@dudousxd/nestjs-durable-dashboard 0.53.0 → 0.54.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.
- package/dist/client/durable-client.d.ts +61 -2
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +17 -0
- package/dist/client/durable-client.js.map +1 -1
- package/dist/client/event-tail.d.ts +25 -0
- package/dist/client/event-tail.d.ts.map +1 -0
- package/dist/client/event-tail.js +30 -0
- package/dist/client/event-tail.js.map +1 -0
- package/dist/server/index.cjs +103 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +49 -2
- package/dist/server/index.d.ts +49 -2
- package/dist/server/index.js +106 -3
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-Db-gqOEF.js → bench-Dee6-QN_.js} +1 -1
- package/dist/spa/assets/index-CJdk28vt.css +1 -0
- package/dist/spa/assets/{index-4tEXGRlA.js → index-RjxbO7dU.js} +1 -1
- package/dist/spa/assets/index-VXNPW483.js +66 -0
- package/dist/spa/assets/{preview-BvCp1zR5.js → preview-BscU9n0o.js} +1 -1
- package/dist/spa/bench.html +3 -3
- package/dist/spa/index.html +3 -3
- package/dist/spa/preview.html +3 -3
- package/package.json +2 -2
- package/dist/spa/assets/index-BbR4CZ1K.css +0 -1
- package/dist/spa/assets/index-CEV7yPmk.js +0 -66
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var VN=Object.defineProperty;var N0=e=>{throw TypeError(e)};var WN=(e,t,n)=>t in e?VN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>WN(e,typeof t!="symbol"?t+"":t,n),Jd=(e,t,n)=>t.has(e)||N0("Cannot "+n);var $=(e,t,n)=>(Jd(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?N0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ee=(e,t,n,r)=>(Jd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(Jd(e,t,"access private method"),n);var Fa=(e,t,n,r)=>({set _(s){ee(e,t,s,n)},get _(){return $(e,t,r)}});function UN(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 Cw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nw={exports:{}},Zu={},Rw={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 va=Symbol.for("react.element"),qN=Symbol.for("react.portal"),KN=Symbol.for("react.fragment"),YN=Symbol.for("react.strict_mode"),GN=Symbol.for("react.profiler"),QN=Symbol.for("react.provider"),XN=Symbol.for("react.context"),ZN=Symbol.for("react.forward_ref"),JN=Symbol.for("react.suspense"),eR=Symbol.for("react.memo"),tR=Symbol.for("react.lazy"),R0=Symbol.iterator;function nR(e){return e===null||typeof e!="object"?null:(e=R0&&e[R0]||e["@@iterator"],typeof e=="function"?e:null)}var Tw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pw=Object.assign,Iw={};function $i(e,t,n){this.props=e,this.context=t,this.refs=Iw,this.updater=n||Tw}$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 jw(){}jw.prototype=$i.prototype;function nm(e,t,n){this.props=e,this.context=t,this.refs=Iw,this.updater=n||Tw}var rm=nm.prototype=new jw;rm.constructor=nm;Pw(rm,$i.prototype);rm.isPureReactComponent=!0;var T0=Array.isArray,_w=Object.prototype.hasOwnProperty,sm={current:null},Ow={key:!0,ref:!0,__self:!0,__source:!0};function Mw(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)_w.call(t,r)&&!Ow.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:va,type:e,key:o,ref:i,props:s,_owner:sm.current}}function rR(e,t){return{$$typeof:va,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function om(e){return typeof e=="object"&&e!==null&&e.$$typeof===va}function sR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var P0=/\/+/g;function ef(e,t){return typeof e=="object"&&e!==null&&e.key!=null?sR(""+e.key):t.toString(36)}function Tc(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 va:case qN:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+ef(i,0):r,T0(s)?(n="",e!=null&&(n=e.replace(P0,"$&/")+"/"),Tc(s,t,n,"",function(c){return c})):s!=null&&(om(s)&&(s=rR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(P0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",T0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+ef(o,l);i+=Tc(o,t,n,a,s)}else if(a=nR(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+ef(o,l++),i+=Tc(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 La(e,t,n){if(e==null)return e;var r=[],s=0;return Tc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function oR(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},Pc={transition:null},iR={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:Pc,ReactCurrentOwner:sm};function Aw(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:La,forEach:function(e,t,n){La(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return La(e,function(){t++}),t},toArray:function(e){return La(e,function(t){return t})||[]},only:function(e){if(!om(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=$i;Ne.Fragment=KN;Ne.Profiler=GN;Ne.PureComponent=nm;Ne.StrictMode=YN;Ne.Suspense=JN;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iR;Ne.act=Aw;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=Pw({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=sm.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)_w.call(t,a)&&!Ow.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:va,type:e.type,key:s,ref:o,props:r,_owner:i}};Ne.createContext=function(e){return e={$$typeof:XN,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:QN,_context:e},e.Consumer=e};Ne.createElement=Mw;Ne.createFactory=function(e){var t=Mw.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:ZN,render:e}};Ne.isValidElement=om;Ne.lazy=function(e){return{$$typeof:tR,_payload:{_status:-1,_result:e},_init:oR}};Ne.memo=function(e,t){return{$$typeof:eR,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Pc.transition;Pc.transition={};try{e()}finally{Pc.transition=t}};Ne.unstable_act=Aw;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";Rw.exports=Ne;var S=Rw.exports;const zw=Cw(S),lR=UN({__proto__:null,default:zw},[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 aR=S,cR=Symbol.for("react.element"),uR=Symbol.for("react.fragment"),dR=Object.prototype.hasOwnProperty,fR=aR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hR={key:!0,ref:!0,__self:!0,__source:!0};function Dw(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)dR.call(t,r)&&!hR.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:cR,type:e,key:o,ref:i,props:s,_owner:fR.current}}Zu.Fragment=uR;Zu.jsx=Dw;Zu.jsxs=Dw;Nw.exports=Zu;var h=Nw.exports;const $w=S.createContext(void 0),po=e=>{const t=S.useContext($w);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j6=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx($w.Provider,{value:e,children:t})),pR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Zr,tm,fw,mR=(fw=class{constructor(){oe(this,Zr,pR);oe(this,tm,!1)}setTimeoutProvider(e){ee(this,Zr,e)}setTimeout(e,t){return $(this,Zr).setTimeout(e,t)}clearTimeout(e){$(this,Zr).clearTimeout(e)}setInterval(e,t){return $(this,Zr).setInterval(e,t)}clearInterval(e){$(this,Zr).clearInterval(e)}},Zr=new WeakMap,tm=new WeakMap,fw);const zs=new mR;function gR(e){setTimeout(e,0)}const xR=typeof window>"u"||"Deno"in globalThis;function Ot(){}function yR(e,t){return typeof e=="function"?e(t):e}function Fw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Lw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tt(e,t){return typeof e=="function"?e(t):e}function I0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==im(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 j0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(no(t.options.mutationKey)!==no(o))return!1}else if(!xi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function im(e,t){return((t==null?void 0:t.queryKeyHashFn)||no)(e)}function no(e){return JSON.stringify(e,(t,n)=>nh(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 vR=Object.prototype.hasOwnProperty;function lm(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=_0(e)&&_0(t);if(!r&&!(nh(e)&&nh(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],d=e[u],f=t[u];if(d===f){l[u]=d,(r?c<s:vR.call(e,u))&&a++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){l[u]=f;continue}const p=lm(d,f,n+1);l[u]=p,p===d&&a++}return s===i&&a===s?e:l}function gl(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 _0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nh(e){if(!O0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!O0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function O0(e){return Object.prototype.toString.call(e)==="[object Object]"}function wR(e){return new Promise(t=>{zs.setTimeout(t,e)})}function rh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lm(e,t):t}function bR(e){return e}function SR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ER(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const am=Symbol();function Hw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cm(e,t){return typeof e=="function"?e(...t):!!e}function kR(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 CR=()=>xR;const um=()=>CR();var mo=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(){}},Hs,Jr,ni,hw,NR=(hw=class extends mo{constructor(){super();oe(this,Hs);oe(this,Jr);oe(this,ni);ee(this,ni,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,Jr)||this.setEventListener($(this,ni))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,Jr))==null||t.call(this),ee(this,Jr,void 0))}setEventListener(t){var n;ee(this,ni,t),(n=$(this,Jr))==null||n.call(this),ee(this,Jr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,Hs)!==t&&(ee(this,Hs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Hs)=="boolean"?$(this,Hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hs=new WeakMap,Jr=new WeakMap,ni=new WeakMap,hw);const dm=new NR,RR=gR;function TR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=RR;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=TR();var ri,es,si,pw,PR=(pw=class extends mo{constructor(){super();oe(this,ri,!0);oe(this,es);oe(this,si);ee(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(){$(this,es)||this.setEventListener($(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,es))==null||t.call(this),ee(this,es,void 0))}setEventListener(t){var n;ee(this,si,t),(n=$(this,es))==null||n.call(this),ee(this,es,t(this.setOnline.bind(this)))}setOnline(t){$(this,ri)!==t&&(ee(this,ri,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return $(this,ri)}},ri=new WeakMap,es=new WeakMap,si=new WeakMap,pw);const Gc=new PR;function IR(e){return Math.min(1e3*2**e,3e4)}function Bw(e){return(e??"online")==="online"?Gc.isOnline():!0}var sh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vw(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 sh(m);v(w),(y=e.onCancel)==null||y.call(e,w)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>dm.isFocused()&&(e.networkMode==="always"||Gc.isOnline())&&e.canRun(),p=()=>Bw(e.networkMode)&&e.canRun(),x=m=>{a()||(r==null||r(),s="resolved",o(m))},v=m=>{a()||(r==null||r(),s="rejected",i(m))},b=()=>new Promise(m=>{var y;r=w=>{(a()||f())&&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(x).catch(w=>{var P;if(a())return;const E=e.retry??(um()?0:3),N=e.retryDelay??IR,k=typeof N=="function"?N(n,w):N,C=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,w);if(t||!C){v(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),wR(k).then(()=>f()?void 0:b()).then(()=>{t?v(w):g()})})};return{promise:l,status:()=>s,cancel:c,continue:()=>(r==null||r(),l),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?g():b().then(g),l)}}var Bs,mw,Ww=(mw=class{constructor(){oe(this,Bs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fw(this.gcTime)&&ee(this,Bs,zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(um()?1/0:3e5))}clearGcTimeout(){$(this,Bs)!==void 0&&(zs.clearTimeout($(this,Bs)),ee(this,Bs,void 0))}},Bs=new WeakMap,mw);function jR(e){return{onFetch:(t,n)=>{var u,d,f,p,x;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let v=!1;const b=y=>{kR(y,()=>t.signal,()=>v=!0)},g=Hw(t.options,t.fetchOptions),m=async(y,w,E)=>{if(v)return Promise.reject(t.signal.reason);if(w==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};return b(A),A})(),C=await g(k),{maxPages:P}=t.options,j=E?ER:SR;return{pages:j(y.pages,C,P),pageParams:j(y.pageParams,w,P)}};if(s&&o.length){const y=s==="backward",w=y?Uw:oh,E={pages:o,pageParams:i};l=await m(E,w(r,E),y)}else{const y=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:oh(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 v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function oh(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 Uw(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 _R(e,t){return t?oh(e,t)!=null:!1}function OR(e,t){return!t||!e.getPreviousPageParam?!1:Uw(e,t)!=null}var oi,Vs,ii,xn,Ws,ht,ua,Us,On,fr,gw,MR=(gw=class extends Ww{constructor(t){super();oe(this,On);oe(this,oi);oe(this,Vs);oe(this,ii);oe(this,xn);oe(this,Ws);oe(this,ht);oe(this,ua);oe(this,Us);ee(this,Us,!1),ee(this,ua,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,Ws,t.client),ee(this,xn,$(this,Ws).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Vs,A0(this.options)),this.state=t.state??$(this,Vs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return $(this,oi)}get promise(){var t;return(t=$(this,ht))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,ua),...t},t!=null&&t._type&&ee(this,oi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=A0(this.options);n.data!==void 0&&(this.setState(M0(n.data,n.dataUpdatedAt)),ee(this,Vs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,xn).remove(this)}setData(t,n){const r=rh(this.state.data,t,this.options);return pe(this,On,fr).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,On,fr).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=$(this,ht))==null?void 0:r.promise;return(s=$(this,ht))==null||s.cancel(t),n?n.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return $(this,Vs)}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===am||!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:!Lw(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=$(this,ht))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=$(this,ht))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,xn).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||($(this,ht)&&($(this,Us)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?$(this,ht).cancel({revert:!0}):$(this,ht).cancelRetry()),this.scheduleGc()),$(this,xn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,On,fr).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,f,p,x,v,b,g,m,y,w;if(this.state.fetchStatus!=="idle"&&((c=$(this,ht))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,ht))return $(this,ht).continueRetry(),$(this,ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(ee(this,Us,!0),r.signal)})},o=()=>{const E=Hw(this.options,n),k=(()=>{const C={client:$(this,Ws),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,Us,!1),this.options.persister?this.options.persister(E,k,this):E(k)},l=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Ws),state:this.state,fetchFn:o};return s(E),E})();(u=$(this,oi)==="infinite"?jR(this.options.pages):this.options.behavior)==null||u.onFetch(l,this),ee(this,ii,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&pe(this,On,fr).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const a=ee(this,ht,Vw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof sh&&E.revert&&this.setState({...$(this,ii),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{pe(this,On,fr).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{pe(this,On,fr).call(this,{type:"pause"})},onContinue:()=>{pe(this,On,fr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const E=await a.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(p=$(this,xn).config).onSuccess)==null||x.call(p,E,this),(b=(v=$(this,xn).config).onSettled)==null||b.call(v,E,this.state.error,this),E}catch(E){if(E instanceof sh){if(E.silent)return $(this,ht).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw pe(this,On,fr).call(this,{type:"error",error:E}),(m=(g=$(this,xn).config).onError)==null||m.call(g,E,this),(w=(y=$(this,xn).config).onSettled)==null||w.call(y,this.state.data,E,this),E}finally{$(this,ht)===a&&ee(this,ht,void 0),this.scheduleGc()}}},oi=new WeakMap,Vs=new WeakMap,ii=new WeakMap,xn=new WeakMap,Ws=new WeakMap,ht=new WeakMap,ua=new WeakMap,Us=new WeakMap,On=new WeakSet,fr=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,...M0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(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()}),$(this,xn).notify({query:this,type:"updated",action:t})})},gw);function qw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function M0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function A0(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,da,$t,qs,li,xr,fa,ai,ci,Ks,Ys,ts,ui,$e,ll,ih,lh,ah,ch,uh,dh,fh,hh,xw,Ju=(xw=class extends mo{constructor(t,n){super();oe(this,$e);oe(this,Dt);oe(this,Te);oe(this,da);oe(this,$t);oe(this,qs);oe(this,li);oe(this,xr);oe(this,fa);oe(this,ai);oe(this,ci);oe(this,Ks);oe(this,Ys);oe(this,ts);oe(this,ui,new Set);this.options=n,ee(this,Dt,t),ee(this,xr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,Te).addObserver(this),z0($(this,Te),this.options)?pe(this,$e,ll).call(this):this.updateResult(),pe(this,$e,uh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ph($(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ph($(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,$e,dh).call(this),pe(this,$e,fh).call(this),$(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=$(this,Te);if(this.options=$(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,$(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,$e,hh).call(this),$(this,Te).setOptions(this.options),n._defaulted&&!gl(this.options,n)&&$(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,Te),observer:this});const s=this.hasListeners();s&&D0($(this,Te),r,this.options,n)&&pe(this,$e,ll).call(this),this.updateResult(),s&&($(this,Te)!==r||tt(this.options.enabled,$(this,Te))!==tt(n.enabled,$(this,Te))||tt(this.options.staleTime,$(this,Te))!==tt(n.staleTime,$(this,Te)))&&pe(this,$e,lh).call(this);const o=pe(this,$e,ah).call(this);s&&($(this,Te)!==r||tt(this.options.enabled,$(this,Te))!==tt(n.enabled,$(this,Te))||o!==$(this,ts))&&pe(this,$e,ch).call(this,o)}getOptimisticResult(t){const n=$(this,Dt).getQueryCache().build($(this,Dt),t),r=this.createResult(n,t);return gl(this.getCurrentResult(),r)||(ee(this,$t,r),ee(this,li,this.options),ee(this,qs,$(this,Te).state)),r}getCurrentResult(){return $(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){$(this,ui).add(t)}getCurrentQuery(){return $(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,Dt).defaultQueryOptions(t),r=$(this,Dt).getQueryCache().build($(this,Dt),n);let s=()=>{},o;const i=new Promise(l=>{o=l,s=$(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,$e,ll).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,$t)))}createResult(t,n){var N;const r=$(this,Te),s=this.options,o=$(this,$t),i=$(this,qs),l=$(this,li),a=t!==r?t.state:$(this,da),{state:c}=t;let u={...c},d=!1,f;if(n._optimisticResults){const k=this.hasListeners(),C=!k&&z0(t,n),P=k&&D0(t,r,n,s);(C||P)&&(u={...u,...qw(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:x,status:v}=u;f=u.data;let b=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(k=o.data,b=!0):k=typeof n.placeholderData=="function"?n.placeholderData((N=$(this,ci))==null?void 0:N.state.data,$(this,ci)):n.placeholderData,k!==void 0&&(v="success",f=rh(o==null?void 0:o.data,k,n),d=!0)}if(n.select&&f!==void 0&&!b)if(o&&f===(i==null?void 0:i.data)&&n.select===$(this,fa))f=$(this,ai);else try{ee(this,fa,n.select),f=n.select(f),f=rh(o==null?void 0:o.data,f,n),ee(this,ai,f),ee(this,xr,null)}catch(k){ee(this,xr,k)}else f===void 0&&ee(this,xr,null);$(this,xr)&&(p=$(this,xr),f=$(this,ai),x=Date.now(),v="error",d=!1);const g=u.fetchStatus==="fetching",m=v==="pending",y=v==="error",w=m&&g,E=f!==void 0;return{status:v,fetchStatus:u.fetchStatus,isPending:m,isSuccess:v==="success",isError:y,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:x,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&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:fm(t,n),refetch:this.refetch,isEnabled:tt(n.enabled,t)!==!1}}updateResult(){const t=$(this,$t),n=this.createResult($(this,Te),this.options);if(ee(this,qs,$(this,Te).state),ee(this,li,this.options),$(this,qs).data!==void 0&&ee(this,ci,$(this,Te)),gl(n,t))return;ee(this,$t,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!$(this,ui).size)return!0;const l=new Set(i??$(this,ui));return this.options.throwOnError&&l.add("error"),Object.keys($(this,$t)).some(a=>{const c=a;return $(this,$t)[c]!==t[c]&&l.has(c)})})();rt.batch(()=>{s&&this.listeners.forEach(o=>{o($(this,$t))}),$(this,Dt).getQueryCache().notify({query:$(this,Te),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,$e,uh).call(this)}},Dt=new WeakMap,Te=new WeakMap,da=new WeakMap,$t=new WeakMap,qs=new WeakMap,li=new WeakMap,xr=new WeakMap,fa=new WeakMap,ai=new WeakMap,ci=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,ts=new WeakMap,ui=new WeakMap,$e=new WeakSet,ll=function(t){pe(this,$e,hh).call(this);let n=$(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ot)),n},ih=function(t){return!um()&&tt(this.options.enabled,$(this,Te))!==!1&&Fw(t)},lh=function(){pe(this,$e,dh).call(this);const t=tt(this.options.staleTime,$(this,Te));if($(this,$t).isStale||!pe(this,$e,ih).call(this,t))return;const n=Lw($(this,$t).dataUpdatedAt,t)+1;ee(this,Ks,zs.setTimeout(()=>{$(this,$t).isStale||this.updateResult()},n))},ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,Te)):this.options.refetchInterval)??!1},ch=function(t){pe(this,$e,fh).call(this),ee(this,ts,t),!($(this,ts)===0||!pe(this,$e,ih).call(this,$(this,ts)))&&ee(this,Ys,zs.setInterval(()=>{(this.options.refetchIntervalInBackground||dm.isFocused())&&pe(this,$e,ll).call(this)},$(this,ts)))},uh=function(){pe(this,$e,lh).call(this),pe(this,$e,ch).call(this,pe(this,$e,ah).call(this))},dh=function(){$(this,Ks)!==void 0&&(zs.clearTimeout($(this,Ks)),ee(this,Ks,void 0))},fh=function(){$(this,Ys)!==void 0&&(zs.clearInterval($(this,Ys)),ee(this,Ys,void 0))},hh=function(){const t=$(this,Dt).getQueryCache().build($(this,Dt),this.options);if(t===$(this,Te))return;const n=$(this,Te);ee(this,Te,t),ee(this,da,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xw);function AR(e,t){return tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&tt(t.retryOnMount,e)===!1)}function z0(e,t){return AR(e,t)||e.state.data!==void 0&&ph(e,t,t.refetchOnMount)}function ph(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&&fm(e,t)}return!1}function D0(e,t,n,r){return(e!==t||tt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fm(e,n)}function fm(e,t){return tt(t.enabled,e)!==!1&&e.isStaleByTime(tt(t.staleTime,e))}var zR=class extends Ju{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,x;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(x=(p=n.fetchMeta)==null?void 0:p.fetchMore)==null?void 0:x.direction,c=i&&a==="forward",u=s&&a==="forward",d=i&&a==="backward",f=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:_R(t,n.data),hasPreviousPage:OR(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:l&&!c&&!d,isRefetching:o&&!u&&!f}}},ha,Xn,jt,Gs,Zn,Ur,yw,DR=(yw=class extends Ww{constructor(t){super();oe(this,Zn);oe(this,ha);oe(this,Xn);oe(this,jt);oe(this,Gs);ee(this,ha,t.client),this.mutationId=t.mutationId,ee(this,jt,t.mutationCache),ee(this,Xn,[]),this.state=t.state||Kw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,Xn).includes(t)||($(this,Xn).push(t),this.clearGcTimeout(),$(this,jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,Xn,$(this,Xn).filter(n=>n!==t)),this.scheduleGc(),$(this,jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,Xn).length||(this.state.status==="pending"?this.scheduleGc():$(this,jt).remove(this))}continue(){var t;return((t=$(this,Gs))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,a,c,u,d,f,p,x,v,b,g,m,y,w,E,N,k,C;const n=()=>{pe(this,Zn,Ur).call(this,{type:"continue"})},r={client:$(this,ha),meta:this.options.meta,mutationKey:this.options.mutationKey},s=ee(this,Gs,Vw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,j)=>{pe(this,Zn,Ur).call(this,{type:"failed",failureCount:P,error:j})},onPause:()=>{pe(this,Zn,Ur).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,jt).canRun(this)})),o=this.state.status==="pending",i=!s.canStart();try{if(o)n();else{pe(this,Zn,Ur).call(this,{type:"pending",variables:t,isPaused:i}),$(this,jt).config.onMutate&&await $(this,jt).config.onMutate(t,this,r);const j=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));j!==this.state.context&&pe(this,Zn,Ur).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const P=await s.start();return await((u=(c=$(this,jt).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,P,t,this.state.context,r)),await((x=(p=$(this,jt).config).onSettled)==null?void 0:x.call(p,P,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,P,null,t,this.state.context,r)),pe(this,Zn,Ur).call(this,{type:"success",data:P}),P}catch(P){try{await((m=(g=$(this,jt).config).onError)==null?void 0:m.call(g,P,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((w=(y=this.options).onError)==null?void 0:w.call(y,P,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((N=(E=$(this,jt).config).onSettled)==null?void 0:N.call(E,void 0,P,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,P,t,this.state.context,r))}catch(j){Promise.reject(j)}throw pe(this,Zn,Ur).call(this,{type:"error",error:P}),P}finally{$(this,Gs)===s&&ee(this,Gs,void 0),$(this,jt).runNext(this)}}},ha=new WeakMap,Xn=new WeakMap,jt=new WeakMap,Gs=new WeakMap,Zn=new WeakSet,Ur=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(()=>{$(this,Xn).forEach(r=>{r.onMutationUpdate(t)}),$(this,jt).notify({mutation:this,type:"updated",action:t})})},yw);function Kw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yr,Mn,pa,vw,$R=(vw=class extends mo{constructor(t={}){super();oe(this,yr);oe(this,Mn);oe(this,pa);this.config=t,ee(this,yr,new Set),ee(this,Mn,new Map),ee(this,pa,0)}build(t,n,r){const s=new DR({client:t,mutationCache:this,mutationId:++Fa(this,pa)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){$(this,yr).add(t);const n=Ha(t);if(typeof n=="string"){const r=$(this,Mn).get(n);r?r.push(t):$(this,Mn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,yr).delete(t)){const n=Ha(t);if(typeof n=="string"){const r=$(this,Mn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&$(this,Mn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=Ha(t);if(typeof n=="string"){const s=(r=$(this,Mn).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=Ha(t);return typeof n=="string"?((s=(r=$(this,Mn).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(()=>{$(this,yr).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,yr).clear(),$(this,Mn).clear()})}getAll(){return Array.from($(this,yr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>j0(n,r))}findAll(t={}){return this.getAll().filter(n=>j0(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))))}},yr=new WeakMap,Mn=new WeakMap,pa=new WeakMap,vw);function Ha(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vr,ns,_t,wr,nr,al,mh,ww,FR=(ww=class extends mo{constructor(n,r){super();oe(this,nr);oe(this,vr);oe(this,ns);oe(this,_t);oe(this,wr);ee(this,vr,n),this.setOptions(r),this.bindMethods(),pe(this,nr,al).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=$(this,vr).defaultMutationOptions(n),gl(this.options,r)||$(this,vr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,_t),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&no(r.mutationKey)!==no(this.options.mutationKey)?this.reset():((s=$(this,_t))==null?void 0:s.state.status)==="pending"&&$(this,_t).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&$(this,_t)&&($(this,_t).addObserver(this),pe(this,nr,al).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,_t))==null||n.removeObserver(this)}onMutationUpdate(n){pe(this,nr,al).call(this),pe(this,nr,mh).call(this,n)}getCurrentResult(){return $(this,ns)}reset(){var n;(n=$(this,_t))==null||n.removeObserver(this),ee(this,_t,void 0),pe(this,nr,al).call(this),pe(this,nr,mh).call(this)}mutate(n,r){var s;return ee(this,wr,r),(s=$(this,_t))==null||s.removeObserver(this),ee(this,_t,$(this,vr).getMutationCache().build($(this,vr),this.options)),$(this,_t).addObserver(this),$(this,_t).execute(n)}},vr=new WeakMap,ns=new WeakMap,_t=new WeakMap,wr=new WeakMap,nr=new WeakSet,al=function(){var r;const n=((r=$(this,_t))==null?void 0:r.state)??Kw();ee(this,ns,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mh=function(n){rt.batch(()=>{var r,s,o,i,l,a,c,u;if($(this,wr)&&this.hasListeners()){const d=$(this,ns).variables,f=$(this,ns).context,p={client:$(this,vr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=$(this,wr)).onSuccess)==null||s.call(r,n.data,d,f,p)}catch(x){Promise.reject(x)}try{(i=(o=$(this,wr)).onSettled)==null||i.call(o,n.data,null,d,f,p)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=$(this,wr)).onError)==null||a.call(l,n.error,d,f,p)}catch(x){Promise.reject(x)}try{(u=(c=$(this,wr)).onSettled)==null||u.call(c,void 0,n.error,d,f,p)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d($(this,ns))})})},ww);function $0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}var di,Ft,fi,Qs,sn,Xs,ma,ga,xa,ya,gt,gh,xh,Yw,yh,vh,wh,bw,LR=(bw=class extends mo{constructor(t,n,r){super();oe(this,gt);oe(this,di);oe(this,Ft);oe(this,fi);oe(this,Qs);oe(this,sn);oe(this,Xs);oe(this,ma);oe(this,ga);oe(this,xa);oe(this,ya,[]);ee(this,di,t),ee(this,Qs,r),ee(this,fi,[]),ee(this,sn,[]),ee(this,Ft,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&$(this,sn).forEach(t=>{t.subscribe(n=>{pe(this,gt,vh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,$(this,sn).forEach(t=>{t.destroy()})}setQueries(t,n){ee(this,fi,t),ee(this,Qs,n),rt.batch(()=>{const r=$(this,sn),s=pe(this,gt,yh).call(this,$(this,fi));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const o=s.map(d=>d.observer),i=o.map(d=>d.getCurrentResult()),l=r.length!==o.length,a=o.some((d,f)=>d!==r[f]),c=l||a,u=c?!0:i.some((d,f)=>{const p=$(this,Ft)[f];return!p||!gl(d,p)});!c&&!u||(c&&(ee(this,ya,s),ee(this,sn,o)),ee(this,Ft,i),this.hasListeners()&&(c&&($0(r,o).forEach(d=>{d.destroy()}),$0(o,r).forEach(d=>{d.subscribe(f=>{pe(this,gt,vh).call(this,d,f)})})),pe(this,gt,wh).call(this)))})}getCurrentResult(){return $(this,Ft)}getQueries(){return $(this,sn).map(t=>t.getCurrentQuery())}getObservers(){return $(this,sn)}getOptimisticResult(t,n){const r=pe(this,gt,yh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>pe(this,gt,xh).call(this,i??s,n,o),()=>pe(this,gt,gh).call(this,s,r)]}},di=new WeakMap,Ft=new WeakMap,fi=new WeakMap,Qs=new WeakMap,sn=new WeakMap,Xs=new WeakMap,ma=new WeakMap,ga=new WeakMap,xa=new WeakMap,ya=new WeakMap,gt=new WeakSet,gh=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)}))})})},xh=function(t,n,r){if(n){const s=$(this,xa),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return($(this,Ft)!==$(this,ga)||o||n!==$(this,ma))&&(ee(this,ma,n),ee(this,ga,$(this,Ft)),r!==void 0&&ee(this,xa,r),ee(this,Xs,lm($(this,Xs),n(t)))),$(this,Xs)}return t},Yw=function(){var t;return!((t=$(this,Qs))!=null&&t.combine)||$(this,sn).some((n,r)=>{var s;return n.options.suspense&&((s=$(this,Ft)[r])==null?void 0:s.data)===void 0})},yh=function(t){const n=new Map;$(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=$(this,di).defaultQueryOptions(s),i=((l=n.get(o.queryHash))==null?void 0:l.shift())??new Ju($(this,di),o);r.push({defaultedQueryOptions:o,observer:i})}),r},vh=function(t,n){const r=$(this,sn).indexOf(t);r!==-1&&(ee(this,Ft,$(this,Ft).slice()),$(this,Ft)[r]=n,pe(this,gt,wh).call(this))},wh=function(){var t;if(this.hasListeners()){const n=pe(this,gt,Yw).call(this),r=$(this,Xs),s=n?r:pe(this,gt,xh).call(this,pe(this,gt,gh).call(this,$(this,Ft),$(this,ya)),(t=$(this,Qs))==null?void 0:t.combine);(n||r!==s)&&rt.batch(()=>{this.listeners.forEach(o=>{o($(this,Ft))})})}},bw),Jn,Sw,HR=(Sw=class extends mo{constructor(t={}){super();oe(this,Jn);this.config=t,ee(this,Jn,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??im(s,n);let i=this.get(o);return i||(i=new MR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){$(this,Jn).has(t.queryHash)||($(this,Jn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,Jn).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,Jn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,Jn).get(t)}getAll(){return[...$(this,Jn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>I0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>I0(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()})})}},Jn=new WeakMap,Sw),Ge,rs,ss,hi,pi,os,mi,gi,Ew,O6=(Ew=class{constructor(e={}){oe(this,Ge);oe(this,rs);oe(this,ss);oe(this,hi);oe(this,pi);oe(this,os);oe(this,mi);oe(this,gi);ee(this,Ge,e.queryCache||new HR),ee(this,rs,e.mutationCache||new $R),ee(this,ss,e.defaultOptions||{}),ee(this,hi,new Map),ee(this,pi,new Map),ee(this,os,0)}mount(){Fa(this,os)._++,$(this,os)===1&&(ee(this,mi,dm.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,Ge).onFocus())})),ee(this,gi,Gc.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,Ge).onOnline())})))}unmount(){var e,t;Fa(this,os)._--,$(this,os)===0&&((e=$(this,mi))==null||e.call(this),ee(this,mi,void 0),(t=$(this,gi))==null||t.call(this),ee(this,gi,void 0))}isFetching(e){return $(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,rs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(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 $(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=$(this,Ge).get(r.queryHash))==null?void 0:i.state.data,o=yR(t,s);if(o!==void 0)return $(this,Ge).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>$(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=$(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,Ge);rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(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(()=>$(this,Ge).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ot).catch(Ot)}invalidateQueries(e,t={}){return rt.batch(()=>($(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(()=>$(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=$(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=$(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 Gc.isOnline()?$(this,rs).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,Ge)}getMutationCache(){return $(this,rs)}getDefaultOptions(){return $(this,ss)}setDefaultOptions(e){ee(this,ss,e)}setQueryDefaults(e,t){$(this,hi).set(no(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,hi).values()],n={};return t.forEach(r=>{xi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,pi).set(no(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(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={...$(this,ss).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=im(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===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,ss).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,Ge).clear(),$(this,rs).clear()}},Ge=new WeakMap,rs=new WeakMap,ss=new WeakMap,hi=new WeakMap,pi=new WeakMap,os=new WeakMap,mi=new WeakMap,gi=new WeakMap,Ew);const Gw=S.createContext(!1),Qw=()=>S.useContext(Gw);Gw.Provider;function BR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const VR=S.createContext(BR()),Xw=()=>S.useContext(VR),Zw=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?cm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Jw=e=>{S.useEffect(()=>{e.clearReset()},[e])},eb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||cm(n,[e.error,r])),tb=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))}},bh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function hm({queries:e,...t},n){const r=po(),s=Qw(),o=Xw(),i=t.subscribed!==!1,l=S.useMemo(()=>e.map(v=>{const b=r.defaultQueryOptions(v);return b._optimisticResults=s?"isRestoring":i?"optimistic":void 0,b}),[e,r,s,i]);l.forEach(v=>{tb(v);const b=r.getQueryCache().get(v.queryHash);Zw(v,o,b)}),Jw(o);const[a]=S.useState(()=>new LR(r,l,t)),[c,u,d]=a.getOptimisticResult(l,t.combine),f=!s&&i;S.useSyncExternalStore(S.useCallback(v=>f?a.subscribe(rt.batchCalls(v)):Ot,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const p=c.some((v,b)=>bh(l[b],v))?c.flatMap((v,b)=>{const g=l[b];if(g&&bh(g,v)){const m=new Ju(r,g);return nb(g,m,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const x=c.find((v,b)=>{const g=l[b];return g&&eb({result:v,errorResetBoundary:o,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(x)throw x.error;return u(d())}function rb(e,t,n){const r=Qw(),s=Xw(),o=po(),i=o.defaultQueryOptions(e),l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,tb(i),Zw(i,s,l),Jw(s);const[c]=S.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),d=!r&&a;if(S.useSyncExternalStore(S.useCallback(f=>{const p=d?c.subscribe(rt.batchCalls(f)):Ot;return c.updateResult(),p},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(i)},[i,c]),bh(i,u))throw nb(i,c,s);if(eb({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw u.error;return i.notifyOnChangeProps?u:c.trackResult(u)}function Zt(e,t){return rb(e,Ju)}function pr(e,t){const n=po(),[r]=S.useState(()=>new FR(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&&cm(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function WR(e,t){return rb(e,zR)}var sb={exports:{}},pn={},ob={exports:{}},ib={};/**
|
|
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 O=T.length;T.push(M);e:for(;0<O;){var V=O-1>>>1,H=T[V];if(0<s(H,M))T[V]=M,T[O]=H,O=V;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],O=T.pop();if(O!==M){T[0]=O;e:for(var V=0,H=T.length,K=H>>>1;V<K;){var W=2*(V+1)-1,U=T[W],L=W+1,Q=T[L];if(0>s(U,O))L<H&&0>s(Q,U)?(T[V]=Q,T[L]=O,V=L):(T[V]=U,T[W]=O,V=W);else if(L<H&&0>s(Q,O))T[V]=Q,T[L]=O,V=L;else break e}}return M}function s(T,M){var O=T.sortIndex-M.sortIndex;return O!==0?O: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,d=null,f=3,p=!1,x=!1,v=!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(v=!1,y(T),!x)if(n(a)!==null)x=!0,_(E);else{var M=n(c);M!==null&&F(w,M.startTime-T)}}function E(T,M){x=!1,v&&(v=!1,g(C),C=-1),p=!0;var O=f;try{for(y(M),d=n(a);d!==null&&(!(d.expirationTime>M)||T&&!A());){var V=d.callback;if(typeof V=="function"){d.callback=null,f=d.priorityLevel;var H=V(d.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),y(M)}else r(a);d=n(a)}if(d!==null)var K=!0;else{var W=n(c);W!==null&&F(w,W.startTime-M),K=!1}return K}finally{d=null,f=O,p=!1}}var N=!1,k=null,C=-1,P=5,j=-1;function A(){return!(e.unstable_now()-j<P)}function D(){if(k!==null){var T=e.unstable_now();j=T;var M=!0;try{M=k(!0,T)}finally{M?z():(N=!1,k=null)}}else N=!1}var z;if(typeof m=="function")z=function(){m(D)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,I=R.port2;R.port1.onmessage=D,z=function(){I.postMessage(null)}}else z=function(){b(D,0)};function _(T){k=T,N||(N=!0,z())}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(){x||p||(x=!0,_(E))},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 f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var O=f;f=M;try{return T()}finally{f=O}},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 O=f;f=T;try{return M()}finally{f=O}},e.unstable_scheduleCallback=function(T,M,O){var V=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?V+O:V):O=V,T){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=O+H,T={id:u++,callback:M,priorityLevel:T,startTime:O,expirationTime:H,sortIndex:-1},O>V?(T.sortIndex=O,t(c,T),n(a)===null&&T===n(c)&&(v?(g(C),C=-1):v=!0,F(w,O-V))):(T.sortIndex=H,t(a,T),x||p||(x=!0,_(E))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var M=f;return function(){var O=f;f=M;try{return T.apply(this,arguments)}finally{f=O}}}})(ib);ob.exports=ib;var UR=ob.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 qR=S,un=UR;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 lb=new Set,jl={};function go(e,t){yi(e,t),yi(e+"Capture",t)}function yi(e,t){for(jl[e]=t,e=0;e<t.length;e++)lb.add(t[e])}var Pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=Object.prototype.hasOwnProperty,KR=/^[: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]*$/,F0={},L0={};function YR(e){return Sh.call(L0,e)?!0:Sh.call(F0,e)?!1:KR.test(e)?L0[e]=!0:(F0[e]=!0,!1)}function GR(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 QR(e,t,n,r){if(t===null||typeof t>"u"||GR(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 pm=/[\-:]([a-z])/g;function mm(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(pm,mm);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(pm,mm);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(pm,mm);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 gm(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")&&(QR(t,n,s,r)&&(n=null),r||s===null?YR(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 zr=qR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ba=Symbol.for("react.element"),jo=Symbol.for("react.portal"),_o=Symbol.for("react.fragment"),xm=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),ab=Symbol.for("react.provider"),cb=Symbol.for("react.context"),ym=Symbol.for("react.forward_ref"),kh=Symbol.for("react.suspense"),Ch=Symbol.for("react.suspense_list"),vm=Symbol.for("react.memo"),qr=Symbol.for("react.lazy"),ub=Symbol.for("react.offscreen"),H0=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=H0&&e[H0]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,tf;function cl(e){if(tf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);tf=t&&t[1]||""}return`
|
|
34
|
+
`+tf+e}var nf=!1;function rf(e,t){if(!e||nf)return"";nf=!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{nf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cl(e):""}function XR(e){switch(e.tag){case 5:return cl(e.type);case 16:return cl("Lazy");case 13:return cl("Suspense");case 19:return cl("SuspenseList");case 0:case 2:case 15:return e=rf(e.type,!1),e;case 11:return e=rf(e.type.render,!1),e;case 1:return e=rf(e.type,!0),e;default:return""}}function Nh(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 _o:return"Fragment";case jo:return"Portal";case Eh:return"Profiler";case xm:return"StrictMode";case kh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cb:return(e.displayName||"Context")+".Consumer";case ab:return(e._context.displayName||"Context")+".Provider";case ym:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vm:return t=e.displayName||null,t!==null?t:Nh(e.type)||"Memo";case qr:t=e._payload,e=e._init;try{return Nh(e(t))}catch{}}return null}function ZR(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 Nh(t);case 8:return t===xm?"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 vs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function db(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function JR(e){var t=db(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 Va(e){e._valueTracker||(e._valueTracker=JR(e))}function fb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=db(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qc(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 Rh(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function B0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vs(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 hb(e,t){t=t.checked,t!=null&&gm(e,"checked",t,!1)}function Th(e,t){hb(e,t);var n=vs(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")?Ph(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ph(e,t.type,vs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function V0(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 Ph(e,t,n){(t!=="number"||Qc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ul=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=""+vs(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 Ih(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function W0(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(ul(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vs(n)}}function pb(e,t){var n=vs(t.value),r=vs(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 U0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mb(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 jh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wa,gb=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(Wa=Wa||document.createElement("div"),Wa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wa.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 xl={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},eT=["Webkit","ms","Moz","O"];Object.keys(xl).forEach(function(e){eT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xl[t]=xl[e]})});function xb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xl.hasOwnProperty(e)&&xl[e]?(""+t).trim():t+"px"}function yb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=xb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var tT=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(tT[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 Oh(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 Mh=null;function wm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ah=null,Ko=null,Yo=null;function q0(e){if(e=Sa(e)){if(typeof Ah!="function")throw Error(J(280));var t=e.stateNode;t&&(t=sd(t),Ah(e.stateNode,e.type,t))}}function vb(e){Ko?Yo?Yo.push(e):Yo=[e]:Ko=e}function wb(){if(Ko){var e=Ko,t=Yo;if(Yo=Ko=null,q0(e),t)for(e=0;e<t.length;e++)q0(t[e])}}function bb(e,t){return e(t)}function Sb(){}var sf=!1;function Eb(e,t,n){if(sf)return e(t,n);sf=!0;try{return bb(e,t,n)}finally{sf=!1,(Ko!==null||Yo!==null)&&(Sb(),wb())}}function Ol(e,t){var n=e.stateNode;if(n===null)return null;var r=sd(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 zh=!1;if(Pr)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){zh=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{zh=!1}function nT(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 yl=!1,Xc=null,Zc=!1,Dh=null,rT={onError:function(e){yl=!0,Xc=e}};function sT(e,t,n,r,s,o,i,l,a){yl=!1,Xc=null,nT.apply(rT,arguments)}function oT(e,t,n,r,s,o,i,l,a){if(sT.apply(this,arguments),yl){if(yl){var c=Xc;yl=!1,Xc=null}else throw Error(J(198));Zc||(Zc=!0,Dh=c)}}function xo(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 kb(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 K0(e){if(xo(e)!==e)throw Error(J(188))}function iT(e){var t=e.alternate;if(!t){if(t=xo(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 K0(s),e;if(o===r)return K0(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 Cb(e){return e=iT(e),e!==null?Nb(e):null}function Nb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nb(e);if(t!==null)return t;e=e.sibling}return null}var Rb=un.unstable_scheduleCallback,Y0=un.unstable_cancelCallback,lT=un.unstable_shouldYield,aT=un.unstable_requestPaint,lt=un.unstable_now,cT=un.unstable_getCurrentPriorityLevel,bm=un.unstable_ImmediatePriority,Tb=un.unstable_UserBlockingPriority,Jc=un.unstable_NormalPriority,uT=un.unstable_LowPriority,Pb=un.unstable_IdlePriority,ed=null,rr=null;function dT(e){if(rr&&typeof rr.onCommitFiberRoot=="function")try{rr.onCommitFiberRoot(ed,e,void 0,(e.current.flags&128)===128)}catch{}}var Ln=Math.clz32?Math.clz32:pT,fT=Math.log,hT=Math.LN2;function pT(e){return e>>>=0,e===0?32:31-(fT(e)/hT|0)|0}var Ua=64,qa=4194304;function dl(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 eu(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=dl(l):(o&=i,o!==0&&(r=dl(o)))}else i=n&~s,i!==0?r=dl(i):o!==0&&(r=dl(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-Ln(t),s=1<<n,r|=e[n],t&=~s;return r}function mT(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 gT(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Ln(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=mT(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function $h(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ib(){var e=Ua;return Ua<<=1,!(Ua&4194240)&&(Ua=64),e}function of(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ln(t),e[t]=n}function xT(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-Ln(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Sm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ln(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var He=0;function jb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var _b,Em,Ob,Mb,Ab,Fh=!1,Ka=[],cs=null,us=null,ds=null,Ml=new Map,Al=new Map,Gr=[],yT="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 G0(e,t){switch(e){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":Ml.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.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=Sa(t),t!==null&&Em(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function vT(e,t,n,r,s){switch(t){case"focusin":return cs=Gi(cs,e,t,n,r,s),!0;case"dragenter":return us=Gi(us,e,t,n,r,s),!0;case"mouseover":return ds=Gi(ds,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Ml.set(o,Gi(Ml.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Al.set(o,Gi(Al.get(o)||null,e,t,n,r,s)),!0}return!1}function zb(e){var t=Ds(e.target);if(t!==null){var n=xo(t);if(n!==null){if(t=n.tag,t===13){if(t=kb(n),t!==null){e.blockedOn=t,Ab(e.priority,function(){Ob(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 Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mh=r,n.target.dispatchEvent(r),Mh=null}else return t=Sa(n),t!==null&&Em(t),e.blockedOn=n,!1;t.shift()}return!0}function Q0(e,t,n){Ic(e)&&n.delete(t)}function wT(){Fh=!1,cs!==null&&Ic(cs)&&(cs=null),us!==null&&Ic(us)&&(us=null),ds!==null&&Ic(ds)&&(ds=null),Ml.forEach(Q0),Al.forEach(Q0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,un.unstable_scheduleCallback(un.unstable_NormalPriority,wT)))}function zl(e){function t(s){return Qi(s,e)}if(0<Ka.length){Qi(Ka[0],e);for(var n=1;n<Ka.length;n++){var r=Ka[n];r.blockedOn===e&&(r.blockedOn=null)}}for(cs!==null&&Qi(cs,e),us!==null&&Qi(us,e),ds!==null&&Qi(ds,e),Ml.forEach(t),Al.forEach(t),n=0;n<Gr.length;n++)r=Gr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Gr.length&&(n=Gr[0],n.blockedOn===null);)zb(n),n.blockedOn===null&&Gr.shift()}var Go=zr.ReactCurrentBatchConfig,tu=!0;function bT(e,t,n,r){var s=He,o=Go.transition;Go.transition=null;try{He=1,km(e,t,n,r)}finally{He=s,Go.transition=o}}function ST(e,t,n,r){var s=He,o=Go.transition;Go.transition=null;try{He=4,km(e,t,n,r)}finally{He=s,Go.transition=o}}function km(e,t,n,r){if(tu){var s=Lh(e,t,n,r);if(s===null)gf(e,t,r,nu,n),G0(e,r);else if(vT(s,e,t,n,r))r.stopPropagation();else if(G0(e,r),t&4&&-1<yT.indexOf(e)){for(;s!==null;){var o=Sa(s);if(o!==null&&_b(o),o=Lh(e,t,n,r),o===null&&gf(e,t,r,nu,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else gf(e,t,r,null,n)}}var nu=null;function Lh(e,t,n,r){if(nu=null,e=wm(r),e=Ds(e),e!==null)if(t=xo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=kb(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 nu=e,null}function Db(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(cT()){case bm:return 1;case Tb:return 4;case Jc:case uT:return 16;case Pb:return 536870912;default:return 16}default:return 16}}var is=null,Cm=null,jc=null;function $b(){if(jc)return jc;var e,t=Cm,n=t.length,r,s="value"in is?is.value:is.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 jc=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 Ya(){return!0}function X0(){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)?Ya:X0,this.isPropagationStopped=X0,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=Ya)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),t}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nm=mn(Fi),ba=Je({},Fi,{view:0,detail:0}),ET=mn(ba),lf,af,Xi,td=Je({},ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rm,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"?(lf=e.screenX-Xi.screenX,af=e.screenY-Xi.screenY):af=lf=0,Xi=e),lf)},movementY:function(e){return"movementY"in e?e.movementY:af}}),Z0=mn(td),kT=Je({},td,{dataTransfer:0}),CT=mn(kT),NT=Je({},ba,{relatedTarget:0}),cf=mn(NT),RT=Je({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),TT=mn(RT),PT=Je({},Fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),IT=mn(PT),jT=Je({},Fi,{data:0}),J0=mn(jT),_T={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OT={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"},MT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=MT[e])?!!t[e]:!1}function Rm(){return AT}var zT=Je({},ba,{key:function(e){if(e.key){var t=_T[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"?OT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rm,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}}),DT=mn(zT),$T=Je({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ex=mn($T),FT=Je({},ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rm}),LT=mn(FT),HT=Je({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),BT=mn(HT),VT=Je({},td,{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}),WT=mn(VT),UT=[9,13,27,32],Tm=Pr&&"CompositionEvent"in window,vl=null;Pr&&"documentMode"in document&&(vl=document.documentMode);var qT=Pr&&"TextEvent"in window&&!vl,Fb=Pr&&(!Tm||vl&&8<vl&&11>=vl),tx=" ",nx=!1;function Lb(e,t){switch(e){case"keyup":return UT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oo=!1;function KT(e,t){switch(e){case"compositionend":return Hb(t);case"keypress":return t.which!==32?null:(nx=!0,tx);case"textInput":return e=t.data,e===tx&&nx?null:e;default:return null}}function YT(e,t){if(Oo)return e==="compositionend"||!Tm&&Lb(e,t)?(e=$b(),jc=Cm=is=null,Oo=!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 Fb&&t.locale!=="ko"?null:t.data;default:return null}}var GT={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 rx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!GT[e.type]:t==="textarea"}function Bb(e,t,n,r){vb(r),t=ru(t,"onChange"),0<t.length&&(n=new Nm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var wl=null,Dl=null;function QT(e){Jb(e,0)}function nd(e){var t=zo(e);if(fb(t))return e}function XT(e,t){if(e==="change")return t}var Vb=!1;if(Pr){var uf;if(Pr){var df="oninput"in document;if(!df){var sx=document.createElement("div");sx.setAttribute("oninput","return;"),df=typeof sx.oninput=="function"}uf=df}else uf=!1;Vb=uf&&(!document.documentMode||9<document.documentMode)}function ox(){wl&&(wl.detachEvent("onpropertychange",Wb),Dl=wl=null)}function Wb(e){if(e.propertyName==="value"&&nd(Dl)){var t=[];Bb(t,Dl,e,wm(e)),Eb(QT,t)}}function ZT(e,t,n){e==="focusin"?(ox(),wl=t,Dl=n,wl.attachEvent("onpropertychange",Wb)):e==="focusout"&&ox()}function JT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nd(Dl)}function eP(e,t){if(e==="click")return nd(t)}function tP(e,t){if(e==="input"||e==="change")return nd(t)}function nP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bn=typeof Object.is=="function"?Object.is:nP;function $l(e,t){if(Bn(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(!Sh.call(t,s)||!Bn(e[s],t[s]))return!1}return!0}function ix(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lx(e,t){var n=ix(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=ix(n)}}function Ub(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ub(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qb(){for(var e=window,t=Qc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qc(e.document)}return t}function Pm(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 rP(e){var t=qb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ub(n.ownerDocument.documentElement,n)){if(r!==null&&Pm(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=lx(n,o);var i=lx(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 sP=Pr&&"documentMode"in document&&11>=document.documentMode,Mo=null,Hh=null,bl=null,Bh=!1;function ax(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bh||Mo==null||Mo!==Qc(r)||(r=Mo,"selectionStart"in r&&Pm(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}),bl&&$l(bl,r)||(bl=r,r=ru(Hh,"onSelect"),0<r.length&&(t=new Nm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mo)))}function Ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ao={animationend:Ga("Animation","AnimationEnd"),animationiteration:Ga("Animation","AnimationIteration"),animationstart:Ga("Animation","AnimationStart"),transitionend:Ga("Transition","TransitionEnd")},ff={},Kb={};Pr&&(Kb=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 rd(e){if(ff[e])return ff[e];if(!Ao[e])return e;var t=Ao[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kb)return ff[e]=t[n];return e}var Yb=rd("animationend"),Gb=rd("animationiteration"),Qb=rd("animationstart"),Xb=rd("transitionend"),Zb=new Map,cx="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 Ns(e,t){Zb.set(e,t),go(t,[e])}for(var hf=0;hf<cx.length;hf++){var pf=cx[hf],oP=pf.toLowerCase(),iP=pf[0].toUpperCase()+pf.slice(1);Ns(oP,"on"+iP)}Ns(Yb,"onAnimationEnd");Ns(Gb,"onAnimationIteration");Ns(Qb,"onAnimationStart");Ns("dblclick","onDoubleClick");Ns("focusin","onFocus");Ns("focusout","onBlur");Ns(Xb,"onTransitionEnd");yi("onMouseEnter",["mouseout","mouseover"]);yi("onMouseLeave",["mouseout","mouseover"]);yi("onPointerEnter",["pointerout","pointerover"]);yi("onPointerLeave",["pointerout","pointerover"]);go("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));go("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));go("onBeforeInput",["compositionend","keypress","textInput","paste"]);go("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));go("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));go("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),lP=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function ux(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,oT(r,t,void 0,e),e.currentTarget=null}function Jb(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;ux(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;ux(s,l,c),o=a}}}if(Zc)throw e=Dh,Zc=!1,Dh=null,e}function Ue(e,t){var n=t[Kh];n===void 0&&(n=t[Kh]=new Set);var r=e+"__bubble";n.has(r)||(e1(t,e,2,!1),n.add(r))}function mf(e,t,n){var r=0;t&&(r|=4),e1(n,e,r,t)}var Qa="_reactListening"+Math.random().toString(36).slice(2);function Fl(e){if(!e[Qa]){e[Qa]=!0,lb.forEach(function(n){n!=="selectionchange"&&(lP.has(n)||mf(n,!1,e),mf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qa]||(t[Qa]=!0,mf("selectionchange",!1,t))}}function e1(e,t,n,r){switch(Db(t)){case 1:var s=bT;break;case 4:s=ST;break;default:s=km}n=s.bind(null,t,n,e),s=void 0,!zh||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 gf(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=Ds(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Eb(function(){var c=o,u=wm(n),d=[];e:{var f=Zb.get(e);if(f!==void 0){var p=Nm,x=e;switch(e){case"keypress":if(_c(n)===0)break e;case"keydown":case"keyup":p=DT;break;case"focusin":x="focus",p=cf;break;case"focusout":x="blur",p=cf;break;case"beforeblur":case"afterblur":p=cf;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=Z0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=CT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=LT;break;case Yb:case Gb:case Qb:p=TT;break;case Xb:p=BT;break;case"scroll":p=ET;break;case"wheel":p=WT;break;case"copy":case"cut":case"paste":p=IT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ex}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var m=c,y;m!==null;){y=m;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,g!==null&&(w=Ol(m,g),w!=null&&v.push(Ll(m,w,y)))),b)break;m=m.return}0<v.length&&(f=new p(f,x,null,n,u),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Mh&&(x=n.relatedTarget||n.fromElement)&&(Ds(x)||x[Ir]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=c,x=x?Ds(x):null,x!==null&&(b=xo(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=c),p!==x)){if(v=Z0,w="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=ex,w="onPointerLeave",g="onPointerEnter",m="pointer"),b=p==null?f:zo(p),y=x==null?f:zo(x),f=new v(w,m+"leave",p,n,u),f.target=b,f.relatedTarget=y,w=null,Ds(u)===c&&(v=new v(g,m+"enter",x,n,u),v.target=y,v.relatedTarget=b,w=v),b=w,p&&x)t:{for(v=p,g=x,m=0,y=v;y;y=Po(y))m++;for(y=0,w=g;w;w=Po(w))y++;for(;0<m-y;)v=Po(v),m--;for(;0<y-m;)g=Po(g),y--;for(;m--;){if(v===g||g!==null&&v===g.alternate)break t;v=Po(v),g=Po(g)}v=null}else v=null;p!==null&&dx(d,f,p,v,!1),x!==null&&b!==null&&dx(d,b,x,v,!0)}}e:{if(f=c?zo(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=XT;else if(rx(f))if(Vb)E=tP;else{E=JT;var N=ZT}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=eP);if(E&&(E=E(e,c))){Bb(d,E,n,u);break e}N&&N(e,f,c),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&Ph(f,"number",f.value)}switch(N=c?zo(c):window,e){case"focusin":(rx(N)||N.contentEditable==="true")&&(Mo=N,Hh=c,bl=null);break;case"focusout":bl=Hh=Mo=null;break;case"mousedown":Bh=!0;break;case"contextmenu":case"mouseup":case"dragend":Bh=!1,ax(d,n,u);break;case"selectionchange":if(sP)break;case"keydown":case"keyup":ax(d,n,u)}var k;if(Tm)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 Oo?Lb(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Fb&&n.locale!=="ko"&&(Oo||C!=="onCompositionStart"?C==="onCompositionEnd"&&Oo&&(k=$b()):(is=u,Cm="value"in is?is.value:is.textContent,Oo=!0)),N=ru(c,C),0<N.length&&(C=new J0(C,e,null,n,u),d.push({event:C,listeners:N}),k?C.data=k:(k=Hb(n),k!==null&&(C.data=k)))),(k=qT?KT(e,n):YT(e,n))&&(c=ru(c,"onBeforeInput"),0<c.length&&(u=new J0("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=k))}Jb(d,t)})}function Ll(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ru(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Ol(e,n),o!=null&&r.unshift(Ll(e,o,s)),o=Ol(e,t),o!=null&&r.push(Ll(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 dx(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=Ol(n,o),a!=null&&i.unshift(Ll(n,a,l))):s||(a=Ol(n,o),a!=null&&i.push(Ll(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var aP=/\r\n?/g,cP=/\u0000|\uFFFD/g;function fx(e){return(typeof e=="string"?e:""+e).replace(aP,`
|
|
38
|
+
`).replace(cP,"")}function Xa(e,t,n){if(t=fx(t),fx(e)!==t&&n)throw Error(J(425))}function su(){}var Vh=null,Wh=null;function Uh(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 qh=typeof setTimeout=="function"?setTimeout:void 0,uP=typeof clearTimeout=="function"?clearTimeout:void 0,hx=typeof Promise=="function"?Promise:void 0,dP=typeof queueMicrotask=="function"?queueMicrotask:typeof hx<"u"?function(e){return hx.resolve(null).then(e).catch(fP)}:qh;function fP(e){setTimeout(function(){throw e})}function xf(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),zl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);zl(t)}function fs(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 px(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),tr="__reactFiber$"+Li,Hl="__reactProps$"+Li,Ir="__reactContainer$"+Li,Kh="__reactEvents$"+Li,hP="__reactListeners$"+Li,pP="__reactHandles$"+Li;function Ds(e){var t=e[tr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ir]||n[tr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=px(e);e!==null;){if(n=e[tr])return n;e=px(e)}return t}e=n,n=e.parentNode}return null}function Sa(e){return e=e[tr]||e[Ir],!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 sd(e){return e[Hl]||null}var Yh=[],Do=-1;function Rs(e){return{current:e}}function qe(e){0>Do||(e.current=Yh[Do],Yh[Do]=null,Do--)}function We(e,t){Do++,Yh[Do]=e.current,e.current=t}var ws={},zt=Rs(ws),Jt=Rs(!1),ro=ws;function vi(e,t){var n=e.type.contextTypes;if(!n)return ws;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 en(e){return e=e.childContextTypes,e!=null}function ou(){qe(Jt),qe(zt)}function mx(e,t,n){if(zt.current!==ws)throw Error(J(168));We(zt,t),We(Jt,n)}function t1(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,ZR(e)||"Unknown",s));return Je({},n,r)}function iu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ws,ro=zt.current,We(zt,e),We(Jt,Jt.current),!0}function gx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=t1(e,t,ro),r.__reactInternalMemoizedMergedChildContext=e,qe(Jt),qe(zt),We(zt,e)):qe(Jt),We(Jt,n)}var gr=null,od=!1,yf=!1;function n1(e){gr===null?gr=[e]:gr.push(e)}function mP(e){od=!0,n1(e)}function Ts(){if(!yf&&gr!==null){yf=!0;var e=0,t=He;try{var n=gr;for(He=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gr=null,od=!1}catch(s){throw gr!==null&&(gr=gr.slice(e+1)),Rb(bm,Ts),s}finally{He=t,yf=!1}}return null}var $o=[],Fo=0,lu=null,au=0,vn=[],wn=0,so=null,br=1,Sr="";function Os(e,t){$o[Fo++]=au,$o[Fo++]=lu,lu=e,au=t}function r1(e,t,n){vn[wn++]=br,vn[wn++]=Sr,vn[wn++]=so,so=e;var r=br;e=Sr;var s=32-Ln(r)-1;r&=~(1<<s),n+=1;var o=32-Ln(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,br=1<<32-Ln(t)+s|n<<s|r,Sr=o+e}else br=1<<o|n<<s|r,Sr=e}function Im(e){e.return!==null&&(Os(e,1),r1(e,1,0))}function jm(e){for(;e===lu;)lu=$o[--Fo],$o[Fo]=null,au=$o[--Fo],$o[Fo]=null;for(;e===so;)so=vn[--wn],vn[wn]=null,Sr=vn[--wn],vn[wn]=null,br=vn[--wn],vn[wn]=null}var cn=null,an=null,Ke=!1,Dn=null;function s1(e,t){var n=Sn(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 xx(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=fs(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=so!==null?{id:br,overflow:Sr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Sn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cn=e,an=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qh(e){if(Ke){var t=an;if(t){var n=t;if(!xx(e,t)){if(Gh(e))throw Error(J(418));t=fs(n.nextSibling);var r=cn;t&&xx(e,t)?s1(r,n):(e.flags=e.flags&-4097|2,Ke=!1,cn=e)}}else{if(Gh(e))throw Error(J(418));e.flags=e.flags&-4097|2,Ke=!1,cn=e}}}function yx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cn=e}function Za(e){if(e!==cn)return!1;if(!Ke)return yx(e),Ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uh(e.type,e.memoizedProps)),t&&(t=an)){if(Gh(e))throw o1(),Error(J(418));for(;t;)s1(e,t),t=fs(t.nextSibling)}if(yx(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=fs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}an=null}}else an=cn?fs(e.stateNode.nextSibling):null;return!0}function o1(){for(var e=an;e;)e=fs(e.nextSibling)}function wi(){an=cn=null,Ke=!1}function _m(e){Dn===null?Dn=[e]:Dn.push(e)}var gP=zr.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 Ja(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vx(e){var t=e._init;return t(e._payload)}function i1(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=gs(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=Cf(y,g.mode,w),m.return=g,m):(m=s(m,y),m.return=g,m)}function a(g,m,y,w){var E=y.type;return E===_o?u(g,m,y.props.children,w,y.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===qr&&vx(E)===m.type)?(w=s(m,y.props),w.ref=Zi(g,m,y),w.return=g,w):(w=Fc(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=Nf(y,g.mode,w),m.return=g,m):(m=s(m,y.children||[]),m.return=g,m)}function u(g,m,y,w,E){return m===null||m.tag!==7?(m=Js(y,g.mode,w,E),m.return=g,m):(m=s(m,y),m.return=g,m)}function d(g,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Cf(""+m,g.mode,y),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ba:return y=Fc(m.type,m.key,m.props,null,g.mode,y),y.ref=Zi(g,null,m),y.return=g,y;case jo:return m=Nf(m,g.mode,y),m.return=g,m;case qr:var w=m._init;return d(g,w(m._payload),y)}if(ul(m)||Ki(m))return m=Js(m,g.mode,y,null),m.return=g,m;Ja(g,m)}return null}function f(g,m,y,w){var E=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:l(g,m,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ba:return y.key===E?a(g,m,y,w):null;case jo:return y.key===E?c(g,m,y,w):null;case qr:return E=y._init,f(g,m,E(y._payload),w)}if(ul(y)||Ki(y))return E!==null?null:u(g,m,y,w,null);Ja(g,y)}return null}function p(g,m,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(y)||null,l(m,g,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ba:return g=g.get(w.key===null?y:w.key)||null,a(m,g,w,E);case jo:return g=g.get(w.key===null?y:w.key)||null,c(m,g,w,E);case qr:var N=w._init;return p(g,m,y,N(w._payload),E)}if(ul(w)||Ki(w))return g=g.get(y)||null,u(m,g,w,E,null);Ja(m,w)}return null}function x(g,m,y,w){for(var E=null,N=null,k=m,C=m=0,P=null;k!==null&&C<y.length;C++){k.index>C?(P=k,k=null):P=k.sibling;var j=f(g,k,y[C],w);if(j===null){k===null&&(k=P);break}e&&k&&j.alternate===null&&t(g,k),m=o(j,m,C),N===null?E=j:N.sibling=j,N=j,k=P}if(C===y.length)return n(g,k),Ke&&Os(g,C),E;if(k===null){for(;C<y.length;C++)k=d(g,y[C],w),k!==null&&(m=o(k,m,C),N===null?E=k:N.sibling=k,N=k);return Ke&&Os(g,C),E}for(k=r(g,k);C<y.length;C++)P=p(k,g,C,y[C],w),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),m=o(P,m,C),N===null?E=P:N.sibling=P,N=P);return e&&k.forEach(function(A){return t(g,A)}),Ke&&Os(g,C),E}function v(g,m,y,w){var E=Ki(y);if(typeof E!="function")throw Error(J(150));if(y=E.call(y),y==null)throw Error(J(151));for(var N=E=null,k=m,C=m=0,P=null,j=y.next();k!==null&&!j.done;C++,j=y.next()){k.index>C?(P=k,k=null):P=k.sibling;var A=f(g,k,j.value,w);if(A===null){k===null&&(k=P);break}e&&k&&A.alternate===null&&t(g,k),m=o(A,m,C),N===null?E=A:N.sibling=A,N=A,k=P}if(j.done)return n(g,k),Ke&&Os(g,C),E;if(k===null){for(;!j.done;C++,j=y.next())j=d(g,j.value,w),j!==null&&(m=o(j,m,C),N===null?E=j:N.sibling=j,N=j);return Ke&&Os(g,C),E}for(k=r(g,k);!j.done;C++,j=y.next())j=p(k,g,C,j.value,w),j!==null&&(e&&j.alternate!==null&&k.delete(j.key===null?C:j.key),m=o(j,m,C),N===null?E=j:N.sibling=j,N=j);return e&&k.forEach(function(D){return t(g,D)}),Ke&&Os(g,C),E}function b(g,m,y,w){if(typeof y=="object"&&y!==null&&y.type===_o&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ba:e:{for(var E=y.key,N=m;N!==null;){if(N.key===E){if(E=y.type,E===_o){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===E||typeof E=="object"&&E!==null&&E.$$typeof===qr&&vx(E)===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===_o?(m=Js(y.props.children,g.mode,w,y.key),m.return=g,g=m):(w=Fc(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=Nf(y,g.mode,w),m.return=g,g=m}return i(g);case qr:return N=y._init,b(g,m,N(y._payload),w)}if(ul(y))return x(g,m,y,w);if(Ki(y))return v(g,m,y,w);Ja(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=Cf(y,g.mode,w),m.return=g,g=m),i(g)):n(g,m)}return b}var bi=i1(!0),l1=i1(!1),cu=Rs(null),uu=null,Lo=null,Om=null;function Mm(){Om=Lo=uu=null}function Am(e){var t=cu.current;qe(cu),e._currentValue=t}function Xh(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){uu=e,Om=Lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qt=!0),e.firstContext=null)}function Nn(e){var t=e._currentValue;if(Om!==e)if(e={context:e,memoizedValue:t,next:null},Lo===null){if(uu===null)throw Error(J(308));Lo=e,uu.dependencies={lanes:0,firstContext:e}}else Lo=Lo.next=e;return t}var $s=null;function zm(e){$s===null?$s=[e]:$s.push(e)}function a1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,zm(t)):(n.next=s.next,s.next=n),t.interleaved=n,jr(e,r)}function jr(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 Kr=!1;function Dm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function c1(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 kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,jr(e,n)}return s=r.interleaved,s===null?(t.next=t,zm(r)):(t.next=s.next,s.next=t),r.interleaved=t,jr(e,n)}function Oc(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,Sm(e,n)}}function wx(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 du(e,t,n,r){var s=e.updateQueue;Kr=!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 d=s.baseState;i=0,u=c=a=null,l=o;do{var f=l.lane,p=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,v=l;switch(f=t,p=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){d=x.call(p,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,f=typeof x=="function"?x.call(p,d,f):x,f==null)break e;d=Je({},d,f);break e;case 2:Kr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=d):u=u.next=p,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(a=d),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);io|=i,e.lanes=i,e.memoizedState=d}}function bx(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={},sr=Rs(Ea),Bl=Rs(Ea),Vl=Rs(Ea);function Fs(e){if(e===Ea)throw Error(J(174));return e}function $m(e,t){switch(We(Vl,t),We(Bl,e),We(sr,Ea),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jh(t,e)}qe(sr),We(sr,t)}function Si(){qe(sr),qe(Bl),qe(Vl)}function u1(e){Fs(Vl.current);var t=Fs(sr.current),n=jh(t,e.type);t!==n&&(We(Bl,e),We(sr,n))}function Fm(e){Bl.current===e&&(qe(sr),qe(Bl))}var Qe=Rs(0);function fu(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 vf=[];function Lm(){for(var e=0;e<vf.length;e++)vf[e]._workInProgressVersionPrimary=null;vf.length=0}var Mc=zr.ReactCurrentDispatcher,wf=zr.ReactCurrentBatchConfig,oo=0,Ze=null,pt=null,vt=null,hu=!1,Sl=!1,Wl=0,xP=0;function Pt(){throw Error(J(321))}function Hm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Bn(e[n],t[n]))return!1;return!0}function Bm(e,t,n,r,s,o){if(oo=o,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mc.current=e===null||e.memoizedState===null?bP:SP,e=n(r,s),Sl){o=0;do{if(Sl=!1,Wl=0,25<=o)throw Error(J(301));o+=1,vt=pt=null,t.updateQueue=null,Mc.current=EP,e=n(r,s)}while(Sl)}if(Mc.current=pu,t=pt!==null&&pt.next!==null,oo=0,vt=pt=Ze=null,hu=!1,t)throw Error(J(300));return e}function Vm(){var e=Wl!==0;return Wl=0,e}function Qn(){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 Rn(){if(pt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=vt===null?Ze.memoizedState:vt.next;if(t!==null)vt=t,pt=e;else{if(e===null)throw Error(J(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},vt===null?Ze.memoizedState=vt=e:vt=vt.next=e}return vt}function Ul(e,t){return typeof t=="function"?t(e):t}function bf(e){var t=Rn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=pt,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((oo&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 d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=d,i=r):a=a.next=d,Ze.lanes|=u,io|=u}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,Bn(r,t.memoizedState)||(Qt=!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,io|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sf(e){var t=Rn(),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);Bn(o,t.memoizedState)||(Qt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function d1(){}function f1(e,t){var n=Ze,r=Rn(),s=t(),o=!Bn(r.memoizedState,s);if(o&&(r.memoizedState=s,Qt=!0),r=r.queue,Wm(m1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,ql(9,p1.bind(null,n,r,s,t),void 0,null),wt===null)throw Error(J(349));oo&30||h1(n,t,s)}return s}function h1(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 p1(e,t,n,r){t.value=n,t.getSnapshot=r,g1(t)&&x1(e)}function m1(e,t,n){return n(function(){g1(t)&&x1(e)})}function g1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bn(e,n)}catch{return!0}}function x1(e){var t=jr(e,1);t!==null&&Hn(t,e,1,-1)}function Sx(e){var t=Qn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:e},t.queue=e,e=e.dispatch=wP.bind(null,Ze,e),[t.memoizedState,e]}function ql(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 y1(){return Rn().memoizedState}function Ac(e,t,n,r){var s=Qn();Ze.flags|=e,s.memoizedState=ql(1|t,n,void 0,r===void 0?null:r)}function id(e,t,n,r){var s=Rn();r=r===void 0?null:r;var o=void 0;if(pt!==null){var i=pt.memoizedState;if(o=i.destroy,r!==null&&Hm(r,i.deps)){s.memoizedState=ql(t,n,o,r);return}}Ze.flags|=e,s.memoizedState=ql(1|t,n,o,r)}function Ex(e,t){return Ac(8390656,8,e,t)}function Wm(e,t){return id(2048,8,e,t)}function v1(e,t){return id(4,2,e,t)}function w1(e,t){return id(4,4,e,t)}function b1(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 S1(e,t,n){return n=n!=null?n.concat([e]):null,id(4,4,b1.bind(null,t,e),n)}function Um(){}function E1(e,t){var n=Rn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Hm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function k1(e,t){var n=Rn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Hm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function C1(e,t,n){return oo&21?(Bn(n,t)||(n=Ib(),Ze.lanes|=n,io|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qt=!0),e.memoizedState=n)}function yP(e,t){var n=He;He=n!==0&&4>n?n:4,e(!0);var r=wf.transition;wf.transition={};try{e(!1),t()}finally{He=n,wf.transition=r}}function N1(){return Rn().memoizedState}function vP(e,t,n){var r=ms(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},R1(e))T1(t,n);else if(n=a1(e,t,n,r),n!==null){var s=Bt();Hn(n,e,r,s),P1(n,t,r)}}function wP(e,t,n){var r=ms(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(R1(e))T1(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,Bn(l,i)){var a=t.interleaved;a===null?(s.next=s,zm(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=a1(e,t,s,r),n!==null&&(s=Bt(),Hn(n,e,r,s),P1(n,t,r))}}function R1(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function T1(e,t){Sl=hu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function P1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sm(e,n)}}var pu={readContext:Nn,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},bP={readContext:Nn,useCallback:function(e,t){return Qn().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:Ex,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ac(4194308,4,b1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ac(4,2,e,t)},useMemo:function(e,t){var n=Qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qn();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=vP.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=Qn();return e={current:e},t.memoizedState=e},useState:Sx,useDebugValue:Um,useDeferredValue:function(e){return Qn().memoizedState=e},useTransition:function(){var e=Sx(!1),t=e[0];return e=yP.bind(null,e[1]),Qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,s=Qn();if(Ke){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),wt===null)throw Error(J(349));oo&30||h1(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Ex(m1.bind(null,r,o,e),[e]),r.flags|=2048,ql(9,p1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Qn(),t=wt.identifierPrefix;if(Ke){var n=Sr,r=br;n=(r&~(1<<32-Ln(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},SP={readContext:Nn,useCallback:E1,useContext:Nn,useEffect:Wm,useImperativeHandle:S1,useInsertionEffect:v1,useLayoutEffect:w1,useMemo:k1,useReducer:bf,useRef:y1,useState:function(){return bf(Ul)},useDebugValue:Um,useDeferredValue:function(e){var t=Rn();return C1(t,pt.memoizedState,e)},useTransition:function(){var e=bf(Ul)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:d1,useSyncExternalStore:f1,useId:N1,unstable_isNewReconciler:!1},EP={readContext:Nn,useCallback:E1,useContext:Nn,useEffect:Wm,useImperativeHandle:S1,useInsertionEffect:v1,useLayoutEffect:w1,useMemo:k1,useReducer:Sf,useRef:y1,useState:function(){return Sf(Ul)},useDebugValue:Um,useDeferredValue:function(e){var t=Rn();return pt===null?t.memoizedState=e:C1(t,pt.memoizedState,e)},useTransition:function(){var e=Sf(Ul)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:d1,useSyncExternalStore:f1,useId:N1,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 Zh(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 ld={isMounted:function(e){return(e=e._reactInternals)?xo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=ms(e),o=kr(r,s);o.payload=t,n!=null&&(o.callback=n),t=hs(e,o,s),t!==null&&(Hn(t,e,s,r),Oc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=ms(e),o=kr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=hs(e,o,s),t!==null&&(Hn(t,e,s,r),Oc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bt(),r=ms(e),s=kr(n,r);s.tag=2,t!=null&&(s.callback=t),t=hs(e,s,r),t!==null&&(Hn(t,e,r,n),Oc(t,e,r))}};function kx(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?!$l(n,r)||!$l(s,o):!0}function I1(e,t,n){var r=!1,s=ws,o=t.contextType;return typeof o=="object"&&o!==null?o=Nn(o):(s=en(t)?ro:zt.current,r=t.contextTypes,o=(r=r!=null)?vi(e,s):ws),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ld,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Cx(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&&ld.enqueueReplaceState(t,t.state,null)}function Jh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Dm(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Nn(o):(o=en(t)?ro:zt.current,s.context=vi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Zh(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&&ld.enqueueReplaceState(s,s.state,null),du(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ei(e,t){try{var n="",r=t;do n+=XR(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 ep(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kP=typeof WeakMap=="function"?WeakMap:Map;function j1(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gu||(gu=!0,up=r),ep(e,t)},n}function _1(e,t,n){n=kr(-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(){ep(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ep(e,t),typeof r!="function"&&(ps===null?ps=new Set([this]):ps.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Nx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kP;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=$P.bind(null,e,t,n),t.then(e,e))}function Rx(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 Tx(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=kr(-1,1),t.tag=2,hs(n,t,1))),n.lanes|=1),e)}var CP=zr.ReactCurrentOwner,Qt=!1;function Lt(e,t,n,r){t.child=e===null?l1(t,null,n,r):bi(t,e.child,n,r)}function Px(e,t,n,r,s){n=n.render;var o=t.ref;return Qo(t,s),r=Bm(e,t,n,r,o,s),n=Vm(),e!==null&&!Qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(Ke&&n&&Im(t),t.flags|=1,Lt(e,t,r,s),t.child)}function Ix(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Jm(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,O1(e,t,o,r,s)):(e=Fc(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:$l,n(i,r)&&e.ref===t.ref)return _r(e,t,s)}return t.flags|=1,e=gs(o,r),e.ref=t.ref,e.return=t,t.child=e}function O1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if($l(o,r)&&e.ref===t.ref)if(Qt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Qt=!0);else return t.lanes=e.lanes,_r(e,t,s)}return tp(e,t,n,r,s)}function M1(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 A1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function tp(e,t,n,r,s){var o=en(n)?ro:zt.current;return o=vi(t,o),Qo(t,s),n=Bm(e,t,n,r,o,s),r=Vm(),e!==null&&!Qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(Ke&&r&&Im(t),t.flags|=1,Lt(e,t,n,s),t.child)}function jx(e,t,n,r,s){if(en(n)){var o=!0;iu(t)}else o=!1;if(Qo(t,s),t.stateNode===null)zc(e,t),I1(t,n,r),Jh(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=Nn(c):(c=en(n)?ro:zt.current,c=vi(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Cx(t,i,r,c),Kr=!1;var f=t.memoizedState;i.state=f,du(t,r,i,s),a=t.memoizedState,l!==r||f!==a||Jt.current||Kr?(typeof u=="function"&&(Zh(t,n,u,r),a=t.memoizedState),(l=Kr||kx(t,n,l,r,f,a,c))?(d||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,c1(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:_n(t.type,l),i.props=c,d=t.pendingProps,f=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=Nn(a):(a=en(n)?ro:zt.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!==d||f!==a)&&Cx(t,i,r,a),Kr=!1,f=t.memoizedState,i.state=f,du(t,r,i,s);var x=t.memoizedState;l!==d||f!==x||Jt.current||Kr?(typeof p=="function"&&(Zh(t,n,p,r),x=t.memoizedState),(c=Kr||kx(t,n,c,r,f,x,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,x,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,x,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),i.props=r,i.state=x,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return np(e,t,n,r,o,s)}function np(e,t,n,r,s,o){A1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&gx(t,n,!1),_r(e,t,o);r=t.stateNode,CP.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&&gx(t,n,!0),t.child}function z1(e){var t=e.stateNode;t.pendingContext?mx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&mx(e,t.context,!1),$m(e,t.containerInfo)}function _x(e,t,n,r,s){return wi(),_m(s),t.flags|=256,Lt(e,t,n,r),t.child}var rp={dehydrated:null,treeContext:null,retryLane:0};function sp(e){return{baseLanes:e,cachePool:null,transitions:null}}function D1(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 Qh(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=ud(i,r,0,null),e=Js(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=sp(n),t.memoizedState=rp,e):qm(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return NP(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=gs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=gs(l,o):(o=Js(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?sp(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=rp,r}return o=e.child,e=o.sibling,r=gs(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 qm(e,t){return t=ud({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&_m(r),bi(t,e.child,null,n),e=qm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function NP(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Ef(Error(J(422))),ec(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ud({mode:"visible",children:r.children},s,0,null),o=Js(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=sp(i),t.memoizedState=rp,o);if(!(t.mode&1))return ec(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),ec(e,t,i,r)}if(l=(i&e.childLanes)!==0,Qt||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,jr(e,s),Hn(r,e,s,-1))}return Zm(),r=Ef(Error(J(421))),ec(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=FP.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,an=fs(s.nextSibling),cn=t,Ke=!0,Dn=null,e!==null&&(vn[wn++]=br,vn[wn++]=Sr,vn[wn++]=so,br=e.id,Sr=e.overflow,so=t),t=qm(t,r.children),t.flags|=4096,t)}function Ox(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xh(e.return,t,n)}function kf(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 $1(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&&Ox(e,n,t);else if(e.tag===19)Ox(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&&fu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),kf(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&&fu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}kf(t,!0,n,null,o);break;case"together":kf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zc(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),io|=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=gs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function RP(e,t,n){switch(t.tag){case 3:z1(t),wi();break;case 5:u1(t);break;case 1:en(t.type)&&iu(t);break;case 4:$m(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;We(cu,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?D1(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 $1(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,M1(e,t,n)}return _r(e,t,n)}var F1,op,L1,H1;F1=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}};op=function(){};L1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Fs(sr.current);var o=null;switch(n){case"input":s=Rh(e,s),r=Rh(e,r),o=[];break;case"select":s=Je({},s,{value:void 0}),r=Je({},r,{value:void 0}),o=[];break;case"textarea":s=Ih(e,s),r=Ih(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=su)}_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"&&(jl.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"&&(jl.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)}};H1=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 It(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 TP(e,t,n){var r=t.pendingProps;switch(jm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(t),null;case 1:return en(t.type)&&ou(),It(t),null;case 3:return r=t.stateNode,Si(),qe(Jt),qe(zt),Lm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Za(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(hp(Dn),Dn=null))),op(e,t),It(t),null;case 5:Fm(t);var s=Fs(Vl.current);if(n=t.type,e!==null&&t.stateNode!=null)L1(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 It(t),null}if(e=Fs(sr.current),Za(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[tr]=t,r[Hl]=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<fl.length;s++)Ue(fl[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":B0(r,o),Ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ue("invalid",r);break;case"textarea":W0(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&&Xa(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Xa(r.textContent,l,e),s=["children",""+l]):jl.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Ue("scroll",r)}switch(n){case"input":Va(r),V0(r,o,!0);break;case"textarea":Va(r),U0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=su)}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=mb(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[tr]=t,e[Hl]=r,F1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Oh(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<fl.length;s++)Ue(fl[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":B0(e,r),s=Rh(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":W0(e,r),s=Ih(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"?yb(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&gb(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"&&(jl.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Ue("scroll",e):a!=null&&gm(e,o,a,i))}switch(n){case"input":Va(e),V0(e,r,!1);break;case"textarea":Va(e),U0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vs(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=su)}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 It(t),null;case 6:if(e&&t.stateNode!=null)H1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Fs(Vl.current),Fs(sr.current),Za(t)){if(r=t.stateNode,n=t.memoizedProps,r[tr]=t,(o=r.nodeValue!==n)&&(e=cn,e!==null))switch(e.tag){case 3:Xa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xa(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[tr]=t,t.stateNode=r}return It(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))o1(),wi(),t.flags|=98560,o=!1;else if(o=Za(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[tr]=t}else wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;It(t),o=!1}else Dn!==null&&(hp(Dn),Dn=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?mt===0&&(mt=3):Zm())),t.updateQueue!==null&&(t.flags|=4),It(t),null);case 4:return Si(),op(e,t),e===null&&Fl(t.stateNode.containerInfo),It(t),null;case 10:return Am(t.type._context),It(t),null;case 17:return en(t.type)&&ou(),It(t),null;case 19:if(qe(Qe),o=t.memoizedState,o===null)return It(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ji(o,!1);else{if(mt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fu(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&<()>ki&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=fu(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 It(t),null}else 2*lt()-o.renderingStartTime>ki&&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=lt(),t.sibling=null,n=Qe.current,We(Qe,r?n&1|2:n&1),t):(It(t),null);case 22:case 23:return Xm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function PP(e,t){switch(jm(t),t.tag){case 1:return en(t.type)&&ou(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),qe(Jt),qe(zt),Lm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fm(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 Am(t.type._context),null;case 22:case 23:return Xm(),null;case 24:return null;default:return null}}var tc=!1,Mt=!1,IP=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 ip(e,t,n){try{n()}catch(r){nt(e,t,r)}}var Mx=!1;function jP(e,t){if(Vh=tu,e=qb(),Pm(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,d=e,f=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(a=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++u===r&&(a=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wh={focusedElem:e,selectionRange:n},tu=!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 x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,b=x.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:_n(t.type,v),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 x=Mx,Mx=!1,x}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&&ip(t,n,o)}s=s.next}while(s!==r)}}function ad(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 lp(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 B1(e){var t=e.alternate;t!==null&&(e.alternate=null,B1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tr],delete t[Hl],delete t[Kh],delete t[hP],delete t[pP])),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 V1(e){return e.tag===5||e.tag===3||e.tag===4}function Ax(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||V1(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 ap(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=su));else if(r!==4&&(e=e.child,e!==null))for(ap(e,t,n),e=e.sibling;e!==null;)ap(e,t,n),e=e.sibling}function cp(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(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}var bt=null,An=!1;function Hr(e,t,n){for(n=n.child;n!==null;)W1(e,t,n),n=n.sibling}function W1(e,t,n){if(rr&&typeof rr.onCommitFiberUnmount=="function")try{rr.onCommitFiberUnmount(ed,n)}catch{}switch(n.tag){case 5:Mt||Ho(n,t);case 6:var r=bt,s=An;bt=null,Hr(e,t,n),bt=r,An=s,bt!==null&&(An?(e=bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bt.removeChild(n.stateNode));break;case 18:bt!==null&&(An?(e=bt,n=n.stateNode,e.nodeType===8?xf(e.parentNode,n):e.nodeType===1&&xf(e,n),zl(e)):xf(bt,n.stateNode));break;case 4:r=bt,s=An,bt=n.stateNode.containerInfo,An=!0,Hr(e,t,n),bt=r,An=s;break;case 0:case 11:case 14:case 15:if(!Mt&&(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)&&ip(n,t,i),s=s.next}while(s!==r)}Hr(e,t,n);break;case 1:if(!Mt&&(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)}Hr(e,t,n);break;case 21:Hr(e,t,n);break;case 22:n.mode&1?(Mt=(r=Mt)||n.memoizedState!==null,Hr(e,t,n),Mt=r):Hr(e,t,n);break;default:Hr(e,t,n)}}function zx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new IP),t.forEach(function(r){var s=LP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function jn(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,An=!1;break e;case 3:bt=l.stateNode.containerInfo,An=!0;break e;case 4:bt=l.stateNode.containerInfo,An=!0;break e}l=l.return}if(bt===null)throw Error(J(160));W1(o,i,s),bt=null,An=!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;)U1(t,e),t=t.sibling}function U1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Yn(e),r&4){try{El(3,e,e.return),ad(3,e)}catch(v){nt(e,e.return,v)}try{El(5,e,e.return)}catch(v){nt(e,e.return,v)}}break;case 1:jn(t,e),Yn(e),r&512&&n!==null&&Ho(n,n.return);break;case 5:if(jn(t,e),Yn(e),r&512&&n!==null&&Ho(n,n.return),e.flags&32){var s=e.stateNode;try{_l(s,"")}catch(v){nt(e,e.return,v)}}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&&hb(s,o),Oh(l,i);var c=Oh(l,o);for(i=0;i<a.length;i+=2){var u=a[i],d=a[i+1];u==="style"?yb(s,d):u==="dangerouslySetInnerHTML"?gb(s,d):u==="children"?_l(s,d):gm(s,u,d,c)}switch(l){case"input":Th(s,o);break;case"textarea":pb(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?qo(s,!!o.multiple,p,!1):f!==!!o.multiple&&(o.defaultValue!=null?qo(s,!!o.multiple,o.defaultValue,!0):qo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Hl]=o}catch(v){nt(e,e.return,v)}}break;case 6:if(jn(t,e),Yn(e),r&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){nt(e,e.return,v)}}break;case 3:if(jn(t,e),Yn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zl(t.containerInfo)}catch(v){nt(e,e.return,v)}break;case 4:jn(t,e),Yn(e);break;case 13:jn(t,e),Yn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Gm=lt())),r&4&&zx(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Mt=(c=Mt)||u,jn(t,e),Mt=c):jn(t,e),Yn(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(d=ae=u;ae!==null;){switch(f=ae,p=f.child,f.tag){case 0:case 11:case 14:case 15:El(4,f,f.return);break;case 1:Ho(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){nt(r,n,v)}}break;case 5:Ho(f,f.return);break;case 22:if(f.memoizedState!==null){$x(d);continue}}p!==null?(p.return=f,ae=p):$x(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,a=d.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=xb("display",i))}catch(v){nt(e,e.return,v)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){nt(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:jn(t,e),Yn(e),r&4&&zx(e);break;case 21:break;default:jn(t,e),Yn(e)}}function Yn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(V1(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=Ax(e);cp(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Ax(e);ap(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 _P(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||tc;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||Mt;l=tc;var c=Mt;if(tc=i,(Mt=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?Fx(s):a!==null?(a.return=i,ae=a):Fx(s);for(;o!==null;)ae=o,q1(o),o=o.sibling;ae=s,tc=l,Mt=c}Dx(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):Dx(e)}}function Dx(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:Mt||ad(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mt)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&&bx(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}bx(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 d=u.dehydrated;d!==null&&zl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Mt||t.flags&512&&lp(t)}catch(f){nt(t,t.return,f)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function $x(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 Fx(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ad(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{lp(t)}catch(a){nt(t,o,a)}break;case 5:var i=t.return;try{lp(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 OP=Math.ceil,mu=zr.ReactCurrentDispatcher,Km=zr.ReactCurrentOwner,kn=zr.ReactCurrentBatchConfig,je=0,wt=null,ct=null,kt=0,on=0,Bo=Rs(0),mt=0,Kl=null,io=0,cd=0,Ym=0,kl=null,Gt=null,Gm=0,ki=1/0,mr=null,gu=!1,up=null,ps=null,nc=!1,ls=null,xu=0,Cl=0,dp=null,Dc=-1,$c=0;function Bt(){return je&6?lt():Dc!==-1?Dc:Dc=lt()}function ms(e){return e.mode&1?je&2&&kt!==0?kt&-kt:gP.transition!==null?($c===0&&($c=Ib()),$c):(e=He,e!==0||(e=window.event,e=e===void 0?16:Db(e.type)),e):1}function Hn(e,t,n,r){if(50<Cl)throw Cl=0,dp=null,Error(J(185));wa(e,n,r),(!(je&2)||e!==wt)&&(e===wt&&(!(je&2)&&(cd|=n),mt===4&&Qr(e,kt)),tn(e,r),n===1&&je===0&&!(t.mode&1)&&(ki=lt()+500,od&&Ts()))}function tn(e,t){var n=e.callbackNode;gT(e,t);var r=eu(e,e===wt?kt:0);if(r===0)n!==null&&Y0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Y0(n),t===1)e.tag===0?mP(Lx.bind(null,e)):n1(Lx.bind(null,e)),dP(function(){!(je&6)&&Ts()}),n=null;else{switch(jb(r)){case 1:n=bm;break;case 4:n=Tb;break;case 16:n=Jc;break;case 536870912:n=Pb;break;default:n=Jc}n=eS(n,K1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function K1(e,t){if(Dc=-1,$c=0,je&6)throw Error(J(327));var n=e.callbackNode;if(Xo()&&e.callbackNode!==n)return null;var r=eu(e,e===wt?kt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=yu(e,r);else{t=r;var s=je;je|=2;var o=G1();(wt!==e||kt!==t)&&(mr=null,ki=lt()+500,Zs(e,t));do try{zP();break}catch(l){Y1(e,l)}while(!0);Mm(),mu.current=o,je=s,ct!==null?t=0:(wt=null,kt=0,t=mt)}if(t!==0){if(t===2&&(s=$h(e),s!==0&&(r=s,t=fp(e,s))),t===1)throw n=Kl,Zs(e,0),Qr(e,r),tn(e,lt()),n;if(t===6)Qr(e,r);else{if(s=e.current.alternate,!(r&30)&&!MP(s)&&(t=yu(e,r),t===2&&(o=$h(e),o!==0&&(r=o,t=fp(e,o))),t===1))throw n=Kl,Zs(e,0),Qr(e,r),tn(e,lt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Ms(e,Gt,mr);break;case 3:if(Qr(e,r),(r&130023424)===r&&(t=Gm+500-lt(),10<t)){if(eu(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Bt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=qh(Ms.bind(null,e,Gt,mr),t);break}Ms(e,Gt,mr);break;case 4:if(Qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Ln(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*OP(r/1960))-r,10<r){e.timeoutHandle=qh(Ms.bind(null,e,Gt,mr),r);break}Ms(e,Gt,mr);break;case 5:Ms(e,Gt,mr);break;default:throw Error(J(329))}}}return tn(e,lt()),e.callbackNode===n?K1.bind(null,e):null}function fp(e,t){var n=kl;return e.current.memoizedState.isDehydrated&&(Zs(e,t).flags|=256),e=yu(e,t),e!==2&&(t=Gt,Gt=n,t!==null&&hp(t)),e}function hp(e){Gt===null?Gt=e:Gt.push.apply(Gt,e)}function MP(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(!Bn(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 Qr(e,t){for(t&=~Ym,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ln(t),r=1<<n;e[n]=-1,t&=~r}}function Lx(e){if(je&6)throw Error(J(327));Xo();var t=eu(e,0);if(!(t&1))return tn(e,lt()),null;var n=yu(e,t);if(e.tag!==0&&n===2){var r=$h(e);r!==0&&(t=r,n=fp(e,r))}if(n===1)throw n=Kl,Zs(e,0),Qr(e,t),tn(e,lt()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ms(e,Gt,mr),tn(e,lt()),null}function Qm(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(ki=lt()+500,od&&Ts())}}function lo(e){ls!==null&&ls.tag===0&&!(je&6)&&Xo();var t=je;je|=1;var n=kn.transition,r=He;try{if(kn.transition=null,He=1,e)return e()}finally{He=r,kn.transition=n,je=t,!(je&6)&&Ts()}}function Xm(){on=Bo.current,qe(Bo)}function Zs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,uP(n)),ct!==null)for(n=ct.return;n!==null;){var r=n;switch(jm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ou();break;case 3:Si(),qe(Jt),qe(zt),Lm();break;case 5:Fm(r);break;case 4:Si();break;case 13:qe(Qe);break;case 19:qe(Qe);break;case 10:Am(r.type._context);break;case 22:case 23:Xm()}n=n.return}if(wt=e,ct=e=gs(e.current,null),kt=on=t,mt=0,Kl=null,Ym=cd=io=0,Gt=kl=null,$s!==null){for(t=0;t<$s.length;t++)if(n=$s[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}$s=null}return e}function Y1(e,t){do{var n=ct;try{if(Mm(),Mc.current=pu,hu){for(var r=Ze.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}hu=!1}if(oo=0,vt=pt=Ze=null,Sl=!1,Wl=0,Km.current=null,n===null||n.return===null){mt=1,Kl=t,ct=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=kt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Rx(i);if(p!==null){p.flags&=-257,Tx(p,i,l,o,t),p.mode&1&&Nx(o,c,t),t=p,a=c;var x=t.updateQueue;if(x===null){var v=new Set;v.add(a),t.updateQueue=v}else x.add(a);break e}else{if(!(t&1)){Nx(o,c,t),Zm();break e}a=Error(J(426))}}else if(Ke&&l.mode&1){var b=Rx(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Tx(b,i,l,o,t),_m(Ei(a,l));break e}}o=a=Ei(a,l),mt!==4&&(mt=2),kl===null?kl=[o]:kl.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=j1(o,a,t);wx(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"&&(ps===null||!ps.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=_1(o,l,t);wx(o,w);break e}}o=o.return}while(o!==null)}X1(n)}catch(E){t=E,ct===n&&n!==null&&(ct=n=n.return);continue}break}while(!0)}function G1(){var e=mu.current;return mu.current=pu,e===null?pu:e}function Zm(){(mt===0||mt===3||mt===2)&&(mt=4),wt===null||!(io&268435455)&&!(cd&268435455)||Qr(wt,kt)}function yu(e,t){var n=je;je|=2;var r=G1();(wt!==e||kt!==t)&&(mr=null,Zs(e,t));do try{AP();break}catch(s){Y1(e,s)}while(!0);if(Mm(),je=n,mu.current=r,ct!==null)throw Error(J(261));return wt=null,kt=0,mt}function AP(){for(;ct!==null;)Q1(ct)}function zP(){for(;ct!==null&&!lT();)Q1(ct)}function Q1(e){var t=J1(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?X1(e):ct=t,Km.current=null}function X1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=PP(n,t),n!==null){n.flags&=32767,ct=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{mt=6,ct=null;return}}else if(n=TP(n,t,on),n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);mt===0&&(mt=5)}function Ms(e,t,n){var r=He,s=kn.transition;try{kn.transition=null,He=1,DP(e,t,n,r)}finally{kn.transition=s,He=r}return null}function DP(e,t,n,r){do Xo();while(ls!==null);if(je&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(xT(e,o),e===wt&&(ct=wt=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||nc||(nc=!0,eS(Jc,function(){return Xo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=kn.transition,kn.transition=null;var i=He;He=1;var l=je;je|=4,Km.current=null,jP(e,n),U1(n,e),rP(Wh),tu=!!Vh,Wh=Vh=null,e.current=n,_P(n),aT(),je=l,He=i,kn.transition=o}else e.current=n;if(nc&&(nc=!1,ls=e,xu=s),o=e.pendingLanes,o===0&&(ps=null),dT(n.stateNode),tn(e,lt()),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(gu)throw gu=!1,e=up,up=null,e;return xu&1&&e.tag!==0&&Xo(),o=e.pendingLanes,o&1?e===dp?Cl++:(Cl=0,dp=e):Cl=0,Ts(),null}function Xo(){if(ls!==null){var e=jb(xu),t=kn.transition,n=He;try{if(kn.transition=null,He=16>e?16:e,ls===null)var r=!1;else{if(e=ls,ls=null,xu=0,je&6)throw Error(J(331));var s=je;for(je|=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 d=u.child;if(d!==null)d.return=u,ae=d;else for(;ae!==null;){u=ae;var f=u.sibling,p=u.return;if(B1(u),u===c){ae=null;break}if(f!==null){f.return=p,ae=f;break}ae=p}}}var x=o.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==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:ad(9,l)}}catch(E){nt(l,l.return,E)}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(je=s,Ts(),rr&&typeof rr.onPostCommitFiberRoot=="function")try{rr.onPostCommitFiberRoot(ed,e)}catch{}r=!0}return r}finally{He=n,kn.transition=t}}return!1}function Hx(e,t,n){t=Ei(n,t),t=j1(e,t,1),e=hs(e,t,1),t=Bt(),e!==null&&(wa(e,1,t),tn(e,t))}function nt(e,t,n){if(e.tag===3)Hx(e,e,n);else for(;t!==null;){if(t.tag===3){Hx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ps===null||!ps.has(r))){e=Ei(n,e),e=_1(t,e,1),t=hs(t,e,1),e=Bt(),t!==null&&(wa(t,1,e),tn(t,e));break}}t=t.return}}function $P(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Bt(),e.pingedLanes|=e.suspendedLanes&n,wt===e&&(kt&n)===n&&(mt===4||mt===3&&(kt&130023424)===kt&&500>lt()-Gm?Zs(e,0):Ym|=n),tn(e,t)}function Z1(e,t){t===0&&(e.mode&1?(t=qa,qa<<=1,!(qa&130023424)&&(qa=4194304)):t=1);var n=Bt();e=jr(e,t),e!==null&&(wa(e,t,n),tn(e,n))}function FP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Z1(e,n)}function LP(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),Z1(e,n)}var J1;J1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Jt.current)Qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qt=!1,RP(e,t,n);Qt=!!(e.flags&131072)}else Qt=!1,Ke&&t.flags&1048576&&r1(t,au,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zc(e,t),e=t.pendingProps;var s=vi(t,zt.current);Qo(t,n),s=Bm(null,t,r,e,s,n);var o=Vm();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,en(r)?(o=!0,iu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Dm(t),s.updater=ld,t.stateNode=s,s._reactInternals=t,Jh(t,r,e,n),t=np(null,t,r,!0,o,n)):(t.tag=0,Ke&&o&&Im(t),Lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=BP(r),e=_n(r,e),s){case 0:t=tp(null,t,r,e,n);break e;case 1:t=jx(null,t,r,e,n);break e;case 11:t=Px(null,t,r,e,n);break e;case 14:t=Ix(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),tp(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),jx(e,t,r,s,n);case 3:e:{if(z1(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,s=o.element,c1(e,t),du(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=Ei(Error(J(423)),t),t=_x(e,t,r,n,s);break e}else if(r!==s){s=Ei(Error(J(424)),t),t=_x(e,t,r,n,s);break e}else for(an=fs(t.stateNode.containerInfo.firstChild),cn=t,Ke=!0,Dn=null,n=l1(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 u1(t),e===null&&Qh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Uh(r,s)?i=null:o!==null&&Uh(r,o)&&(t.flags|=32),A1(e,t),Lt(e,t,i,n),t.child;case 6:return e===null&&Qh(t),null;case 13:return D1(e,t,n);case 4:return $m(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),Px(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(cu,r._currentValue),r._currentValue=i,o!==null)if(Bn(o.value,i)){if(o.children===s.children&&!Jt.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=kr(-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),Xh(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),Xh(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=Nn(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),Ix(e,t,r,s,n);case 15:return O1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),zc(e,t),t.tag=1,en(r)?(e=!0,iu(t)):e=!1,Qo(t,n),I1(t,r,s),Jh(t,r,s,n),np(null,t,r,!0,e,n);case 19:return $1(e,t,n);case 22:return M1(e,t,n)}throw Error(J(156,t.tag))};function eS(e,t){return Rb(e,t)}function HP(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 Sn(e,t,n,r){return new HP(e,t,n,r)}function Jm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function BP(e){if(typeof e=="function")return Jm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ym)return 11;if(e===vm)return 14}return 2}function gs(e,t){var n=e.alternate;return n===null?(n=Sn(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 Fc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Jm(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case _o:return Js(n.children,s,o,t);case xm:i=8,s|=8;break;case Eh:return e=Sn(12,n,t,s|2),e.elementType=Eh,e.lanes=o,e;case kh:return e=Sn(13,n,t,s),e.elementType=kh,e.lanes=o,e;case Ch:return e=Sn(19,n,t,s),e.elementType=Ch,e.lanes=o,e;case ub:return ud(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ab:i=10;break e;case cb:i=9;break e;case ym:i=11;break e;case vm:i=14;break e;case qr:i=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=Sn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Js(e,t,n,r){return e=Sn(7,e,r,t),e.lanes=n,e}function ud(e,t,n,r){return e=Sn(22,e,r,t),e.elementType=ub,e.lanes=n,e.stateNode={isHidden:!1},e}function Cf(e,t,n){return e=Sn(6,e,null,t),e.lanes=n,e}function Nf(e,t,n){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function VP(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=of(0),this.expirationTimes=of(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=of(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function eg(e,t,n,r,s,o,i,l,a){return e=new VP(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Sn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dm(o),e}function WP(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 tS(e){if(!e)return ws;e=e._reactInternals;e:{if(xo(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(en(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(en(n))return t1(e,n,t)}return t}function nS(e,t,n,r,s,o,i,l,a){return e=eg(n,r,!0,e,s,o,i,l,a),e.context=tS(null),n=e.current,r=Bt(),s=ms(n),o=kr(r,s),o.callback=t??null,hs(n,o,s),e.current.lanes=s,wa(e,s,r),tn(e,r),e}function dd(e,t,n,r){var s=t.current,o=Bt(),i=ms(s);return n=tS(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=hs(s,t,i),e!==null&&(Hn(e,s,i,o),Oc(e,s,i)),i}function vu(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 Bx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tg(e,t){Bx(e,t),(e=e.alternate)&&Bx(e,t)}function UP(){return null}var rS=typeof reportError=="function"?reportError:function(e){console.error(e)};function ng(e){this._internalRoot=e}fd.prototype.render=ng.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));dd(e,t,null,null)};fd.prototype.unmount=ng.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lo(function(){dd(null,e,null,null)}),t[Ir]=null}};function fd(e){this._internalRoot=e}fd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gr.length&&t!==0&&t<Gr[n].priority;n++);Gr.splice(n,0,e),n===0&&zb(e)}};function rg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vx(){}function qP(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=vu(i);o.call(c)}}var i=nS(t,r,e,0,null,!1,!1,"",Vx);return e._reactRootContainer=i,e[Ir]=i.current,Fl(e.nodeType===8?e.parentNode:e),lo(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=vu(a);l.call(c)}}var a=eg(e,0,!1,null,null,!1,!1,"",Vx);return e._reactRootContainer=a,e[Ir]=a.current,Fl(e.nodeType===8?e.parentNode:e),lo(function(){dd(t,a,n,r)}),a}function pd(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=vu(i);l.call(a)}}dd(t,i,e,s)}else i=qP(n,t,e,s,r);return vu(i)}_b=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dl(t.pendingLanes);n!==0&&(Sm(t,n|1),tn(t,lt()),!(je&6)&&(ki=lt()+500,Ts()))}break;case 13:lo(function(){var r=jr(e,1);if(r!==null){var s=Bt();Hn(r,e,1,s)}}),tg(e,1)}};Em=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var n=Bt();Hn(t,e,134217728,n)}tg(e,134217728)}};Ob=function(e){if(e.tag===13){var t=ms(e),n=jr(e,t);if(n!==null){var r=Bt();Hn(n,e,t,r)}tg(e,t)}};Mb=function(){return He};Ab=function(e,t){var n=He;try{return He=e,t()}finally{He=n}};Ah=function(e,t,n){switch(t){case"input":if(Th(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=sd(r);if(!s)throw Error(J(90));fb(r),Th(r,s)}}}break;case"textarea":pb(e,n);break;case"select":t=n.value,t!=null&&qo(e,!!n.multiple,t,!1)}};bb=Qm;Sb=lo;var KP={usingClientEntryPoint:!1,Events:[Sa,zo,sd,vb,wb,Qm]},el={findFiberByHostInstance:Ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},YP={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:zr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Cb(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||UP,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 rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{ed=rc.inject(YP),rr=rc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KP;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rg(t))throw Error(J(200));return WP(e,t,null,n)};pn.createRoot=function(e,t){if(!rg(e))throw Error(J(299));var n=!1,r="",s=rS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=eg(e,1,!1,null,null,n,!1,r,s),e[Ir]=t.current,Fl(e.nodeType===8?e.parentNode:e),new ng(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=Cb(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return lo(e)};pn.hydrate=function(e,t,n){if(!hd(t))throw Error(J(200));return pd(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!rg(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=rS;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=nS(t,null,e,1,n??null,s,!1,o,i),e[Ir]=t.current,Fl(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 fd(t)};pn.render=function(e,t,n){if(!hd(t))throw Error(J(200));return pd(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!hd(e))throw Error(J(40));return e._reactRootContainer?(lo(function(){pd(null,null,e,!1,function(){e._reactRootContainer=null,e[Ir]=null})}),!0):!1};pn.unstable_batchedUpdates=Qm;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hd(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return pd(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function sS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sS)}catch(e){console.error(e)}}sS(),sb.exports=pn;var dn=sb.exports,GP,Wx=dn;GP=Wx.createRoot,Wx.hydrateRoot;function QP(e){return typeof e=="object"?e.key:e}function XP(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 Ux(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const qx=(e,t)=>Math.abs(e-t)<1.01,ZP=(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 Rf=()=>{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},Kx=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},JP=e=>e,eI=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},tI=(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(Kx(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(Kx(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},wu={passive:!0},nI=typeof window>"u"?!0:"onscrollend"in window,rI=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&nI;let i=0;const l=o?null:ZP(s,()=>t(n(r),!1),e.options.isScrollingResetDelay),a=d=>()=>{i=n(r),l==null||l(),t(i,d)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,wu),o&&r.addEventListener("scrollend",u,wu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u),l==null||l.cancel()}},sI=(e,t)=>rI(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),oI=(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"]},iI=(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})},lI=iI;function aI(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 cI{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:JP,rangeExtractor:eI,onChange:()=>{},measureElement:oI,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 d in n){const f=n[d];f!==void 0&&(s[d]=f)}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 d=o.count,f=s.count,p=this.getMeasurements(),x=((r=this._singleLaneMeasurements)==null?void 0:r.items)??p,v=w=>QP(x[w]),b=d>0?v(0):null,g=d>0?v(d-1):null;if(f!==d||d>0&&f>0&&(s.getItemKey(0)!==b||s.getItemKey(f-1)!==g)){a=!0;const w=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;w&&(i=[w.key,this.getScrollOffset()-w.start]);const E=s.followOnAppend===!0?"auto":s.followOnAppend||null;E&&f>0&&this.isAtEnd(o.scrollEndThreshold)&&(d===0||s.getItemKey(f-1)!==g)&&(f>d||aI(d,f,v,s.getItemKey))&&(l=E)}}this.options=s,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(i&&this.scrollOffset!==null){const[d,f]=i,p=this.getMeasurements(),{count:x,getItemKey:v}=this.options;let b=0;for(;b<x&&v(b)!==d;)b++;if(b<x){const g=p[b];if(g){const m=Math.max(0,g.start+f);!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,!(!Rf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,wu),i.addEventListener("touchend",a,wu),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&&(Rf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):((r=this.scrollState)==null?void 0:r.behavior)==="smooth"&&!qx(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 d;const f=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=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!y||y.length<m){const k=new Float64Array(m);y&&p>0&&k.set(y.subarray(0,p*2)),y=k}const w=p===0?new Array(n):this._singleLaneMeasurements.items.slice();let E;if(p===0)E=r+s;else{const k=p-1;E=y[k*2]+y[k*2+1]+c}for(let k=p;k<n;k++){const C=o(k);w[k]=C;const P=f.get(C),j=typeof P=="number"?P:this.options.estimateSize(k);y[k*2]=E,y[k*2+1]=j,E+=j+c}this._singleLaneMeasurements={flat:y,items:w};const N=XP(w,y);return this.measurementsCache=N,N}const x=this.measurementsCache.slice(0,p),v=new Array(l).fill(void 0),b=new Float64Array(l);let g=0;for(let m=0;m<p;m++){const y=x[m];y&&(v[y.lane]===void 0&&g++,v[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 E,N;const k=a==="estimate"||f.has(y);if(w!==void 0&&this.options.lanes>1){E=w;const A=v[E],D=A!==void 0?x[A]:void 0;N=D?D.end+c:r+s}else if(g===l){let A=0,D=b[0],z=v[0];for(let R=1;R<l;R++){const I=b[R];(I<D||I===D&&v[R]<z)&&(A=R,D=I,z=v[R])}E=A,N=D+c,k&&this.laneAssignments.set(m,E)}else E=m%this.options.lanes,N=r+s,k&&this.laneAssignments.set(m,E);const C=f.get(y),P=typeof C=="number"?C:this.options.estimateSize(m),j=N+P;x[m]={index:m,start:N,size:P,end:j,key:y,lane:E},v[E]===void 0&&g++,v[E]=m,b[E]=j}return this.measurementsCache=x,x},{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=dI(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 d=this.itemSizeCache.get(c)??l,f=r-d;if(f!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=p?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,g=!this.itemSizeCache.has(c)?a<v:a+d<=v&&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},f,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()-x):m&&(y=this.applyScrollAdjustment(f)),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=oS(0,s.length-1,i?a=>o[a*2]:a=>Ux(s[a]).start,n);return Ux(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(Rf()&&(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&&qx(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 oS=(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 uI(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 dI(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=uI(s,o,n);let u=c;const d=n+t;for(;u<o&&s[u*2]+s[u*2+1]<d;)u++;return{startIndex:c,endIndex:u}}let l=oS(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(d=>d<n+t);){const d=e[a];c[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(d=>d>=n);){const d=e[l];u[d.lane]=d.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const Tf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function fI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(d=>d+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=d=>{const f=o.current;if(!f.enabled||!f.container)return;const p=d.getTotalSize();if(p!==f.lastSize){f.lastSize=p;const x=d.options.horizontal?"width":"height";f.container.style[x]=`${p}px`}},a=d=>{const f=o.current;if(!f.enabled||!f.container)return;l(d);const p=!!d.options.horizontal,x=f.mode==="transform",v=p?"left":"top",b=d.options.scrollMargin,g=d.getVirtualItems();for(const m of g){const y=m.start-b,w=d.elementsCache.get(m.key);w&&f.lastPositions.get(w)!==y&&(f.lastPositions.set(w,y),x?w.style.transform=p?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:w.style[v]=`${y}px`)}},c={...r,onChange:(d,f)=>{var p;const x=o.current;let v=!0;if(x.enabled){a(d);const b=d.range,g=x.prevRange;v=!g||g.isScrolling!==d.isScrolling||g.startIndex!==(b==null?void 0:b.startIndex)||g.endIndex!==(b==null?void 0:b.endIndex),v&&(x.prevRange=b?{startIndex:b.startIndex,endIndex:b.endIndex,isScrolling:d.isScrolling}:null)}v&&(e&&f&&!i.current?dn.flushSync(s):s()),(p=r.onChange)==null||p.call(r,d,f)}},[u]=S.useState(()=>{const d=new cI(c),f=d.measureElement;return d.measureElement=p=>{i.current=!0;try{f(p)}finally{i.current=!1}},Object.assign(d,{containerRef:p=>{const x=o.current;if(x.container=p,x.lastSize=null,p&&x.enabled){const v=d.getTotalSize();x.lastSize=v;const b=d.options.horizontal?"width":"height";p.style[b]=`${v}px`}}})});return u.setOptions(c),Tf(()=>u._didMount(),[]),Tf(()=>(l(u),u._willUpdate())),Tf(()=>{a(u)}),u}function sg(e){return fI({observeElementRect:tI,observeElementOffset:sI,scrollToFn:lI,...e})}function bn(e){return encodeURIComponent(String(e))}function Vo(e,t){const n=[],r=s=>t!=null&&t.prefix?`${t.prefix}[${bn(s)}]`:bn(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)}[]=${bn(i)}`);else if(typeof o=="object")for(const[i,l]of Object.entries(o))l!=null&&n.push(`${r(s)}[${bn(i)}]=${bn(l)}`);else n.push(`${r(s)}=${bn(o)}`);return n.join("&")}function iS(e,t){const n=[];return pp(e,(t==null?void 0:t.prefix)??"where",n),n.join("&")}function hI(e){var s;const t=[],{where:n,...r}=e.filter??{};if(n!=null&&n.length&&t.push(iS(n,{prefix:"filter[where]"})),t.push(Vo(r,{prefix:"filter"})),e.search&&t.push(`search=${bn(e.search)}`),(s=e.sort)!=null&&s.length){const o=e.sort.map(i=>`${i.direction==="desc"?"-":""}${i.field}`).join(",");t.push(`sort=${bn(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 pp(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]=${bn(s.field)}`),s.operator!==void 0&&n.push(`${o}[operator]=${bn(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}]=${bn(s.value[i])}`);else n.push(`${o}[value]=${bn(s.value)}`);s.AND&&s.AND.length>0&&pp(s.AND,`${o}[AND]`,n),s.OR&&s.OR.length>0&&pp(s.OR,`${o}[OR]`,n)}}const pI=["equals","notEquals","contains","notContains","iContains","startsWith","endsWith","gt","gte","lt","lte","between","notBetween","in","notIn","isAnyOf","isEmpty","isNotEmpty","isNull","isNotNull","exists","notExists"],mI=["equals","notEquals","gt","gte","lt","lte"],gI=["contains","notContains","iContains","startsWith","endsWith"],xI=["in","notIn","isAnyOf"],yI=["between","notBetween"],vI=["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"],wI=["gt","gte","lt","lte"],bI=new Set(mI),SI=new Set(gI),EI=new Set(xI),kI=new Set(yI),mp=new Set(vI),CI=new Set(wI);function sc(e,t){if(!mp.has(e)){if(SI.has(e)){if(typeof t!="string")throw new Error(`Operator "${e}" expects a string value.`);return}if(kI.has(e)){if(!Array.isArray(t)||t.length!==2)throw new Error(`Operator "${e}" expects [low, high] tuple.`);return}if(EI.has(e)){if(!Array.isArray(t))throw new Error(`Operator "${e}" expects an array value.`);return}if(bI.has(e)){if(Array.isArray(t))throw new Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`);return}}}function NI(e){if(!CI.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 bu{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;sc(s,r),this.conditions.push({field:t,operator:s,value:mp.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)?(sc(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(!pI.includes(n))throw new Error(`Unknown filter operator "${String(n)}".`);return sc(n,r),this.conditions=this.conditions.filter(s=>s.field!==t),this.conditions.push({field:t,operator:n,value:mp.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 NI(n),sc(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 bu;return t(n),this.groups.push({type:"OR",conditions:n.conditions}),this.notify(),this}and(t){const n=new bu;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=iS(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 RI(){return new bu}const TI={eq:"equals",ne:"notEquals",gt:"gt",gte:"gte",lt:"lt",lte:"lte",in:"in"};function Yx(e){return e==="true"?!0:e==="false"?!1:e!==""&&!Number.isNaN(Number(e))?Number(e):e}function oc(e,t={},n){const r=RI(),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?TI[a]:void 0;if(!l||!u||c.length===0)continue;const d=c.join(":");r.where(`attr.${l}`,u,a==="in"?d.split("|").filter(Boolean).map(Yx):Yx(d))}const o=r.build();return hI({...o,filter:{...o.filter,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset}},...n&&{groupByCount:n}})}function PI(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function og(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(d=>d.at),l=i.length?i.reduce((d,f)=>f<d?f:d,Number.POSITIVE_INFINITY):void 0,c=PI((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 lS={kind:"all"},md="app";function Hi(e){const t=e==null?void 0:e.trim();return t||void 0}function II(e){return Hi(e)===void 0}function ka(e){const t=Hi(e);if(t===void 0)return md;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function jI(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function aS(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function _I(e,t){if(t.kind==="all")return!0;const n=Hi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}const ig="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 OI(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:lS,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:ka(o),title:o,count:t.get(o)??0});return n>0&&s.push({filter:{kind:"unknown"},label:md,title:ig,count:n}),s}function MI(e){return e.some(t=>t.filter.kind==="origin")}function AI(e){return e.reduce((t,n)=>t+(II(n.origin??void 0)?n.count:0),0)}function zI(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 ${ka(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const Gx="compensate:";function DI(e){return e.startsWith(Gx)?e.slice(Gx.length):e}function $I(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 FI(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 LI=10*60*1e3;function HI(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>LI}const cS=["running","suspended","cancelling"],BI=new Set(cS);function gp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function Pf(e,t){const n=gp(e),r=t.filter(i=>gp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function VI(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 WI(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 BI.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 UI(e){return`${e.on} ${e.name}`}function uS(e,t){var s,o;if(e.status!=="suspended")return e.status==="pending"&&Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=WI(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:VI(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&Pf(r.workerGroup,t.health)?{status:"no-worker",detail:gp(r.workerGroup)}:{status:"running"}}return e.waiting?{status:"awaiting",detail:UI(e.waiting)}:Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function qI(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 dS(){return typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}function fS(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${dS()}/api`}async function KI(e){try{const t=await e.json();if(typeof t!="object"||t===null||!("auth"in t))return;const n=t.auth;if(typeof n!="object"||n===null||!("modes"in n))return;const r=n.modes;return Array.isArray(r)?r.filter(s=>typeof s=="string"):void 0}catch{return}}function YI(e){if(typeof window>"u")return;const t=dS();if(e!=null&&e.includes("login")){const n=encodeURIComponent(window.location.pathname+window.location.search);window.location.href=`${t}/login?returnTo=${n}`;return}window.location.href=t}async function dt(e,t){const n=await fetch(fS()+e,t);if(n.status===401)throw YI(await KI(n)),new Error("Session expired; redirecting to sign-in.");if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const Fe={runs(e,t,n,r){const s=oc({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 dt(s?`/runs?${s}`:"/runs")},facets(e,t,n){const r=oc({tag:e,attr:t,namespace:n});return dt(r?`/runs/facets?${r}`:"/runs/facets")},values(e,t={},n){var s;const r=oc(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 dt(`/runs/values?${r}`)},run(e){return dt(`/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 dt(s?`${o}?${s}`:o)},workers(){return dt("/workers")},schedules(){return dt("/schedules")},pauseSchedule(e){return dt(`/schedules/${encodeURIComponent(e)}/pause`,{method:"POST"})},resumeSchedule(e){return dt(`/schedules/${encodeURIComponent(e)}/resume`,{method:"POST"})},triggerSchedule(e){return dt(`/schedules/${encodeURIComponent(e)}/trigger`,{method:"POST"})},topology(){return dt("/topology")},retry(e){return dt(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return dt(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=oc(t);return dt(`/bulk/${e}${n?`?${n}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return dt(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},workflowLifecycle(e){return dt(`/workflows/${encodeURIComponent(e)}/lifecycle`)},republishLifecycle(e,t){return dt(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:"POST",...t!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify({subscriber:t})}:{}})},continue(e){return dt(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},redispatch(e){return dt(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${fS()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}},GI=200;class QI{constructor(t=GI){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 Su(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 XI(e){const t=new Map;for(const r of e){const s=Su(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 ZI(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 JI(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 ej(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:Su(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=Su(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 tj(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 nj(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 rj(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 Vn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function hS(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),h.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function sj(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function oj(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"13",r:"8"}),h.jsx("path",{d:"M12 13V9M9 2h6"})]})}function ij(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"2"}),h.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 lg(e){return h.jsx("svg",{...Vn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"m4 12 5 5L20 6"})})}function bs(e){return h.jsx("svg",{...Vn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function lj(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),h.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function If(e){return h.jsx("svg",{...Vn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function ku(e){return h.jsx("svg",{...Vn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function aj(e){return h.jsx("svg",{...Vn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 4l14 8-14 8z"})})}function ag(e){return h.jsxs("svg",{...Vn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"6",cy:"5",r:"2"}),h.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),h.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const cj={local:hS,remote:sj,sleep:oj,signal:ij,child:ag};function cg(e){return cj[e]??hS}const xp={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function pS(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=pS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=pS(e))&&(r&&(r+=" "),r+=t);return r}const Qx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xx=mS,gS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xx(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],d=o==null?void 0:o[c];if(u===null)return null;const f=Qx(u)||Qx(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...c,d,f]:c},[]);return Xx(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},uj=(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},dj=(e,t)=>({classGroupId:e,validator:t}),xS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cu="-",Zx=[],fj="arbitrary..",hj=e=>{const t=mj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return pj(i);const l=i.split(Cu),a=l[0]===""&&l.length>1?1:0;return yS(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?uj(c,a):a:c||Zx}return n[i]||Zx}}},yS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=yS(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(Cu):e.slice(t).join(Cu),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},pj=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?fj+r:void 0})(),mj=e=>{const{theme:t,classGroups:n}=e;return gj(n,t)},gj=(e,t)=>{const n=xS();for(const r in e){const s=e[r];ug(s,n,r,t)}return n},ug=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];xj(i,t,n,r)}},xj=(e,t,n,r)=>{if(typeof e=="string"){yj(e,t,n);return}if(typeof e=="function"){vj(e,t,n,r);return}wj(e,t,n,r)},yj=(e,t,n)=>{const r=e===""?t:vS(t,e);r.classGroupId=n},vj=(e,t,n,r)=>{if(bj(e)){ug(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(dj(n,e))},wj=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];ug(a,vS(t,l),n,r)}},vS=(e,t)=>{let n=e;const r=t.split(Cu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=xS(),n.nextPart.set(i,l)),n=l}return n},bj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Sj=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)}}},yp="!",Jx=":",Ej=[],ey=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),kj=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 v=0;v<u;v++){const b=s[v];if(i===0&&l===0){if(b===Jx){o.push(s.slice(a,v)),a=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const d=o.length===0?s:s.slice(a);let f=d,p=!1;d.endsWith(yp)?(f=d.slice(0,-1),p=!0):d.startsWith(yp)&&(f=d.slice(1),p=!0);const x=c&&c>a?c-a:void 0;return ey(o,p,f,x)};if(t){const s=t+Jx,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):ey(Ej,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Cj=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}},Nj=e=>({cache:Sj(e.cacheSize),parseClassName:kj(e),sortModifiers:Cj(e),postfixLookupClassGroupIds:Rj(e),...hj(e)}),Rj=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},Tj=/\s+/,Pj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(Tj);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!b,m;if(g){const k=v.substring(0,b);m=r(k);const C=m&&i[m]?r(v):void 0;C&&C!==m&&(m=C,g=!1)}else m=r(v);if(!m){if(!g){c=d+(c.length>0?" "+c:c);continue}if(m=r(v),!m){c=d+(c.length>0?" "+c:c);continue}g=!1}const y=p.length===0?"":p.length===1?p[0]:o(p).join(":"),w=x?y+yp:y,E=w+m;if(l.indexOf(E)>-1)continue;l.push(E);const N=s(m,g);for(let k=0;k<N.length;++k){const C=N[k];l.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},Ij=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=wS(n))&&(s&&(s+=" "),s+=r);return s},wS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wS(e[r]))&&(n&&(n+=" "),n+=t);return n},jj=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,d)=>d(u),e());return n=Nj(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=Pj(a,n);return s(a,u),u};return o=i,(...a)=>o(Ij(...a))},_j=[],ft=e=>{const t=n=>n[e]||_j;return t.isThemeGetter=!0,t},bS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,SS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aj=/\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$/,zj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Dj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Br=e=>Oj.test(e),be=e=>!!e&&!Number.isNaN(Number(e)),Gn=e=>!!e&&Number.isInteger(Number(e)),jf=e=>e.endsWith("%")&&be(e.slice(0,-1)),cr=e=>Mj.test(e),ES=()=>!0,Fj=e=>Aj.test(e)&&!zj.test(e),dg=()=>!1,Lj=e=>Dj.test(e),Hj=e=>$j.test(e),Bj=e=>!ie(e)&&!le(e),Vj=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)),Wj=e=>Ps(e,NS,dg),ie=e=>bS.test(e),js=e=>Ps(e,RS,Fj),ty=e=>Ps(e,Zj,be),Uj=e=>Ps(e,PS,ES),qj=e=>Ps(e,TS,dg),ny=e=>Ps(e,kS,dg),Kj=e=>Ps(e,CS,Hj),ic=e=>Ps(e,IS,Lj),le=e=>SS.test(e),nl=e=>yo(e,RS),Yj=e=>yo(e,TS),ry=e=>yo(e,kS),Gj=e=>yo(e,NS),Qj=e=>yo(e,CS),lc=e=>yo(e,IS,!0),Xj=e=>yo(e,PS,!0),Ps=(e,t,n)=>{const r=bS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},yo=(e,t,n=!1)=>{const r=SS.exec(e);return r?r[1]?t(r[1]):n:!1},kS=e=>e==="position"||e==="percentage",CS=e=>e==="image"||e==="url",NS=e=>e==="length"||e==="size"||e==="bg-size",RS=e=>e==="length",Zj=e=>e==="number",TS=e=>e==="family-name",PS=e=>e==="number"||e==="weight",IS=e=>e==="shadow",Jj=()=>{const e=ft("color"),t=ft("font"),n=ft("text"),r=ft("font-weight"),s=ft("tracking"),o=ft("leading"),i=ft("breakpoint"),l=ft("container"),a=ft("spacing"),c=ft("radius"),u=ft("shadow"),d=ft("inset-shadow"),f=ft("text-shadow"),p=ft("drop-shadow"),x=ft("blur"),v=ft("perspective"),b=ft("aspect"),g=ft("ease"),m=ft("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"],E=()=>[...w(),le,ie],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[le,ie,a],P=()=>[Br,"full","auto",...C()],j=()=>[Gn,"none","subgrid",le,ie],A=()=>["auto",{span:["full",Gn,le,ie]},Gn,le,ie],D=()=>[Gn,"auto",le,ie],z=()=>["auto","min","max","fr",le,ie],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...C()],F=()=>[Br,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],T=()=>[Br,"screen","full","dvw","lvw","svw","min","max","fit",...C()],M=()=>[Br,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],O=()=>[e,le,ie],V=()=>[...w(),ry,ny,{position:[le,ie]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",Gj,Wj,{size:[le,ie]}],W=()=>[jf,nl,js],U=()=>["","none","full",c,le,ie],L=()=>["",be,nl,js],Q=()=>["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"],q=()=>[be,jf,ry,ny],Z=()=>["","none",x,le,ie],Y=()=>["none",be,le,ie],G=()=>["none",be,le,ie],X=()=>[be,le,ie],te=()=>[Br,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[cr],breakpoint:[cr],color:[ES],container:[cr],"drop-shadow":[cr],ease:["in","out","in-out"],font:[Bj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[cr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[cr],shadow:[cr],spacing:["px",be],text:[cr],"text-shadow":[cr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Br,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[Vj],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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],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:[Gn,"auto",le,ie]}],basis:[{basis:[Br,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[be,Br,"auto","initial","none",ie]}],grow:[{grow:["",be,le,ie]}],shrink:[{shrink:["",be,le,ie]}],order:[{order:[Gn,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],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:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"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,js]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Xj,Uj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jf,ie]}],"font-family":[{font:[Yj,qj,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,ty]}],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:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[be,"from-font","auto",le,js]}],"text-decoration-color":[{decoration:O()}],"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:[Gn,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:V()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gn,le,ie],radial:["",le,ie],conic:[Gn,le,ie]},Qj,Kj]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[be,le,ie]}],"outline-w":[{outline:["",be,nl,js]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,lc,ic]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,lc,ic]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[be,js]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,lc,ic]}],"text-shadow-color":[{"text-shadow":O()}],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":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:Z()}],brightness:[{brightness:[be,le,ie]}],contrast:[{contrast:[be,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,lc,ic]}],"drop-shadow-color":[{"drop-shadow":O()}],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":Z()}],"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:[v,le,ie]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"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:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],zoom:[{zoom:[Gn,le,ie]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"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",...O()]}],"stroke-w":[{stroke:[be,nl,js,ty]}],stroke:[{stroke:["none",...O()]}],"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"]}},e_=jj(Jj);function st(...e){return e_(mS(e))}const jS=gS("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)=>h.jsx("span",{ref:r,className:st(jS({variant:t}),e),...n}));Xe.displayName="Badge";const t_=gS("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)=>h.jsx("button",{ref:o,type:r??"button",className:st(t_({variant:t,size:n}),e),...s}));Se.displayName="Button";const fg=S.forwardRef(({className:e,...t},n)=>h.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}));fg.displayName="Input";const sy={};function Tn(e,t){const n=S.useRef(sy);return n.current===sy&&(n.current=e(t)),n}const vp=[];let wp;function n_(){return wp}function r_(e){vp.push(e)}function gd(e){const t=(n,r)=>{const s=Tn(s_).current;let o;try{wp=s;for(const i of vp)i.before(s);o=e(n,r);for(const i of vp)i.after(s);s.didInitialize=!0}finally{wp=void 0}return o};return t.displayName=e.displayName||e.name,t}function _S(e){return S.forwardRef(gd(e))}function s_(){return{didInitialize:!1}}function hg(){}const Yl=Object.freeze([]),Et=Object.freeze({});function pg(e){S.useEffect(e,Yl)}const rl=0;class Pn{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 Pn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rl,n()},t)}isStarted(){return this.currentId!==rl}}function Or(){const e=Tn(Pn.create).current;return pg(e.disposeEffect),e}const o_=()=>{},fe=typeof document<"u"?S.useLayoutEffect:o_;function i_(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:l_,platform:a_,maxTouchPoints:c_}=i_(),xd=l_.toLowerCase(),Gl=a_.toLowerCase(),yd=/^i(os$|p)/.test(Gl)||Gl==="macintel"&&c_>1,oy="android",bp=Gl===oy||xd.includes(oy),OS=!yd&&Gl.startsWith("mac");Gl.startsWith("win");const u_=OS||yd;var kw;const vo=typeof CSS<"u"&&!!((kw=CSS.supports)!=null&&kw.call(CSS,"-webkit-backdrop-filter:none"));!vo&&xd.includes("firefox");!vo&&xd.includes("chrom");const d_=u_,MS=/jsdom|happydom/.test(xd);function f_(e){e.preventDefault(),e.stopPropagation()}function h_(e){return"nativeEvent"in e}function AS(e){return e.pointerType===""&&e.isTrusted?!0:bp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function zS(e){return MS?!1:!bp&&e.width===0&&e.height===0||bp&&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 xs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function p_(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function vd(){return typeof window<"u"}function Nt(e){return mg(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dr(e){var t;return(t=(mg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mg(e){return vd()?e instanceof Node||e instanceof ot(e).Node:!1}function Ce(e){return vd()?e instanceof Element||e instanceof ot(e).Element:!1}function Ve(e){return vd()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function Ci(e){return!vd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function Ca(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 m_(e){return/^(table|td|th)$/.test(Nt(e))}function wd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const g_=/transform|translate|scale|rotate|perspective|filter/,x_=/paint|layout|strict|content/,_s=e=>!!e&&e!=="none";let _f;function gg(e){const t=Ce(e)?fn(e):e;return _s(t.transform)||_s(t.translate)||_s(t.scale)||_s(t.rotate)||_s(t.perspective)||!xg()&&(_s(t.backdropFilter)||_s(t.filter))||g_.test(t.willChange||"")||x_.test(t.contain||"")}function y_(e){let t=Ss(e);for(;Ve(t)&&!ys(t);){if(gg(t))return t;if(wd(t))return null;t=Ss(t)}return null}function xg(){return _f==null&&(_f=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_f}function ys(e){return/^(html|body|#document)$/.test(Nt(e))}function fn(e){return ot(e).getComputedStyle(e)}function bd(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ss(e){if(Nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ci(e)&&e.host||Dr(e);return Ci(t)?t.host:t}function DS(e){const t=Ss(e);return ys(t)?(e.ownerDocument||e).body:Ve(t)&&Ca(t)?t:DS(t)}function Ql(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=DS(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=ot(s);if(o){const l=Sp(i);return t.concat(i,i.visualViewport||[],Ca(s)?s:[],l&&n?Ql(l):[])}else return t.concat(s,Ql(s,[],n))}function Sp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yn(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 ye(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 At(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Ep="data-base-ui-focusable",$S="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",FS="data-starting-style",v_="data-ending-style",w_={[FS]:""},b_={[v_]:""},yg={transitionStatus(e){return e==="starting"?w_:e==="ending"?b_:null}},S_="data-open",E_="data-closed",k_="data-anchor-hidden",LS="data-popup-open",C_="data-pressed",N_={[LS]:""},R_={[LS]:"",[C_]:""},T_={[S_]:""},P_={[E_]:""},I_={[k_]:""},HS={open(e){return e?N_:null}},j_={open(e){return e?R_:null}},vg={open(e){return e?T_:P_},anchorHidden(e){return e?I_:null}},wg={...vg,...yg},kp="data-trigger-disabled";function Nu(e,t){if(!Ce(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(kp);for(const[,r]of t.entries())if(ye(r,n))return!r.hasAttribute(kp);return!1}function Of(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 __(e){return e.matches("html,body")}function Sd(e){return Ve(e)&&e.matches($S)}function O_(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${$S}`))!=null}function iy(e){return e?e.getAttribute("role")==="combobox"&&Sd(e):!1}function M_(e){if(!e||MS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ly(e){return e?e.hasAttribute(Ep)?e:e.querySelector(`[${Ep}]`)||e:null}function A_(e,t){return t!=null&&!xs(t)?0:typeof e=="function"?e():e}function ao(e,t,n){const r=A_(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function ay(e){return typeof e=="function"?e():e}function BS(e,t){return t||e==="click"||e==="mousedown"}function z_(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const Ed="none",Es="trigger-press",St="trigger-hover",Lc="trigger-focus",VS="outside-press",WS="close-press",Xl="focus-out",kd="escape-key",US="disabled",cy="missing",uy="initial",bg="imperative-action";function De(e,t,n,r){let s=!1,o=!1;const i=r??Et;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 qS=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Pn,currentIdRef:{current:null},currentContextRef:{current:null}});function D_(e,t){e.current=t.current}function $_(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=Or();return fe(()=>{if(o.current=n,!i.current){s.current=n;return}s.current={open:ao(s.current,"open"),close:ao(n,"close")}},[n,i,s,o]),h.jsx(qS.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function F_(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(qS),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:d,timeout:f}=o,[p,x]=S.useState(!1),v=S.useRef(n);return fe(()=>{v.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,f.clear()}if(i.current&&!n&&i.current===s){if(x(!1),a){const g=s;return f.start(a,()=>{r.select("open")||i.current&&i.current!==g||b()}),()=>{(v.current||i.current!==g)&&f.clear()}}b()}},[n,s,i,l,a,c,u,f,r]),fe(()=>{if(!n)return;const b=u.current,g=i.current;f.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:x},i.current=s,l.current={open:0,close:ao(c.current,"close")},g!==null&&g!==s?(x(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,De(Ed))):(x(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,f]),fe(()=>()=>{if(i.current===s){if(u.current=null,!v.current)return;i.current=null,D_(l,c),f.clear()}},[u,i,l,s,c,f]),S.useMemo(()=>({activeIdRef:i,hasProvider:d,delayRef:l,isInstantPhase:p}),[i,d,l,p])}function Ee(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function or(...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=Tn(KS).current;return H_(s,e,t,n,r)&&YS(s,[e,t,n,r]),s.callback}function L_(e){const t=Tn(KS).current;return B_(t,e)&&YS(t,e),t.callback}function KS(){return{callback:null,cleanup:null,refs:[]}}function H_(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function B_(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function YS(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=Tn(V_,e).current;return t.next=e,fe(t.effect),t}function V_(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Sg={...lR},Mf=Sg.useInsertionEffect,W_=Mf&&Mf!==Sg.useLayoutEffect?Mf:e=>e();function me(e){const t=Tn(U_).current;return t.next=e,W_(t.effect),t.trampoline}function U_(){const e={next:void 0,callback:q_,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function q_(){}const ac=null;class K_{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 cc=new K_;class er{constructor(){ge(this,"currentId",ac);ge(this,"cancel",()=>{this.currentId!==ac&&(cc.cancel(this.currentId),this.currentId=ac)});ge(this,"disposeEffect",()=>this.cancel)}static create(){return new er}static request(t){return cc.request(t)}static cancel(t){return cc.cancel(t)}request(t){this.cancel(),this.currentId=cc.request(()=>{this.currentId=ac,t()})}}function Eg(){const e=Tn(er.create).current;return pg(e.disposeEffect),e}function Le(e){return(e==null?void 0:e.ownerDocument)||document}const Y_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},G_={...Y_,position:"fixed",top:0,left:0},Ri=S.forwardRef(function(t,n){const[r,s]=S.useState();fe(()=>{d_&&vo&&s("button")},[]);const o={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:G_,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Ti=Math.min,Cr=Math.max,Ru=Math.round,uc=Math.floor,Nr=e=>({x:e,y:e}),Q_={left:"right",right:"left",bottom:"top",top:"bottom"};function GS(e,t,n){return Cr(e,Ti(t,n))}function ks(e,t){return typeof e=="function"?e(t):e}function Cn(e){return e.split("-")[0]}function Mr(e){return e.split("-")[1]}function kg(e){return e==="x"?"y":"x"}function Cg(e){return e==="y"?"height":"width"}function En(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ng(e){return kg(En(e))}function X_(e,t,n){n===void 0&&(n=!1);const r=Mr(e),s=Ng(e),o=Cg(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Tu(i)),[i,Tu(i)]}function Z_(e){const t=Tu(e);return[Cp(e),t,Cp(t)]}function Cp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const dy=["left","right"],fy=["right","left"],J_=["top","bottom"],eO=["bottom","top"];function tO(e,t,n){switch(e){case"top":case"bottom":return n?t?fy:dy:t?dy:fy;case"left":case"right":return t?J_:eO;default:return[]}}function nO(e,t,n,r){const s=Mr(e);let o=tO(Cn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Cp)))),o}function Tu(e){const t=Cn(e);return Q_[t]+e.slice(t.length)}function rO(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 QS(e){return typeof e!="number"?rO(e):{top:e,right:e,bottom:e,left:e}}function Pu(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 Af(e,t){return t<0||t>=e.length}function sO(e,t){return Nl(e.current,{disabledIndices:t})}function oO(e,t){return Nl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nl(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&&Rl(e,o,r));return o}function Rl(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?!Rg(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function iO(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Rg(e,t=e?fn(e):null){return!e||!e.isConnected||!t||iO(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const lO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function aO(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 Np(e){for(const t of Array.from(e.children))if(Nt(t)==="summary")return t;return null}function cO(e,t){const n=Np(t);return!!n&&(e===n||ye(n,e))}function XS(e){const t=e?Nt(e):"";return e!=null&&e.matches(lO)&&(t!=="summary"||e.parentElement!=null&&Nt(e.parentElement)==="details"&&Np(e.parentElement)===e)&&(t!=="details"||Np(e)==null)&&(t!=="input"||e.type!=="hidden")}function ZS(e){if(!XS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=aO(t)){const n=t!==e,r=Nt(t)==="slot";if(t.hasAttribute("inert")||n&&Nt(t)==="details"&&!t.open&&!cO(e,t)||t.hasAttribute("hidden")||!r&&!uO(t,n))return!1}return!0}function uO(e,t){const n=fn(e);return t?n.display!=="none":Rg(e,n)}function JS(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 zf(e){if(Nt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function dO(e,t){const n=zf(e);if(!n)return!0;const r=t.find(s=>{const o=zf(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=zf(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function eE(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 tE(e,t){eE(e).forEach(n=>{XS(n)&&t.push(n),tE(n,t)})}function nE(e,t,n){eE(e).forEach(r=>{Ve(r)&&r.matches(t)&&n.push(r),nE(r,t,n)})}function Tg(e){return ZS(e)&&JS(e)>=0}function rE(e){const t=[];return tE(e,t),t.filter(ZS)}function Na(e){const t=rE(e);return t.filter(n=>JS(n)>=0&&dO(n,t))}function sE(e,t){const n=Na(e),r=n.length;if(r===0)return;const s=yn(Le(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function Pg(e){return sE(Le(e).body,1)||e}function oE(e){return sE(Le(e).body,-1)||e}function iE(e,t){if(!e)return null;const n=Na(Le(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 fO(e){return iE(e,1)}function hO(e){return iE(e,-1)}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ye(n,r)}function pO(e){Na(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function hy(e){const t=[];nE(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 Cs(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...Cs(e,s.id,n)]})}function py(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 Zl(e){return`data-base-ui-${e}`}let dc=0;function Df(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(dc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),hg;const i=requestAnimationFrame(o);return dc=i,()=>{dc===i&&(cancelAnimationFrame(i),dc=0)}}const $f={inert:new WeakMap,"aria-hidden":new WeakMap},my="data-base-ui-inert",Rp={inert:new WeakSet,"aria-hidden":new WeakSet};let sl=new WeakMap,Ff=0;function mO(e){return Rp[e]}function lE(e){return e?Ci(e)?e.host:lE(e.parentNode):null}const gy=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=lE(n);return e.contains(r)?r:null}).filter(n=>n!=null),xy=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},yy=(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 gO(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=gy(t,e),c=s?yy(t,xy(a),new Set(a)):[],u=[],d=[];if(o){const f=$f[o],p=mO(o);l=p,i=f;const x=gy(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(x);yy(t,xy(v),new Set(v)).forEach(g=>{const m=g.getAttribute(o),y=m!==null&&m!=="false",w=(f.get(g)||0)+1;f.set(g,w),u.push(g),w===1&&y&&p.add(g),y||g.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(f=>{const p=(sl.get(f)||0)+1;sl.set(f,p),d.push(f),p===1&&f.setAttribute(my,"")}),Ff+=1,()=>{i&&u.forEach(f=>{const x=(i.get(f)||0)-1;i.set(f,x),x||(!(l!=null&&l.has(f))&&o&&f.removeAttribute(o),l==null||l.delete(f))}),s&&d.forEach(f=>{const p=(sl.get(f)||0)-1;sl.set(f,p),p||f.removeAttribute(my)}),Ff-=1,Ff||($f.inert=new WeakMap,$f["aria-hidden"]=new WeakMap,Rp.inert=new WeakSet,Rp["aria-hidden"]=new WeakSet,sl=new WeakMap)}}function vy(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=Le(e[0]).body;return gO(e,o,n,r,{mark:s})}let wy=0;function xO(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(wy+=1,r(`${t}-${wy}`))},[n,t]),s}const by=Sg.useId;function Cd(e,t){if(by!==void 0){const n=by();return e??(t?`${t}-${n}`:n)}return xO(e,t)}function yO(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 nn=yO("https://base-ui.com/production-error","Base UI"),vO=parseInt(S.version,10);function Ig(e){return vO>=e}function Sy(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Ig(19)?n==null?void 0:n.ref:t.ref)??null}function Tp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function wO(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 bO(e,t){return typeof e=="function"?e(t):e}function SO(e,t){return typeof e=="function"?e(t):e}const jg={};function Nd(e,t,n,r,s){if(!n&&!r&&!e)return Iu(t);let o=Iu(e);return t&&(o=Hc(o,t)),n&&(o=Hc(o,n)),r&&(o=Hc(o,r)),o}function EO(e){if(e.length===0)return jg;if(e.length===1)return Iu(e[0]);let t=Iu(e[0]);for(let n=1;n<e.length;n+=1)t=Hc(t,e[n]);return t}function Iu(e){return _g(e)?{...cE(e,jg)}:kO(e)}function Hc(e,t){return _g(t)?cE(t,e):CO(e,t)}function kO(e){const t={...e};for(const n in t){const r=t[n];aE(n,r)&&(t[n]=uE(r))}return t}function CO(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Tp(e.style,r);break}case"className":{e[n]=dE(e.className,r);break}default:aE(n,r)?e[n]=NO(e[n],r):e[n]=r}}return e}function aE(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 _g(e){return typeof e=="function"}function cE(e,t){return _g(e)?e(t):e??jg}function NO(e,t){return t?e?(...n)=>{const r=n[0];if(fE(r)){const o=r;ju(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:uE(t):e}function uE(e){return e&&((...t)=>{const n=t[0];return fE(n)&&ju(n),e(...t)})}function ju(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dE(e,t){return t?e?t+" "+e:t:e}function fE(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ut(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=IO(r));const s=RO(t,n,r);if(n.enabled===!1)return null;const o=n.state??Et;return jO(e,r,s,o)}function RO(e,t,n){const{className:r,style:s}=e,{state:o=Et,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?bO(r,o):void 0,d=c?SO(s,o):void 0,f=c?wO(o,a):Et,p=c&&l?TO(l):void 0,x=c?Tp(f,p)??{}:Et;return typeof document<"u"&&(c?Array.isArray(i)?x.ref=L_([x.ref,Sy(n),...i]):x.ref=Ni(x.ref,Sy(n),i):Ni(null,null)),c?(u!==void 0&&(x.className=dE(x.className,u)),d!==void 0&&(x.style=Tp(x.style,d)),x):Et}function TO(e){return Array.isArray(e)?EO(e):Nd(void 0,e)}const PO=Symbol.for("react.lazy");function IO(e){if((e==null?void 0:e.$$typeof)!==PO)return e;const t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function jO(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Nd(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return _O(e,n);throw new Error(nn(8))}function _O(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 OO=500,MO={style:{transition:"none"}},hE="data-base-ui-click-trigger",pE={fallbackAxisSide:"end"},AO={clipPath:"inset(50%)",position:"fixed",top:0,left:0},mE=S.createContext(null),gE=()=>S.useContext(mE),zO=Zl("portal");function xE(e={}){const{ref:t,container:n,componentProps:r=Et,elementProps:s}=e,o=Cd(),i=gE(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,d]=S.useState(null),f=me(b=>{b!==null&&d(b)}),p=S.useRef(null);fe(()=>{if(n===null){p.current&&(p.current=null,d(null),c(null));return}const b=(n&&(mg(n)?n:n.current))??l??document.body;if(b==null){p.current&&(p.current=null,d(null),c(null));return}p.current!==b&&(p.current=b,d(null),c(b))},[n,l]);const x=Ut("div",r,{ref:[t,f],props:[{id:o,[zO]:""},s]}),v=a&&x?dn.createPortal(x,a):null;return{node:u,nodeId:S.isValidElement(x)?x.props.id:void 0,subtree:v}}const yE=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,portalOwnerRole:a,...c}=t,{node:u,nodeId:d,subtree:f}=xE({container:l,ref:n,componentProps:t,elementProps:c}),p=S.useRef(null),x=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[g,m]=S.useState(null),y=S.useRef(!1),w=g==null?void 0:g.modal,E=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&&(hy(u),y.current=!1):(pO(u),y.current=!0))}return or(Ee(u,"focusin",C,!0),Ee(u,"focusout",C,!0))},[u,w]),fe(()=>{!u||E!==!0||!y.current||(hy(u),y.current=!1)},[E,u]);const k=S.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:b,portalNode:u,setFocusManagerState:m}),[u]);return h.jsxs(S.Fragment,{children:[f,h.jsxs(mE.Provider,{value:k,children:[N&&u&&h.jsx(Ri,{"data-type":"outside",ref:p,onFocus:C=>{var P;if(Zo(C,u))(P=v.current)==null||P.focus();else{const j=g?g.domReference:null,A=oE(j);A==null||A.focus()}}}),N&&u&&h.jsx("span",{role:a,"aria-owns":d,style:AO}),u&&dn.createPortal(i,u),N&&u&&h.jsx(Ri,{"data-type":"outside",ref:x,onFocus:C=>{var P;if(Zo(C,u))(P=b.current)==null||P.focus();else{const j=g?g.domReference:null,A=Pg(j);A==null||A.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,De(Xl,C.nativeEvent)))}}})]})]})});function vE(){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 DO{constructor(){ge(this,"nodesRef",{current:[]});ge(this,"events",vE())}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 wE=S.createContext(null),bE=S.createContext(null),Rd=()=>{var e;return((e=S.useContext(wE))==null?void 0:e.id)||null},Bi=e=>{const t=S.useContext(bE);return e??t};function $O(e){const t=Cd(),n=Bi(e),r=Rd();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 FO(e){const{children:t,id:n}=e,r=Rd();return h.jsx(wE.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function LO(e){const{children:t,externalTree:n}=e,r=Tn(()=>n??new DO).current;return h.jsx(bE.Provider,{value:r,children:t})}function hr(e){return e==null?e:"current"in e?e.current:e}function HO(e,t){const n=ot(At(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 Ey=20;let as=[];function Og(){as=as.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function ky(e){Og(),e&&Nt(e)!=="body"&&(as.push(new WeakRef(e)),as.length>Ey&&(as=as.slice(-Ey)))}function Cy(){var e;return Og(),(e=as[as.length-1])==null?void 0:e.deref()}function BO(e){return e?Tg(e)?e:Na(e)[0]||e:null}function Ny(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=rE(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return Tg(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 SE(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:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:x}=e,v="rootStore"in t?t.rootStore:t,b=v.useState("open"),g=v.useState("domReferenceElement"),m=v.useState("floatingElement"),{events:y,dataRef:w}=v.context,E=me(()=>{var G;return(G=w.current.floatingContext)==null?void 0:G.nodeId}),N=s===!1,k=iy(g)&&N,C=Ht(s),P=Ht(o),j=Ht(c),A=Ht(b),D=Bi(p),z=gE(),R=S.useRef(!1),I=S.useRef(!1),_=S.useRef(!1),F=S.useRef(null),T=S.useRef(""),M=S.useRef(""),O=S.useRef(null),V=S.useRef(null),H=Ni(O,f,z==null?void 0:z.beforeInsideRef),K=Ni(V,z==null?void 0:z.afterInsideRef),W=Or(),U=Or(),L=Eg(),Q=z!=null,B=ly(m),q=me((G=B)=>G?Na(G):[]),Z=me(()=>(x==null?void 0:x().filter(G=>G!=null))??[]);S.useEffect(()=>{if(r||!l)return;function G(te){te.key==="Tab"&&ye(B,yn(Le(B)))&&q().length===0&&!k&&f_(te)}const X=Le(B);return Ee(X,"keydown",G)},[r,B,l,k,q]),S.useEffect(()=>{if(r||!b)return;const G=Le(B);function X(){_.current=!1}function te(Pe){const ce=At(Pe),ve=Z(),de=ye(m,ce)||ye(g,ce)||ye(z==null?void 0:z.portalNode,ce)||ve.some(xe=>xe===ce||ye(xe,ce));_.current=!de,M.current=Pe.pointerType||"keyboard",ce!=null&&ce.closest(`[${hE}]`)&&(I.current=!0,U.start(0,()=>{I.current=!1}))}function he(){M.current="keyboard"}return or(Ee(G,"pointerdown",te,!0),Ee(G,"pointerup",X,!0),Ee(G,"pointercancel",X,!0),Ee(G,"keydown",he,!0),X)},[r,m,g,B,b,z,U,Z]),S.useEffect(()=>{if(r||!a)return;const G=Le(B);function X(){I.current=!0,U.start(0,()=>{I.current=!1})}function te(ve){const de=At(ve);Tg(de)&&(F.current=de)}function he(ve){const de=ve.relatedTarget,xe=ve.currentTarget,Oe=At(ve);l&&de==null&&Oe!=null&&ye(m,Oe)&&ky(Oe),queueMicrotask(()=>{const Ie=E(),ze=v.context.triggerElements,at=Z(),et=(de==null?void 0:de.hasAttribute(Zl("focus-guard")))&&[O.current,V.current,z==null?void 0:z.beforeInsideRef.current,z==null?void 0:z.afterInsideRef.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,hr(d),hr(u)].includes(de),ne=!(ye(g,de)||ye(m,de)||ye(de,m)||ye(z==null?void 0:z.portalNode,de)||at.some(re=>re===de||ye(re,de))||ze.hasMatchingElement(re=>ye(re,de))||et||D&&(Cs(D.nodesRef.current,Ie).find(re=>{var Me,we;return ye((Me=re.context)==null?void 0:Me.elements.floating,de)||ye((we=re.context)==null?void 0:we.elements.domReference,de)})||py(D.nodesRef.current,Ie).find(re=>{var Me,we,xt;return[(Me=re.context)==null?void 0:Me.elements.floating,ly((we=re.context)==null?void 0:we.elements.floating)].includes(de)||((xt=re.context)==null?void 0:xt.elements.domReference)===de})));if(xe===g&&B&&Ny(B),i&&xe!==g&&!Rg(Oe)&&yn(G)===G.body){if(Ve(B)&&(B.focus(),i==="popup")){L.request(()=>{B.focus()});return}const re=q(),Me=F.current,we=(Me&&re.includes(Me)?Me:null)||re[re.length-1]||B;Ve(we)&&we.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(k||!l)&&de&&ne&&!I.current&&(k||de!==Cy())&&(R.current=!0,v.setOpen(!1,De(Xl,ve)))})}function Pe(){_.current||(w.current.insideReactTree=!0,W.start(0,()=>{w.current.insideReactTree=!1}))}const ce=Ve(g)?g:null;if(!(!m&&!ce))return or(ce&&Ee(ce,"focusout",he),ce&&Ee(ce,"pointerdown",X),m&&Ee(m,"focusin",te),m&&Ee(m,"focusout",he),m&&z&&Ee(m,"focusout",Pe,!0))},[r,g,m,B,l,D,z,v,a,i,q,k,E,w,W,U,L,u,d,Z]),S.useEffect(()=>{var xe,Oe,Ie;if(r||!m||!b)return;const G=Array.from(((xe=z==null?void 0:z.portalNode)==null?void 0:xe.querySelectorAll(`[${Zl("portal")}]`))||[]),te=(Ie=(Oe=(D?py(D.nodesRef.current,E()):[]).find(ze=>{var at;return iy(((at=ze.context)==null?void 0:at.elements.domReference)||null)}))==null?void 0:Oe.context)==null?void 0:Ie.elements.domReference,Pe=[...[m,...G,O.current,V.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,...Z()],te,hr(d),hr(u),k?g:null].filter(ze=>ze!=null),ce=vy(Pe,{ariaHidden:l||k,mark:!1}),ve=[m,...G].filter(ze=>ze!=null),de=vy(ve);return()=>{de(),ce()}},[b,r,g,m,l,z,k,D,E,u,d,Z]),fe(()=>{if(!b||r||!Ve(B))return;T.current="",M.current="";const G=Le(B),X=yn(G);queueMicrotask(()=>{const te=C.current,he=typeof te=="function"?te(j.current||""):te;if(he===void 0||he===!1||ye(B,X))return;let ce=null;const ve=()=>(ce==null&&(ce=q(B)),ce[0]||B);let de;he===!0||he===null?de=ve():de=hr(he),de=de||ve();const xe=ye(B,yn(G));Df(de,{preventScroll:de===B,shouldFocus(){if(!A.current)return!1;if(xe)return!0;const Oe=yn(G);return!(Oe!==de&&ye(B,Oe))}})})},[r,b,B,q,C,j,A]),fe(()=>{if(r||!B)return;const G=Le(B),X=yn(G),te=j.current==null;ky(X);function he(ce){if(ce.open||(T.current=HO(ce.nativeEvent,M.current)),ce.reason===St&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===VS)if(ce.nested)R.current=!1;else if(AS(ce.nativeEvent)||zS(ce.nativeEvent))R.current=!1;else{let ve=!1;Le(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 de=typeof ve=="function"?ve(ce):ve;if(de===void 0||de===!1)return null;de===null&&(de=!0);const xe=g!=null&&g.isConnected?g:null,Oe=X!=null&&X.isConnected&&Nt(X)!=="body"?X:null;let Ie=te?Oe||xe:xe||Oe;return Ie||(Ie=Cy()||null),typeof de=="boolean"?Ie:hr(de)||Ie||null}return()=>{y.off("openchange",he);const ce=yn(G),ve=Z(),de=ye(m,ce)||ve.some(ze=>ze===ce||ye(ze,ce))||D&&Cs(D.nodesRef.current,E(),!1).some(ze=>{var at;return ye((at=ze.context)==null?void 0:at.elements.floating,ce)}),xe=P.current,Oe=T.current,Ie=Pe(Oe);queueMicrotask(()=>{const ze=BO(Ie),at=typeof xe!="boolean";if(xe&&!R.current&&Ve(ze)&&(!(!at&&ze!==ce&&ce!==G.body)||de)){const et={preventScroll:!0};Oe==="keyboard"&&(et.focusVisible=!0),ze.focus(et)}R.current=!1})}},[r,m,B,P,j,y,D,g,E,Z]),fe(()=>{if(!vo||b||!m)return;const G=yn(Le(m));!Ve(G)||!Sd(G)||ye(m,G)&&G.blur()},[b,m]),fe(()=>{if(!(r||!z))return z.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:v.setOpen,domReference:g}),()=>{z.setFocusManagerState(null)}},[r,z,l,b,v,a,g]),fe(()=>{if(!(r||!B))return Ny(B),()=>{queueMicrotask(Og)}},[r,B]);const Y=!r&&(l?!k:!0)&&(Q||l);return h.jsxs(S.Fragment,{children:[Y&&h.jsx(Ri,{"data-type":"inside",ref:H,onFocus:G=>{var X;if(l){const te=q();Df(te[te.length-1])}else if(z!=null&&z.portalNode)if(R.current=!1,Zo(G,z.portalNode)){const te=Pg(g);te==null||te.focus()}else(X=hr(d??z.beforeOutsideRef))==null||X.focus()}}),n,Y&&h.jsx(Ri,{"data-type":"inside",ref:K,onFocus:G=>{var X;if(l)Df(q()[0]);else if(z!=null&&z.portalNode)if(a&&(R.current=!0),Zo(G,z.portalNode)){const te=oE(g);te==null||te.focus()}else(X=hr(u??z.afterOutsideRef))==null||X.focus()}})]})}function VO(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,d=S.useRef(void 0),f=Eg(),p=Or(),x=S.useMemo(()=>{function v(g,m,y,w){const E=De(a,m,y);g&&w==="touch"&&l>0?p.start(l,()=>{c.setOpen(!0,E)}):c.setOpen(g,E)}function b(g,m,y){const w=u.current.openEvent,E=c.select("domReferenceElement")!==m;return g&&E||!g||!s?!0:w&&i?!y(w.type):!1}return{onPointerDown(g){d.current=xs(g.pointerType,!0)&&zS(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const m=d.current,y=g.nativeEvent,w=c.select("open");if(g.button!==0||r==="click"||xs(m,!0)&&o)return;const E=b(w,g.currentTarget,C=>C==="click"||C==="mousedown"),N=At(y);if(Sd(N)){v(E,y,N,m);return}const k=g.currentTarget;f.request(()=>{v(E,y,k,m)})},onClick(g){if(r==="mousedown-only")return;const m=d.current;if(r==="mousedown"&&m){d.current=void 0;return}if(xs(m,!0)&&o)return;const y=c.select("open"),w=b(y,g.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");v(w,g.nativeEvent,g.currentTarget,m)},onKeyDown(){d.current=void 0}}},[u,r,o,a,c,i,s,f,p,l]);return S.useMemo(()=>n?{reference:x}:Et,[n,x])}function WO(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,d=o.x,f=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),d-=n||0,f-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,d=i&&t.x!=null?t.x:d,f=l&&t.y!=null?t.y:f):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:d,y:f,top:f,right:d+c,bottom:f+u,left:d}}}}function Ry(e){return e!=null&&e.clientX!=null}function UO(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),[d,f]=S.useState(),[p,x]=S.useState([]),v=me(w=>{s.set("positionReference",w)}),b=me((w,E,N)=>{c.current||a.current.openEvent&&!Ry(a.current.openEvent)||s.set("positionReference",WO(N??l,{x:w,y:E,axis:r,dataRef:a,pointerType:d}))}),g=me(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),x([])):b(w.clientX,w.clientY,w.currentTarget)}),m=xs(d)?i:o;S.useEffect(()=>{if(!n){v(l);return}if(!m)return;function w(){var k;(k=u.current)==null||k.call(u),u.current=null}const E=ot(i);function N(k){const C=At(k);ye(i,C)?w():b(k.clientX,k.clientY)}return!a.current.openEvent||Ry(a.current.openEvent)?u.current=Ee(E,"mousemove",N):v(l),w},[m,n,i,a,l,s,b,v,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(E){f(E.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:g,onMouseEnter:g}},[g]);return S.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function qO(){return!1}function KO(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 Mg(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=qO,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),d=c.useState("floatingElement"),{dataRef:f,events:p}=c.context,x=Bi(a),v=me(typeof s=="function"?s:()=>!1),b=typeof s=="function"?v:s,g=b!==!1,m=me(()=>o),{escapeKey:y,outsidePress:w}=KO(l),E=S.useRef(!1),N=S.useRef(!1),k=S.useRef(!1),C=S.useRef(!1),P=S.useRef(!1),j=S.useRef(""),A=S.useRef(null),D=Or(),z=Or(),R=me(()=>{z.clear(),f.current.insideReactTree=!1}),I=me(W=>{var Q;const U=(Q=f.current.floatingContext)==null?void 0:Q.nodeId;return(x?Cs(x.nodesRef.current,U):[]).some(B=>{var q;return((q=B.context)==null?void 0:q.open)&&!B.context.dataRef.current[W]})}),_=me(W=>Of(W,c.select("floatingElement"))||Of(W,c.select("domReferenceElement"))),F=me(W=>{i()&&c.setOpen(!1,De(Es,W.nativeEvent))}),T=me(W=>{if(!u||!n||!r||W.key!=="Escape"||P.current||!y&&I("__escapeKeyBubbles"))return;const U=h_(W)?W.nativeEvent:W,L=De(kd,U);c.setOpen(!1,L),L.isCanceled||W.preventDefault(),!y&&!L.isPropagationAllowed&&W.stopPropagation()}),M=me(()=>{f.current.insideReactTree=!0,z.start(0,R)}),O=me(W=>{if(!u||!n||W.button!==0)return;const U=At(W.nativeEvent);ye(c.select("floatingElement"),U)&&(E.current||(E.current=!0,N.current=!1))}),V=me(W=>{!u||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&E.current&&(N.current=!0)});S.useEffect(()=>{function W(U){U.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;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=w;const W=new Pn,U=new Pn,L=Le(d);function Q(){W.clear(),P.current=!0}function B(){W.start(vo?5:0,()=>{P.current=!1})}function q(){k.current=!0,U.start(0,()=>{k.current=!1})}function Z(){E.current=!1,N.current=!1}function Y(){const ne=j.current,re=ne==="pen"||!ne?"mouse":ne,Me=m(),we=typeof Me=="function"?Me():Me;return typeof we=="string"?we:we[re]}function G(ne){const re=Y();return re==="intentional"&&ne.type!=="click"||re==="sloppy"&&ne.type==="click"}function X(ne){var we;const re=(we=f.current.floatingContext)==null?void 0:we.nodeId,Me=x&&Cs(x.nodesRef.current,re).some(xt=>{var qt;return Of(ne,(qt=xt.context)==null?void 0:qt.elements.floating)});return _(ne)||Me}function te(ne){if(G(ne)){ne.type!=="click"&&!_(ne)&&(U.clear(),k.current=!1),R();return}if(f.current.insideReactTree){R();return}const re=At(ne),Me=`[${Zl("inert")}]`,we=Ce(re)?re.getRootNode():null,xt=Array.from((Ci(we)?we:Le(c.select("floatingElement"))).querySelectorAll(Me)),qt=c.context.triggerElements;if(re&&(qt.hasElement(re)||qt.hasMatchingElement(Re=>ye(Re,re))))return;let se=Ce(re)?re:null;for(;se&&!ys(se);){const Re=Ss(se);if(ys(Re)||!Ce(Re))break;se=Re}if(!(xt.length&&Ce(re)&&!__(re)&&!ye(re,c.select("floatingElement"))&&xt.every(Re=>!ye(se,Re)))){if(Ve(re)&&!("touches"in ne)){const Re=ys(re),Ae=fn(re),Kt=/auto|scroll/,Rt=Re||Kt.test(Ae.overflowX),Un=Re||Kt.test(Ae.overflowY),qn=Rt&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,So=Un&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,Eo=Ae.direction==="rtl",ko=So&&(Eo?ne.offsetX<=re.offsetWidth-re.clientWidth:ne.offsetX>re.clientWidth),Co=qn&&ne.offsetY>re.clientHeight;if(ko||Co)return}if(!X(ne)){if(Y()==="intentional"){if(ne.detail!==0&&!AS(ne)&&!C.current)return;if(k.current){U.clear(),k.current=!1;return}}typeof b=="function"&&!b(ne)||I("__outsidePressBubbles")||(c.setOpen(!1,De(VS,ne)),R())}}}function he(ne){Y()!=="sloppy"||ne.pointerType==="touch"||!c.select("open")||!n||_(ne)||te(ne)}function Pe(ne){if(Y()!=="sloppy"||!c.select("open")||!n||_(ne))return;const re=ne.touches[0];re&&(A.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function ce(ne,re){const Me=At(ne);if(!Me)return;const we=Ee(Me,ne.type,()=>{re(ne),we()})}function ve(ne){j.current="touch",ce(ne,Pe)}function de(ne){D.clear(),ne.type==="pointerdown"&&(ne.button===0&&(C.current=!0),j.current=ne.pointerType),!(ne.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)&&ce(ne,re=>{re.type==="pointerdown"?he(re):te(re)})}function xe(ne){if(ne.type==="pointercancel"&&(C.current=!1),!E.current)return;const re=N.current;if(Z(),Y()==="intentional"){if(ne.type==="pointercancel"){re&&q();return}if(!X(ne)){if(re){q();return}typeof b=="function"&&!b(ne)||(U.clear(),k.current=!0,R())}}}function Oe(ne){if(Y()!=="sloppy"||!A.current||_(ne))return;const re=ne.touches[0];if(!re)return;const Me=Math.abs(re.clientX-A.current.startX),we=Math.abs(re.clientY-A.current.startY),xt=Math.sqrt(Me*Me+we*we);xt>5&&(A.current.dismissOnTouchEnd=!0),xt>10&&(te(ne),D.clear(),A.current=null)}function Ie(ne){ce(ne,Oe)}function ze(ne){Y()!=="sloppy"||!A.current||_(ne)||(A.current.dismissOnTouchEnd&&te(ne),D.clear(),A.current=null)}function at(ne){ce(ne,ze)}const et=or(r&&or(Ee(L,"keydown",T),Ee(L,"compositionstart",Q),Ee(L,"compositionend",B)),g&&or(Ee(L,"click",de,!0),Ee(L,"pointerdown",de,!0),Ee(L,"pointerup",xe,!0),Ee(L,"pointercancel",xe,!0),Ee(L,"mousedown",de,!0),Ee(L,"mouseup",xe,!0),Ee(L,"touchstart",ve,{capture:!0,passive:!0}),Ee(L,"touchmove",Ie,{capture:!0,passive:!0}),Ee(L,"touchend",at,{capture:!0,passive:!0})));return()=>{et(),W.clear(),U.clear(),Z(),k.current=!1,R()}},[f,d,r,g,b,u,n,y,w,T,R,m,I,_,x,c,D]);const H=S.useMemo(()=>({onKeyDown:T,onPointerDown:F,onClick:F}),[T,F]),K=S.useMemo(()=>({onKeyDown:T,onPointerDown:V,onMouseDown:V,onClickCapture:M,onMouseDownCapture(W){M(),O(W)},onPointerDownCapture(W){M(),O(W)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[T,M,O,V]);return S.useMemo(()=>n?{reference:H,floating:K,trigger:H}:{},[n,H,K])}function Ty(e,t,n){let{reference:r,floating:s}=e;const o=En(t),i=Ng(t),l=Cg(i),a=Cn(t),c=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=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:d};break;case"left":p={x:r.x-s.width,y:d};break;default:p={x:r.x,y:r.y}}const x=Mr(t);return x&&(p[i]+=f*(x==="end"?1:-1)*(n&&c?-1:1)),p}async function YO(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:d="floating",altBoundary:f=!1,padding:p=0}=ks(t,e),x=QS(p),b=l[f?d==="floating"?"reference":"floating":d],g=Pu(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=d==="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},E=Pu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:m,offsetParent:y,strategy:a}):m);return{top:(g.top-E.top+x.top)/w.y,bottom:(E.bottom-g.bottom+x.bottom)/w.y,left:(g.left-E.left+x.left)/w.x,right:(E.right-g.right+x.right)/w.x}}const GO=50,QO=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:YO},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Ty(c,r,a),f=r,p=0;const x={};for(let v=0;v<o.length;v++){const b=o[v];if(!b)continue;const{name:g,fn:m}=b,{x:y,y:w,data:E,reset:N}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:x,rects:c,platform:l,elements:{reference:e,floating:t}});u=y??u,d=w??d,x[g]={...x[g],...E},N&&p<GO&&(p++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:d}=Ty(c,f,a)),v=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:x}},XO=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:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=ks(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Cn(s),m=En(l),y=Cn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=f||(y||!v?[Tu(l)]:Z_(l)),N=x!=="none";!f&&N&&E.push(...nO(l,v,x,w));const k=[l,...E],C=await a.detectOverflow(t,b),P=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(C[g]),d){const R=X_(s,i,w);P.push(C[R[0]],C[R[1]])}if(j=[...j,{placement:s,overflows:P}],!P.every(R=>R<=0)){var A,D;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,I=k[R];if(I&&(!(d==="alignment"?m!==En(I):!1)||j.every(T=>En(T.placement)===m?T.overflows[0]>0:!0)))return{data:{index:R,overflows:j},reset:{placement:I}};let _=(D=j.filter(F=>F.overflows[0]<=0).sort((F,T)=>F.overflows[1]-T.overflows[1])[0])==null?void 0:D.placement;if(!_)switch(p){case"bestFit":{var z;const F=(z=j.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,O)=>M+O,0)]).sort((T,M)=>T[1]-M[1])[0])==null?void 0:z[0];F&&(_=F);break}case"initialPlacement":_=l;break}if(s!==_)return{reset:{placement:_}}}return{}}}},EE=new Set(["left","top"]);async function ZO(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Cn(n),l=Mr(n),a=En(n)==="y",c=EE.has(i)?-1:1,u=o&&a?-1:1,d=ks(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),a?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const JO=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 ZO(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}}}}},e2=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}=ks(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=En(s),p=kg(f);let x=u[p],v=u[f];const b=(m,y)=>GS(y+d[m==="y"?"top":"left"],y,y-d[m==="y"?"bottom":"right"]);i&&(x=b(p,x)),l&&(v=b(f,v));const g=a.fn({...t,[p]:x,[f]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:l}}}}}},t2=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:d=!0}=ks(e,t),f={x:s,y:o},p=En(i),x=kg(p);let v=f[x],b=f[p];const g=ks(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 E=x==="y"?"height":"width",N=l.reference[x]-l.floating[E]+m.mainAxis,k=l.reference[x]+l.reference[E]-m.mainAxis;v<N?v=N:v>k&&(v=k)}if(d){var y,w;const E=x==="y"?"width":"height",N=EE.has(Cn(i)),k=l.reference[p]-l.floating[E]+(N&&((y=a.offset)==null?void 0:y[p])||0)+(N?0:m.crossAxis),C=l.reference[p]+l.reference[E]+(N?0:((w=a.offset)==null?void 0:w[p])||0)-(N?m.crossAxis:0);b<k?b=k:b>C&&(b=C)}return{[x]:v,[p]:b}}}},n2=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}=ks(e,t),a=await s.detectOverflow(t,l),c=Cn(n),u=Mr(n),d=En(n)==="y",{width:f,height:p}=r.floating;let x,v;c==="top"||c==="bottom"?(x=c,v=u===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,x=u==="end"?"top":"bottom");const b=p-a.top-a.bottom,g=f-a.left-a.right,m=Ti(p-a[x],b),y=Ti(f-a[v],g),w=t.middlewareData.shift,E=!w;let N=m,k=y;w!=null&&w.enabled.x&&(k=g),w!=null&&w.enabled.y&&(N=b),E&&!u&&(d?k=f-2*Cr(a.left,a.right):N=p-2*Cr(a.top,a.bottom)),await i({...t,availableWidth:k,availableHeight:N});const C=await s.getDimensions(o.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function kE(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=Ru(n)!==o||Ru(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Ag(e){return Ce(e)?e:e.contextElement}function Jo(e){const t=Ag(e);if(!Ve(t))return Nr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=kE(t);let i=(o?Ru(n.width):n.width)/r,l=(o?Ru(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const r2=Nr(0);function CE(e){const t=ot(e);return!xg()||!t.visualViewport?r2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s2(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ot(e)}function co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Ag(e);let i=Nr(1);t&&(r?Ce(r)&&(i=Jo(r)):i=Jo(e));const l=s2(o,n,r)?CE(o):Nr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o&&r){const f=ot(o),p=Ce(r)?ot(r):r;let x=f,v=Sp(x);for(;v&&p!==x;){const b=Jo(v),g=v.getBoundingClientRect(),m=fn(v),y=g.left+(v.clientLeft+parseFloat(m.paddingLeft))*b.x,w=g.top+(v.clientTop+parseFloat(m.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,d*=b.y,a+=y,c+=w,x=ot(v),v=Sp(x)}}return Pu({width:u,height:d,x:a,y:c})}function Td(e,t){const n=bd(e).scrollLeft;return t?t.left+n:co(Dr(e)).left+n}function NE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Td(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function o2(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Dr(r),l=t?wd(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=Nr(1);const u=Nr(0),d=Ve(r);if((d||!o)&&((Nt(r)!=="body"||Ca(i))&&(a=bd(r)),d)){const p=co(r);c=Jo(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=i&&!d&&!o?NE(i,a):Nr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-a.scrollTop*c.y+u.y+f.y}}function i2(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function l2(e){const t=bd(e),n=e.ownerDocument.body,r=Cr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Cr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Td(e);const i=-t.scrollTop;return fn(n).direction==="rtl"&&(o+=Cr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const a2=25;function c2(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=ot(e),o=Dr(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const f=!xg()||t==="fixed";r?f||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,f&&(c=i.offsetLeft,u=i.offsetTop))}if(Td(o)<=0){const f=o.ownerDocument,p=f.body,x=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-v),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;g<=a2&&(l-=g)}return{width:l,height:a,x:c,y:u}}function u2(e,t){const n=co(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 Py(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=c2(e,n,t);else if(t==="document")r=l2(Dr(e));else if(Ce(t))r=u2(t,n);else{const s=CE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Pu(r)}function d2(e,t){const n=t.get(e);if(n)return n;let r=Ql(e,[],!1).filter(l=>Ce(l)&&Nt(l)!=="body"),s=null;const o=fn(e).position==="fixed";let i=o?Ss(e):e;for(;Ce(i)&&!ys(i);){const l=fn(i),a=gg(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(d=>d!==i):s=l,i=Ss(i)}return t.set(e,r),r}function f2(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?wd(t)?[]:d2(t,this._c):[].concat(n),r],l=Py(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let f=1;f<i.length;f++){const p=Py(t,i[f],s);a=Cr(p.top,a),c=Ti(p.right,c),u=Ti(p.bottom,u),d=Cr(p.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function h2(e){const{width:t,height:n}=kE(e);return{width:t,height:n}}function p2(e,t,n){const r=Ve(t),s=Dr(t),o=n==="fixed",i=co(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=Nr(0);if((r||!o)&&((Nt(t)!=="body"||Ca(s))&&(l=bd(t)),r)){const f=co(t,!0,o,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}!r&&s&&(a.x=Td(s));const c=s&&!r&&!o?NE(s,l):Nr(0),u=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Lf(e){return fn(e).position==="static"}function Iy(e,t){if(!Ve(e)||fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dr(e)===n&&(n=n.ownerDocument.body),n}function RE(e,t){const n=ot(e);if(wd(e))return n;if(!Ve(e)){let s=Ss(e);for(;s&&!ys(s);){if(Ce(s)&&!Lf(s))return s;s=Ss(s)}return n}let r=Iy(e,t);for(;r&&m_(r)&&Lf(r);)r=Iy(r,t);return r&&ys(r)&&Lf(r)&&!gg(r)?n:r||y_(e)||n}const m2=async function(e){const t=this.getOffsetParent||RE,n=this.getDimensions,r=await n(e.floating);return{reference:p2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g2(e){return fn(e).direction==="rtl"}const x2={convertOffsetParentRelativeRectToViewportRelativeRect:o2,getDocumentElement:Dr,getClippingRect:f2,getOffsetParent:RE,getElementRects:m2,getClientRects:i2,getDimensions:h2,getScale:Jo,isElement:Ce,isRTL:g2};function TE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function y2(e,t,n){let r=null,s;const o=Dr(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:p,top:x,width:v,height:b}=f;if(u||t(),!v||!b)return;const g=uc(x),m=uc(o.clientWidth-(p+v)),y=uc(o.clientHeight-(x+b)),w=uc(p),N={rootMargin:-g+"px "+-m+"px "+-y+"px "+-w+"px",threshold:Cr(0,Ti(1,d))||1};let k=!0;function C(P){const j=P[0].intersectionRatio;if(!TE(f,e.getBoundingClientRect()))return l();if(j!==d){if(!k)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}k=!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 jy(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=Ag(e),u=s||o?[...c?Ql(c):[],...t?Ql(t):[]]:[];u.forEach(g=>{s&&g.addEventListener("scroll",n),o&&g.addEventListener("resize",n)});const d=c&&l?y2(c,n,o):null;let f=-1,p=null;i&&(p=new ResizeObserver(g=>{let[m]=g;m&&m.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),c&&!a&&p.observe(c),t&&p.observe(t));let x,v=a?co(e):null;a&&b();function b(){const g=co(e);v&&!TE(v,g)&&n(),v=g,x=requestAnimationFrame(b)}return n(),()=>{var g;u.forEach(m=>{s&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(x)}}const v2=JO,w2=e2,b2=XO,S2=n2,E2=t2,k2=(e,t,n)=>{const r=new Map,s=n??{},o={...x2,...s.platform,_c:r};return QO(e,t,{...s,platform:o})};var C2=typeof document<"u",N2=function(){},Bc=C2?S.useLayoutEffect:N2;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 PE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _y(e,t){const n=PE(e);return Math.round(t*n)/n}function Hf(e){const t=S.useRef(e);return Bc(()=>{t.current=e}),t}function R2(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,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);_u(f,r)||p(r);const[x,v]=S.useState(null),[b,g]=S.useState(null),m=S.useCallback(T=>{T!==N.current&&(N.current=T,v(T))},[]),y=S.useCallback(T=>{T!==k.current&&(k.current=T,g(T))},[]),w=o||x,E=i||b,N=S.useRef(null),k=S.useRef(null),C=S.useRef(u),P=a!=null,j=Hf(a),A=Hf(s),D=Hf(c),z=S.useCallback(()=>{if(!N.current||!k.current)return;const T={placement:t,strategy:n,middleware:f};A.current&&(T.platform=A.current),k2(N.current,k.current,T).then(M=>{const O={...M,isPositioned:D.current!==!1};R.current&&!_u(C.current,O)&&(C.current=O,dn.flushSync(()=>{d(O)}))})},[f,t,n,A,D]);Bc(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[c]);const R=S.useRef(!1);Bc(()=>(R.current=!0,()=>{R.current=!1}),[]),Bc(()=>{if(w&&(N.current=w),E&&(k.current=E),w&&E){if(j.current)return j.current(w,E,z);z()}},[w,E,z,j,P]);const I=S.useMemo(()=>({reference:N,floating:k,setReference:m,setFloating:y}),[m,y]),_=S.useMemo(()=>({reference:w,floating:E}),[w,E]),F=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!_.floating)return T;const M=_y(_.floating,u.x),O=_y(_.floating,u.y);return l?{...T,transform:"translate("+M+"px, "+O+"px)",...PE(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:O}},[n,l,_.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:z,refs:I,elements:_,floatingStyles:F}),[u,z,I,_,F])}const T2=(e,t)=>{const n=v2(e);return{name:n.name,fn:n.fn,options:[e,t]}},P2=(e,t)=>{const n=w2(e);return{name:n.name,fn:n.fn,options:[e,t]}},I2=(e,t)=>({fn:E2(e).fn,options:[e,t]}),j2=(e,t)=>{const n=b2(e);return{name:n.name,fn:n.fn,options:[e,t]}},_2=(e,t)=>{const n=S2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var IE={exports:{}},jE={};/**
|
|
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 O2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var M2=typeof Object.is=="function"?Object.is:O2,A2=Pi.useState,z2=Pi.useEffect,D2=Pi.useLayoutEffect,$2=Pi.useDebugValue;function F2(e,t){var n=t(),r=A2({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return D2(function(){s.value=n,s.getSnapshot=t,Bf(s)&&o({inst:s})},[e,n,t]),z2(function(){return Bf(s)&&o({inst:s}),e(function(){Bf(s)&&o({inst:s})})},[e]),$2(n),n}function Bf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!M2(e,n)}catch{return!0}}function L2(e,t){return t()}var H2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?L2:F2;jE.useSyncExternalStore=Pi.useSyncExternalStore!==void 0?Pi.useSyncExternalStore:H2;IE.exports=jE;var Pd=IE.exports,_E={exports:{}},OE={};/**
|
|
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 Id=S,B2=Pd;function V2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W2=typeof Object.is=="function"?Object.is:V2,U2=B2.useSyncExternalStore,q2=Id.useRef,K2=Id.useEffect,Y2=Id.useMemo,G2=Id.useDebugValue;OE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=q2(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Y2(function(){function a(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&i.hasValue){var x=i.value;if(s(x,p))return d=x}return d=p}if(x=d,W2(u,p))return x;var v=r(p);return s!==void 0&&s(x,v)?(u=p,x):(u=p,d=v)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,s]);var l=U2(e,o[0],o[1]);return K2(function(){i.hasValue=!0,i.value=l},[l]),G2(l),l};_E.exports=OE;var ME=_E.exports;const Q2=Cw(ME),X2=Ig(19),Z2=X2?eM:tM;function AE(e,t,n,r,s){return Z2(e,t,n,r,s)}function J2(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return Pd.useSyncExternalStore(e.subscribe,o,o)}r_({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()}}),Pd.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function eM(e,t,n,r,s){const o=n_();if(!o)return J2(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 tM(e,t,n,r,s){return ME.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class nM{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 AE(this,t,n,r,s)}}class jd extends nM{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),AE(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=me(n??hg);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 rM={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 zE extends jd{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:vE(),nested:s,triggerElements:i},rM);ge(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&p_(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 sM(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,d=i,f=S.useRef(null);r===void 0&&f.current===null&&(f.current=new zE({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:d,floatingId:s,syncOnly:!0,nested:o}));const p=r??f.current;return t.useSyncedValue("floatingId",s),fe(()=>{const x={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ce(a)&&(x.domReferenceElement=a),p.state.positionReference===p.state.referenceElement&&(x.positionReference=a),p.update(x)},[l,s,a,c,p]),p.context.onOpenChange=d,p.context.nested=o,p}function DE(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=er.request(()=>{o("ending")});return()=>{er.cancel(a)}}},[e,i,s,n]),fe(()=>{if(!e||t)return;const a=er.request(()=>{o(void 0)});return()=>{er.cancel(a)}},[t,e]),fe(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&o("starting");const a=er.request(()=>{o("idle")});return()=>{er.cancel(a)}},[t,e,i,s]),{mounted:i,setMounted:l,transitionStatus:s}}let fc=null;function oM(e){if(!fc){const t=[];fc=t,queueMicrotask(()=>{fc=null,dn.flushSync(()=>{for(const n of t)n()})})}fc.push(e)}function $E(e,t=!1,n=!1){const r=Eg();return me((s,o=null)=>{r.cancel();const i=hr(e);if(i==null)return;const l=i,a=()=>{if(!n){dn.flushSync(s);return}oM(()=>{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(d=>d.pending||d.playState!=="finished")){c();return}a()})}if(t){const u=FS;if(!l.hasAttribute(u)){r.request(c);return}const d=new MutationObserver(()=>{l.hasAttribute(u)||(d.disconnect(),c())});d.observe(l,{attributes:!0,attributeFilter:[u]}),o==null||o.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(c)})}function Ra(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,i=me(o),l=$E(r,n,s);S.useEffect(()=>{if(!t)return;const a=new AbortController;return l(i,a.signal),()=>{a.abort()}},[t,n,i,l])}const zg={tabIndex:-1,[Ep]:""};function FE(e){return t=>t==="touch"?e.current:!0}function Dg(e,t=!1){const n=Cd(),r=Rd()!=null,s=Tn(()=>e(n,r)).current;return sM({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function $g({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function Oy(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function iM(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),Oy(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Oy(t))})}function Fg(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 LE(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lM(e,t,n,r={}){var u,d,f;const s=n.reason,o=s===St,i=t&&s===Lc,l=!t&&(s===Es||s===kd),a=LE(n);if((d=(u=e.context).onOpenChange)==null||d.call(u,t,n),n.isCanceled)return;(f=r.onBeforeDispatch)==null||f.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const p=Fg(e.state,t,n.trigger,a()),x={...r.extraState,...p};i?x.instantType="focus":l?x.instantType="dismiss":o&&(x.instantType=void 0),e.update(x)};o?dn.flushSync(c):c()}function HE(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=iM(e,n),i=me(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){const d={activeTriggerElement:a,...c?r:null};n.update(d);return}if(u==null&&c){const d={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(d)}}),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 Lg(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 d=null;if(u){const f=e.context.triggerElements.getById(u);if(f)r.current=u,f!==e.state.activeTriggerElement&&(c.activeTriggerElement=f);else{for(const[p,x]of e.context.triggerElements.entries())if(x===e.state.activeTriggerElement){c.activeTriggerId=p,c.activeTriggerElement=x,r.current=p;break}c.activeTriggerId===void 0&&(r.current===u?d=u:r.current=null)}}else r.current=null;if(!d&&!u&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[p,x]=f.value;c.activeTriggerId=p,c.activeTriggerElement=x,r.current=p}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=De(Ed);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Hg(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:i}=DE(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,d;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return Ra({enabled:s&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function Bg(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:Et,inactiveTriggerProps:Et,popupProps:Et})},[e])}function BE(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 Vg{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 Wg(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new zE({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:Et,inactiveTriggerProps:Et,popupProps:Et}}const Tl=e=>e.triggerIdProp??e.activeTriggerId,Ug=e=>e.openProp??e.open,My=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function VE(e,t){return t!==void 0&&Ug(e)&&Tl(e)===t}function aM(e,t){return VE(e,t)?!0:t!==void 0&&Ug(e)&&Tl(e)==null&&e.triggerCount===1}const qg={open:Ug,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:Tl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:My,isTriggerActive:(e,t)=>t!==void 0&&Tl(e)===t,isOpenedByTrigger:(e,t)=>VE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Tl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>aM(e,t)?My(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function WE(e){const t=S.useCallback(r=>e===void 0?hg:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return Pd.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function cM(e){return uM(e,e.rootContext)}function uM(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),[d,f]=S.useState(void 0),[p,x]=S.useState(void 0),v=S.useRef(null),b=Bi(r),g=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),m=R2({...e,elements:{...g,...c&&{reference:c}}}),y=Ce(d)?d:null,w=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?i:y),t.useSyncedValue("floatingElement",w);const E=S.useCallback(A=>{const D=Ce(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;u(D),m.refs.setReference(D)},[m.refs]),N=S.useCallback(A=>{(Ce(A)||A===null)&&(v.current=A,f(A)),(Ce(m.refs.reference.current)||m.refs.reference.current===null||A!==null&&!Ce(A))&&m.refs.setReference(A)},[m.refs,f]),k=S.useCallback(A=>{x(A),m.refs.setFloating(A)},[m.refs]),C=S.useMemo(()=>({...m.refs,setReference:N,setFloating:k,setPositionReference:E,domReference:v}),[m.refs,N,k,E]),P=S.useMemo(()=>({...m.elements,domReference:i}),[m.elements,i]),j=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&&(v.current=i)},[i]),fe(()=>{t.context.dataRef.current.floatingContext=j;const A=b==null?void 0:b.nodesRef.current.find(D=>D.id===n);A&&(A.context=j)}),S.useMemo(()=>({...m,context:j,refs:C,elements:P,rootStore:t}),[m,C,P,j,t])}const Vf=OS&&vo;function dM(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=Or();S.useEffect(()=>{const f=s.select("domReferenceElement");if(!n)return;const p=ot(f);function x(){const g=s.select("domReferenceElement");!s.select("open")&&Ve(g)&&g===yn(Le(g))&&(l.current=!0,a.current=g)}function v(){c.current=!0}function b(){c.current=!1}return or(Ee(p,"blur",x),Vf&&Ee(p,"keydown",v,!0),Vf&&Ee(p,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function f(p){if(p.reason===Es||p.reason===kd){const x=s.select("domReferenceElement");Ce(x)&&(a.current=x,l.current=!0)}}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,n,s]);const d=S.useMemo(()=>{function f(){l.current=!1,a.current=null}return{onMouseLeave(){f()},onFocus(p){const x=p.currentTarget;if(l.current){if(a.current===x)return;f()}const v=At(p.nativeEvent);if(Ce(v)){if(Vf&&!p.relatedTarget){if(!c.current&&!Sd(v))return}else if(!M_(v))return}const b=Nu(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,De(Lc,g,m));return}u.start(y,()=>{l.current||s.setOpen(!0,De(Lc,g,m))})},onBlur(p){f();const x=p.relatedTarget,v=p.nativeEvent,b=Ce(x)&&x.hasAttribute(Zl("focus-guard"))&&x.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const g=s.select("domReferenceElement"),m=yn(Le(g));!x&&m===g||ye((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,m)||ye(g,m)||b||Nu(x??m,s.context.triggerElements)||s.setOpen(!1,De(Lc,v))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}class Kg{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 Pn,this.restTimeout=new Pn,this.handleCloseOptions=void 0}static create(){return new Kg}}const Ou=new WeakMap;function Mu(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ou.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"),Ou.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function UE(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Ou.get(n);o&&o!==e&&Mu(o),Mu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Ou.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Yg(e){const t=e.context.dataRef.current,n=Tn(()=>t.hoverInteractionState??Kg.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),pg(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function qE(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(),d=Rd(),f=Yg(o),p=Or(),x=me(()=>{var g;return BS((g=c.current.openEvent)==null?void 0:g.type,f.interactedInside)}),v=me(()=>{var g;return z_((g=c.current.openEvent)==null?void 0:g.type)}),b=me(()=>{Mu(f)});fe(()=>{i||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,b())},[i,f,b]),S.useEffect(()=>b,[b]),fe(()=>{var g,m,y,w,E;if(n&&i&&(g=f.handleCloseOptions)!=null&&g.blockPointerEvents&&v()&&Ce(a)&&l){const N=a,k=l,C=Le(l),P=(y=(m=u==null?void 0:u.nodesRef.current.find(z=>z.id===d))==null?void 0:m.context)==null?void 0:y.elements.floating;P&&(P.style.pointerEvents="");const j=f.pointerEventsScopeElement!==k?f.pointerEventsScopeElement:null,A=P!==k?P:null,D=((E=(w=f.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:E.call(w))??j??A??N.closest("[data-rootownerid]")??C.body;return UE(f,{scopeElement:D,referenceElement:N,floatingElement:k}),()=>{b()}}},[n,i,a,l,f,v,u,d,b]),S.useEffect(()=>{if(!n)return;function g(){return!!(u&&d&&Cs(u.nodesRef.current,d).length>0)}function m(C){const P=ao(r,"close",f.pointerType),j=()=>{o.setOpen(!1,De(St,C)),u==null||u.events.emit("floating.closed",C)};P?f.openChangeTimeout.start(P,j):(f.openChangeTimeout.clear(),j())}function y(C){const P=At(C);if(!O_(P)){f.interactedInside=!1;return}f.interactedInside=(P==null?void 0:P.closest("[aria-haspopup]"))!=null}function w(){f.openChangeTimeout.clear(),p.clear(),u==null||u.events.off("floating.closed",N),b()}function E(C){var D;if(g()&&u){u.events.on("floating.closed",N);return}if(Nu(C.relatedTarget,o.context.triggerElements))return;const P=((D=c.current.floatingContext)==null?void 0:D.nodeId)??s,j=C.relatedTarget;if(!(u&&P&&Ce(j)&&Cs(u.nodesRef.current,P,!1).some(z=>{var R;return ye((R=z.context)==null?void 0:R.elements.floating,j)}))){if(f.handler){f.handler(C);return}b(),v()&&!x()&&m(C)}}function N(C){!u||!d||g()||p.start(0,()=>{u.events.off("floating.closed",N),o.setOpen(!1,De(St,C)),u.events.emit("floating.closed",C)})}const k=l;return or(k&&Ee(k,"mouseenter",w),k&&Ee(k,"mouseleave",E),k&&Ee(k,"pointerdown",y,!0),()=>{u==null||u.events.off("floating.closed",N)})},[n,l,o,c,r,s,v,x,b,f,u,d,p])}const fM={current:null};function KE(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=fM,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:x=!1}=t,v="rootStore"in e?e.rootStore:e,{dataRef:b,events:g}=v.context,m=Bi(c),y=Yg(v),w=S.useRef(!1),E=Ht(s),N=Ht(r),k=Ht(i),C=Ht(n),P=Ht(p),j=Ht(f),A=me(()=>{var _;return BS((_=b.current.openEvent)==null?void 0:_.type,y.interactedInside)}),D=me(()=>{var _;return((_=P.current)==null?void 0:_.call(P))!==!1}),z=me((_,F,T)=>{const M=v.context.triggerElements;if(M.hasElement(F))return!_||!ye(_,F);if(!Ce(T))return!1;const O=T;return M.hasMatchingElement(V=>ye(V,O))&&(!_||!ye(_,O))}),R=me(()=>{if(!y.handler)return;Le(v.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),I=me(()=>{Mu(y)});return u&&(y.handleCloseOptions=s==null?void 0:s.__options),S.useEffect(()=>R,[R]),S.useEffect(()=>{if(!n)return;function _(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",_),()=>{g.off("openchange",_)}},[n,g,y,R]),S.useEffect(()=>{if(!n)return;function _(H,K=!0){const W=ao(N.current,"close",y.pointerType);W?y.openChangeTimeout.start(W,()=>{v.setOpen(!1,De(St,H)),m==null||m.events.emit("floating.closed",H)}):K&&(y.openChangeTimeout.clear(),v.setOpen(!1,De(St,H)),m==null||m.events.emit("floating.closed",H))}const F=a.current??(u?v.select("domReferenceElement"):null);if(!Ce(F))return;function T(H){var ce;if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,o&&!xs(y.pointerType))return;const K=ay(k.current),W=ao(N.current,"open",y.pointerType),U=At(H),L=H.currentTarget??null,Q=v.select("domReferenceElement");let B=L;if(Ce(U)&&!v.context.triggerElements.hasElement(U)){for(const ve of v.context.triggerElements.elements())if(ye(ve,U)){B=ve;break}}Ce(L)&&Ce(Q)&&!v.context.triggerElements.hasElement(L)&&ye(L,Q)&&(B=Q);const q=B==null?!1:z(Q,B,U),Z=v.select("open"),Y=((ce=j.current)==null?void 0:ce.call(j))??v.select("transitionStatus")==="ending",G=!Z&&Y&&w.current,X=!q&&Ce(B)&&Ce(Q)&&ye(Q,B)&&G,te=K>0&&!W,he=q&&(Z||G)||X,Pe=!Z||q;if(he){D()&&v.setOpen(!0,De(St,H,B));return}te||(W?y.openChangeTimeout.start(W,()=>{Pe&&D()&&v.setOpen(!0,De(St,H,B))}):Pe&&D()&&v.setOpen(!0,De(St,H,B)))}function M(H){if(A()){I();return}R();const K=v.select("domReferenceElement"),W=Le(K);y.restTimeout.clear(),y.restTimeoutPending=!1;const U=b.current.floatingContext??(d==null?void 0:d());if(Nu(H.relatedTarget,v.context.triggerElements))return;if(E.current&&U){v.select("open")||y.openChangeTimeout.clear();const Q=a.current;y.handler=E.current({...U,tree:m,x:H.clientX,y:H.clientY,onClose(){I(),R(),C.current&&!A()&&Q===v.select("domReferenceElement")&&_(H,!0)}}),W.addEventListener("mousemove",y.handler),y.handler(H);return}(y.pointerType==="touch"?!ye(v.select("floatingElement"),H.relatedTarget):!0)&&_(H)}function O(H){ye(F,H.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const V=x?Ee(F,"mouseout",O):void 0;return l?or(Ee(F,"mousemove",T,{once:!0}),Ee(F,"mouseenter",T),Ee(F,"mouseleave",M),V):or(Ee(F,"mouseenter",T),Ee(F,"mouseleave",M),V)},[R,I,b,N,v,n,E,y,u,z,A,o,l,k,a,m,C,d,j,D,x]),S.useMemo(()=>{if(!n)return;function _(F){y.pointerType=F.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(F){var U,L,Q;const{nativeEvent:T}=F,M=F.currentTarget,O=v.select("domReferenceElement"),V=v.select("open"),H=z(O,M,F.target);if(o&&!xs(y.pointerType))return;if(V&&H&&((U=y.handleCloseOptions)!=null&&U.blockPointerEvents)){const B=v.select("floatingElement");if(B){const q=((Q=(L=y.handleCloseOptions)==null?void 0:L.getScope)==null?void 0:Q.call(L))??M.ownerDocument.body;UE(y,{scopeElement:q,referenceElement:M,floatingElement:B})}}const K=ay(k.current);if(V&&!H||K===0||!H&&y.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;y.restTimeout.clear();function W(){if(y.restTimeoutPending=!1,A())return;const B=v.select("open");!y.blockMouseMove&&(!B||H)&&D()&&v.setOpen(!0,De(St,T,M))}y.pointerType==="touch"?dn.flushSync(()=>{W()}):H&&V?W():(y.restTimeoutPending=!0,y.restTimeout.start(K,W))}}},[n,y,A,z,o,v,k,D])}const Ay=.1,hM=Ay*Ay,Be=.5;function hc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function pc(e,t,n,r,s,o,i,l,a,c){let u=!1;return hc(e,t,n,r,s,o)&&(u=!u),hc(e,t,s,o,i,l)&&(u=!u),hc(e,t,i,l,a,c)&&(u=!u),hc(e,t,a,c,n,r)&&(u=!u),u}function pM(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function mc(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 YE(e={}){const{blockPointerEvents:t=!1}=e,n=new Pn,r=({x:s,y:o,placement:i,elements:l,onClose:a,nodeId:c,tree:u})=>{const d=i==null?void 0:i.split("-")[0];let f=!1,p=null,x=null,v=typeof performance<"u"?performance.now():0;function b(m,y){const w=performance.now(),E=w-v;if(p===null||x===null||E===0)return p=m,x=y,v=w,!1;const N=m-p,k=y-x,C=N*N+k*k,P=E*E*hM;return p=m,x=y,v=w,C<P}function g(){n.clear(),a()}return function(y){n.clear();const w=l.domReference,E=l.floating;if(!w||!E||d==null||s==null||o==null)return;const{clientX:N,clientY:k}=y,C=At(y),P=y.type==="mouseleave",j=ye(E,C),A=ye(w,C);if(j&&(f=!0,!P))return;if(A&&(f=!1,!P)){f=!0;return}if(P&&Ce(y.relatedTarget)&&ye(E,y.relatedTarget))return;function D(){return!!(u&&Cs(u.nodesRef.current,c).length>0)}function z(){D()||g()}if(D())return;const R=w.getBoundingClientRect(),I=E.getBoundingClientRect(),_=s>I.right-I.width/2,F=o>I.bottom-I.height/2,T=I.width>R.width,M=I.height>R.height,O=(T?R:I).left,V=(T?R:I).right,H=(M?R:I).top,K=(M?R:I).bottom;if(d==="top"&&o>=R.bottom-1||d==="bottom"&&o<=R.top+1||d==="left"&&s>=R.right-1||d==="right"&&s<=R.left+1){z();return}let W=!1;switch(d){case"top":W=mc(N,k,O,R.top+1,V,I.bottom-1);break;case"bottom":W=mc(N,k,O,I.top+1,V,R.bottom-1);break;case"left":W=mc(N,k,I.right-1,K,R.left+1,H);break;case"right":W=mc(N,k,R.right-1,K,I.left+1,H);break}if(W)return;if(f&&!pM(N,k,R)){z();return}if(!P&&b(N,k)){z();return}let U=!1;switch(d){case"top":{const L=T?Be/2:Be*4,Q=T||_?s+L:s-L,B=T?s-L:_?s+L:s-L,q=o+Be+1,Z=_||T?I.bottom-Be:I.top,Y=_?T?I.bottom-Be:I.top:I.bottom-Be;U=pc(N,k,Q,q,B,q,I.left,Z,I.right,Y);break}case"bottom":{const L=T?Be/2:Be*4,Q=T||_?s+L:s-L,B=T?s-L:_?s+L:s-L,q=o-Be,Z=_||T?I.top+Be:I.bottom,Y=_?T?I.top+Be:I.bottom:I.top+Be;U=pc(N,k,Q,q,B,q,I.left,Z,I.right,Y);break}case"left":{const L=M?Be/2:Be*4,Q=M||F?o+L:o-L,B=M?o-L:F?o+L:o-L,q=s+Be+1,Z=F||M?I.right-Be:I.left,Y=F?M?I.right-Be:I.left:I.right-Be;U=pc(N,k,Z,I.top,Y,I.bottom,q,Q,q,B);break}case"right":{const L=M?Be/2:Be*4,Q=M||F?o+L:o-L,B=M?o-L:F?o+L:o-L,q=s-Be,Z=F||M?I.left+Be:I.right,Y=F?M?I.left+Be:I.right:I.left+Be;U=pc(N,k,q,Q,q,B,Z,I.top,Y,I.bottom);break}}U?f||n.start(40,z):z()}};return r.__options={...e,blockPointerEvents:t},r}const GE=S.createContext(void 0);function Ta(e){const t=S.useContext(GE);if(t===void 0&&!e)throw new Error(nn(47));return t}const mM={...qg,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 gM extends jd{constructor(n,r,s){const o=new Vg;super(xM(n,o,r,s),yM(o),mM);ge(this,"setOpen",(n,r)=>{var d,f;const s=r.reason===St,o=r.reason===Es&&r.event.detail===0,i=!n&&(r.reason===kd||r.reason==null),l=LE(r),a=this.select("activeTriggerId");if(!n&&r.reason===WS&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(f=(d=this.context).onOpenChange)==null||f.call(d,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const p=Fg(this.state,n,r.trigger,l());p.openChangeReason=r.reason,this.update(p)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(OO,()=>{this.set("stickIfOpen",!1)}),dn.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Xl&&(u="focus"),this.set("instantType",u)})}}function xM(e,t,n,r=!1){const s={...Wg(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 yM(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new Pn,triggerElements:e}}const zy=gd(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,d=wM(a,{modal:l,open:s,openProp:r,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),p=d.useState("mounted"),x=d.useState("payload");d.useContextCallback("onOpenChange",o),d.useContextCallback("onOpenChangeComplete",i),BE(d,f),Lg(d);const{forceUnmount:v}=Hg(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:l}),S.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),S.useImperativeHandle(t.actionsRef,()=>({unmount:v,close:()=>d.setOpen(!1,De(bg))}),[v,d]);const b=f||p;return h.jsxs(GE.Provider,{value:d,children:[a&&h.jsx($g,{handle:a,store:d}),b&&h.jsx(bM,{store:d,modal:l}),typeof n=="function"?n({payload:x}):n]})});function vM(e){return Ta(!0)?h.jsx(zy,{props:e}):h.jsx(LO,{children:h.jsx(zy,{props:e})})}function wM(e,t){const n=Dg((r,s)=>new gM(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function bM({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=Mg(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Bg(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const QE=S.createContext(void 0);function Gg(e=!1){const t=S.useContext(QE);if(t===void 0&&!e)throw new Error(nn(16));return t}function SM(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 Wf(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 Qg(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=Gg(!0),a=o??l!==void 0,{props:c}=SM({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const p=i.current;Uf(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);fe(u,[u]);const d=S.useCallback((p={})=>{const{onClick:x,onMouseDown:v,onKeyUp:b,onKeyDown:g,onPointerDown:m,...y}=p;return Nd({onClick(w){if(t){w.preventDefault();return}x==null||x(w)},onMouseDown(w){t||v==null||v(w)},onKeyDown(w){if(t||(ju(w),g==null||g(w),w.baseUIHandlerPrevented))return;const E=w.target===w.currentTarget,N=w.currentTarget,k=Uf(N),C=!s&&EM(N),P=E&&(s?k:!C),j=w.key==="Enter",A=w.key===" ",D=N.getAttribute("role"),z=(D==null?void 0:D.startsWith("menuitem"))||D==="option"||D==="gridcell";if(E&&a&&A){if(w.defaultPrevented&&z)return;w.preventDefault(),(!s||k)&&(w.preventBaseUIHandler(),Wf(N,w));return}if(!P||s||!A&&!j){E&&C&&A&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),j&&(w.preventBaseUIHandler(),Wf(N,w)))},onKeyUp(w){if(!t){if(ju(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&Uf(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),Wf(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]),f=me(p=>{i.current=p,u()});return{getButtonProps:d,buttonRef:f}}function Uf(e){return Ve(e)&&e.tagName==="BUTTON"}function EM(e){return Ve(e)&&e.tagName==="A"&&!!e.href}const kM=300;function Vi(e){return Cd(e,"base-ui")}function CM(e,t){const n=S.useRef(null);function r(o){dn.flushSync(()=>{e.setOpen(!1,De(Xl,o.nativeEvent,o.currentTarget))});const i=hO(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,De(Xl,o.nativeEvent,o.currentTarget))});let a=fO(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ye(i,a);){const c=a;if(a=Pg(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function NM(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 RM(e,t){const n=me((o,i)=>{(typeof e=="function"?e():e)||t(i||(yd?"touch":""))}),{onClick:r,onPointerDown:s}=NM(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const TM=_S(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:d=kM,closeDelay:f=0,id:p,...x}=t,v=Ta(!0),g=WE(a)??v;if(!g)throw new Error(nn(74));const m=Vi(p),y=g.useState("isTriggerActive",m),w=g.useState("floatingRootContext"),E=g.useState("isOpenedByTrigger",m),N=g.useState("triggerPopupId",m),k=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:P}=HE(m,k,g,{payload:c,disabled:i,openOnHover:u,closeDelay:f}),j=g.useState("openChangeReason"),A=g.useState("stickIfOpen"),D=g.useState("openMethod"),z=g.useState("focusManagerModal"),R=KE(w,{enabled:!i&&u&&(D!=="touch"||j!==Es),mouseOnly:!0,move:!1,handleClose:YE(),restMs:d,delay:{close:f},triggerElementRef:k,isActiveTrigger:y,isClosing:()=>g.select("transitionStatus")==="ending"}),I=VO(w,{stickIfOpen:A}),_=RM(()=>g.select("open"),Q=>{g.set("openMethod",Q)}),F=g.useState("triggerProps",P),{getButtonProps:T,buttonRef:M}=Qg({disabled:i,native:l}),O={open(Q){return Q&&j===Es?j_.open(Q):HS.open(Q)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:H,handleFocusTargetFocus:K}=CM(g,k),U=Ut("button",t,{state:{disabled:i,open:E},ref:[M,n,C,k],props:[I.reference,R,F,_,{[hE]:"",id:m,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":N},x,T],stateAttributesMapping:O}),L=h.jsx(S.Fragment,{children:U},m);return P&&!z?h.jsxs(S.Fragment,{children:[h.jsx(Ri,{ref:V,onFocus:H}),L,h.jsx(Ri,{ref:g.context.triggerFocusTargetRef,onFocus:K})]}):L}),XE=S.createContext(void 0);function PM(){const e=S.useContext(XE);if(e===void 0)throw new Error(nn(45));return e}const IM=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ta().useState("mounted")||r?h.jsx(XE.Provider,{value:r,children:h.jsx(yE,{ref:n,...s})}):null});function Xg(e){return Ig(19)?e:e?"true":void 0}const ZE=S.createContext(void 0);function jM(){const e=S.useContext(ZE);if(!e)throw new Error(nn(46));return e}const _M=S.createContext(void 0);function JE(){const e=S.useContext(_M);return(e==null?void 0:e.direction)??"ltr"}const OM=e=>({name:"arrow",options:e,async fn(t){var M,O;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:d="real"}=ks(e,t)||{};if(c==null)return{};const f=QS(u),p={x:n,y:r},x=Ng(s),v=Cg(x),b=await i.getDimensions(c),g=x==="y",m=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[x]-p[x]-o.floating[v],N=p[x]-o.reference[x],k=d==="real"?await((M=i.getOffsetParent)==null?void 0:M.call(i,c)):l.floating;let C=l.floating[w]||o.floating[v];(!C||!await((O=i.isElement)==null?void 0:O.call(i,k)))&&(C=l.floating[w]||o.floating[v]);const P=E/2-N/2,j=C/2-b[v]/2-1,A=Math.min(f[m],j),D=Math.min(f[y],j),z=A,R=C-b[v]-D,I=C/2-b[v]/2+P,_=GS(z,I,R),F=!a.arrow&&Mr(s)!=null&&I!==_&&o.reference[v]/2-(I<z?A:D)-b[v]/2<0,T=F?I<z?I-z:I-R:0;return{[x]:p[x]+T,data:{[x]:_,centerOffset:I-_-T,...F&&{alignmentOffset:T}},reset:F}}}),MM=(e,t)=>{const{name:n,fn:r}=OM(e);return{name:n,fn:r,options:[e,t]}},AM={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}}}},zM={sideX:"left",sideY:"top"},DM="--available-width",$M="--available-height",FM="--anchor-width",LM="--anchor-height",HM="--transform-origin",Dy=DM,$y=$M;function ek(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 Fy(e,t,n){const{rects:r,placement:s}=e;return{side:ek(t,Cn(s),n),align:Mr(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tk(e){return BM(e,cM)}function BM(e,t){var Co,Ma;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:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:x=!1,floatingRootContext:v,mounted:b,collisionAvoidance:g,shift:m,nodeId:y,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:N}=e,[k,C]=S.useState(null);!b&&k!==null&&C(null);const P=g.side||"flip",j=g.align||"flip",A=g.fallbackAxisSide||"end",D=(m==null?void 0:m.crossAxis)??!1,z=m==null?void 0:m.rootBoundary,R=typeof n=="function"?n:void 0,I=me(R),_=R?I:n,F=Ht(n),T=Ht(b),O=JE()==="rtl",V=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[s],H=i==="center"?V:`${V}-${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,U=s==="bottom"?W:0,L=s==="top"?W:0,Q=s==="right"?W:0,B=s==="left"?W:0,q={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:K},Z=S.useRef(null),Y=Ht(o),G=Ht(l),X=typeof o!="function"?o:0,te=typeof l!="function"?l:0,he=[];p&&he.push(p),he.push(T2(ke=>{const yt=Fy(ke,s,O),Yt=typeof Y.current=="function"?Y.current(yt):Y.current,Tt=typeof G.current=="function"?G.current(yt):G.current;return{mainAxis:Yt,crossAxis:Tt,alignmentAxis:Tt}},[X,te,O,s]));const Pe=j==="none"&&P!=="shift",ce=!Pe&&(u||D||P==="shift"),ve=P==="none"?null:j2({...q,padding:{top:K.top+W+U,right:K.right+W+B,bottom:K.bottom+W+L,left:K.left+W+Q},mainAxis:!D&&P==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:A}),de=Pe?null:P2({...q,rootBoundary:z,mainAxis:j!=="none",crossAxis:ce,limiter:u||D?void 0:I2(ke=>{if(!Z.current)return{};const{width:yt,height:Yt}=Z.current.getBoundingClientRect(),Tt=En(Cn(ke.placement)),gn=Tt==="y"?yt:Yt,rn=Tt==="y"?K.left+K.right:K.top+K.bottom;return{offset:gn/2+rn/2}})},[q,u,D,z,K,j]);P==="shift"||j==="shift"||i==="center"?he.push(de,ve):he.push(ve,de),he.push(_2({...q,apply({elements:{floating:ke},availableWidth:yt,availableHeight:Yt,rects:Tt}){if(!T.current)return;const gn=ke.style;gn.setProperty(Dy,`${yt}px`),gn.setProperty($y,`${Yt}px`);const rn=ot(ke).devicePixelRatio||1,{x:No,y:Lr,width:Ro,height:Kn}=Tt.reference,In=(Math.round((No+Ro)*rn)-Math.round(No*rn))/rn,Is=(Math.round((Lr+Kn)*rn)-Math.round(Lr*rn))/rn;gn.setProperty(FM,`${In}px`),gn.setProperty(LM,`${Is}px`)}}),MM(ke=>({element:Z.current||Le(ke.elements.floating).createElement("div"),padding:Z.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(ke){var Aa,za,Ui,qi,Da,$a;const{elements:{floating:yt},middlewareData:Yt,placement:Tt,platform:gn,rects:rn,y:No}=ke,Lr=Cn(Tt),Ro=Mr(Tt),Kn=En(Lr)==="y",In=Z.current,Is=typeof o=="function"?o(Fy(ke,s,O)):o;let To;if(!In&&Ro&&Math.abs(Kn?((Aa=Yt.shift)==null?void 0:Aa.x)||0:((za=Yt.shift)==null?void 0:za.y)||0)<=1)To=Ro==="start"===(Kn&&((Ui=gn.isRTL)==null?void 0:Ui.call(gn,yt))===!0)?"100%":"0%";else{const Qd=Kn?((qi=Yt.arrow)==null?void 0:qi.x)||0:((Da=Yt.arrow)==null?void 0:Da.y)||0,Xd=Kn?(In==null?void 0:In.clientWidth)||0:(In==null?void 0:In.clientHeight)||0;To=`${Qd+Xd/2}px`}let Wi=Lr==="top"||Lr==="left"?`calc(100% + ${Is}px)`:`${-Is}px`;return ce&&Kn&&Math.abs((($a=Yt.shift)==null?void 0:$a.y)||0)>Is&&(Wi=`${rn.reference.y+rn.reference.height/2-No}px`),yt.style.setProperty(HM,Kn?`${To} ${Wi}`:`${Wi} ${To}`),{}}},AM,w),fe(()=>{!b&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,v]);const xe=S.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:Oe,elements:Ie,x:ze,y:at,middlewareData:et,update:ne,placement:re,context:Me,isPositioned:we,floatingStyles:xt}=t({rootContext:v,open:x?b:void 0,placement:H,middleware:he,strategy:r,whileElementsMounted:x?void 0:(...ke)=>jy(...ke,xe),nodeId:y,externalTree:N}),{sideX:qt,sideY:se}=et.adaptiveOrigin||zM,Re=we?r:"fixed",Ae=S.useMemo(()=>{let ke;return we?w?ke={position:Re,[qt]:ze,[se]:at}:ke={...xt,position:Re}:ke={position:Re,top:0,left:0},ke[Dy]="100vw",ke[$y]="100vh",we||(ke.opacity=0),ke},[w,Re,qt,ze,se,at,xt,we]),Kt=S.useRef(null);fe(()=>{if(!b)return;const ke=F.current,yt=typeof ke=="function"?ke():ke,Tt=(Ly(yt)?yt.current:yt)||null||null;Tt!==Kt.current&&(Oe.setPositionReference(Tt),Kt.current=Tt)},[b,Oe,_,F]),S.useEffect(()=>{if(!b)return;const ke=F.current;typeof ke!="function"&&Ly(ke)&&ke.current!==Kt.current&&(Oe.setPositionReference(ke.current),Kt.current=ke.current)},[b,Oe,_,F]),S.useEffect(()=>{if(x&&b&&Ie.reference&&Ie.floating)return jy(Ie.reference,Ie.floating,ne,xe)},[x,b,Ie,ne,xe]);const Rt=Cn(re),Un=ek(s,Rt,O),qn=Mr(re)||"center",So=!!((Co=et.hide)!=null&&Co.referenceHidden);fe(()=>{E&&b&&we&&Rt!==V&&C(Rt)},[E,b,we,Rt,V]);const Eo=S.useMemo(()=>{var ke,yt;return{position:"absolute",top:(ke=et.arrow)==null?void 0:ke.y,left:(yt=et.arrow)==null?void 0:yt.x}},[et.arrow]),ko=((Ma=et.arrow)==null?void 0:Ma.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:Ae,arrowStyles:Eo,arrowRef:Z,arrowUncentered:ko,side:Un,align:qn,physicalSide:Rt,anchorHidden:So,refs:Oe,context:Me,isPositioned:we,update:ne}),[Ae,Eo,Z,ko,Un,qn,Rt,So,Oe,Me,we,ne])}function Ly(e){return e!=null&&"current"in e}const nk=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 h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function Zg(e){return e==="starting"?MO:Et}function rk(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},Zg(r),s],stateAttributesMapping:vg})}let Hy={},By={},Vy="";function _d(e,t){return Ca(e)?e:t}function Wy(e,t,n){return/hidden|clip/.test(e.getComputedStyle(_d(t,n)).overflowY)}function VM(e){if(typeof document>"u")return!1;const t=Le(e);return ot(t).innerWidth-t.documentElement.clientWidth>0}function WM(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Le(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 UM(e){const t=Le(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 qM(e){var p;const t=Le(e),n=t.documentElement,r=t.body,s=ot(n);let o=0,i=0,l=!1;const a=er.create();if(vo&&(((p=s.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function c(){const x=s.getComputedStyle(n),v=s.getComputedStyle(r),m=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Hy={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Vy=n.style.scrollBehavior,By={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,E=x.overflowY==="scroll"||v.overflowY==="scroll",N=x.overflowX==="scroll"||v.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),C=Math.max(0,s.innerHeight-r.clientHeight),P=parseFloat(v.marginTop)+parseFloat(v.marginBottom),j=parseFloat(v.marginLeft)+parseFloat(v.marginRight),A=_d(n,r);if(l=WM(e),l){n.style.scrollbarGutter=m,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(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:j||k?`calc(100vw - ${j+k}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,Hy),Object.assign(r.style,By),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Vy)}function d(){u(),a.request(c)}c();const f=Ee(s,"resize",d);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&f()}}class KM{constructor(){ge(this,"lockCount",0);ge(this,"restore",null);ge(this,"timeoutLock",Pn.create());ge(this,"timeoutUnlock",Pn.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=Le(t),r=n.documentElement,s=n.body,o=ot(r);if(Wy(o,r,s)){const l=new o.MutationObserver(()=>{Wy(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=yd||!VM(t);this.restore=i?UM(t):qM(t)}}const YM=new KM;function sk(e=!0,t=null){fe(()=>{if(e)return YM.acquire(t)},[e,t])}const GM=20;function QM(e,t,n,r){const[s,o]=S.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const i=Le(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-GM)},[e,t,n]),sk(e&&(!t||s),r)}const XM=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:x,sticky:v,disableAnchorTracking:b=!1,collisionAvoidance:g=pE,...m}=t,y=Ta(),w=PM(),E=$O(),N=y.useState("floatingRootContext"),k=y.useState("mounted"),C=y.useState("open"),P=y.useState("openChangeReason"),j=y.useState("activeTriggerElement"),A=y.useState("modal"),D=y.useState("openMethod"),z=y.useState("positionerElement"),R=y.useState("instantType"),I=y.useState("transitionStatus"),_=y.useState("adaptiveOrigin"),F=S.useRef(null),T=$E(z),M=tk({anchor:i,floatingRootContext:N,positionMethod:l,mounted:k,side:a,sideOffset:u,align:c,alignOffset:d,arrowPadding:x,collisionBoundary:f,collisionPadding:p,sticky:v,disableAnchorTracking:b,keepMounted:w,nodeId:E,collisionAvoidance:g,adaptiveOrigin:_}),O=N.useState("domReferenceElement");fe(()=>{const U=O,L=F.current;if(U&&(F.current=U),L&&U&&U!==L){y.set("instantType",void 0);const Q=new AbortController;return T(()=>{y.set("instantType","trigger-change")},Q.signal),()=>{Q.abort()}}},[O,T,y]);const V=A===!0&&P!==St;QM(C&&V,D==="touch",z,j);const H=y.useStateSetter("positionerElement"),K={open:C,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:R},W=rk(t,K,{styles:M.positionerStyles,transitionStatus:I,props:m,refs:[n,H],hidden:!k,inert:!C});return h.jsxs(ZE.Provider,{value:M,children:[k&&V&&h.jsx(nk,{inert:Xg(!C),cutout:j}),h.jsx(FO,{id:E,children:W})]})}),Pp="ArrowUp",Ip="ArrowDown",jp="ArrowLeft",_p="ArrowRight",Op="Home",Mp="End",Jg=new Set([Pp,Ip,jp,_p,Op,Mp]),ZM="Shift",JM=[ZM,"Control","Alt","Meta"];function eA(e){return Ve(e)&&e.tagName==="INPUT"}function Uy(e){return!!(eA(e)&&e.selectionStart!=null||Ve(e)&&e.tagName==="TEXTAREA")}function qy(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=Ky(e,t,"left"),c=gc(e),u=gc(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=Ky(e,t,"top"),c=gc(e),u=gc(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 Ky(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 gc(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 tA=S.createContext(void 0);function nA(e){return S.useContext(tA)}const rA=S.createContext(void 0);function sA(){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 oA=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Ta(),u=jM(),d=nA()!=null,{context:f,hasClosePart:p}=sA(),x=c.useState("open"),v=c.useState("openMethod"),b=c.useState("instantType"),g=c.useState("transitionStatus"),m=c.useState("popupProps"),y=c.useState("titleElementId"),w=c.useState("descriptionElementId"),E=c.useState("modal"),N=c.useState("mounted"),k=c.useState("openChangeReason"),C=c.useState("activeTriggerElement"),P=c.useState("floatingRootContext"),j=P.useState("floatingId"),A=c.useState("disabled"),D=c.useState("openOnHover"),z=c.useState("closeDelay");Ra({open:x,ref:c.context.popupRef,onComplete(){var M,O;x&&((O=(M=c.context).onOpenChangeComplete)==null||O.call(M,!0))}}),qE(P,{enabled:D&&!A,closeDelay:z});const R=i===void 0?FE(c.context.popupRef):i,I=E!==!1&&p;c.useSyncedValue("focusManagerModal",I);const _=c.useStateSetter("popupElement"),F={open:x,side:u.side,align:u.align,instant:b,transitionStatus:g},T=Ut("div",t,{state:F,ref:[n,c.context.popupRef,_],props:[m,{id:j,role:"dialog",...zg,"aria-labelledby":y,"aria-describedby":w,onKeyDown(M){d&&Jg.has(M.key)&&M.stopPropagation()}},Zg(g),a],stateAttributesMapping:wg});return h.jsx(SE,{context:P,openInteractionType:v,modal:I,disabled:!N||k===St,initialFocus:R,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Ve(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:h.jsx(rA.Provider,{value:f,children:T})})}),Ii=vM,ji=TM,uo=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>h.jsx(IM,{children:h.jsx(XM,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:h.jsx(oA,{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})})}));uo.displayName="PopoverContent";const iA=48,lA=60,aA=24;function cA({glyph:e,label:t,placeholder:n,value:r,onChange:s,options:o,loading:i,failed:l,search:a,onSearchChange:c,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:p=!0,title:x}){const[v,b]=S.useState(!1),[g,m]=S.useState(""),y=c!==void 0,w=y?a??"":g,E=y?c:m,N=S.useMemo(()=>{const I=w.trim().toLowerCase(),_=I&&!y?o.filter(T=>T.value.toLowerCase().includes(I)):o;return[...r.filter(T=>!_.some(M=>M.value===T)).filter(T=>!I||T.toLowerCase().includes(I)).map(T=>({value:T,count:0})),..._]},[o,w,y,r]),k=S.useRef(null),C=()=>{const I=k.current;!I||!u||d||!f||I.scrollTop+I.clientHeight>=I.scrollHeight-iA&&f()},P=I=>{s(r.includes(I)?r.filter(_=>_!==I):[...r,I])},j=N.length>lA,A=sg({count:N.length,getScrollElement:()=>k.current,estimateSize:()=>aA,overscan:8,enabled:j}),D=I=>{const _=r.includes(I.value);return h.jsxs("button",{type:"button",role:"option","aria-selected":_,onClick:()=>P(I.value),className:st("mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800",_?"text-zinc-100":"text-zinc-400"),children:[h.jsx("span",{className:"w-3 shrink-0",children:_&&h.jsx(lg,{width:12,height:12})}),h.jsx("span",{className:"truncate",children:I.value}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-zinc-600",children:I.count})]},I.value)},z=w.trim(),R=p&&z!==""&&!N.some(I=>I.value===z)&&!r.includes(z);return h.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&&h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),h.jsxs(Ii,{open:v,onOpenChange:b,children:[h.jsx(ji,{render:h.jsx("button",{type:"button","aria-label":t,title:x??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?h.jsx("span",{className:"text-zinc-600",children:n}):r.map(I=>h.jsx(Xe,{className:"mono max-w-[10rem] truncate",children:I},I))}),h.jsxs(uo,{align:"start",className:"w-72 p-0",children:[h.jsx("div",{className:"border-b border-line px-2",children:h.jsx(fg,{autoFocus:!0,value:w,onChange:I=>E(I.target.value),placeholder:p?"search, or type a value…":"search…",onKeyDown:I=>{I.key!=="Enter"||!R||(I.preventDefault(),P(z),E(""))}})}),h.jsxs("div",{ref:k,onScroll:C,className:"max-h-64 overflow-auto py-1",role:"listbox",tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[R&&h.jsxs("button",{type:"button","aria-label":`use ${z} as typed`,onClick:()=>{P(z),E("")},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:[h.jsx("span",{className:"w-3 shrink-0 text-zinc-600",children:"+"}),h.jsx("span",{className:"truncate",children:z}),h.jsx("span",{className:"ml-auto text-[10px] text-zinc-600",children:"use as typed"})]}),d&&N.length>0&&h.jsx("p",{className:"px-2 py-1 text-[10px] text-zinc-600",children:"loading more…"}),N.length===0&&!R&&h.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"}),j?h.jsx("div",{className:"relative w-full",style:{height:`${A.getTotalSize()}px`},children:A.getVirtualItems().map(I=>{var _;return h.jsx("div",{ref:A.measureElement,"data-index":I.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${I.start}px)`},children:D(N[I.index])},((_=N[I.index])==null?void 0:_.value)??I.key)})}):N.map(D)]})]})]}),r.length>0&&h.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>s([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:"h-4 w-4",children:h.jsx(bs,{width:12,height:12})})]})}const Yy=50,uA=200;function dA(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function fA(e){return e.filter(t=>t.value!==null).map(t=>({value:t.value,count:t.count}))}function Au({field:e,scope:t,value:n,onChange:r,glyph:s,label:o,placeholder:i,title:l,single:a}){const[c,u]=S.useState(""),d=dA(c,uA),f=WR({queryKey:["run-values",e,t,d],queryFn:({pageParam:x})=>Fe.values(e,t,{limit:Yy,offset:x,search:d}),initialPageParam:0,getNextPageParam:(x,v)=>x.length<Yy?void 0:v.reduce((b,g)=>b+g.length,0),staleTime:1e4}),p=S.useMemo(()=>{var x;return fA(((x=f.data)==null?void 0:x.pages.flat())??[])},[f.data]);return h.jsx(cA,{label:o,placeholder:i,...l!==void 0&&{title:l},...s!==void 0&&{glyph:s},value:n,onChange:x=>r(a?x.slice(-1):x),options:p,search:c,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}const ok=[{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 hA(e){const[t,n,...r]=e.split(":");return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(":")}}function xc(e){var r;const t=hA(e);if(!t)return e;const n=((r=ok.find(s=>s.op===t.op))==null?void 0:r.label)??t.op;return`${t.key} ${n} ${t.operand.split("|").join(", ")}`}function pA({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([]),[d,f]=S.useState(""),p=l==="eq"||l==="in",x=p?c.join("|"):d.trim(),v=o!==""&&x!=="",b=()=>{i(""),a("eq"),u([]),f("")},g=()=>{if(!v)return;const m=l==="in"&&c.length===1?"eq":l;t([...e,`${o}:${m}:${x}`]),b(),s(!1)};return h.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:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"⛃"}),h.jsxs(Ii,{open:r,onOpenChange:m=>{s(m),m||b()},children:[h.jsx(ji,{render:h.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?h.jsx("span",{className:"text-zinc-600",children:"filter by attribute…"}):e.map(m=>h.jsx(Xe,{variant:"attr",className:"mono max-w-[12rem] truncate",children:xc(m)},m))}),h.jsx(uo,{align:"start",className:"w-80 p-2",children:h.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line pb-1.5",children:e.map(m=>h.jsxs(Xe,{variant:"attr",className:"mono gap-1 py-0.5",children:[xc(m),h.jsx(Se,{variant:"ghost",size:"icon",className:"h-3 w-3 text-indigo-300/70 hover:text-indigo-100",title:`remove ${xc(m)}`,"aria-label":`remove ${xc(m)}`,onClick:()=>t(e.filter(y=>y!==m)),children:h.jsx(bs,{width:10,height:10})})]},m))}),h.jsx(Au,{field:"attr",scope:n,glyph:"⛃",label:"attribute key",placeholder:"key…",single:!0,value:o?[o]:[],onChange:m=>{i(m.at(-1)??""),u([])}}),h.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:ok.map(m=>h.jsx("option",{value:m.op,className:"bg-zinc-900",children:m.label},m.op))}),p?h.jsx(Au,{field:`attr.${o}`,scope:n,glyph:"=",label:"attribute value",placeholder:o?"value…":"pick a key first",...l!=="in"&&{single:!0},value:c,onChange:u}):h.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-zinc-600",children:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"="}),h.jsx(fg,{value:d,onChange:m=>f(m.target.value),placeholder:"value…","aria-label":"attribute value",onKeyDown:m=>{m.key==="Enter"&&g()}})]}),h.jsx(Se,{variant:"brand",size:"chip",className:"mono self-end rounded",disabled:!v,onClick:g,children:"add filter"})]})})]}),e.length>0&&h.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>t([]),title:"clear attribute filters","aria-label":"clear attribute filters",className:"h-4 w-4",children:h.jsx(bs,{width:12,height:12})})]})}function mA({facets:e,value:t,onChange:n}){return e.length===0||!MI(e)&&t.kind==="all"?null:h.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),e.map(r=>{const s=jI(t,r.filter);return h.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:[h.jsx("span",{className:"truncate",children:r.label}),h.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:r.count})]},aS(r.filter))})]})}function Od(e){return`#/workflow/${encodeURIComponent(e)}`}function Gy(e){const t=e.match(/^#\/workflow\/(.+)$/);return t!=null&&t[1]?decodeURIComponent(t[1]):void 0}function gA(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 Qy(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 Xy({title:e,empty:t,links:n,counts:r}){return h.jsxs("section",{"aria-label":e,className:"min-w-0",children:[h.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:e}),n.length===0?h.jsx("p",{className:"mt-1 text-[11px] text-zinc-600",children:t}):h.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:n.map(s=>{var o;return h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("a",{href:Od(s.workflow),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:s.workflow}),h.jsxs(Xe,{className:s.kind==="failed"?"s-failed":"s-completed",children:["on ",s.kind]}),gA(s).map(i=>h.jsx(Xe,{children:i},i)),Qy(r,s.workflow)&&h.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:Qy(r,s.workflow)})]},`${s.workflow}:${s.kind}`)})})]})}function ik({links:e,counts:t}){return h.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[h.jsx(Xy,{title:"Starts when it settles",empty:"No workflow starts when it settles.",links:e.startsOnSettle,counts:t}),h.jsx(Xy,{title:"Started by",empty:"No workflow's settling starts it.",links:e.startedBy})]})}function xA({workflow:e}){const{data:t,error:n,isPending:r}=Zt({queryKey:["workflow-lifecycle",e],queryFn:()=>Fe.workflowLifecycle(e),refetchInterval:1e4});return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"border-b border-line px-7 py-5",children:[h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e}),h.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Lifecycle events: registered here and announced by live workers."})]}),h.jsx("div",{className:"px-7 py-5",children:n?h.jsx("p",{className:"text-[11px] text-bad",children:n instanceof Error?n.message:String(n)}):r||!t?h.jsx("p",{className:"text-[11px] text-zinc-600",children:"Loading…"}):h.jsx(ik,{links:t,counts:t.triggerCounts})})]})}function wo(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 yA(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 lk=50;function e0(e,t=lk){const n=new Set;for(const r of e){if(n.size>=t)break;const s=wo(r);s!==void 0&&n.add(s)}return[...n]}function ak(e,t){const n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}const vA=12;function wA(e,t,n=vA){const r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function bA(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}function ck(e){const t={};for(const n of e)n.data&&(t[n.data.run.id]=n.data);return t}function SA(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString().slice(11,23)}function EA(e,t){if(e.type==="run.triggered")return e.triggeredRunId?[{label:"started",runId:e.triggeredRunId}]:[];if(e.type.startsWith("step.")&&e.name){const n=wo({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 kA(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 CA({tail:e,sourceRunId:t,parentRunId:n,onOpenRun:r}){const s=S.useSyncExternalStore(e.subscribe,e.snapshot,e.snapshot);return h.jsxs("section",{"aria-label":"Events",className:"mt-3",children:[h.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:["Events ",h.jsx("span",{className:"normal-case tracking-normal text-zinc-600",children:"(live)"})]}),s.length===0?h.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."]}):h.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 h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5 text-[11px]","data-type":i.type,children:[h.jsx("span",{className:"mono text-zinc-600",title:i.at,children:SA(i.at)}),h.jsx("span",{className:`mono ${kA(i.type)}`,children:i.type}),i.name&&(i.type==="run.triggered"||i.type==="run.trigger_failed"?h.jsx("a",{href:Od(i.name),className:"mono text-zinc-200 underline-offset-2 hover:underline",children:i.name}):h.jsx("span",{className:"mono text-zinc-400",children:i.name})),i.seq!=null&&h.jsxs(Xe,{className:"text-[10px]",children:["#",i.seq]}),EA(i,{sourceRunId:t,parentRunId:n}).map(a=>h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:a.label}),h.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)&&h.jsx("span",{className:"text-bad",children:i.error.message}),i.reason&&h.jsx("span",{className:"text-zinc-500",children:i.reason})]},o)})})]})}const hl=100;function NA(e,t,n=hl){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 RA="fan:";function Ap(e){var n;if(!e.name.startsWith(RA))return;const t=(n=e.output)==null?void 0:n.values;return Array.isArray(t)?t.length:void 0}function uk(e){const t=Ap(e);return t===void 0?e.name:`${t} child run${t===1?"":"s"}`}function TA(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 PA(e){if(e.some(n=>Ap(n)!==void 0))return`child runs ×${e.reduce((r,s)=>r+(Ap(s)??1),0)}`;const t=TA(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function IA(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 dk(e,t=[]){const n=jA(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=IA(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 jA(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:PA(i)}),n=l}return t}function t0(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 n0(e,t=!1){const n=t0(e,t);return n.running>0?"running":n.pending>0||n.notStarted>0?"pending":n.failed>0||n.interrupted>0?"failed":"completed"}function fk(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}const _A=new Set(["completed","failed","cancelled","dead"]);function zp(e){return _A.has(e)}const zu=[{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"}],OA=9e4;function MA(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=OA).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 hk=[];function AA(e){const t=S.useMemo(()=>e0(e),[e]);return hm({queries:t.map(n=>({queryKey:["run",n],queryFn:()=>Fe.run(n)})),combine:ck})}function pk(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}=og(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 mk(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 r0(e,t,n,r=pk(e,t,n.liveNow)){const{t0:s,span:o}=n,[i,l]=r,{subs:a}=og(e.events??[]),c=a.map(u=>{var p;const d=u.startedAt??i,f=((p=u.terminal)==null?void 0:p.at)??d;return{key:u.id,name:u.name,status:u.status??"ok",left:(d-s)/o*100,width:Math.max((f-d)/o*100,.8),ms:u.durationMs??Math.max(f-d,0)}});return{step:e,childId:wo(e),childRun:t,left:(i-s)/o*100,width:Math.max((l-i)/o*100,.8),ms:l-i,subRows:c}}function Du(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const zA={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"},DA={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Md({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var A;const{step:d,left:f,width:p,ms:x,subRows:v}=e,b=d.status==="failed",g=wo(d),m=!!g,y=m?ag:cg(d.kind),w=s===`${d.runId}#${d.seq}`,E=m&&g!==void 0&&a.has(g),N=v.length>0&&!m,k=c.has(d.seq),C=HI(d,Date.now()),{data:P}=Zt({queryKey:["workers"],queryFn:()=>Fe.workers(),refetchInterval:1e4,enabled:C}),j=C?MA(d,P==null?void 0:P.find(D=>D.group===d.workerGroup),Date.now()):void 0;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>o(d,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:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[m&&g!==void 0&&h.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(g)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:E?"Collapse child run":"Expand child run inline",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:E?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),N&&h.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),u(d.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:k?`Show ${v.length} sub-process(es)`:"Hide sub-processes",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:k?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),h.jsx("span",{className:b?"text-red-400":m?"text-indigo-300":"text-emerald-400",children:h.jsx(y,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:g!==void 0?((A=n[g])==null?void 0:A.run.workflow)??ak(g,d.runId):uk(d)}),m&&g!==void 0&&h.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),i(g)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.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:`${f}%`,width:`${p}%`}}),h.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(${f+p}%, calc(100% - 44px))`},children:Du(x)})]})]}),(j==null?void 0:j.kind)==="working"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",j.instanceId," — heartbeat ",j.beatAgoS,"s ago",j.inFlight!==void 0?` · ${j.inFlight} in flight`:""]}),(j==null?void 0:j.kind)==="lost"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",j.minutes,"m ago, no live worker (possibly lost)"]}),v.length>0&&!k&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:v.map(D=>h.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${D.name} — ${D.status}`,children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${DA[D.status]}`}),h.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:D.name})]}),h.jsxs("span",{className:"relative h-3",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${zA[D.status]}`,style:{left:`${D.left}%`,width:`${D.width}%`}}),h.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(${D.left+D.width}%, calc(100% - 38px))`},children:Du(D.ms)})]})]},D.key))}),m&&g!==void 0&&E&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:h.jsx(HA,{id:g,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function $A({label:e,fanFailed:t,memberRows:n,rowProps:r}){return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),h.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),h.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>h.jsx(Md,{row:s,...r},s.step.seq))})]})}const Zy=28;function FA({fan:e,frame:t,rowProps:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(!1),l=zp(n.run.status),a=t0(e,l),c=n0(e,l),u=c==="running"||c==="pending",d=n.run.status==="running"||n.run.status==="suspended",f=e.startedAt?new Date(e.startedAt).getTime():void 0,p=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,x=S.useMemo(()=>e.failures.map(v=>r0(v,void 0,t)),[e.failures,t]);return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1",children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("button",{type:"button",onClick:()=>s(v=>!v),className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:r?"Hide the members":`List the ${e.size} members started`,children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out, summarized",children:"⑃"}),h.jsxs("span",{className:`truncate text-[12px] ${c==="failed"?"text-red-400":"text-zinc-300"}`,title:e.group,children:[e.label," ×",a.total]})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),f!==void 0&&p!==void 0&&h.jsxs(h.Fragment,{children:[h.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:`${(f-t.t0)/t.span*100}%`,width:`${Math.max((p-f)/t.span*100,.8)}%`}}),h.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:Du(p-f)})]})]})]}),h.jsxs("div",{className:"flex items-center gap-3 px-2 pb-1.5 pl-[26px]",children:[h.jsx("span",{className:"flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-zinc-800",children:zu.map(v=>a[v.key]>0?h.jsx("span",{className:v.className,style:{width:`${a[v.key]/Math.max(a.total,1)*100}%`}},v.key):null)}),h.jsxs("span",{className:"mono tnum flex flex-wrap gap-2 text-[10px]",children:[a.started<a.total&&h.jsxs("span",{className:"text-zinc-400",children:[fk(a)," started"]}),zu.map(v=>a[v.key]>0?h.jsxs("span",{className:v.text,children:[a[v.key]," ",v.label,v.key==="skipped"&&e.failFast?" (failFast)":""]},v.key):null)]})]}),x.length>0&&!r&&h.jsxs("div",{className:"ml-[10px] border-l border-red-500/30 pl-1",children:[h.jsx("div",{className:"mono px-2 text-[10px] text-red-300/70",children:a.failed>x.length?`first ${x.length} of ${a.failed} failed`:`${x.length} failed`}),x.map(v=>h.jsx(Md,{row:v,...n},v.step.seq))]}),r&&h.jsxs("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:[h.jsx("div",{className:"flex items-center gap-2 px-2 py-0.5",children:h.jsx("button",{type:"button",onClick:()=>i(v=>!v),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"})}),h.jsx(LA,{group:e.group,failedOnly:o,live:u&&d,frame:t,rowProps:n},o?"failed":"all")]})]})}function LA({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=sg({count:l??0,getScrollElement:()=>i.current,estimateSize:()=>Zy,measureElement:w=>w.getBoundingClientRect().height,overscan:10}),u=c.getVirtualItems(),d=NA((b=u[0])==null?void 0:b.index,(g=u[u.length-1])==null?void 0:g.index),f=hm({queries:d.map(w=>({queryKey:["fan",o,e,t,w],queryFn:()=>Fe.fanMembers(o,e,{offset:w*hl,limit:hl,failed:t}),refetchInterval:n?5e3:!1}))}),p=(y=(m=f.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 x=w=>{var k,C;const E=Math.floor(w/hl),N=d.indexOf(E);return N<0||(C=(k=f[N])==null?void 0:k.data)==null?void 0:C.items[w%hl]},v=f.find(w=>w.isError);return l===void 0&&v?h.jsxs("div",{className:"mono px-2 py-1 text-[10px] text-red-400",children:["couldn't load members:"," ",v.error instanceof Error?v.error.message:String(v.error)]}):l===void 0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading members…"}):l===0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:t?"no failed members":"no members"}):h.jsx("div",{ref:i,className:"max-h-[320px] overflow-auto",children:h.jsx("div",{className:"relative w-full",style:{height:c.getTotalSize()},children:u.map(w=>{const E=x(w.index);return h.jsx("div",{"data-index":w.index,ref:c.measureElement,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${w.start}px)`},children:E?h.jsx(Md,{row:r0(E,void 0,r),...s}):h.jsxs("div",{className:"mono px-2 text-[10px] leading-7 text-zinc-700",style:{height:Zy},children:["#",w.index+1," loading…"]})},w.key)})})})}function s0({run:e,timeline:t,fans:n=hk,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=AA(t),{frame:u,rows:d}=S.useMemo(()=>{const m=Date.now(),y=t.map(N=>{const k=wo(N),C=k!==void 0?c[k]:void 0;return{step:N,childRun:C,window:pk(N,C,m)}}),w=mk(e,y.map(N=>N.window),n),E=y.map(N=>r0(N.step,N.childRun,w,N.window));return{frame:w,rows:E}},[e,t,n,c]),f=S.useMemo(()=>dk(t,n),[t,n]),p=S.useMemo(()=>{const m=new Map;for(const y of d)m.set(y.step.seq,y);return m},[d]),[x,v]=S.useState(new Set),g={run:e,childRuns:c,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:a,expanded:l,collapsedSubs:x,toggleSubs:m=>v(y=>{const w=new Set(y);return w.has(m)?w.delete(m):w.add(m),w})};return h.jsx(h.Fragment,{children:f.map(m=>{if(m.kind==="single"){const w=p.get(m.step.seq);return w?h.jsx(Md,{row:w,...g},w.step.seq):null}if(m.kind==="summary")return h.jsx(FA,{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 h.jsx($A,{label:m.label,fanFailed:m.steps.some(w=>w.status==="failed"),memberRows:y,rowProps:g},`fan:${m.group}`)})})}function HA({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=Zt({queryKey:["run",e],queryFn:()=>Fe.run(e)});return t>6?null:l?h.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[h.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[h.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),h.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),h.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),h.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 ↗"})]}),h.jsx(s0,{run:l.run,timeline:l.timeline,fans:l.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}const BA=S.memo(function({run:t,timeline:n,fans:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=S.useMemo(()=>mk(t,n.map(f=>[new Date(f.startedAt).getTime(),new Date(f.finishedAt).getTime()]),r??hk).span,[t,n,r]),u=l??new Set,d=a??(()=>{});return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),h.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",Du(c)]})]}),h.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:h.jsx(s0,{run:t,timeline:n,fans:r,depth:0,selectedKey:s,onSelect:o,onOpenRun:i,expanded:u,onToggleChild:d})})]})});function $u(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Jy(e,t){return $u(new Date(t).getTime()-new Date(e).getTime())}function ev(e){return o0(new Date(e).getTime())}function o0(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const gk={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"},VA={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},WA=["ok","failed","skipped"];function xk({e}){return h.jsxs("div",{className:"flex gap-2 py-0.5",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:o0(e.at)}),h.jsx("span",{className:`shrink-0 uppercase ${VA[e.level]}`,children:e.level}),h.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function tv({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?gk[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return h.jsxs("li",{className:`rounded-md border ${i}`,children:[h.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:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&h.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),h.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),h.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&h.jsx("span",{className:"tnum text-zinc-400",children:$u(e.durationMs)}),h.jsx("span",{children:e.status??"running"})]})]}),s&&h.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&h.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,u)=>h.jsxs("li",{className:"flex gap-2",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:o0(c.at)}),h.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&h.jsxs("span",{className:"text-zinc-600 tnum",children:["+",$u(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${u}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&h.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&&h.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,u)=>h.jsx(xk,{e:c},`${c.at}-${u}`))})]})]})}function UA({events:e}){const{subs:t,stepLogs:n}=og(e),r=WA.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return h.jsxs(h.Fragment,{children:[t.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),h.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>h.jsxs("span",{className:gk[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])=>h.jsxs("div",{className:"mb-2",children:[h.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),h.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>h.jsx(tv,{sub:l,showGroup:!1},l.id))})]},o)):h.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>h.jsx(tv,{sub:o},o.id))})]}),n.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),h.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)=>h.jsx(xk,{e:o},`${o.at}-${i}`))})]})]})}function yk({value:e}){const[t,n]=S.useState(!1);return h.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?h.jsx(lg,{width:11,height:11}):h.jsx(lj,{width:11,height:11}),t?"copied":"copy"]})}function Jl({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),h.jsx(yk,{value:n})]}),h.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 vk({error:e}){return h.jsxs(h.Fragment,{children:[h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:[h.jsx("span",{children:"error"}),e.code&&h.jsx("span",{className:"rounded border border-red-500/30 px-1.5 py-px normal-case tracking-normal text-red-300",children:e.code})]}),h.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&&h.jsx(Jl,{label:"error details",value:e.details})]})}function ur({k:e,v:t,mono:n=!0}){return h.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),h.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function qA({id:e,onOpenRun:t}){const{data:n}=Zt({queryKey:["run",e],queryFn:()=>Fe.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?h.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):h.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:h.jsx(s0,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):h.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function KA({step:e,run:t,onClose:n,onOpenRun:r}){const s=wo(e),o=yA(e),[i,l]=S.useState(!1),a=e.status==="failed",c=e.status==="pending"||e.status==="running",u=cg(e.kind),d=Jy(t.createdAt,e.startedAt),f=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.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:h.jsx(u,{width:13,height:13})}),h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",xp[e.kind]??e.kind]})]}),h.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:h.jsx(bs,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[h.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[h.jsx(ur,{k:"seq",v:`#${e.seq}`}),f>=1&&h.jsx(ur,{k:"queued",v:h.jsx("span",{className:"text-sky-300",children:$u(f)})}),h.jsx(ur,{k:"duration",v:c?h.jsx("span",{className:"text-amber-300",children:"running…"}):Jy(e.startedAt,e.finishedAt)}),h.jsx(ur,{k:"attempts",v:h.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&h.jsx(ku,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&h.jsx(ur,{k:"worker",v:`@${e.workerGroup}`}),o&&h.jsx(ur,{k:"waited for run",v:r?h.jsx("button",{type:"button",onClick:()=>r(o),className:"mono text-sky-300 underline-offset-2 hover:underline",children:o}):h.jsx("span",{className:"mono",children:o})}),h.jsx(ur,{k:"started",v:ev(e.startedAt)}),!c&&h.jsx(ur,{k:"finished",v:ev(e.finishedAt)}),h.jsx(ur,{k:"offset",v:`+${d}`})]}),a&&e.error&&h.jsx(vk,{error:e.error}),e.events&&e.events.length>0&&h.jsx(UA,{events:e.events}),s&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&h.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 ↗"})]}),h.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:[h.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:i?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),h.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),i&&h.jsx(qA,{id:s,onOpenRun:r})]}),e.input!==void 0&&h.jsx(Jl,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Jl,{label:"output",value:e.output})]})]})}function YA({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),h.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:h.jsx(bs,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&h.jsx(vk,{error:e.error}),e.input!==void 0&&h.jsx(Jl,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Jl,{label:"output",value:e.output}),n&&h.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}const qf="durable:lifecycle:pending";function nv(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 GA(e,t){switch(e.state){case"started":return"started";case"owed":{const n=e.owedSince!==void 0?`owed for ${nv(t-e.owedSince)}`:"owed";return e.orphanAt!==void 0?`${n} · orphan in ${nv(e.orphanAt-t)}`:n}case"coalesced":return"coalesced";case"failed":return"failed";default:return"not started"}}const QA="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",XA="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.",ZA="No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.";function Fu({status:e}){return e?h.jsx(Xe,{variant:"status",className:`s-${e} text-[10px]`,children:e}):null}function Lu({runId:e,onOpenRun:t}){return h.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 JA({source:e,onOpenRun:t}){return h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1","data-testid":"lifecycle-source",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"started by"}),h.jsx(Lu,{runId:e.runId,onOpenRun:t}),h.jsx("span",{className:"text-[10px] text-zinc-600",children:"on"}),h.jsx(Xe,{className:st("text-[10px]",e.kind==="failed"?"s-failed":"s-completed"),children:e.kind}),h.jsx(Fu,{status:e.status}),e.traceId&&h.jsxs("span",{className:"ml-1 flex items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"trace"}),h.jsx("span",{className:"mono text-[10px] text-zinc-400",title:"The source run's trace id",children:e.traceId}),h.jsx(yk,{value:e.traceId})]})]})}function ez({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:h.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[e.map(r=>h.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"waits-for",children:[h.jsx("span",{className:"text-[10px] text-amber-300/80",children:"Waiting for run"}),h.jsx(Lu,{runId:r.runId,onOpenRun:n}),h.jsx(Fu,{status:r.status})]},`${r.runId}#${r.seq}`)),t.length>0&&h.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"awaited-by",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"Awaited by"}),t.map(r=>h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Lu,{runId:r.runId,onOpenRun:n}),h.jsx(Fu,{status:r.status})]},`${r.runId}#${r.seq}`))]})]})}function tz({deliveries:e,now:t=Date.now(),onOpenRun:n,onRepublish:r,republishing:s=!1}){return e.length===0?null:h.jsxs("section",{"aria-label":"Lifecycle subscribers",className:"mt-3",children:[h.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"Lifecycle subscribers"}),h.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:e.map(o=>h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5","data-state":o.state,children:[h.jsx("a",{href:Od(o.subscriber),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:o.subscriber}),h.jsx(Xe,{variant:o.state==="owed"?"warn":o.state==="failed"?"danger":"outline",className:"text-[10px]",title:o.state==="not-started"?QA:o.state==="failed"&&o.error===void 0?XA:o.orphanAt!==void 0?ZA:void 0,children:GA(o,t)}),o.runId&&h.jsx(Lu,{runId:o.runId,onOpenRun:n}),o.state==="started"&&h.jsx(Fu,{status:o.status}),o.state==="failed"&&o.error!==void 0&&h.jsx("span",{className:"mono text-[11px] text-bad",children:o.error}),o.state==="failed"&&r&&h.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 nz(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 rz({tags:e,onChange:t}){const n=e.includes(qf);return h.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!==qf):[...e,qf]),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 sz(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 rv(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 oz(){const e=po(),{data:t}=Zt({queryKey:["schedules"],queryFn:()=>Fe.schedules(),refetchInterval:1e4}),n=pr({mutationFn:({id:s,action:o})=>o==="pause"?Fe.pauseSchedule(s):o==="resume"?Fe.resumeSchedule(s):Fe.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 h.jsxs(Ii,{children:[h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",className:"mono gap-1",children:[h.jsx("span",{className:"uppercase tracking-wide",children:"schedules"}),h.jsxs("span",{className:"tnum text-zinc-500",children:[t.length,r?` · ${r} paused`:""]})]})}),h.jsx(uo,{className:"w-[34rem] max-h-[60vh] overflow-y-auto",children:h.jsxs("table",{className:"mono w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0 bg-popover text-left text-zinc-500",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"schedule"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"cadence"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"next"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"last"}),h.jsx("th",{className:"px-2 py-1.5"})]})}),h.jsx("tbody",{children:t.map(s=>h.jsxs("tr",{className:"border-t border-line align-top",children:[h.jsxs("td",{className:"max-w-[10rem] px-2 py-1.5",children:[h.jsx("div",{className:"truncate text-zinc-200",title:s.id,children:s.id}),h.jsxs("div",{className:"truncate text-zinc-500",title:s.workflow,children:[s.workflow,s.namespace!=="default"?` @${s.namespace}`:""]})]}),h.jsx("td",{className:"px-2 py-1.5 text-zinc-400",children:sz(s)}),h.jsx("td",{className:st("px-2 py-1.5",s.paused?"text-amber-400/80":"text-zinc-300"),children:s.paused?"paused":s.nextFireAt?rv(s.nextFireAt):"—"}),h.jsxs("td",{className:"max-w-[9rem] px-2 py-1.5 text-zinc-500",children:[s.lastFireAt?rv(s.lastFireAt):"never",s.lastError&&h.jsx("div",{className:"truncate text-red-400/80",title:s.lastError,children:s.lastError})]}),h.jsxs("td",{className:"whitespace-nowrap px-2 py-1.5 text-right",children:[h.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"}),h.jsx(Se,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:"trigger"}),children:"run now"})]})]},s.id))})]})})]})}function ut(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=ut(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var iz={value:()=>{}};function Ad(){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 Vc(n)}function Vc(e){this._=e}function lz(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}})}Vc.prototype=Ad.prototype={constructor:Vc,on:function(e,t){var n=this._,r=lz(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=az(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]=sv(n[s],e.name,t);else if(t==null)for(s in n)n[s]=sv(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 Vc(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 az(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function sv(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=iz,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Dp="http://www.w3.org/1999/xhtml";const ov={svg:"http://www.w3.org/2000/svg",xhtml:Dp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ov.hasOwnProperty(t)?{space:ov[t],local:e}:e}function cz(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Dp&&t.documentElement.namespaceURI===Dp?t.createElement(e):t.createElementNS(n,e)}}function uz(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wk(e){var t=zd(e);return(t.local?uz:cz)(t)}function dz(){}function i0(e){return e==null?dz:function(){return this.querySelector(e)}}function fz(e){typeof e!="function"&&(e=i0(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 hz(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function pz(){return[]}function bk(e){return e==null?pz:function(){return this.querySelectorAll(e)}}function mz(e){return function(){return hz(e.apply(this,arguments))}}function gz(e){typeof e=="function"?e=mz(e):e=bk(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 Sk(e){return function(){return this.matches(e)}}function Ek(e){return function(t){return t.matches(e)}}var xz=Array.prototype.find;function yz(e){return function(){return xz.call(this.children,e)}}function vz(){return this.firstElementChild}function wz(e){return this.select(e==null?vz:yz(typeof e=="function"?e:Ek(e)))}var bz=Array.prototype.filter;function Sz(){return Array.from(this.children)}function Ez(e){return function(){return bz.call(this.children,e)}}function kz(e){return this.selectAll(e==null?Sz:Ez(typeof e=="function"?e:Ek(e)))}function Cz(e){typeof e!="function"&&(e=Sk(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 kk(e){return new Array(e.length)}function Nz(){return new hn(this._enter||this._groups.map(kk),this._parents)}function Hu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Hu.prototype={constructor:Hu,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 Rz(e){return function(){return e}}function Tz(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 Hu(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function Pz(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,d=o.length,f=new Array(u),p;for(l=0;l<u;++l)(a=t[l])&&(f[l]=p=i.call(a,a.__data__,l,t)+"",c.has(p)?s[l]=a:c.set(p,a));for(l=0;l<d;++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 Hu(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(f[l])===a&&(s[l]=a)}function Iz(e){return e.__data__}function jz(e,t){if(!arguments.length)return Array.from(this,Iz);var n=t?Pz:Tz,r=this._parents,s=this._groups;typeof e!="function"&&(e=Rz(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],d=s[c],f=d.length,p=_z(e.call(u,u&&u.__data__,c,r)),x=p.length,v=l[c]=new Array(x),b=i[c]=new Array(x),g=a[c]=new Array(f);n(u,d,v,b,g,p,t);for(var m=0,y=0,w,E;m<x;++m)if(w=v[m]){for(m>=y&&(y=m+1);!(E=b[y])&&++y<x;);w._next=E||null}}return i=new hn(i,r),i._enter=l,i._exit=a,i}function _z(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Oz(){return new hn(this._exit||this._groups.map(kk),this._parents)}function Mz(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 Az(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],d=c.length,f=l[a]=new Array(d),p,x=0;x<d;++x)(p=c[x]||u[x])&&(f[x]=p);for(;a<s;++a)l[a]=n[a];return new hn(l,this._parents)}function zz(){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 Dz(e){e||(e=$z);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}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 $z(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Fz(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Lz(){return Array.from(this)}function Hz(){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 Bz(){let e=0;for(const t of this)++e;return e}function Vz(){return!this.node()}function Wz(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 Uz(e){return function(){this.removeAttribute(e)}}function qz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kz(e,t){return function(){this.setAttribute(e,t)}}function Yz(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Gz(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Qz(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 Xz(e,t){var n=zd(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?qz:Uz:typeof t=="function"?n.local?Qz:Gz:n.local?Yz:Kz)(n,t))}function Ck(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zz(e){return function(){this.style.removeProperty(e)}}function Jz(e,t,n){return function(){this.style.setProperty(e,t,n)}}function e5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function t5(e,t,n){return arguments.length>1?this.each((t==null?Zz:typeof t=="function"?e5:Jz)(e,t,n??"")):_i(this.node(),e)}function _i(e,t){return e.style.getPropertyValue(t)||Ck(e).getComputedStyle(e,null).getPropertyValue(t)}function n5(e){return function(){delete this[e]}}function r5(e,t){return function(){this[e]=t}}function s5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function o5(e,t){return arguments.length>1?this.each((t==null?n5:typeof t=="function"?s5:r5)(e,t)):this.node()[e]}function Nk(e){return e.trim().split(/^|\s+/)}function l0(e){return e.classList||new Rk(e)}function Rk(e){this._node=e,this._names=Nk(e.getAttribute("class")||"")}Rk.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 Tk(e,t){for(var n=l0(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Pk(e,t){for(var n=l0(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function i5(e){return function(){Tk(this,e)}}function l5(e){return function(){Pk(this,e)}}function a5(e,t){return function(){(t.apply(this,arguments)?Tk:Pk)(this,e)}}function c5(e,t){var n=Nk(e+"");if(arguments.length<2){for(var r=l0(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?a5:t?i5:l5)(n,t))}function u5(){this.textContent=""}function d5(e){return function(){this.textContent=e}}function f5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function h5(e){return arguments.length?this.each(e==null?u5:(typeof e=="function"?f5:d5)(e)):this.node().textContent}function p5(){this.innerHTML=""}function m5(e){return function(){this.innerHTML=e}}function g5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function x5(e){return arguments.length?this.each(e==null?p5:(typeof e=="function"?g5:m5)(e)):this.node().innerHTML}function y5(){this.nextSibling&&this.parentNode.appendChild(this)}function v5(){return this.each(y5)}function w5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function b5(){return this.each(w5)}function S5(e){var t=typeof e=="function"?e:wk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function E5(){return null}function k5(e,t){var n=typeof e=="function"?e:wk(e),r=t==null?E5:typeof t=="function"?t:i0(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function C5(){var e=this.parentNode;e&&e.removeChild(this)}function N5(){return this.each(C5)}function R5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function P5(e){return this.select(e?T5:R5)}function I5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function j5(e){return function(t){e.call(this,t,this.__data__)}}function _5(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 O5(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 M5(e,t,n){return function(){var r=this.__on,s,o=j5(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 A5(e,t,n){var r=_5(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?M5:O5,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function Ik(e,t,n){var r=Ck(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 z5(e,t){return function(){return Ik(this,e,t)}}function D5(e,t){return function(){return Ik(this,e,t.apply(this,arguments))}}function $5(e,t){return this.each((typeof t=="function"?D5:z5)(e,t))}function*F5(){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 jk=[null];function hn(e,t){this._groups=e,this._parents=t}function Pa(){return new hn([[document.documentElement]],jk)}function L5(){return this}hn.prototype=Pa.prototype={constructor:hn,select:fz,selectAll:gz,selectChild:wz,selectChildren:kz,filter:Cz,data:jz,enter:Nz,exit:Oz,join:Mz,merge:Az,selection:L5,order:zz,sort:Dz,call:Fz,nodes:Lz,node:Hz,size:Bz,empty:Vz,each:Wz,attr:Xz,style:t5,property:o5,classed:c5,text:h5,html:x5,raise:v5,lower:b5,append:S5,insert:k5,remove:N5,clone:P5,datum:I5,on:A5,dispatch:$5,[Symbol.iterator]:F5};function ln(e){return typeof e=="string"?new hn([[document.querySelector(e)]],[document.documentElement]):new hn([[e]],jk)}function H5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zn(e,t){if(e=H5(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 B5={passive:!1},ea={capture:!0,passive:!1};function Kf(e){e.stopImmediatePropagation()}function ei(e){e.preventDefault(),e.stopImmediatePropagation()}function _k(e){var t=e.document.documentElement,n=ln(e).on("dragstart.drag",ei,ea);"onselectstart"in t?n.on("selectstart.drag",ei,ea):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ok(e,t){var n=e.document.documentElement,r=ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",ei,ea),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 yc=e=>()=>e;function $p(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}})}$p.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function V5(e){return!e.ctrlKey&&!e.button}function W5(){return this.parentNode}function U5(e,t){return t??{x:e.x,y:e.y}}function q5(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mk(){var e=V5,t=W5,n=U5,r=q5,s={},o=Ad("start","drag","end"),i=0,l,a,c,u,d=0;function f(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,B5).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,E){if(!(u||!e.call(this,w,E))){var N=y(this,t.call(this,w,E),w,E,"mouse");N&&(ln(w.view).on("mousemove.drag",x,ea).on("mouseup.drag",v,ea),_k(w.view),Kf(w),c=!1,l=w.clientX,a=w.clientY,N("start",w))}}function x(w){if(ei(w),!c){var E=w.clientX-l,N=w.clientY-a;c=E*E+N*N>d}s.mouse("drag",w)}function v(w){ln(w.view).on("mousemove.drag mouseup.drag",null),Ok(w.view,c),ei(w),s.mouse("end",w)}function b(w,E){if(e.call(this,w,E)){var N=w.changedTouches,k=t.call(this,w,E),C=N.length,P,j;for(P=0;P<C;++P)(j=y(this,k,w,E,N[P].identifier,N[P]))&&(Kf(w),j("start",w,N[P]))}}function g(w){var E=w.changedTouches,N=E.length,k,C;for(k=0;k<N;++k)(C=s[E[k].identifier])&&(ei(w),C("drag",w,E[k]))}function m(w){var E=w.changedTouches,N=E.length,k,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<N;++k)(C=s[E[k].identifier])&&(Kf(w),C("end",w,E[k]))}function y(w,E,N,k,C,P){var j=o.copy(),A=zn(P||N,E),D,z,R;if((R=n.call(w,new $p("beforestart",{sourceEvent:N,target:f,identifier:C,active:i,x:A[0],y:A[1],dx:0,dy:0,dispatch:j}),k))!=null)return D=R.x-A[0]||0,z=R.y-A[1]||0,function I(_,F,T){var M=A,O;switch(_){case"start":s[C]=I,O=i++;break;case"end":delete s[C],--i;case"drag":A=zn(T||F,E),O=i;break}j.call(_,w,new $p(_,{sourceEvent:F,subject:R,target:f,identifier:C,active:O,x:A[0]+D,y:A[1]+z,dx:A[0]-M[0],dy:A[1]-M[1],dispatch:j}),k)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:yc(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:yc(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:yc(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:yc(!!w),f):r},f.on=function(){var w=o.on.apply(o,arguments);return w===o?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function a0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ak(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ia(){}var ta=.7,Bu=1/ta,ti="\\s*([+-]?\\d+)\\s*",na="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ir="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K5=/^#([0-9a-f]{3,8})$/,Y5=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),G5=new RegExp(`^rgb\\(${ir},${ir},${ir}\\)$`),Q5=new RegExp(`^rgba\\(${ti},${ti},${ti},${na}\\)$`),X5=new RegExp(`^rgba\\(${ir},${ir},${ir},${na}\\)$`),Z5=new RegExp(`^hsl\\(${na},${ir},${ir}\\)$`),J5=new RegExp(`^hsla\\(${na},${ir},${ir},${na}\\)$`),iv={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};a0(Ia,ra,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lv,formatHex:lv,formatHex8:eD,formatHsl:tD,formatRgb:av,toString:av});function lv(){return this.rgb().formatHex()}function eD(){return this.rgb().formatHex8()}function tD(){return zk(this).formatHsl()}function av(){return this.rgb().formatRgb()}function ra(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=K5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cv(t):n===3?new Xt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vc(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=Y5.exec(e))?new Xt(t[1],t[2],t[3],1):(t=G5.exec(e))?new Xt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Q5.exec(e))?vc(t[1],t[2],t[3],t[4]):(t=X5.exec(e))?vc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Z5.exec(e))?fv(t[1],t[2]/100,t[3]/100,1):(t=J5.exec(e))?fv(t[1],t[2]/100,t[3]/100,t[4]):iv.hasOwnProperty(e)?cv(iv[e]):e==="transparent"?new Xt(NaN,NaN,NaN,0):null}function cv(e){return new Xt(e>>16&255,e>>8&255,e&255,1)}function vc(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xt(e,t,n,r)}function nD(e){return e instanceof Ia||(e=ra(e)),e?(e=e.rgb(),new Xt(e.r,e.g,e.b,e.opacity)):new Xt}function Fp(e,t,n,r){return arguments.length===1?nD(e):new Xt(e,t,n,r??1)}function Xt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}a0(Xt,Fp,Ak(Ia,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ta:Math.pow(ta,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xt(eo(this.r),eo(this.g),eo(this.b),Vu(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:uv,formatHex:uv,formatHex8:rD,formatRgb:dv,toString:dv}));function uv(){return`#${Ls(this.r)}${Ls(this.g)}${Ls(this.b)}`}function rD(){return`#${Ls(this.r)}${Ls(this.g)}${Ls(this.b)}${Ls((isNaN(this.opacity)?1:this.opacity)*255)}`}function dv(){const e=Vu(this.opacity);return`${e===1?"rgb(":"rgba("}${eo(this.r)}, ${eo(this.g)}, ${eo(this.b)}${e===1?")":`, ${e})`}`}function Vu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ls(e){return e=eo(e),(e<16?"0":"")+e.toString(16)}function fv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $n(e,t,n,r)}function zk(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof Ia||(e=ra(e)),!e)return new $n;if(e instanceof $n)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 $n(i,l,a,e.opacity)}function sD(e,t,n,r){return arguments.length===1?zk(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}a0($n,sD,Ak(Ia,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ta:Math.pow(ta,e),new $n(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 Xt(Yf(e>=240?e-240:e+120,s,r),Yf(e,s,r),Yf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new $n(hv(this.h),wc(this.s),wc(this.l),Vu(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=Vu(this.opacity);return`${e===1?"hsl(":"hsla("}${hv(this.h)}, ${wc(this.s)*100}%, ${wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hv(e){return e=(e||0)%360,e<0?e+360:e}function wc(e){return Math.max(0,Math.min(1,e||0))}function Yf(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 Dk=e=>()=>e;function oD(e,t){return function(n){return e+n*t}}function iD(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 lD(e){return(e=+e)==1?$k:function(t,n){return n-t?iD(t,n,e):Dk(isNaN(t)?n:t)}}function $k(e,t){var n=t-e;return n?oD(e,n):Dk(isNaN(e)?t:e)}const pv=function e(t){var n=lD(t);function r(s,o){var i=n((s=Fp(s)).r,(o=Fp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=$k(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 Yr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Lp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gf=new RegExp(Lp.source,"g");function aD(e){return function(){return e}}function cD(e){return function(t){return e(t)+""}}function uD(e,t){var n=Lp.lastIndex=Gf.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Lp.exec(e))&&(s=Gf.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:Yr(r,s)})),n=Gf.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?cD(a[0].x):aD(t):(t=a.length,function(c){for(var u=0,d;u<t;++u)l[(d=a[u]).i]=d.x(c);return l.join("")})}var mv=180/Math.PI,Hp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fk(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)*mv,skewX:Math.atan(a)*mv,scaleX:i,scaleY:l}}var bc;function dD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Hp:Fk(t.a,t.b,t.c,t.d,t.e,t.f)}function fD(e){return e==null||(bc||(bc=document.createElementNS("http://www.w3.org/2000/svg","g")),bc.setAttribute("transform",e),!(e=bc.transform.baseVal.consolidate()))?Hp:(e=e.matrix,Fk(e.a,e.b,e.c,e.d,e.e,e.f))}function Lk(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,d,f,p,x){if(c!==d||u!==f){var v=p.push("translate(",null,t,null,n);x.push({i:v-4,x:Yr(c,d)},{i:v-2,x:Yr(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function i(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Yr(c,u)})):u&&d.push(s(d)+"rotate("+u+r)}function l(c,u,d,f){c!==u?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Yr(c,u)}):u&&d.push(s(d)+"skewX("+u+r)}function a(c,u,d,f,p,x){if(c!==d||u!==f){var v=p.push(s(p)+"scale(",null,",",null,")");x.push({i:v-4,x:Yr(c,d)},{i:v-2,x:Yr(u,f)})}else(d!==1||f!==1)&&p.push(s(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,f),i(c.rotate,u.rotate,d,f),l(c.skewX,u.skewX,d,f),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var x=-1,v=f.length,b;++x<v;)d[(b=f[x]).i]=b.x(p);return d.join("")}}}var hD=Lk(dD,"px, ","px)","deg)"),pD=Lk(fD,", ",")",")"),mD=1e-12;function gv(e){return((e=Math.exp(e))+1/e)/2}function gD(e){return((e=Math.exp(e))-1/e)/2}function xD(e){return((e=Math.exp(2*e))-1)/(e+1)}const yD=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],d=i[1],f=i[2],p=u-l,x=d-a,v=p*p+x*x,b,g;if(v<mD)g=Math.log(f/c)/t,b=function(k){return[l+k*p,a+k*x,c*Math.exp(t*k*g)]};else{var m=Math.sqrt(v),y=(f*f-c*c+r*v)/(2*c*n*m),w=(f*f-c*c-r*v)/(2*f*n*m),E=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(w*w+1)-w);g=(N-E)/t,b=function(k){var C=k*g,P=gv(E),j=c/(n*m)*(P*xD(t*C+E)-gD(E));return[l+j*p,a+j*x,c*P/gv(t*C+E)]}}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 Oi=0,pl=0,ol=0,Hk=1e3,Wu,ml,Uu=0,fo=0,Dd=0,sa=typeof performance=="object"&&performance.now?performance:Date,Bk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function c0(){return fo||(Bk(vD),fo=sa.now()+Dd)}function vD(){fo=0}function qu(){this._call=this._time=this._next=null}qu.prototype=Vk.prototype={constructor:qu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?c0():+n)+(t==null?0:+t),!this._next&&ml!==this&&(ml?ml._next=this:Wu=this,ml=this),this._call=e,this._time=n,Bp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bp())}};function Vk(e,t,n){var r=new qu;return r.restart(e,t,n),r}function wD(){c0(),++Oi;for(var e=Wu,t;e;)(t=fo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Oi}function xv(){fo=(Uu=sa.now())+Dd,Oi=pl=0;try{wD()}finally{Oi=0,SD(),fo=0}}function bD(){var e=sa.now(),t=e-Uu;t>Hk&&(Dd-=t,Uu=e)}function SD(){for(var e,t=Wu,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:Wu=n);ml=e,Bp(r)}function Bp(e){if(!Oi){pl&&(pl=clearTimeout(pl));var t=e-fo;t>24?(e<1/0&&(pl=setTimeout(xv,e-sa.now()-Dd)),ol&&(ol=clearInterval(ol))):(ol||(Uu=sa.now(),ol=setInterval(bD,Hk)),Oi=1,Bk(xv))}}function yv(e,t,n){var r=new qu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var ED=Ad("start","end","cancel","interrupt"),kD=[],Wk=0,vv=1,Vp=2,Wc=3,wv=4,Wp=5,Uc=6;function $d(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;CD(e,n,{name:t,index:r,group:s,on:ED,tween:kD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Wk})}function u0(e,t){var n=Wn(e,t);if(n.state>Wk)throw new Error("too late; already scheduled");return n}function ar(e,t){var n=Wn(e,t);if(n.state>Wc)throw new Error("too late; already running");return n}function Wn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function CD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Vk(o,0,n.time);function o(c){n.state=vv,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,d,f,p;if(n.state!==vv)return a();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Wc)return yv(i);p.state===wv?(p.state=Uc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=Uc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(yv(function(){n.state===Wc&&(n.state=wv,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Vp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vp){for(n.state=Wc,s=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=p);s.length=d+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=Wp,1),d=-1,f=s.length;++d<f;)s[d].call(e,u);n.state===Wp&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Uc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function qc(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>Vp&&r.state<Wp,r.state=Uc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function ND(e){return this.each(function(){qc(this,e)})}function RD(e,t){var n,r;return function(){var s=ar(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 TD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=ar(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 PD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Wn(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?RD:TD)(n,e,t))}function d0(e,t,n){var r=e._id;return e.each(function(){var s=ar(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Wn(s,r).value[t]}}function Uk(e,t){var n;return(typeof t=="number"?Yr:t instanceof ra?pv:(n=ra(t))?(t=n,pv):uD)(e,t)}function ID(e){return function(){this.removeAttribute(e)}}function jD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _D(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 OD(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 MD(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 AD(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 zD(e,t){var n=zd(e),r=n==="transform"?pD:Uk;return this.attrTween(e,typeof t=="function"?(n.local?AD:MD)(n,r,d0(this,"attr."+e,t)):t==null?(n.local?jD:ID)(n):(n.local?OD:_D)(n,r,t))}function DD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $D(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function FD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&$D(e,o)),n}return s._value=t,s}function LD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&DD(e,o)),n}return s._value=t,s}function HD(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=zd(e);return this.tween(n,(r.local?FD:LD)(r,t))}function BD(e,t){return function(){u0(this,e).delay=+t.apply(this,arguments)}}function VD(e,t){return t=+t,function(){u0(this,e).delay=t}}function WD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BD:VD)(t,e)):Wn(this.node(),t).delay}function UD(e,t){return function(){ar(this,e).duration=+t.apply(this,arguments)}}function qD(e,t){return t=+t,function(){ar(this,e).duration=t}}function KD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?UD:qD)(t,e)):Wn(this.node(),t).duration}function YD(e,t){if(typeof t!="function")throw new Error;return function(){ar(this,e).ease=t}}function GD(e){var t=this._id;return arguments.length?this.each(YD(t,e)):Wn(this.node(),t).ease}function QD(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ar(this,e).ease=n}}function XD(e){if(typeof e!="function")throw new Error;return this.each(QD(this._id,e))}function ZD(e){typeof e!="function"&&(e=Sk(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 Ar(r,this._parents,this._name,this._id)}function JD(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,d=i[l]=new Array(u),f,p=0;p<u;++p)(f=a[p]||c[p])&&(d[p]=f);for(;l<r;++l)i[l]=t[l];return new Ar(i,this._parents,this._name,this._id)}function e$(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 t$(e,t,n){var r,s,o=e$(t)?u0:ar;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function n$(e,t){var n=this._id;return arguments.length<2?Wn(this.node(),n).on.on(e):this.each(t$(n,e,t))}function r$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function s$(){return this.on("end.remove",r$(this._id))}function o$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=i0(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,d,f=0;f<a;++f)(u=l[f])&&(d=e.call(u,u.__data__,f,l))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,$d(c[f],t,n,f,c,Wn(u,n)));return new Ar(o,this._parents,t,n)}function i$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bk(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,d=0;d<c;++d)if(u=a[d]){for(var f=e.call(u,u.__data__,d,a),p,x=Wn(u,n),v=0,b=f.length;v<b;++v)(p=f[v])&&$d(p,t,n,v,f,x);o.push(f),i.push(u)}return new Ar(o,i,t,n)}var l$=Pa.prototype.constructor;function a$(){return new l$(this._groups,this._parents)}function c$(e,t){var n,r,s;return function(){var o=_i(this,e),i=(this.style.removeProperty(e),_i(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function qk(e){return function(){this.style.removeProperty(e)}}function u$(e,t,n){var r,s=n+"",o;return function(){var i=_i(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function d$(e,t,n){var r,s,o;return function(){var i=_i(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),_i(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function f$(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=ar(this,e),c=a.on,u=a.value[o]==null?l||(l=qk(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function h$(e,t,n){var r=(e+="")=="transform"?hD:Uk;return t==null?this.styleTween(e,c$(e,r)).on("end.style."+e,qk(e)):typeof t=="function"?this.styleTween(e,d$(e,r,d0(this,"style."+e,t))).each(f$(this._id,e)):this.styleTween(e,u$(e,r,t),n).on("end.style."+e,null)}function p$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function m$(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&p$(e,i,n)),r}return o._value=t,o}function g$(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,m$(e,t,n??""))}function x$(e){return function(){this.textContent=e}}function y$(e){return function(){var t=e(this);this.textContent=t??""}}function v$(e){return this.tween("text",typeof e=="function"?y$(d0(this,"text",e)):x$(e==null?"":e+""))}function w$(e){return function(t){this.textContent=e.call(this,t)}}function b$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&w$(s)),t}return r._value=e,r}function S$(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,b$(e))}function E$(){for(var e=this._name,t=this._id,n=Kk(),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=Wn(a,t);$d(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ar(r,this._parents,e,n)}function k$(){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=ar(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 C$=0;function Ar(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Kk(){return++C$}var dr=Pa.prototype;Ar.prototype={constructor:Ar,select:o$,selectAll:i$,selectChild:dr.selectChild,selectChildren:dr.selectChildren,filter:ZD,merge:JD,selection:a$,transition:E$,call:dr.call,nodes:dr.nodes,node:dr.node,size:dr.size,empty:dr.empty,each:dr.each,on:n$,attr:zD,attrTween:HD,style:h$,styleTween:g$,text:v$,textTween:S$,remove:s$,tween:PD,delay:WD,duration:KD,ease:GD,easeVarying:XD,end:k$,[Symbol.iterator]:dr[Symbol.iterator]};function N$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var R$={time:null,delay:0,duration:250,ease:N$};function T$(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 P$(e){var t,n;e instanceof Ar?(t=e._id,e=e._name):(t=Kk(),(n=R$).time=c0(),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])&&$d(a,e,t,c,i,n||T$(a,t));return new Ar(r,this._parents,e,t)}Pa.prototype.interrupt=ND;Pa.prototype.transition=P$;const Sc=e=>()=>e;function I$(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 Fd=new Er(1,0,0);Yk.prototype=Er.prototype;function Yk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fd;return e.__zoom}function Qf(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function j$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _$(){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 bv(){return this.__zoom||Fd}function O$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function M$(){return navigator.maxTouchPoints||"ontouchstart"in this}function A$(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 Gk(){var e=j$,t=_$,n=A$,r=O$,s=M$,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=yD,c=Ad("start","zoom","end"),u,d,f,p=500,x=150,v=0,b=10;function g(R){R.property("__zoom",bv).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",j).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(R,I,_,F){var T=R.selection?R.selection():R;T.property("__zoom",bv),R!==T?E(R,I,_,F):T.interrupt().each(function(){N(this,arguments).event(F).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},g.scaleBy=function(R,I,_,F){g.scaleTo(R,function(){var T=this.__zoom.k,M=typeof I=="function"?I.apply(this,arguments):I;return T*M},_,F)},g.scaleTo=function(R,I,_,F){g.transform(R,function(){var T=t.apply(this,arguments),M=this.__zoom,O=_==null?w(T):typeof _=="function"?_.apply(this,arguments):_,V=M.invert(O),H=typeof I=="function"?I.apply(this,arguments):I;return n(y(m(M,H),O,V),T,i)},_,F)},g.translateBy=function(R,I,_,F){g.transform(R,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),i)},null,F)},g.translateTo=function(R,I,_,F,T){g.transform(R,function(){var M=t.apply(this,arguments),O=this.__zoom,V=F==null?w(M):typeof F=="function"?F.apply(this,arguments):F;return n(Fd.translate(V[0],V[1]).scale(O.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof _=="function"?-_.apply(this,arguments):-_),M,i)},F,T)};function m(R,I){return I=Math.max(o[0],Math.min(o[1],I)),I===R.k?R:new Er(I,R.x,R.y)}function y(R,I,_){var F=I[0]-_[0]*R.k,T=I[1]-_[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 E(R,I,_,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,O=N(T,M).event(F),V=t.apply(T,M),H=_==null?w(V):typeof _=="function"?_.apply(T,M):_,K=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),W=T.__zoom,U=typeof I=="function"?I.apply(T,M):I,L=a(W.invert(H).concat(K/W.k),U.invert(H).concat(K/U.k));return function(Q){if(Q===1)Q=U;else{var B=L(Q),q=K/B[2];Q=new Er(q,H[0]-B[0]*q,H[1]-B[1]*q)}O.zoom(null,Q)}})}function N(R,I,_){return!_&&R.__zooming||new k(R,I)}function k(R,I){this.that=R,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,I),this.taps=0}k.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,I){return this.mouse&&R!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var I=ln(this.that).datum();c.call(R,this.that,new I$(R,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),I)}};function C(R,...I){if(!e.apply(this,arguments))return;var _=N(this,I).event(R),F=this.__zoom,T=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),M=zn(R);if(_.wheel)(_.mouse[0][0]!==M[0]||_.mouse[0][1]!==M[1])&&(_.mouse[1]=F.invert(_.mouse[0]=M)),clearTimeout(_.wheel);else{if(F.k===T)return;_.mouse=[M,F.invert(M)],qc(this),_.start()}il(R),_.wheel=setTimeout(O,x),_.zoom("mouse",n(y(m(F,T),_.mouse[0],_.mouse[1]),_.extent,i));function O(){_.wheel=null,_.end()}}function P(R,...I){if(f||!e.apply(this,arguments))return;var _=R.currentTarget,F=N(this,I,!0).event(R),T=ln(R.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",K,!0),M=zn(R,_),O=R.clientX,V=R.clientY;_k(R.view),Qf(R),F.mouse=[M,this.__zoom.invert(M)],qc(this),F.start();function H(W){if(il(W),!F.moved){var U=W.clientX-O,L=W.clientY-V;F.moved=U*U+L*L>v}F.event(W).zoom("mouse",n(y(F.that.__zoom,F.mouse[0]=zn(W,_),F.mouse[1]),F.extent,i))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),Ok(W.view,F.moved),il(W),F.event(W).end()}}function j(R,...I){if(e.apply(this,arguments)){var _=this.__zoom,F=zn(R.changedTouches?R.changedTouches[0]:R,this),T=_.invert(F),M=_.k*(R.shiftKey?.5:2),O=n(y(m(_,M),F,T),t.apply(this,I),i);il(R),l>0?ln(this).transition().duration(l).call(E,O,F,R):ln(this).call(g.transform,O,F,R)}}function A(R,...I){if(e.apply(this,arguments)){var _=R.touches,F=_.length,T=N(this,I,R.changedTouches.length===F).event(R),M,O,V,H;for(Qf(R),O=0;O<F;++O)V=_[O],H=zn(V,this),H=[H,this.__zoom.invert(H),V.identifier],T.touch0?!T.touch1&&T.touch0[2]!==H[2]&&(T.touch1=H,T.taps=0):(T.touch0=H,M=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),M&&(T.taps<2&&(d=H[0],u=setTimeout(function(){u=null},p)),qc(this),T.start())}}function D(R,...I){if(this.__zooming){var _=N(this,I).event(R),F=R.changedTouches,T=F.length,M,O,V,H;for(il(R),M=0;M<T;++M)O=F[M],V=zn(O,this),_.touch0&&_.touch0[2]===O.identifier?_.touch0[0]=V:_.touch1&&_.touch1[2]===O.identifier&&(_.touch1[0]=V);if(O=_.that.__zoom,_.touch1){var K=_.touch0[0],W=_.touch0[1],U=_.touch1[0],L=_.touch1[1],Q=(Q=U[0]-K[0])*Q+(Q=U[1]-K[1])*Q,B=(B=L[0]-W[0])*B+(B=L[1]-W[1])*B;O=m(O,Math.sqrt(Q/B)),V=[(K[0]+U[0])/2,(K[1]+U[1])/2],H=[(W[0]+L[0])/2,(W[1]+L[1])/2]}else if(_.touch0)V=_.touch0[0],H=_.touch0[1];else return;_.zoom("touch",n(y(O,V,H),_.extent,i))}}function z(R,...I){if(this.__zooming){var _=N(this,I).event(R),F=R.changedTouches,T=F.length,M,O;for(Qf(R),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),M=0;M<T;++M)O=F[M],_.touch0&&_.touch0[2]===O.identifier?delete _.touch0:_.touch1&&_.touch1[2]===O.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(O=zn(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<b)){var V=ln(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return g.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Sc(+R),g):r},g.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Sc(!!R),g):e},g.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Sc(!!R),g):s},g.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Sc([[+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?(v=(R=+R)*R,g):Math.sqrt(v)},g.tapDistance=function(R){return arguments.length?(b=+R,g):b},g}const $r={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.`},oa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qk=["Enter"," ","Escape"];var Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var to;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(to||(to={}));var ia;(function(e){e.Partial="partial",e.Full="full"})(ia||(ia={}));const Xk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Xr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Xr||(Xr={}));var Ku;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ku||(Ku={}));var ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ue||(ue={}));const Sv={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top};function Zk(e){return e===null?null:e?"valid":"invalid"}const Jk=e=>"id"in e&&"source"in e&&"target"in e,z$=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),f0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ja=(e,t=[0,0])=>{const{width:n,height:r}=Fr(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},D$=(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):f0(s)?s:t.nodeLookup.get(s.id));const l=i?Yu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ld(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hd(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=Yu(r);n=Ld(n,s)}}),Hd(n)},eC=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...Oa(t,[n,r,s]),width:t.width/s,height:t.height/s},a=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,x=u.height??c.height??c.initialHeight??null,v=la(l,zi(c)),b=(p??0)*(x??0),g=o&&v>0;(!c.internals.handleBounds||g||v>=b||c.dragging)&&a.push(c)}return a},$$=(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 Up(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 qp({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=h0(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 tC({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 d=s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",$r.error005());else{const p=l.measured.width,x=l.measured.height;p&&x&&(d=[[a,c],[a+p,c+x]])}else l&&Di(i.extent)&&(d=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const f=Di(d)?ho(t,d,i.measured):t;return{position:{x:f.x-a+i.measured.width*u[0],y:f.y-c+i.measured.height*u[1]},positionAbsolute:f}}async function F$({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const p=o.has(f.id),x=!p&&f.parentId&&i.find(v=>v.id===f.parentId);(p||x)&&i.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),u=$$(i,a);for(const f of a)l.has(f.id)&&!u.find(x=>x.id===f.id)&&u.push(f);if(!s)return{edges:u,nodes:i};const d=await s({nodes:i,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}const Ai=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ho=(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 nC(e,t,n){const{width:r,height:s}=Fr(n),{x:o,y:i}=n.internals.positionAbsolute;return ho(e,[[o,i],[o+r,i+s]],t)}const Ev=(e,t,n)=>e<t?Ai(Math.abs(e-t),1,t)/t:e>n?-Ai(Math.abs(e-n),1,t)/t:0,rC=(e,t,n=15,r=40)=>{const s=Ev(e.x,r,t.width-r)*n,o=Ev(e.y,r,t.height-r)*n;return[s,o]},Ld=(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)}),Kp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Hd=({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}=f0(e)?e.internals.positionAbsolute:ja(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}},Yu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=f0(e)?e.internals.positionAbsolute:ja(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)}},sC=(e,t)=>Hd(Ld(Kp(e),Kp(t))),la=(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)},kv=e=>Fn(e.width)&&Fn(e.height)&&Fn(e.x)&&Fn(e.y),Fn=e=>!isNaN(e)&&isFinite(e),L$=(e,t)=>{},Bd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Oa=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Bd(l,i):l},oC=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),h0=(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,d=e.y+e.height/2,f=t/2-u*c,p=n/2-d*c;return{x:f,y:p,zoom:c}},Gu=()=>{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 Fr(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 iC(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 lC(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 Pl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rr(e),l=Oa({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Bd(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const Vd=e=>({width:e.offsetWidth,height:e.offsetHeight}),aC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},H$=["INPUT","SELECT","TEXTAREA"];function Yp(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 H$.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 cC=e=>"clientX"in e,Rr=(e,t)=>{var o,i;const n=cC(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)}},Cv=(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,...Vd(i)}})};function uC({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),d=Math.abs(c-t);return[a,c,u,d]}function Ec(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Nv({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case ue.Left:return[t-Ec(t-r,o),n];case ue.Right:return[t+Ec(r-t,o),n];case ue.Top:return[t,n-Ec(n-s,o)];case ue.Bottom:return[t,n+Ec(s-n,o)]}}function dC({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top,curvature:i=.25}){const[l,a]=Nv({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=Nv({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,p,x]=uC({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}`,d,f,p,x]}function fC({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 B$({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 V$({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Ld(Yu(e),Yu(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 la(i,Hd(o))>0}const W$=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,U$=(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)),q$=(e,t)=>{if(!e.source||!e.target)return t;let n;return Jk(e)?n={...e}:n={...e,id:W$(e)},U$(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function hC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=fC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const Rv={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}},K$=({source:e,sourcePosition:t=ue.Bottom,target:n})=>t===ue.Left||t===ue.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},Tv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Y$({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:r=ue.Top,center:s,offset:o}){const i=Rv[t],l=Rv[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=K$({source:a,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",f=u[d];let p=[],x,v;const b={x:0,y:0},g={x:0,y:0},[m,y,w,E]=fC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*l[d]===-1){x=s.x??m,v=s.y??y;const k=[{x,y:a.y},{x,y:c.y}],C=[{x:a.x,y:v},{x:c.x,y:v}];i[d]===f?p=d==="x"?k:C:p=d==="x"?C:k}else{const k=[{x:a.x,y:c.y}],C=[{x:c.x,y:a.y}];if(d==="x"?p=i.x===f?C:k:p=i.y===f?k:C,t===r){const z=Math.abs(e[d]-n[d]);if(z<=o){const R=Math.min(o-1,o-z);i[d]===f?b[d]=(a[d]>e[d]?-1:1)*R:g[d]=(c[d]>n[d]?-1:1)*R}}if(t!==r){const z=d==="x"?"y":"x",R=i[d]===l[z],I=a[z]>c[z],_=a[z]<c[z];(i[d]===1&&(!R&&I||R&&_)||i[d]!==1&&(!R&&_||R&&I))&&(p=d==="x"?k:C)}const P={x:a.x+b.x,y:a.y+b.y},j={x:c.x+g.x,y:c.y+g.y},A=Math.max(Math.abs(P.x-p[0].x),Math.abs(j.x-p[0].x)),D=Math.max(Math.abs(P.y-p[0].y),Math.abs(j.y-p[0].y));A>=D?(x=(P.x+j.x)/2,v=p[0].y):(x=p[0].x,v=(P.y+j.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],x,v,w,E]}function G$(e,t,n,r){const s=Math.min(Tv(e,t)/2,Tv(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 Gp({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20}){const[u,d,f,p,x]=Y$({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=G$(u[m-1],g,u[m+1],i):y=`${m===0?"M":"L"}${g.x} ${g.y}`,b+=y,b},""),d,f,p,x]}function Pv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Q$(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Pv(t)||!Pv(n))return null;const r=t.internals.handleBounds||Iv(t.handles),s=n.internals.handleBounds||Iv(n.handles),o=jv((r==null?void 0:r.source)??[],e.sourceHandle),i=jv(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(d=e.onError)==null||d.call(e,"008",$r.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||ue.Bottom,a=(i==null?void 0:i.position)||ue.Top,c=aa(t,o,l),u=aa(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function Iv(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 aa(e,t,n=ue.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??Fr(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case ue.Top:return{x:s+i/2,y:o};case ue.Right:return{x:s+i,y:o+l/2};case ue.Bottom:return{x:s+i/2,y:o+l};case ue.Left:return{x:s,y:o+l/2}}}function jv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Qp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function X$(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=Qp(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 p0={nodeOrigin:[0,0],nodeExtent:oa,elevateNodesOnSelect:!0,defaults:{}},Z$={...p0,checkEquality:!0};function m0(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function J$(e,t,n){const r=m0(p0,n);for(const s of e.values())if(s.parentId)g0(s,e,t,r);else{const o=ja(s,r.nodeOrigin),i=Di(s.extent)?s.extent:r.nodeExtent,l=ho(o,i,Fr(s));s.internals.positionAbsolute=l}}function Xp(e,t,n,r){var l,a;const s=m0(Z$,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 d=ja(c,s.nodeOrigin),f=Di(c.extent)?c.extent:s.nodeExtent,p=ho(d,f,Fr(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:pC(c,i),userNode:c}},t.set(c.id,u)}c.parentId&&g0(u,t,n,r)}}function eF(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 g0(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:i}=m0(p0,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}eF(e,n);const c=s?1e3:0,{x:u,y:d,z:f}=tF(e,a,o,i,c),{positionAbsolute:p}=e.internals,x=u!==p.x||d!==p.y;(x||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:x?{x:u,y:d}:p,z:f})}function pC(e,t){return(Fn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function tF(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=Fr(e),a=ja(e,n),c=Di(e.extent)?ho(a,e.extent,l):a;let u=ho({x:o+c.x,y:i+c.y},r,l);e.extent==="parent"&&(u=nC(u,l,t));const d=pC(e,s),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}function x0(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=sC(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,d=Fr(a),f=a.origin??r,p=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,x=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),b=Math.max(d.height,Math.round(l.height)),g=(v-d.width)*f[0],m=(b-d.height)*f[1];(p>0||x>0||g||m)&&(s.push({id:c,type:"position",position:{x:a.position.x-p+g,y:a.position.y-x+m}}),(y=n.get(c))==null||y.forEach(w=>{e.some(E=>E.id===w.id)||s.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+x}})})),(d.width<l.width||d.height<l.height||p||x)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-g:0),height:b+(x?f[1]*x-m:0)}})}),s}function nF(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),d=[];for(const f of e.values()){const p=t.get(f.id);if(p)if(p.hidden)p.internals={...p.internals,handleBounds:void 0},l=!0;else{const x=Vd(f.nodeElement),v=p.measured.width!==x.width||p.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!p.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),m=Di(p.extent)?p.extent:o;let{positionAbsolute:y}=p.internals;p.parentId&&p.extent==="parent"?y=nC(y,x,t.get(p.parentId)):m&&(y=ho(y,m,x)),p.measured=x,p.internals={...p.internals,positionAbsolute:y,handleBounds:{source:Cv("source",f.nodeElement,g,u,p.id),target:Cv("target",f.nodeElement,g,u,p.id)}},p.parentId&&g0(p,t,n,{nodeOrigin:s}),l=!0,v&&(a.push({id:p.id,type:"dimensions",dimensions:x}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:zi(p,s)}))}}}if(d.length>0){const f=x0(d,t,n,s);a.push(...f)}return{changes:a,updatedInternals:l}}async function rF({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 mC(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,d=e.get(c)||new Map,f={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l};t.set(r.id,r),e.set(a,u.set(`${o}-${l}`,f)),e.set(c,d.set(`${s}-${i}`,f))}}function gC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:gC(n,t):!1}function _v(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 sF(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!gC(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 Xf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const d=(i=n.get(c))==null?void 0:i.internals.userNode;d&&s.push({...d,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 oF({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,d=!1,f=null,p=!1;function x({noDragClassName:b,handleSelector:g,domNode:m,isSelectable:y,nodeId:w,nodeClickDistance:E=0}){f=ln(m);function N({x:j,y:A},D){const{nodeLookup:z,nodeExtent:R,snapGrid:I,snapToGrid:_,nodeOrigin:F,onNodeDrag:T,onSelectionDrag:M,onError:O,updateNodePositions:V}=t();o={x:j,y:A};let H=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&R){const W=_a(l);K=Kp(W)}for(const[W,U]of l){if(!z.has(W))continue;let L={x:j-U.distance.x,y:A-U.distance.y};_&&(L=Bd(L,I));let Q=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(l.size>1&&R&&!U.extent){const{positionAbsolute:Z}=U.internals,Y=Z.x-K.x+R[0][0],G=Z.x+U.measured.width-K.x2+R[1][0],X=Z.y-K.y+R[0][1],te=Z.y+U.measured.height-K.y2+R[1][1];Q=[[Y,X],[G,te]]}const{position:B,positionAbsolute:q}=tC({nodeId:W,nextPosition:L,nodeLookup:z,nodeExtent:Q,nodeOrigin:F,onError:O});H=H||U.position.x!==B.x||U.position.y!==B.y,U.position=B,U.internals.positionAbsolute=q}if(H&&(V(l,!0),D&&(r||T||!w&&M))){const[W,U]=Xf({nodeId:w,dragItems:l,nodeLookup:z});r==null||r(D,l,W,U),T==null||T(D,W,U),w||M==null||M(D,U)}}async function k(){if(!u)return;const{transform:j,panBy:A,autoPanSpeed:D}=t(),[z,R]=rC(c,u,D);(z!==0||R!==0)&&(o.x=(o.x??0)-z/j[2],o.y=(o.y??0)-R/j[2],await A({x:z,y:R})&&N(o,null)),i=requestAnimationFrame(k)}function C(j){var H;const{nodeLookup:A,multiSelectionActive:D,nodesDraggable:z,transform:R,snapGrid:I,snapToGrid:_,selectNodesOnDrag:F,onNodeDragStart:T,onSelectionDragStart:M,unselectNodesAndEdges:O}=t();d=!0,(!F||!y)&&!D&&w&&((H=A.get(w))!=null&&H.selected||O()),y&&F&&w&&(e==null||e(w));const V=Pl(j.sourceEvent,{transform:R,snapGrid:I,snapToGrid:_,containerBounds:u});if(o=V,l=sF(A,z,V,w),l.size>0&&(n||T||!w&&M)){const[K,W]=Xf({nodeId:w,dragItems:l,nodeLookup:A});n==null||n(j.sourceEvent,l,K,W),T==null||T(j.sourceEvent,K,W),w||M==null||M(j.sourceEvent,W)}}const P=Mk().clickDistance(E).on("start",j=>{const{domNode:A,nodeDragThreshold:D,transform:z,snapGrid:R,snapToGrid:I}=t();u=(A==null?void 0:A.getBoundingClientRect())||null,p=!1,D===0&&C(j),o=Pl(j.sourceEvent,{transform:z,snapGrid:R,snapToGrid:I,containerBounds:u}),c=Rr(j.sourceEvent,u)}).on("drag",j=>{const{autoPanOnNodeDrag:A,transform:D,snapGrid:z,snapToGrid:R,nodeDragThreshold:I,nodeLookup:_}=t(),F=Pl(j.sourceEvent,{transform:D,snapGrid:z,snapToGrid:R,containerBounds:u});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||w&&!_.has(w))&&(p=!0),!p){if(!a&&A&&d&&(a=!0,k()),!d){const T=F.xSnapped-(o.x??0),M=F.ySnapped-(o.y??0);Math.sqrt(T*T+M*M)>I&&C(j)}(o.x!==F.xSnapped||o.y!==F.ySnapped)&&l&&d&&(c=Rr(j.sourceEvent,u),N(F,j.sourceEvent))}}).on("end",j=>{if(!(!d||p)&&(a=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:A,updateNodePositions:D,onNodeDragStop:z,onSelectionDragStop:R}=t();if(D(l,!1),s||z||!w&&R){const[I,_]=Xf({nodeId:w,dragItems:l,nodeLookup:A,dragging:!1});s==null||s(j.sourceEvent,l,I,_),z==null||z(j.sourceEvent,I,_),w||R==null||R(j.sourceEvent,_)}}}).filter(j=>{const A=j.target;return!j.button&&(!b||!_v(A,`.${b}`,m))&&(!g||_v(A,g,m))});f.call(P)}function v(){f==null||f.on(".drag",null)}return{update:x,destroy:v}}function iF(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())la(s,zi(o))>0&&r.push(o);return r}const lF=250;function aF(e,t,n,r){var l,a;let s=[],o=1/0;const i=iF(e,n,t+lF);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 d of u){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=aa(c,d,d.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));x>t||(x<o?(s=[{...d,x:f,y:p}],o=x):x===o&&s.push({...d,x:f,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 xC(e,t,n,r,s,o=!1){var c,u,d;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)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...aa(i,a,a.position,!0)}:a}function yC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function cF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vC=()=>!0;function uF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:x,onConnect:v,onConnectEnd:b,isValidConnection:g=vC,onReconnectEnd:m,updateConnection:y,getTransform:w,getFromHandle:E,autoPanSpeed:N}){const k=aC(e.target);let C=0,P;const{x:j,y:A}=Rr(e),D=k==null?void 0:k.elementFromPoint(j,A),z=yC(o,D),R=l==null?void 0:l.getBoundingClientRect();if(!R||!z)return;const I=xC(s,z,r,a,t);if(!I)return;let _=Rr(e,R),F=!1,T=null,M=!1,O=null;function V(){if(!u||!R)return;const[q,Z]=rC(_,R,N);f({x:q,y:Z}),C=requestAnimationFrame(V)}const H={...I,nodeId:s,type:z,position:I.position},K=a.get(s),U={inProgress:!0,isValid:null,from:aa(K,H,ue.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:K,to:_,toHandle:null,toPosition:Sv[H.position],toNode:null};y(U);let L=U;x==null||x(e,{nodeId:s,handleId:r,handleType:z});function Q(q){if(!E()||!H){B(q);return}const Z=w();_=Rr(q,R),P=aF(Oa(_,Z,!1,[1,1]),n,a,H),F||(V(),F=!0);const Y=wC(q,{handle:P,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:g,doc:k,lib:c,flowId:d,nodeLookup:a});O=Y.handleDomNode,T=Y.connection,M=cF(!!P,Y.isValid);const G={...L,isValid:M,to:P&&M?oC({x:P.x,y:P.y},Z):_,toHandle:Y.toHandle,toPosition:M&&Y.toHandle?Y.toHandle.position:Sv[H.position],toNode:Y.toHandle?a.get(Y.toHandle.nodeId):null};M&&P&&L.toHandle&&G.toHandle&&L.toHandle.type===G.toHandle.type&&L.toHandle.nodeId===G.toHandle.nodeId&&L.toHandle.id===G.toHandle.id&&L.to.x===G.to.x&&L.to.y===G.to.y||(y(G),L=G)}function B(q){(P||O)&&T&&M&&(v==null||v(T));const{inProgress:Z,...Y}=L,G={...Y,toPosition:L.toHandle?L.toPosition:null};b==null||b(q,G),o&&(m==null||m(q,G)),p(),cancelAnimationFrame(C),F=!1,M=!1,T=null,O=null,k.removeEventListener("mousemove",Q),k.removeEventListener("mouseup",B),k.removeEventListener("touchmove",Q),k.removeEventListener("touchend",B)}k.addEventListener("mousemove",Q),k.addEventListener("mouseup",B),k.addEventListener("touchmove",Q),k.addEventListener("touchend",B)}function wC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=vC,nodeLookup:u}){const d=o==="target",f=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:x}=Rr(e),v=i.elementFromPoint(p,x),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const m=yC(void 0,b),y=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),E=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!m)return g;const k={source:d?y:r,sourceHandle:d?w:s,target:d?r:y,targetHandle:d?s:w};g.connection=k;const P=E&&N&&(n===Mi.Strict?d&&m==="source"||!d&&m==="target":y!==r||w!==s);g.isValid=P&&c(k),g.toHandle=xC(y,m,w,u,n,!1)}return g}const Zp={onPointerDown:uF,isValid:wC};function dF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ln(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=10,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const x=y=>{const w=n();if(y.sourceEvent.type!=="wheel"||!t)return;const E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,N=w[2]*Math.pow(2,E);t.scaleTo(N)};let v=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(v=[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 E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-v[0],E[1]-v[1]];v=E;const k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-N[0]*k,y:w[1]-N[1]*k},P=[[0,0],[a,c]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},P,l)},m=Gk().on("start",b).on("zoom",d?g:null).on("zoom.wheel",f?x:null);s.call(m,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:zn}}const fF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wd=e=>({x:e.x,y:e.y,zoom:e.k}),Zf=({x:e,y:t,zoom:n})=>Fd.translate(e,t).scale(n),Wo=(e,t)=>e.target.closest(`.${t}`),bC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Jf=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},SC=e=>{const t=e.ctrlKey&&Gu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function hF({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 d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=zn(u),g=SC(u),m=d*Math.pow(2,g);r.scaleTo(n,m,b,u);return}const f=u.deltaMode===1?20:1;let p=s===to.Vertical?0:u.deltaX*f,x=s===to.Horizontal?0:u.deltaY*f;!Gu()&&u.shiftKey&&s!==to.Vertical&&(p=u.deltaY*f,x=0),r.translateBy(n,-(p/d)*o,-(x/d)*o,{internal:!0});const v=Wd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,v)),e.isPanScrolling&&(a==null||a(u,v),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,v),e.isPanScrolling=!1},150))}}function pF({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 mF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Wd(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 gF({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&bC(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,Wd(o.transform)))}}function xF({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&&bC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&fF(e.prevViewport,i.transform))){const a=Wd(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function yF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:a,lib:c}){return u=>{var x;const d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Wo(u,`${c}-flow__node`)||Wo(u,`${c}-flow__edge`)))return!0;if(!r&&!d&&!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"&&((x=u.touches)==null?void 0:x.length)>1)return u.preventDefault(),!1;if(!d&&!s&&!f&&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 vF({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},d=e.getBoundingClientRect(),f=Gk().clickDistance(!Fn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),p=ln(e).call(f);y({x:o.x,y:o.y,zoom:Ai(o.zoom,t,n)},[[0,0],[d.width,d.height]],s);const x=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(SC);function b(D,z){return p?new Promise(R=>{f==null||f.transform(Jf(p,z==null?void 0:z.duration,()=>R(!0)),D)}):Promise.resolve(!1)}function g({noWheelClassName:D,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:I,panOnScroll:_,panOnDrag:F,panOnScrollMode:T,panOnScrollSpeed:M,preventScrolling:O,zoomOnPinch:V,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:W,lib:U,onTransformChange:L}){I&&!u.isZoomingOrPanning&&m();const B=_&&!W&&!I?hF({zoomPanValues:u,noWheelClassName:D,d3Selection:p,d3Zoom:f,panOnScrollMode:T,panOnScrollSpeed:M,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:a}):pF({noWheelClassName:D,preventScrolling:O,d3ZoomHandler:x});if(p.on("wheel.zoom",B,{passive:!1}),!I){const Z=mF({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:l});f.on("start",Z);const Y=gF({zoomPanValues:u,panOnDrag:F,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:L});f.on("zoom",Y);const G=xF({zoomPanValues:u,panOnDrag:F,panOnScroll:_,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:c});f.on("end",G)}const q=yF({zoomActivationKeyPressed:W,panOnDrag:F,zoomOnScroll:H,panOnScroll:_,zoomOnDoubleClick:K,zoomOnPinch:V,userSelectionActive:I,noPanClassName:z,noWheelClassName:D,lib:U});f.filter(q),K?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function m(){f.on("zoom",null)}async function y(D,z,R){const I=Zf(D),_=f==null?void 0:f.constrain()(I,z,R);return _&&await b(_),new Promise(F=>F(_))}async function w(D,z){const R=Zf(D);return await b(R,z),new Promise(I=>I(R))}function E(D){if(p){const z=Zf(D),R=p.property("__zoom");(R.k!==D.zoom||R.x!==D.x||R.y!==D.y)&&(f==null||f.transform(p,z,null,{sync:!0}))}}function N(){const D=p?Yk(p.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function k(D,z){return p?new Promise(R=>{f==null||f.scaleTo(Jf(p,z==null?void 0:z.duration,()=>R(!0)),D)}):Promise.resolve(!1)}function C(D,z){return p?new Promise(R=>{f==null||f.scaleBy(Jf(p,z==null?void 0:z.duration,()=>R(!0)),D)}):Promise.resolve(!1)}function P(D){f==null||f.scaleExtent(D)}function j(D){f==null||f.translateExtent(D)}function A(D){const z=!Fn(D)||D<0?0:D;f==null||f.clickDistance(z)}return{update:g,destroy:m,setViewport:w,setViewportConstrained:y,getViewport:N,scaleTo:k,scaleBy:C,setScaleExtent:P,setTranslateExtent:j,syncViewport:E,setClickDistance:A}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function wF({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 bF(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 Vr(e,t){return Math.max(0,t-e)}function Wr(e,t){return Math.max(0,e-t)}function kc(e,t,n){return Math.max(0,t-e,e-n)}function Ov(e,t){return e?!t:t}function SF(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:x}=n,{minWidth:v,maxWidth:b,minHeight:g,maxHeight:m}=r,{x:y,y:w,width:E,height:N,aspectRatio:k}=e;let C=Math.floor(u?p-e.pointerX:0),P=Math.floor(d?x-e.pointerY:0);const j=E+(a?-C:C),A=N+(c?-P:P),D=-o[0]*E,z=-o[1]*N;let R=kc(j,v,b),I=kc(A,g,m);if(i){let T=0,M=0;a&&C<0?T=Vr(y+C+D,i[0][0]):!a&&C>0&&(T=Wr(y+j+D,i[1][0])),c&&P<0?M=Vr(w+P+z,i[0][1]):!c&&P>0&&(M=Wr(w+A+z,i[1][1])),R=Math.max(R,T),I=Math.max(I,M)}if(l){let T=0,M=0;a&&C>0?T=Wr(y+C,l[0][0]):!a&&C<0&&(T=Vr(y+j,l[1][0])),c&&P>0?M=Wr(w+P,l[0][1]):!c&&P<0&&(M=Vr(w+A,l[1][1])),R=Math.max(R,T),I=Math.max(I,M)}if(s){if(u){const T=kc(j/k,g,m)*k;if(R=Math.max(R,T),i){let M=0;!a&&!c||a&&!c&&f?M=Wr(w+z+j/k,i[1][1])*k:M=Vr(w+z+(a?C:-C)/k,i[0][1])*k,R=Math.max(R,M)}if(l){let M=0;!a&&!c||a&&!c&&f?M=Vr(w+j/k,l[1][1])*k:M=Wr(w+(a?C:-C)/k,l[0][1])*k,R=Math.max(R,M)}}if(d){const T=kc(A*k,v,b)/k;if(I=Math.max(I,T),i){let M=0;!a&&!c||c&&!a&&f?M=Wr(y+A*k+D,i[1][0])/k:M=Vr(y+(c?P:-P)*k+D,i[0][0])/k,I=Math.max(I,M)}if(l){let M=0;!a&&!c||c&&!a&&f?M=Vr(y+A*k,l[1][0])/k:M=Wr(y+(c?P:-P)*k,l[0][0])/k,I=Math.max(I,M)}}}P=P+(P<0?I:-I),C=C+(C<0?R:-R),s&&(f?j>A*k?P=(Ov(a,c)?-C:C)/k:C=(Ov(a,c)?-P:P)*k:u?(P=C/k,c=a):(C=P*k,a=c));const _=a?y+C:y,F=c?w+P:w;return{width:E+(a?-C:C),height:N+(c?-P:P),x:o[0]*C*(a?-1:1)+_,y:o[1]*P*(c?-1:1)+F}}const EC={width:0,height:0,x:0,y:0},EF={...EC,pointerX:0,pointerY:0,aspectRatio:1};function kF(e){return[[0,0],[e.measured.width,e.measured.height]]}function CF(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 NF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=ln(e);function i({controlPosition:a,boundaries:c,keepAspectRatio:u,onResizeStart:d,onResize:f,onResizeEnd:p,shouldResize:x}){let v={...EC},b={...EF};const g=bF(a);let m,y=null,w=[],E,N,k;const C=Mk().on("start",P=>{const{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:z,nodeOrigin:R,paneDomNode:I}=n();if(m=j.get(t),!m)return;y=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:F}=Pl(P.sourceEvent,{transform:A,snapGrid:D,snapToGrid:z,containerBounds:y});v={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...v,pointerX:_,pointerY:F,aspectRatio:v.width/v.height},E=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(E=j.get(m.parentId),N=E&&m.extent==="parent"?kF(E):void 0),w=[],k=void 0;for(const[T,M]of j)if(M.parentId===t&&(w.push({id:T,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const O=CF(M,m,M.origin??R);k?k=[[Math.min(O[0][0],k[0][0]),Math.min(O[0][1],k[0][1])],[Math.max(O[1][0],k[1][0]),Math.max(O[1][1],k[1][1])]]:k=O}d==null||d(P,{...v})}).on("drag",P=>{const{transform:j,snapGrid:A,snapToGrid:D,nodeOrigin:z}=n(),R=Pl(P.sourceEvent,{transform:j,snapGrid:A,snapToGrid:D,containerBounds:y}),I=[];if(!m)return;const{x:_,y:F,width:T,height:M}=v,O={},V=m.origin??z,{width:H,height:K,x:W,y:U}=SF(b,g,R,c,u,V,N,k),L=H!==T,Q=K!==M,B=W!==_&&L,q=U!==F&&Q;if(!B&&!q&&!L&&!Q)return;if((B||q||V[0]===1||V[1]===1)&&(O.x=B?W:v.x,O.y=q?U:v.y,v.x=O.x,v.y=O.y,w.length>0)){const X=W-_,te=U-F;for(const he of w)he.position={x:he.position.x-X+V[0]*(H-T),y:he.position.y-te+V[1]*(K-M)},I.push(he)}if((L||Q)&&(O.width=L?H:v.width,O.height=Q?K:v.height,v.width=O.width,v.height=O.height),E&&m.expandParent){const X=V[0]*(O.width??0);O.x&&O.x<X&&(v.x=X,b.x=b.x-(O.x-X));const te=V[1]*(O.height??0);O.y&&O.y<te&&(v.y=te,b.y=b.y-(O.y-te))}const Z=wF({width:v.width,prevWidth:T,height:v.height,prevHeight:M,affectsX:g.affectsX,affectsY:g.affectsY}),Y={...v,direction:Z};(x==null?void 0:x(P,Y))!==!1&&(f==null||f(P,Y),r(O,I))}).on("end",P=>{p==null||p(P,{...v}),s==null||s()});o.call(C)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}const RF={},Mv=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(RF?"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},TF=e=>e?Mv(e):Mv,{useDebugValue:PF}=zw,{useSyncExternalStoreWithSelector:IF}=Q2,jF=e=>e;function kC(e,t=jF,n){const r=IF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return PF(r),r}const Av=(e,t)=>{const n=TF(e),r=(s,o=t)=>kC(n,s,o);return Object.assign(r,n),r},_F=(e,t)=>e?Av(e,t):Av;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 Ud=S.createContext(null),OF=Ud.Provider,CC=$r.error001();function _e(e,t){const n=S.useContext(Ud);if(n===null)throw new Error(CC);return kC(n,e,t)}function Ye(){const e=S.useContext(Ud);if(e===null)throw new Error(CC);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zv={display:"none"},MF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},NC="react-flow__node-desc",RC="react-flow__edge-desc",AF="react-flow__aria-live",zF=e=>e.ariaLiveMessage;function DF({rfId:e}){const t=_e(zF);return h.jsx("div",{id:`${AF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:MF,children:t})}function $F({rfId:e,disableKeyboardA11y:t}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:`${NC}-${e}`,style:zv,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."," "]}),h.jsx("div",{id:`${RC}-${e}`,style:zv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&h.jsx(DF,{rfId:e})]})}const FF=e=>e.userSelectionActive?"none":"all",y0=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=_e(FF),l=`${e}`.split("-");return h.jsx("div",{className:ut(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},ref:o,...s,children:t})});function LF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(y0,{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:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const HF=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}},Cc=e=>e.id;function BF(e,t){return it(e.selectedNodes.map(Cc),t.selectedNodes.map(Cc))&&it(e.selectedEdges.map(Cc),t.selectedEdges.map(Cc))}function VF({onSelectionChange:e}){const t=Ye(),{selectedNodes:n,selectedEdges:r}=_e(HF,BF);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 WF=e=>!!e.onSelectionChangeHandlers;function UF({onSelectionChange:e}){const t=_e(WF);return e||t?h.jsx(VF,{onSelectionChange:e}):null}const TC=[0,0],qF={x:0,y:0,zoom:1},KF=["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"],Dv=[...KF,"rfId"],YF=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}),$v={translateExtent:oa,nodeOrigin:TC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function GF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:c}=_e(YF,it),u=Ye();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=$v,l()}),[]);const d=S.useRef($v);return S.useEffect(()=>{for(const f of Dv){const p=e[f],x=d.current[f];p!==x&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?s(p):f==="translateExtent"?o(p):f==="nodeExtent"?i(p):f==="paneClickDistance"?c(p):f==="fitView"?u.setState({fitViewOnInit:p}):f==="fitViewOptions"?u.setState({fitViewOnInitOptions:p}):u.setState({[f]:p})))}d.current=e},Dv.map(f=>e[f])),null}function Fv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function QF(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=Fv(),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=Fv())!=null&&r.matches?"dark":"light"}const Lv=typeof document<"u"?document:null;function ca(e=null,t={target:Lv,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(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)||Lv;if(e!==null){const c=f=>{if(s.current=f.ctrlKey||f.metaKey||f.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Yp(f))return!1;const x=Bv(f.code,l);o.current.add(f[x]),Hv(i,o.current,!1)&&(f.preventDefault(),r(!0))},u=f=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Yp(f))return!1;const x=Bv(f.code,l);Hv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[x]),f.key==="Meta"&&o.current.clear(),s.current=!1},d=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Hv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Bv(e,t){return t.includes(e)?"code":"key"}const XF=()=>{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=Up(n,t),{width:a,height:c}=Vd(i);return qp({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=h0(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 Oa(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=oC(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function PC(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)ZF(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 ZF(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 JF(e,t){return PC(e,t)}function eL(e,t){return PC(e,t)}function As(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(As(o.id,i)))}return r}function Vv({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 Wv(e){return{id:e.id,type:"remove"}}const Uv=e=>z$(e),tL=e=>Jk(e);function IC(e){return S.forwardRef(e)}const nL=typeof window<"u"?S.useLayoutEffect:S.useEffect;function qv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>rL(()=>n(s=>s+BigInt(1))));return nL(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function rL(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const jC=S.createContext(null);function sL({children:e}){const t=Ye(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f}=t.getState();let p=a;for(const x of l)p=typeof x=="function"?x(p):x;u?c(p):d&&d(Vv({items:p,lookup:f}))},[]),r=qv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let p=a;for(const x of l)p=typeof x=="function"?x(p):x;u?c(p):d&&d(Vv({items:p,lookup:f}))},[]),o=qv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(jC.Provider,{value:i,children:e})}function oL(){const e=S.useContext(jC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iL=e=>!!e.panZoom;function v0(){const e=XF(),t=Ye(),n=oL(),r=_e(iL),s=S.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var g,m;const{nodeLookup:f,nodeOrigin:p}=t.getState(),x=Uv(d)?d:f.get(d.id),v=x.parentId?lC(x.position,x.measured,x.parentId,f,p):x.position,b={...x,position:v,width:((g=x.measured)==null?void 0:g.width)??x.width,height:((m=x.measured)==null?void 0:m.height)??x.height};return zi(b)},c=(d,f,p={replace:!1})=>{i(x=>x.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&Uv(b)?b:{...v,...b}}return v}))},u=(d,f,p={replace:!1})=>{l(x=>x.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&tL(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[x,v,b]=p;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x,y:v,zoom:b}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:x,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:m,onDelete:y,onBeforeDelete:w}=t.getState(),{nodes:E,edges:N}=await F$({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:x,onBeforeDelete:w}),k=N.length>0,C=E.length>0;if(k){const P=N.map(Wv);b==null||b(N),m(P)}if(C){const P=E.map(Wv);v==null||v(E),g(P)}return(C||k)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,f=!0,p)=>{const x=kv(d),v=x?d:a(d),b=p!==void 0;return v?(p||t.getState().nodes).filter(g=>{const m=t.getState().nodeLookup.get(g.id);if(m&&!x&&(g.id===d.id||!m.internals.positionAbsolute))return!1;const y=zi(b?g:m),w=la(y,v);return f&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const v=kv(d)?d:a(d);if(!v)return!1;const b=la(v,f);return p&&b>0||b>=v.width*v.height},updateNode:c,updateNodeData:(d,f,p={replace:!1})=>{c(d,x=>{const v=typeof f=="function"?f(x):f;return p.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},p)},updateEdge:u,updateEdgeData:(d,f,p={replace:!1})=>{u(d,x=>{const v=typeof f=="function"?f(x):f;return p.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return D$(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${p}-${d}-${f??null}`))==null?void 0:x.values())??[])}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Kv=e=>e.selected,lL={actInsideInputWithModifier:!1},aL=typeof window<"u"?window:void 0;function cL({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ye(),{deleteElements:r}=v0(),s=ca(e,lL),o=ca(t,{target:aL});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Kv),edges:i.filter(Kv)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function uL(e){const t=Ye();S.useEffect(()=>{const n=()=>{var s,o;if(!e.current)return!1;const r=Vd(e.current);(r.height===0||r.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",$r.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 qd={position:"absolute",width:"100%",height:"100%",top:0,left:0},dL=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function fL({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=to.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:x,noWheelClassName:v,noPanClassName:b,onViewportChange:g,isControlledViewport:m,paneClickDistance:y}){const w=Ye(),E=S.useRef(null),{userSelectionActive:N,lib:k}=_e(dL,it),C=ca(f),P=S.useRef();uL(E);const j=S.useCallback(A=>{g==null||g({x:A[0],y:A[1],zoom:A[2]}),m||w.setState({transform:A})},[g,m]);return S.useEffect(()=>{if(E.current){P.current=vF({domNode:E.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:a,paneClickDistance:y,onDraggingChange:R=>w.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:_,onMoveStart:F}=w.getState();F==null||F(R,I),_==null||_(I)},onPanZoom:(R,I)=>{const{onViewportChange:_,onMove:F}=w.getState();F==null||F(R,I),_==null||_(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:_,onMoveEnd:F}=w.getState();F==null||F(R,I),_==null||_(I)}});const{x:A,y:D,zoom:z}=P.current.getViewport();return w.setState({panZoom:P.current,transform:[A,D,z],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=P.current)==null||R.destroy()}}},[]),S.useEffect(()=>{var A;(A=P.current)==null||A.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:v,lib:k,onTransformChange:j})},[e,t,n,r,s,o,i,l,C,p,b,N,v,k,j]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:qd,children:x})}const hL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function pL(){const{userSelectionActive:e,userSelectionRect:t}=_e(hL,it);return e&&t?h.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 eh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},mL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function gL({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ia.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p}){const x=S.useRef(null),v=Ye(),b=S.useRef(0),g=S.useRef(0),m=S.useRef(),y=S.useRef(new Map),{userSelectionActive:w,elementsSelectable:E,dragging:N}=_e(mL,it),k=E&&(e||w),C=S.useRef(!1),P=S.useRef(!1),j=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,g.current=0},A=T=>{if(C.current){C.current=!1;return}l==null||l(T),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},D=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}a==null||a(T)},z=c?T=>c(T):void 0,R=T=>{var W,U,L,Q;const{resetSelectedElements:M,domNode:O,edgeLookup:V}=v.getState();if(m.current=O==null?void 0:O.getBoundingClientRect(),!E||!e||T.button!==0||T.target!==x.current||!m.current)return;(U=(W=T.target)==null?void 0:W.setPointerCapture)==null||U.call(W,T.pointerId),P.current=!0,C.current=!1,y.current=new Map;for(const[B,q]of V)y.current.set(q.source,((L=y.current.get(q.source))==null?void 0:L.add(B))||new Set([B])),y.current.set(q.target,((Q=y.current.get(q.target))==null?void 0:Q.add(B))||new Set([B]));const{x:H,y:K}=Rr(T.nativeEvent,m.current);M(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:K,x:H,y:K}}),o==null||o(T)},I=T=>{const{userSelectionRect:M,edgeLookup:O,transform:V,nodeLookup:H,triggerNodeChanges:K,triggerEdgeChanges:W}=v.getState();if(!m.current||!M)return;C.current=!0;const{x:U,y:L}=Rr(T.nativeEvent,m.current),{startX:Q,startY:B}=M,q={startX:Q,startY:B,x:U<Q?U:Q,y:L<B?L:B,width:Math.abs(U-Q),height:Math.abs(L-B)},Z=eC(H,q,V,n===ia.Partial,!0),Y=new Set,G=new Set;for(const X of Z){G.add(X.id);const te=y.current.get(X.id);if(te)for(const he of te)Y.add(he)}if(b.current!==G.size){b.current=G.size;const X=Uo(H,G,!0);K(X)}if(g.current!==Y.size){g.current=Y.size;const X=Uo(O,Y);W(X)}v.setState({userSelectionRect:q,userSelectionActive:!0,nodesSelectionActive:!1})},_=T=>{var O,V;if(T.button!==0||!P.current)return;(V=(O=T.target)==null?void 0:O.releasePointerCapture)==null||V.call(O,T.pointerId);const{userSelectionRect:M}=v.getState();!w&&M&&T.target===x.current&&(A==null||A(T)),b.current>0&&v.setState({nodesSelectionActive:!0}),j(),i==null||i(T),(t||s)&&(C.current=!1),P.current=!1},F=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:ut(["react-flow__pane",{draggable:F,dragging:N,selection:e}]),onClick:k?void 0:eh(A,x),onContextMenu:eh(D,x),onWheel:eh(z,x),onPointerEnter:k?void 0:u,onPointerDown:k?R:d,onPointerMove:k?I:d,onPointerUp:k?_:void 0,onPointerLeave:f,ref:x,style:qd,children:[p,h.jsx(pL,{})]})}function Jp({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",$r.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=oF({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Jp({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var d,f;if(t)(d=u.current)==null||d.destroy();else if(e.current)return(f=u.current)==null||f.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 xL=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function OC(){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(),d=new Map,f=xL(i),p=s?o[0]:5,x=s?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*x*n.factor;for(const[,g]of c){if(!f(g))continue;let m={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+b};s&&(m=Bd(m,o));const{position:y,positionAbsolute:w}=tC({nodeId:g.id,nextPosition:m,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});g.position=y,g.internals.positionAbsolute=w,d.set(g.id,g)}a(d)},[])}const w0=S.createContext(null),yL=w0.Provider;w0.Consumer;const MC=()=>S.useContext(w0),vL=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wL=(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 bL({type:e="source",position:t=ue.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:d,...f},p){var R,I;const x=i||null,v=e==="target",b=Ye(),g=MC(),{connectOnClick:m,noPanClassName:y,rfId:w}=_e(vL,it),{connectingFrom:E,connectingTo:N,clickConnecting:k,isPossibleEndHandle:C,connectionInProcess:P,valid:j}=_e(wL(g,x,e),it);g||(I=(R=b.getState()).onError)==null||I.call(R,"010",$r.error010());const A=_=>{const{defaultEdgeOptions:F,onConnect:T,hasDefaultEdges:M}=b.getState(),O={...F,..._};if(M){const{edges:V,setEdges:H}=b.getState();H(q$(O,V))}T==null||T(O),l==null||l(O)},D=_=>{if(!g)return;const F=cC(_.nativeEvent);if(s&&(F&&_.button===0||!F)){const T=b.getState();Zp.onPointerDown(_.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:v,handleId:x,nodeId:g,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:A,isValidConnection:n||T.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}F?u==null||u(_):d==null||d(_)},z=_=>{const{onClickConnectStart:F,onClickConnectEnd:T,connectionClickStartHandle:M,connectionMode:O,isValidConnection:V,lib:H,rfId:K,nodeLookup:W,connection:U}=b.getState();if(!g||!M&&!s)return;if(!M){F==null||F(_.nativeEvent,{nodeId:g,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:x}});return}const L=aC(_.target),Q=n||V,{connection:B,isValid:q}=Zp.isValid(_.nativeEvent,{handle:{nodeId:g,id:x,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:Q,flowId:K,doc:L,lib:H,nodeLookup:W});q&&B&&A(B);const Z=structuredClone(U);delete Z.inProgress,Z.toPosition=Z.toHandle?Z.toHandle.position:null,T==null||T(_,Z),b.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":x,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${x}-${e}`,className:ut(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,c,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:E,connectingto:N,valid:j,connectionindicator:r&&(!P||C)&&(P?o:s)}]),onMouseDown:D,onTouchStart:D,onClick:m?z:void 0,ref:p,...f,children:a})}const lr=S.memo(IC(bL));function SL({data:e,isConnectable:t,sourcePosition:n=ue.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(lr,{type:"source",position:n,isConnectable:t})]})}function EL({data:e,isConnectable:t,targetPosition:n=ue.Top,sourcePosition:r=ue.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(lr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(lr,{type:"source",position:r,isConnectable:t})]})}function kL(){return null}function CL({data:e,isConnectable:t,targetPosition:n=ue.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(lr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Qu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Yv={input:SL,default:EL,output:CL,group:kL};function NL(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 RL=e=>{const{width:t,height:n,x:r,y:s}=_a(e.nodeLookup,{filter:o=>!!o.selected});return{width:Fn(t)?t:null,height:Fn(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 TL({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ye(),{width:s,height:o,transformString:i,userSelectionActive:l}=_e(RL,it),a=OC(),c=S.useRef(null);if(S.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),_C({nodeRef:c}),l||!s||!o)return null;const u=e?f=>{const p=r.getState().nodes.filter(x=>x.selected);e(f,p)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Qu,f.key)&&(f.preventDefault(),a({direction:Qu[f.key],factor:f.shiftKey?4:1}))};return h.jsx("div",{className:ut(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:h.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Gv=typeof window<"u"?window:void 0,PL=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function AC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:C,defaultViewport:P,translateExtent:j,minZoom:A,maxZoom:D,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:I,noPanClassName:_,disableKeyboardA11y:F,onViewportChange:T,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:V}=_e(PL),H=ca(c,{target:Gv}),K=ca(v,{target:Gv}),W=K||C,U=K||w,L=u&&W!==!0,Q=H||V||L;return cL({deleteKeyCode:a,multiSelectionKeyCode:x}),h.jsx(fL,{onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:U,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:!H&&W,defaultViewport:P,translateExtent:j,minZoom:A,maxZoom:D,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:I,noPanClassName:_,onViewportChange:T,isControlledViewport:M,paneClickDistance:l,children:h.jsxs(gL,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:W,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:H,selectionOnDrag:L,children:[e,O&&h.jsx(TL,{onSelectionContextMenu:R,noPanClassName:_,disableKeyboardA11y:F})]})})}AC.displayName="FlowRenderer";const IL=S.memo(AC),jL=e=>t=>e?eC(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 _L(e){return _e(S.useCallback(jL(e),[e]),it)}const OL=e=>e.updateNodeInternals;function ML(){const e=_e(OL),[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 AL({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 d=c.current!==t,f=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||f||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 zL({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:x,rfId:v,nodeTypes:b,nodeExtent:g,nodeClickDistance:m,onError:y}){const{node:w,internals:E,isParent:N}=_e(B=>{const q=B.nodeLookup.get(e),Z=B.parentLookup.has(e);return{node:q,internals:q.internals,isParent:Z}},it);let k=w.type||"default",C=(b==null?void 0:b[k])||Yv[k];C===void 0&&(y==null||y("003",$r.error003(k)),k="default",C=Yv.default);const P=!!(w.draggable||l&&typeof w.draggable>"u"),j=!!(w.selectable||a&&typeof w.selectable>"u"),A=!!(w.connectable||c&&typeof w.connectable>"u"),D=!!(w.focusable||u&&typeof w.focusable>"u"),z=Ye(),R=iC(w),I=AL({node:w,nodeType:k,hasDimensions:R,resizeObserver:d}),_=_C({nodeRef:I,disabled:w.hidden||!P,noDragClassName:f,handleSelector:w.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:m}),F=OC();if(w.hidden)return null;const T=Fr(w),M=NL(w),O=j||P||t||n||r||s,V=n?B=>n(B,{...E.userNode}):void 0,H=r?B=>r(B,{...E.userNode}):void 0,K=s?B=>s(B,{...E.userNode}):void 0,W=o?B=>o(B,{...E.userNode}):void 0,U=i?B=>i(B,{...E.userNode}):void 0,L=B=>{const{selectNodesOnDrag:q,nodeDragThreshold:Z}=z.getState();j&&(!q||!P||Z>0)&&Jp({id:e,store:z,nodeRef:I}),t&&t(B,{...E.userNode})},Q=B=>{if(!(Yp(B.nativeEvent)||x))if(Qk.includes(B.key)&&j){const q=B.key==="Escape";Jp({id:e,store:z,unselect:q,nodeRef:I})}else P&&w.selected&&Object.prototype.hasOwnProperty.call(Qu,B.key)&&(B.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${B.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`}),F({direction:Qu[B.key],factor:B.shiftKey?4:1}))};return h.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${k}`,{[p]:P},w.className,{selected:w.selected,selectable:j,parent:N,draggable:P,dragging:_}]),ref:I,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:O?"all":"none",visibility:R?"visible":"hidden",...w.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:H,onMouseLeave:K,onContextMenu:W,onClick:L,onDoubleClick:U,onKeyDown:D?Q:void 0,tabIndex:D?0:void 0,role:D?"button":void 0,"aria-describedby":x?void 0:`${NC}-${v}`,"aria-label":w.ariaLabel,children:h.jsx(yL,{value:e,children:h.jsx(C,{id:e,data:w.data,type:k,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:w.selected,selectable:j,draggable:P,deletable:w.deletable??!0,isConnectable:A,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:_,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...T})})})}const DL=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function zC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=_e(DL,it),i=_L(e.onlyRenderVisibleElements),l=ML();return h.jsx("div",{className:"react-flow__nodes",style:qd,children:i.map(a=>h.jsx(zL,{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))})}zC.displayName="NodeRenderer";const $L=S.memo(zC);function FL(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&&V$({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),it)}const LL=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),HL=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Qv={[Ku.Arrow]:LL,[Ku.ArrowClosed]:HL};function BL(e){const t=Ye();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Qv,e)?Qv[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",$r.error009(e)),null)},[e])}const VL=({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=BL(t);return a?h.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:h.jsx(a,{color:n,strokeWidth:i})}):null},DC=({defaultColor:e,rfId:t})=>{const n=_e(o=>o.edges),r=_e(o=>o.defaultEdgeOptions),s=S.useMemo(()=>X$(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?h.jsx("svg",{className:"react-flow__marker",children:h.jsx("defs",{children:s.map(o=>h.jsx(VL,{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};DC.displayName="MarkerDefinitions";var WL=S.memo(DC);function $C({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[d,f]=S.useState({x:1,y:0,width:0,height:0}),p=ut(["react-flow__edge-textwrapper",c]),x=S.useRef(null);return S.useEffect(()=>{if(x.current){const v=x.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[s&&h.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:n}),a]})}$C.displayName="EdgeText";const UL=S.memo($C);function Kd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...u}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...u,d:e,fill:"none",className:ut(["react-flow__edge-path",u.className])}),c&&h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&Fn(t)&&Fn(n)?h.jsx(UL,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Xv({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===ue.Left||e===ue.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function FC({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top}){const[i,l]=Xv({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=Xv({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,d,f,p]=uC({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,d,f,p]}function LC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=ue.Bottom,targetPosition:l=ue.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:g})=>{const[m,y,w]=FC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),E=e.isInternal?void 0:t;return h.jsx(Kd,{id:E,path:m,labelX:y,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:g})})}const qL=LC({isInternal:!1}),HC=LC({isInternal:!0});qL.displayName="SimpleBezierEdge";HC.displayName="SimpleBezierEdgeInternal";function BC(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:d,style:f,sourcePosition:p=ue.Bottom,targetPosition:x=ue.Top,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[y,w,E]=Gp({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:o,targetPosition:x,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset}),N=e.isInternal?void 0:t;return h.jsx(Kd,{id:N,path:y,labelX:w,labelY:E,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:b,interactionWidth:m})})}const VC=BC({isInternal:!1}),WC=BC({isInternal:!0});VC.displayName="SmoothStepEdge";WC.displayName="SmoothStepEdgeInternal";function UC(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx(VC,{...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 KL=UC({isInternal:!1}),qC=UC({isInternal:!0});KL.displayName="StepEdge";qC.displayName="StepEdgeInternal";function KC(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:d,style:f,markerEnd:p,markerStart:x,interactionWidth:v})=>{const[b,g,m]=hC({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return h.jsx(Kd,{id:y,path:b,labelX:g,labelY:m,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:x,interactionWidth:v})})}const YL=KC({isInternal:!1}),YC=KC({isInternal:!0});YL.displayName="StraightEdge";YC.displayName="StraightEdgeInternal";function GC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=ue.Bottom,targetPosition:l=ue.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[y,w,E]=dC({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 h.jsx(Kd,{id:N,path:y,labelX:w,labelY:E,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:m})})}const GL=GC({isInternal:!1}),QC=GC({isInternal:!0});GL.displayName="BezierEdge";QC.displayName="BezierEdgeInternal";const Zv={default:QC,straight:YC,step:qC,smoothstep:WC,simplebezier:HC},Jv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},QL=(e,t,n)=>n===ue.Left?e-t:n===ue.Right?e+t:e,XL=(e,t,n)=>n===ue.Top?e-t:n===ue.Bottom?e+t:e,ew="react-flow__edgeupdater";function tw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:ut([ew,`${ew}-${l}`]),cx:QL(t,r,e),cy:XL(n,r,e),r,stroke:"transparent",fill:"transparent"})}function ZL({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const x=Ye(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:k,isValidConnection:C,connectionMode:P,connectionRadius:j,lib:A,onConnectStart:D,onConnectEnd:z,cancelConnection:R,nodeLookup:I,rfId:_,panBy:F,updateConnection:T}=x.getState(),M=E.type==="target";f(!0),u==null||u(w,n,E.type);const O=(H,K)=>{f(!1),d==null||d(H,n,E.type,K)},V=H=>c==null?void 0:c(n,H);Zp.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:P,connectionRadius:j,domNode:k,handleId:E.id,nodeId:E.nodeId,nodeLookup:I,isTarget:M,edgeUpdaterType:E.type,lib:A,flowId:_,cancelConnection:R,panBy:F,isValidConnection:C,onConnect:V,onConnectStart:D,onConnectEnd:z,onReconnectEnd:O,updateConnection:T,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle})},b=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>p(!0),y=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(tw,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:m,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(tw,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:g,onMouseEnter:m,onMouseOut:y,type:"target"})]})}function JL({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:x,edgeTypes:v,noPanClassName:b,onError:g,disableKeyboardA11y:m}){let y=_e(G=>G.edgeLookup.get(e));const w=_e(G=>G.defaultEdgeOptions);y=w?{...w,...y}:y;let E=y.type||"default",N=(v==null?void 0:v[E])||Zv[E];N===void 0&&(g==null||g("011",$r.error011(E)),E="default",N=Zv.default);const k=!!(y.focusable||t&&typeof y.focusable>"u"),C=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),P=!!(y.selectable||r&&typeof y.selectable>"u"),j=S.useRef(null),[A,D]=S.useState(!1),[z,R]=S.useState(!1),I=Ye(),{zIndex:_,sourceX:F,sourceY:T,targetX:M,targetY:O,sourcePosition:V,targetPosition:H}=_e(S.useCallback(G=>{const X=G.nodeLookup.get(y.source),te=G.nodeLookup.get(y.target);if(!X||!te)return{zIndex:y.zIndex,...Jv};const he=Q$({id:e,sourceNode:X,targetNode:te,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:G.connectionMode,onError:g});return{zIndex:B$({selected:y.selected,zIndex:y.zIndex,sourceNode:X,targetNode:te,elevateOnSelect:G.elevateEdgesOnSelect}),...he||Jv}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),it),K=S.useMemo(()=>y.markerStart?`url('#${Qp(y.markerStart,x)}')`:void 0,[y.markerStart,x]),W=S.useMemo(()=>y.markerEnd?`url('#${Qp(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||F===null||T===null||M===null||O===null)return null;const U=G=>{var Pe;const{addSelectedEdges:X,unselectNodesAndEdges:te,multiSelectionActive:he}=I.getState();P&&(I.setState({nodesSelectionActive:!1}),y.selected&&he?(te({nodes:[],edges:[y]}),(Pe=j.current)==null||Pe.blur()):X([e])),s&&s(G,y)},L=o?G=>{o(G,{...y})}:void 0,Q=i?G=>{i(G,{...y})}:void 0,B=l?G=>{l(G,{...y})}:void 0,q=a?G=>{a(G,{...y})}:void 0,Z=c?G=>{c(G,{...y})}:void 0,Y=G=>{var X;if(!m&&Qk.includes(G.key)&&P){const{unselectNodesAndEdges:te,addSelectedEdges:he}=I.getState();G.key==="Escape"?((X=j.current)==null||X.blur(),te({edges:[y]})):he([e])}};return h.jsx("svg",{style:{zIndex:_},children:h.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${E}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!P&&!s,updating:A,selectable:P}]),onClick:U,onDoubleClick:L,onContextMenu:Q,onMouseEnter:B,onMouseMove:q,onMouseLeave:Z,onKeyDown:k?Y:void 0,tabIndex:k?0:void 0,role:k?"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":k?`${RC}-${x}`:void 0,ref:j,children:[!z&&h.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:O,sourcePosition:V,targetPosition:H,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&&h.jsx(ZL,{edge:y,isReconnectable:C,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:F,sourceY:T,targetX:M,targetY:O,sourcePosition:V,targetPosition:H,setUpdateHover:D,setReconnecting:R})]})})}const e3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function XC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:x,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,onError:y}=_e(e3,it),w=FL(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(WL,{defaultColor:e,rfId:n}),w.map(E=>h.jsx(JL,{id:E,edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:x,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},E))]})}XC.displayName="EdgeRenderer";const t3=S.memo(XC),n3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function r3({children:e}){const t=_e(n3);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function s3(e){const t=v0(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const o3=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function i3(e){const t=_e(o3),n=Ye();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function l3(e){return e.connection.inProgress?{...e.connection,to:Oa(e.connection.to,e.transform)}:{...e.connection}}function a3(e){return l3}function c3(e){const t=a3();return _e(t,it)}const u3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function d3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=_e(u3,it);return!(o&&s&&a)?null:h.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:ut(["react-flow__connection",Zk(l)]),children:h.jsx(ZC,{style:t,type:n,CustomComponent:r,isValid:l})})})}const ZC=({style:e,type:t=Xr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:d,toPosition:f}=c3();if(!s)return;if(n)return h.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:f,connectionStatus:Zk(r),toNode:u,toHandle:d});let p="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Xr.Bezier:[p]=dC(x);break;case Xr.SimpleBezier:[p]=FC(x);break;case Xr.Step:[p]=Gp({...x,borderRadius:0});break;case Xr.SmoothStep:[p]=Gp(x);break;default:[p]=hC(x)}return h.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};ZC.displayName="ConnectionLine";const f3={};function nw(e=f3){S.useRef(e),Ye(),S.useEffect(()=>{},[e])}function h3(){Ye(),S.useRef(!1),S.useEffect(()=>{},[])}function JC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:g,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,deleteKeyCode:C,onlyRenderVisibleElements:P,elementsSelectable:j,defaultViewport:A,translateExtent:D,minZoom:z,maxZoom:R,preventScrolling:I,defaultMarkerColor:_,zoomOnScroll:F,zoomOnPinch:T,panOnScroll:M,panOnScrollSpeed:O,panOnScrollMode:V,zoomOnDoubleClick:H,panOnDrag:K,onPaneClick:W,onPaneMouseEnter:U,onPaneMouseMove:L,onPaneMouseLeave:Q,onPaneScroll:B,onPaneContextMenu:q,paneClickDistance:Z,nodeClickDistance:Y,onEdgeContextMenu:G,onEdgeMouseEnter:X,onEdgeMouseMove:te,onEdgeMouseLeave:he,reconnectRadius:Pe,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:de,noDragClassName:xe,noWheelClassName:Oe,noPanClassName:Ie,disableKeyboardA11y:ze,nodeExtent:at,rfId:et,viewport:ne,onViewportChange:re}){return nw(e),nw(t),h3(),s3(n),i3(ne),h.jsx(IL,{onPaneClick:W,onPaneMouseEnter:U,onPaneMouseMove:L,onPaneMouseLeave:Q,onPaneContextMenu:q,onPaneScroll:B,paneClickDistance:Z,deleteKeyCode:C,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:j,zoomOnScroll:F,zoomOnPinch:T,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:O,panOnScrollMode:V,panOnDrag:K,defaultViewport:A,translateExtent:D,minZoom:z,maxZoom:R,onSelectionContextMenu:d,preventScrolling:I,noDragClassName:xe,noWheelClassName:Oe,noPanClassName:Ie,disableKeyboardA11y:ze,onViewportChange:re,isControlledViewport:!!ne,children:h.jsxs(r3,{children:[h.jsx(t3,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:de,onlyRenderVisibleElements:P,onEdgeContextMenu:G,onEdgeMouseEnter:X,onEdgeMouseMove:te,onEdgeMouseLeave:he,reconnectRadius:Pe,defaultMarkerColor:_,noPanClassName:Ie,disableKeyboardA11y:ze,rfId:et}),h.jsx(d3,{style:v,type:x,component:b,containerStyle:g}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx($L,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Y,onlyRenderVisibleElements:P,noPanClassName:Ie,noDragClassName:xe,disableKeyboardA11y:ze,nodeExtent:at,rfId:et}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}JC.displayName="GraphView";const p3=S.memo(JC),rw=({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,d=new Map,f=new Map,p=r??t??[],x=n??e??[],v=l??[0,0],b=a??oa;mC(d,f,p),Xp(x,c,u,{nodeOrigin:v,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:E}=h0(m,s,o,.5,2,.1);g=[y,w,E]}return{rfId:"1",width:0,height:0,transform:g,nodes:x,nodeLookup:c,parentLookup:u,edges:p,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:oa,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,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:{...Xk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:L$,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},m3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a})=>_F((c,u)=>({...rw({nodes:e,edges:t,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:f,parentLookup:p,nodeOrigin:x,elevateNodesOnSelect:v}=u();Xp(d,f,p,{nodeOrigin:x,nodeExtent:a,elevateNodesOnSelect:v,checkEquality:!0}),c({nodes:d})},setEdges:d=>{const{connectionLookup:f,edgeLookup:p}=u();mC(f,p,d),c({edges:d})},setDefaultNodesAndEdges:(d,f)=>{if(d){const{setNodes:p}=u();p(d),c({hasDefaultNodes:!0})}if(f){const{setEdges:p}=u();p(f),c({hasDefaultEdges:!0})}},updateNodeInternals:(d,f={triggerFitView:!0})=>{const{triggerNodeChanges:p,nodeLookup:x,parentLookup:v,fitViewOnInit:b,fitViewDone:g,fitViewOnInitOptions:m,domNode:y,nodeOrigin:w,nodeExtent:E,debug:N,fitViewSync:k}=u(),{changes:C,updatedInternals:P}=nF(d,x,v,y,w,E);if(P){if(J$(x,v,{nodeOrigin:w,nodeExtent:E}),f.triggerFitView){let j=g;!g&&b&&(j=k({...m,nodes:m==null?void 0:m.nodes})),c({fitViewDone:j})}else c({});(C==null?void 0:C.length)>0&&(N&&console.log("React Flow: trigger node changes",C),p==null||p(C))}},updateNodePositions:(d,f=!1)=>{const p=[],x=[];for(const[v,b]of d){const g=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(b!=null&&b.position)),m={id:v,type:"position",position:g?{x:Math.max(0,b.position.x),y:Math.max(0,b.position.y)}:b.position,dragging:f};g&&p.push({id:v,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.measured.height}}),x.push(m)}if(p.length>0){const{nodeLookup:v,parentLookup:b,nodeOrigin:g}=u(),m=x0(p,v,b,g);x.push(...m)}u().triggerNodeChanges(x)},triggerNodeChanges:d=>{const{onNodesChange:f,setNodes:p,nodes:x,hasDefaultNodes:v,debug:b}=u();if(d!=null&&d.length){if(v){const g=JF(d,x);p(g)}b&&console.log("React Flow: trigger node changes",d),f==null||f(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:f,setEdges:p,edges:x,hasDefaultEdges:v,debug:b}=u();if(d!=null&&d.length){if(v){const g=eL(d,x);p(g)}b&&console.log("React Flow: trigger edge changes",d),f==null||f(d)}},addSelectedNodes:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const g=d.map(m=>As(m,!0));v(g);return}v(Uo(x,new Set([...d]),!0)),b(Uo(p))},addSelectedEdges:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const g=d.map(m=>As(m,!0));b(g);return}b(Uo(p,new Set([...d]))),v(Uo(x,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:f}={})=>{const{edges:p,nodes:x,nodeLookup:v,triggerNodeChanges:b,triggerEdgeChanges:g}=u(),m=d||x,y=f||p,w=m.map(N=>{const k=v.get(N.id);return k&&(k.selected=!1),As(N.id,!1)}),E=y.map(N=>As(N.id,!1));b(w),g(E)},setMinZoom:d=>{const{panZoom:f,maxZoom:p}=u();f==null||f.setScaleExtent([d,p]),c({minZoom:d})},setMaxZoom:d=>{const{panZoom:f,minZoom:p}=u();f==null||f.setScaleExtent([p,d]),c({maxZoom:d})},setTranslateExtent:d=>{var f;(f=u().panZoom)==null||f.setTranslateExtent(d),c({translateExtent:d})},setPaneClickDistance:d=>{var f;(f=u().panZoom)==null||f.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:f,triggerNodeChanges:p,triggerEdgeChanges:x}=u(),v=f.reduce((g,m)=>m.selected?[...g,As(m.id,!1)]:g,[]),b=d.reduce((g,m)=>m.selected?[...g,As(m.id,!1)]:g,[]);p(v),x(b)},setNodeExtent:d=>{const{nodes:f,nodeLookup:p,parentLookup:x,nodeOrigin:v,elevateNodesOnSelect:b,nodeExtent:g}=u();d[0][0]===g[0][0]&&d[0][1]===g[0][1]&&d[1][0]===g[1][0]&&d[1][1]===g[1][1]||(Xp(f,p,x,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:b,checkEquality:!1}),c({nodeExtent:d}))},panBy:d=>{const{transform:f,width:p,height:x,panZoom:v,translateExtent:b}=u();return rF({delta:d,panZoom:v,transform:f,translateExtent:b,width:p,height:x})},fitView:d=>{const{panZoom:f,width:p,height:x,minZoom:v,maxZoom:b,nodeLookup:g}=u();if(!f)return Promise.resolve(!1);const m=Up(g,d);return qp({nodes:m,width:p,height:x,panZoom:f,minZoom:v,maxZoom:b},d)},fitViewSync:d=>{const{panZoom:f,width:p,height:x,minZoom:v,maxZoom:b,nodeLookup:g}=u();if(!f)return!1;const m=Up(g,d);return qp({nodes:m,width:p,height:x,panZoom:f,minZoom:v,maxZoom:b},d),m.size>0},cancelConnection:()=>{c({connection:{...Xk}})},updateConnection:d=>{c({connection:d})},reset:()=>c({...rw()})}),Object.is);function g3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:i,nodeOrigin:l,nodeExtent:a,children:c}){const[u]=S.useState(()=>m3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}));return h.jsx(OF,{value:u,children:h.jsx(sL,{children:c})})}function x3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,nodeOrigin:a,nodeExtent:c}){return S.useContext(Ud)?h.jsx(h.Fragment,{children:e}):h.jsx(g3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,nodeOrigin:a,nodeExtent:c,children:e})}const y3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function v3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:P,onNodesDelete:j,onEdgesDelete:A,onDelete:D,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:I,onSelectionDragStop:_,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onBeforeDelete:O,connectionMode:V,connectionLineType:H=Xr.Bezier,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:U,deleteKeyCode:L="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:B=!1,selectionMode:q=ia.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:Y=Gu()?"Meta":"Control",zoomActivationKeyCode:G=Gu()?"Meta":"Control",snapToGrid:X,snapGrid:te,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:Pe,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:de,nodeOrigin:xe=TC,edgesFocusable:Oe,edgesReconnectable:Ie,elementsSelectable:ze=!0,defaultViewport:at=qF,minZoom:et=.5,maxZoom:ne=2,translateExtent:re=oa,preventScrolling:Me=!0,nodeExtent:we,defaultMarkerColor:xt="#b1b1b7",zoomOnScroll:qt=!0,zoomOnPinch:se=!0,panOnScroll:Re=!1,panOnScrollSpeed:Ae=.5,panOnScrollMode:Kt=to.Free,zoomOnDoubleClick:Rt=!0,panOnDrag:Un=!0,onPaneClick:qn,onPaneMouseEnter:So,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:Ma,paneClickDistance:ke=0,nodeClickDistance:yt=0,children:Yt,onReconnect:Tt,onReconnectStart:gn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Kn,onEdgeMouseLeave:In,reconnectRadius:Is=10,onNodesChange:To,onEdgesChange:Wi,noDragClassName:Aa="nodrag",noWheelClassName:za="nowheel",noPanClassName:Ui="nopan",fitView:qi,fitViewOptions:Da,connectOnClick:$a,attributionPosition:Qd,proOptions:Xd,defaultEdgeOptions:EN,elevateNodesOnSelect:kN,elevateEdgesOnSelect:CN,disableKeyboardA11y:k0=!1,autoPanOnConnect:NN,autoPanOnNodeDrag:RN,autoPanSpeed:TN,connectionRadius:PN,isValidConnection:IN,onError:jN,style:_N,id:C0,nodeDragThreshold:ON,viewport:MN,onViewportChange:AN,width:zN,height:DN,colorMode:$N="light",debug:FN,...LN},HN){const Zd=C0||"1",BN=QF($N);return h.jsx("div",{"data-testid":"rf__wrapper",...LN,style:{..._N,...y3},ref:HN,className:ut(["react-flow",s,BN]),id:C0,children:h.jsxs(x3,{nodes:e,edges:t,width:zN,height:DN,fitView:qi,nodeOrigin:xe,nodeExtent:we,children:[h.jsx(p3,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:i,connectionLineType:H,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:U,selectionKeyCode:Q,selectionOnDrag:B,selectionMode:q,deleteKeyCode:L,multiSelectionKeyCode:Y,panActivationKeyCode:Z,zoomActivationKeyCode:G,onlyRenderVisibleElements:he,defaultViewport:at,translateExtent:re,minZoom:et,maxZoom:ne,preventScrolling:Me,zoomOnScroll:qt,zoomOnPinch:se,zoomOnDoubleClick:Rt,panOnScroll:Re,panOnScrollSpeed:Ae,panOnScrollMode:Kt,panOnDrag:Un,onPaneClick:qn,onPaneMouseEnter:So,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:Ma,paneClickDistance:ke,nodeClickDistance:yt,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onReconnect:Tt,onReconnectStart:gn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Kn,onEdgeMouseLeave:In,reconnectRadius:Is,defaultMarkerColor:xt,noDragClassName:Aa,noWheelClassName:za,noPanClassName:Ui,rfId:Zd,disableKeyboardA11y:k0,nodeExtent:we,viewport:MN,onViewportChange:AN}),h.jsx(GF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:de,edgesFocusable:Oe,edgesReconnectable:Ie,elementsSelectable:ze,elevateNodesOnSelect:kN,elevateEdgesOnSelect:CN,minZoom:et,maxZoom:ne,nodeExtent:we,onNodesChange:To,onEdgesChange:Wi,snapToGrid:X,snapGrid:te,connectionMode:V,translateExtent:re,connectOnClick:$a,defaultEdgeOptions:EN,fitView:qi,fitViewOptions:Da,onNodesDelete:j,onEdgesDelete:A,onDelete:D,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:P,onSelectionDrag:I,onSelectionDragStart:R,onSelectionDragStop:_,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Ui,nodeOrigin:xe,rfId:Zd,autoPanOnConnect:NN,autoPanOnNodeDrag:RN,autoPanSpeed:TN,onError:jN,connectionRadius:PN,isValidConnection:IN,selectNodesOnDrag:Pe,nodeDragThreshold:ON,onBeforeDelete:O,paneClickDistance:ke,debug:FN}),h.jsx(UF,{onSelectionChange:z}),Yt,h.jsx(LF,{proOptions:Xd,position:Qd}),h.jsx($F,{rfId:Zd,disableKeyboardA11y:k0})]})})}var w3=IC(v3);function b3({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ut(["react-flow__background-pattern",n,r])})}function S3({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:ut(["react-flow__background-pattern","dots",t])})}var Tr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Tr||(Tr={}));const E3={[Tr.Dots]:1,[Tr.Lines]:1,[Tr.Cross]:6},k3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function eN({id:e,variant:t=Tr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const d=S.useRef(null),{transform:f,patternId:p}=_e(k3,it),x=r||E3[t],v=t===Tr.Dots,b=t===Tr.Cross,g=Array.isArray(n)?n:[n,n],m=[g[0]*f[2]||1,g[1]*f[2]||1],y=x*f[2],w=Array.isArray(o)?o:[o,o],E=b?[y,y]:m,N=[w[0]*f[2]||1+E[0]/2,w[1]*f[2]||1+E[1]/2],k=`${p}${e||""}`;return h.jsxs("svg",{className:ut(["react-flow__background",c]),style:{...a,...qd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:k,x:f[0]%m[0],y:f[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?h.jsx(S3,{radius:y/2,className:u}):h.jsx(b3,{dimensions:E,lineWidth:s,variant:t,className:u})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}eN.displayName="Background";const C3=S.memo(eN);function N3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function R3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function T3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 P3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 I3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Nc({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:ut(["react-flow__controls-button",t]),...n,children:e})}const j3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function tN({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:d="bottom-left",orientation:f="vertical","aria-label":p="React Flow controls"}){const x=Ye(),{isInteractive:v,minZoomReached:b,maxZoomReached:g}=_e(j3,it),{zoomIn:m,zoomOut:y,fitView:w}=v0(),E=()=>{m(),o==null||o()},N=()=>{y(),i==null||i()},k=()=>{w(s),l==null||l()},C=()=>{x.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},P=f==="horizontal"?"horizontal":"vertical";return h.jsxs(y0,{className:ut(["react-flow__controls",P,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p,children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Nc,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:h.jsx(N3,{})}),h.jsx(Nc,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:h.jsx(R3,{})})]}),n&&h.jsx(Nc,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:h.jsx(T3,{})}),r&&h.jsx(Nc,{className:"react-flow__controls-interactive",onClick:C,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?h.jsx(I3,{}):h.jsx(P3,{})}),u]})}tN.displayName="Controls";const _3=S.memo(tN);function O3({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:x,backgroundColor:v}=o||{},b=i||x||v;return h.jsx("rect",{className:ut(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}const M3=S.memo(O3),A3=e=>e.nodes.map(t=>t.id),th=e=>e instanceof Function?e:()=>e;function z3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=M3,onClick:i}){const l=_e(A3,it),a=th(t),c=th(e),u=th(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx($3,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function D3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:d,width:f,height:p}=_e(x=>{const v=x.nodeLookup.get(e),{x:b,y:g}=v.internals.positionAbsolute,{width:m,height:y}=Fr(v);return{node:v,x:b,y:g,width:m,height:y}},it);return!c||c.hidden||!iC(c)?null:h.jsx(l,{x:u,y:d,width:f,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 $3=S.memo(D3);var F3=S.memo(z3);const L3=200,H3=150,B3=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?sC(_a(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},V3="react-flow__minimap-desc";function nN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:x,pannable:v=!1,zoomable:b=!1,ariaLabel:g="React Flow mini map",inversePan:m,zoomStep:y=10,offsetScale:w=5}){const E=Ye(),N=S.useRef(null),{boundingRect:k,viewBB:C,rfId:P,panZoom:j,translateExtent:A,flowWidth:D,flowHeight:z}=_e(B3,it),R=(e==null?void 0:e.width)??L3,I=(e==null?void 0:e.height)??H3,_=k.width/R,F=k.height/I,T=Math.max(_,F),M=T*R,O=T*I,V=w*T,H=k.x-(M-k.width)/2-V,K=k.y-(O-k.height)/2-V,W=M+V*2,U=O+V*2,L=`${V3}-${P}`,Q=S.useRef(0),B=S.useRef();Q.current=T,S.useEffect(()=>{if(N.current&&j)return B.current=dF({domNode:N.current,panZoom:j,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Y;(Y=B.current)==null||Y.destroy()}},[j]),S.useEffect(()=>{var Y;(Y=B.current)==null||Y.update({translateExtent:A,width:D,height:z,inversePan:m,pannable:v,zoomStep:y,zoomable:b})},[v,b,m,y,A,D,z]);const q=p?Y=>{var te;const[G,X]=((te=B.current)==null?void 0:te.pointer(Y))||[0,0];p(Y,{x:G,y:X})}:void 0,Z=x?S.useCallback((Y,G)=>{const X=E.getState().nodeLookup.get(G);x(Y,X)},[]):void 0;return h.jsx(y0,{position:f,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 d=="number"?d*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:ut(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:R,height:I,viewBox:`${H} ${K} ${W} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":L,ref:N,onClick:q,children:[g&&h.jsx("title",{id:L,children:g}),h.jsx(F3,{onClick:Z,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-V},${K-V}h${W+V*2}v${U+V*2}h${-W-V*2}z
|
|
62
|
+
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}nN.displayName="MiniMap";S.memo(nN);function W3({nodeId:e,position:t,variant:n=Il.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:d=!1,shouldResize:f,onResizeStart:p,onResize:x,onResizeEnd:v}){const b=MC(),g=typeof e=="string"?e:b,m=Ye(),y=S.useRef(null),w=n===Il.Line?"right":"bottom-right",E=t??w,N=S.useRef(null);S.useEffect(()=>{if(!(!y.current||!g))return N.current||(N.current=NF({domNode:y.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:z,nodeOrigin:R,domNode:I}=m.getState();return{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:z,nodeOrigin:R,paneDomNode:I}},onChange:(j,A)=>{const{triggerNodeChanges:D,nodeLookup:z,parentLookup:R,nodeOrigin:I}=m.getState(),_=[],F={x:j.x,y:j.y},T=z.get(g);if(T&&T.expandParent&&T.parentId){const M=T.origin??I,O=j.width??T.measured.width,V=j.height??T.measured.height,H={id:T.id,parentId:T.parentId,rect:{width:O,height:V,...lC({x:j.x??T.position.x,y:j.y??T.position.y},{width:O,height:V},T.parentId,z,M)}},K=x0([H],z,R,I);_.push(...K),F.x=j.x?Math.max(M[0]*O,j.x):void 0,F.y=j.y?Math.max(M[1]*V,j.y):void 0}if(F.x!==void 0&&F.y!==void 0){const M={id:g,type:"position",position:{...F}};_.push(M)}if(j.width!==void 0&&j.height!==void 0){const M={id:g,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:j.width,height:j.height}};_.push(M)}for(const M of A){const O={...M,type:"position"};_.push(O)}D(_)},onEnd:()=>{const j={id:g,type:"dimensions",resizing:!1};m.getState().triggerNodeChanges([j])}})),N.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:d,onResizeStart:p,onResize:x,onResizeEnd:v,shouldResize:f}),()=>{var j;(j=N.current)==null||j.destroy()}},[E,l,a,c,u,d,p,x,v,f]);const k=E.split("-"),C=n===Il.Line?"borderColor":"backgroundColor",P=i?{...s,[C]:i}:s;return h.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...k,n,r]),ref:y,style:P,children:o})}S.memo(W3);const U3=new Set,sw=[];function q3(e){return e.startsWith("signal:child:")}function K3(e){const t=po(),n=(()=>{const r=new Set(e),s=e.size+lk,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 e0(l.timeline)){if(r.size>=s)break;r.has(a)||(r.add(a),o.push(a))}}return[...r].sort()})();return hm({queries:n.map(r=>({queryKey:["run",r],queryFn:()=>Fe.run(r)})),combine:ck})}function Y3({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?ag:cg(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 h.jsxs("div",{title:o?xp.child:xp[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:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),h.jsx(lr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:h.jsx(i,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),h.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?h.jsx(bs,{width:9,height:9}):n?h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):h.jsx(lg,{width:9,height:9})})]}),h.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?h.jsxs("span",{className:"flex items-center gap-1",children:[!s&&h.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:h.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.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 ↗"})]}):h.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&h.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[h.jsx(ku,{width:9,height:9}),e.attempts]}),e.workerGroup&&h.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),h.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&h.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&h.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&&h.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&h.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&h.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),h.jsx(lr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}function G3({data:e}){const{fan:t}=e,n=t0(t,e.runFinished),r=n0(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 h.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:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${i} ${o?"animate-pulse":""}`}),h.jsx(lr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded bg-indigo-500/15 text-[11px] text-indigo-300",children:"⑃"}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:t.label}),h.jsx("span",{className:"mono tnum ml-auto shrink-0 text-[11px] text-zinc-400",children:fk(n)})]}),h.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-full bg-zinc-800",children:zu.map(a=>h.jsx("span",{className:a.className,style:{width:l(n[a.key])}},a.key))}),h.jsxs("div",{className:"mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]",children:[zu.map(a=>n[a.key]>0?h.jsxs("span",{className:a.text,children:[n[a.key]," ",a.label,a.key==="skipped"&&t.failFast?" (failFast)":""]},a.key):null),h.jsxs("span",{className:"ml-auto text-zinc-500",children:["#",t.firstSeq,"–",t.lastSeq]})]})]}),h.jsx(lr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}function Q3({data:e}){const t=e.status==="running"||e.status==="awaiting";return h.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:[h.jsx(lr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsx("span",{className:`dot ${t?"pulse":""}`}),h.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),h.jsx(lr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}const X3={step:Y3,fan:G3,terminal:Q3};function Z3(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 J3=S.memo(function({run:t,timeline:n,fans:r=sw,endStatus:s,selectedKey:o,onSelect:i,onOpenRun:l,fmtDuration:a,expanded:c,onToggleChild:u}){const d=c??U3,f=S.useMemo(()=>{const g=new Set(d);for(const m of e0(n))g.add(m);return g},[d,n]),p=K3(f),{nodes:x,edges:v}=S.useMemo(()=>{const w=[],E=[],N=t.status==="running"||t.status==="suspended",k=(I,_,F)=>({id:`${I}->${_}`,source:I,target:_,style:{stroke:F?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(I,_)=>({id:`${I}=>${_}`,source:I,target:_,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function P(I,_,F,T,M,O){const V=`${M}s${I.seq}`,H=wo(I),K=H!==void 0?p[H]:void 0,W=K!==void 0&&K.timeline.length===1&&K.timeline[0]?{step:K.timeline[0],run:K.run}:void 0,U=W!==void 0,L=!U&&H!==void 0&&d.has(H),Q=W?W.step:I,B=W?W.run:O,q=W?W.step.name:H!==void 0?(K==null?void 0:K.run.workflow)??ak(H,I.runId):uk(I),Z=Q.status==="failed";w.push({id:V,type:"step",draggable:!1,position:{x:_,y:F},data:{seq:Q.seq,name:q,kind:Q.kind,status:Q.status,workerGroup:Q.workerGroup,attempts:Q.attempts,duration:a(Q.startedAt,Q.finishedAt),subs:Z3(Q),selected:o===`${Q.runId}#${Q.seq}`,childRunId:H,onOpenRun:l,childExpanded:L,onToggleChild:u,collapsed:U,depth:T,step:Q,laneRun:B}});const Y=L?K:void 0;if(Y){const G=j(Y.timeline,Y.fans??sw,T+1,_+248,F+150,`${H}:`,Y.run);for(const te of G.firstIds)E.push(C(V,te));const X=q3(I.name)&&G.connectors.length>0?G.connectors:[{id:V,failed:Z}];return{id:V,exits:X,nextX:Math.max(_+248,G.nextX),bottomY:Math.max(F,G.bottomY)}}return{id:V,exits:[{id:V,failed:Z}],nextX:_+248,bottomY:F}}function j(I,_,F,T,M,O,V){let H=T;const K=[];let W=[],U=M;for(const L of dk(I,_)){if(L.kind==="summary"){const G=`${O}fan:${L.fan.group}`;w.push({id:G,type:"fan",draggable:!1,position:{x:H,y:M},data:{fan:L.fan,runFinished:zp(V.status),depth:F}}),K.length===0&&K.push(G);for(const X of W)E.push(k(X.id,G,X.failed));W=[{id:G,failed:n0(L.fan,zp(V.status))==="failed"}],H+=248;continue}const Q=L.kind==="single"?[L.step]:L.steps,B=K.length===0,q=[];let Z=M,Y=H;for(const G of Q){const X=P(G,H,Z,F,O,V);B&&K.push(X.id);for(const te of W)E.push(k(te.id,X.id,te.failed));q.push(...X.exits),Y=Math.max(Y,X.nextX),Z=X.bottomY+96}W=q,H=Y,U=Math.max(U,Z-96)}return{firstIds:K,connectors:W,nextX:H,bottomY:U}}const A=248;w.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:t.workflow}});const D=j(n,r,0,A,0,"",t);for(const I of D.firstIds)E.push({id:`start->${I}`,source:"start",target:I});const z=s??qI(t,n);w.push({id:"end",type:"terminal",position:{x:Math.max(D.nextX,A),y:0},draggable:!1,data:{status:z,label:z}});const R=D.connectors.length>0?D.connectors:[{id:"start",failed:!1}];for(const I of R)E.push({id:`${I.id}->end`,source:I.id,target:"end",animated:N,style:{stroke:N?"var(--live)":"var(--line)",strokeWidth:N?2:1.5}});return{nodes:w,edges:E}},[t,n,r,s,o,l,a,d,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 h.jsxs(w3,{nodes:x,edges:v,nodeTypes:X3,onNodeClick:b,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,onlyRenderVisibleElements:!0,children:[h.jsx(C3,{variant:Tr.Dots,gap:22,size:1,color:"#1c1c22"}),h.jsx(_3,{showInteractive:!1,position:"bottom-right"})]})});function e4(e){return!e.hasMore||e.loading||e.requestedAtCount===e.loadedCount?!1:e.lastRenderedIndex>=e.loadedCount-1-e.loadAhead}function Kc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Rc(e){const n=(Kc(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/);return(n==null?void 0:n[1])||void 0}function t4(e,t){var n;return((n=e[t])==null?void 0:n.id)??t}function n4(e){return JSON.stringify([e.status,e.tag,e.attrs,e.namespace,e.origin])}const rN=S.createContext(void 0);function bo(e){const t=S.useContext(rN);if(!e&&t===void 0)throw new Error(nn(27));return t}const r4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=bo(),c=a.useState("open"),u=a.useState("nested"),d=a.useState("mounted"),f=a.useState("transitionStatus");return Ut("div",t,{state:{open:c,transitionStatus:f},ref:[a.context.backdropRef,n],stateAttributesMapping:wg,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),s4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=bo(),u=c.useState("open"),{getButtonProps:d,buttonRef:f}=Qg({disabled:i,native:l}),p={disabled:i};function x(v){u&&c.setOpen(!1,De(WS,v.nativeEvent))}return Ut("button",t,{state:p,ref:[n,f],props:[{onClick:x},a,d]})}),o4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=bo(),c=Vi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),Ut("p",t,{ref:n,props:[{id:c},l]})}),sN=S.createContext(void 0);function i4(){const e=S.useContext(sN);if(e===void 0)throw new Error(nn(26));return e}const l4="--nested-dialogs",a4="data-nested-dialog-open",c4={...vg,...yg,nestedDialogOpen(e){return e?{[a4]:""}:null}},u4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=bo(),u=c.useState("descriptionElementId"),d=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),p=c.useState("popupProps"),x=c.useState("modal"),v=c.useState("mounted"),b=c.useState("nested"),g=c.useState("nestedOpenDialogCount"),m=c.useState("open"),y=c.useState("openMethod"),w=c.useState("titleElementId"),E=c.useState("transitionStatus"),N=c.useState("role"),k=f.useState("floatingId");i4(),Ra({open:m,ref:c.context.popupRef,onComplete(){var z,R;m&&((R=(z=c.context).onOpenChangeComplete)==null||R.call(z,!0))}});const C=l===void 0?FE(c.context.popupRef):l,P=g>0,j=c.useStateSetter("popupElement"),D=Ut("div",t,{state:{open:m,nested:b,transitionStatus:E,nestedDialogOpen:P},props:[p,{id:k,"aria-labelledby":w,"aria-describedby":u,role:N,...zg,hidden:!v,onKeyDown(z){Jg.has(z.key)&&z.stopPropagation()},style:{[l4]:g}},a],ref:[n,c.context.popupRef,j],stateAttributesMapping:c4});return h.jsx(SE,{context:f,openInteractionType:y,disabled:!v,closeOnFocusOut:!d,initialFocus:C,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:D})}),d4=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=bo(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?h.jsx(sN.Provider,{value:r,children:h.jsxs(yE,{ref:n,...s,children:[i&&l===!0&&h.jsx(nk,{ref:o.context.internalBackdropRef,inert:Xg(!a)}),t.children]})}):null});function f4({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,d]=S.useState(0),f=a===0,p=Mg(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(x){if(!e.context.outsidePressEnabledRef.current||"button"in x&&x.button!==0)return!1;if("touches"in x){if(x.type==="touchend"){if(x.changedTouches.length!==1||x.touches.length!==0)return!1}else if(x.touches.length!==1)return!1}const v=At(x);if(f&&!s){if(o){const b=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return b||g?b===v||g===v||ye(v,i)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:f});return sk(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(x,v)=>{c(x),d(v)}),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]),Bg(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const h4={...qg,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 p4 extends jd{constructor(n,r,s){const o=new Vg,i=m4(n,o,r,s);super(i,g4(o),h4);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(Fg(this.state,n,r.trigger)))})}}function m4(e,t,n,r=!1){return{...Wg(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 g4(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function x4(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:d,defaultTriggerId:f=null}=t,p=e==="drawer",x=a,v=l,b="dialog",g=bo(!0),m=g!=null,y={modal:x,disablePointerDismissal:v,nested:m,role:b},w=Dg((j,A)=>new p4({open:s,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},j,A),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",d),w.useSyncedValues(y),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const E=w.useState("open"),N=w.useState("mounted"),k=w.useState("payload");BE(w,E),Lg(w);const{forceUnmount:C}=Hg(E,w);S.useImperativeHandle(c,()=>({unmount:C,close:()=>w.setOpen(!1,De(bg))}),[C,w]);const P=E||N;return h.jsxs(rN.Provider,{value:w,children:[u&&h.jsx($g,{handle:u,store:w}),P&&h.jsx(f4,{store:w,parentContext:g==null?void 0:g.context,isDrawer:p}),typeof n=="function"?n({payload:k}):n]})}const y4=gd(function(t){return x4("dialog",t)}),v4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=bo(),c=Vi(i);return a.useSyncedValueWithCleanup("titleElementId",c),Ut("h2",t,{ref:n,props:[{id:c},l]})}),w4=y4,b4=s4;function ow({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return h.jsx(w4,{open:e,onOpenChange:t,children:h.jsxs(d4,{children:[h.jsx(r4,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),h.jsxs(u4,{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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx(v4,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&h.jsx(o4,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),h.jsx(b4,{render:h.jsx(Se,{variant:"quiet",size:"icon","aria-label":"Close",children:h.jsx(bs,{})})})]}),h.jsx("div",{className:"px-5 py-4",children:o}),s&&h.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}function S4({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 oN=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function E4(){return S.useContext(oN)}function iN(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=me(s),[,i]=S.useState(!1),l=Tn(C4).current,a=Tn(k4).current,c=S.useRef(0),u=S.useRef(!0),d=S.useRef(null),f=S.useRef(null),p=me(()=>{u.current||(u.current=!0,i(E=>!E))}),x=me((E,N)=>{a.set(E,N),p()}),v=me(E=>{a.delete(E),p()}),b=me(E=>{const N=new Map;return n.current.length=0,r&&(r.current.length=0),E.forEach(k=>{var C,P;N.set(k.element,{...k.registration.metadata??{},index:k.index}),n.current[k.index]=k.element,r&&(r.current[k.index]=k.registration.label!==void 0?k.registration.label:((P=(C=k.registration.textRef)==null?void 0:C.current)==null?void 0:P.textContent)??k.element.textContent)}),c.current=n.current.length,N});function g(E){var C;if((C=f.current)==null||C.disconnect(),f.current=null,typeof MutationObserver!="function"||E.length<2)return;const N=new MutationObserver(P=>{if(!T4(P))return;let j=null;for(const A of E)if(A.isConnected){if(j&&lN(j,A)>0){N.disconnect(),p();return}j=A}});f.current=N;const k=new Set;for(let P=1;P<E.length;P+=1){const j=R4(E[P-1],E[P]);j&&k.add(j)}k.forEach(P=>N.observe(P,{childList:!0}))}const m=me(()=>{const[E,N]=N4(a),k=b(E),C=d.current,P=!C||C.length!==E.length||E.some((j,A)=>{const D=C[A];return j.index!==D.index||j.element!==D.element||j.registration.index!==D.registration.index||j.registration.metadata!==D.registration.metadata});g(N),d.current=E,u.current=!1,P&&(l.forEach(j=>j(k)),o(k))});fe(()=>(!u.current&&d.current&&b(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),fe(()=>{u.current&&m()}),fe(()=>()=>{var E;(E=f.current)==null||E.disconnect(),u.current=!0},[]);const y=me(E=>(l.add(E),()=>{l.delete(E)})),w=S.useMemo(()=>({register:x,unregister:v,subscribeMapChange:y,nextIndexRef:c}),[x,v,y,c]);return h.jsx(oN.Provider,{value:w,children:t})}function k4(){return new Map}function C4(){return new Set}function N4(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)=>lN(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 R4(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function T4(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 lN(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const aN=S.createContext(void 0);function b0(){const e=S.useContext(aN);if(e===void 0)throw new Error(nn(64));return e}const P4="data-activation-direction",Yd={tabActivationDirection:e=>({[P4]:e})},I4=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,d=t.defaultValue!==void 0,f=S.useRef([]),[p,x]=S.useState(()=>new Map),[v,b]=S4({controlled:a,default:s,name:"Tabs",state:"value"}),g=a!==void 0,[m,y]=S.useState(()=>new Map),w=S.useRef(void 0),E=S.useCallback(B=>em(m,B),[m]),[N,k]=S.useState(()=>({previousValue:v,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:P}=N;let j=P,A=!1;C!==v&&(j=iw(C,v,i,m),A=C!=null&&v!=null&&E(v)==null);const D=A?C:v,z=C!==D||P!==j;fe(()=>{z&&k({previousValue:D,tabActivationDirection:j})},[D,z,j]);const R=me((B,q)=>{const Z=iw(v,B,i,m);q.activationDirection=Z,o==null||o(B,q),!q.isCanceled&&b(B)}),I=me((B,q)=>{o==null||o(B,De(q,void 0,void 0,{activationDirection:"none"}))}),_=me((B,q)=>(x(Z=>{const Y=new Map(Z);return Y.set(B,q),Y}),()=>{x(Z=>{if(Z.get(B)!==q)return Z;const Y=new Map(Z);return Y.delete(B),Y})})),F=S.useCallback(B=>p.get(B),[p]),T=S.useCallback(B=>{for(const q of m.values())if(B===q.value)return q.id},[m]),M=S.useMemo(()=>({getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:F,onValueChange:R,orientation:i,registerMountedTabPanel:_,setTabMap:y,tabActivationDirection:j,value:v}),[E,T,F,R,i,_,y,j,v]),O=S.useMemo(()=>{for(const B of m.values())if(B.value===v)return B},[m,v]),V=S.useMemo(()=>{for(const B of m.values())if(!B.disabled)return B.value},[m]),H=S.useRef(!d),K=S.useRef(s),W=S.useRef(d),U=S.useRef(!1);fe(()=>{var G;if(g)return;function B(X,te){b(X),k({previousValue:X,tabActivationDirection:"none"}),I(X,te),H.current=!1}if(m.size===0){U.current&&v!==null&&!((G=w.current)!=null&&G.isConnected)&&B(null,cy);return}U.current=!0,w.current=m.keys().next().value;const q=O==null?void 0:O.disabled,Z=O==null&&v!==null;if(!q&&v===K.current&&(W.current=!1),W.current&&q&&v===K.current)return;const Y=H.current;if(q||Z){const X=V??null;if(v===X){H.current=!1;return}let te=cy;Y?te=uy:q&&(te=US),B(X,te);return}Y&&O!=null&&(I(v,uy),H.current=!1)},[V,g,I,O,b,m,v]);const Q=Ut("div",t,{state:{orientation:i,tabActivationDirection:j},ref:n,props:u,stateAttributesMapping:Yd});return h.jsx(aN.Provider,{value:M,children:h.jsx(iN,{elementsRef:f,children:Q})})});function em(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function iw(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=em(r,e),a=em(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 S0="data-composite-item-active";function cN(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=E4(),u=S.useRef(-1),[d,f]=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??d,x=S.useRef(null),v=S.useCallback(b=>{const g=x.current;g&&l(g),x.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=x.current?(m=b.get(x.current))==null?void 0:m.index:null;g!=null&&f(g)})},[o,a]),{ref:v,index:p}}function j4(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Gg(),{ref:s,index:o}=cN(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 d=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!d&&u.focus()}},compositeRef:a,index:o}}const uN=S.createContext(void 0);function _4(){const e=S.useContext(uN);if(e===void 0)throw new Error(nn(65));return e}const O4=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:d,getTabPanelIdByValue:f,onValueChange:p,orientation:x,tabActivationDirection:v}=b0(),{activateOnFocus:b,registerTabResizeObserverElement:g,tabsListElement:m}=_4(),{highlightedIndex:y,onHighlightedIndexChange:w}=Gg(),E=Vi(l),N=S.useMemo(()=>({disabled:s,id:E,value:i}),[s,E,i]),{compositeProps:k,compositeRef:C,index:P}=j4({metadata:N}),j=i===d,A=S.useRef(!1),D=S.useRef(null),z=me(U=>{var L;(L=D.current)==null||L.call(D),D.current=U?g(U):null});fe(()=>{if(A.current){A.current=!1;return}if(!(j&&P>-1&&y!==P))return;const U=m;if(U!=null){const L=yn(Le(U));if(L&&ye(U,L))return}s||w(P)},[j,P,y,w,s,m]);const{getButtonProps:R,buttonRef:I}=Qg({disabled:s,native:a,focusableWhenDisabled:!0}),_=f(i),F=S.useRef(!1),T=S.useRef(!1);function M(U){p(i,De(Ed,U.nativeEvent,void 0,{activationDirection:"none"}))}function O(U){j||s||M(U)}function V(U){j||s||b&&(!F.current||T.current)&&M(U)}function H(U){if(j||s)return;F.current=!0,T.current=U.button===0;const L=Le(U.currentTarget);function Q(){F.current=!1,T.current=!1,L.removeEventListener("pointerup",Q),L.removeEventListener("pointercancel",Q)}L.addEventListener("pointerup",Q),L.addEventListener("pointercancel",Q)}return Ut("button",t,{state:{disabled:s,active:j,orientation:x,tabActivationDirection:v},ref:[n,I,C,z],props:[k,{role:"tab","aria-controls":_,"aria-selected":j,id:E,onClick:O,onFocus:V,onPointerDown:H,[S0]:j?"":void 0,onKeyDownCapture(){A.current=!0}},u,R],stateAttributesMapping:Yd})}),M4="data-index",A4={...Yd,...yg},z4=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=b0(),x=Vi(),{ref:v,index:b}=cN(),g=s===c,{mounted:m,transitionStatus:y,setMounted:w}=DE(g),E=!m,N=u(s),k={hidden:E,orientation:d,tabActivationDirection:f,transitionStatus:y},C=S.useRef(null),P=Ut("div",t,{state:k,ref:[n,v,C],props:[{"aria-labelledby":N,hidden:E,id:x,role:"tabpanel",tabIndex:g?0:-1,inert:Xg(!g),[M4]:b},a],stateAttributesMapping:A4});return Ra({open:g,ref:C,onComplete(){g||w(!1)}}),fe(()=>{if(!(x==null||E&&!i))return p(s,x)},[E,i,s,x,p]),i||m?P:null});function D4(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function $4(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:d,modifierKeys:f=Yl}=e,[p,x]=S.useState(0),v=r!=null,b=S.useRef(null),g=Ni(b,a),m=S.useRef([]),y=S.useRef(!1),w=S.useRef(null),E=i??p,N=me((A,D=!1)=>{if(w.current=m.current[A]??null,(l??x)(A),D){const z=m.current[A];qy(b.current,z,o,n)}}),k=me(A=>{var I;if(A.size===0)return;if(y.current){const _=m.current,F=_.indexOf(w.current);if(F===-1){const T=_[E];!T||Rl(_,E,d)?N(F4(_,d)):w.current=T}else F!==E&&N(F);return}y.current=!0;const D=Array.from(A.keys()),z=D.find(_=>_==null?void 0:_.hasAttribute(S0))??null,R=z?((I=A.get(z))==null?void 0:I.index)??-1:-1;if(R!==-1)N(R);else if(Rl(D,E,d)){const _=Nl(D,{disabledIndices:d});Af(D,_)||N(_)}qy(b.current,z,o,n)});fe(()=>{if(d==null||i!=null||!y.current)return;const A=m.current;if(Rl(A,E,d)){const D=Nl(A,{disabledIndices:d});Af(A,D)||N(D)}},[d,i,E,m,N]);const C=me((A,D,z)=>s?s(A,D,z,m):z),P=me(A=>{const D=A.key===Op||A.key===Mp;if(!Jg.has(A.key)||!c&&D||L4(A,f)||!b.current)return;const R=o==="rtl",I=R?jp:_p,_=R?_p:jp,F=n==="vertical"?Ip:I,T=n==="vertical"?Pp:_,M=At(A.nativeEvent);if(M!=null&&Uy(M)&&!D4(M)){const U=M.selectionStart,L=M.selectionEnd,Q=M.value;if(U==null||A.shiftKey||U!==L||A.key!==T&&U<Q.length||A.key!==F&&U>0)return}let O=E;const V=sO(m,d),H=oO(m,d);r!=null&&(O=r({disabledIndices:d,elementsRef:m,event:A,highlightedIndex:E,loopFocus:t,maxIndex:H,minIndex:V,onLoop:C,orientation:n,rtl:R}));const K=n!=="vertical"&&A.key===I||n!=="horizontal"&&A.key===Ip,W=n!=="vertical"&&A.key===_||n!=="horizontal"&&A.key===Pp;c&&(A.key===Op?O=V:A.key===Mp&&(O=H)),O===E&&(K||W)&&(t&&O===H&&K?(O=V,s&&(O=s(A,E,O,m))):t&&O===V&&W?(O=H,s&&(O=s(A,E,O,m))):O=Nl(m.current,{startingIndex:O,decrement:W,disabledIndices:d})),O!==E&&!Af(m.current,O)&&(u&&A.stopPropagation(),(v||D||K||W)&&A.preventDefault(),N(O,!0),queueMicrotask(()=>{var U;(U=m.current[O])==null||U.focus()}))});return{props:{ref:g,onFocus(A){const D=b.current,z=At(A.nativeEvent);!D||z==null||!Uy(z)||z.setSelectionRange(0,z.value.length)},onKeyDown:P},highlightedIndex:E,onHighlightedIndexChange:N,elementsRef:m,onMapChange:k,relayKeyboardEvent:P}}function F4(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const s=e[r];if(!(!s||Rl(e,r,t))){if(s.hasAttribute(S0))return r;n===-1&&(n=r)}}return Math.max(n,0)}function L4(e,t){for(const n of JM)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function H4(e){const{render:t,className:n,style:r,refs:s=Yl,props:o=Yl,state:i=Et,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:x,onMapChange:v,stopEventPropagation:b=!0,rootRef:g,disabledIndices:m,modifierKeys:y,highlightItemOnHover:w=!1,tag:E="div",...N}=e,k=JE(),{props:C,highlightedIndex:P,onHighlightedIndexChange:j,elementsRef:A,onMapChange:D,relayKeyboardEvent:z}=$4({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:g,stopEventPropagation:b,enableHomeAndEndKeys:x,direction:k,disabledIndices:m,modifierKeys:y}),R=Ut(E,e,{state:i,ref:s,props:[C,...o,N],stateAttributesMapping:l}),I=S.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:j,highlightItemOnHover:w,relayKeyboardEvent:z}),[P,j,w,z]);return h.jsx(QE.Provider,{value:I,children:h.jsx(iN,{elementsRef:A,onMapChange:_=>{v==null||v(_),D(_)},children:R})})}const B4=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:d}=b0(),[f,p]=S.useState(0),[x,v]=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,x&&C.observe(x),g.current.forEach(P=>{C.observe(P)}),()=>{C.disconnect(),m.current=null}},[x]);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 j;g.current.delete(C),(j=m.current)==null||j.unobserve(C)}}),E={orientation:c,tabActivationDirection:d},N={"aria-orientation":c==="vertical"?"vertical":void 0,role:"tablist"},k=S.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:w,tabsListElement:x}),[r,y,w,x]);return h.jsx(uN.Provider,{value:k,children:h.jsx(H4,{render:i,className:s,style:l,state:E,refs:[n,v],props:[N,a],stateAttributesMapping:Yd,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:Yl})})}),V4=I4,dN=S.forwardRef(({className:e,...t},n)=>h.jsx(B4,{ref:n,className:st("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));dN.displayName="TabsList";const fN=S.forwardRef(({className:e,...t},n)=>h.jsx(O4,{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}));fN.displayName="TabsTab";const Yc=S.forwardRef(({className:e,...t},n)=>h.jsx(z4,{ref:n,className:st("focus-visible:outline-none",e),...t}));Yc.displayName="TabsPanel";const hN=S.createContext(void 0);function Gd(e){const t=S.useContext(hN);if(t===void 0&&!e)throw new Error(nn(72));return t}const W4={...qg,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 U4 extends jd{constructor(n,r,s){const o=new Vg;super(q4(n,o,r,s),K4(o),W4);ge(this,"setOpen",(n,r)=>{lM(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,De(Es,n))}}function q4(e,t,n,r=!1){return{...Wg(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 K4(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Y4=gd(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:d,defaultTriggerId:f=null,children:p}=t,x=Dg((A,D)=>new U4({open:r,openProp:s,activeTriggerId:f,triggerIdProp:d},A,D));x.useControlledProp("openProp",s),x.useControlledProp("triggerIdProp",d),x.useContextCallback("onOpenChange",a),x.useContextCallback("onOpenChangeComplete",c);const v=x.useState("open"),b=!n&&v,g=x.useState("activeTriggerId"),m=x.useState("mounted"),y=x.useState("payload");x.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),Lg(x,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:E}=Hg(b,x),N=x.useState("isInstantPhase"),k=x.useState("instantType"),C=x.useState("lastOpenChangeReason"),P=S.useRef(null);fe(()=>{v&&n&&x.setOpen(!1,De(US))},[v,n,x]),fe(()=>{E==="ending"&&C===Ed||E!=="ending"&&N?(k!=="delay"&&(P.current=k),x.set("instantType","delay")):P.current!==null&&(x.set("instantType",P.current),P.current=null)},[E,N,C,k,x]),fe(()=>{b&&g==null&&x.set("payload",void 0)},[x,g,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>x.setOpen(!1,De(bg))}),[w,x]);const j=b||m||!n&&i!=="none";return h.jsxs(hN.Provider,{value:x,children:[u&&h.jsx($g,{handle:u,store:x}),j&&h.jsx(G4,{store:x,disabled:n,trackCursorAxis:i}),typeof p=="function"?p({payload:y}):p]})});function G4({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Mg(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=UO(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>Nd(o.reference,s.reference),[o.reference,s.reference]);return Bg(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??Et}),null}const pN=S.createContext(void 0);function Q4(){return S.useContext(pN)}const X4=600,mN="data-base-ui-tooltip-trigger";function lw(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 Z4(e){let t=e;for(;t;){const n=t.closest(`[${mN}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ce(r.host)?r.host:null}return null}const J4=_S(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...p}=t,x=Gd(!0),b=WE(i)??x;if(!b)throw new Error(nn(82));const g=Vi(f),m=b.useState("isTriggerActive",g),y=b.useState("isOpenedByTrigger",g),w=b.useState("floatingRootContext"),E=S.useRef(null),N=d??0,{registerTrigger:k,isMountedByThisTrigger:C}=HE(g,E,b,{payload:l,closeOnClick:u,closeDelay:N}),P=Q4(),{activeIdRef:j,delayRef:A,isInstantPhase:D,hasProvider:z}=F_(w,{open:y}),R=Yg(w);b.useSyncedValue("isInstantPhase",D);const I=b.useState("disabled"),_=a??I,F=Ht(_),T=b.useState("trackCursorAxis"),M=b.useState("disableHoverablePopup"),O=S.useRef(!1),V=Or(),H=S.useRef(void 0);function K(){return z&&j.current!=null?0:c??P??X4}function W(X){const te=E.current;if(!te||!X)return!1;const he=Z4(X);return he!==null&&he!==te&&ye(te,he)}function U(X){const te=W(X);return O.current=te,te&&(R.openChangeTimeout.clear(),R.restTimeout.clear(),R.restTimeoutPending=!1,V.clear()),te}const L=KE(w,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!M&&T!=="both"?YE():null,restMs:K,delay(){return d==null&&z?{close:ao(A.current,"close")}:{close:N}},triggerElementRef:E,isActiveTrigger:m,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!O.current}}),Q=dM(w,{enabled:!_}).reference,B=X=>{const te=O.current,he=lw(X),Pe=U(he),ce=E.current,ve=ce&&he&&ye(ce,he);if(Pe&&b.select("open")&&b.select("lastOpenChangeReason")===St){b.setOpen(!1,De(St,X));return}if(te&&!Pe&&ve&&!F.current&&!b.select("open")&&ce&&xs(H.current)){const de=()=>{!O.current&&!F.current&&!b.select("open")&&b.setOpen(!0,De(St,X,ce))},xe=K();xe===0?(V.clear(),de()):V.start(xe,de)}},q=b.useState("triggerProps",C);return Ut("button",t,{state:{open:y},ref:[n,k,E],props:[L,Q,C||T!=="none"?q:void 0,{onMouseOver(X){B(X.nativeEvent)},onFocus(X){W(lw(X.nativeEvent))&&X.preventBaseUIHandler()},onMouseLeave(){O.current=!1,V.clear(),H.current=void 0},onPointerEnter(X){H.current=X.pointerType},onPointerDown(X){H.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,[kp]:_?"":void 0,[mN]:_?void 0:""},p],stateAttributesMapping:HS})}),gN=S.createContext(void 0);function e6(){const e=S.useContext(gN);if(e===void 0)throw new Error(nn(70));return e}const t6=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=xE({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:h.jsxs(S.Fragment,{children:[u,c&&dn.createPortal(r,c)]})}),n6=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Gd().useState("mounted")||r?h.jsx(gN.Provider,{value:r,children:h.jsx(t6,{ref:n,...s})}):null}),xN=S.createContext(void 0);function r6(){const e=S.useContext(xN);if(e===void 0)throw new Error(nn(71));return e}const s6=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:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:v=!1,collisionAvoidance:b=pE,style:g,...m}=t,y=Gd(),w=e6(),E=y.useState("open"),N=y.useState("mounted"),k=y.useState("trackCursorAxis"),C=y.useState("disableHoverablePopup"),P=y.useState("floatingRootContext"),j=y.useState("instantType"),A=y.useState("transitionStatus"),D=y.useState("adaptiveOrigin"),z=tk({anchor:o,positionMethod:i,floatingRootContext:P,mounted:N,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:x,arrowPadding:p,disableAnchorTracking:v,keepMounted:w,collisionAvoidance:b,adaptiveOrigin:D}),R=S.useMemo(()=>({open:E,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:k!=="none"?"tracking-cursor":j}),[E,z.side,z.align,z.anchorHidden,k,j]),I=rk(t,R,{styles:z.positionerStyles,transitionStatus:A,props:m,refs:[n,y.useStateSetter("positionerElement")],hidden:!N,inert:!E||k==="both"||C});return h.jsx(xN.Provider,{value:z,children:I})}),o6=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Gd(),{side:a,align:c}=r6(),u=l.useState("open"),d=l.useState("instantType"),f=l.useState("transitionStatus"),p=l.useState("popupProps"),x=l.useState("floatingRootContext"),v=l.useState("disabled"),b=l.useState("closeDelay");Ra({open:u,ref:l.context.popupRef,onComplete(){var w,E;u&&((E=(w=l.context).onOpenChangeComplete)==null||E.call(w,!0))}}),qE(x,{enabled:!v,closeDelay:b});const g=l.useStateSetter("popupElement");return Ut("div",t,{state:{open:u,side:a,align:c,instant:d,transitionStatus:f},ref:[n,l.context.popupRef,g],props:[zg,p,Zg(f),i],stateAttributesMapping:wg})}),i6=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(pN.Provider,{value:n,children:h.jsx($_,{delay:o,timeoutMs:s,children:t.children})})};function l6({children:e,...t}){return h.jsx(i6,{delay:150,closeDelay:80,...t,children:e})}const a6=Y4,c6=J4,u6="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 Xu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return h.jsxs(a6,{disabled:t??!1,children:[h.jsx(c6,{render:s}),h.jsx(n6,{children:h.jsx(s6,{side:n,align:r,sideOffset:4,collisionPadding:8,children:h.jsx(o6,{className:st(u6),children:e})})})]})}function yN({className:e}){return h.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:[h.jsx("title",{children:"durable"}),h.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),h.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const d6=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"];function f6(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 h6(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 E0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return h.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function vN({status:e}){return h.jsxs(Xe,{variant:"status",className:`s-${e} text-[11px]`,children:[h.jsx(E0,{status:e}),e]})}function p6({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,u)=>h.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"&&h.jsx(E0,{status:a}),h.jsx("span",{className:"uppercase tracking-wide",children:c}),h.jsx("span",{className:"mono tnum text-zinc-600",children:u})]},a),{data:o}=Zt({queryKey:["topology"],queryFn:()=>Fe.topology(),staleTime:Number.POSITIVE_INFINITY}),i=(o==null?void 0:o.role)==="tenant",l=o?i?o.tenant?`tenant · ${o.tenant}`:"tenant":"control plane":"";return h.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:h.jsx(yN,{className:"h-4 w-4 text-brand"})}),h.jsxs("div",{className:"leading-none",children:[h.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),h.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})]})]}),h.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),d6.map(a=>s(a,a,e[a]??0))]}),h.jsx(x6,{}),!i&&h.jsx(oz,{}),h.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[h.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function m6(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 wN({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return h.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[h.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"}),h.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",h.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&h.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",h.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&h.jsxs("span",{children:["cpu ",h.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&h.jsxs("span",{children:[h.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&h.jsxs("span",{children:["p95 ",h.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&h.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",h.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",m6(e.lastAdjust.at)]})]})}function g6({workers:e}){return h.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>h.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[h.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),h.jsx(wN,{status:t.status})]},t.instanceId))})}function x6(){const{data:e}=Zt({queryKey:["workers"],queryFn:()=>Fe.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=nj(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return h.jsxs(V4,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[h.jsx(dN,{children:["workers","partitions","alerts"].map(o=>h.jsxs(fN,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&h.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),h.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[h.jsx(Yc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(y6,{workers:ej(e)})}),h.jsx(Yc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(v6,{groups:e})}),h.jsx(Yc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(w6,{summary:r})})]})]})}const aw="__overflow__";function cw(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 uw({w:e}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 py-2",children:h.jsx(wN,{status:e.status})}),h.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[h.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>h.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function y6({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===aw;return h.jsxs(h.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,d=cw(c);return h.jsxs(Ii,{open:u,onOpenChange:f=>n(f?c.instanceId:void 0),children:[h.jsx(Xu,{suppressed:u,label:`${c.instanceId}
|
|
63
|
+
${c.handlers.length} handlers · ${c.partition}${d?` · ${d} in-flight`:""}`,children:h.jsx(ji,{render:h.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:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&h.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",d?` · ${d}`:""]})]})})}),h.jsxs(uo,{children:[h.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:[h.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),h.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),h.jsx(uw,{w:c})]})]},c.instanceId)}),l.length>0&&h.jsxs(Ii,{open:a,onOpenChange:c=>{n(c?aw:void 0),s(void 0)},children:[h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",className:st("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),h.jsxs(uo,{children:[h.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"]}),h.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const u=cw(c),d=r===c.instanceId;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>s(d?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",d?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId})]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",u?` · ${u}`:""]})]}),d&&h.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:h.jsx(uw,{w:c})})]},c.instanceId)})})]})]})]})}function v6({groups:e}){const[t,n]=S.useState(void 0),r=XI(e);function s(o){const i=new Map;for(const l of e)if(Su(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return h.jsx(h.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return h.jsxs(Ii,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[h.jsx(Xu,{suppressed:l,label:`${o.partition}
|
|
64
|
+
${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:h.jsx(ji,{render:h.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:[h.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,h.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),h.jsxs(uo,{children:[h.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:[h.jsx("span",{className:"text-zinc-300",children:o.partition}),h.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),h.jsx(g6,{workers:s(o.partition)})]})]},o.partition)})})}function w6({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return h.jsxs(h.Fragment,{children:[h.jsx(Xu,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
|
|
65
|
+
${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:h.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?h.jsx("span",{className:"text-good",children:"all draining"}):h.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>h.jsx(Xu,{label:`${n.group}
|
|
66
|
+
${n.depth} queued, no worker consuming`,children:h.jsxs(Xe,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[h.jsx("span",{className:"dot s-failed","aria-hidden":!0}),h.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),h.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function b6(){return h.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>h.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),h.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),h.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}const S6=S.memo(function({run:t,siblings:n,health:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a}){const c=uS(t,{runs:n,health:r}),u=t.namespace&&t.namespace!=="default"?t.namespace:void 0,d=Hi(t.origin);return h.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:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:t.workflow}),u&&h.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:f=>{f.stopPropagation(),l(u)},children:u}),d&&h.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 ${d} — click to show only this library's runs`,onClick:f=>{f.stopPropagation(),a({kind:"origin",origin:d})},children:ka(d)}),t.id.startsWith("dlq:")&&h.jsx(Xe,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),h.jsx(vN,{status:c.status})]}),c.detail&&h.jsx("div",{className:`mono truncate text-[11px] s-${c.status}`,children:c.detail}),h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:t.id}),h.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:f6(t.updatedAt)})]}),t.tags&&t.tags.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:t.tags.map(f=>h.jsxs("span",{onClick:p=>{p.stopPropagation(),i(f)},className:st(jS({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",f]},f))})]})}),E6=86,k6=12;function C6({runs:e,siblings:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,total:c,onLoadMore:u,loadingMore:d,emptyNotice:f}){var w;const p=S.useRef(null),x=S.useCallback(E=>t4(e,E),[e]),v=sg({count:e.length,getScrollElement:()=>p.current,estimateSize:()=>E6,getItemKey:x,measureElement:E=>E.getBoundingClientRect().height,overscan:8}),b=v.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(()=>{e4({hasMore:g,loading:!!d,lastRenderedIndex:m,loadedCount:e.length,requestedAtCount:y.current,loadAhead:k6})&&(y.current=e.length,u())},[g,d,m,e.length,u]),r&&e.length===0?h.jsx(b6,{}):e.length===0?h.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[h.jsx("span",{children:f.message}),f.unclassified!==void 0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-[11px] text-zinc-500",children:[f.unclassified," run",f.unclassified===1?"":"s"," here"," ",f.unclassified===1?"is":"are"," the app's own (no package origin), so no package filter can match ",f.unclassified===1?"it":"them","."]}),h.jsx(Se,{variant:"chip",size:"xs",className:"mono rounded",title:ig,onClick:()=>a({kind:"unknown"}),children:"show app runs"})]})]}):h.jsxs("div",{ref:p,className:"min-h-0 flex-1 overflow-auto",children:[h.jsx("ul",{className:"relative",style:{height:v.getTotalSize()},children:b.map(E=>{const N=e[E.index];return N?h.jsx("li",{"data-index":E.index,ref:v.measureElement,className:"absolute left-0 top-0 w-full border-b border-line-soft",style:{transform:`translateY(${E.start}px)`},children:h.jsx(S6,{run:N,siblings:t,health:n,selected:s===N.id,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},N.id):null})}),h.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2","aria-live":"polite","aria-busy":g&&d,children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-600",children:[e.length," of ",c]}),g&&h.jsx("span",{className:"mono ml-auto text-[10px] text-zinc-600",children:d?"loading…":"scroll for more"})]})]})}function N6({compensations:e,selKey:t,onSelect:n}){return h.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[h.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),h.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return h.jsx("li",{children:h.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:[h.jsx(E0,{status:r.status}),h.jsx("span",{className:"truncate text-amber-100",children:DI(r.name)}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}const R6=[],T6=S.memo(function({id:t,onOpenRun:n}){const r=po(),{data:s}=Zt({queryKey:["run",t],queryFn:async()=>ZI(r.getQueryData(["run",t]),await Fe.run(t)),refetchInterval:se=>{var Ae;const Re=(Ae=se.state.data)==null?void 0:Ae.run.status;return Re==="running"||Re==="suspended"?1500:!1}}),{data:o=[]}=Zt({queryKey:["workers"],queryFn:()=>Fe.workers(),refetchInterval:5e3}),i=s==null?void 0:s.run,l=SN(i!==void 0&&bN([i])),a=(s==null?void 0:s.run.status)==="dead"?`dlq:${t}`:void 0,{data:c}=Zt({queryKey:["run",a],queryFn:()=>Fe.run(a),enabled:!!a,retry:!1}),u=()=>{r.invalidateQueries({queryKey:["run",t]}),r.invalidateQueries({queryKey:["runs"]})},d=s==null?void 0:s.run.status,f=d==="running"||d==="suspended",p=S.useRef(f);p.current=f;const[x]=S.useState(()=>new QI),[v,b]=S.useState({});S.useEffect(()=>{const se=rj(()=>r.invalidateQueries({queryKey:["run",t]}),1500),Re=Fe.streamRun(t,Ae=>{var Kt;if(x.push(Ae),Ae.type==="run.trigger_failed"&&Ae.name&&((Kt=Ae.error)!=null&&Kt.message)){const{name:Rt,error:Un}=Ae;b(qn=>({...qn,[Rt]:Un.message}))}if(Ae.type==="step.progress"&&Ae.event&&Ae.seq!=null){const Rt=Ae.seq,Un=Ae.event;r.setQueryData(["run",t],qn=>JI(qn,Rt,Un));return}(p.current||Ae.type==="run.triggered"||Ae.type==="run.trigger_failed")&&se.call()});return()=>{se.cancel(),Re()}},[t,x,r]);const g=pr({mutationFn:()=>Fe.retry(t),onSuccess:u}),m=pr({mutationFn:se=>Fe.cancel(t,se!==void 0?{compensate:se}:{}),onSuccess:u}),y=pr({mutationFn:()=>Fe.continue(t),onSuccess:u}),w=pr({mutationFn:()=>Fe.redispatch(t),onSuccess:u}),[E,N]=S.useState(!1),k=pr({mutationFn:()=>Fe.republishLifecycle(t),onSuccess:u}),C=pr({mutationFn:se=>Fe.republishLifecycle(t,se),onSuccess:u}),P=pr({mutationFn:se=>Fe.retryWithInput(t,se),onSuccess:se=>{r.invalidateQueries({queryKey:["runs"]}),n(se.runId)}}),[j,A]=S.useState(!1),[D,z]=S.useState(""),[R,I]=S.useState(),_=()=>{z(JSON.stringify((s==null?void 0:s.run.input)??{},null,2)),I(void 0),A(!0)},F=()=>{let se;try{se=JSON.parse(D)}catch(Re){I(Re instanceof Error?Re.message:"Invalid JSON");return}A(!1),P.mutate(se)},[T,M]=S.useState(),[O,V]=S.useState(!1),[H,K]=S.useState(new Set),[W,U]=S.useState(240);function L(se){se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId);const Re=Kt=>U(Rt=>Math.max(120,Math.min(720,Rt-Kt.movementY))),Ae=()=>{window.removeEventListener("pointermove",Re),window.removeEventListener("pointerup",Ae)};window.addEventListener("pointermove",Re),window.addEventListener("pointerup",Ae)}const Q=S.useCallback(se=>{K(Re=>{const Ae=new Set(Re);return Ae.has(se)?Ae.delete(se):Ae.add(se),Ae})},[]),B=S.useCallback((se,Re)=>{M({step:se,run:Re})},[]),q=S.useMemo(()=>$I((s==null?void 0:s.timeline)??[]),[s==null?void 0:s.timeline]),Z=(s==null?void 0:s.fans)??R6;if(!s)return h.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:Y}=s,{body:G,compensations:X}=q,te=Z.reduce((se,Re)=>se+Re.size,G.length),he=G.length>0||Z.length>0,Pe=wA(s.children??[],s.childCount),ce=bA(s),ve=ce.startedBy,de=s.lifecycleSubscribers??[],xe=FI(X),Oe=Y.id.startsWith("dlq:"),Ie=Oe?{id:Y.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${Y.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:c?{id:`dlq:${Y.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,ze=X.length>0?(()=>{const se=xe.failed>0?` ${xe.failed} undo${xe.failed===1?"":"s"} failed after retries — check ${xe.failed===1?"it":"them"} below.`:"";return xe.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${xe.done} of ${xe.total} done).${se}`}:Y.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${se}`}:{title:"Saga compensated",subtitle:`the run failed and its ${xe.total} completed step${xe.total===1?"":"s"} were undone in reverse.${se}`}})():void 0,at=Y.status==="failed"||Y.status==="suspended",et=Y.status==="running"||Y.status==="suspended",ne=Y.status==="suspended"||Y.status==="running",re=G.some(se=>se.status==="pending"&&se.kind==="signal"&&se.name.startsWith("breakpoint")),Me=T?`${T.step.runId}#${T.step.seq}`:void 0,we=uS(Y,{runs:l,health:o,timeline:G}),xt=Y.namespace&&Y.namespace!=="default"?Y.namespace:void 0,qt=Hi(Y.origin);return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:h.jsx("a",{href:Od(Y.workflow),className:"underline-offset-4 hover:underline",title:"Open this workflow's page: who starts when it settles, and who starts it",children:Y.workflow})}),Rc(Y.id)!==void 0&&h.jsx(Se,{variant:"alt",size:"xs",onClick:()=>n(Rc(Y.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Rc(Y.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Kc(Y.id)!==void 0&&h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(Kc(Y.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Kc(Y.id)} — open the original run`,children:"↩ original"}),Oe&&h.jsx(Xe,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),h.jsx(vN,{status:we.status}),we.detail&&h.jsx("span",{className:`mono text-[11px] s-${we.status}`,children:we.detail}),xt&&h.jsx(Xe,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:xt}),qt?h.jsx(Xe,{variant:"origin",className:"mono py-0.5",title:`Declared by ${qt}`,children:ka(qt)}):h.jsxs(Xe,{variant:"origin-unknown",className:"mono py-0.5",title:ig,children:["origin ",md]}),X.length>0&&h.jsx(Xe,{variant:"warn",className:st("mono py-0.5 uppercase tracking-wider",xe.pending>0&&"pulse"),title:xe.pending>0?`compensating: ${xe.done} of ${xe.total} undone`:`${xe.total} step${xe.total===1?"":"s"} compensated`,children:xe.pending>0?"compensating":"compensated"}),h.jsxs(Xe,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",Y.workflowVersion]}),h.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[te," ",te===1?"step":"steps"]})]}),h.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:Y.id}),Y.tags&&Y.tags.length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Y.tags.map(se=>h.jsxs(Xe,{className:"mono",children:["#",se]},se))}),Y.searchAttributes&&Object.keys(Y.searchAttributes).length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(Y.searchAttributes).map(([se,Re])=>h.jsxs(Xe,{variant:"attr",className:"mono",title:"search attribute",children:[se,"=",String(Re)]},se))}),Pe.shown.length>0?h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),Pe.shown.map(se=>h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(se),className:"mono px-1.5 py-0",children:se},se)),Pe.more>0&&h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:["+",Pe.more," more"]})]}):null,ve?h.jsx(JA,{source:ve,onOpenRun:n}):null,h.jsx(ez,{waitsFor:s.waitsFor,awaitedBy:s.awaitedBy,onOpenRun:n}),ce.triggered.length>0?h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"triggered:"}),ce.triggered.map(se=>h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(se),className:"mono px-1.5 py-0",children:se},se))]}):null,s.lifecycleDeliveries?h.jsx(tz,{deliveries:nz(s.lifecycleDeliveries,v),onOpenRun:n,onRepublish:se=>C.mutate(se),republishing:C.isPending}):null,s.workflowLifecycle?h.jsx("div",{className:"mt-3",children:h.jsx(ik,{links:s.workflowLifecycle})}):null,h.jsx(CA,{tail:x,sourceRunId:ve==null?void 0:ve.runId,parentRunId:Rc(Y.id),onOpenRun:n})]}),h.jsxs("div",{className:"flex shrink-0 gap-2",children:[h.jsx(Se,{onClick:()=>V(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),re&&h.jsxs(Se,{variant:"warn",disabled:y.isPending,onClick:()=>y.mutate(),children:[h.jsx(aj,{width:12,height:12}),"Continue"]}),h.jsxs(Se,{variant:"brand",disabled:!at||g.isPending,onClick:()=>g.mutate(),children:[h.jsx(If,{width:12,height:12}),"Retry"]}),ne&&h.jsxs(Se,{variant:"info",disabled:w.isPending,onClick:()=>w.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[h.jsx(ku,{width:12,height:12}),"Re-dispatch"]}),de.length>0&&h.jsxs(Se,{variant:"info",disabled:k.isPending,onClick:()=>{k.reset(),N(!0)},title:"Start the lifecycle-event subscribers that have not started from this run",children:[h.jsx(ku,{width:12,height:12}),"Republish lifecycle event"]}),(Y.status==="dead"||Y.status==="failed")&&h.jsxs(Se,{variant:"alt",disabled:P.isPending,onClick:_,title:"Edit the input and re-run as a fresh linked run",children:[h.jsx(If,{width:12,height:12}),"Fix & replay"]}),et&&h.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:[h.jsx(If,{width:12,height:12}),"Cancel + Undo"]}),h.jsxs(Se,{className:"border-zinc-700",disabled:!et||m.isPending,onClick:()=>m.mutate(!1),children:[h.jsx(bs,{width:12,height:12}),"Cancel"]})]})]}),Ie&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[h.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:"⚠"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:Ie.title}),h.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:Ie.subtitle})]}),h.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})]}),ze&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[h.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:"↺"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:ze.title}),h.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:ze.subtitle})]})]}),h.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:he?`1fr ${W}px`:"1fr"},children:[h.jsxs("div",{className:"relative min-h-0",children:[he?h.jsx(J3,{run:Y,timeline:G,fans:Z,endStatus:we.status,selectedKey:Me,onSelect:B,onOpenRun:n,fmtDuration:h6,expanded:H,onToggleChild:Q}):h.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}),(Y.status==="failed"||Y.status==="cancelled")&&Y.error&&h.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:Y.error.message})]}),he&&h.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[h.jsx("div",{onPointerDown:L,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"}),h.jsx(BA,{run:Y,timeline:G,fans:Z,selectedKey:Me,onSelect:B,onOpenRun:n,expanded:H,onToggleChild:Q})]}),T&&h.jsx(KA,{step:T.step,run:T.run,onClose:()=>M(void 0),onOpenRun:n}),O&&h.jsx(YA,{run:Y,onClose:()=>V(!1)})]}),X.length>0&&h.jsx(N6,{compensations:X,selKey:Me,onSelect:se=>M({step:se,run:Y})}),h.jsxs(ow,{open:E,onOpenChange:N,title:"Republish lifecycle event",subtitle:`publishes ${Y.id}'s ${Y.status==="completed"?"run.completed":"run.failed"} event again`,footer:k.isSuccess||k.isError?h.jsx(Se,{onClick:()=>N(!1),children:"Close"}):h.jsxs(h.Fragment,{children:[h.jsx(Se,{onClick:()=>N(!1),children:"Cancel"}),h.jsx(Se,{variant:"info",disabled:k.isPending,onClick:()=>k.mutate(),children:"Republish"})]}),children:[h.jsxs("p",{className:"text-[12px] text-zinc-400",children:["Subscribers: ",h.jsx("span",{className:"mono text-zinc-300",children:de.join(", ")}),". The ones already started from this run are not started again."]}),k.isSuccess&&h.jsxs("div",{className:"mono mt-3 space-y-1 text-[11.5px] text-zinc-300",children:[h.jsxs("p",{children:["started ",k.data.started," subscriber run",k.data.started===1?"":"s"]}),k.data.failed.map(se=>h.jsxs("p",{className:"rounded border border-bad/25 bg-bad/10 px-2 py-1 text-bad",children:[se.subscriber,": ",se.error]},se.subscriber))]}),k.isError&&h.jsx("p",{className:"mono mt-3 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:k.error instanceof Error?k.error.message:String(k.error)})]}),h.jsxs(ow,{open:j,onOpenChange:A,title:"Fix & replay",subtitle:`re-runs ${Y.id} as a fresh linked run`,footer:h.jsxs(h.Fragment,{children:[h.jsx(Se,{onClick:()=>A(!1),children:"Cancel"}),h.jsx(Se,{variant:"alt",disabled:P.isPending,onClick:F,children:"Replay"})]}),children:[h.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),h.jsx("textarea",{id:"fix-replay-input",value:D,spellCheck:!1,onChange:se=>{z(se.target.value),I(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"}),R&&h.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:R})]})]})});function dw(){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 bN(e){return e.some(t=>{var n;return t.status==="suspended"&&((n=t.tags)==null?void 0:n.some(r=>r.startsWith("singleton:")))})}function SN(e){const{data:t=[]}=Zt({queryKey:["runs","in-flight"],queryFn:()=>Fe.runs(void 0,void 0,void 0,{statuses:cS,limit:500}),enabled:e,refetchInterval:5e3});return t}const P6=100;function M6(){const[e,t]=S.useState("all"),[n,r]=S.useState([]),[s,o]=S.useState([]),[i,l]=S.useState([]),[a,c]=S.useState(lS),[u,d]=S.useState(()=>dw()),[f,p]=S.useState(()=>typeof window>"u"?void 0:Gy(window.location.hash)),x=S.useCallback(q=>{if(d(q),p(void 0),typeof window>"u")return;const Z=q?`#/run/${encodeURIComponent(q)}`:"",Y=Z||window.location.pathname+window.location.search;window.location.hash!==Z&&window.history.pushState(null,"",Y)},[]);S.useEffect(()=>{const q=()=>{d(dw()),p(Gy(window.location.hash))};return window.addEventListener("hashchange",q),window.addEventListener("popstate",q),()=>{window.removeEventListener("hashchange",q),window.removeEventListener("popstate",q)}},[]);const[v,b]=S.useState({key:"",pages:1}),g=po(),m=s,y=m.join("|"),w=a.kind==="origin"?a.origin:a.kind==="unknown"?null:void 0,E=aS(a),N=n4({status:e,tag:n.join("|"),attrs:y,namespace:i.join("|"),origin:E}),k=v.key===N?v.pages:1,C=P6*k,{data:P=[],isPending:j,isFetching:A}=Zt({queryKey:["runs",e,n,y,i,E,C],queryFn:()=>Fe.runs(e==="all"?void 0:e,n,m.length?m:void 0,{namespace:i,origin:w,limit:C}),refetchInterval:3e3,placeholderData:bR}),{data:D=[]}=Zt({queryKey:["run-facets",n,y,i],queryFn:()=>Fe.facets(n,m.length?m:void 0,i),refetchInterval:5e3}),z=a.kind==="unknown"?null:a.kind==="origin"?a.origin:void 0,R=S.useMemo(()=>({namespace:i,attr:s,origin:z}),[i,s,z]),I=S.useMemo(()=>({tag:n,attr:s,origin:z}),[n,s,z]),_=S.useMemo(()=>({tag:n,namespace:i,origin:z}),[n,i,z]),{data:F=[]}=Zt({queryKey:["workers"],queryFn:()=>Fe.workers(),refetchInterval:5e3}),T=pr({mutationFn:q=>Fe.bulk(q,{status:e!=="all"?e:void 0,tag:n,attr:m.length?m:void 0,namespace:i,origin:w}),onSuccess:()=>g.invalidateQueries({queryKey:["runs"]})}),M=S.useMemo(()=>{const q={};for(const Z of D)_I({origin:Z.origin??void 0},a)&&(q[Z.status]=(q[Z.status]??0)+Z.count);return q},[D,a]),O=S.useMemo(()=>AI(D),[D]),V=S.useMemo(()=>e==="all"?Object.values(M).reduce((q,Z)=>q+Z,0):M[e]??0,[M,e]),H=e!=="all"||n.length>0||i.length>0||m.length>0||a.kind!=="all",K=S.useMemo(()=>OI(D),[D]),W=S.useMemo(()=>tj(F),[F]),U=SN(S.useMemo(()=>bN(P),[P])),L=S.useCallback(q=>{r(Z=>Z.includes(q)?Z:[...Z,q])},[]),Q=S.useCallback(q=>{l(Z=>Z.includes(q)?Z:[...Z,q])},[]),B=S.useCallback(()=>{b(q=>({key:N,pages:q.key===N?q.pages+1:2}))},[N]);return h.jsxs(l6,{children:[h.jsx("div",{className:"app-bg"}),h.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[h.jsx(p6,{counts:M,filter:e,onFilter:t}),W.length>0&&h.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:[h.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:h.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),h.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",h.jsx("span",{className:"mono text-amber-100",children:W.join(", ")}),". Start a worker to unblock."]})]}),h.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[h.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[h.jsxs("div",{className:"border-b border-line p-2",children:[h.jsx(Au,{field:"tag",scope:R,glyph:"#",label:"filter by tag",placeholder:"filter by tag…",value:n,onChange:r,title:"Tags carried by a run (WorkflowRun.tags). Several match ANY of them."}),h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:h.jsx(rz,{tags:n,onChange:r})}),h.jsx("div",{className:"mt-1.5",children:h.jsx(Au,{field:"namespace",scope:I,glyph:"@",label:"filter by tenant",placeholder:"filter by tenant / namespace…",value:i,onChange:l,title:"Tenant / worker-pool partition (WorkflowRun.namespace). None selected shows every tenant."})}),h.jsx(pA,{value:s,onChange:o,scope:_})]}),h.jsx(mA,{facets:K,value:a,onChange:c}),H&&V>0&&h.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[V," ",e!=="all"?e:"",n.length>0&&` #${n.join(", ")}`,i.length>0&&` @${i.join(", ")}`,a.kind==="origin"&&` ⬡${ka(a.origin)}`,a.kind==="unknown"&&` ⬡${md}`,m.length>0&&` ⛃${m.length}`]}),h.jsx(Se,{variant:"brand",size:"xs",disabled:T.isPending,onClick:()=>T.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),h.jsx(Se,{variant:"danger",size:"xs",disabled:T.isPending,onClick:()=>T.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),h.jsx(C6,{runs:P,siblings:U,health:F,loading:j,selected:u,onSelect:x,onSelectTag:L,onSelectNamespace:Q,onSelectOrigin:c,total:V,onLoadMore:B,loadingMore:A,emptyNotice:zI({anyFilter:H,origin:a,unknownCount:O})},N)]}),h.jsx("main",{className:"min-h-0",children:u?h.jsx(T6,{id:u,onOpenRun:x},u):f?h.jsx(xA,{workflow:f},f):h.jsx("div",{className:"grid h-full place-items-center text-center",children:h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx(yN,{className:"h-10 w-10 text-zinc-800"}),h.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}export{M6 as A,j6 as Q,s0 as R,O6 as a,GP as c,h as j,S as r};
|