@dudousxd/nestjs-durable-dashboard 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var lf=e=>{throw TypeError(e)};var Sa=(e,t,n)=>t.has(e)||lf("Cannot "+n);var C=(e,t,n)=>(Sa(e,t,"read from private field"),n?n.call(e):t.get(e)),Y=(e,t,n)=>t.has(e)?lf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(Sa(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ee=(e,t,n)=>(Sa(e,t,"access private method"),n);var so=(e,t,n,r)=>({set _(i){V(e,t,i,n)},get _(){return C(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Hp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bp={exports:{}},Al={},Vp={exports:{}},re={};/**
|
|
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 qs=Symbol.for("react.element"),gx=Symbol.for("react.portal"),yx=Symbol.for("react.fragment"),vx=Symbol.for("react.strict_mode"),xx=Symbol.for("react.profiler"),wx=Symbol.for("react.provider"),Sx=Symbol.for("react.context"),kx=Symbol.for("react.forward_ref"),Ex=Symbol.for("react.suspense"),_x=Symbol.for("react.memo"),Nx=Symbol.for("react.lazy"),af=Symbol.iterator;function Cx(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Up={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qp=Object.assign,Wp={};function Pi(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}Pi.prototype.isReactComponent={};Pi.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")};Pi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qp(){}qp.prototype=Pi.prototype;function Rc(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}var $c=Rc.prototype=new qp;$c.constructor=Rc;Qp($c,Pi.prototype);$c.isPureReactComponent=!0;var uf=Array.isArray,Xp=Object.prototype.hasOwnProperty,Oc={current:null},Yp={key:!0,ref:!0,__self:!0,__source:!0};function Kp(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Xp.call(t,r)&&!Yp.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:qs,type:e,key:s,ref:o,props:i,_owner:Oc.current}}function bx(e,t){return{$$typeof:qs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dc(e){return typeof e=="object"&&e!==null&&e.$$typeof===qs}function jx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cf=/\/+/g;function ka(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jx(""+e.key):t.toString(36)}function Ro(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case qs:case gx:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+ka(o,0):r,uf(i)?(n="",e!=null&&(n=e.replace(cf,"$&/")+"/"),Ro(i,t,n,"",function(u){return u})):i!=null&&(Dc(i)&&(i=bx(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(cf,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",uf(e))for(var l=0;l<e.length;l++){s=e[l];var a=r+ka(s,l);o+=Ro(s,t,n,a,i)}else if(a=Cx(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=r+ka(s,l++),o+=Ro(s,t,n,a,i);else if(s==="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 o}function oo(e,t,n){if(e==null)return e;var r=[],i=0;return Ro(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Mx(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 Qe={current:null},$o={transition:null},Px={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:$o,ReactCurrentOwner:Oc};function Gp(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:oo,forEach:function(e,t,n){oo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oo(e,function(){t++}),t},toArray:function(e){return oo(e,function(t){return t})||[]},only:function(e){if(!Dc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Pi;re.Fragment=yx;re.Profiler=xx;re.PureComponent=Rc;re.StrictMode=vx;re.Suspense=Ex;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Px;re.act=Gp;re.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=Qp({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Oc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Xp.call(t,a)&&!Yp.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 u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:qs,type:e.type,key:i,ref:s,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:Sx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:wx,_context:e},e.Consumer=e};re.createElement=Kp;re.createFactory=function(e){var t=Kp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:kx,render:e}};re.isValidElement=Dc;re.lazy=function(e){return{$$typeof:Nx,_payload:{_status:-1,_result:e},_init:Mx}};re.memo=function(e,t){return{$$typeof:_x,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=$o.transition;$o.transition={};try{e()}finally{$o.transition=t}};re.unstable_act=Gp;re.useCallback=function(e,t){return Qe.current.useCallback(e,t)};re.useContext=function(e){return Qe.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};re.useEffect=function(e,t){return Qe.current.useEffect(e,t)};re.useId=function(){return Qe.current.useId()};re.useImperativeHandle=function(e,t,n){return Qe.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Qe.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Qe.current.useReducer(e,t,n)};re.useRef=function(e){return Qe.current.useRef(e)};re.useState=function(e){return Qe.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Qe.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Qe.current.useTransition()};re.version="18.3.1";Vp.exports=re;var R=Vp.exports;const zx=Hp(R);/**
|
|
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 Ix=R,Tx=Symbol.for("react.element"),Rx=Symbol.for("react.fragment"),$x=Object.prototype.hasOwnProperty,Ox=Ix.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Dx={key:!0,ref:!0,__self:!0,__source:!0};function Zp(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)$x.call(t,r)&&!Dx.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Tx,type:e,key:s,ref:o,props:i,_owner:Ox.current}}Al.Fragment=Rx;Al.jsx=Zp;Al.jsxs=Zp;Bp.exports=Al;var p=Bp.exports,Cr=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(){}},yr=typeof window>"u"||"Deno"in globalThis;function pt(){}function Ax(e,t){return typeof e=="function"?e(t):e}function ou(e){return typeof e=="number"&&e>=0&&e!==1/0}function Jp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ur(e,t){return typeof e=="function"?e(t):e}function Ct(e,t){return typeof e=="function"?e(t):e}function df(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Ac(o,t.options))return!1}else if(!hs(t.queryKey,o))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||i&&i!==t.state.fetchStatus||s&&!s(t))}function ff(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(vr(t.options.mutationKey)!==vr(s))return!1}else if(!hs(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ac(e,t){return((t==null?void 0:t.queryKeyHashFn)||vr)(e)}function vr(e){return JSON.stringify(e,(t,n)=>lu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!hs(e[n],t[n])):!1}function Lc(e,t){if(e===t)return e;const n=hf(e)&&hf(t);if(n||lu(e)&&lu(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,l=n?[]:{};let a=0;for(let u=0;u<o;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,a++):(l[f]=Lc(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&a++)}return i===o&&a===i?e:l}return t}function Zo(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 hf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lu(e){if(!pf(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!pf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function pf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Lx(e){return new Promise(t=>{setTimeout(t,e)})}function au(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lc(e,t):t}function Fx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Fc=Symbol();function e0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Fc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sr,Cn,Jr,Pp,Bx=(Pp=class extends Cr{constructor(){super();Y(this,sr);Y(this,Cn);Y(this,Jr);V(this,Jr,t=>{if(!yr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Cn)||this.setEventListener(C(this,Jr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Cn))==null||t.call(this),V(this,Cn,void 0))}setEventListener(t){var n;V(this,Jr,t),(n=C(this,Cn))==null||n.call(this),V(this,Cn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,sr)!==t&&(V(this,sr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,sr)=="boolean"?C(this,sr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sr=new WeakMap,Cn=new WeakMap,Jr=new WeakMap,Pp),Hc=new Bx,ei,bn,ti,zp,Vx=(zp=class extends Cr{constructor(){super();Y(this,ei,!0);Y(this,bn);Y(this,ti);V(this,ti,t=>{if(!yr&&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(){C(this,bn)||this.setEventListener(C(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,bn))==null||t.call(this),V(this,bn,void 0))}setEventListener(t){var n;V(this,ti,t),(n=C(this,bn))==null||n.call(this),V(this,bn,t(this.setOnline.bind(this)))}setOnline(t){C(this,ei)!==t&&(V(this,ei,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,ei)}},ei=new WeakMap,bn=new WeakMap,ti=new WeakMap,zp),Jo=new Vx;function uu(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Ux(e){return Math.min(1e3*2**e,3e4)}function t0(e){return(e??"online")==="online"?Jo.isOnline():!0}var n0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ea(e){return e instanceof n0}function r0(e){let t=!1,n=0,r=!1,i;const s=uu(),o=y=>{var S;r||(c(new n0(y)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},a=()=>{t=!1},u=()=>Hc.isFocused()&&(e.networkMode==="always"||Jo.isOnline())&&e.canRun(),f=()=>t0(e.networkMode)&&e.canRun(),d=y=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,y),i==null||i(),s.resolve(y))},c=y=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,y),i==null||i(),s.reject(y))},h=()=>new Promise(y=>{var S;i=m=>{(r||u())&&y(m)},(S=e.onPause)==null||S.call(e)}).then(()=>{var y;i=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;const S=n===0?e.initialPromise:void 0;try{y=S??e.fn()}catch(m){y=Promise.reject(m)}Promise.resolve(y).then(d).catch(m=>{var M;if(r)return;const x=e.retry??(yr?0:3),g=e.retryDelay??Ux,w=typeof g=="function"?g(n,m):g,_=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,m);if(t||!_){c(m);return}n++,(M=e.onFail)==null||M.call(e,n,m),Lx(w).then(()=>u()?void 0:h()).then(()=>{t?c(m):v()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:a,canStart:f,start:()=>(f()?v():h().then(v),s)}}function Qx(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const s=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{s(()=>{l(...a)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ke=Qx(),or,Ip,i0=(Ip=class{constructor(){Y(this,or)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ou(this.gcTime)&&V(this,or,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yr?1/0:5*60*1e3))}clearGcTimeout(){C(this,or)&&(clearTimeout(C(this,or)),V(this,or,void 0))}},or=new WeakMap,Ip),ni,ri,dt,Ae,Hs,lr,Et,qt,Tp,Wx=(Tp=class extends i0{constructor(t){super();Y(this,Et);Y(this,ni);Y(this,ri);Y(this,dt);Y(this,Ae);Y(this,Hs);Y(this,lr);V(this,lr,!1),V(this,Hs,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,ni,qx(this.options)),this.state=t.state??C(this,ni),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Ae))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Hs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,dt).remove(this)}setData(t,n){const r=au(this.state.data,t,this.options);return ee(this,Et,qt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ee(this,Et,qt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=C(this,Ae))==null?void 0:r.promise;return(i=C(this,Ae))==null||i.cancel(t),n?n.then(pt).catch(pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,ni))}isActive(){return this.observers.some(t=>Ct(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Jp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Ae)&&(C(this,lr)?C(this,Ae).cancel({revert:!0}):C(this,Ae).cancelRetry()),this.scheduleGc()),C(this,dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ee(this,Et,qt).call(this,{type:"invalidate"})}fetch(t,n){var a,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ae))return C(this,Ae).continueRetry(),C(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(c=>c.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(V(this,lr,!0),r.signal)})},s=()=>{const d=e0(this.options,n),c={queryKey:this.queryKey,meta:this.meta};return i(c),V(this,lr,!1),this.options.persister?this.options.persister(d,c,this):d(c)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(a=this.options.behavior)==null||a.onFetch(o,this),V(this,ri,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&ee(this,Et,qt).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=d=>{var c,h,v,y;Ea(d)&&d.silent||ee(this,Et,qt).call(this,{type:"error",error:d}),Ea(d)||((h=(c=C(this,dt).config).onError)==null||h.call(c,d,this),(y=(v=C(this,dt).config).onSettled)==null||y.call(v,this.state.data,d,this)),this.scheduleGc()};return V(this,Ae,r0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var c,h,v,y;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(S){l(S);return}(h=(c=C(this,dt).config).onSuccess)==null||h.call(c,d,this),(y=(v=C(this,dt).config).onSettled)==null||y.call(v,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,c)=>{ee(this,Et,qt).call(this,{type:"failed",failureCount:d,error:c})},onPause:()=>{ee(this,Et,qt).call(this,{type:"pause"})},onContinue:()=>{ee(this,Et,qt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),C(this,Ae).start()}},ni=new WeakMap,ri=new WeakMap,dt=new WeakMap,Ae=new WeakMap,Hs=new WeakMap,lr=new WeakMap,Et=new WeakSet,qt=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,...s0(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Ea(i)&&i.revert&&C(this,ri)?{...C(this,ri),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,dt).notify({query:this,type:"updated",action:t})})},Tp);function s0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:t0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qx(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,Rp,Xx=(Rp=class extends Cr{constructor(t={}){super();Y(this,Dt);this.config=t,V(this,Dt,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Ac(i,n);let o=this.get(s);return o||(o=new Wx({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){C(this,Dt).has(t.queryHash)||(C(this,Dt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,Dt).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,Dt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Dt).get(t)}getAll(){return[...C(this,Dt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>df(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>df(t,r)):n}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Dt=new WeakMap,Rp),At,He,ar,Lt,xn,$p,Yx=($p=class extends i0{constructor(t){super();Y(this,Lt);Y(this,At);Y(this,He);Y(this,ar);this.mutationId=t.mutationId,V(this,He,t.mutationCache),V(this,At,[]),this.state=t.state||o0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,At).includes(t)||(C(this,At).push(t),this.clearGcTimeout(),C(this,He).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,At,C(this,At).filter(n=>n!==t)),this.scheduleGc(),C(this,He).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,At).length||(this.state.status==="pending"?this.scheduleGc():C(this,He).remove(this))}continue(){var t;return((t=C(this,ar))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,l,a,u,f,d,c,h,v,y,S,m,x,g,w,_,M,N;V(this,ar,r0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(b,P)=>{ee(this,Lt,xn).call(this,{type:"failed",failureCount:b,error:P})},onPause:()=>{ee(this,Lt,xn).call(this,{type:"pause"})},onContinue:()=>{ee(this,Lt,xn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,He).canRun(this)}));const n=this.state.status==="pending",r=!C(this,ar).canStart();try{if(!n){ee(this,Lt,xn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=C(this,He).config).onMutate)==null?void 0:s.call(i,t,this));const P=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));P!==this.state.context&&ee(this,Lt,xn).call(this,{type:"pending",context:P,variables:t,isPaused:r})}const b=await C(this,ar).start();return await((u=(a=C(this,He).config).onSuccess)==null?void 0:u.call(a,b,t,this.state.context,this)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,b,t,this.state.context)),await((h=(c=C(this,He).config).onSettled)==null?void 0:h.call(c,b,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,b,null,t,this.state.context)),ee(this,Lt,xn).call(this,{type:"success",data:b}),b}catch(b){try{throw await((m=(S=C(this,He).config).onError)==null?void 0:m.call(S,b,t,this.state.context,this)),await((g=(x=this.options).onError)==null?void 0:g.call(x,b,t,this.state.context)),await((_=(w=C(this,He).config).onSettled)==null?void 0:_.call(w,void 0,b,this.state.variables,this.state.context,this)),await((N=(M=this.options).onSettled)==null?void 0:N.call(M,void 0,b,t,this.state.context)),b}finally{ee(this,Lt,xn).call(this,{type:"error",error:b})}}finally{C(this,He).runNext(this)}}},At=new WeakMap,He=new WeakMap,ar=new WeakMap,Lt=new WeakSet,xn=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),ke.batch(()=>{C(this,At).forEach(r=>{r.onMutationUpdate(t)}),C(this,He).notify({mutation:this,type:"updated",action:t})})},$p);function o0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tt,Bs,Op,Kx=(Op=class extends Cr{constructor(t={}){super();Y(this,tt);Y(this,Bs);this.config=t,V(this,tt,new Map),V(this,Bs,Date.now())}build(t,n,r){const i=new Yx({mutationCache:this,mutationId:++so(this,Bs)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=lo(t),r=C(this,tt).get(n)??[];r.push(t),C(this,tt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=lo(t);if(C(this,tt).has(n)){const i=(r=C(this,tt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?C(this,tt).delete(n):C(this,tt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=C(this,tt).get(lo(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=C(this,tt).get(lo(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...C(this,tt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ff(n,r))}findAll(t={}){return this.getAll().filter(n=>ff(t,n))}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ke.batch(()=>Promise.all(t.map(n=>n.continue().catch(pt))))}},tt=new WeakMap,Bs=new WeakMap,Op);function lo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function mf(e){return{onFetch:(t,n)=>{var f,d,c,h,v;const r=t.options,i=(c=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:c.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let y=!1;const S=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},m=e0(t.options,t.fetchOptions),x=async(g,w,_)=>{if(y)return Promise.reject();if(w==null&&g.pages.length)return Promise.resolve(g);const M={queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};S(M);const N=await m(M),{maxPages:b}=t.options,P=_?Hx:Fx;return{pages:P(g.pages,N,b),pageParams:P(g.pageParams,w,b)}};if(i&&s.length){const g=i==="backward",w=g?Gx:gf,_={pages:s,pageParams:o},M=w(r,_);l=await x(_,M,g)}else{const g=e??s.length;do{const w=a===0?o[0]??r.initialPageParam:gf(r,l);if(a>0&&w==null)break;l=await x(l,w),a++}while(a<g)}return l};t.options.persister?t.fetchFn=()=>{var y,S;return(S=(y=t.options).persister)==null?void 0:S.call(y,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gf(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 Gx(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}var we,jn,Mn,ii,si,Pn,oi,li,Dp,Zx=(Dp=class{constructor(e={}){Y(this,we);Y(this,jn);Y(this,Mn);Y(this,ii);Y(this,si);Y(this,Pn);Y(this,oi);Y(this,li);V(this,we,e.queryCache||new Xx),V(this,jn,e.mutationCache||new Kx),V(this,Mn,e.defaultOptions||{}),V(this,ii,new Map),V(this,si,new Map),V(this,Pn,0)}mount(){so(this,Pn)._++,C(this,Pn)===1&&(V(this,oi,Hc.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onFocus())})),V(this,li,Jo.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onOnline())})))}unmount(){var e,t;so(this,Pn)._--,C(this,Pn)===0&&((e=C(this,oi))==null||e.call(this),V(this,oi,void 0),(t=C(this,li))==null||t.call(this),V(this,li,void 0))}isFetching(e){return C(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,jn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ur(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=C(this,we).get(r.queryHash),s=i==null?void 0:i.state.data,o=Ax(t,s);if(o!==void 0)return C(this,we).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>C(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,we);ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,we),r={type:"active",...e};return ke.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ke.batch(()=>C(this,we).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(pt).catch(pt)}invalidateQueries(e,t={}){return ke.batch(()=>{if(C(this,we).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ke.batch(()=>C(this,we).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(pt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,we).build(this,t);return n.isStaleByTime(Ur(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pt).catch(pt)}fetchInfiniteQuery(e){return e.behavior=mf(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pt).catch(pt)}ensureInfiniteQueryData(e){return e.behavior=mf(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Jo.isOnline()?C(this,jn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,we)}getMutationCache(){return C(this,jn)}getDefaultOptions(){return C(this,Mn)}setDefaultOptions(e){V(this,Mn,e)}setQueryDefaults(e,t){C(this,ii).set(vr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,ii).values()],n={};return t.forEach(r=>{hs(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,si).set(vr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,si).values()];let n={};return t.forEach(r=>{hs(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,Mn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ac(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===Fc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,we).clear(),C(this,jn).clear()}},we=new WeakMap,jn=new WeakMap,Mn=new WeakMap,ii=new WeakMap,si=new WeakMap,Pn=new WeakMap,oi=new WeakMap,li=new WeakMap,Dp),qe,ie,Vs,Be,ur,ai,zn,Ft,Us,ui,ci,cr,dr,In,di,ue,Xi,cu,du,fu,hu,pu,mu,gu,l0,Ap,Bc=(Ap=class extends Cr{constructor(t,n){super();Y(this,ue);Y(this,qe);Y(this,ie);Y(this,Vs);Y(this,Be);Y(this,ur);Y(this,ai);Y(this,zn);Y(this,Ft);Y(this,Us);Y(this,ui);Y(this,ci);Y(this,cr);Y(this,dr);Y(this,In);Y(this,di,new Set);this.options=n,V(this,qe,t),V(this,Ft,null),V(this,zn,uu()),this.options.experimental_prefetchInRender||C(this,zn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ie).addObserver(this),yf(C(this,ie),this.options)?ee(this,ue,Xi).call(this):this.updateResult(),ee(this,ue,hu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yu(C(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yu(C(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ee(this,ue,pu).call(this),ee(this,ue,mu).call(this),C(this,ie).removeObserver(this)}setOptions(t,n){const r=this.options,i=C(this,ie);if(this.options=C(this,qe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ct(this.options.enabled,C(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ee(this,ue,gu).call(this),C(this,ie).setOptions(this.options),r._defaulted&&!Zo(this.options,r)&&C(this,qe).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ie),observer:this});const s=this.hasListeners();s&&vf(C(this,ie),i,this.options,r)&&ee(this,ue,Xi).call(this),this.updateResult(n),s&&(C(this,ie)!==i||Ct(this.options.enabled,C(this,ie))!==Ct(r.enabled,C(this,ie))||Ur(this.options.staleTime,C(this,ie))!==Ur(r.staleTime,C(this,ie)))&&ee(this,ue,cu).call(this);const o=ee(this,ue,du).call(this);s&&(C(this,ie)!==i||Ct(this.options.enabled,C(this,ie))!==Ct(r.enabled,C(this,ie))||o!==C(this,In))&&ee(this,ue,fu).call(this,o)}getOptimisticResult(t){const n=C(this,qe).getQueryCache().build(C(this,qe),t),r=this.createResult(n,t);return e1(this,r)&&(V(this,Be,r),V(this,ai,this.options),V(this,ur,C(this,ie).state)),r}getCurrentResult(){return C(this,Be)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){C(this,di).add(t)}getCurrentQuery(){return C(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,qe).defaultQueryOptions(t),r=C(this,qe).getQueryCache().build(C(this,qe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ee(this,ue,Xi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Be)))}createResult(t,n){var b;const r=C(this,ie),i=this.options,s=C(this,Be),o=C(this,ur),l=C(this,ai),u=t!==r?t.state:C(this,Vs),{state:f}=t;let d={...f},c=!1,h;if(n._optimisticResults){const P=this.hasListeners(),I=!P&&yf(t,n),D=P&&vf(t,r,n,i);(I||D)&&(d={...d,...s0(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:S}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(o==null?void 0:o.data)&&n.select===C(this,Us))h=C(this,ui);else try{V(this,Us,n.select),h=n.select(d.data),h=au(s==null?void 0:s.data,h,n),V(this,ui,h),V(this,Ft,null)}catch(P){V(this,Ft,P)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let P;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))P=s.data;else if(P=typeof n.placeholderData=="function"?n.placeholderData((b=C(this,ci))==null?void 0:b.state.data,C(this,ci)):n.placeholderData,n.select&&P!==void 0)try{P=n.select(P),V(this,Ft,null)}catch(I){V(this,Ft,I)}P!==void 0&&(S="success",h=au(s==null?void 0:s.data,P,n),c=!0)}C(this,Ft)&&(v=C(this,Ft),h=C(this,ui),y=Date.now(),S="error");const m=d.fetchStatus==="fetching",x=S==="pending",g=S==="error",w=x&&m,_=h!==void 0,N={status:S,fetchStatus:d.fetchStatus,isPending:x,isSuccess:S==="success",isError:g,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!x,isLoadingError:g&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:c,isRefetchError:g&&_,isStale:Vc(t,n),refetch:this.refetch,promise:C(this,zn)};if(this.options.experimental_prefetchInRender){const P=F=>{N.status==="error"?F.reject(N.error):N.data!==void 0&&F.resolve(N.data)},I=()=>{const F=V(this,zn,N.promise=uu());P(F)},D=C(this,zn);switch(D.status){case"pending":t.queryHash===r.queryHash&&P(D);break;case"fulfilled":(N.status==="error"||N.data!==D.value)&&I();break;case"rejected":(N.status!=="error"||N.error!==D.reason)&&I();break}}return N}updateResult(t){const n=C(this,Be),r=this.createResult(C(this,ie),this.options);if(V(this,ur,C(this,ie).state),V(this,ai,this.options),C(this,ur).data!==void 0&&V(this,ci,C(this,ie)),Zo(r,n))return;V(this,Be,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!C(this,di).size)return!0;const a=new Set(l??C(this,di));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Be)).some(u=>{const f=u;return C(this,Be)[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ee(this,ue,l0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ee(this,ue,hu).call(this)}},qe=new WeakMap,ie=new WeakMap,Vs=new WeakMap,Be=new WeakMap,ur=new WeakMap,ai=new WeakMap,zn=new WeakMap,Ft=new WeakMap,Us=new WeakMap,ui=new WeakMap,ci=new WeakMap,cr=new WeakMap,dr=new WeakMap,In=new WeakMap,di=new WeakMap,ue=new WeakSet,Xi=function(t){ee(this,ue,gu).call(this);let n=C(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pt)),n},cu=function(){ee(this,ue,pu).call(this);const t=Ur(this.options.staleTime,C(this,ie));if(yr||C(this,Be).isStale||!ou(t))return;const r=Jp(C(this,Be).dataUpdatedAt,t)+1;V(this,cr,setTimeout(()=>{C(this,Be).isStale||this.updateResult()},r))},du=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ie)):this.options.refetchInterval)??!1},fu=function(t){ee(this,ue,mu).call(this),V(this,In,t),!(yr||Ct(this.options.enabled,C(this,ie))===!1||!ou(C(this,In))||C(this,In)===0)&&V(this,dr,setInterval(()=>{(this.options.refetchIntervalInBackground||Hc.isFocused())&&ee(this,ue,Xi).call(this)},C(this,In)))},hu=function(){ee(this,ue,cu).call(this),ee(this,ue,fu).call(this,ee(this,ue,du).call(this))},pu=function(){C(this,cr)&&(clearTimeout(C(this,cr)),V(this,cr,void 0))},mu=function(){C(this,dr)&&(clearInterval(C(this,dr)),V(this,dr,void 0))},gu=function(){const t=C(this,qe).getQueryCache().build(C(this,qe),this.options);if(t===C(this,ie))return;const n=C(this,ie);V(this,ie,t),V(this,Vs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},l0=function(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Be))}),C(this,qe).getQueryCache().notify({query:C(this,ie),type:"observerResultsUpdated"})})},Ap);function Jx(e,t){return Ct(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function yf(e,t){return Jx(e,t)||e.state.data!==void 0&&yu(e,t,t.refetchOnMount)}function yu(e,t,n){if(Ct(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vc(e,t)}return!1}function vf(e,t,n,r){return(e!==t||Ct(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vc(e,n)}function Vc(e,t){return Ct(t.enabled,e)!==!1&&e.isStaleByTime(Ur(t.staleTime,e))}function e1(e,t){return!Zo(e.getCurrentResult(),t)}function xf(e,t){return e.filter(n=>!t.includes(n))}function t1(e,t,n){const r=e.slice(0);return r[t]=n,r}var fi,ft,fr,hi,ht,Tn,Qs,Ws,ze,vu,xu,Oo,wu,Su,Lp,n1=(Lp=class extends Cr{constructor(t,n,r){super();Y(this,ze);Y(this,fi);Y(this,ft);Y(this,fr);Y(this,hi);Y(this,ht);Y(this,Tn);Y(this,Qs);Y(this,Ws);V(this,fi,t),V(this,hi,r),V(this,fr,[]),V(this,ht,[]),V(this,ft,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&C(this,ht).forEach(t=>{t.subscribe(n=>{ee(this,ze,wu).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,C(this,ht).forEach(t=>{t.destroy()})}setQueries(t,n,r){V(this,fr,t),V(this,hi,n),ke.batch(()=>{const i=C(this,ht),s=ee(this,ze,Oo).call(this,C(this,fr));s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions,r));const o=s.map(u=>u.observer),l=o.map(u=>u.getCurrentResult()),a=o.some((u,f)=>u!==i[f]);i.length===o.length&&!a||(V(this,ht,o),V(this,ft,l),this.hasListeners()&&(xf(i,o).forEach(u=>{u.destroy()}),xf(o,i).forEach(u=>{u.subscribe(f=>{ee(this,ze,wu).call(this,u,f)})}),ee(this,ze,Su).call(this)))})}getCurrentResult(){return C(this,ft)}getQueries(){return C(this,ht).map(t=>t.getCurrentQuery())}getObservers(){return C(this,ht)}getOptimisticResult(t,n){const i=ee(this,ze,Oo).call(this,t).map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[i,s=>ee(this,ze,xu).call(this,s??i,n),()=>ee(this,ze,vu).call(this,i,t)]}},fi=new WeakMap,ft=new WeakMap,fr=new WeakMap,hi=new WeakMap,ht=new WeakMap,Tn=new WeakMap,Qs=new WeakMap,Ws=new WeakMap,ze=new WeakSet,vu=function(t,n){const r=ee(this,ze,Oo).call(this,n);return r.map((i,s)=>{const o=t[s];return i.defaultedQueryOptions.notifyOnChangeProps?o:i.observer.trackResult(o,l=>{r.forEach(a=>{a.observer.trackProp(l)})})})},xu=function(t,n){return n?((!C(this,Tn)||C(this,ft)!==C(this,Ws)||n!==C(this,Qs))&&(V(this,Qs,n),V(this,Ws,C(this,ft)),V(this,Tn,Lc(C(this,Tn),n(t)))),C(this,Tn)):t},Oo=function(t){const n=new Map(C(this,ht).map(i=>[i.options.queryHash,i])),r=[];return t.forEach(i=>{const s=C(this,fi).defaultQueryOptions(i),o=n.get(s.queryHash);o?r.push({defaultedQueryOptions:s,observer:o}):r.push({defaultedQueryOptions:s,observer:new Bc(C(this,fi),s)})}),r},wu=function(t,n){const r=C(this,ht).indexOf(t);r!==-1&&(V(this,ft,t1(C(this,ft),r,n)),ee(this,ze,Su).call(this))},Su=function(){var t;if(this.hasListeners()){const n=C(this,Tn),r=ee(this,ze,xu).call(this,ee(this,ze,vu).call(this,C(this,ft),C(this,fr)),(t=C(this,hi))==null?void 0:t.combine);n!==r&&ke.batch(()=>{this.listeners.forEach(i=>{i(C(this,ft))})})}},Lp),Rn,$n,Xe,Kt,rn,Do,ku,Fp,r1=(Fp=class extends Cr{constructor(n,r){super();Y(this,rn);Y(this,Rn);Y(this,$n);Y(this,Xe);Y(this,Kt);V(this,Rn,n),this.setOptions(r),this.bindMethods(),ee(this,rn,Do).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=C(this,Rn).defaultMutationOptions(n),Zo(this.options,r)||C(this,Rn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Xe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&vr(r.mutationKey)!==vr(this.options.mutationKey)?this.reset():((i=C(this,Xe))==null?void 0:i.state.status)==="pending"&&C(this,Xe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,Xe))==null||n.removeObserver(this)}onMutationUpdate(n){ee(this,rn,Do).call(this),ee(this,rn,ku).call(this,n)}getCurrentResult(){return C(this,$n)}reset(){var n;(n=C(this,Xe))==null||n.removeObserver(this),V(this,Xe,void 0),ee(this,rn,Do).call(this),ee(this,rn,ku).call(this)}mutate(n,r){var i;return V(this,Kt,r),(i=C(this,Xe))==null||i.removeObserver(this),V(this,Xe,C(this,Rn).getMutationCache().build(C(this,Rn),this.options)),C(this,Xe).addObserver(this),C(this,Xe).execute(n)}},Rn=new WeakMap,$n=new WeakMap,Xe=new WeakMap,Kt=new WeakMap,rn=new WeakSet,Do=function(){var r;const n=((r=C(this,Xe))==null?void 0:r.state)??o0();V(this,$n,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ku=function(n){ke.batch(()=>{var r,i,s,o,l,a,u,f;if(C(this,Kt)&&this.hasListeners()){const d=C(this,$n).variables,c=C(this,$n).context;(n==null?void 0:n.type)==="success"?((i=(r=C(this,Kt)).onSuccess)==null||i.call(r,n.data,d,c),(o=(s=C(this,Kt)).onSettled)==null||o.call(s,n.data,null,d,c)):(n==null?void 0:n.type)==="error"&&((a=(l=C(this,Kt)).onError)==null||a.call(l,n.error,d,c),(f=(u=C(this,Kt)).onSettled)==null||f.call(u,void 0,n.error,d,c))}this.listeners.forEach(d=>{d(C(this,$n))})})},Fp),a0=R.createContext(void 0),Xs=e=>{const t=R.useContext(a0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i1=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(a0.Provider,{value:e,children:t})),u0=R.createContext(!1),c0=()=>R.useContext(u0);u0.Provider;function s1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o1=R.createContext(s1()),d0=()=>R.useContext(o1);function f0(e,t){return typeof e=="function"?e(...t):!!e}function el(){}var h0=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},p0=e=>{R.useEffect(()=>{e.clearReset()},[e])},m0=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&f0(n,[e.error,r]),g0=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},y0=(e,t)=>e.isLoading&&e.isFetching&&!t,Eu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,tl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function l1({queries:e,...t},n){const r=Xs(),i=c0(),s=d0(),o=R.useMemo(()=>e.map(v=>{const y=r.defaultQueryOptions(v);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[e,r,i]);o.forEach(v=>{g0(v),h0(v,s)}),p0(s);const[l]=R.useState(()=>new n1(r,o,t)),[a,u,f]=l.getOptimisticResult(o,t.combine);R.useSyncExternalStore(R.useCallback(v=>i?el:l.subscribe(ke.batchCalls(v)),[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,t,{listeners:!1})},[o,t,l]);const c=a.some((v,y)=>Eu(o[y],v))?a.flatMap((v,y)=>{const S=o[y];if(S){const m=new Bc(r,S);if(Eu(S,v))return tl(S,m,s);y0(v,i)&&tl(S,m,s)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=a.find((v,y)=>{const S=o[y];return S&&m0({result:v,errorResetBoundary:s,throwOnError:S.throwOnError,query:r.getQueryCache().get(S.queryHash)})});if(h!=null&&h.error)throw h.error;return u(f())}function a1(e,t,n){var f,d,c,h,v;const r=Xs(),i=c0(),s=d0(),o=r.defaultQueryOptions(e);(d=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||d.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",g0(o),h0(o,s),p0(s);const l=!r.getQueryCache().get(o.queryHash),[a]=R.useState(()=>new t(r,o)),u=a.getOptimisticResult(o);if(R.useSyncExternalStore(R.useCallback(y=>{const S=i?el:a.subscribe(ke.batchCalls(y));return a.updateResult(),S},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),R.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Eu(o,u))throw tl(o,a,s);if(m0({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((h=(c=r.getDefaultOptions().queries)==null?void 0:c._experimental_afterQuery)==null||h.call(c,o,u),o.experimental_prefetchInRender&&!yr&&y0(u,i)){const y=l?tl(o,a,s):(v=r.getQueryCache().get(o.queryHash))==null?void 0:v.promise;y==null||y.catch(el).finally(()=>{a.updateResult()})}return o.notifyOnChangeProps?u:a.trackResult(u)}function pi(e,t){return a1(e,Bc)}function Yi(e,t){const n=Xs(),[r]=R.useState(()=>new r1(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const i=R.useSyncExternalStore(R.useCallback(o=>r.subscribe(ke.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=R.useCallback((o,l)=>{r.mutate(o,l).catch(el)},[r]);if(i.error&&f0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var v0={exports:{}},ut={},x0={exports:{}},w0={};/**
|
|
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(k,j){var T=k.length;k.push(j);e:for(;0<T;){var L=T-1>>>1,H=k[L];if(0<i(H,j))k[L]=j,k[T]=H,T=L;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var j=k[0],T=k.pop();if(T!==j){k[0]=T;e:for(var L=0,H=k.length,K=H>>>1;L<K;){var Q=2*(L+1)-1,X=k[Q],q=Q+1,Z=k[q];if(0>i(X,T))q<H&&0>i(Z,X)?(k[L]=Z,k[q]=T,L=q):(k[L]=X,k[Q]=T,L=Q);else if(q<H&&0>i(Z,T))k[L]=Z,k[q]=T,L=q;else break e}}return j}function i(k,j){var T=k.sortIndex-j.sortIndex;return T!==0?T:k.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],f=1,d=null,c=3,h=!1,v=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(k){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=k)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function w(k){if(y=!1,g(k),!v)if(n(a)!==null)v=!0,z(_);else{var j=n(u);j!==null&&O(w,j.startTime-k)}}function _(k,j){v=!1,y&&(y=!1,m(b),b=-1),h=!0;var T=c;try{for(g(j),d=n(a);d!==null&&(!(d.expirationTime>j)||k&&!D());){var L=d.callback;if(typeof L=="function"){d.callback=null,c=d.priorityLevel;var H=L(d.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),g(j)}else r(a);d=n(a)}if(d!==null)var K=!0;else{var Q=n(u);Q!==null&&O(w,Q.startTime-j),K=!1}return K}finally{d=null,c=T,h=!1}}var M=!1,N=null,b=-1,P=5,I=-1;function D(){return!(e.unstable_now()-I<P)}function F(){if(N!==null){var k=e.unstable_now();I=k;var j=!0;try{j=N(!0,k)}finally{j?A():(M=!1,N=null)}}else M=!1}var A;if(typeof x=="function")A=function(){x(F)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=F,A=function(){$.postMessage(null)}}else A=function(){S(F,0)};function z(k){N=k,M||(M=!0,A())}function O(k,j){b=S(function(){k(e.unstable_now())},j)}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(k){k.callback=null},e.unstable_continueExecution=function(){v||h||(v=!0,z(_))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return c},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(k){switch(c){case 1:case 2:case 3:var j=3;break;default:j=c}var T=c;c=j;try{return k()}finally{c=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,j){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var T=c;c=k;try{return j()}finally{c=T}},e.unstable_scheduleCallback=function(k,j,T){var L=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?L+T:L):T=L,k){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=T+H,k={id:f++,callback:j,priorityLevel:k,startTime:T,expirationTime:H,sortIndex:-1},T>L?(k.sortIndex=T,t(u,k),n(a)===null&&k===n(u)&&(y?(m(b),b=-1):y=!0,O(w,T-L))):(k.sortIndex=H,t(a,k),v||h||(v=!0,z(_))),k},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(k){var j=c;return function(){var T=c;c=j;try{return k.apply(this,arguments)}finally{c=T}}}})(w0);x0.exports=w0;var u1=x0.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 c1=R,lt=u1;function B(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 S0=new Set,ps={};function br(e,t){mi(e,t),mi(e+"Capture",t)}function mi(e,t){for(ps[e]=t,e=0;e<t.length;e++)S0.add(t[e])}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,d1=/^[: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]*$/,wf={},Sf={};function f1(e){return _u.call(Sf,e)?!0:_u.call(wf,e)?!1:d1.test(e)?Sf[e]=!0:(wf[e]=!0,!1)}function h1(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 p1(e,t,n,r){if(t===null||typeof t>"u"||h1(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 We(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new We(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new We(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new We(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new We(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){Re[e]=new We(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new We(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new We(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new We(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new We(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uc=/[\-:]([a-z])/g;function Qc(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(Uc,Qc);Re[t]=new We(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(Uc,Qc);Re[t]=new We(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(Uc,Qc);Re[t]=new We(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new We(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new We("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new We(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wc(e,t,n,r){var i=Re.hasOwnProperty(t)?Re[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(p1(t,n,i,r)&&(n=null),r||i===null?f1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var cn=c1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ao=Symbol.for("react.element"),Pr=Symbol.for("react.portal"),zr=Symbol.for("react.fragment"),qc=Symbol.for("react.strict_mode"),Nu=Symbol.for("react.profiler"),k0=Symbol.for("react.provider"),E0=Symbol.for("react.context"),Xc=Symbol.for("react.forward_ref"),Cu=Symbol.for("react.suspense"),bu=Symbol.for("react.suspense_list"),Yc=Symbol.for("react.memo"),wn=Symbol.for("react.lazy"),_0=Symbol.for("react.offscreen"),kf=Symbol.iterator;function Ai(e){return e===null||typeof e!="object"?null:(e=kf&&e[kf]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,_a;function Ki(e){if(_a===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_a=t&&t[1]||""}return`
|
|
34
|
+
`+_a+e}var Na=!1;function Ca(e,t){if(!e||Na)return"";Na=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{Na=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ki(e):""}function m1(e){switch(e.tag){case 5:return Ki(e.type);case 16:return Ki("Lazy");case 13:return Ki("Suspense");case 19:return Ki("SuspenseList");case 0:case 2:case 15:return e=Ca(e.type,!1),e;case 11:return e=Ca(e.type.render,!1),e;case 1:return e=Ca(e.type,!0),e;default:return""}}function ju(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 zr:return"Fragment";case Pr:return"Portal";case Nu:return"Profiler";case qc:return"StrictMode";case Cu:return"Suspense";case bu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E0:return(e.displayName||"Context")+".Consumer";case k0:return(e._context.displayName||"Context")+".Provider";case Xc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yc:return t=e.displayName||null,t!==null?t:ju(e.type)||"Memo";case wn:t=e._payload,e=e._init;try{return ju(e(t))}catch{}}return null}function g1(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 ju(t);case 8:return t===qc?"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 Wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function N0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y1(e){var t=N0(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 i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uo(e){e._valueTracker||(e._valueTracker=y1(e))}function C0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=N0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function nl(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 Mu(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ef(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wn(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 b0(e,t){t=t.checked,t!=null&&Wc(e,"checked",t,!1)}function Pu(e,t){b0(e,t);var n=Wn(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")?zu(e,t.type,n):t.hasOwnProperty("defaultValue")&&zu(e,t.type,Wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _f(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 zu(e,t,n){(t!=="number"||nl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gi=Array.isArray;function Qr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Wn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Iu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Nf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Gi(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Wn(n)}}function j0(e,t){var n=Wn(t.value),r=Wn(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 Cf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function M0(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 Tu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?M0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var co,P0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(co=co||document.createElement("div"),co.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=co.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ns={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},v1=["Webkit","ms","Moz","O"];Object.keys(ns).forEach(function(e){v1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ns[t]=ns[e]})});function z0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ns.hasOwnProperty(e)&&ns[e]?(""+t).trim():t+"px"}function I0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=z0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var x1=xe({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 Ru(e,t){if(t){if(x1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function $u(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 Ou=null;function Kc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Du=null,Wr=null,qr=null;function bf(e){if(e=Gs(e)){if(typeof Du!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Vl(t),Du(e.stateNode,e.type,t))}}function T0(e){Wr?qr?qr.push(e):qr=[e]:Wr=e}function R0(){if(Wr){var e=Wr,t=qr;if(qr=Wr=null,bf(e),t)for(e=0;e<t.length;e++)bf(t[e])}}function $0(e,t){return e(t)}function O0(){}var ba=!1;function D0(e,t,n){if(ba)return e(t,n);ba=!0;try{return $0(e,t,n)}finally{ba=!1,(Wr!==null||qr!==null)&&(O0(),R0())}}function gs(e,t){var n=e.stateNode;if(n===null)return null;var r=Vl(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(B(231,t,typeof n));return n}var Au=!1;if(sn)try{var Li={};Object.defineProperty(Li,"passive",{get:function(){Au=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Au=!1}function w1(e,t,n,r,i,s,o,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var rs=!1,rl=null,il=!1,Lu=null,S1={onError:function(e){rs=!0,rl=e}};function k1(e,t,n,r,i,s,o,l,a){rs=!1,rl=null,w1.apply(S1,arguments)}function E1(e,t,n,r,i,s,o,l,a){if(k1.apply(this,arguments),rs){if(rs){var u=rl;rs=!1,rl=null}else throw Error(B(198));il||(il=!0,Lu=u)}}function jr(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 A0(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 jf(e){if(jr(e)!==e)throw Error(B(188))}function _1(e){var t=e.alternate;if(!t){if(t=jr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return jf(i),e;if(s===r)return jf(i),t;s=s.sibling}throw Error(B(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function L0(e){return e=_1(e),e!==null?F0(e):null}function F0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=F0(e);if(t!==null)return t;e=e.sibling}return null}var H0=lt.unstable_scheduleCallback,Mf=lt.unstable_cancelCallback,N1=lt.unstable_shouldYield,C1=lt.unstable_requestPaint,_e=lt.unstable_now,b1=lt.unstable_getCurrentPriorityLevel,Gc=lt.unstable_ImmediatePriority,B0=lt.unstable_UserBlockingPriority,sl=lt.unstable_NormalPriority,j1=lt.unstable_LowPriority,V0=lt.unstable_IdlePriority,Ll=null,Bt=null;function M1(e){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Ll,e,void 0,(e.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:I1,P1=Math.log,z1=Math.LN2;function I1(e){return e>>>=0,e===0?32:31-(P1(e)/z1|0)|0}var fo=64,ho=4194304;function Zi(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 ol(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Zi(l):(s&=o,s!==0&&(r=Zi(s)))}else o=n&~i,o!==0?r=Zi(o):s!==0&&(r=Zi(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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-Pt(t),i=1<<n,r|=e[n],t&=~i;return r}function T1(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 R1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Pt(s),l=1<<o,a=i[o];a===-1?(!(l&n)||l&r)&&(i[o]=T1(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function Fu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function U0(){var e=fo;return fo<<=1,!(fo&4194240)&&(fo=64),e}function ja(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ys(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pt(t),e[t]=n}function $1(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 i=31-Pt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Zc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ce=0;function Q0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var W0,Jc,q0,X0,Y0,Hu=!1,po=[],An=null,Ln=null,Fn=null,ys=new Map,vs=new Map,En=[],O1="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 Pf(e,t){switch(e){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":Ln=null;break;case"mouseover":case"mouseout":Fn=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(t.pointerId)}}function Fi(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Gs(t),t!==null&&Jc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function D1(e,t,n,r,i){switch(t){case"focusin":return An=Fi(An,e,t,n,r,i),!0;case"dragenter":return Ln=Fi(Ln,e,t,n,r,i),!0;case"mouseover":return Fn=Fi(Fn,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ys.set(s,Fi(ys.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,vs.set(s,Fi(vs.get(s)||null,e,t,n,r,i)),!0}return!1}function K0(e){var t=tr(e.target);if(t!==null){var n=jr(t);if(n!==null){if(t=n.tag,t===13){if(t=A0(n),t!==null){e.blockedOn=t,Y0(e.priority,function(){q0(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 Ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ou=r,n.target.dispatchEvent(r),Ou=null}else return t=Gs(n),t!==null&&Jc(t),e.blockedOn=n,!1;t.shift()}return!0}function zf(e,t,n){Ao(e)&&n.delete(t)}function A1(){Hu=!1,An!==null&&Ao(An)&&(An=null),Ln!==null&&Ao(Ln)&&(Ln=null),Fn!==null&&Ao(Fn)&&(Fn=null),ys.forEach(zf),vs.forEach(zf)}function Hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Hu||(Hu=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,A1)))}function xs(e){function t(i){return Hi(i,e)}if(0<po.length){Hi(po[0],e);for(var n=1;n<po.length;n++){var r=po[n];r.blockedOn===e&&(r.blockedOn=null)}}for(An!==null&&Hi(An,e),Ln!==null&&Hi(Ln,e),Fn!==null&&Hi(Fn,e),ys.forEach(t),vs.forEach(t),n=0;n<En.length;n++)r=En[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<En.length&&(n=En[0],n.blockedOn===null);)K0(n),n.blockedOn===null&&En.shift()}var Xr=cn.ReactCurrentBatchConfig,ll=!0;function L1(e,t,n,r){var i=ce,s=Xr.transition;Xr.transition=null;try{ce=1,ed(e,t,n,r)}finally{ce=i,Xr.transition=s}}function F1(e,t,n,r){var i=ce,s=Xr.transition;Xr.transition=null;try{ce=4,ed(e,t,n,r)}finally{ce=i,Xr.transition=s}}function ed(e,t,n,r){if(ll){var i=Bu(e,t,n,r);if(i===null)Aa(e,t,r,al,n),Pf(e,r);else if(D1(i,e,t,n,r))r.stopPropagation();else if(Pf(e,r),t&4&&-1<O1.indexOf(e)){for(;i!==null;){var s=Gs(i);if(s!==null&&W0(s),s=Bu(e,t,n,r),s===null&&Aa(e,t,r,al,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Aa(e,t,r,null,n)}}var al=null;function Bu(e,t,n,r){if(al=null,e=Kc(r),e=tr(e),e!==null)if(t=jr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=A0(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 al=e,null}function G0(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(b1()){case Gc:return 1;case B0:return 4;case sl:case j1:return 16;case V0:return 536870912;default:return 16}default:return 16}}var On=null,td=null,Lo=null;function Z0(){if(Lo)return Lo;var e,t=td,n=t.length,r,i="value"in On?On.value:On.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Lo=i.slice(e,1<r?1-r:void 0)}function Fo(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 mo(){return!0}function If(){return!1}function ct(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?mo:If,this.isPropagationStopped=If,this}return xe(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=mo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=mo)},persist:function(){},isPersistent:mo}),t}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nd=ct(zi),Ks=xe({},zi,{view:0,detail:0}),H1=ct(Ks),Ma,Pa,Bi,Fl=xe({},Ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rd,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!==Bi&&(Bi&&e.type==="mousemove"?(Ma=e.screenX-Bi.screenX,Pa=e.screenY-Bi.screenY):Pa=Ma=0,Bi=e),Ma)},movementY:function(e){return"movementY"in e?e.movementY:Pa}}),Tf=ct(Fl),B1=xe({},Fl,{dataTransfer:0}),V1=ct(B1),U1=xe({},Ks,{relatedTarget:0}),za=ct(U1),Q1=xe({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),W1=ct(Q1),q1=xe({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X1=ct(q1),Y1=xe({},zi,{data:0}),Rf=ct(Y1),K1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G1={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"},Z1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z1[e])?!!t[e]:!1}function rd(){return J1}var ew=xe({},Ks,{key:function(e){if(e.key){var t=K1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?G1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rd,charCode:function(e){return e.type==="keypress"?Fo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tw=ct(ew),nw=xe({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$f=ct(nw),rw=xe({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rd}),iw=ct(rw),sw=xe({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ow=ct(sw),lw=xe({},Fl,{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}),aw=ct(lw),uw=[9,13,27,32],id=sn&&"CompositionEvent"in window,is=null;sn&&"documentMode"in document&&(is=document.documentMode);var cw=sn&&"TextEvent"in window&&!is,J0=sn&&(!id||is&&8<is&&11>=is),Of=" ",Df=!1;function em(e,t){switch(e){case"keyup":return uw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function dw(e,t){switch(e){case"compositionend":return tm(t);case"keypress":return t.which!==32?null:(Df=!0,Of);case"textInput":return e=t.data,e===Of&&Df?null:e;default:return null}}function fw(e,t){if(Ir)return e==="compositionend"||!id&&em(e,t)?(e=Z0(),Lo=td=On=null,Ir=!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 J0&&t.locale!=="ko"?null:t.data;default:return null}}var hw={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 Af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hw[e.type]:t==="textarea"}function nm(e,t,n,r){T0(r),t=ul(t,"onChange"),0<t.length&&(n=new nd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ss=null,ws=null;function pw(e){hm(e,0)}function Hl(e){var t=$r(e);if(C0(t))return e}function mw(e,t){if(e==="change")return t}var rm=!1;if(sn){var Ia;if(sn){var Ta="oninput"in document;if(!Ta){var Lf=document.createElement("div");Lf.setAttribute("oninput","return;"),Ta=typeof Lf.oninput=="function"}Ia=Ta}else Ia=!1;rm=Ia&&(!document.documentMode||9<document.documentMode)}function Ff(){ss&&(ss.detachEvent("onpropertychange",im),ws=ss=null)}function im(e){if(e.propertyName==="value"&&Hl(ws)){var t=[];nm(t,ws,e,Kc(e)),D0(pw,t)}}function gw(e,t,n){e==="focusin"?(Ff(),ss=t,ws=n,ss.attachEvent("onpropertychange",im)):e==="focusout"&&Ff()}function yw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hl(ws)}function vw(e,t){if(e==="click")return Hl(t)}function xw(e,t){if(e==="input"||e==="change")return Hl(t)}function ww(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:ww;function Ss(e,t){if(It(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 i=n[r];if(!_u.call(t,i)||!It(e[i],t[i]))return!1}return!0}function Hf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bf(e,t){var n=Hf(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=Hf(n)}}function sm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function om(){for(var e=window,t=nl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nl(e.document)}return t}function sd(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 Sw(e){var t=om(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sm(n.ownerDocument.documentElement,n)){if(r!==null&&sd(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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Bf(n,s);var o=Bf(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 kw=sn&&"documentMode"in document&&11>=document.documentMode,Tr=null,Vu=null,os=null,Uu=!1;function Vf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uu||Tr==null||Tr!==nl(r)||(r=Tr,"selectionStart"in r&&sd(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}),os&&Ss(os,r)||(os=r,r=ul(Vu,"onSelect"),0<r.length&&(t=new nd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function go(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rr={animationend:go("Animation","AnimationEnd"),animationiteration:go("Animation","AnimationIteration"),animationstart:go("Animation","AnimationStart"),transitionend:go("Transition","TransitionEnd")},Ra={},lm={};sn&&(lm=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function Bl(e){if(Ra[e])return Ra[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in lm)return Ra[e]=t[n];return e}var am=Bl("animationend"),um=Bl("animationiteration"),cm=Bl("animationstart"),dm=Bl("transitionend"),fm=new Map,Uf="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 Yn(e,t){fm.set(e,t),br(t,[e])}for(var $a=0;$a<Uf.length;$a++){var Oa=Uf[$a],Ew=Oa.toLowerCase(),_w=Oa[0].toUpperCase()+Oa.slice(1);Yn(Ew,"on"+_w)}Yn(am,"onAnimationEnd");Yn(um,"onAnimationIteration");Yn(cm,"onAnimationStart");Yn("dblclick","onDoubleClick");Yn("focusin","onFocus");Yn("focusout","onBlur");Yn(dm,"onTransitionEnd");mi("onMouseEnter",["mouseout","mouseover"]);mi("onMouseLeave",["mouseout","mouseover"]);mi("onPointerEnter",["pointerout","pointerover"]);mi("onPointerLeave",["pointerout","pointerover"]);br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));br("onBeforeInput",["compositionend","keypress","textInput","paste"]);br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ji="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(" "),Nw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ji));function Qf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,E1(r,t,void 0,e),e.currentTarget=null}function hm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;Qf(i,l,u),s=a}else for(o=0;o<r.length;o++){if(l=r[o],a=l.instance,u=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;Qf(i,l,u),s=a}}}if(il)throw e=Lu,il=!1,Lu=null,e}function he(e,t){var n=t[Yu];n===void 0&&(n=t[Yu]=new Set);var r=e+"__bubble";n.has(r)||(pm(t,e,2,!1),n.add(r))}function Da(e,t,n){var r=0;t&&(r|=4),pm(n,e,r,t)}var yo="_reactListening"+Math.random().toString(36).slice(2);function ks(e){if(!e[yo]){e[yo]=!0,S0.forEach(function(n){n!=="selectionchange"&&(Nw.has(n)||Da(n,!1,e),Da(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yo]||(t[yo]=!0,Da("selectionchange",!1,t))}}function pm(e,t,n,r){switch(G0(t)){case 1:var i=L1;break;case 4:i=F1;break;default:i=ed}n=i.bind(null,t,n,e),i=void 0,!Au||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Aa(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=tr(l),o===null)return;if(a=o.tag,a===5||a===6){r=s=o;continue e}l=l.parentNode}}r=r.return}D0(function(){var u=s,f=Kc(n),d=[];e:{var c=fm.get(e);if(c!==void 0){var h=nd,v=e;switch(e){case"keypress":if(Fo(n)===0)break e;case"keydown":case"keyup":h=tw;break;case"focusin":v="focus",h=za;break;case"focusout":v="blur",h=za;break;case"beforeblur":case"afterblur":h=za;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":h=Tf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=V1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=iw;break;case am:case um:case cm:h=W1;break;case dm:h=ow;break;case"scroll":h=H1;break;case"wheel":h=aw;break;case"copy":case"cut":case"paste":h=X1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=$f}var y=(t&4)!==0,S=!y&&e==="scroll",m=y?c!==null?c+"Capture":null:c;y=[];for(var x=u,g;x!==null;){g=x;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=gs(x,m),w!=null&&y.push(Es(x,w,g)))),S)break;x=x.return}0<y.length&&(c=new h(c,v,null,n,f),d.push({event:c,listeners:y}))}}if(!(t&7)){e:{if(c=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",c&&n!==Ou&&(v=n.relatedTarget||n.fromElement)&&(tr(v)||v[on]))break e;if((h||c)&&(c=f.window===f?f:(c=f.ownerDocument)?c.defaultView||c.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=u,v=v?tr(v):null,v!==null&&(S=jr(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(y=Tf,w="onMouseLeave",m="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=$f,w="onPointerLeave",m="onPointerEnter",x="pointer"),S=h==null?c:$r(h),g=v==null?c:$r(v),c=new y(w,x+"leave",h,n,f),c.target=S,c.relatedTarget=g,w=null,tr(f)===u&&(y=new y(m,x+"enter",v,n,f),y.target=g,y.relatedTarget=S,w=y),S=w,h&&v)t:{for(y=h,m=v,x=0,g=y;g;g=Mr(g))x++;for(g=0,w=m;w;w=Mr(w))g++;for(;0<x-g;)y=Mr(y),x--;for(;0<g-x;)m=Mr(m),g--;for(;x--;){if(y===m||m!==null&&y===m.alternate)break t;y=Mr(y),m=Mr(m)}y=null}else y=null;h!==null&&Wf(d,c,h,y,!1),v!==null&&S!==null&&Wf(d,S,v,y,!0)}}e:{if(c=u?$r(u):window,h=c.nodeName&&c.nodeName.toLowerCase(),h==="select"||h==="input"&&c.type==="file")var _=mw;else if(Af(c))if(rm)_=xw;else{_=yw;var M=gw}else(h=c.nodeName)&&h.toLowerCase()==="input"&&(c.type==="checkbox"||c.type==="radio")&&(_=vw);if(_&&(_=_(e,u))){nm(d,_,n,f);break e}M&&M(e,c,u),e==="focusout"&&(M=c._wrapperState)&&M.controlled&&c.type==="number"&&zu(c,"number",c.value)}switch(M=u?$r(u):window,e){case"focusin":(Af(M)||M.contentEditable==="true")&&(Tr=M,Vu=u,os=null);break;case"focusout":os=Vu=Tr=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Vf(d,n,f);break;case"selectionchange":if(kw)break;case"keydown":case"keyup":Vf(d,n,f)}var N;if(id)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Ir?em(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(J0&&n.locale!=="ko"&&(Ir||b!=="onCompositionStart"?b==="onCompositionEnd"&&Ir&&(N=Z0()):(On=f,td="value"in On?On.value:On.textContent,Ir=!0)),M=ul(u,b),0<M.length&&(b=new Rf(b,e,null,n,f),d.push({event:b,listeners:M}),N?b.data=N:(N=tm(n),N!==null&&(b.data=N)))),(N=cw?dw(e,n):fw(e,n))&&(u=ul(u,"onBeforeInput"),0<u.length&&(f=new Rf("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=N))}hm(d,t)})}function Es(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ul(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=gs(e,n),s!=null&&r.unshift(Es(e,s,i)),s=gs(e,t),s!=null&&r.push(Es(e,s,i))),e=e.return}return r}function Mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Wf(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,i?(a=gs(n,s),a!=null&&o.unshift(Es(n,a,l))):i||(a=gs(n,s),a!=null&&o.push(Es(n,a,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Cw=/\r\n?/g,bw=/\u0000|\uFFFD/g;function qf(e){return(typeof e=="string"?e:""+e).replace(Cw,`
|
|
38
|
+
`).replace(bw,"")}function vo(e,t,n){if(t=qf(t),qf(e)!==t&&n)throw Error(B(425))}function cl(){}var Qu=null,Wu=null;function qu(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 Xu=typeof setTimeout=="function"?setTimeout:void 0,jw=typeof clearTimeout=="function"?clearTimeout:void 0,Xf=typeof Promise=="function"?Promise:void 0,Mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Xf<"u"?function(e){return Xf.resolve(null).then(e).catch(Pw)}:Xu;function Pw(e){setTimeout(function(){throw e})}function La(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),xs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);xs(t)}function Hn(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 Yf(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 Ii=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Ii,_s="__reactProps$"+Ii,on="__reactContainer$"+Ii,Yu="__reactEvents$"+Ii,zw="__reactListeners$"+Ii,Iw="__reactHandles$"+Ii;function tr(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yf(e);e!==null;){if(n=e[Ht])return n;e=Yf(e)}return t}e=n,n=e.parentNode}return null}function Gs(e){return e=e[Ht]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $r(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Vl(e){return e[_s]||null}var Ku=[],Or=-1;function Kn(e){return{current:e}}function pe(e){0>Or||(e.current=Ku[Or],Ku[Or]=null,Or--)}function de(e,t){Or++,Ku[Or]=e.current,e.current=t}var qn={},Fe=Kn(qn),Ze=Kn(!1),xr=qn;function gi(e,t){var n=e.type.contextTypes;if(!n)return qn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Je(e){return e=e.childContextTypes,e!=null}function dl(){pe(Ze),pe(Fe)}function Kf(e,t,n){if(Fe.current!==qn)throw Error(B(168));de(Fe,t),de(Ze,n)}function mm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(B(108,g1(e)||"Unknown",i));return xe({},n,r)}function fl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qn,xr=Fe.current,de(Fe,e),de(Ze,Ze.current),!0}function Gf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=mm(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,pe(Ze),pe(Fe),de(Fe,e)):pe(Ze),de(Ze,n)}var Yt=null,Ul=!1,Fa=!1;function gm(e){Yt===null?Yt=[e]:Yt.push(e)}function Tw(e){Ul=!0,gm(e)}function Gn(){if(!Fa&&Yt!==null){Fa=!0;var e=0,t=ce;try{var n=Yt;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Yt=null,Ul=!1}catch(i){throw Yt!==null&&(Yt=Yt.slice(e+1)),H0(Gc,Gn),i}finally{ce=t,Fa=!1}}return null}var Dr=[],Ar=0,hl=null,pl=0,mt=[],gt=0,wr=null,Gt=1,Zt="";function Zn(e,t){Dr[Ar++]=pl,Dr[Ar++]=hl,hl=e,pl=t}function ym(e,t,n){mt[gt++]=Gt,mt[gt++]=Zt,mt[gt++]=wr,wr=e;var r=Gt;e=Zt;var i=32-Pt(r)-1;r&=~(1<<i),n+=1;var s=32-Pt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gt=1<<32-Pt(t)+i|n<<i|r,Zt=s+e}else Gt=1<<s|n<<i|r,Zt=e}function od(e){e.return!==null&&(Zn(e,1),ym(e,1,0))}function ld(e){for(;e===hl;)hl=Dr[--Ar],Dr[Ar]=null,pl=Dr[--Ar],Dr[Ar]=null;for(;e===wr;)wr=mt[--gt],mt[gt]=null,Zt=mt[--gt],mt[gt]=null,Gt=mt[--gt],mt[gt]=null}var ot=null,st=null,me=!1,bt=null;function vm(e,t){var n=yt(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 Zf(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,ot=e,st=Hn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ot=e,st=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wr!==null?{id:Gt,overflow:Zt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ot=e,st=null,!0):!1;default:return!1}}function Gu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zu(e){if(me){var t=st;if(t){var n=t;if(!Zf(e,t)){if(Gu(e))throw Error(B(418));t=Hn(n.nextSibling);var r=ot;t&&Zf(e,t)?vm(r,n):(e.flags=e.flags&-4097|2,me=!1,ot=e)}}else{if(Gu(e))throw Error(B(418));e.flags=e.flags&-4097|2,me=!1,ot=e}}}function Jf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ot=e}function xo(e){if(e!==ot)return!1;if(!me)return Jf(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qu(e.type,e.memoizedProps)),t&&(t=st)){if(Gu(e))throw xm(),Error(B(418));for(;t;)vm(e,t),t=Hn(t.nextSibling)}if(Jf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){st=Hn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}st=null}}else st=ot?Hn(e.stateNode.nextSibling):null;return!0}function xm(){for(var e=st;e;)e=Hn(e.nextSibling)}function yi(){st=ot=null,me=!1}function ad(e){bt===null?bt=[e]:bt.push(e)}var Rw=cn.ReactCurrentBatchConfig;function Vi(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(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function wo(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function eh(e){var t=e._init;return t(e._payload)}function wm(e){function t(m,x){if(e){var g=m.deletions;g===null?(m.deletions=[x],m.flags|=16):g.push(x)}}function n(m,x){if(!e)return null;for(;x!==null;)t(m,x),x=x.sibling;return null}function r(m,x){for(m=new Map;x!==null;)x.key!==null?m.set(x.key,x):m.set(x.index,x),x=x.sibling;return m}function i(m,x){return m=Qn(m,x),m.index=0,m.sibling=null,m}function s(m,x,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<x?(m.flags|=2,x):g):(m.flags|=2,x)):(m.flags|=1048576,x)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,x,g,w){return x===null||x.tag!==6?(x=qa(g,m.mode,w),x.return=m,x):(x=i(x,g),x.return=m,x)}function a(m,x,g,w){var _=g.type;return _===zr?f(m,x,g.props.children,w,g.key):x!==null&&(x.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===x.type)?(w=i(x,g.props),w.ref=Vi(m,x,g),w.return=m,w):(w=qo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,x,g),w.return=m,w)}function u(m,x,g,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==g.containerInfo||x.stateNode.implementation!==g.implementation?(x=Xa(g,m.mode,w),x.return=m,x):(x=i(x,g.children||[]),x.return=m,x)}function f(m,x,g,w,_){return x===null||x.tag!==7?(x=pr(g,m.mode,w,_),x.return=m,x):(x=i(x,g),x.return=m,x)}function d(m,x,g){if(typeof x=="string"&&x!==""||typeof x=="number")return x=qa(""+x,m.mode,g),x.return=m,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ao:return g=qo(x.type,x.key,x.props,null,m.mode,g),g.ref=Vi(m,null,x),g.return=m,g;case Pr:return x=Xa(x,m.mode,g),x.return=m,x;case wn:var w=x._init;return d(m,w(x._payload),g)}if(Gi(x)||Ai(x))return x=pr(x,m.mode,g,null),x.return=m,x;wo(m,x)}return null}function c(m,x,g,w){var _=x!==null?x.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return _!==null?null:l(m,x,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ao:return g.key===_?a(m,x,g,w):null;case Pr:return g.key===_?u(m,x,g,w):null;case wn:return _=g._init,c(m,x,_(g._payload),w)}if(Gi(g)||Ai(g))return _!==null?null:f(m,x,g,w,null);wo(m,g)}return null}function h(m,x,g,w,_){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,l(x,m,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ao:return m=m.get(w.key===null?g:w.key)||null,a(x,m,w,_);case Pr:return m=m.get(w.key===null?g:w.key)||null,u(x,m,w,_);case wn:var M=w._init;return h(m,x,g,M(w._payload),_)}if(Gi(w)||Ai(w))return m=m.get(g)||null,f(x,m,w,_,null);wo(x,w)}return null}function v(m,x,g,w){for(var _=null,M=null,N=x,b=x=0,P=null;N!==null&&b<g.length;b++){N.index>b?(P=N,N=null):P=N.sibling;var I=c(m,N,g[b],w);if(I===null){N===null&&(N=P);break}e&&N&&I.alternate===null&&t(m,N),x=s(I,x,b),M===null?_=I:M.sibling=I,M=I,N=P}if(b===g.length)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;b<g.length;b++)N=d(m,g[b],w),N!==null&&(x=s(N,x,b),M===null?_=N:M.sibling=N,M=N);return me&&Zn(m,b),_}for(N=r(m,N);b<g.length;b++)P=h(N,m,b,g[b],w),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?b:P.key),x=s(P,x,b),M===null?_=P:M.sibling=P,M=P);return e&&N.forEach(function(D){return t(m,D)}),me&&Zn(m,b),_}function y(m,x,g,w){var _=Ai(g);if(typeof _!="function")throw Error(B(150));if(g=_.call(g),g==null)throw Error(B(151));for(var M=_=null,N=x,b=x=0,P=null,I=g.next();N!==null&&!I.done;b++,I=g.next()){N.index>b?(P=N,N=null):P=N.sibling;var D=c(m,N,I.value,w);if(D===null){N===null&&(N=P);break}e&&N&&D.alternate===null&&t(m,N),x=s(D,x,b),M===null?_=D:M.sibling=D,M=D,N=P}if(I.done)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;!I.done;b++,I=g.next())I=d(m,I.value,w),I!==null&&(x=s(I,x,b),M===null?_=I:M.sibling=I,M=I);return me&&Zn(m,b),_}for(N=r(m,N);!I.done;b++,I=g.next())I=h(N,m,b,I.value,w),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?b:I.key),x=s(I,x,b),M===null?_=I:M.sibling=I,M=I);return e&&N.forEach(function(F){return t(m,F)}),me&&Zn(m,b),_}function S(m,x,g,w){if(typeof g=="object"&&g!==null&&g.type===zr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ao:e:{for(var _=g.key,M=x;M!==null;){if(M.key===_){if(_=g.type,_===zr){if(M.tag===7){n(m,M.sibling),x=i(M,g.props.children),x.return=m,m=x;break e}}else if(M.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===M.type){n(m,M.sibling),x=i(M,g.props),x.ref=Vi(m,M,g),x.return=m,m=x;break e}n(m,M);break}else t(m,M);M=M.sibling}g.type===zr?(x=pr(g.props.children,m.mode,w,g.key),x.return=m,m=x):(w=qo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,x,g),w.return=m,m=w)}return o(m);case Pr:e:{for(M=g.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===g.containerInfo&&x.stateNode.implementation===g.implementation){n(m,x.sibling),x=i(x,g.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else t(m,x);x=x.sibling}x=Xa(g,m.mode,w),x.return=m,m=x}return o(m);case wn:return M=g._init,S(m,x,M(g._payload),w)}if(Gi(g))return v(m,x,g,w);if(Ai(g))return y(m,x,g,w);wo(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,g),x.return=m,m=x):(n(m,x),x=qa(g,m.mode,w),x.return=m,m=x),o(m)):n(m,x)}return S}var vi=wm(!0),Sm=wm(!1),ml=Kn(null),gl=null,Lr=null,ud=null;function cd(){ud=Lr=gl=null}function dd(e){var t=ml.current;pe(ml),e._currentValue=t}function Ju(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 Yr(e,t){gl=e,ud=Lr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(ud!==e)if(e={context:e,memoizedValue:t,next:null},Lr===null){if(gl===null)throw Error(B(308));Lr=e,gl.dependencies={lanes:0,firstContext:e}}else Lr=Lr.next=e;return t}var nr=null;function fd(e){nr===null?nr=[e]:nr.push(e)}function km(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,fd(t)):(n.next=i.next,i.next=n),t.interleaved=n,ln(e,r)}function ln(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 Sn=!1;function hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Em(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 en(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ln(e,n)}return i=r.interleaved,i===null?(t.next=t,fd(r)):(t.next=i.next,i.next=t),r.interleaved=t,ln(e,n)}function Ho(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,Zc(e,n)}}function th(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 yl(e,t,n,r){var i=e.updateQueue;Sn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=a))}if(s!==null){var d=i.baseState;o=0,f=u=a=null,l=s;do{var c=l.lane,h=l.eventTime;if((r&c)===c){f!==null&&(f=f.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,y=l;switch(c=t,h=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(h,d,c);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,c=typeof v=="function"?v.call(h,d,c):v,c==null)break e;d=xe({},d,c);break e;case 2:Sn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,c=i.effects,c===null?i.effects=[l]:c.push(l))}else h={eventTime:h,lane:c,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=h,a=d):f=f.next=h,o|=c;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;c=l,l=c.next,c.next=null,i.lastBaseUpdate=c,i.shared.pending=null}}while(!0);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);kr|=o,e.lanes=o,e.memoizedState=d}}function nh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(B(191,i));i.call(r)}}}var Zs={},Vt=Kn(Zs),Ns=Kn(Zs),Cs=Kn(Zs);function rr(e){if(e===Zs)throw Error(B(174));return e}function pd(e,t){switch(de(Cs,t),de(Ns,e),de(Vt,Zs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tu(t,e)}pe(Vt),de(Vt,t)}function xi(){pe(Vt),pe(Ns),pe(Cs)}function _m(e){rr(Cs.current);var t=rr(Vt.current),n=Tu(t,e.type);t!==n&&(de(Ns,e),de(Vt,n))}function md(e){Ns.current===e&&(pe(Vt),pe(Ns))}var ye=Kn(0);function vl(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 Ha=[];function gd(){for(var e=0;e<Ha.length;e++)Ha[e]._workInProgressVersionPrimary=null;Ha.length=0}var Bo=cn.ReactCurrentDispatcher,Ba=cn.ReactCurrentBatchConfig,Sr=0,ve=null,be=null,Me=null,xl=!1,ls=!1,bs=0,$w=0;function Oe(){throw Error(B(321))}function yd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!It(e[n],t[n]))return!1;return!0}function vd(e,t,n,r,i,s){if(Sr=s,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bo.current=e===null||e.memoizedState===null?Lw:Fw,e=n(r,i),ls){s=0;do{if(ls=!1,bs=0,25<=s)throw Error(B(301));s+=1,Me=be=null,t.updateQueue=null,Bo.current=Hw,e=n(r,i)}while(ls)}if(Bo.current=wl,t=be!==null&&be.next!==null,Sr=0,Me=be=ve=null,xl=!1,t)throw Error(B(300));return e}function xd(){var e=bs!==0;return bs=0,e}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?ve.memoizedState=Me=e:Me=Me.next=e,Me}function wt(){if(be===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=Me===null?ve.memoizedState:Me.next;if(t!==null)Me=t,be=e;else{if(e===null)throw Error(B(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},Me===null?ve.memoizedState=Me=e:Me=Me.next=e}return Me}function js(e,t){return typeof t=="function"?t(e):t}function Va(e){var t=wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=be,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,a=null,u=s;do{var f=u.lane;if((Sr&f)===f)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,o=r):a=a.next=d,ve.lanes|=f,kr|=f}u=u.next}while(u!==null&&u!==s);a===null?o=r:a.next=l,It(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,ve.lanes|=s,kr|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ua(e){var t=wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);It(s,t.memoizedState)||(Ke=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Nm(){}function Cm(e,t){var n=ve,r=wt(),i=t(),s=!It(r.memoizedState,i);if(s&&(r.memoizedState=i,Ke=!0),r=r.queue,wd(Mm.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Ms(9,jm.bind(null,n,r,i,t),void 0,null),Pe===null)throw Error(B(349));Sr&30||bm(n,t,i)}return i}function bm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jm(e,t,n,r){t.value=n,t.getSnapshot=r,Pm(t)&&zm(e)}function Mm(e,t,n){return n(function(){Pm(t)&&zm(e)})}function Pm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!It(e,n)}catch{return!0}}function zm(e){var t=ln(e,1);t!==null&&zt(t,e,1,-1)}function rh(e){var t=Ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:e},t.queue=e,e=e.dispatch=Aw.bind(null,ve,e),[t.memoizedState,e]}function Ms(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.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 Im(){return wt().memoizedState}function Vo(e,t,n,r){var i=Ot();ve.flags|=e,i.memoizedState=Ms(1|t,n,void 0,r===void 0?null:r)}function Ql(e,t,n,r){var i=wt();r=r===void 0?null:r;var s=void 0;if(be!==null){var o=be.memoizedState;if(s=o.destroy,r!==null&&yd(r,o.deps)){i.memoizedState=Ms(t,n,s,r);return}}ve.flags|=e,i.memoizedState=Ms(1|t,n,s,r)}function ih(e,t){return Vo(8390656,8,e,t)}function wd(e,t){return Ql(2048,8,e,t)}function Tm(e,t){return Ql(4,2,e,t)}function Rm(e,t){return Ql(4,4,e,t)}function $m(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 Om(e,t,n){return n=n!=null?n.concat([e]):null,Ql(4,4,$m.bind(null,t,e),n)}function Sd(){}function Dm(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Am(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Lm(e,t,n){return Sr&21?(It(n,t)||(n=U0(),ve.lanes|=n,kr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function Ow(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Ba.transition;Ba.transition={};try{e(!1),t()}finally{ce=n,Ba.transition=r}}function Fm(){return wt().memoizedState}function Dw(e,t,n){var r=Un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hm(e))Bm(t,n);else if(n=km(e,t,n,r),n!==null){var i=Ue();zt(n,e,r,i),Vm(n,t,r)}}function Aw(e,t,n){var r=Un(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hm(e))Bm(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,It(l,o)){var a=t.interleaved;a===null?(i.next=i,fd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=km(e,t,i,r),n!==null&&(i=Ue(),zt(n,e,r,i),Vm(n,t,r))}}function Hm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Bm(e,t){ls=xl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zc(e,n)}}var wl={readContext:xt,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},Lw={readContext:xt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:ih,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vo(4194308,4,$m.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vo(4,2,e,t)},useMemo:function(e,t){var n=Ot();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ot();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=Dw.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:rh,useDebugValue:Sd,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=rh(!1),t=e[0];return e=Ow.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,i=Ot();if(me){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Pe===null)throw Error(B(349));Sr&30||bm(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ih(Mm.bind(null,r,s,e),[e]),r.flags|=2048,Ms(9,jm.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ot(),t=Pe.identifierPrefix;if(me){var n=Zt,r=Gt;n=(r&~(1<<32-Pt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=$w++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fw={readContext:xt,useCallback:Dm,useContext:xt,useEffect:wd,useImperativeHandle:Om,useInsertionEffect:Tm,useLayoutEffect:Rm,useMemo:Am,useReducer:Va,useRef:Im,useState:function(){return Va(js)},useDebugValue:Sd,useDeferredValue:function(e){var t=wt();return Lm(t,be.memoizedState,e)},useTransition:function(){var e=Va(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Nm,useSyncExternalStore:Cm,useId:Fm,unstable_isNewReconciler:!1},Hw={readContext:xt,useCallback:Dm,useContext:xt,useEffect:wd,useImperativeHandle:Om,useInsertionEffect:Tm,useLayoutEffect:Rm,useMemo:Am,useReducer:Ua,useRef:Im,useState:function(){return Ua(js)},useDebugValue:Sd,useDeferredValue:function(e){var t=wt();return be===null?t.memoizedState=e:Lm(t,be.memoizedState,e)},useTransition:function(){var e=Ua(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Nm,useSyncExternalStore:Cm,useId:Fm,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ec(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Wl={isMounted:function(e){return(e=e._reactInternals)?jr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ue(),i=Un(e),s=en(r,i);s.payload=t,n!=null&&(s.callback=n),t=Bn(e,s,i),t!==null&&(zt(t,e,i,r),Ho(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ue(),i=Un(e),s=en(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Bn(e,s,i),t!==null&&(zt(t,e,i,r),Ho(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ue(),r=Un(e),i=en(n,r);i.tag=2,t!=null&&(i.callback=t),t=Bn(e,i,r),t!==null&&(zt(t,e,r,n),Ho(t,e,r))}};function sh(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Ss(n,r)||!Ss(i,s):!0}function Um(e,t,n){var r=!1,i=qn,s=t.contextType;return typeof s=="object"&&s!==null?s=xt(s):(i=Je(t)?xr:Fe.current,r=t.contextTypes,s=(r=r!=null)?gi(e,i):qn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Wl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function oh(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&&Wl.enqueueReplaceState(t,t.state,null)}function tc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},hd(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=xt(s):(s=Je(t)?xr:Fe.current,i.context=gi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ec(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Wl.enqueueReplaceState(i,i.state,null),yl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wi(e,t){try{var n="",r=t;do n+=m1(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Qa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function nc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Bw=typeof WeakMap=="function"?WeakMap:Map;function Qm(e,t,n){n=en(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){kl||(kl=!0,fc=r),nc(e,t)},n}function Wm(e,t,n){n=en(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){nc(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){nc(e,t),typeof r!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function lh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bw;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=nS.bind(null,e,t,n),t.then(e,e))}function ah(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 uh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=en(-1,1),t.tag=2,Bn(n,t,1))),n.lanes|=1),e)}var Vw=cn.ReactCurrentOwner,Ke=!1;function Ve(e,t,n,r){t.child=e===null?Sm(t,null,n,r):vi(t,e.child,n,r)}function ch(e,t,n,r,i){n=n.render;var s=t.ref;return Yr(t,i),r=vd(e,t,n,r,s,i),n=xd(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,an(e,t,i)):(me&&n&&od(t),t.flags|=1,Ve(e,t,r,i),t.child)}function dh(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Md(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,qm(e,t,s,r,i)):(e=qo(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ss,n(o,r)&&e.ref===t.ref)return an(e,t,i)}return t.flags|=1,e=Qn(s,r),e.ref=t.ref,e.return=t,t.child=e}function qm(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Ss(s,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,an(e,t,i)}return rc(e,t,n,r,i)}function Xm(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},de(Hr,nt),nt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,de(Hr,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,de(Hr,nt),nt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,de(Hr,nt),nt|=r;return Ve(e,t,i,n),t.child}function Ym(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rc(e,t,n,r,i){var s=Je(n)?xr:Fe.current;return s=gi(t,s),Yr(t,i),n=vd(e,t,n,r,s,i),r=xd(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,an(e,t,i)):(me&&r&&od(t),t.flags|=1,Ve(e,t,n,i),t.child)}function fh(e,t,n,r,i){if(Je(n)){var s=!0;fl(t)}else s=!1;if(Yr(t,i),t.stateNode===null)Uo(e,t),Um(t,n,r),tc(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var a=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=xt(u):(u=Je(n)?xr:Fe.current,u=gi(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==u)&&oh(t,o,r,u),Sn=!1;var c=t.memoizedState;o.state=c,yl(t,r,o,i),a=t.memoizedState,l!==r||c!==a||Ze.current||Sn?(typeof f=="function"&&(ec(t,n,f,r),a=t.memoizedState),(l=Sn||sh(t,n,l,r,c,a,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Em(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:kt(t.type,l),o.props=u,d=t.pendingProps,c=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=xt(a):(a=Je(n)?xr:Fe.current,a=gi(t,a));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||c!==a)&&oh(t,o,r,a),Sn=!1,c=t.memoizedState,o.state=c,yl(t,r,o,i);var v=t.memoizedState;l!==d||c!==v||Ze.current||Sn?(typeof h=="function"&&(ec(t,n,h,r),v=t.memoizedState),(u=Sn||sh(t,n,u,r,c,v,a)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=a,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),r=!1)}return ic(e,t,n,r,s,i)}function ic(e,t,n,r,i,s){Ym(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Gf(t,n,!1),an(e,t,s);r=t.stateNode,Vw.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=vi(t,e.child,null,s),t.child=vi(t,null,l,s)):Ve(e,t,l,s),t.memoizedState=r.state,i&&Gf(t,n,!0),t.child}function Km(e){var t=e.stateNode;t.pendingContext?Kf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kf(e,t.context,!1),pd(e,t.containerInfo)}function hh(e,t,n,r,i){return yi(),ad(i),t.flags|=256,Ve(e,t,n,r),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0};function oc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gm(e,t,n){var r=t.pendingProps,i=ye.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),de(ye,i&1),e===null)return Zu(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):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Yl(o,r,0,null),e=pr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=oc(n),t.memoizedState=sc,e):kd(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Uw(e,t,o,r,l,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Qn(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Qn(l,s):(s=pr(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?oc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=sc,r}return s=e.child,e=s.sibling,r=Qn(s,{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 kd(e,t){return t=Yl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function So(e,t,n,r){return r!==null&&ad(r),vi(t,e.child,null,n),e=kd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uw(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Qa(Error(B(422))),So(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Yl({mode:"visible",children:r.children},i,0,null),s=pr(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&vi(t,e.child,null,o),t.child.memoizedState=oc(o),t.memoizedState=sc,s);if(!(t.mode&1))return So(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(B(419)),r=Qa(s,r,void 0),So(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ke||l){if(r=Pe,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,ln(e,i),zt(r,e,i,-1))}return jd(),r=Qa(Error(B(421))),So(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=rS.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,st=Hn(i.nextSibling),ot=t,me=!0,bt=null,e!==null&&(mt[gt++]=Gt,mt[gt++]=Zt,mt[gt++]=wr,Gt=e.id,Zt=e.overflow,wr=t),t=kd(t,r.children),t.flags|=4096,t)}function ph(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ju(e.return,t,n)}function Wa(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Zm(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ve(e,t,r.children,n),r=ye.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&&ph(e,n,t);else if(e.tag===19)ph(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(de(ye,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&vl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Wa(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&vl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Wa(t,!0,n,null,s);break;case"together":Wa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Uo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function an(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),kr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qw(e,t,n){switch(t.tag){case 3:Km(t),yi();break;case 5:_m(t);break;case 1:Je(t.type)&&fl(t);break;case 4:pd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;de(ml,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(de(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?Gm(e,t,n):(de(ye,ye.current&1),e=an(e,t,n),e!==null?e.sibling:null);de(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Zm(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,Xm(e,t,n)}return an(e,t,n)}var Jm,lc,eg,tg;Jm=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}};lc=function(){};eg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,rr(Vt.current);var s=null;switch(n){case"input":i=Mu(e,i),r=Mu(e,r),s=[];break;case"select":i=xe({},i,{value:void 0}),r=xe({},r,{value:void 0}),s=[];break;case"textarea":i=Iu(e,i),r=Iu(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cl)}Ru(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ps.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var a=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ps.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&he("scroll",e),s||l===a||(s=[])):(s=s||[]).push(u,a))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};tg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ui(e,t){if(!me)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 De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ww(e,t,n){var r=t.pendingProps;switch(ld(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return Je(t.type)&&dl(),De(t),null;case 3:return r=t.stateNode,xi(),pe(Ze),pe(Fe),gd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bt!==null&&(mc(bt),bt=null))),lc(e,t),De(t),null;case 5:md(t);var i=rr(Cs.current);if(n=t.type,e!==null&&t.stateNode!=null)eg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return De(t),null}if(e=rr(Vt.current),xo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ht]=t,r[_s]=s,e=(t.mode&1)!==0,n){case"dialog":he("cancel",r),he("close",r);break;case"iframe":case"object":case"embed":he("load",r);break;case"video":case"audio":for(i=0;i<Ji.length;i++)he(Ji[i],r);break;case"source":he("error",r);break;case"img":case"image":case"link":he("error",r),he("load",r);break;case"details":he("toggle",r);break;case"input":Ef(r,s),he("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},he("invalid",r);break;case"textarea":Nf(r,s),he("invalid",r)}Ru(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&vo(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&vo(r.textContent,l,e),i=["children",""+l]):ps.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&he("scroll",r)}switch(n){case"input":uo(r),_f(r,s,!0);break;case"textarea":uo(r),Cf(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=cl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=M0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ht]=t,e[_s]=r,Jm(e,t,!1,!1),t.stateNode=e;e:{switch(o=$u(n,r),n){case"dialog":he("cancel",e),he("close",e),i=r;break;case"iframe":case"object":case"embed":he("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ji.length;i++)he(Ji[i],e);i=r;break;case"source":he("error",e),i=r;break;case"img":case"image":case"link":he("error",e),he("load",e),i=r;break;case"details":he("toggle",e),i=r;break;case"input":Ef(e,r),i=Mu(e,r),he("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=xe({},r,{value:void 0}),he("invalid",e);break;case"textarea":Nf(e,r),i=Iu(e,r),he("invalid",e);break;default:i=r}Ru(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?I0(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&P0(e,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&ms(e,a):typeof a=="number"&&ms(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ps.hasOwnProperty(s)?a!=null&&s==="onScroll"&&he("scroll",e):a!=null&&Wc(e,s,a,o))}switch(n){case"input":uo(e),_f(e,r,!1);break;case"textarea":uo(e),Cf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Wn(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Qr(e,!!r.multiple,s,!1):r.defaultValue!=null&&Qr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=cl)}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 De(t),null;case 6:if(e&&t.stateNode!=null)tg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=rr(Cs.current),rr(Vt.current),xo(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ht]=t,(s=r.nodeValue!==n)&&(e=ot,e!==null))switch(e.tag){case 3:vo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vo(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ht]=t,t.stateNode=r}return De(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&st!==null&&t.mode&1&&!(t.flags&128))xm(),yi(),t.flags|=98560,s=!1;else if(s=xo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(B(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(B(317));s[Ht]=t}else yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),s=!1}else bt!==null&&(mc(bt),bt=null),s=!0;if(!s)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||ye.current&1?je===0&&(je=3):jd())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return xi(),lc(e,t),e===null&&ks(t.stateNode.containerInfo),De(t),null;case 10:return dd(t.type._context),De(t),null;case 17:return Je(t.type)&&dl(),De(t),null;case 19:if(pe(ye),s=t.memoizedState,s===null)return De(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Ui(s,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vl(e),o!==null){for(t.flags|=128,Ui(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return de(ye,ye.current&1|2),t.child}e=e.sibling}s.tail!==null&&_e()>Si&&(t.flags|=128,r=!0,Ui(s,!1),t.lanes=4194304)}else{if(!r)if(e=vl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ui(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!me)return De(t),null}else 2*_e()-s.renderingStartTime>Si&&n!==1073741824&&(t.flags|=128,r=!0,Ui(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=_e(),t.sibling=null,n=ye.current,de(ye,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return bd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nt&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function qw(e,t){switch(ld(t),t.tag){case 1:return Je(t.type)&&dl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xi(),pe(Ze),pe(Fe),gd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return md(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return xi(),null;case 10:return dd(t.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var ko=!1,Le=!1,Xw=typeof WeakSet=="function"?WeakSet:Set,W=null;function Fr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function ac(e,t,n){try{n()}catch(r){Se(e,t,r)}}var mh=!1;function Yw(e,t){if(Qu=ll,e=om(),sd(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 i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,f=0,d=e,c=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(l=o+i),d!==s||r!==0&&d.nodeType!==3||(a=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)c=d,d=h;for(;;){if(d===e)break t;if(c===n&&++u===i&&(l=o),c===s&&++f===r&&(a=o),(h=d.nextSibling)!==null)break;d=c,c=d.parentNode}d=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wu={focusedElem:e,selectionRange:n},ll=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,S=v.memoizedState,m=t.stateNode,x=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:kt(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){Se(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=mh,mh=!1,v}function as(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&ac(t,n,s)}i=i.next}while(i!==r)}}function ql(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 uc(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 ng(e){var t=e.alternate;t!==null&&(e.alternate=null,ng(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[_s],delete t[Yu],delete t[zw],delete t[Iw])),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 rg(e){return e.tag===5||e.tag===3||e.tag===4}function gh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rg(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 cc(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=cl));else if(r!==4&&(e=e.child,e!==null))for(cc(e,t,n),e=e.sibling;e!==null;)cc(e,t,n),e=e.sibling}function dc(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(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}var Ie=null,_t=!1;function pn(e,t,n){for(n=n.child;n!==null;)ig(e,t,n),n=n.sibling}function ig(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Ll,n)}catch{}switch(n.tag){case 5:Le||Fr(n,t);case 6:var r=Ie,i=_t;Ie=null,pn(e,t,n),Ie=r,_t=i,Ie!==null&&(_t?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(_t?(e=Ie,n=n.stateNode,e.nodeType===8?La(e.parentNode,n):e.nodeType===1&&La(e,n),xs(e)):La(Ie,n.stateNode));break;case 4:r=Ie,i=_t,Ie=n.stateNode.containerInfo,_t=!0,pn(e,t,n),Ie=r,_t=i;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ac(n,t,o),i=i.next}while(i!==r)}pn(e,t,n);break;case 1:if(!Le&&(Fr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,pn(e,t,n),Le=r):pn(e,t,n);break;default:pn(e,t,n)}}function yh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Xw),t.forEach(function(r){var i=iS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function St(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Ie=l.stateNode,_t=!1;break e;case 3:Ie=l.stateNode.containerInfo,_t=!0;break e;case 4:Ie=l.stateNode.containerInfo,_t=!0;break e}l=l.return}if(Ie===null)throw Error(B(160));ig(s,o,i),Ie=null,_t=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){Se(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)sg(t,e),t=t.sibling}function sg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(St(t,e),$t(e),r&4){try{as(3,e,e.return),ql(3,e)}catch(y){Se(e,e.return,y)}try{as(5,e,e.return)}catch(y){Se(e,e.return,y)}}break;case 1:St(t,e),$t(e),r&512&&n!==null&&Fr(n,n.return);break;case 5:if(St(t,e),$t(e),r&512&&n!==null&&Fr(n,n.return),e.flags&32){var i=e.stateNode;try{ms(i,"")}catch(y){Se(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&b0(i,s),$u(l,o);var u=$u(l,s);for(o=0;o<a.length;o+=2){var f=a[o],d=a[o+1];f==="style"?I0(i,d):f==="dangerouslySetInnerHTML"?P0(i,d):f==="children"?ms(i,d):Wc(i,f,d,u)}switch(l){case"input":Pu(i,s);break;case"textarea":j0(i,s);break;case"select":var c=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Qr(i,!!s.multiple,h,!1):c!==!!s.multiple&&(s.defaultValue!=null?Qr(i,!!s.multiple,s.defaultValue,!0):Qr(i,!!s.multiple,s.multiple?[]:"",!1))}i[_s]=s}catch(y){Se(e,e.return,y)}}break;case 6:if(St(t,e),$t(e),r&4){if(e.stateNode===null)throw Error(B(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){Se(e,e.return,y)}}break;case 3:if(St(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xs(t.containerInfo)}catch(y){Se(e,e.return,y)}break;case 4:St(t,e),$t(e);break;case 13:St(t,e),$t(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Nd=_e())),r&4&&yh(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Le=(u=Le)||f,St(t,e),Le=u):St(t,e),$t(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(W=e,f=e.child;f!==null;){for(d=W=f;W!==null;){switch(c=W,h=c.child,c.tag){case 0:case 11:case 14:case 15:as(4,c,c.return);break;case 1:Fr(c,c.return);var v=c.stateNode;if(typeof v.componentWillUnmount=="function"){r=c,n=c.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){Se(r,n,y)}}break;case 5:Fr(c,c.return);break;case 22:if(c.memoizedState!==null){xh(d);continue}}h!==null?(h.return=c,W=h):xh(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=z0("display",o))}catch(y){Se(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Se(e,e.return,y)}}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;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:St(t,e),$t(e),r&4&&yh(e);break;case 21:break;default:St(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(rg(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ms(i,""),r.flags&=-33);var s=gh(e);dc(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=gh(e);cc(e,l,o);break;default:throw Error(B(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kw(e,t,n){W=e,og(e)}function og(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ko;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Le;l=ko;var u=Le;if(ko=o,(Le=a)&&!u)for(W=i;W!==null;)o=W,a=o.child,o.tag===22&&o.memoizedState!==null?wh(i):a!==null?(a.return=o,W=a):wh(i);for(;s!==null;)W=s,og(s),s=s.sibling;W=i,ko=l,Le=u}vh(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,W=s):vh(e)}}function vh(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Le||ql(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Le)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&nh(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nh(t,o,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 u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&xs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Le||t.flags&512&&uc(t)}catch(c){Se(t,t.return,c)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function xh(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function wh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ql(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){Se(t,i,a)}}var s=t.return;try{uc(t)}catch(a){Se(t,s,a)}break;case 5:var o=t.return;try{uc(t)}catch(a){Se(t,o,a)}}}catch(a){Se(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var Gw=Math.ceil,Sl=cn.ReactCurrentDispatcher,Ed=cn.ReactCurrentOwner,vt=cn.ReactCurrentBatchConfig,oe=0,Pe=null,Ne=null,Te=0,nt=0,Hr=Kn(0),je=0,Ps=null,kr=0,Xl=0,_d=0,us=null,Ye=null,Nd=0,Si=1/0,Xt=null,kl=!1,fc=null,Vn=null,Eo=!1,Dn=null,El=0,cs=0,hc=null,Qo=-1,Wo=0;function Ue(){return oe&6?_e():Qo!==-1?Qo:Qo=_e()}function Un(e){return e.mode&1?oe&2&&Te!==0?Te&-Te:Rw.transition!==null?(Wo===0&&(Wo=U0()),Wo):(e=ce,e!==0||(e=window.event,e=e===void 0?16:G0(e.type)),e):1}function zt(e,t,n,r){if(50<cs)throw cs=0,hc=null,Error(B(185));Ys(e,n,r),(!(oe&2)||e!==Pe)&&(e===Pe&&(!(oe&2)&&(Xl|=n),je===4&&_n(e,Te)),et(e,r),n===1&&oe===0&&!(t.mode&1)&&(Si=_e()+500,Ul&&Gn()))}function et(e,t){var n=e.callbackNode;R1(e,t);var r=ol(e,e===Pe?Te:0);if(r===0)n!==null&&Mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mf(n),t===1)e.tag===0?Tw(Sh.bind(null,e)):gm(Sh.bind(null,e)),Mw(function(){!(oe&6)&&Gn()}),n=null;else{switch(Q0(r)){case 1:n=Gc;break;case 4:n=B0;break;case 16:n=sl;break;case 536870912:n=V0;break;default:n=sl}n=pg(n,lg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function lg(e,t){if(Qo=-1,Wo=0,oe&6)throw Error(B(327));var n=e.callbackNode;if(Kr()&&e.callbackNode!==n)return null;var r=ol(e,e===Pe?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_l(e,r);else{t=r;var i=oe;oe|=2;var s=ug();(Pe!==e||Te!==t)&&(Xt=null,Si=_e()+500,hr(e,t));do try{eS();break}catch(l){ag(e,l)}while(!0);cd(),Sl.current=s,oe=i,Ne!==null?t=0:(Pe=null,Te=0,t=je)}if(t!==0){if(t===2&&(i=Fu(e),i!==0&&(r=i,t=pc(e,i))),t===1)throw n=Ps,hr(e,0),_n(e,r),et(e,_e()),n;if(t===6)_n(e,r);else{if(i=e.current.alternate,!(r&30)&&!Zw(i)&&(t=_l(e,r),t===2&&(s=Fu(e),s!==0&&(r=s,t=pc(e,s))),t===1))throw n=Ps,hr(e,0),_n(e,r),et(e,_e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Jn(e,Ye,Xt);break;case 3:if(_n(e,r),(r&130023424)===r&&(t=Nd+500-_e(),10<t)){if(ol(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ue(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xu(Jn.bind(null,e,Ye,Xt),t);break}Jn(e,Ye,Xt);break;case 4:if(_n(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Pt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Gw(r/1960))-r,10<r){e.timeoutHandle=Xu(Jn.bind(null,e,Ye,Xt),r);break}Jn(e,Ye,Xt);break;case 5:Jn(e,Ye,Xt);break;default:throw Error(B(329))}}}return et(e,_e()),e.callbackNode===n?lg.bind(null,e):null}function pc(e,t){var n=us;return e.current.memoizedState.isDehydrated&&(hr(e,t).flags|=256),e=_l(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&mc(t)),e}function mc(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function Zw(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 i=n[r],s=i.getSnapshot;i=i.value;try{if(!It(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _n(e,t){for(t&=~_d,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pt(t),r=1<<n;e[n]=-1,t&=~r}}function Sh(e){if(oe&6)throw Error(B(327));Kr();var t=ol(e,0);if(!(t&1))return et(e,_e()),null;var n=_l(e,t);if(e.tag!==0&&n===2){var r=Fu(e);r!==0&&(t=r,n=pc(e,r))}if(n===1)throw n=Ps,hr(e,0),_n(e,t),et(e,_e()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jn(e,Ye,Xt),et(e,_e()),null}function Cd(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Si=_e()+500,Ul&&Gn())}}function Er(e){Dn!==null&&Dn.tag===0&&!(oe&6)&&Kr();var t=oe;oe|=1;var n=vt.transition,r=ce;try{if(vt.transition=null,ce=1,e)return e()}finally{ce=r,vt.transition=n,oe=t,!(oe&6)&&Gn()}}function bd(){nt=Hr.current,pe(Hr)}function hr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jw(n)),Ne!==null)for(n=Ne.return;n!==null;){var r=n;switch(ld(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dl();break;case 3:xi(),pe(Ze),pe(Fe),gd();break;case 5:md(r);break;case 4:xi();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:dd(r.type._context);break;case 22:case 23:bd()}n=n.return}if(Pe=e,Ne=e=Qn(e.current,null),Te=nt=t,je=0,Ps=null,_d=Xl=kr=0,Ye=us=null,nr!==null){for(t=0;t<nr.length;t++)if(n=nr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}nr=null}return e}function ag(e,t){do{var n=Ne;try{if(cd(),Bo.current=wl,xl){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}xl=!1}if(Sr=0,Me=be=ve=null,ls=!1,bs=0,Ed.current=null,n===null||n.return===null){je=1,Ps=t,Ne=null;break}e:{var s=e,o=n.return,l=n,a=t;if(t=Te,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var c=f.alternate;c?(f.updateQueue=c.updateQueue,f.memoizedState=c.memoizedState,f.lanes=c.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=ah(o);if(h!==null){h.flags&=-257,uh(h,o,l,s,t),h.mode&1&&lh(s,u,t),t=h,a=u;var v=t.updateQueue;if(v===null){var y=new Set;y.add(a),t.updateQueue=y}else v.add(a);break e}else{if(!(t&1)){lh(s,u,t),jd();break e}a=Error(B(426))}}else if(me&&l.mode&1){var S=ah(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),uh(S,o,l,s,t),ad(wi(a,l));break e}}s=a=wi(a,l),je!==4&&(je=2),us===null?us=[s]:us.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Qm(s,a,t);th(s,m);break e;case 1:l=a;var x=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Vn===null||!Vn.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=Wm(s,l,t);th(s,w);break e}}s=s.return}while(s!==null)}dg(n)}catch(_){t=_,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(!0)}function ug(){var e=Sl.current;return Sl.current=wl,e===null?wl:e}function jd(){(je===0||je===3||je===2)&&(je=4),Pe===null||!(kr&268435455)&&!(Xl&268435455)||_n(Pe,Te)}function _l(e,t){var n=oe;oe|=2;var r=ug();(Pe!==e||Te!==t)&&(Xt=null,hr(e,t));do try{Jw();break}catch(i){ag(e,i)}while(!0);if(cd(),oe=n,Sl.current=r,Ne!==null)throw Error(B(261));return Pe=null,Te=0,je}function Jw(){for(;Ne!==null;)cg(Ne)}function eS(){for(;Ne!==null&&!N1();)cg(Ne)}function cg(e){var t=hg(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?dg(e):Ne=t,Ed.current=null}function dg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=qw(n,t),n!==null){n.flags&=32767,Ne=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Ne=null;return}}else if(n=Ww(n,t,nt),n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);je===0&&(je=5)}function Jn(e,t,n){var r=ce,i=vt.transition;try{vt.transition=null,ce=1,tS(e,t,n,r)}finally{vt.transition=i,ce=r}return null}function tS(e,t,n,r){do Kr();while(Dn!==null);if(oe&6)throw Error(B(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if($1(e,s),e===Pe&&(Ne=Pe=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Eo||(Eo=!0,pg(sl,function(){return Kr(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=vt.transition,vt.transition=null;var o=ce;ce=1;var l=oe;oe|=4,Ed.current=null,Yw(e,n),sg(n,e),Sw(Wu),ll=!!Qu,Wu=Qu=null,e.current=n,Kw(n),C1(),oe=l,ce=o,vt.transition=s}else e.current=n;if(Eo&&(Eo=!1,Dn=e,El=i),s=e.pendingLanes,s===0&&(Vn=null),M1(n.stateNode),et(e,_e()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(kl)throw kl=!1,e=fc,fc=null,e;return El&1&&e.tag!==0&&Kr(),s=e.pendingLanes,s&1?e===hc?cs++:(cs=0,hc=e):cs=0,Gn(),null}function Kr(){if(Dn!==null){var e=Q0(El),t=vt.transition,n=ce;try{if(vt.transition=null,ce=16>e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,El=0,oe&6)throw Error(B(331));var i=oe;for(oe|=4,W=e.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var f=W;switch(f.tag){case 0:case 11:case 15:as(8,f,s)}var d=f.child;if(d!==null)d.return=f,W=d;else for(;W!==null;){f=W;var c=f.sibling,h=f.return;if(ng(f),f===u){W=null;break}if(c!==null){c.return=h,W=c;break}W=h}}}var v=s.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var S=y.sibling;y.sibling=null,y=S}while(y!==null)}}W=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,W=o;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:as(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,W=m;break e}W=s.return}}var x=e.current;for(W=x;W!==null;){o=W;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,W=g;else e:for(o=x;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ql(9,l)}}catch(_){Se(l,l.return,_)}if(l===o){W=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,W=w;break e}W=l.return}}if(oe=i,Gn(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Ll,e)}catch{}r=!0}return r}finally{ce=n,vt.transition=t}}return!1}function kh(e,t,n){t=wi(n,t),t=Qm(e,t,1),e=Bn(e,t,1),t=Ue(),e!==null&&(Ys(e,1,t),et(e,t))}function Se(e,t,n){if(e.tag===3)kh(e,e,n);else for(;t!==null;){if(t.tag===3){kh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vn===null||!Vn.has(r))){e=wi(n,e),e=Wm(t,e,1),t=Bn(t,e,1),e=Ue(),t!==null&&(Ys(t,1,e),et(t,e));break}}t=t.return}}function nS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ue(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Te&n)===n&&(je===4||je===3&&(Te&130023424)===Te&&500>_e()-Nd?hr(e,0):_d|=n),et(e,t)}function fg(e,t){t===0&&(e.mode&1?(t=ho,ho<<=1,!(ho&130023424)&&(ho=4194304)):t=1);var n=Ue();e=ln(e,t),e!==null&&(Ys(e,t,n),et(e,n))}function rS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fg(e,n)}function iS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),fg(e,n)}var hg;hg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ze.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,Qw(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,me&&t.flags&1048576&&ym(t,pl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Uo(e,t),e=t.pendingProps;var i=gi(t,Fe.current);Yr(t,n),i=vd(null,t,r,e,i,n);var s=xd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Je(r)?(s=!0,fl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hd(t),i.updater=Wl,t.stateNode=i,i._reactInternals=t,tc(t,r,e,n),t=ic(null,t,r,!0,s,n)):(t.tag=0,me&&s&&od(t),Ve(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Uo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=oS(r),e=kt(r,e),i){case 0:t=rc(null,t,r,e,n);break e;case 1:t=fh(null,t,r,e,n);break e;case 11:t=ch(null,t,r,e,n);break e;case 14:t=dh(null,t,r,kt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kt(r,i),rc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kt(r,i),fh(e,t,r,i,n);case 3:e:{if(Km(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Em(e,t),yl(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=wi(Error(B(423)),t),t=hh(e,t,r,n,i);break e}else if(r!==i){i=wi(Error(B(424)),t),t=hh(e,t,r,n,i);break e}else for(st=Hn(t.stateNode.containerInfo.firstChild),ot=t,me=!0,bt=null,n=Sm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){t=an(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return _m(t),e===null&&Zu(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,qu(r,i)?o=null:s!==null&&qu(r,s)&&(t.flags|=32),Ym(e,t),Ve(e,t,o,n),t.child;case 6:return e===null&&Zu(t),null;case 13:return Gm(e,t,n);case 4:return pd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vi(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kt(r,i),ch(e,t,r,i,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,de(ml,r._currentValue),r._currentValue=o,s!==null)if(It(s.value,o)){if(s.children===i.children&&!Ze.current){t=an(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=en(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ju(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(B(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ju(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ve(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Yr(t,n),i=xt(i),r=r(i),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,i=kt(r,t.pendingProps),i=kt(r.type,i),dh(e,t,r,i,n);case 15:return qm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kt(r,i),Uo(e,t),t.tag=1,Je(r)?(e=!0,fl(t)):e=!1,Yr(t,n),Um(t,r,i),tc(t,r,i,n),ic(null,t,r,!0,e,n);case 19:return Zm(e,t,n);case 22:return Xm(e,t,n)}throw Error(B(156,t.tag))};function pg(e,t){return H0(e,t)}function sS(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 yt(e,t,n,r){return new sS(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oS(e){if(typeof e=="function")return Md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xc)return 11;if(e===Yc)return 14}return 2}function Qn(e,t){var n=e.alternate;return n===null?(n=yt(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 qo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Md(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case zr:return pr(n.children,i,s,t);case qc:o=8,i|=8;break;case Nu:return e=yt(12,n,t,i|2),e.elementType=Nu,e.lanes=s,e;case Cu:return e=yt(13,n,t,i),e.elementType=Cu,e.lanes=s,e;case bu:return e=yt(19,n,t,i),e.elementType=bu,e.lanes=s,e;case _0:return Yl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k0:o=10;break e;case E0:o=9;break e;case Xc:o=11;break e;case Yc:o=14;break e;case wn:o=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=yt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function pr(e,t,n,r){return e=yt(7,e,r,t),e.lanes=n,e}function Yl(e,t,n,r){return e=yt(22,e,r,t),e.elementType=_0,e.lanes=n,e.stateNode={isHidden:!1},e}function qa(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Xa(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lS(e,t,n,r,i){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=ja(0),this.expirationTimes=ja(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pd(e,t,n,r,i,s,o,l,a){return e=new lS(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=yt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hd(s),e}function aS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function mg(e){if(!e)return qn;e=e._reactInternals;e:{if(jr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Je(n))return mm(e,n,t)}return t}function gg(e,t,n,r,i,s,o,l,a){return e=Pd(n,r,!0,e,i,s,o,l,a),e.context=mg(null),n=e.current,r=Ue(),i=Un(n),s=en(r,i),s.callback=t??null,Bn(n,s,i),e.current.lanes=i,Ys(e,i,r),et(e,r),e}function Kl(e,t,n,r){var i=t.current,s=Ue(),o=Un(i);return n=mg(n),t.context===null?t.context=n:t.pendingContext=n,t=en(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Bn(i,t,o),e!==null&&(zt(e,i,o,s),Ho(e,i,o)),o}function Nl(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 Eh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function zd(e,t){Eh(e,t),(e=e.alternate)&&Eh(e,t)}function uS(){return null}var yg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Id(e){this._internalRoot=e}Gl.prototype.render=Id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Kl(e,t,null,null)};Gl.prototype.unmount=Id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Er(function(){Kl(null,e,null,null)}),t[on]=null}};function Gl(e){this._internalRoot=e}Gl.prototype.unstable_scheduleHydration=function(e){if(e){var t=X0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<En.length&&t!==0&&t<En[n].priority;n++);En.splice(n,0,e),n===0&&K0(e)}};function Td(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _h(){}function cS(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Nl(o);s.call(u)}}var o=gg(t,r,e,0,null,!1,!1,"",_h);return e._reactRootContainer=o,e[on]=o.current,ks(e.nodeType===8?e.parentNode:e),Er(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Nl(a);l.call(u)}}var a=Pd(e,0,!1,null,null,!1,!1,"",_h);return e._reactRootContainer=a,e[on]=a.current,ks(e.nodeType===8?e.parentNode:e),Er(function(){Kl(t,a,n,r)}),a}function Jl(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=Nl(o);l.call(a)}}Kl(t,o,e,i)}else o=cS(n,t,e,i,r);return Nl(o)}W0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zi(t.pendingLanes);n!==0&&(Zc(t,n|1),et(t,_e()),!(oe&6)&&(Si=_e()+500,Gn()))}break;case 13:Er(function(){var r=ln(e,1);if(r!==null){var i=Ue();zt(r,e,1,i)}}),zd(e,1)}};Jc=function(e){if(e.tag===13){var t=ln(e,134217728);if(t!==null){var n=Ue();zt(t,e,134217728,n)}zd(e,134217728)}};q0=function(e){if(e.tag===13){var t=Un(e),n=ln(e,t);if(n!==null){var r=Ue();zt(n,e,t,r)}zd(e,t)}};X0=function(){return ce};Y0=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};Du=function(e,t,n){switch(t){case"input":if(Pu(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 i=Vl(r);if(!i)throw Error(B(90));C0(r),Pu(r,i)}}}break;case"textarea":j0(e,n);break;case"select":t=n.value,t!=null&&Qr(e,!!n.multiple,t,!1)}};$0=Cd;O0=Er;var dS={usingClientEntryPoint:!1,Events:[Gs,$r,Vl,T0,R0,Cd]},Qi={findFiberByHostInstance:tr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fS={bundleType:Qi.bundleType,version:Qi.version,rendererPackageName:Qi.rendererPackageName,rendererConfig:Qi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=L0(e),e===null?null:e.stateNode},findFiberByHostInstance:Qi.findFiberByHostInstance||uS,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 _o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_o.isDisabled&&_o.supportsFiber)try{Ll=_o.inject(fS),Bt=_o}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dS;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Td(t))throw Error(B(200));return aS(e,t,null,n)};ut.createRoot=function(e,t){if(!Td(e))throw Error(B(299));var n=!1,r="",i=yg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Pd(e,1,!1,null,null,n,!1,r,i),e[on]=t.current,ks(e.nodeType===8?e.parentNode:e),new Id(t)};ut.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(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=L0(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return Er(e)};ut.hydrate=function(e,t,n){if(!Zl(t))throw Error(B(200));return Jl(null,e,t,!0,n)};ut.hydrateRoot=function(e,t,n){if(!Td(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=yg;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=gg(t,null,e,1,n??null,i,!1,s,o),e[on]=t.current,ks(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Gl(t)};ut.render=function(e,t,n){if(!Zl(t))throw Error(B(200));return Jl(null,e,t,!1,n)};ut.unmountComponentAtNode=function(e){if(!Zl(e))throw Error(B(40));return e._reactRootContainer?(Er(function(){Jl(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};ut.unstable_batchedUpdates=Cd;ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Jl(e,t,n,!1,r)};ut.version="18.3.1-next-f1338f8080-20240426";function vg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vg)}catch(e){console.error(e)}}vg(),v0.exports=ut;var hS=v0.exports,xg,Nh=hS;xg=Nh.createRoot,Nh.hydrateRoot;function pS(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function mS(e){const t=new Map,n=[];for(const i of e){const s=i.subId??i.name??i.process;if(s===void 0){n.push(i);continue}const o=t.get(s),l=o??{id:s,name:i.name??s,phases:[],logs:[]};o||t.set(s,l),i.name!==void 0&&(l.name=i.name),i.group!==void 0&&(l.group=i.group),i.status!==void 0?(l.terminal=i,l.status=i.status):i.phase!==void 0?l.phases.push(i):l.logs.push(i)}return{subs:[...t.values()].map(i=>{var f;const s=[...i.phases,...i.logs],o=[...s,...i.terminal?[i.terminal]:[]].map(d=>d.at),l=o.length?o.reduce((d,c)=>c<d?c:d,Number.POSITIVE_INFINITY):void 0,u=pS((f=i.terminal)==null?void 0:f.data)??(i.terminal&&l!==void 0&&s.length>0?i.terminal.at-l:void 0);return{...i,startedAt:l,durationMs:u}}),stepLogs:n}}function Rd(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 wg(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}/api`}async function mn(e,t){const n=await fetch(wg()+e,t);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const rt={runs(e,t,n){const r=new URLSearchParams;e&&r.set("status",e),t&&r.set("tag",t);for(const s of n??[])r.append("attr",s);const i=r.toString();return mn(i?`/runs?${i}`:"/runs")},run(e){return mn(`/runs/${encodeURIComponent(e)}`)},workers(){return mn("/workers")},retry(e){return mn(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return mn(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=new URLSearchParams;t.status&&n.set("status",t.status),t.tag&&n.set("tag",t.tag);for(const i of t.attr??[])n.append("attr",i);const r=n.toString();return mn(`/bulk/${e}${r?`?${r}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return mn(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},continue(e){return mn(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${wg()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function gS(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 s,o;if((r.status==="pending"||r.status==="running")&&(((s=r.events)==null?void 0:s.length)??0)===0){const l=(o=n.get(r.seq))==null?void 0:o.events;if(l!=null&&l.length)return{...r,events:l}}return r})}}function $d(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)}const Tt={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function Sg(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),p.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function yS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function vS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"13",r:"8"}),p.jsx("path",{d:"M12 13V9M9 2h6"})]})}function xS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"12",r:"2"}),p.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 kg(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"m4 12 5 5L20 6"})})}function ki(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function wS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),p.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function Ya(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Eg(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function SS(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 4l14 8-14 8z"})})}function Od(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"6",cy:"5",r:"2"}),p.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),p.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const kS={local:Sg,remote:yS,sleep:vS,signal:xS,child:Od};function Dd(e){return kS[e]??Sg}const gc={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function _g(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const ES={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"},_S={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Ad({run:e,timeline:t,depth:n,selectedKey:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l}){const{span:a,rows:u}=R.useMemo(()=>{const h=t.map(_=>new Date(_.startedAt).getTime()),v=t.map(_=>new Date(_.finishedAt).getTime()),y=Math.min(new Date(e.createdAt).getTime(),...h),S=e.status==="running"||e.status==="suspended",m=Math.max(...v,S?Date.now():y+1),x=Math.max(m-y,1);let g=y;const w=t.map(_=>{const M=new Date(_.finishedAt).getTime(),N=g;g=M;const b=new Date(_.startedAt).getTime();let P=b;const I=(_.events??[]).filter(D=>D.status).sort((D,F)=>D.at-F.at).map((D,F)=>{const A=Math.min(Math.max(D.at,b),M),E=P;return P=A,{key:`${D.name??"sub"}-${D.at}-${F}`,name:D.name??"sub-process",status:D.status,left:(E-y)/x*100,width:Math.max((A-E)/x*100,.8),ms:A-E}});return{step:_,left:(N-y)/x*100,width:Math.max((M-N)/x*100,.8),ms:M-N,subRows:I}});return{span:x,rows:w}},[e,t]),[f,d]=R.useState(new Set),c=h=>d(v=>{const y=new Set(v);return y.has(h)?y.delete(h):y.add(h),y});return p.jsx(p.Fragment,{children:u.map(({step:h,left:v,width:y,ms:S,subRows:m})=>{const x=h.status==="failed",g=$d(h),w=!!g,_=w?Od:Dd(h.kind),M=r===`${h.runId}#${h.seq}`,N=w&&g!==void 0&&o.has(g),b=m.length>0&&!w,P=f.has(h.seq);return p.jsxs("div",{children:[p.jsxs("button",{type:"button",onClick:()=>i(h,e),title:w?"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 ${M?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[p.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[w&&g!==void 0&&p.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),l(g)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:N?"Collapse child run":"Expand child run inline",children:p.jsx("span",{className:"inline-block transition-transform",style:{transform:N?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),b&&p.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),c(h.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:P?`Show ${m.length} sub-process(es)`:"Hide sub-processes",children:p.jsx("span",{className:"inline-block transition-transform",style:{transform:P?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),p.jsx("span",{className:x?"text-red-400":w?"text-indigo-300":"text-emerald-400",children:p.jsx(_,{width:12,height:12})}),p.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:h.name}),w&&g!==void 0&&p.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),s(g)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),p.jsxs("span",{className:"relative h-5",children:[p.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),p.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] ${x?"bg-red-500/35 ring-1 ring-red-500/50":M?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${v}%`,width:`${y}%`}}),p.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(${v+y}%, calc(100% - 44px))`},children:_g(S)})]})]}),m.length>0&&!P&&p.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-[var(--line-soft)] pl-2",children:m.map(I=>p.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${I.name} — ${I.status}`,children:[p.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[p.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${_S[I.status]}`}),p.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:I.name})]}),p.jsxs("span",{className:"relative h-3",children:[p.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),p.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] ${ES[I.status]}`,style:{left:`${I.left}%`,width:`${I.width}%`}})]})]},I.key))}),w&&g!==void 0&&N&&p.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-[var(--line-soft)] pl-2",children:p.jsx(NS,{id:g,depth:n+1,selectedKey:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l})})]},h.seq)})})}function NS({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o}){const{data:l}=pi({queryKey:["run",e],queryFn:()=>rt.run(e)});return t>6?null:l?p.jsxs("div",{className:"my-1 rounded-md border border-[var(--line)] bg-black/15",children:[p.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[p.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),p.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),p.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),p.jsx("button",{type:"button",onClick:()=>i(e),className:"ml-auto rounded border border-[var(--line)] px-1.5 text-zinc-400 hover:text-zinc-200",children:"open ↗"})]}),p.jsx(Ad,{run:l.run,timeline:l.timeline,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o})]}):p.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}function CS({run:e,timeline:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o}){const l=R.useMemo(()=>{const f=t.map(y=>new Date(y.startedAt).getTime()),d=t.map(y=>new Date(y.finishedAt).getTime()),c=Math.min(new Date(e.createdAt).getTime(),...f),h=e.status==="running"||e.status==="suspended",v=Math.max(...d,h?Date.now():c+1);return Math.max(v-c,1)},[e,t]),a=s??new Set,u=o??(()=>{});return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[p.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),p.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",_g(l)]})]}),p.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:p.jsx(Ad,{run:e,timeline:t,depth:0,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:u})})]})}function Cl(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Ch(e,t){return Cl(new Date(t).getTime()-new Date(e).getTime())}function bh(e){return Ld(new Date(e).getTime())}function Ld(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const Ng={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"},bS={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},jS=["ok","failed","skipped"];function Cg({e}){return p.jsxs("div",{className:"flex gap-2 py-0.5",children:[p.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:Ld(e.at)}),p.jsx("span",{className:`shrink-0 uppercase ${bS[e.level]}`,children:e.level}),p.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function jh({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,[i,s]=R.useState(e.status==="failed"),o=e.status?Ng[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return p.jsxs("li",{className:`rounded-md border ${o}`,children:[p.jsxs("button",{type:"button",disabled:!r,onClick:()=>s(u=>!u),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?i:void 0,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&p.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${i?"":"-rotate-90"}`,children:"▼"}),p.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&p.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),p.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&p.jsx("span",{className:"tnum text-zinc-400",children:Cl(e.durationMs)}),p.jsx("span",{children:e.status??"running"})]})]}),i&&p.jsxs("div",{className:"border-t border-[var(--line)]/60 px-2.5 py-2",children:[e.phases.length>0&&p.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((u,f)=>p.jsxs("li",{className:"flex gap-2",children:[p.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:Ld(u.at)}),p.jsx("span",{className:"text-zinc-400",children:u.phase}),e.startedAt!==void 0&&p.jsxs("span",{className:"text-zinc-600 tnum",children:["+",Cl(u.at-e.startedAt)]})]},`${u.at}-${u.phase}-${f}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&p.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-[var(--line)] bg-black/20 text-zinc-300"}`,children:e.terminal.message}),e.logs.length>0&&p.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((u,f)=>p.jsx(Cg,{e:u},`${u.at}-${f}`))})]})]})}function MS({events:e}){const{subs:t,stepLogs:n}=mS(e),r=jS.map(s=>[s,t.filter(o=>o.status===s).length]).filter(([,s])=>s>0),i=t.some(s=>s.group);return p.jsxs(p.Fragment,{children:[t.length>0&&p.jsxs("section",{className:"rise",children:[p.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[p.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),p.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([s,o])=>p.jsxs("span",{className:Ng[s].split(" ").pop(),children:[o," ",s]},s))})]}),i?Object.entries(t.reduce((s,o)=>{const l=o.group??"—";return s[l]===void 0&&(s[l]=[]),s[l].push(o),s},{})).sort(([s],[o])=>s==="—"?1:o==="—"?-1:s.localeCompare(o)).map(([s,o])=>p.jsxs("div",{className:"mb-2",children:[p.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:s}),p.jsx("ul",{className:"flex flex-col gap-1",children:o.map(l=>p.jsx(jh,{sub:l,showGroup:!1},l.id))})]},s)):p.jsx("ul",{className:"flex flex-col gap-1",children:t.map(s=>p.jsx(jh,{sub:s},s.id))})]}),n.length>0&&p.jsxs("section",{className:"rise",children:[p.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),p.jsx("div",{className:"mono max-h-64 overflow-auto rounded-lg border border-[var(--line)] bg-black/40 p-2.5 text-[11px] leading-relaxed",children:n.map((s,o)=>p.jsx(Cg,{e:s},`${s.at}-${o}`))})]})]})}function PS({value:e}){const[t,n]=R.useState(!1);return p.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded border border-[var(--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?p.jsx(kg,{width:11,height:11}):p.jsx(wS,{width:11,height:11}),t?"copied":"copy"]})}function bl({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return p.jsxs("section",{className:"rise",children:[p.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[p.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),p.jsx(PS,{value:n})]}),p.jsx("pre",{className:"mono max-h-64 overflow-auto rounded-lg border border-[var(--line)] bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300",children:n})]})}function gn({k:e,v:t,mono:n=!0}){return p.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[p.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),p.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function zS({id:e,onOpenRun:t}){const{data:n}=pi({queryKey:["run",e],queryFn:()=>rt.run(e)}),[r,i]=R.useState(new Set),s=o=>i(l=>{const a=new Set(l);return a.has(o)?a.delete(o):a.add(o),a});return n?n.timeline.length===0?p.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):p.jsx("div",{className:"mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-[var(--line)] bg-black/20 p-1.5",children:p.jsx(Ad,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:s})}):p.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function IS({step:e,run:t,onClose:n,onOpenRun:r}){const i=$d(e),[s,o]=R.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",u=Dd(e.kind),f=Ch(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return p.jsxs("aside",{className:"absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-[var(--line)] bg-[var(--panel)]/95 shadow-2xl backdrop-blur-md rise",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${l?"bg-red-500/15 text-red-300":a?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:p.jsx(u,{width:13,height:13})}),p.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),p.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",gc[e.kind]??e.kind]})]}),p.jsx("button",{type:"button",onClick:n,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-[var(--line)] text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:p.jsx(ki,{})})]}),p.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[p.jsxs("div",{className:"rounded-lg border border-[var(--line)] bg-black/20 px-3.5 py-1",children:[p.jsx(gn,{k:"seq",v:`#${e.seq}`}),d>=1&&p.jsx(gn,{k:"queued",v:p.jsx("span",{className:"text-sky-300",children:Cl(d)})}),p.jsx(gn,{k:"duration",v:a?p.jsx("span",{className:"text-amber-300",children:"running…"}):Ch(e.startedAt,e.finishedAt)}),p.jsx(gn,{k:"attempts",v:p.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&p.jsx(Eg,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&p.jsx(gn,{k:"worker",v:`@${e.workerGroup}`}),p.jsx(gn,{k:"started",v:bh(e.startedAt)}),p.jsx(gn,{k:"finished",v:bh(e.finishedAt)}),p.jsx(gn,{k:"offset",v:`+${f}`})]}),l&&e.error&&p.jsxs("section",{className:"rise",children:[p.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),p.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.error.message})]}),e.events&&e.events.length>0&&p.jsx(MS,{events:e.events}),i&&p.jsxs("section",{className:"rise",children:[p.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[p.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&p.jsx("button",{type:"button",onClick:()=>r(i),className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",children:"open ↗"})]}),p.jsxs("button",{type:"button",onClick:()=>o(c=>!c),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:s?"Collapse child run":"Expand child run inline",children:[p.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:s?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),p.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:i})]}),s&&p.jsx(zS,{id:i,onOpenRun:r})]}),e.input!==void 0&&p.jsx(bl,{label:"input",value:e.input}),e.output!==void 0&&p.jsx(bl,{label:"output",value:e.output})]})]})}function TS({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return p.jsxs("aside",{className:"absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-[var(--line)] bg-[var(--panel)]/95 shadow-2xl backdrop-blur-md rise",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),p.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),p.jsx("button",{type:"button",onClick:t,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-[var(--line)] text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:p.jsx(ki,{})})]}),p.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&p.jsxs("section",{className:"rise",children:[p.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),p.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.error.message})]}),e.input!==void 0&&p.jsx(bl,{label:"input",value:e.input}),e.output!==void 0&&p.jsx(bl,{label:"output",value:e.output}),n&&p.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function Ce(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=Ce(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var RS={value:()=>{}};function ea(){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 Xo(n)}function Xo(e){this._=e}function $S(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Xo.prototype=ea.prototype={constructor:Xo,on:function(e,t){var n=this._,r=$S(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=OS(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(i=(e=r[s]).type)n[i]=Mh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Mh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Xo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[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],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function OS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Mh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=RS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yc="http://www.w3.org/1999/xhtml";const Ph={svg:"http://www.w3.org/2000/svg",xhtml:yc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ta(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ph.hasOwnProperty(t)?{space:Ph[t],local:e}:e}function DS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yc&&t.documentElement.namespaceURI===yc?t.createElement(e):t.createElementNS(n,e)}}function AS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bg(e){var t=ta(e);return(t.local?AS:DS)(t)}function LS(){}function Fd(e){return e==null?LS:function(){return this.querySelector(e)}}function FS(e){typeof e!="function"&&(e=Fd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=new Array(o),a,u,f=0;f<o;++f)(a=s[f])&&(u=e.call(a,a.__data__,f,s))&&("__data__"in a&&(u.__data__=a.__data__),l[f]=u);return new at(r,this._parents)}function HS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function BS(){return[]}function jg(e){return e==null?BS:function(){return this.querySelectorAll(e)}}function VS(e){return function(){return HS(e.apply(this,arguments))}}function US(e){typeof e=="function"?e=VS(e):e=jg(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var o=t[s],l=o.length,a,u=0;u<l;++u)(a=o[u])&&(r.push(e.call(a,a.__data__,u,o)),i.push(a));return new at(r,i)}function Mg(e){return function(){return this.matches(e)}}function Pg(e){return function(t){return t.matches(e)}}var QS=Array.prototype.find;function WS(e){return function(){return QS.call(this.children,e)}}function qS(){return this.firstElementChild}function XS(e){return this.select(e==null?qS:WS(typeof e=="function"?e:Pg(e)))}var YS=Array.prototype.filter;function KS(){return Array.from(this.children)}function GS(e){return function(){return YS.call(this.children,e)}}function ZS(e){return this.selectAll(e==null?KS:GS(typeof e=="function"?e:Pg(e)))}function JS(e){typeof e!="function"&&(e=Mg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=[],a,u=0;u<o;++u)(a=s[u])&&e.call(a,a.__data__,u,s)&&l.push(a);return new at(r,this._parents)}function zg(e){return new Array(e.length)}function ek(){return new at(this._enter||this._groups.map(zg),this._parents)}function jl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}jl.prototype={constructor:jl,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 tk(e){return function(){return e}}function nk(e,t,n,r,i,s){for(var o=0,l,a=t.length,u=s.length;o<u;++o)(l=t[o])?(l.__data__=s[o],r[o]=l):n[o]=new jl(e,s[o]);for(;o<a;++o)(l=t[o])&&(i[o]=l)}function rk(e,t,n,r,i,s,o){var l,a,u=new Map,f=t.length,d=s.length,c=new Array(f),h;for(l=0;l<f;++l)(a=t[l])&&(c[l]=h=o.call(a,a.__data__,l,t)+"",u.has(h)?i[l]=a:u.set(h,a));for(l=0;l<d;++l)h=o.call(e,s[l],l,s)+"",(a=u.get(h))?(r[l]=a,a.__data__=s[l],u.delete(h)):n[l]=new jl(e,s[l]);for(l=0;l<f;++l)(a=t[l])&&u.get(c[l])===a&&(i[l]=a)}function ik(e){return e.__data__}function sk(e,t){if(!arguments.length)return Array.from(this,ik);var n=t?rk:nk,r=this._parents,i=this._groups;typeof e!="function"&&(e=tk(e));for(var s=i.length,o=new Array(s),l=new Array(s),a=new Array(s),u=0;u<s;++u){var f=r[u],d=i[u],c=d.length,h=ok(e.call(f,f&&f.__data__,u,r)),v=h.length,y=l[u]=new Array(v),S=o[u]=new Array(v),m=a[u]=new Array(c);n(f,d,y,S,m,h,t);for(var x=0,g=0,w,_;x<v;++x)if(w=y[x]){for(x>=g&&(g=x+1);!(_=S[g])&&++g<v;);w._next=_||null}}return o=new at(o,r),o._enter=l,o._exit=a,o}function ok(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lk(){return new at(this._exit||this._groups.map(zg),this._parents)}function ak(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function uk(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),l=new Array(i),a=0;a<o;++a)for(var u=n[a],f=r[a],d=u.length,c=l[a]=new Array(d),h,v=0;v<d;++v)(h=u[v]||f[v])&&(c[v]=h);for(;a<i;++a)l[a]=n[a];return new at(l,this._parents)}function ck(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function dk(e){e||(e=fk);function t(d,c){return d&&c?e(d.__data__,c.__data__):!d-!c}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],l=o.length,a=i[s]=new Array(l),u,f=0;f<l;++f)(u=o[f])&&(a[f]=u);a.sort(t)}return new at(i,this._parents).order()}function fk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function hk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pk(){return Array.from(this)}function mk(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function gk(){let e=0;for(const t of this)++e;return e}function yk(){return!this.node()}function vk(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,o=i.length,l;s<o;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function xk(e){return function(){this.removeAttribute(e)}}function wk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sk(e,t){return function(){this.setAttribute(e,t)}}function kk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ek(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function _k(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 Nk(e,t){var n=ta(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?wk:xk:typeof t=="function"?n.local?_k:Ek:n.local?kk:Sk)(n,t))}function Ig(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ck(e){return function(){this.style.removeProperty(e)}}function bk(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jk(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Mk(e,t,n){return arguments.length>1?this.each((t==null?Ck:typeof t=="function"?jk:bk)(e,t,n??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||Ig(e).getComputedStyle(e,null).getPropertyValue(t)}function Pk(e){return function(){delete this[e]}}function zk(e,t){return function(){this[e]=t}}function Ik(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Tk(e,t){return arguments.length>1?this.each((t==null?Pk:typeof t=="function"?Ik:zk)(e,t)):this.node()[e]}function Tg(e){return e.trim().split(/^|\s+/)}function Hd(e){return e.classList||new Rg(e)}function Rg(e){this._node=e,this._names=Tg(e.getAttribute("class")||"")}Rg.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 $g(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Og(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Rk(e){return function(){$g(this,e)}}function $k(e){return function(){Og(this,e)}}function Ok(e,t){return function(){(t.apply(this,arguments)?$g:Og)(this,e)}}function Dk(e,t){var n=Tg(e+"");if(arguments.length<2){for(var r=Hd(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Ok:t?Rk:$k)(n,t))}function Ak(){this.textContent=""}function Lk(e){return function(){this.textContent=e}}function Fk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Hk(e){return arguments.length?this.each(e==null?Ak:(typeof e=="function"?Fk:Lk)(e)):this.node().textContent}function Bk(){this.innerHTML=""}function Vk(e){return function(){this.innerHTML=e}}function Uk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qk(e){return arguments.length?this.each(e==null?Bk:(typeof e=="function"?Uk:Vk)(e)):this.node().innerHTML}function Wk(){this.nextSibling&&this.parentNode.appendChild(this)}function qk(){return this.each(Wk)}function Xk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yk(){return this.each(Xk)}function Kk(e){var t=typeof e=="function"?e:bg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Gk(){return null}function Zk(e,t){var n=typeof e=="function"?e:bg(e),r=t==null?Gk:typeof t=="function"?t:Fd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Jk(){var e=this.parentNode;e&&e.removeChild(this)}function e2(){return this.each(Jk)}function t2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function n2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function r2(e){return this.select(e?n2:t2)}function i2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function s2(e){return function(t){e.call(this,t,this.__data__)}}function o2(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 l2(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function a2(e,t,n){return function(){var r=this.__on,i,s=s2(t);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function u2(e,t,n){var r=o2(e+""),i,s=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,f;a<u;++a)for(i=0,f=l[a];i<s;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(l=t?a2:l2,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function Dg(e,t,n){var r=Ig(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function c2(e,t){return function(){return Dg(this,e,t)}}function d2(e,t){return function(){return Dg(this,e,t.apply(this,arguments))}}function f2(e,t){return this.each((typeof t=="function"?d2:c2)(e,t))}function*h2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var Ag=[null];function at(e,t){this._groups=e,this._parents=t}function Js(){return new at([[document.documentElement]],Ag)}function p2(){return this}at.prototype=Js.prototype={constructor:at,select:FS,selectAll:US,selectChild:XS,selectChildren:ZS,filter:JS,data:sk,enter:ek,exit:lk,join:ak,merge:uk,selection:p2,order:ck,sort:dk,call:hk,nodes:pk,node:mk,size:gk,empty:yk,each:vk,attr:Nk,style:Mk,property:Tk,classed:Dk,text:Hk,html:Qk,raise:qk,lower:Yk,append:Kk,insert:Zk,remove:e2,clone:r2,datum:i2,on:u2,dispatch:f2,[Symbol.iterator]:h2};function it(e){return typeof e=="string"?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],Ag)}function m2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nt(e,t){if(e=m2(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const g2={passive:!1},zs={capture:!0,passive:!1};function Ka(e){e.stopImmediatePropagation()}function Gr(e){e.preventDefault(),e.stopImmediatePropagation()}function Lg(e){var t=e.document.documentElement,n=it(e).on("dragstart.drag",Gr,zs);"onselectstart"in t?n.on("selectstart.drag",Gr,zs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Fg(e,t){var n=e.document.documentElement,r=it(e).on("dragstart.drag",null);t&&(r.on("click.drag",Gr,zs),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 No=e=>()=>e;function vc(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:o,y:l,dx:a,dy:u,dispatch:f}){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:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:f}})}vc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function y2(e){return!e.ctrlKey&&!e.button}function v2(){return this.parentNode}function x2(e,t){return t??{x:e.x,y:e.y}}function w2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hg(){var e=y2,t=v2,n=x2,r=w2,i={},s=ea("start","drag","end"),o=0,l,a,u,f,d=0;function c(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",m,g2).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,_){if(!(f||!e.call(this,w,_))){var M=g(this,t.call(this,w,_),w,_,"mouse");M&&(it(w.view).on("mousemove.drag",v,zs).on("mouseup.drag",y,zs),Lg(w.view),Ka(w),u=!1,l=w.clientX,a=w.clientY,M("start",w))}}function v(w){if(Gr(w),!u){var _=w.clientX-l,M=w.clientY-a;u=_*_+M*M>d}i.mouse("drag",w)}function y(w){it(w.view).on("mousemove.drag mouseup.drag",null),Fg(w.view,u),Gr(w),i.mouse("end",w)}function S(w,_){if(e.call(this,w,_)){var M=w.changedTouches,N=t.call(this,w,_),b=M.length,P,I;for(P=0;P<b;++P)(I=g(this,N,w,_,M[P].identifier,M[P]))&&(Ka(w),I("start",w,M[P]))}}function m(w){var _=w.changedTouches,M=_.length,N,b;for(N=0;N<M;++N)(b=i[_[N].identifier])&&(Gr(w),b("drag",w,_[N]))}function x(w){var _=w.changedTouches,M=_.length,N,b;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),N=0;N<M;++N)(b=i[_[N].identifier])&&(Ka(w),b("end",w,_[N]))}function g(w,_,M,N,b,P){var I=s.copy(),D=Nt(P||M,_),F,A,E;if((E=n.call(w,new vc("beforestart",{sourceEvent:M,target:c,identifier:b,active:o,x:D[0],y:D[1],dx:0,dy:0,dispatch:I}),N))!=null)return F=E.x-D[0]||0,A=E.y-D[1]||0,function $(z,O,k){var j=D,T;switch(z){case"start":i[b]=$,T=o++;break;case"end":delete i[b],--o;case"drag":D=Nt(k||O,_),T=o;break}I.call(z,w,new vc(z,{sourceEvent:O,subject:E,target:c,identifier:b,active:T,x:D[0]+F,y:D[1]+A,dx:D[0]-j[0],dy:D[1]-j[1],dispatch:I}),N)}}return c.filter=function(w){return arguments.length?(e=typeof w=="function"?w:No(!!w),c):e},c.container=function(w){return arguments.length?(t=typeof w=="function"?w:No(w),c):t},c.subject=function(w){return arguments.length?(n=typeof w=="function"?w:No(w),c):n},c.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:No(!!w),c):r},c.on=function(){var w=s.on.apply(s,arguments);return w===s?c:w},c.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,c):Math.sqrt(d)},c}function Bd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function eo(){}var Is=.7,Ml=1/Is,Zr="\\s*([+-]?\\d+)\\s*",Ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",S2=/^#([0-9a-f]{3,8})$/,k2=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),E2=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),_2=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Ts}\\)$`),N2=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Ts}\\)$`),C2=new RegExp(`^hsl\\(${Ts},${Ut},${Ut}\\)$`),b2=new RegExp(`^hsla\\(${Ts},${Ut},${Ut},${Ts}\\)$`),zh={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};Bd(eo,Rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ih,formatHex:Ih,formatHex8:j2,formatHsl:M2,formatRgb:Th,toString:Th});function Ih(){return this.rgb().formatHex()}function j2(){return this.rgb().formatHex8()}function M2(){return Vg(this).formatHsl()}function Th(){return this.rgb().formatRgb()}function Rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=S2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rh(t):n===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Co(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Co(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=k2.exec(e))?new Ge(t[1],t[2],t[3],1):(t=E2.exec(e))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_2.exec(e))?Co(t[1],t[2],t[3],t[4]):(t=N2.exec(e))?Co(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=C2.exec(e))?Dh(t[1],t[2]/100,t[3]/100,1):(t=b2.exec(e))?Dh(t[1],t[2]/100,t[3]/100,t[4]):zh.hasOwnProperty(e)?Rh(zh[e]):e==="transparent"?new Ge(NaN,NaN,NaN,0):null}function Rh(e){return new Ge(e>>16&255,e>>8&255,e&255,1)}function Co(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ge(e,t,n,r)}function P2(e){return e instanceof eo||(e=Rs(e)),e?(e=e.rgb(),new Ge(e.r,e.g,e.b,e.opacity)):new Ge}function xc(e,t,n,r){return arguments.length===1?P2(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bd(Ge,xc,Bg(eo,{brighter(e){return e=e==null?Ml:Math.pow(Ml,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Is:Math.pow(Is,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ge(mr(this.r),mr(this.g),mr(this.b),Pl(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:$h,formatHex:$h,formatHex8:z2,formatRgb:Oh,toString:Oh}));function $h(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function z2(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oh(){const e=Pl(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Pl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function Dh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new jt(e,t,n,r)}function Vg(e){if(e instanceof jt)return new jt(e.h,e.s,e.l,e.opacity);if(e instanceof eo||(e=Rs(e)),!e)return new jt;if(e instanceof jt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-i,a=(s+i)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=a<.5?s+i:2-s-i,o*=60):l=a>0&&a<1?0:o,new jt(o,l,a,e.opacity)}function I2(e,t,n,r){return arguments.length===1?Vg(e):new jt(e,t,n,r??1)}function jt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bd(jt,I2,Bg(eo,{brighter(e){return e=e==null?Ml:Math.pow(Ml,e),new jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Is:Math.pow(Is,e),new jt(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,i=2*n-r;return new Ge(Ga(e>=240?e-240:e+120,i,r),Ga(e,i,r),Ga(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new jt(Ah(this.h),bo(this.s),bo(this.l),Pl(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=Pl(this.opacity);return`${e===1?"hsl(":"hsla("}${Ah(this.h)}, ${bo(this.s)*100}%, ${bo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ah(e){return e=(e||0)%360,e<0?e+360:e}function bo(e){return Math.max(0,Math.min(1,e||0))}function Ga(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 Ug=e=>()=>e;function T2(e,t){return function(n){return e+n*t}}function R2(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 $2(e){return(e=+e)==1?Qg:function(t,n){return n-t?R2(t,n,e):Ug(isNaN(t)?n:t)}}function Qg(e,t){var n=t-e;return n?T2(e,n):Ug(isNaN(e)?t:e)}const Lh=function e(t){var n=$2(t);function r(i,s){var o=n((i=xc(i)).r,(s=xc(s)).r),l=n(i.g,s.g),a=n(i.b,s.b),u=Qg(i.opacity,s.opacity);return function(f){return i.r=o(f),i.g=l(f),i.b=a(f),i.opacity=u(f),i+""}}return r.gamma=e,r}(1);function kn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var wc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Za=new RegExp(wc.source,"g");function O2(e){return function(){return e}}function D2(e){return function(t){return e(t)+""}}function A2(e,t){var n=wc.lastIndex=Za.lastIndex=0,r,i,s,o=-1,l=[],a=[];for(e=e+"",t=t+"";(r=wc.exec(e))&&(i=Za.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,a.push({i:o,x:kn(r,i)})),n=Za.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?a[0]?D2(a[0].x):O2(t):(t=a.length,function(u){for(var f=0,d;f<t;++f)l[(d=a[f]).i]=d.x(u);return l.join("")})}var Fh=180/Math.PI,Sc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wg(e,t,n,r,i,s){var o,l,a;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(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,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Fh,skewX:Math.atan(a)*Fh,scaleX:o,scaleY:l}}var jo;function L2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Sc:Wg(t.a,t.b,t.c,t.d,t.e,t.f)}function F2(e){return e==null||(jo||(jo=document.createElementNS("http://www.w3.org/2000/svg","g")),jo.setAttribute("transform",e),!(e=jo.transform.baseVal.consolidate()))?Sc:(e=e.matrix,Wg(e.a,e.b,e.c,e.d,e.e,e.f))}function qg(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,f,d,c,h,v){if(u!==d||f!==c){var y=h.push("translate(",null,t,null,n);v.push({i:y-4,x:kn(u,d)},{i:y-2,x:kn(f,c)})}else(d||c)&&h.push("translate("+d+t+c+n)}function o(u,f,d,c){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),c.push({i:d.push(i(d)+"rotate(",null,r)-2,x:kn(u,f)})):f&&d.push(i(d)+"rotate("+f+r)}function l(u,f,d,c){u!==f?c.push({i:d.push(i(d)+"skewX(",null,r)-2,x:kn(u,f)}):f&&d.push(i(d)+"skewX("+f+r)}function a(u,f,d,c,h,v){if(u!==d||f!==c){var y=h.push(i(h)+"scale(",null,",",null,")");v.push({i:y-4,x:kn(u,d)},{i:y-2,x:kn(f,c)})}else(d!==1||c!==1)&&h.push(i(h)+"scale("+d+","+c+")")}return function(u,f){var d=[],c=[];return u=e(u),f=e(f),s(u.translateX,u.translateY,f.translateX,f.translateY,d,c),o(u.rotate,f.rotate,d,c),l(u.skewX,f.skewX,d,c),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,d,c),u=f=null,function(h){for(var v=-1,y=c.length,S;++v<y;)d[(S=c[v]).i]=S.x(h);return d.join("")}}}var H2=qg(L2,"px, ","px)","deg)"),B2=qg(F2,", ",")",")"),V2=1e-12;function Hh(e){return((e=Math.exp(e))+1/e)/2}function U2(e){return((e=Math.exp(e))-1/e)/2}function Q2(e){return((e=Math.exp(2*e))-1)/(e+1)}const W2=function e(t,n,r){function i(s,o){var l=s[0],a=s[1],u=s[2],f=o[0],d=o[1],c=o[2],h=f-l,v=d-a,y=h*h+v*v,S,m;if(y<V2)m=Math.log(c/u)/t,S=function(N){return[l+N*h,a+N*v,u*Math.exp(t*N*m)]};else{var x=Math.sqrt(y),g=(c*c-u*u+r*y)/(2*u*n*x),w=(c*c-u*u-r*y)/(2*c*n*x),_=Math.log(Math.sqrt(g*g+1)-g),M=Math.log(Math.sqrt(w*w+1)-w);m=(M-_)/t,S=function(N){var b=N*m,P=Hh(_),I=u/(n*x)*(P*Q2(t*b+_)-U2(_));return[l+I*h,a+I*v,u*P/Hh(t*b+_)]}}return S.duration=m*1e3*t/Math.SQRT2,S}return i.rho=function(s){var o=Math.max(.001,+s),l=o*o,a=l*l;return e(o,l,a)},i}(Math.SQRT2,2,4);var _i=0,es=0,Wi=0,Xg=1e3,zl,ts,Il=0,_r=0,na=0,$s=typeof performance=="object"&&performance.now?performance:Date,Yg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vd(){return _r||(Yg(q2),_r=$s.now()+na)}function q2(){_r=0}function Tl(){this._call=this._time=this._next=null}Tl.prototype=Kg.prototype={constructor:Tl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vd():+n)+(t==null?0:+t),!this._next&&ts!==this&&(ts?ts._next=this:zl=this,ts=this),this._call=e,this._time=n,kc()},stop:function(){this._call&&(this._call=null,this._time=1/0,kc())}};function Kg(e,t,n){var r=new Tl;return r.restart(e,t,n),r}function X2(){Vd(),++_i;for(var e=zl,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_i}function Bh(){_r=(Il=$s.now())+na,_i=es=0;try{X2()}finally{_i=0,K2(),_r=0}}function Y2(){var e=$s.now(),t=e-Il;t>Xg&&(na-=t,Il=e)}function K2(){for(var e,t=zl,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:zl=n);ts=e,kc(r)}function kc(e){if(!_i){es&&(es=clearTimeout(es));var t=e-_r;t>24?(e<1/0&&(es=setTimeout(Bh,e-$s.now()-na)),Wi&&(Wi=clearInterval(Wi))):(Wi||(Il=$s.now(),Wi=setInterval(Y2,Xg)),_i=1,Yg(Bh))}}function Vh(e,t,n){var r=new Tl;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var G2=ea("start","end","cancel","interrupt"),Z2=[],Gg=0,Uh=1,Ec=2,Yo=3,Qh=4,_c=5,Ko=6;function ra(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;J2(e,n,{name:t,index:r,group:i,on:G2,tween:Z2,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gg})}function Ud(e,t){var n=Rt(e,t);if(n.state>Gg)throw new Error("too late; already scheduled");return n}function Qt(e,t){var n=Rt(e,t);if(n.state>Yo)throw new Error("too late; already running");return n}function Rt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function J2(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Kg(s,0,n.time);function s(u){n.state=Uh,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var f,d,c,h;if(n.state!==Uh)return a();for(f in r)if(h=r[f],h.name===n.name){if(h.state===Yo)return Vh(o);h.state===Qh?(h.state=Ko,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[f]):+f<t&&(h.state=Ko,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[f])}if(Vh(function(){n.state===Yo&&(n.state=Qh,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Ec,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ec){for(n.state=Yo,i=new Array(c=n.tween.length),f=0,d=-1;f<c;++f)(h=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function l(u){for(var f=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=_c,1),d=-1,c=i.length;++d<c;)i[d].call(e,f);n.state===_c&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Ko,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Go(e,t){var n=e.__transition,r,i,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){s=!1;continue}i=r.state>Ec&&r.state<_c,r.state=Ko,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function eE(e){return this.each(function(){Go(this,e)})}function tE(e,t){var n,r;return function(){var i=Qt(this,e),s=i.tween;if(s!==n){r=n=s;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function nE(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Qt(this,e),o=s.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},a=0,u=i.length;a<u;++a)if(i[a].name===t){i[a]=l;break}a===u&&i.push(l)}s.tween=i}}function rE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Rt(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?tE:nE)(n,e,t))}function Qd(e,t,n){var r=e._id;return e.each(function(){var i=Qt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Rt(i,r).value[t]}}function Zg(e,t){var n;return(typeof t=="number"?kn:t instanceof Rs?Lh:(n=Rs(t))?(t=n,Lh):A2)(e,t)}function iE(e){return function(){this.removeAttribute(e)}}function sE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oE(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttribute(e);return o===i?null:o===r?s:s=t(r=o,n)}}function lE(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?s:s=t(r=o,n)}}function aE(e,t,n){var r,i,s;return function(){var o,l=n(this),a;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),a=l+"",o===a?null:o===r&&a===i?s:(i=a,s=t(r=o,l)))}}function uE(e,t,n){var r,i,s;return function(){var o,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),a=l+"",o===a?null:o===r&&a===i?s:(i=a,s=t(r=o,l)))}}function cE(e,t){var n=ta(e),r=n==="transform"?B2:Zg;return this.attrTween(e,typeof t=="function"?(n.local?uE:aE)(n,r,Qd(this,"attr."+e,t)):t==null?(n.local?sE:iE)(n):(n.local?lE:oE)(n,r,t))}function dE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&fE(e,s)),n}return i._value=t,i}function pE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&dE(e,s)),n}return i._value=t,i}function mE(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=ta(e);return this.tween(n,(r.local?hE:pE)(r,t))}function gE(e,t){return function(){Ud(this,e).delay=+t.apply(this,arguments)}}function yE(e,t){return t=+t,function(){Ud(this,e).delay=t}}function vE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gE:yE)(t,e)):Rt(this.node(),t).delay}function xE(e,t){return function(){Qt(this,e).duration=+t.apply(this,arguments)}}function wE(e,t){return t=+t,function(){Qt(this,e).duration=t}}function SE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xE:wE)(t,e)):Rt(this.node(),t).duration}function kE(e,t){if(typeof t!="function")throw new Error;return function(){Qt(this,e).ease=t}}function EE(e){var t=this._id;return arguments.length?this.each(kE(t,e)):Rt(this.node(),t).ease}function _E(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qt(this,e).ease=n}}function NE(e){if(typeof e!="function")throw new Error;return this.each(_E(this._id,e))}function CE(e){typeof e!="function"&&(e=Mg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=[],a,u=0;u<o;++u)(a=s[u])&&e.call(a,a.__data__,u,s)&&l.push(a);return new un(r,this._parents,this._name,this._id)}function bE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),l=0;l<s;++l)for(var a=t[l],u=n[l],f=a.length,d=o[l]=new Array(f),c,h=0;h<f;++h)(c=a[h]||u[h])&&(d[h]=c);for(;l<r;++l)o[l]=t[l];return new un(o,this._parents,this._name,this._id)}function jE(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 ME(e,t,n){var r,i,s=jE(t)?Ud:Qt;return function(){var o=s(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function PE(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(ME(n,e,t))}function zE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function IE(){return this.on("end.remove",zE(this._id))}function TE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Fd(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var l=r[o],a=l.length,u=s[o]=new Array(a),f,d,c=0;c<a;++c)(f=l[c])&&(d=e.call(f,f.__data__,c,l))&&("__data__"in f&&(d.__data__=f.__data__),u[c]=d,ra(u[c],t,n,c,u,Rt(f,n)));return new un(s,this._parents,t,n)}function RE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jg(e));for(var r=this._groups,i=r.length,s=[],o=[],l=0;l<i;++l)for(var a=r[l],u=a.length,f,d=0;d<u;++d)if(f=a[d]){for(var c=e.call(f,f.__data__,d,a),h,v=Rt(f,n),y=0,S=c.length;y<S;++y)(h=c[y])&&ra(h,t,n,y,c,v);s.push(c),o.push(f)}return new un(s,o,t,n)}var $E=Js.prototype.constructor;function OE(){return new $E(this._groups,this._parents)}function DE(e,t){var n,r,i;return function(){var s=Ei(this,e),o=(this.style.removeProperty(e),Ei(this,e));return s===o?null:s===n&&o===r?i:i=t(n=s,r=o)}}function Jg(e){return function(){this.style.removeProperty(e)}}function AE(e,t,n){var r,i=n+"",s;return function(){var o=Ei(this,e);return o===i?null:o===r?s:s=t(r=o,n)}}function LE(e,t,n){var r,i,s;return function(){var o=Ei(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Ei(this,e))),o===a?null:o===r&&a===i?s:(i=a,s=t(r=o,l))}}function FE(e,t){var n,r,i,s="style."+t,o="end."+s,l;return function(){var a=Qt(this,e),u=a.on,f=a.value[s]==null?l||(l=Jg(t)):void 0;(u!==n||i!==f)&&(r=(n=u).copy()).on(o,i=f),a.on=r}}function HE(e,t,n){var r=(e+="")=="transform"?H2:Zg;return t==null?this.styleTween(e,DE(e,r)).on("end.style."+e,Jg(e)):typeof t=="function"?this.styleTween(e,LE(e,r,Qd(this,"style."+e,t))).each(FE(this._id,e)):this.styleTween(e,AE(e,r,t),n).on("end.style."+e,null)}function BE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function VE(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&BE(e,o,n)),r}return s._value=t,s}function UE(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,VE(e,t,n??""))}function QE(e){return function(){this.textContent=e}}function WE(e){return function(){var t=e(this);this.textContent=t??""}}function qE(e){return this.tween("text",typeof e=="function"?WE(Qd(this,"text",e)):QE(e==null?"":e+""))}function XE(e){return function(t){this.textContent=e.call(this,t)}}function YE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&XE(i)),t}return r._value=e,r}function KE(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,YE(e))}function GE(){for(var e=this._name,t=this._id,n=ey(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],l=o.length,a,u=0;u<l;++u)if(a=o[u]){var f=Rt(a,t);ra(a,e,n,u,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new un(r,this._parents,e,n)}function ZE(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var l={value:o},a={value:function(){--i===0&&s()}};n.each(function(){var u=Qt(this,r),f=u.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),i===0&&s()})}var JE=0;function un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ey(){return++JE}var Wt=Js.prototype;un.prototype={constructor:un,select:TE,selectAll:RE,selectChild:Wt.selectChild,selectChildren:Wt.selectChildren,filter:CE,merge:bE,selection:OE,transition:GE,call:Wt.call,nodes:Wt.nodes,node:Wt.node,size:Wt.size,empty:Wt.empty,each:Wt.each,on:PE,attr:cE,attrTween:mE,style:HE,styleTween:UE,text:qE,textTween:KE,remove:IE,tween:rE,delay:vE,duration:SE,ease:EE,easeVarying:NE,end:ZE,[Symbol.iterator]:Wt[Symbol.iterator]};function e_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var t_={time:null,delay:0,duration:250,ease:e_};function n_(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 r_(e){var t,n;e instanceof un?(t=e._id,e=e._name):(t=ey(),(n=t_).time=Vd(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],l=o.length,a,u=0;u<l;++u)(a=o[u])&&ra(a,e,t,u,o,n||n_(a,t));return new un(r,this._parents,e,t)}Js.prototype.interrupt=eE;Js.prototype.transition=r_;const Mo=e=>()=>e;function i_(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Jt(e,t,n){this.k=e,this.x=t,this.y=n}Jt.prototype={constructor:Jt,scale:function(e){return e===1?this:new Jt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Jt(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 ia=new Jt(1,0,0);ty.prototype=Jt.prototype;function ty(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ia;return e.__zoom}function Ja(e){e.stopImmediatePropagation()}function qi(e){e.preventDefault(),e.stopImmediatePropagation()}function s_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function o_(){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 Wh(){return this.__zoom||ia}function l_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function a_(){return navigator.maxTouchPoints||"ontouchstart"in this}function u_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function ny(){var e=s_,t=o_,n=u_,r=l_,i=a_,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,a=W2,u=ea("start","zoom","end"),f,d,c,h=500,v=150,y=0,S=10;function m(E){E.property("__zoom",Wh).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,$,z,O){var k=E.selection?E.selection():E;k.property("__zoom",Wh),E!==k?_(E,$,z,O):k.interrupt().each(function(){M(this,arguments).event(O).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},m.scaleBy=function(E,$,z,O){m.scaleTo(E,function(){var k=this.__zoom.k,j=typeof $=="function"?$.apply(this,arguments):$;return k*j},z,O)},m.scaleTo=function(E,$,z,O){m.transform(E,function(){var k=t.apply(this,arguments),j=this.__zoom,T=z==null?w(k):typeof z=="function"?z.apply(this,arguments):z,L=j.invert(T),H=typeof $=="function"?$.apply(this,arguments):$;return n(g(x(j,H),T,L),k,o)},z,O)},m.translateBy=function(E,$,z,O){m.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),o)},null,O)},m.translateTo=function(E,$,z,O,k){m.transform(E,function(){var j=t.apply(this,arguments),T=this.__zoom,L=O==null?w(j):typeof O=="function"?O.apply(this,arguments):O;return n(ia.translate(L[0],L[1]).scale(T.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof z=="function"?-z.apply(this,arguments):-z),j,o)},O,k)};function x(E,$){return $=Math.max(s[0],Math.min(s[1],$)),$===E.k?E:new Jt($,E.x,E.y)}function g(E,$,z){var O=$[0]-z[0]*E.k,k=$[1]-z[1]*E.k;return O===E.x&&k===E.y?E:new Jt(E.k,O,k)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function _(E,$,z,O){E.on("start.zoom",function(){M(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(O).end()}).tween("zoom",function(){var k=this,j=arguments,T=M(k,j).event(O),L=t.apply(k,j),H=z==null?w(L):typeof z=="function"?z.apply(k,j):z,K=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Q=k.__zoom,X=typeof $=="function"?$.apply(k,j):$,q=a(Q.invert(H).concat(K/Q.k),X.invert(H).concat(K/X.k));return function(Z){if(Z===1)Z=X;else{var U=q(Z),te=K/U[2];Z=new Jt(te,H[0]-U[0]*te,H[1]-U[1]*te)}T.zoom(null,Z)}})}function M(E,$,z){return!z&&E.__zooming||new N(E,$)}function N(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,$){return this.mouse&&E!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var $=it(this.that).datum();u.call(E,this.that,new i_(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),$)}};function b(E,...$){if(!e.apply(this,arguments))return;var z=M(this,$).event(E),O=this.__zoom,k=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,r.apply(this,arguments)))),j=Nt(E);if(z.wheel)(z.mouse[0][0]!==j[0]||z.mouse[0][1]!==j[1])&&(z.mouse[1]=O.invert(z.mouse[0]=j)),clearTimeout(z.wheel);else{if(O.k===k)return;z.mouse=[j,O.invert(j)],Go(this),z.start()}qi(E),z.wheel=setTimeout(T,v),z.zoom("mouse",n(g(x(O,k),z.mouse[0],z.mouse[1]),z.extent,o));function T(){z.wheel=null,z.end()}}function P(E,...$){if(c||!e.apply(this,arguments))return;var z=E.currentTarget,O=M(this,$,!0).event(E),k=it(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",K,!0),j=Nt(E,z),T=E.clientX,L=E.clientY;Lg(E.view),Ja(E),O.mouse=[j,this.__zoom.invert(j)],Go(this),O.start();function H(Q){if(qi(Q),!O.moved){var X=Q.clientX-T,q=Q.clientY-L;O.moved=X*X+q*q>y}O.event(Q).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=Nt(Q,z),O.mouse[1]),O.extent,o))}function K(Q){k.on("mousemove.zoom mouseup.zoom",null),Fg(Q.view,O.moved),qi(Q),O.event(Q).end()}}function I(E,...$){if(e.apply(this,arguments)){var z=this.__zoom,O=Nt(E.changedTouches?E.changedTouches[0]:E,this),k=z.invert(O),j=z.k*(E.shiftKey?.5:2),T=n(g(x(z,j),O,k),t.apply(this,$),o);qi(E),l>0?it(this).transition().duration(l).call(_,T,O,E):it(this).call(m.transform,T,O,E)}}function D(E,...$){if(e.apply(this,arguments)){var z=E.touches,O=z.length,k=M(this,$,E.changedTouches.length===O).event(E),j,T,L,H;for(Ja(E),T=0;T<O;++T)L=z[T],H=Nt(L,this),H=[H,this.__zoom.invert(H),L.identifier],k.touch0?!k.touch1&&k.touch0[2]!==H[2]&&(k.touch1=H,k.taps=0):(k.touch0=H,j=!0,k.taps=1+!!f);f&&(f=clearTimeout(f)),j&&(k.taps<2&&(d=H[0],f=setTimeout(function(){f=null},h)),Go(this),k.start())}}function F(E,...$){if(this.__zooming){var z=M(this,$).event(E),O=E.changedTouches,k=O.length,j,T,L,H;for(qi(E),j=0;j<k;++j)T=O[j],L=Nt(T,this),z.touch0&&z.touch0[2]===T.identifier?z.touch0[0]=L:z.touch1&&z.touch1[2]===T.identifier&&(z.touch1[0]=L);if(T=z.that.__zoom,z.touch1){var K=z.touch0[0],Q=z.touch0[1],X=z.touch1[0],q=z.touch1[1],Z=(Z=X[0]-K[0])*Z+(Z=X[1]-K[1])*Z,U=(U=q[0]-Q[0])*U+(U=q[1]-Q[1])*U;T=x(T,Math.sqrt(Z/U)),L=[(K[0]+X[0])/2,(K[1]+X[1])/2],H=[(Q[0]+q[0])/2,(Q[1]+q[1])/2]}else if(z.touch0)L=z.touch0[0],H=z.touch0[1];else return;z.zoom("touch",n(g(T,L,H),z.extent,o))}}function A(E,...$){if(this.__zooming){var z=M(this,$).event(E),O=E.changedTouches,k=O.length,j,T;for(Ja(E),c&&clearTimeout(c),c=setTimeout(function(){c=null},h),j=0;j<k;++j)T=O[j],z.touch0&&z.touch0[2]===T.identifier?delete z.touch0:z.touch1&&z.touch1[2]===T.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(T=Nt(T,this),Math.hypot(d[0]-T[0],d[1]-T[1])<S)){var L=it(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Mo(+E),m):r},m.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Mo(!!E),m):e},m.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Mo(!!E),m):i},m.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Mo([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),m):t},m.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],m):[s[0],s[1]]},m.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],m):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},m.constrain=function(E){return arguments.length?(n=E,m):n},m.duration=function(E){return arguments.length?(l=+E,m):l},m.interpolate=function(E){return arguments.length?(a=E,m):a},m.on=function(){var E=u.on.apply(u,arguments);return E===u?m:E},m.clickDistance=function(E){return arguments.length?(y=(E=+E)*E,m):Math.sqrt(y)},m.tapDistance=function(E){return arguments.length?(S=+E,m):S},m}const dn={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.`},Os=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ry=["Enter"," ","Escape"];var Ni;(function(e){e.Strict="strict",e.Loose="loose"})(Ni||(Ni={}));var gr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(gr||(gr={}));var Ds;(function(e){e.Partial="partial",e.Full="full"})(Ds||(Ds={}));const iy={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Nn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Nn||(Nn={}));var Rl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Rl||(Rl={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const qh={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function sy(e){return e===null?null:e?"valid":"invalid"}const oy=e=>"id"in e&&"source"in e&&"target"in e,c_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),to=(e,t=[0,0])=>{const{width:n,height:r}=fn(e),i=e.origin??t,s=n*i[0],o=r*i[1];return{x:e.position.x-s,y:e.position.y-o}},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,i)=>{const s=typeof i=="string";let o=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(i):Wd(i)?i:t.nodeLookup.get(i.id));const l=o?$l(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sa(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return oa(n)},no=(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 i=$l(r);n=sa(n,i)}}),oa(n)},ly=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const l={...ro(t,[n,r,i]),width:t.width/i,height:t.height/i},a=[];for(const u of e.values()){const{measured:f,selectable:d=!0,hidden:c=!1}=u;if(o&&!d||c)continue;const h=f.width??u.width??u.initialWidth??null,v=f.height??u.height??u.initialHeight??null,y=As(l,bi(u)),S=(h??0)*(v??0),m=s&&y>0;(!u.internals.handleBounds||m||y>=S||u.dragging)&&a.push(u)}return a},f_=(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 Nc(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Cc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!1);const l=no(e),a=qd(l,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(a,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function ay({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},f=o.origin??r;let d=i;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",dn.error005());else{const h=l.measured.width,v=l.measured.height;h&&v&&(d=[[a,u],[a+h,u+v]])}else l&&ji(o.extent)&&(d=[[o.extent[0][0]+a,o.extent[0][1]+u],[o.extent[1][0]+a,o.extent[1][1]+u]]);const c=ji(d)?Nr(t,d,o.measured):t;return{position:{x:c.x-a+o.measured.width*f[0],y:c.y-u+o.measured.height*f[1]},positionAbsolute:c}}async function h_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(c=>c.id)),o=[];for(const c of n){if(c.deletable===!1)continue;const h=s.has(c.id),v=!h&&c.parentId&&o.find(y=>y.id===c.parentId);(h||v)&&o.push(c)}const l=new Set(t.map(c=>c.id)),a=r.filter(c=>c.deletable!==!1),f=f_(o,a);for(const c of a)l.has(c.id)&&!f.find(v=>v.id===c.id)&&f.push(c);if(!i)return{edges:f,nodes:o};const d=await i({nodes:o,edges:f});return typeof d=="boolean"?d?{edges:f,nodes:o}:{edges:[],nodes:[]}:d}const Ci=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Nr=(e={x:0,y:0},t,n)=>({x:Ci(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ci(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function uy(e,t,n){const{width:r,height:i}=fn(n),{x:s,y:o}=n.internals.positionAbsolute;return Nr(e,[[s,o],[s+r,o+i]],t)}const Xh=(e,t,n)=>e<t?Ci(Math.abs(e-t),1,t)/t:e>n?-Ci(Math.abs(e-n),1,t)/t:0,cy=(e,t,n=15,r=40)=>{const i=Xh(e.x,r,t.width-r)*n,s=Xh(e.y,r,t.height-r)*n;return[i,s]},sa=(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)}),bc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),oa=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),bi=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Wd(e)?e.internals.positionAbsolute:to(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},$l=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Wd(e)?e.internals.positionAbsolute:to(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},dy=(e,t)=>oa(sa(bc(e),bc(t))),As=(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)},Yh=e=>Mt(e.width)&&Mt(e.height)&&Mt(e.x)&&Mt(e.y),Mt=e=>!isNaN(e)&&isFinite(e),p_=(e,t)=>{},la=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ro=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return s?la(l,o):l},fy=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),qd=(e,t,n,r,i,s)=>{const o=t/(e.width*(1+s)),l=n/(e.height*(1+s)),a=Math.min(o,l),u=Ci(a,r,i),f=e.x+e.width/2,d=e.y+e.height/2,c=t/2-f*u,h=n/2-d*u;return{x:c,y:h,zoom:u}},Ol=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ji(e){return e!==void 0&&e!=="parent"}function fn(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 hy(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 py(e,t={width:0,height:0},n,r,i){const s={...e},o=r.get(n);if(o){const l=o.origin||i;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function ds(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=tn(e),l=ro({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:a,y:u}=n?la(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const aa=e=>({width:e.offsetWidth,height:e.offsetHeight}),my=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},m_=["INPUT","SELECT","TEXTAREA"];function jc(e){var r,i,s;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return m_.includes(t==null?void 0:t.nodeName)||((s=t==null?void 0:t.hasAttribute)==null?void 0:s.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const gy=e=>"clientX"in e,tn=(e,t)=>{var s,o;const n=gy(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Kh=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...aa(o)}})};function yy({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:l}){const a=e*.125+i*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,f=Math.abs(a-e),d=Math.abs(u-t);return[a,u,f,d]}function Po(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gh({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case G.Left:return[t-Po(t-r,s),n];case G.Right:return[t+Po(r-t,s),n];case G.Top:return[t,n-Po(n-i,s)];case G.Bottom:return[t,n+Po(i-n,s)]}}function vy({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top,curvature:o=.25}){const[l,a]=Gh({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[u,f]=Gh({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[d,c,h,v]=yy({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:f});return[`M${e},${t} C${l},${a} ${u},${f} ${r},${i}`,d,c,h,v]}function xy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[s,l,i,o]}function g_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const s=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(s?o:0)}function y_({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=sa($l(e),$l(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return As(o,oa(s))>0}const v_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,x_=(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)),w_=(e,t)=>{if(!e.source||!e.target)return t;let n;return oy(e)?n={...e}:n={...e,id:v_(e)},x_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function wy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,l]=xy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,o,l]}const Zh={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},S_=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.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},Jh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function k_({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:r=G.Top,center:i,offset:s}){const o=Zh[t],l=Zh[r],a={x:e.x+o.x*s,y:e.y+o.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},f=S_({source:a,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",c=f[d];let h=[],v,y;const S={x:0,y:0},m={x:0,y:0},[x,g,w,_]=xy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*l[d]===-1){v=i.x??x,y=i.y??g;const N=[{x:v,y:a.y},{x:v,y:u.y}],b=[{x:a.x,y},{x:u.x,y}];o[d]===c?h=d==="x"?N:b:h=d==="x"?b:N}else{const N=[{x:a.x,y:u.y}],b=[{x:u.x,y:a.y}];if(d==="x"?h=o.x===c?b:N:h=o.y===c?N:b,t===r){const A=Math.abs(e[d]-n[d]);if(A<=s){const E=Math.min(s-1,s-A);o[d]===c?S[d]=(a[d]>e[d]?-1:1)*E:m[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const A=d==="x"?"y":"x",E=o[d]===l[A],$=a[A]>u[A],z=a[A]<u[A];(o[d]===1&&(!E&&$||E&&z)||o[d]!==1&&(!E&&z||E&&$))&&(h=d==="x"?N:b)}const P={x:a.x+S.x,y:a.y+S.y},I={x:u.x+m.x,y:u.y+m.y},D=Math.max(Math.abs(P.x-h[0].x),Math.abs(I.x-h[0].x)),F=Math.max(Math.abs(P.y-h[0].y),Math.abs(I.y-h[0].y));D>=F?(v=(P.x+I.x)/2,y=h[0].y):(v=h[0].x,y=(P.y+I.y)/2)}return[[e,{x:a.x+S.x,y:a.y+S.y},...h,{x:u.x+m.x,y:u.y+m.y},n],v,y,w,_]}function E_(e,t,n,r){const i=Math.min(Jh(e,t)/2,Jh(t,n)/2,r),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${s+i*u},${o}Q ${s},${o} ${s},${o+i*f}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${s},${o+i*a}Q ${s},${o} ${s+i*l},${o}`}function Mc({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top,borderRadius:o=5,centerX:l,centerY:a,offset:u=20}){const[f,d,c,h,v]=k_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:a},offset:u});return[f.reduce((S,m,x)=>{let g="";return x>0&&x<f.length-1?g=E_(f[x-1],m,f[x+1],o):g=`${x===0?"M":"L"}${m.x} ${m.y}`,S+=g,S},""),d,c,h,v]}function ep(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function __(e){var d;const{sourceNode:t,targetNode:n}=e;if(!ep(t)||!ep(n))return null;const r=t.internals.handleBounds||tp(t.handles),i=n.internals.handleBounds||tp(n.handles),s=np((r==null?void 0:r.source)??[],e.sourceHandle),o=np(e.connectionMode===Ni.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(d=e.onError)==null||d.call(e,"008",dn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||G.Bottom,a=(o==null?void 0:o.position)||G.Top,u=Ls(t,s,l),f=Ls(n,o,a);return{sourceX:u.x,sourceY:u.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:a}}function tp(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 Ls(e,t,n=G.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??fn(e);if(r)return{x:i+o/2,y:s+l/2};switch((t==null?void 0:t.position)??n){case G.Top:return{x:i+o/2,y:s};case G.Right:return{x:i+o,y:s+l/2};case G.Bottom:return{x:i+o/2,y:s+l};case G.Left:return{x:i,y:s+l/2}}}function np(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Pc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function N_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(a=>{if(a&&typeof a=="object"){const u=Pc(a,t);s.has(u)||(o.push({id:u,color:a.color||n,...a}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const Xd={nodeOrigin:[0,0],nodeExtent:Os,elevateNodesOnSelect:!0,defaults:{}},C_={...Xd,checkEquality:!0};function Yd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function b_(e,t,n){const r=Yd(Xd,n);for(const i of e.values())if(i.parentId)Kd(i,e,t,r);else{const s=to(i,r.nodeOrigin),o=ji(i.extent)?i.extent:r.nodeExtent,l=Nr(s,o,fn(i));i.internals.positionAbsolute=l}}function zc(e,t,n,r){var l,a;const i=Yd(C_,r),s=new Map(t),o=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(i.checkEquality&&u===(f==null?void 0:f.internals.userNode))t.set(u.id,f);else{const d=to(u,i.nodeOrigin),c=ji(u.extent)?u.extent:i.nodeExtent,h=Nr(d,c,fn(u));f={...i.defaults,...u,measured:{width:(l=u.measured)==null?void 0:l.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:h,handleBounds:u.measured?f==null?void 0:f.internals.handleBounds:void 0,z:Sy(u,o),userNode:u}},t.set(u.id,f)}u.parentId&&Kd(f,t,n,r)}}function j_(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 Kd(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:o}=Yd(Xd,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}j_(e,n);const u=i?1e3:0,{x:f,y:d,z:c}=M_(e,a,s,o,u),{positionAbsolute:h}=e.internals,v=f!==h.x||d!==h.y;(v||c!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:v?{x:f,y:d}:h,z:c})}function Sy(e,t){return(Mt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function M_(e,t,n,r,i){const{x:s,y:o}=t.internals.positionAbsolute,l=fn(e),a=to(e,n),u=ji(e.extent)?Nr(a,e.extent,l):a;let f=Nr({x:s+u.x,y:o+u.y},r,l);e.extent==="parent"&&(f=uy(f,l,t));const d=Sy(e,i),c=t.internals.z??0;return{x:f.x,y:f.y,z:c>d?c:d}}function Gd(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??bi(a),f=dy(u,l.rect);s.set(l.parentId,{expandedRect:f,parent:a})}return s.size>0&&s.forEach(({expandedRect:l,parent:a},u)=>{var g;const f=a.internals.positionAbsolute,d=fn(a),c=a.origin??r,h=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,v=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,y=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),m=(y-d.width)*c[0],x=(S-d.height)*c[1];(h>0||v>0||m||x)&&(i.push({id:u,type:"position",position:{x:a.position.x-h+m,y:a.position.y-v+x}}),(g=n.get(u))==null||g.forEach(w=>{e.some(_=>_.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+v}})})),(d.width<l.width||d.height<l.height||h||v)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:y+(h?c[0]*h-m:0),height:S+(v?c[1]*v-x:0)}})}),i}function P_(e,t,n,r,i,s){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const a=[],u=window.getComputedStyle(o),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const c of e.values()){const h=t.get(c.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const v=aa(c.nodeElement),y=h.measured.width!==v.width||h.measured.height!==v.height;if(!!(v.width&&v.height&&(y||!h.internals.handleBounds||c.force))){const m=c.nodeElement.getBoundingClientRect(),x=ji(h.extent)?h.extent:s;let{positionAbsolute:g}=h.internals;h.parentId&&h.extent==="parent"?g=uy(g,v,t.get(h.parentId)):x&&(g=Nr(g,x,v)),h.measured=v,h.internals={...h.internals,positionAbsolute:g,handleBounds:{source:Kh("source",c.nodeElement,m,f,h.id),target:Kh("target",c.nodeElement,m,f,h.id)}},h.parentId&&Kd(h,t,n,{nodeOrigin:i}),l=!0,y&&(a.push({id:h.id,type:"dimensions",dimensions:v}),h.expandParent&&h.parentId&&d.push({id:h.id,parentId:h.parentId,rect:bi(h,i)}))}}}if(d.length>0){const c=Gd(d,t,n,i);a.push(...c)}return{changes:a,updatedInternals:l}}async function z_({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function ky(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:l=null}=r,a=`${i}-source-${o}`,u=`${s}-target-${l}`,f=e.get(a)||new Map,d=e.get(u)||new Map,c={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:l};t.set(r.id,r),e.set(a,f.set(`${s}-${l}`,c)),e.set(u,d.set(`${i}-${o}`,c))}}function Ey(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ey(n,t):!1}function rp(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 I_(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Ey(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&i.set(s,{id:s,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 i}function eu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,a;const i=[];for(const[u,f]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&i.push({...d,position:f.position,dragging:r})}if(!e)return[i[0],i];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((a=t.get(e))==null?void 0:a.position)||s.position,dragging:r}:i[0],i]}function T_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,l=new Map,a=!1,u={x:0,y:0},f=null,d=!1,c=null,h=!1;function v({noDragClassName:S,handleSelector:m,domNode:x,isSelectable:g,nodeId:w,nodeClickDistance:_=0}){c=it(x);function M({x:I,y:D},F){const{nodeLookup:A,nodeExtent:E,snapGrid:$,snapToGrid:z,nodeOrigin:O,onNodeDrag:k,onSelectionDrag:j,onError:T,updateNodePositions:L}=t();s={x:I,y:D};let H=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&E){const Q=no(l);K=bc(Q)}for(const[Q,X]of l){if(!A.has(Q))continue;let q={x:I-X.distance.x,y:D-X.distance.y};z&&(q=la(q,$));let Z=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(l.size>1&&E&&!X.extent){const{positionAbsolute:se}=X.internals,ne=se.x-K.x+E[0][0],J=se.x+X.measured.width-K.x2+E[1][0],ae=se.y-K.y+E[0][1],fe=se.y+X.measured.height-K.y2+E[1][1];Z=[[ne,ae],[J,fe]]}const{position:U,positionAbsolute:te}=ay({nodeId:Q,nextPosition:q,nodeLookup:A,nodeExtent:Z,nodeOrigin:O,onError:T});H=H||X.position.x!==U.x||X.position.y!==U.y,X.position=U,X.internals.positionAbsolute=te}if(H&&(L(l,!0),F&&(r||k||!w&&j))){const[Q,X]=eu({nodeId:w,dragItems:l,nodeLookup:A});r==null||r(F,l,Q,X),k==null||k(F,Q,X),w||j==null||j(F,X)}}async function N(){if(!f)return;const{transform:I,panBy:D,autoPanSpeed:F}=t(),[A,E]=cy(u,f,F);(A!==0||E!==0)&&(s.x=(s.x??0)-A/I[2],s.y=(s.y??0)-E/I[2],await D({x:A,y:E})&&M(s,null)),o=requestAnimationFrame(N)}function b(I){var H;const{nodeLookup:D,multiSelectionActive:F,nodesDraggable:A,transform:E,snapGrid:$,snapToGrid:z,selectNodesOnDrag:O,onNodeDragStart:k,onSelectionDragStart:j,unselectNodesAndEdges:T}=t();d=!0,(!O||!g)&&!F&&w&&((H=D.get(w))!=null&&H.selected||T()),g&&O&&w&&(e==null||e(w));const L=ds(I.sourceEvent,{transform:E,snapGrid:$,snapToGrid:z,containerBounds:f});if(s=L,l=I_(D,A,L,w),l.size>0&&(n||k||!w&&j)){const[K,Q]=eu({nodeId:w,dragItems:l,nodeLookup:D});n==null||n(I.sourceEvent,l,K,Q),k==null||k(I.sourceEvent,K,Q),w||j==null||j(I.sourceEvent,Q)}}const P=Hg().clickDistance(_).on("start",I=>{const{domNode:D,nodeDragThreshold:F,transform:A,snapGrid:E,snapToGrid:$}=t();f=(D==null?void 0:D.getBoundingClientRect())||null,h=!1,F===0&&b(I),s=ds(I.sourceEvent,{transform:A,snapGrid:E,snapToGrid:$,containerBounds:f}),u=tn(I.sourceEvent,f)}).on("drag",I=>{const{autoPanOnNodeDrag:D,transform:F,snapGrid:A,snapToGrid:E,nodeDragThreshold:$,nodeLookup:z}=t(),O=ds(I.sourceEvent,{transform:F,snapGrid:A,snapToGrid:E,containerBounds:f});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||w&&!z.has(w))&&(h=!0),!h){if(!a&&D&&d&&(a=!0,N()),!d){const k=O.xSnapped-(s.x??0),j=O.ySnapped-(s.y??0);Math.sqrt(k*k+j*j)>$&&b(I)}(s.x!==O.xSnapped||s.y!==O.ySnapped)&&l&&d&&(u=tn(I.sourceEvent,f),M(O,I.sourceEvent))}}).on("end",I=>{if(!(!d||h)&&(a=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:D,updateNodePositions:F,onNodeDragStop:A,onSelectionDragStop:E}=t();if(F(l,!1),i||A||!w&&E){const[$,z]=eu({nodeId:w,dragItems:l,nodeLookup:D,dragging:!1});i==null||i(I.sourceEvent,l,$,z),A==null||A(I.sourceEvent,$,z),w||E==null||E(I.sourceEvent,z)}}}).filter(I=>{const D=I.target;return!I.button&&(!S||!rp(D,`.${S}`,x))&&(!m||rp(D,m,x))});c.call(P)}function y(){c==null||c.on(".drag",null)}return{update:v,destroy:y}}function R_(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())As(i,bi(s))>0&&r.push(s);return r}const $_=250;function O_(e,t,n,r){var l,a;let i=[],s=1/0;const o=R_(e,n,t+$_);for(const u of o){const f=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of f){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:c,y:h}=Ls(u,d,d.position,!0),v=Math.sqrt(Math.pow(c-e.x,2)+Math.pow(h-e.y,2));v>t||(v<s?(i=[{...d,x:c,y:h}],s=v):v===s&&i.push({...d,x:c,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(f=>f.type===u)??i[0]}return i[0]}function _y(e,t,n,r,i,s=!1){var u,f,d;const o=r.get(e);if(!o)return null;const l=i==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((f=o.internals.handleBounds)==null?void 0:f.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(c=>c.id===n):l==null?void 0:l[0])??null;return a&&s?{...a,...Ls(o,a,a.position,!0)}:a}function Ny(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function D_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Cy=()=>!0;function A_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:f,flowId:d,panBy:c,cancelConnection:h,onConnectStart:v,onConnect:y,onConnectEnd:S,isValidConnection:m=Cy,onReconnectEnd:x,updateConnection:g,getTransform:w,getFromHandle:_,autoPanSpeed:M}){const N=my(e.target);let b=0,P;const{x:I,y:D}=tn(e),F=N==null?void 0:N.elementFromPoint(I,D),A=Ny(s,F),E=l==null?void 0:l.getBoundingClientRect();if(!E||!A)return;const $=_y(i,A,r,a,t);if(!$)return;let z=tn(e,E),O=!1,k=null,j=!1,T=null;function L(){if(!f||!E)return;const[te,se]=cy(z,E,M);c({x:te,y:se}),b=requestAnimationFrame(L)}const H={...$,nodeId:i,type:A,position:$.position},K=a.get(i),X={inProgress:!0,isValid:null,from:Ls(K,H,G.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:K,to:z,toHandle:null,toPosition:qh[H.position],toNode:null};g(X);let q=X;v==null||v(e,{nodeId:i,handleId:r,handleType:A});function Z(te){if(!_()||!H){U(te);return}const se=w();z=tn(te,E),P=O_(ro(z,se,!1,[1,1]),n,a,H),O||(L(),O=!0);const ne=by(te,{handle:P,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:m,doc:N,lib:u,flowId:d,nodeLookup:a});T=ne.handleDomNode,k=ne.connection,j=D_(!!P,ne.isValid);const J={...q,isValid:j,to:P&&j?fy({x:P.x,y:P.y},se):z,toHandle:ne.toHandle,toPosition:j&&ne.toHandle?ne.toHandle.position:qh[H.position],toNode:ne.toHandle?a.get(ne.toHandle.nodeId):null};j&&P&&q.toHandle&&J.toHandle&&q.toHandle.type===J.toHandle.type&&q.toHandle.nodeId===J.toHandle.nodeId&&q.toHandle.id===J.toHandle.id&&q.to.x===J.to.x&&q.to.y===J.to.y||(g(J),q=J)}function U(te){(P||T)&&k&&j&&(y==null||y(k));const{inProgress:se,...ne}=q,J={...ne,toPosition:q.toHandle?q.toPosition:null};S==null||S(te,J),s&&(x==null||x(te,J)),h(),cancelAnimationFrame(b),O=!1,j=!1,k=null,T=null,N.removeEventListener("mousemove",Z),N.removeEventListener("mouseup",U),N.removeEventListener("touchmove",Z),N.removeEventListener("touchend",U)}N.addEventListener("mousemove",Z),N.addEventListener("mouseup",U),N.addEventListener("touchmove",Z),N.addEventListener("touchend",U)}function by(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:l,flowId:a,isValidConnection:u=Cy,nodeLookup:f}){const d=s==="target",c=t?o.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:h,y:v}=tn(e),y=o.elementFromPoint(h,v),S=y!=null&&y.classList.contains(`${l}-flow__handle`)?y:c,m={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=Ny(void 0,S),g=S.getAttribute("data-nodeid"),w=S.getAttribute("data-handleid"),_=S.classList.contains("connectable"),M=S.classList.contains("connectableend");if(!g||!x)return m;const N={source:d?g:r,sourceHandle:d?w:i,target:d?r:g,targetHandle:d?i:w};m.connection=N;const P=_&&M&&(n===Ni.Strict?d&&x==="source"||!d&&x==="target":g!==r||w!==i);m.isValid=P&&u(N),m.toHandle=_y(g,x,w,f,n,!1)}return m}const Ic={onPointerDown:A_,isValid:by};function L_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=it(e);function s({translateExtent:l,width:a,height:u,zoomStep:f=10,pannable:d=!0,zoomable:c=!0,inversePan:h=!1}){const v=g=>{const w=n();if(g.sourceEvent.type!=="wheel"||!t)return;const _=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*f,M=w[2]*Math.pow(2,_);t.scaleTo(M)};let y=[0,0];const S=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(y=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const _=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],M=[_[0]-y[0],_[1]-y[1]];y=_;const N=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),b={x:w[0]-M[0]*N,y:w[1]-M[1]*N},P=[[0,0],[a,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},P,l)},x=ny().on("start",S).on("zoom",d?m:null).on("zoom.wheel",c?v:null);i.call(x,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:Nt}}const F_=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ua=e=>({x:e.x,y:e.y,zoom:e.k}),tu=({x:e,y:t,zoom:n})=>ia.translate(e,t).scale(n),Br=(e,t)=>e.target.closest(`.${t}`),jy=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),nu=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},My=e=>{const t=e.ctrlKey&&Ol()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function H_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return f=>{if(Br(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(f.ctrlKey&&o){const S=Nt(f),m=My(f),x=d*Math.pow(2,m);r.scaleTo(n,x,S,f);return}const c=f.deltaMode===1?20:1;let h=i===gr.Vertical?0:f.deltaX*c,v=i===gr.Horizontal?0:f.deltaY*c;!Ol()&&f.shiftKey&&i!==gr.Vertical&&(h=f.deltaY*c,v=0),r.translateBy(n,-(h/d)*s,-(v/d)*s,{internal:!0});const y=ua(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,y)),e.isPanScrolling&&(a==null||a(f,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(f,y),e.isPanScrolling=!1},150))}}function B_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||Br(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function V_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,l;if((s=r.sourceEvent)!=null&&s.internal)return;const i=ua(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function U_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&jy(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((l=s.sourceEvent)!=null&&l.internal)&&(i==null||i(s.sourceEvent,ua(s.transform)))}}function Q_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&jy(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&F_(e.prevViewport,o.transform))){const a=ua(o.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,a)},n?150:0)}}}function W_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:a,lib:u}){return f=>{var v;const d=e||t,c=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(Br(f,`${u}-flow__node`)||Br(f,`${u}-flow__edge`)))return!0;if(!r&&!d&&!i&&!s&&!n||o||Br(f,l)&&f.type==="wheel"||Br(f,a)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!d&&!i&&!c&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&h}}function q_({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:a,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=ny().clickDistance(!Mt(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=it(e).call(c);g({x:s.x,y:s.y,zoom:Ci(s.zoom,t,n)},[[0,0],[d.width,d.height]],i);const v=h.on("wheel.zoom"),y=h.on("dblclick.zoom");c.wheelDelta(My);function S(F,A){return h?new Promise(E=>{c==null||c.transform(nu(h,A==null?void 0:A.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function m({noWheelClassName:F,noPanClassName:A,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:z,panOnDrag:O,panOnScrollMode:k,panOnScrollSpeed:j,preventScrolling:T,zoomOnPinch:L,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:Q,lib:X,onTransformChange:q}){$&&!f.isZoomingOrPanning&&x();const U=z&&!Q&&!$?H_({zoomPanValues:f,noWheelClassName:F,d3Selection:h,d3Zoom:c,panOnScrollMode:k,panOnScrollSpeed:j,zoomOnPinch:L,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:a}):B_({noWheelClassName:F,preventScrolling:T,d3ZoomHandler:v});if(h.on("wheel.zoom",U,{passive:!1}),!$){const se=V_({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:l});c.on("start",se);const ne=U_({zoomPanValues:f,panOnDrag:O,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:q});c.on("zoom",ne);const J=Q_({zoomPanValues:f,panOnDrag:O,panOnScroll:z,onPaneContextMenu:E,onPanZoomEnd:a,onDraggingChange:u});c.on("end",J)}const te=W_({zoomActivationKeyPressed:Q,panOnDrag:O,zoomOnScroll:H,panOnScroll:z,zoomOnDoubleClick:K,zoomOnPinch:L,userSelectionActive:$,noPanClassName:A,noWheelClassName:F,lib:X});c.filter(te),K?h.on("dblclick.zoom",y):h.on("dblclick.zoom",null)}function x(){c.on("zoom",null)}async function g(F,A,E){const $=tu(F),z=c==null?void 0:c.constrain()($,A,E);return z&&await S(z),new Promise(O=>O(z))}async function w(F,A){const E=tu(F);return await S(E,A),new Promise($=>$(E))}function _(F){if(h){const A=tu(F),E=h.property("__zoom");(E.k!==F.zoom||E.x!==F.x||E.y!==F.y)&&(c==null||c.transform(h,A,null,{sync:!0}))}}function M(){const F=h?ty(h.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function N(F,A){return h?new Promise(E=>{c==null||c.scaleTo(nu(h,A==null?void 0:A.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function b(F,A){return h?new Promise(E=>{c==null||c.scaleBy(nu(h,A==null?void 0:A.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function P(F){c==null||c.scaleExtent(F)}function I(F){c==null||c.translateExtent(F)}function D(F){const A=!Mt(F)||F<0?0:F;c==null||c.clickDistance(A)}return{update:m,destroy:x,setViewport:w,setViewportConstrained:g,getViewport:M,scaleTo:N,scaleBy:b,setScaleExtent:P,setTranslateExtent:I,syncViewport:_,setClickDistance:D}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function X_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=e-t,l=n-r,a=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(a[0]=a[0]*-1),l&&s&&(a[1]=a[1]*-1),a}function Y_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function yn(e,t){return Math.max(0,t-e)}function vn(e,t){return Math.max(0,e-t)}function zo(e,t,n){return Math.max(0,t-e,e-n)}function ip(e,t){return e?!t:t}function K_(e,t,n,r,i,s,o,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:f,isVertical:d}=t,c=f&&d,{xSnapped:h,ySnapped:v}=n,{minWidth:y,maxWidth:S,minHeight:m,maxHeight:x}=r,{x:g,y:w,width:_,height:M,aspectRatio:N}=e;let b=Math.floor(f?h-e.pointerX:0),P=Math.floor(d?v-e.pointerY:0);const I=_+(a?-b:b),D=M+(u?-P:P),F=-s[0]*_,A=-s[1]*M;let E=zo(I,y,S),$=zo(D,m,x);if(o){let k=0,j=0;a&&b<0?k=yn(g+b+F,o[0][0]):!a&&b>0&&(k=vn(g+I+F,o[1][0])),u&&P<0?j=yn(w+P+A,o[0][1]):!u&&P>0&&(j=vn(w+D+A,o[1][1])),E=Math.max(E,k),$=Math.max($,j)}if(l){let k=0,j=0;a&&b>0?k=vn(g+b,l[0][0]):!a&&b<0&&(k=yn(g+I,l[1][0])),u&&P>0?j=vn(w+P,l[0][1]):!u&&P<0&&(j=yn(w+D,l[1][1])),E=Math.max(E,k),$=Math.max($,j)}if(i){if(f){const k=zo(I/N,m,x)*N;if(E=Math.max(E,k),o){let j=0;!a&&!u||a&&!u&&c?j=vn(w+A+I/N,o[1][1])*N:j=yn(w+A+(a?b:-b)/N,o[0][1])*N,E=Math.max(E,j)}if(l){let j=0;!a&&!u||a&&!u&&c?j=yn(w+I/N,l[1][1])*N:j=vn(w+(a?b:-b)/N,l[0][1])*N,E=Math.max(E,j)}}if(d){const k=zo(D*N,y,S)/N;if($=Math.max($,k),o){let j=0;!a&&!u||u&&!a&&c?j=vn(g+D*N+F,o[1][0])/N:j=yn(g+(u?P:-P)*N+F,o[0][0])/N,$=Math.max($,j)}if(l){let j=0;!a&&!u||u&&!a&&c?j=yn(g+D*N,l[1][0])/N:j=vn(g+(u?P:-P)*N,l[0][0])/N,$=Math.max($,j)}}}P=P+(P<0?$:-$),b=b+(b<0?E:-E),i&&(c?I>D*N?P=(ip(a,u)?-b:b)/N:b=(ip(a,u)?-P:P)*N:f?(P=b/N,u=a):(b=P*N,a=u));const z=a?g+b:g,O=u?w+P:w;return{width:_+(a?-b:b),height:M+(u?-P:P),x:s[0]*b*(a?-1:1)+z,y:s[1]*P*(u?-1:1)+O}}const Py={width:0,height:0,x:0,y:0},G_={...Py,pointerX:0,pointerY:0,aspectRatio:1};function Z_(e){return[[0,0],[e.measured.width,e.measured.height]]}function J_(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,a=n[1]*o;return[[r-l,i-a],[r+s-l,i+o-a]]}function eN({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=it(e);function o({controlPosition:a,boundaries:u,keepAspectRatio:f,onResizeStart:d,onResize:c,onResizeEnd:h,shouldResize:v}){let y={...Py},S={...G_};const m=Y_(a);let x,g=null,w=[],_,M,N;const b=Hg().on("start",P=>{const{nodeLookup:I,transform:D,snapGrid:F,snapToGrid:A,nodeOrigin:E,paneDomNode:$}=n();if(x=I.get(t),!x)return;g=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:O}=ds(P.sourceEvent,{transform:D,snapGrid:F,snapToGrid:A,containerBounds:g});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},S={...y,pointerX:z,pointerY:O,aspectRatio:y.width/y.height},_=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(_=I.get(x.parentId),M=_&&x.extent==="parent"?Z_(_):void 0),w=[],N=void 0;for(const[k,j]of I)if(j.parentId===t&&(w.push({id:k,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const T=J_(j,x,j.origin??E);N?N=[[Math.min(T[0][0],N[0][0]),Math.min(T[0][1],N[0][1])],[Math.max(T[1][0],N[1][0]),Math.max(T[1][1],N[1][1])]]:N=T}d==null||d(P,{...y})}).on("drag",P=>{const{transform:I,snapGrid:D,snapToGrid:F,nodeOrigin:A}=n(),E=ds(P.sourceEvent,{transform:I,snapGrid:D,snapToGrid:F,containerBounds:g}),$=[];if(!x)return;const{x:z,y:O,width:k,height:j}=y,T={},L=x.origin??A,{width:H,height:K,x:Q,y:X}=K_(S,m,E,u,f,L,M,N),q=H!==k,Z=K!==j,U=Q!==z&&q,te=X!==O&&Z;if(!U&&!te&&!q&&!Z)return;if((U||te||L[0]===1||L[1]===1)&&(T.x=U?Q:y.x,T.y=te?X:y.y,y.x=T.x,y.y=T.y,w.length>0)){const ae=Q-z,fe=X-O;for(const $e of w)$e.position={x:$e.position.x-ae+L[0]*(H-k),y:$e.position.y-fe+L[1]*(K-j)},$.push($e)}if((q||Z)&&(T.width=q?H:y.width,T.height=Z?K:y.height,y.width=T.width,y.height=T.height),_&&x.expandParent){const ae=L[0]*(T.width??0);T.x&&T.x<ae&&(y.x=ae,S.x=S.x-(T.x-ae));const fe=L[1]*(T.height??0);T.y&&T.y<fe&&(y.y=fe,S.y=S.y-(T.y-fe))}const se=X_({width:y.width,prevWidth:k,height:y.height,prevHeight:j,affectsX:m.affectsX,affectsY:m.affectsY}),ne={...y,direction:se};(v==null?void 0:v(P,ne))!==!1&&(c==null||c(P,ne),r(T,$))}).on("end",P=>{h==null||h(P,{...y}),i==null||i()});s.call(b)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var zy={exports:{}},Iy={},Ty={exports:{}},Ry={};/**
|
|
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 Mi=R;function tN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nN=typeof Object.is=="function"?Object.is:tN,rN=Mi.useState,iN=Mi.useEffect,sN=Mi.useLayoutEffect,oN=Mi.useDebugValue;function lN(e,t){var n=t(),r=rN({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return sN(function(){i.value=n,i.getSnapshot=t,ru(i)&&s({inst:i})},[e,n,t]),iN(function(){return ru(i)&&s({inst:i}),e(function(){ru(i)&&s({inst:i})})},[e]),oN(n),n}function ru(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nN(e,n)}catch{return!0}}function aN(e,t){return t()}var uN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aN:lN;Ry.useSyncExternalStore=Mi.useSyncExternalStore!==void 0?Mi.useSyncExternalStore:uN;Ty.exports=Ry;var cN=Ty.exports;/**
|
|
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 ca=R,dN=cN;function fN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hN=typeof Object.is=="function"?Object.is:fN,pN=dN.useSyncExternalStore,mN=ca.useRef,gN=ca.useEffect,yN=ca.useMemo,vN=ca.useDebugValue;Iy.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=mN(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=yN(function(){function a(h){if(!u){if(u=!0,f=h,h=r(h),i!==void 0&&o.hasValue){var v=o.value;if(i(v,h))return d=v}return d=h}if(v=d,hN(f,h))return v;var y=r(h);return i!==void 0&&i(v,y)?(f=h,v):(f=h,d=y)}var u=!1,f,d,c=n===void 0?null:n;return[function(){return a(t())},c===null?void 0:function(){return a(c())}]},[t,n,r,i]);var l=pN(e,s[0],s[1]);return gN(function(){o.hasValue=!0,o.value=l},[l]),vN(l),l};zy.exports=Iy;var xN=zy.exports;const wN=Hp(xN),SN={},sp=e=>{let t;const n=new Set,r=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const h=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(v=>v(t,h))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(SN?"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()}},u=t=e(r,i,a);return a},kN=e=>e?sp(e):sp,{useDebugValue:EN}=zx,{useSyncExternalStoreWithSelector:_N}=wN,NN=e=>e;function $y(e,t=NN,n){const r=_N(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return EN(r),r}const op=(e,t)=>{const n=kN(e),r=(i,s=t)=>$y(n,i,s);return Object.assign(r,n),r},CN=(e,t)=>e?op(e,t):op;function Ee(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,i]of e)if(!Object.is(i,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 da=R.createContext(null),bN=da.Provider,Oy=dn.error001();function le(e,t){const n=R.useContext(da);if(n===null)throw new Error(Oy);return $y(n,e,t)}function ge(){const e=R.useContext(da);if(e===null)throw new Error(Oy);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const lp={display:"none"},jN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Dy="react-flow__node-desc",Ay="react-flow__edge-desc",MN="react-flow__aria-live",PN=e=>e.ariaLiveMessage;function zN({rfId:e}){const t=le(PN);return p.jsx("div",{id:`${MN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jN,children:t})}function IN({rfId:e,disableKeyboardA11y:t}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{id:`${Dy}-${e}`,style:lp,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."," "]}),p.jsx("div",{id:`${Ay}-${e}`,style:lp,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&p.jsx(zN,{rfId:e})]})}const TN=e=>e.userSelectionActive?"none":"all",Zd=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const o=le(TN),l=`${e}`.split("-");return p.jsx("div",{className:Ce(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},ref:s,...i,children:t})});function RN({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:p.jsx(Zd,{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:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $N=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}},Io=e=>e.id;function ON(e,t){return Ee(e.selectedNodes.map(Io),t.selectedNodes.map(Io))&&Ee(e.selectedEdges.map(Io),t.selectedEdges.map(Io))}function DN({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le($N,ON);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const AN=e=>!!e.onSelectionChangeHandlers;function LN({onSelectionChange:e}){const t=le(AN);return e||t?p.jsx(DN,{onSelectionChange:e}):null}const Ly=[0,0],FN={x:0,y:0,zoom:1},HN=["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"],ap=[...HN,"rfId"],BN=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}),up={translateExtent:Os,nodeOrigin:Ly,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function VN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=le(BN,Ee),f=ge();R.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=up,l()}),[]);const d=R.useRef(up);return R.useEffect(()=>{for(const c of ap){const h=e[c],v=d.current[c];h!==v&&(typeof e[c]>"u"||(c==="nodes"?t(h):c==="edges"?n(h):c==="minZoom"?r(h):c==="maxZoom"?i(h):c==="translateExtent"?s(h):c==="nodeExtent"?o(h):c==="paneClickDistance"?u(h):c==="fitView"?f.setState({fitViewOnInit:h}):c==="fitViewOptions"?f.setState({fitViewOnInitOptions:h}):f.setState({[c]:h})))}d.current=e},ap.map(c=>e[c])),null}function cp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function UN(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=cp(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=cp())!=null&&r.matches?"dark":"light"}const dp=typeof document<"u"?document:null;function Fs(e=null,t={target:dp,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),s=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),f=u.reduce((d,c)=>d.concat(...c),[]);return[u,f]}return[[],[]]},[e]);return R.useEffect(()=>{const a=(t==null?void 0:t.target)||dp;if(e!==null){const u=c=>{if(i.current=c.ctrlKey||c.metaKey||c.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&jc(c))return!1;const v=hp(c.code,l);s.current.add(c[v]),fp(o,s.current,!1)&&(c.preventDefault(),r(!0))},f=c=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&jc(c))return!1;const v=hp(c.code,l);fp(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(c[v]),c.key==="Meta"&&s.current.clear(),i.current=!1},d=()=>{s.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function fp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function hp(e,t){return t.includes(e)?"code":"key"}const QN=()=>{const e=ge();return R.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,i,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},{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:i,panZoom:s,domNode:o}=e.getState();if(!s||!o)return Promise.resolve(!1);const l=Nc(n,t),{width:a,height:u}=aa(o);return Cc({nodes:l,width:a,height:u,minZoom:r,maxZoom:i,panZoom:s},t)},setCenter:async(t,n,r)=>{const{width:i,height:s,maxZoom:o,panZoom:l}=e.getState(),a=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,u=i/2-t*a,f=s/2-n*a;return l?(await l.setViewport({x:u,y:f,zoom:a},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),a=qd(t,r,i,s,o,(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:i,domNode:s}=e.getState();if(!s)return t;const{x:o,y:l}=s.getBoundingClientRect(),a={x:t.x-o,y:t.y-l};return ro(a,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),o=fy(t,n);return{x:o.x+i,y:o.y+s}}}),[])};function Fy(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const o=r.get(s.id);o?o.push(s):r.set(s.id,[s])}for(const s of t){const o=r.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const a of o)WN(a,l);n.push(l)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function WN(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 qN(e,t){return Fy(e,t)}function XN(e,t){return Fy(e,t)}function er(e,t){return{id:e,type:"select",selected:t}}function Vr(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const o=t.has(i);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),r.push(er(s.id,o)))}return r}function pp({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),a=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;a!==void 0&&a!==o&&n.push({id:o.id,item:o,type:"replace"}),a===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function mp(e){return{id:e.id,type:"remove"}}const gp=e=>c_(e),YN=e=>oy(e);function Hy(e){return R.forwardRef(e)}const KN=typeof window<"u"?R.useLayoutEffect:R.useEffect;function yp(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>GN(()=>n(i=>i+BigInt(1))));return KN(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function GN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const By=R.createContext(null);function ZN({children:e}){const t=ge(),n=R.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:f,onNodesChange:d,nodeLookup:c}=t.getState();let h=a;for(const v of l)h=typeof v=="function"?v(h):v;f?u(h):d&&d(pp({items:h,lookup:c}))},[]),r=yp(n),i=R.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:f,onEdgesChange:d,edgeLookup:c}=t.getState();let h=a;for(const v of l)h=typeof v=="function"?v(h):v;f?u(h):d&&d(pp({items:h,lookup:c}))},[]),s=yp(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return p.jsx(By.Provider,{value:o,children:e})}function JN(){const e=R.useContext(By);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const eC=e=>!!e.panZoom;function Jd(){const e=QN(),t=ge(),n=JN(),r=le(eC),i=R.useMemo(()=>{const s=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var m,x;const{nodeLookup:c,nodeOrigin:h}=t.getState(),v=gp(d)?d:c.get(d.id),y=v.parentId?py(v.position,v.measured,v.parentId,c,h):v.position,S={...v,position:y,width:((m=v.measured)==null?void 0:m.width)??v.width,height:((x=v.measured)==null?void 0:x.height)??v.height};return bi(S)},u=(d,c,h={replace:!1})=>{o(v=>v.map(y=>{if(y.id===d){const S=typeof c=="function"?c(y):c;return h.replace&&gp(S)?S:{...y,...S}}return y}))},f=(d,c,h={replace:!1})=>{l(v=>v.map(y=>{if(y.id===d){const S=typeof c=="function"?c(y):c;return h.replace&&YN(S)?S:{...y,...S}}return y}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var c;return(c=s(d))==null?void 0:c.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(c=>({...c}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const c=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...c])},addEdges:d=>{const c=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...c])},toObject:()=>{const{nodes:d=[],edges:c=[],transform:h}=t.getState(),[v,y,S]=h;return{nodes:d.map(m=>({...m})),edges:c.map(m=>({...m})),viewport:{x:v,y,zoom:S}}},deleteElements:async({nodes:d=[],edges:c=[]})=>{const{nodes:h,edges:v,onNodesDelete:y,onEdgesDelete:S,triggerNodeChanges:m,triggerEdgeChanges:x,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:_,edges:M}=await h_({nodesToRemove:d,edgesToRemove:c,nodes:h,edges:v,onBeforeDelete:w}),N=M.length>0,b=_.length>0;if(N){const P=M.map(mp);S==null||S(M),x(P)}if(b){const P=_.map(mp);y==null||y(_),m(P)}return(b||N)&&(g==null||g({nodes:_,edges:M})),{deletedNodes:_,deletedEdges:M}},getIntersectingNodes:(d,c=!0,h)=>{const v=Yh(d),y=v?d:a(d),S=h!==void 0;return y?(h||t.getState().nodes).filter(m=>{const x=t.getState().nodeLookup.get(m.id);if(x&&!v&&(m.id===d.id||!x.internals.positionAbsolute))return!1;const g=bi(S?m:x),w=As(g,y);return c&&w>0||w>=y.width*y.height}):[]},isNodeIntersecting:(d,c,h=!0)=>{const y=Yh(d)?d:a(d);if(!y)return!1;const S=As(y,c);return h&&S>0||S>=y.width*y.height},updateNode:u,updateNodeData:(d,c,h={replace:!1})=>{u(d,v=>{const y=typeof c=="function"?c(v):c;return h.replace?{...v,data:y}:{...v,data:{...v.data,...y}}},h)},updateEdge:f,updateEdgeData:(d,c,h={replace:!1})=>{f(d,v=>{const y=typeof c=="function"?c(v):c;return h.replace?{...v,data:y}:{...v,data:{...v.data,...y}}},h)},getNodesBounds:d=>{const{nodeLookup:c,nodeOrigin:h}=t.getState();return d_(d,{nodeLookup:c,nodeOrigin:h})},getHandleConnections:({type:d,id:c,nodeId:h})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${h}-${d}-${c??null}`))==null?void 0:v.values())??[])}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const vp=e=>e.selected,tC={actInsideInputWithModifier:!1},nC=typeof window<"u"?window:void 0;function rC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=Jd(),i=Fs(e,tC),s=Fs(t,{target:nC});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(vp),edges:o.filter(vp)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function iC(e){const t=ge();R.useEffect(()=>{const n=()=>{var i,s;if(!e.current)return!1;const r=aa(e.current);(r.height===0||r.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",dn.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 fa={position:"absolute",width:"100%",height:"100%",top:0,left:0},sC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function oC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=gr.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:f,maxZoom:d,zoomActivationKeyCode:c,preventScrolling:h=!0,children:v,noWheelClassName:y,noPanClassName:S,onViewportChange:m,isControlledViewport:x,paneClickDistance:g}){const w=ge(),_=R.useRef(null),{userSelectionActive:M,lib:N}=le(sC,Ee),b=Fs(c),P=R.useRef();iC(_);const I=R.useCallback(D=>{m==null||m({x:D[0],y:D[1],zoom:D[2]}),x||w.setState({transform:D})},[m,x]);return R.useEffect(()=>{if(_.current){P.current=q_({domNode:_.current,minZoom:f,maxZoom:d,translateExtent:u,viewport:a,paneClickDistance:g,onDraggingChange:E=>w.setState({paneDragging:E}),onPanZoomStart:(E,$)=>{const{onViewportChangeStart:z,onMoveStart:O}=w.getState();O==null||O(E,$),z==null||z($)},onPanZoom:(E,$)=>{const{onViewportChange:z,onMove:O}=w.getState();O==null||O(E,$),z==null||z($)},onPanZoomEnd:(E,$)=>{const{onViewportChangeEnd:z,onMoveEnd:O}=w.getState();O==null||O(E,$),z==null||z($)}});const{x:D,y:F,zoom:A}=P.current.getViewport();return w.setState({panZoom:P.current,transform:[D,F,A],domNode:_.current.closest(".react-flow")}),()=>{var E;(E=P.current)==null||E.destroy()}}},[]),R.useEffect(()=>{var D;(D=P.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:b,preventScrolling:h,noPanClassName:S,userSelectionActive:M,noWheelClassName:y,lib:N,onTransformChange:I})},[e,t,n,r,i,s,o,l,b,h,S,M,y,N,I]),p.jsx("div",{className:"react-flow__renderer",ref:_,style:fa,children:v})}const lC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function aC(){const{userSelectionActive:e,userSelectionRect:t}=le(lC,Ee);return e&&t?p.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 iu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},uC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function cC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ds.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:f,onPaneMouseMove:d,onPaneMouseLeave:c,children:h}){const v=R.useRef(null),y=ge(),S=R.useRef(0),m=R.useRef(0),x=R.useRef(),g=R.useRef(new Map),{userSelectionActive:w,elementsSelectable:_,dragging:M}=le(uC,Ee),N=_&&(e||w),b=R.useRef(!1),P=R.useRef(!1),I=()=>{y.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,m.current=0},D=k=>{if(b.current){b.current=!1;return}l==null||l(k),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},F=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}a==null||a(k)},A=u?k=>u(k):void 0,E=k=>{var Q,X,q,Z;const{resetSelectedElements:j,domNode:T,edgeLookup:L}=y.getState();if(x.current=T==null?void 0:T.getBoundingClientRect(),!_||!e||k.button!==0||k.target!==v.current||!x.current)return;(X=(Q=k.target)==null?void 0:Q.setPointerCapture)==null||X.call(Q,k.pointerId),P.current=!0,b.current=!1,g.current=new Map;for(const[U,te]of L)g.current.set(te.source,((q=g.current.get(te.source))==null?void 0:q.add(U))||new Set([U])),g.current.set(te.target,((Z=g.current.get(te.target))==null?void 0:Z.add(U))||new Set([U]));const{x:H,y:K}=tn(k.nativeEvent,x.current);j(),y.setState({userSelectionRect:{width:0,height:0,startX:H,startY:K,x:H,y:K}}),s==null||s(k)},$=k=>{const{userSelectionRect:j,edgeLookup:T,transform:L,nodeLookup:H,triggerNodeChanges:K,triggerEdgeChanges:Q}=y.getState();if(!x.current||!j)return;b.current=!0;const{x:X,y:q}=tn(k.nativeEvent,x.current),{startX:Z,startY:U}=j,te={startX:Z,startY:U,x:X<Z?X:Z,y:q<U?q:U,width:Math.abs(X-Z),height:Math.abs(q-U)},se=ly(H,te,L,n===Ds.Partial,!0),ne=new Set,J=new Set;for(const ae of se){J.add(ae.id);const fe=g.current.get(ae.id);if(fe)for(const $e of fe)ne.add($e)}if(S.current!==J.size){S.current=J.size;const ae=Vr(H,J,!0);K(ae)}if(m.current!==ne.size){m.current=ne.size;const ae=Vr(T,ne);Q(ae)}y.setState({userSelectionRect:te,userSelectionActive:!0,nodesSelectionActive:!1})},z=k=>{var T,L;if(k.button!==0||!P.current)return;(L=(T=k.target)==null?void 0:T.releasePointerCapture)==null||L.call(T,k.pointerId);const{userSelectionRect:j}=y.getState();!w&&j&&k.target===v.current&&(D==null||D(k)),S.current>0&&y.setState({nodesSelectionActive:!0}),I(),o==null||o(k),(t||i)&&(b.current=!1),P.current=!1},O=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:Ce(["react-flow__pane",{draggable:O,dragging:M,selection:e}]),onClick:N?void 0:iu(D,v),onContextMenu:iu(F,v),onWheel:iu(A,v),onPointerEnter:N?void 0:f,onPointerDown:N?E:d,onPointerMove:N?$:d,onPointerUp:N?z:void 0,onPointerLeave:c,ref:v,style:fa,children:[h,p.jsx(aC,{})]})}function Tc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",dn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):i([e])}function Vy({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:o}){const l=ge(),[a,u]=R.useState(!1),f=R.useRef();return R.useEffect(()=>{f.current=T_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Tc({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{var d,c;if(t)(d=f.current)==null||d.destroy();else if(e.current)return(c=f.current)==null||c.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=f.current)==null||h.destroy()}},[n,r,t,s,e,i]),a}const dC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Uy(){const e=ge();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:f}=e.getState(),d=new Map,c=dC(o),h=i?s[0]:5,v=i?s[1]:5,y=n.direction.x*h*n.factor,S=n.direction.y*v*n.factor;for(const[,m]of u){if(!c(m))continue;let x={x:m.internals.positionAbsolute.x+y,y:m.internals.positionAbsolute.y+S};i&&(x=la(x,s));const{position:g,positionAbsolute:w}=ay({nodeId:m.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:f,onError:l});m.position=g,m.internals.positionAbsolute=w,d.set(m.id,m)}a(d)},[])}const ef=R.createContext(null),fC=ef.Provider;ef.Consumer;const Qy=()=>R.useContext(ef),hC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pC=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:o}=r,{fromHandle:l,toHandle:a,isValid:u}=o,f=(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:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===Ni.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:f&&u}};function mC({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:a,className:u,onMouseDown:f,onTouchStart:d,...c},h){var E,$;const v=o||null,y=e==="target",S=ge(),m=Qy(),{connectOnClick:x,noPanClassName:g,rfId:w}=le(hC,Ee),{connectingFrom:_,connectingTo:M,clickConnecting:N,isPossibleEndHandle:b,connectionInProcess:P,valid:I}=le(pC(m,v,e),Ee);m||($=(E=S.getState()).onError)==null||$.call(E,"010",dn.error010());const D=z=>{const{defaultEdgeOptions:O,onConnect:k,hasDefaultEdges:j}=S.getState(),T={...O,...z};if(j){const{edges:L,setEdges:H}=S.getState();H(w_(T,L))}k==null||k(T),l==null||l(T)},F=z=>{if(!m)return;const O=gy(z.nativeEvent);if(i&&(O&&z.button===0||!O)){const k=S.getState();Ic.onPointerDown(z.nativeEvent,{autoPanOnConnect:k.autoPanOnConnect,connectionMode:k.connectionMode,connectionRadius:k.connectionRadius,domNode:k.domNode,nodeLookup:k.nodeLookup,lib:k.lib,isTarget:y,handleId:v,nodeId:m,flowId:k.rfId,panBy:k.panBy,cancelConnection:k.cancelConnection,onConnectStart:k.onConnectStart,onConnectEnd:k.onConnectEnd,updateConnection:k.updateConnection,onConnect:D,isValidConnection:n||k.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:k.autoPanSpeed})}O?f==null||f(z):d==null||d(z)},A=z=>{const{onClickConnectStart:O,onClickConnectEnd:k,connectionClickStartHandle:j,connectionMode:T,isValidConnection:L,lib:H,rfId:K,nodeLookup:Q,connection:X}=S.getState();if(!m||!j&&!i)return;if(!j){O==null||O(z.nativeEvent,{nodeId:m,handleId:v,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:m,type:e,id:v}});return}const q=my(z.target),Z=n||L,{connection:U,isValid:te}=Ic.isValid(z.nativeEvent,{handle:{nodeId:m,id:v,type:e},connectionMode:T,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:Z,flowId:K,doc:q,lib:H,nodeLookup:Q});te&&U&&D(U);const se=structuredClone(X);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,k==null||k(z,se),S.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":v,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${v}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!y,target:y,connectable:r,connectablestart:i,connectableend:s,clickconnecting:N,connectingfrom:_,connectingto:M,valid:I,connectionindicator:r&&(!P||b)&&(P?s:i)}]),onMouseDown:F,onTouchStart:F,onClick:x?A:void 0,ref:h,...c,children:a})}const Xn=R.memo(Hy(mC));function gC({data:e,isConnectable:t,sourcePosition:n=G.Bottom}){return p.jsxs(p.Fragment,{children:[e==null?void 0:e.label,p.jsx(Xn,{type:"source",position:n,isConnectable:t})]})}function yC({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:r=G.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Xn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,p.jsx(Xn,{type:"source",position:r,isConnectable:t})]})}function vC(){return null}function xC({data:e,isConnectable:t,targetPosition:n=G.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Xn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Dl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xp={input:gC,default:yC,output:xC,group:vC};function wC(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const SC=e=>{const{width:t,height:n,x:r,y:i}=no(e.nodeLookup,{filter:s=>!!s.selected});return{width:Mt(t)?t:null,height:Mt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function kC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:s,transformString:o,userSelectionActive:l}=le(SC,Ee),a=Uy(),u=R.useRef(null);if(R.useEffect(()=>{var c;n||(c=u.current)==null||c.focus({preventScroll:!0})},[n]),Vy({nodeRef:u}),l||!i||!s)return null;const f=e?c=>{const h=r.getState().nodes.filter(v=>v.selected);e(c,h)}:void 0,d=c=>{Object.prototype.hasOwnProperty.call(Dl,c.key)&&(c.preventDefault(),a({direction:Dl[c.key],factor:c.shiftKey?4:1}))};return p.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:p.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:s}})})}const wp=typeof window<"u"?window:void 0,EC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Wy({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:f,selectionMode:d,onSelectionStart:c,onSelectionEnd:h,multiSelectionKeyCode:v,panActivationKeyCode:y,zoomActivationKeyCode:S,elementsSelectable:m,zoomOnScroll:x,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:_,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:b,defaultViewport:P,translateExtent:I,minZoom:D,maxZoom:F,preventScrolling:A,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:z,disableKeyboardA11y:O,onViewportChange:k,isControlledViewport:j}){const{nodesSelectionActive:T,userSelectionActive:L}=le(EC),H=Fs(u,{target:wp}),K=Fs(y,{target:wp}),Q=K||b,X=K||w,q=f&&Q!==!0,Z=H||L||q;return rC({deleteKeyCode:a,multiSelectionKeyCode:v}),p.jsx(oC,{onPaneContextMenu:s,elementsSelectable:m,zoomOnScroll:x,zoomOnPinch:g,panOnScroll:X,panOnScrollSpeed:_,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:!H&&Q,defaultViewport:P,translateExtent:I,minZoom:D,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:A,noWheelClassName:$,noPanClassName:z,onViewportChange:k,isControlledViewport:j,paneClickDistance:l,children:p.jsxs(cC,{onSelectionStart:c,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:Q,isSelecting:!!Z,selectionMode:d,selectionKeyPressed:H,selectionOnDrag:q,children:[e,T&&p.jsx(kC,{onSelectionContextMenu:E,noPanClassName:z,disableKeyboardA11y:O})]})})}Wy.displayName="FlowRenderer";const _C=R.memo(Wy),NC=e=>t=>e?ly(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 CC(e){return le(R.useCallback(NC(e),[e]),Ee)}const bC=e=>e.updateNodeInternals;function jC(){const e=le(bC),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function MC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ge(),s=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),a=R.useRef(e.targetPosition),u=R.useRef(t),f=n&&!!e.internals.handleBounds;return R.useEffect(()=>{s.current&&!e.hidden&&(!f||o.current!==s.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(s.current),o.current=s.current)},[f,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(s.current){const d=u.current!==t,c=l.current!==e.sourcePosition,h=a.current!==e.targetPosition;(d||c||h)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function PC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:f,resizeObserver:d,noDragClassName:c,noPanClassName:h,disableKeyboardA11y:v,rfId:y,nodeTypes:S,nodeExtent:m,nodeClickDistance:x,onError:g}){const{node:w,internals:_,isParent:M}=le(U=>{const te=U.nodeLookup.get(e),se=U.parentLookup.has(e);return{node:te,internals:te.internals,isParent:se}},Ee);let N=w.type||"default",b=(S==null?void 0:S[N])||xp[N];b===void 0&&(g==null||g("003",dn.error003(N)),N="default",b=xp.default);const P=!!(w.draggable||l&&typeof w.draggable>"u"),I=!!(w.selectable||a&&typeof w.selectable>"u"),D=!!(w.connectable||u&&typeof w.connectable>"u"),F=!!(w.focusable||f&&typeof w.focusable>"u"),A=ge(),E=hy(w),$=MC({node:w,nodeType:N,hasDimensions:E,resizeObserver:d}),z=Vy({nodeRef:$,disabled:w.hidden||!P,noDragClassName:c,handleSelector:w.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:x}),O=Uy();if(w.hidden)return null;const k=fn(w),j=wC(w),T=I||P||t||n||r||i,L=n?U=>n(U,{..._.userNode}):void 0,H=r?U=>r(U,{..._.userNode}):void 0,K=i?U=>i(U,{..._.userNode}):void 0,Q=s?U=>s(U,{..._.userNode}):void 0,X=o?U=>o(U,{..._.userNode}):void 0,q=U=>{const{selectNodesOnDrag:te,nodeDragThreshold:se}=A.getState();I&&(!te||!P||se>0)&&Tc({id:e,store:A,nodeRef:$}),t&&t(U,{..._.userNode})},Z=U=>{if(!(jc(U.nativeEvent)||v))if(ry.includes(U.key)&&I){const te=U.key==="Escape";Tc({id:e,store:A,unselect:te,nodeRef:$})}else P&&w.selected&&Object.prototype.hasOwnProperty.call(Dl,U.key)&&(U.preventDefault(),A.setState({ariaLiveMessage:`Moved selected node ${U.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~_.positionAbsolute.x}, y: ${~~_.positionAbsolute.y}`}),O({direction:Dl[U.key],factor:U.shiftKey?4:1}))};return p.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${N}`,{[h]:P},w.className,{selected:w.selected,selectable:I,parent:M,draggable:P,dragging:z}]),ref:$,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:E?"visible":"hidden",...w.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:H,onMouseLeave:K,onContextMenu:Q,onClick:q,onDoubleClick:X,onKeyDown:F?Z:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":v?void 0:`${Dy}-${y}`,"aria-label":w.ariaLabel,children:p.jsx(fC,{value:e,children:p.jsx(b,{id:e,data:w.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:w.selected,selectable:I,draggable:P,deletable:w.deletable??!0,isConnectable:D,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:z,dragHandle:w.dragHandle,zIndex:_.z,parentId:w.parentId,...k})})})}const zC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function qy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=le(zC,Ee),o=CC(e.onlyRenderVisibleElements),l=jC();return p.jsx("div",{className:"react-flow__nodes",style:fa,children:o.map(a=>p.jsx(PC,{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:i,nodeClickDistance:e.nodeClickDistance,onError:s},a))})}qy.displayName="NodeRenderer";const IC=R.memo(qy);function TC(e){return le(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);s&&o&&y_({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const RC=({color:e="none",strokeWidth:t=1})=>p.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),$C=({color:e="none",strokeWidth:t=1})=>p.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Sp={[Rl.Arrow]:RC,[Rl.ArrowClosed]:$C};function OC(e){const t=ge();return R.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(Sp,e)?Sp[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",dn.error009(e)),null)},[e])}const DC=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const a=OC(t);return a?p.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:p.jsx(a,{color:n,strokeWidth:o})}):null},Xy=({defaultColor:e,rfId:t})=>{const n=le(s=>s.edges),r=le(s=>s.defaultEdgeOptions),i=R.useMemo(()=>N_(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?p.jsx("svg",{className:"react-flow__marker",children:p.jsx("defs",{children:i.map(s=>p.jsx(DC,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};Xy.displayName="MarkerDefinitions";var AC=R.memo(Xy);function Yy({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:s={},labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...f}){const[d,c]=R.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",u]),v=R.useRef(null);return R.useEffect(()=>{if(v.current){const y=v.current.getBBox();c({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),typeof n>"u"||!n?null:p.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...f,children:[i&&p.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),p.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:v,style:r,children:n}),a]})}Yy.displayName="EdgeText";const LC=R.memo(Yy);function ha({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...f}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...f,d:e,fill:"none",className:Ce(["react-flow__edge-path",f.className])}),u&&p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}),r&&Mt(t)&&Mt(n)?p.jsx(LC,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function kp({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===G.Left||e===G.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Ky({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top}){const[o,l]=kp({pos:n,x1:e,y1:t,x2:r,y2:i}),[a,u]=kp({pos:s,x1:r,y1:i,x2:e,y2:t}),[f,d,c,h]=yy({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${o},${l} ${a},${u} ${r},${i}`,f,d,c,h]}function Gy(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=G.Bottom,targetPosition:l=G.Top,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:v,markerEnd:y,markerStart:S,interactionWidth:m})=>{const[x,g,w]=Ky({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l}),_=e.isInternal?void 0:t;return p.jsx(ha,{id:_,path:x,labelX:g,labelY:w,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:v,markerEnd:y,markerStart:S,interactionWidth:m})})}const FC=Gy({isInternal:!1}),Zy=Gy({isInternal:!0});FC.displayName="SimpleBezierEdge";Zy.displayName="SimpleBezierEdgeInternal";function Jy(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,sourcePosition:h=G.Bottom,targetPosition:v=G.Top,markerEnd:y,markerStart:S,pathOptions:m,interactionWidth:x})=>{const[g,w,_]=Mc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:s,targetPosition:v,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset}),M=e.isInternal?void 0:t;return p.jsx(ha,{id:M,path:g,labelX:w,labelY:_,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:y,markerStart:S,interactionWidth:x})})}const ev=Jy({isInternal:!1}),tv=Jy({isInternal:!0});ev.displayName="SmoothStepEdge";tv.displayName="SmoothStepEdgeInternal";function nv(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return p.jsx(ev,{...n,id:r,pathOptions:R.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const HC=nv({isInternal:!1}),rv=nv({isInternal:!0});HC.displayName="StepEdge";rv.displayName="StepEdgeInternal";function iv(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:v,interactionWidth:y})=>{const[S,m,x]=wy({sourceX:n,sourceY:r,targetX:i,targetY:s}),g=e.isInternal?void 0:t;return p.jsx(ha,{id:g,path:S,labelX:m,labelY:x,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:v,interactionWidth:y})})}const BC=iv({isInternal:!1}),sv=iv({isInternal:!0});BC.displayName="StraightEdge";sv.displayName="StraightEdgeInternal";function ov(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=G.Bottom,targetPosition:l=G.Top,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:v,markerEnd:y,markerStart:S,pathOptions:m,interactionWidth:x})=>{const[g,w,_]=vy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l,curvature:m==null?void 0:m.curvature}),M=e.isInternal?void 0:t;return p.jsx(ha,{id:M,path:g,labelX:w,labelY:_,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:v,markerEnd:y,markerStart:S,interactionWidth:x})})}const VC=ov({isInternal:!1}),lv=ov({isInternal:!0});VC.displayName="BezierEdge";lv.displayName="BezierEdgeInternal";const Ep={default:lv,straight:sv,step:rv,smoothstep:tv,simplebezier:Zy},_p={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},UC=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,QC=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Np="react-flow__edgeupdater";function Cp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:o,type:l}){return p.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:o,className:Ce([Np,`${Np}-${l}`]),cx:UC(t,r,e),cy:QC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function WC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:f,onReconnectEnd:d,setReconnecting:c,setUpdateHover:h}){const v=ge(),y=(w,_)=>{if(w.button!==0)return;const{autoPanOnConnect:M,domNode:N,isValidConnection:b,connectionMode:P,connectionRadius:I,lib:D,onConnectStart:F,onConnectEnd:A,cancelConnection:E,nodeLookup:$,rfId:z,panBy:O,updateConnection:k}=v.getState(),j=_.type==="target";c(!0),f==null||f(w,n,_.type);const T=(H,K)=>{c(!1),d==null||d(H,n,_.type,K)},L=H=>u==null?void 0:u(n,H);Ic.onPointerDown(w.nativeEvent,{autoPanOnConnect:M,connectionMode:P,connectionRadius:I,domNode:N,handleId:_.id,nodeId:_.nodeId,nodeLookup:$,isTarget:j,edgeUpdaterType:_.type,lib:D,flowId:z,cancelConnection:E,panBy:O,isValidConnection:b,onConnect:L,onConnectStart:F,onConnectEnd:A,onReconnectEnd:T,updateConnection:k,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},S=w=>y(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>y(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>h(!0),g=()=>h(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(Cp,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&p.jsx(Cp,{position:a,centerX:s,centerY:o,radius:t,onMouseDown:m,onMouseEnter:x,onMouseOut:g,type:"target"})]})}function qC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:f,onReconnect:d,onReconnectStart:c,onReconnectEnd:h,rfId:v,edgeTypes:y,noPanClassName:S,onError:m,disableKeyboardA11y:x}){let g=le(J=>J.edgeLookup.get(e));const w=le(J=>J.defaultEdgeOptions);g=w?{...w,...g}:g;let _=g.type||"default",M=(y==null?void 0:y[_])||Ep[_];M===void 0&&(m==null||m("011",dn.error011(_)),_="default",M=Ep.default);const N=!!(g.focusable||t&&typeof g.focusable>"u"),b=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),P=!!(g.selectable||r&&typeof g.selectable>"u"),I=R.useRef(null),[D,F]=R.useState(!1),[A,E]=R.useState(!1),$=ge(),{zIndex:z,sourceX:O,sourceY:k,targetX:j,targetY:T,sourcePosition:L,targetPosition:H}=le(R.useCallback(J=>{const ae=J.nodeLookup.get(g.source),fe=J.nodeLookup.get(g.target);if(!ae||!fe)return{zIndex:g.zIndex,..._p};const $e=__({id:e,sourceNode:ae,targetNode:fe,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:J.connectionMode,onError:m});return{zIndex:g_({selected:g.selected,zIndex:g.zIndex,sourceNode:ae,targetNode:fe,elevateOnSelect:J.elevateEdgesOnSelect}),...$e||_p}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),Ee),K=R.useMemo(()=>g.markerStart?`url('#${Pc(g.markerStart,v)}')`:void 0,[g.markerStart,v]),Q=R.useMemo(()=>g.markerEnd?`url('#${Pc(g.markerEnd,v)}')`:void 0,[g.markerEnd,v]);if(g.hidden||O===null||k===null||j===null||T===null)return null;const X=J=>{var hn;const{addSelectedEdges:ae,unselectNodesAndEdges:fe,multiSelectionActive:$e}=$.getState();P&&($.setState({nodesSelectionActive:!1}),g.selected&&$e?(fe({nodes:[],edges:[g]}),(hn=I.current)==null||hn.blur()):ae([e])),i&&i(J,g)},q=s?J=>{s(J,{...g})}:void 0,Z=o?J=>{o(J,{...g})}:void 0,U=l?J=>{l(J,{...g})}:void 0,te=a?J=>{a(J,{...g})}:void 0,se=u?J=>{u(J,{...g})}:void 0,ne=J=>{var ae;if(!x&&ry.includes(J.key)&&P){const{unselectNodesAndEdges:fe,addSelectedEdges:$e}=$.getState();J.key==="Escape"?((ae=I.current)==null||ae.blur(),fe({edges:[g]})):$e([e])}};return p.jsx("svg",{style:{zIndex:z},children:p.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${_}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!P&&!i,updating:D,selectable:P}]),onClick:X,onDoubleClick:q,onContextMenu:Z,onMouseEnter:U,onMouseMove:te,onMouseLeave:se,onKeyDown:N?ne:void 0,tabIndex:N?0:void 0,role:N?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":N?`${Ay}-${v}`:void 0,ref:I,children:[!A&&p.jsx(M,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:P,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:k,targetX:j,targetY:T,sourcePosition:L,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:K,markerEnd:Q,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),b&&p.jsx(WC,{edge:g,isReconnectable:b,reconnectRadius:f,onReconnect:d,onReconnectStart:c,onReconnectEnd:h,sourceX:O,sourceY:k,targetX:j,targetY:T,sourcePosition:L,targetPosition:H,setUpdateHover:F,setReconnecting:E})]})})}const XC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function av({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:f,reconnectRadius:d,onEdgeDoubleClick:c,onReconnectStart:h,onReconnectEnd:v,disableKeyboardA11y:y}){const{edgesFocusable:S,edgesReconnectable:m,elementsSelectable:x,onError:g}=le(XC,Ee),w=TC(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(AC,{defaultColor:e,rfId:n}),w.map(_=>p.jsx(qC,{id:_,edgesFocusable:S,edgesReconnectable:m,elementsSelectable:x,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:f,reconnectRadius:d,onDoubleClick:c,onReconnectStart:h,onReconnectEnd:v,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:y},_))]})}av.displayName="EdgeRenderer";const YC=R.memo(av),KC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function GC({children:e}){const t=le(KC);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function ZC(e){const t=Jd(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const JC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function e3(e){const t=le(JC),n=ge();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function t3(e){return e.connection.inProgress?{...e.connection,to:ro(e.connection.to,e.transform)}:{...e.connection}}function n3(e){return t3}function r3(e){const t=n3();return le(t,Ee)}const i3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function s3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:l,inProgress:a}=le(i3,Ee);return!(s&&i&&a)?null:p.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:Ce(["react-flow__connection",sy(l)]),children:p.jsx(uv,{style:t,type:n,CustomComponent:r,isValid:l})})})}const uv=({style:e,type:t=Nn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:o,fromHandle:l,fromPosition:a,to:u,toNode:f,toHandle:d,toPosition:c}=r3();if(!i)return;if(n)return p.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:c,connectionStatus:sy(r),toNode:f,toHandle:d});let h="";const v={sourceX:s.x,sourceY:s.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:c};switch(t){case Nn.Bezier:[h]=vy(v);break;case Nn.SimpleBezier:[h]=Ky(v);break;case Nn.Step:[h]=Mc({...v,borderRadius:0});break;case Nn.SmoothStep:[h]=Mc(v);break;default:[h]=wy(v)}return p.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};uv.displayName="ConnectionLine";const o3={};function bp(e=o3){R.useRef(e),ge(),R.useEffect(()=>{},[e])}function l3(){ge(),R.useRef(!1),R.useEffect(()=>{},[])}function cv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,onSelectionContextMenu:d,onSelectionStart:c,onSelectionEnd:h,connectionLineType:v,connectionLineStyle:y,connectionLineComponent:S,connectionLineContainerStyle:m,selectionKeyCode:x,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:N,deleteKeyCode:b,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:D,translateExtent:F,minZoom:A,maxZoom:E,preventScrolling:$,defaultMarkerColor:z,zoomOnScroll:O,zoomOnPinch:k,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:K,onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneScroll:U,onPaneContextMenu:te,paneClickDistance:se,nodeClickDistance:ne,onEdgeContextMenu:J,onEdgeMouseEnter:ae,onEdgeMouseMove:fe,onEdgeMouseLeave:$e,reconnectRadius:hn,onReconnect:pa,onReconnectStart:ma,onReconnectEnd:ga,noDragClassName:Ti,noWheelClassName:ya,noPanClassName:Ri,disableKeyboardA11y:$i,nodeExtent:va,rfId:Oi,viewport:Di,onViewportChange:io}){return bp(e),bp(t),l3(),ZC(n),e3(Di),p.jsx(_C,{onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:te,onPaneScroll:U,paneClickDistance:se,deleteKeyCode:b,selectionKeyCode:x,selectionOnDrag:g,selectionMode:w,onSelectionStart:c,onSelectionEnd:h,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:N,elementsSelectable:I,zoomOnScroll:O,zoomOnPinch:k,zoomOnDoubleClick:H,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:L,panOnDrag:K,defaultViewport:D,translateExtent:F,minZoom:A,maxZoom:E,onSelectionContextMenu:d,preventScrolling:$,noDragClassName:Ti,noWheelClassName:ya,noPanClassName:Ri,disableKeyboardA11y:$i,onViewportChange:io,isControlledViewport:!!Di,children:p.jsxs(GC,{children:[p.jsx(YC,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pa,onReconnectStart:ma,onReconnectEnd:ga,onlyRenderVisibleElements:P,onEdgeContextMenu:J,onEdgeMouseEnter:ae,onEdgeMouseMove:fe,onEdgeMouseLeave:$e,reconnectRadius:hn,defaultMarkerColor:z,noPanClassName:Ri,disableKeyboardA11y:$i,rfId:Oi}),p.jsx(s3,{style:y,type:v,component:S,containerStyle:m}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(IC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,nodeClickDistance:ne,onlyRenderVisibleElements:P,noPanClassName:Ri,noDragClassName:Ti,disableKeyboardA11y:$i,nodeExtent:va,rfId:Oi}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}cv.displayName="GraphView";const a3=R.memo(cv),jp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a}={})=>{const u=new Map,f=new Map,d=new Map,c=new Map,h=r??t??[],v=n??e??[],y=l??[0,0],S=a??Os;ky(d,c,h),zc(v,u,f,{nodeOrigin:y,nodeExtent:S,elevateNodesOnSelect:!1});let m=[0,0,1];if(o&&i&&s){const x=no(u,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:g,y:w,zoom:_}=qd(x,i,s,.5,2,.1);m=[g,w,_]}return{rfId:"1",width:0,height:0,transform:m,nodes:v,nodeLookup:u,parentLookup:f,edges:h,edgeLookup:c,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Os,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ni.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:{...iy},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:p_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},u3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a})=>CN((u,f)=>({...jp({nodes:e,edges:t,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:c,parentLookup:h,nodeOrigin:v,elevateNodesOnSelect:y}=f();zc(d,c,h,{nodeOrigin:v,nodeExtent:a,elevateNodesOnSelect:y,checkEquality:!0}),u({nodes:d})},setEdges:d=>{const{connectionLookup:c,edgeLookup:h}=f();ky(c,h,d),u({edges:d})},setDefaultNodesAndEdges:(d,c)=>{if(d){const{setNodes:h}=f();h(d),u({hasDefaultNodes:!0})}if(c){const{setEdges:h}=f();h(c),u({hasDefaultEdges:!0})}},updateNodeInternals:(d,c={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:v,parentLookup:y,fitViewOnInit:S,fitViewDone:m,fitViewOnInitOptions:x,domNode:g,nodeOrigin:w,nodeExtent:_,debug:M,fitViewSync:N}=f(),{changes:b,updatedInternals:P}=P_(d,v,y,g,w,_);if(P){if(b_(v,y,{nodeOrigin:w,nodeExtent:_}),c.triggerFitView){let I=m;!m&&S&&(I=N({...x,nodes:x==null?void 0:x.nodes})),u({fitViewDone:I})}else u({});(b==null?void 0:b.length)>0&&(M&&console.log("React Flow: trigger node changes",b),h==null||h(b))}},updateNodePositions:(d,c=!1)=>{const h=[],v=[];for(const[y,S]of d){const m=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(S!=null&&S.position)),x={id:y,type:"position",position:m?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:c};m&&h.push({id:y,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),v.push(x)}if(h.length>0){const{nodeLookup:y,parentLookup:S,nodeOrigin:m}=f(),x=Gd(h,y,S,m);v.push(...x)}f().triggerNodeChanges(v)},triggerNodeChanges:d=>{const{onNodesChange:c,setNodes:h,nodes:v,hasDefaultNodes:y,debug:S}=f();if(d!=null&&d.length){if(y){const m=qN(d,v);h(m)}S&&console.log("React Flow: trigger node changes",d),c==null||c(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:c,setEdges:h,edges:v,hasDefaultEdges:y,debug:S}=f();if(d!=null&&d.length){if(y){const m=XN(d,v);h(m)}S&&console.log("React Flow: trigger edge changes",d),c==null||c(d)}},addSelectedNodes:d=>{const{multiSelectionActive:c,edgeLookup:h,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:S}=f();if(c){const m=d.map(x=>er(x,!0));y(m);return}y(Vr(v,new Set([...d]),!0)),S(Vr(h))},addSelectedEdges:d=>{const{multiSelectionActive:c,edgeLookup:h,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:S}=f();if(c){const m=d.map(x=>er(x,!0));S(m);return}S(Vr(h,new Set([...d]))),y(Vr(v,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:c}={})=>{const{edges:h,nodes:v,nodeLookup:y,triggerNodeChanges:S,triggerEdgeChanges:m}=f(),x=d||v,g=c||h,w=x.map(M=>{const N=y.get(M.id);return N&&(N.selected=!1),er(M.id,!1)}),_=g.map(M=>er(M.id,!1));S(w),m(_)},setMinZoom:d=>{const{panZoom:c,maxZoom:h}=f();c==null||c.setScaleExtent([d,h]),u({minZoom:d})},setMaxZoom:d=>{const{panZoom:c,minZoom:h}=f();c==null||c.setScaleExtent([h,d]),u({maxZoom:d})},setTranslateExtent:d=>{var c;(c=f().panZoom)==null||c.setTranslateExtent(d),u({translateExtent:d})},setPaneClickDistance:d=>{var c;(c=f().panZoom)==null||c.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:c,triggerNodeChanges:h,triggerEdgeChanges:v}=f(),y=c.reduce((m,x)=>x.selected?[...m,er(x.id,!1)]:m,[]),S=d.reduce((m,x)=>x.selected?[...m,er(x.id,!1)]:m,[]);h(y),v(S)},setNodeExtent:d=>{const{nodes:c,nodeLookup:h,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:S,nodeExtent:m}=f();d[0][0]===m[0][0]&&d[0][1]===m[0][1]&&d[1][0]===m[1][0]&&d[1][1]===m[1][1]||(zc(c,h,v,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!1}),u({nodeExtent:d}))},panBy:d=>{const{transform:c,width:h,height:v,panZoom:y,translateExtent:S}=f();return z_({delta:d,panZoom:y,transform:c,translateExtent:S,width:h,height:v})},fitView:d=>{const{panZoom:c,width:h,height:v,minZoom:y,maxZoom:S,nodeLookup:m}=f();if(!c)return Promise.resolve(!1);const x=Nc(m,d);return Cc({nodes:x,width:h,height:v,panZoom:c,minZoom:y,maxZoom:S},d)},fitViewSync:d=>{const{panZoom:c,width:h,height:v,minZoom:y,maxZoom:S,nodeLookup:m}=f();if(!c)return!1;const x=Nc(m,d);return Cc({nodes:x,width:h,height:v,panZoom:c,minZoom:y,maxZoom:S},d),x.size>0},cancelConnection:()=>{u({connection:{...iy}})},updateConnection:d=>{u({connection:d})},reset:()=>u({...jp()})}),Object.is);function c3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:o,nodeOrigin:l,nodeExtent:a,children:u}){const[f]=R.useState(()=>u3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a}));return p.jsx(bN,{value:f,children:p.jsx(ZN,{children:u})})}function d3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:o,fitView:l,nodeOrigin:a,nodeExtent:u}){return R.useContext(da)?p.jsx(p.Fragment,{children:e}):p.jsx(c3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:l,nodeOrigin:a,nodeExtent:u,children:e})}const f3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function h3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:f,onMoveStart:d,onMoveEnd:c,onConnect:h,onConnectStart:v,onConnectEnd:y,onClickConnectStart:S,onClickConnectEnd:m,onNodeMouseEnter:x,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:M,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onSelectionChange:A,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:z,onSelectionContextMenu:O,onSelectionStart:k,onSelectionEnd:j,onBeforeDelete:T,connectionMode:L,connectionLineType:H=Nn.Bezier,connectionLineStyle:K,connectionLineComponent:Q,connectionLineContainerStyle:X,deleteKeyCode:q="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:U=!1,selectionMode:te=Ds.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ne=Ol()?"Meta":"Control",zoomActivationKeyCode:J=Ol()?"Meta":"Control",snapToGrid:ae,snapGrid:fe,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:hn,nodesDraggable:pa,nodesConnectable:ma,nodesFocusable:ga,nodeOrigin:Ti=Ly,edgesFocusable:ya,edgesReconnectable:Ri,elementsSelectable:$i=!0,defaultViewport:va=FN,minZoom:Oi=.5,maxZoom:Di=2,translateExtent:io=Os,preventScrolling:gv=!0,nodeExtent:xa,defaultMarkerColor:yv="#b1b1b7",zoomOnScroll:vv=!0,zoomOnPinch:xv=!0,panOnScroll:wv=!1,panOnScrollSpeed:Sv=.5,panOnScrollMode:kv=gr.Free,zoomOnDoubleClick:Ev=!0,panOnDrag:_v=!0,onPaneClick:Nv,onPaneMouseEnter:Cv,onPaneMouseMove:bv,onPaneMouseLeave:jv,onPaneScroll:Mv,onPaneContextMenu:Pv,paneClickDistance:tf=0,nodeClickDistance:zv=0,children:Iv,onReconnect:Tv,onReconnectStart:Rv,onReconnectEnd:$v,onEdgeContextMenu:Ov,onEdgeDoubleClick:Dv,onEdgeMouseEnter:Av,onEdgeMouseMove:Lv,onEdgeMouseLeave:Fv,reconnectRadius:Hv=10,onNodesChange:Bv,onEdgesChange:Vv,noDragClassName:Uv="nodrag",noWheelClassName:Qv="nowheel",noPanClassName:nf="nopan",fitView:rf,fitViewOptions:Wv,connectOnClick:qv,attributionPosition:Xv,proOptions:Yv,defaultEdgeOptions:Kv,elevateNodesOnSelect:Gv,elevateEdgesOnSelect:Zv,disableKeyboardA11y:sf=!1,autoPanOnConnect:Jv,autoPanOnNodeDrag:ex,autoPanSpeed:tx,connectionRadius:nx,isValidConnection:rx,onError:ix,style:sx,id:of,nodeDragThreshold:ox,viewport:lx,onViewportChange:ax,width:ux,height:cx,colorMode:dx="light",debug:fx,...hx},px){const wa=of||"1",mx=UN(dx);return p.jsx("div",{"data-testid":"rf__wrapper",...hx,style:{...sx,...f3},ref:px,className:Ce(["react-flow",i,mx]),id:of,children:p.jsxs(d3,{nodes:e,edges:t,width:ux,height:cx,fitView:rf,nodeOrigin:Ti,nodeExtent:xa,children:[p.jsx(a3,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:x,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:M,nodeTypes:s,edgeTypes:o,connectionLineType:H,connectionLineStyle:K,connectionLineComponent:Q,connectionLineContainerStyle:X,selectionKeyCode:Z,selectionOnDrag:U,selectionMode:te,deleteKeyCode:q,multiSelectionKeyCode:ne,panActivationKeyCode:se,zoomActivationKeyCode:J,onlyRenderVisibleElements:$e,defaultViewport:va,translateExtent:io,minZoom:Oi,maxZoom:Di,preventScrolling:gv,zoomOnScroll:vv,zoomOnPinch:xv,zoomOnDoubleClick:Ev,panOnScroll:wv,panOnScrollSpeed:Sv,panOnScrollMode:kv,panOnDrag:_v,onPaneClick:Nv,onPaneMouseEnter:Cv,onPaneMouseMove:bv,onPaneMouseLeave:jv,onPaneScroll:Mv,onPaneContextMenu:Pv,paneClickDistance:tf,nodeClickDistance:zv,onSelectionContextMenu:O,onSelectionStart:k,onSelectionEnd:j,onReconnect:Tv,onReconnectStart:Rv,onReconnectEnd:$v,onEdgeContextMenu:Ov,onEdgeDoubleClick:Dv,onEdgeMouseEnter:Av,onEdgeMouseMove:Lv,onEdgeMouseLeave:Fv,reconnectRadius:Hv,defaultMarkerColor:yv,noDragClassName:Uv,noWheelClassName:Qv,noPanClassName:nf,rfId:wa,disableKeyboardA11y:sf,nodeExtent:xa,viewport:lx,onViewportChange:ax}),p.jsx(VN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:v,onConnectEnd:y,onClickConnectStart:S,onClickConnectEnd:m,nodesDraggable:pa,nodesConnectable:ma,nodesFocusable:ga,edgesFocusable:ya,edgesReconnectable:Ri,elementsSelectable:$i,elevateNodesOnSelect:Gv,elevateEdgesOnSelect:Zv,minZoom:Oi,maxZoom:Di,nodeExtent:xa,onNodesChange:Bv,onEdgesChange:Vv,snapToGrid:ae,snapGrid:fe,connectionMode:L,translateExtent:io,connectOnClick:qv,defaultEdgeOptions:Kv,fitView:rf,fitViewOptions:Wv,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:P,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:z,onMove:f,onMoveStart:d,onMoveEnd:c,noPanClassName:nf,nodeOrigin:Ti,rfId:wa,autoPanOnConnect:Jv,autoPanOnNodeDrag:ex,autoPanSpeed:tx,onError:ix,connectionRadius:nx,isValidConnection:rx,selectNodesOnDrag:hn,nodeDragThreshold:ox,onBeforeDelete:T,paneClickDistance:tf,debug:fx}),p.jsx(LN,{onSelectionChange:A}),Iv,p.jsx(RN,{proOptions:Yv,position:Xv}),p.jsx(IN,{rfId:wa,disableKeyboardA11y:sf})]})})}var p3=Hy(h3);function m3({dimensions:e,lineWidth:t,variant:n,className:r}){return p.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,r])})}function g3({radius:e,className:t}){return p.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var nn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(nn||(nn={}));const y3={[nn.Dots]:1,[nn.Lines]:1,[nn.Cross]:6},v3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function dv({id:e,variant:t=nn.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:o,bgColor:l,style:a,className:u,patternClassName:f}){const d=R.useRef(null),{transform:c,patternId:h}=le(v3,Ee),v=r||y3[t],y=t===nn.Dots,S=t===nn.Cross,m=Array.isArray(n)?n:[n,n],x=[m[0]*c[2]||1,m[1]*c[2]||1],g=v*c[2],w=Array.isArray(s)?s:[s,s],_=S?[g,g]:x,M=[w[0]*c[2]||1+_[0]/2,w[1]*c[2]||1+_[1]/2],N=`${h}${e||""}`;return p.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...fa,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[p.jsx("pattern",{id:N,x:c[0]%x[0],y:c[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:y?p.jsx(g3,{radius:g/2,className:f}):p.jsx(m3,{dimensions:_,lineWidth:i,variant:t,className:f})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}dv.displayName="Background";const x3=R.memo(dv);function w3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function S3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function k3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.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 E3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 _3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 To({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const N3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function fv({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:a,className:u,children:f,position:d="bottom-left",orientation:c="vertical","aria-label":h="React Flow controls"}){const v=ge(),{isInteractive:y,minZoomReached:S,maxZoomReached:m}=le(N3,Ee),{zoomIn:x,zoomOut:g,fitView:w}=Jd(),_=()=>{x(),s==null||s()},M=()=>{g(),o==null||o()},N=()=>{w(i),l==null||l()},b=()=>{v.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),a==null||a(!y)},P=c==="horizontal"?"horizontal":"vertical";return p.jsxs(Zd,{className:Ce(["react-flow__controls",P,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(To,{onClick:_,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:p.jsx(w3,{})}),p.jsx(To,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:p.jsx(S3,{})})]}),n&&p.jsx(To,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view",children:p.jsx(k3,{})}),r&&p.jsx(To,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity",children:y?p.jsx(_3,{}):p.jsx(E3,{})}),f]})}fv.displayName="Controls";const C3=R.memo(fv);function b3({id:e,x:t,y:n,width:r,height:i,style:s,color:o,strokeColor:l,strokeWidth:a,className:u,borderRadius:f,shapeRendering:d,selected:c,onClick:h}){const{background:v,backgroundColor:y}=s||{},S=o||v||y;return p.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:c},u]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:a},shapeRendering:d,onClick:h?m=>h(m,e):void 0})}const j3=R.memo(b3),M3=e=>e.nodes.map(t=>t.id),su=e=>e instanceof Function?e:()=>e;function P3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=j3,onClick:o}){const l=le(M3,Ee),a=su(t),u=su(e),f=su(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:l.map(c=>p.jsx(I3,{id:c,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:d},c))})}function z3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:a}){const{node:u,x:f,y:d,width:c,height:h}=le(v=>{const y=v.nodeLookup.get(e),{x:S,y:m}=y.internals.positionAbsolute,{width:x,height:g}=fn(y);return{node:y,x:S,y:m,width:x,height:g}},Ee);return!u||u.hidden||!hy(u)?null:p.jsx(l,{x:f,y:d,width:c,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:a,id:u.id})}const I3=R.memo(z3);var T3=R.memo(P3);const R3=200,$3=150,O3=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?dy(no(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},D3="react-flow__minimap-desc";function hv({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:f,maskStrokeWidth:d,position:c="bottom-right",onClick:h,onNodeClick:v,pannable:y=!1,zoomable:S=!1,ariaLabel:m="React Flow mini map",inversePan:x,zoomStep:g=10,offsetScale:w=5}){const _=ge(),M=R.useRef(null),{boundingRect:N,viewBB:b,rfId:P,panZoom:I,translateExtent:D,flowWidth:F,flowHeight:A}=le(O3,Ee),E=(e==null?void 0:e.width)??R3,$=(e==null?void 0:e.height)??$3,z=N.width/E,O=N.height/$,k=Math.max(z,O),j=k*E,T=k*$,L=w*k,H=N.x-(j-N.width)/2-L,K=N.y-(T-N.height)/2-L,Q=j+L*2,X=T+L*2,q=`${D3}-${P}`,Z=R.useRef(0),U=R.useRef();Z.current=k,R.useEffect(()=>{if(M.current&&I)return U.current=L_({domNode:M.current,panZoom:I,getTransform:()=>_.getState().transform,getViewScale:()=>Z.current}),()=>{var ne;(ne=U.current)==null||ne.destroy()}},[I]),R.useEffect(()=>{var ne;(ne=U.current)==null||ne.update({translateExtent:D,width:F,height:A,inversePan:x,pannable:y,zoomStep:g,zoomable:S})},[y,S,x,g,D,F,A]);const te=h?ne=>{var fe;const[J,ae]=((fe=U.current)==null?void 0:fe.pointer(ne))||[0,0];h(ne,{x:J,y:ae})}:void 0,se=v?R.useCallback((ne,J)=>{const ae=_.getState().nodeLookup.get(J);v(ne,ae)},[]):void 0;return p.jsx(Zd,{position:c,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*k: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 o=="string"?o:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:E,height:$,viewBox:`${H} ${K} ${Q} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:M,onClick:te,children:[m&&p.jsx("title",{id:q,children:m}),p.jsx(T3,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-L},${K-L}h${Q+L*2}v${X+L*2}h${-Q-L*2}z
|
|
62
|
+
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}hv.displayName="MiniMap";R.memo(hv);function A3({nodeId:e,position:t,variant:n=fs.Handle,className:r,style:i={},children:s,color:o,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:c,onResizeStart:h,onResize:v,onResizeEnd:y}){const S=Qy(),m=typeof e=="string"?e:S,x=ge(),g=R.useRef(null),w=n===fs.Line?"right":"bottom-right",_=t??w,M=R.useRef(null);R.useEffect(()=>{if(!(!g.current||!m))return M.current||(M.current=eN({domNode:g.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:I,transform:D,snapGrid:F,snapToGrid:A,nodeOrigin:E,domNode:$}=x.getState();return{nodeLookup:I,transform:D,snapGrid:F,snapToGrid:A,nodeOrigin:E,paneDomNode:$}},onChange:(I,D)=>{const{triggerNodeChanges:F,nodeLookup:A,parentLookup:E,nodeOrigin:$}=x.getState(),z=[],O={x:I.x,y:I.y},k=A.get(m);if(k&&k.expandParent&&k.parentId){const j=k.origin??$,T=I.width??k.measured.width,L=I.height??k.measured.height,H={id:k.id,parentId:k.parentId,rect:{width:T,height:L,...py({x:I.x??k.position.x,y:I.y??k.position.y},{width:T,height:L},k.parentId,A,j)}},K=Gd([H],A,E,$);z.push(...K),O.x=I.x?Math.max(j[0]*T,I.x):void 0,O.y=I.y?Math.max(j[1]*L,I.y):void 0}if(O.x!==void 0&&O.y!==void 0){const j={id:m,type:"position",position:{...O}};z.push(j)}if(I.width!==void 0&&I.height!==void 0){const j={id:m,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};z.push(j)}for(const j of D){const T={...j,type:"position"};z.push(T)}F(z)},onEnd:()=>{const I={id:m,type:"dimensions",resizing:!1};x.getState().triggerNodeChanges([I])}})),M.current.update({controlPosition:_,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:f},keepAspectRatio:d,onResizeStart:h,onResize:v,onResizeEnd:y,shouldResize:c}),()=>{var I;(I=M.current)==null||I.destroy()}},[_,l,a,u,f,d,h,v,y,c]);const N=_.split("-"),b=n===fs.Line?"borderColor":"backgroundColor",P=o?{...i,[b]:o}:i;return p.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...N,n,r]),ref:g,style:P,children:s})}R.memo(A3);const L3=new Set;function F3(e){return e.startsWith("signal:child:")}function H3(e){const t=R.useMemo(()=>[...e].sort(),[e]),n=l1({queries:t.map(i=>({queryKey:["run",i],queryFn:()=>rt.run(i)}))}),r={};return t.forEach((i,s)=>{var l;const o=(l=n[s])==null?void 0:l.data;o&&(r[i]=o)}),r}function B3({data:e}){const t=e.status==="failed",n=e.status==="pending"||e.status==="running",r=!!e.childRunId,i=r?Od:Dd(e.kind),s=t?{rail:"bg-red-400",badge:"bg-red-500/15 text-red-300",pill:"bg-red-500/20 text-red-300"}:n?{rail:"bg-amber-400",badge:"bg-amber-500/15 text-amber-300",pill:"bg-amber-500/20 text-amber-300"}:{rail:"bg-emerald-400",badge:"bg-emerald-500/15 text-emerald-300",pill:"bg-emerald-500/20 text-emerald-300"};return p.jsxs("div",{title:r?gc.child:gc[e.kind]??e.kind,className:`group relative w-[208px] cursor-pointer overflow-hidden rounded-xl border bg-[var(--panel)]/95 shadow-lg backdrop-blur transition-all duration-150 hover:-translate-y-0.5 ${e.selected?"border-emerald-400/60 ring-2 ring-emerald-400/30":t?"border-red-500/40 hover:border-red-400/60":r?"border-indigo-500/40 hover:border-indigo-400/60":"border-[var(--line)] hover:border-zinc-600"}`,children:[p.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${s.rail} ${n?"animate-pulse":""}`}),p.jsx(Xn,{type:"target",position:G.Left,className:"!border-0 !bg-zinc-600"}),p.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${s.badge}`,children:p.jsx(i,{width:12,height:12})}),p.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),p.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${s.pill} ${n?"animate-pulse":""}`,children:t?p.jsx(ki,{width:9,height:9}):n?p.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):p.jsx(kg,{width:9,height:9})})]}),p.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button",onClick:o=>{var l;o.stopPropagation(),e.childRunId&&((l=e.onToggleChild)==null||l.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:p.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),p.jsx("button",{type:"button",onClick:o=>{var l;o.stopPropagation(),e.childRunId&&((l=e.onOpenRun)==null||l.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 ↗"})]}):p.jsx("span",{className:"rounded border border-[var(--line)] px-1 text-zinc-400",children:e.kind}),e.attempts>1&&p.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[p.jsx(Eg,{width:9,height:9}),e.attempts]}),e.workerGroup&&p.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),p.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&p.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&p.jsxs("div",{className:"mono mt-1.5 flex items-center gap-2 border-t border-[var(--line)] pt-1.5 text-[10px]",children:[e.subs.ok>0&&p.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&p.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&p.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),p.jsx(Xn,{type:"source",position:G.Right,className:"!border-0 !bg-zinc-600"})]})}function V3({data:e}){const t=e.status==="running"||e.status==="awaiting";return p.jsxs("div",{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-[var(--panel)] px-3.5 py-1.5`,children:[p.jsx(Xn,{type:"target",position:G.Left,className:"!border-0 !bg-zinc-600"}),p.jsx("span",{className:`dot ${t?"pulse":""}`}),p.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),p.jsx(Xn,{type:"source",position:G.Right,className:"!border-0 !bg-zinc-600"})]})}const U3={step:B3,terminal:V3};function Q3(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}}function W3({run:e,timeline:t,selectedKey:n,onSelect:r,onOpenRun:i,fmtDuration:s,expanded:o,onToggleChild:l}){const a=o??L3,u=H3(a),{nodes:f,edges:d}=(()=>{const y=[],S=[],m=e.status==="running"||e.status==="suspended",x=(b,P,I)=>({id:`${b}->${P}`,source:b,target:P,style:{stroke:I?"#f87171":"var(--line)",strokeWidth:1.5}}),g=(b,P)=>({id:`${b}=>${P}`,source:b,target:P,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function w(b,P,I,D,F){let A=I,E,$,z=!1;for(const O of b){const k=`${D}s${O.seq}`,j=$d(O),T=j!==void 0&&a.has(j);y.push({id:k,type:"step",draggable:!1,position:{x:A,y:P*150},data:{seq:O.seq,name:O.name,kind:O.kind,status:O.status,workerGroup:O.workerGroup,attempts:O.attempts,duration:s(O.startedAt,O.finishedAt),subs:Q3(O),selected:n===`${O.runId}#${O.seq}`,childRunId:j,onOpenRun:i,childExpanded:T,onToggleChild:l,depth:P,step:O,laneRun:F}}),E===void 0&&(E=k),$!==void 0&&S.push(x($,k,z));const L=j!==void 0&&T?u[j]:void 0;if(L){const H=w(L.timeline,P+1,A+248,`${j}:`,L.run);H.firstId!==void 0&&S.push(g(k,H.firstId)),F3(O.name)&&H.connectorId!==void 0?$=H.connectorId:$=k,A=Math.max(A+248,H.nextX)}else $=k,A+=248;z=O.status==="failed"}return{firstId:E,connectorId:$,nextX:A}}const _=248;y.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:e.workflow}});const M=w(t,0,_,"",e);M.firstId!==void 0&&S.push({id:"start->first",source:"start",target:M.firstId});const N=Rd(e,t);return y.push({id:"end",type:"terminal",position:{x:Math.max(M.nextX,_),y:0},draggable:!1,data:{status:N,label:N}}),S.push({id:"exit->end",source:M.connectorId??"start",target:"end",animated:m,style:{stroke:m?"var(--accent)":"var(--line)",strokeWidth:m?2:1.5}}),{nodes:y,edges:S}})(),c=R.useCallback((h,v)=>{if(v.type!=="step")return;const y=v.data;y.step&&y.laneRun&&r(y.step,y.laneRun)},[r]);return p.jsxs(p3,{nodes:f,edges:d,nodeTypes:U3,onNodeClick:c,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[p.jsx(x3,{variant:nn.Dots,gap:22,size:1,color:"#1c1c22"}),p.jsx(C3,{showInteractive:!1,position:"bottom-right"})]})}const q3=["pending","running","suspended","completed","failed","cancelled","dead"];function X3(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 i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function Y3(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 pv({status:e}){const t=e==="running"||e==="awaiting";return p.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function mv({status:e}){return p.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[p.jsx(pv,{status:e}),e]})}function K3({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((s,o)=>s+o,0),i=(s,o,l)=>p.jsxs("button",{type:"button",onClick:()=>n(s),className:`group flex items-center gap-2 rounded-md border px-2.5 py-1 text-xs transition-colors ${t===s?"border-zinc-600 bg-zinc-900 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[s!=="all"&&p.jsx(pv,{status:s}),p.jsx("span",{className:"uppercase tracking-wide",children:o}),p.jsx("span",{className:"mono tnum text-zinc-600",children:l})]},s);return p.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-[var(--line)] px-5 py-3",children:[p.jsxs("div",{className:"flex items-center gap-2.5",children:[p.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-emerald-500/30 bg-emerald-500/10",children:p.jsx("span",{className:"text-emerald-400","aria-hidden":!0,children:"◆"})}),p.jsxs("div",{className:"leading-none",children:[p.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),p.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-600",children:"control plane"})]})]}),p.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[i("all","all",r),q3.map(s=>i(s,s,e[s]??0))]}),p.jsx(G3,{}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[p.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function G3(){const{data:e}=pi({queryKey:["workers"],queryFn:()=>rt.workers(),refetchInterval:1e4});return!e||e.length===0?null:p.jsx("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:e.map(t=>{const n=t.liveWorkers.length,r=t.depth>0&&n===0;return p.jsxs("span",{title:`${t.group}: ${n} live worker(s), ${t.depth} queued${r?" — NO worker consuming":""}`,className:`mono flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] ${r?"border-rose-500/50 bg-rose-500/15 text-rose-300":"border-[var(--line)] bg-zinc-800/40 text-zinc-400"}`,children:[p.jsx("span",{className:`dot ${r?"s-failed":n>0?"s-completed":""}`,"aria-hidden":!0}),t.group,p.jsxs("span",{className:"tnum text-zinc-500",children:[n,"w",t.depth>0?` ${t.depth}q`:""]})]},t.group)})})}function Z3({runs:e,selected:t,onSelect:n,onSelectTag:r}){return e.length===0?p.jsx("div",{className:"p-6 text-sm text-zinc-600",children:"No runs yet."}):p.jsx("ul",{className:"divide-y divide-[var(--line-soft)]",children:e.map(i=>p.jsx("li",{children:p.jsxs("button",{type:"button",onClick:()=>n(i.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${t===i.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[p.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:i.workflow}),i.id.startsWith("dlq:")&&p.jsx("span",{className:"mono shrink-0 rounded border border-rose-500/40 bg-rose-500/10 px-1 text-[9px] uppercase tracking-wider text-rose-300",children:"dlq"})]}),p.jsx(mv,{status:Rd(i)})]}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:i.id}),p.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:X3(i.updatedAt)})]}),i.tags&&i.tags.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1",children:i.tags.map(s=>p.jsxs("span",{onClick:o=>{o.stopPropagation(),r(s)},className:"mono cursor-pointer rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400 hover:border-zinc-500 hover:text-zinc-200",children:["#",s]},s))})]})},i.id))})}function J3({id:e,onOpenRun:t}){var z,O;const n=Xs(),{data:r}=pi({queryKey:["run",e],queryFn:async()=>gS(n.getQueryData(["run",e]),await rt.run(e)),refetchInterval:k=>{var T;const j=(T=k.state.data)==null?void 0:T.run.status;return j==="running"||j==="suspended"?1500:!1}}),i=(r==null?void 0:r.run.status)==="dead"?`dlq:${e}`:void 0,{data:s}=pi({queryKey:["run",i],queryFn:()=>rt.run(i),enabled:!!i,retry:!1}),o=()=>{n.invalidateQueries({queryKey:["run",e]}),n.invalidateQueries({queryKey:["runs"]})},l=r==null?void 0:r.run.status,a=l==="running"||l==="suspended";R.useEffect(()=>{if(a)return rt.streamRun(e,k=>{if(k.type==="step.progress"&&k.event&&k.seq!=null){const j=k.seq,T=k.event;n.setQueryData(["run",e],L=>L&&{...L,timeline:L.timeline.map(H=>H.seq===j?{...H,events:[...H.events??[],T]}:H)});return}n.invalidateQueries({queryKey:["run",e]})})},[e,a,n]);const u=Yi({mutationFn:()=>rt.retry(e),onSuccess:o}),f=Yi({mutationFn:k=>rt.cancel(e,{compensate:k}),onSuccess:o}),d=Yi({mutationFn:()=>rt.continue(e),onSuccess:o}),c=Yi({mutationFn:k=>rt.retryWithInput(e,k),onSuccess:k=>{n.invalidateQueries({queryKey:["runs"]}),t(k.runId)}}),h=()=>{const k=JSON.stringify((r==null?void 0:r.run.input)??{},null,2),j=window.prompt("Fix the input, then replay as a fresh run:",k);if(j!=null)try{c.mutate(JSON.parse(j))}catch{window.alert("Invalid JSON")}},[v,y]=R.useState(),[S,m]=R.useState(!1),[x,g]=R.useState(new Set),[w,_]=R.useState(240);function M(k){k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId);const j=L=>_(H=>Math.max(120,Math.min(720,H-L.movementY))),T=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",T)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",T)}function N(k){g(j=>{const T=new Set(j);return T.has(k)?T.delete(k):T.add(k),T})}if(!r)return p.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:b,timeline:P}=r,I=b.id.startsWith("dlq:"),D=I?{id:b.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${b.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:s?{id:`dlq:${b.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,F=b.status==="failed"||b.status==="suspended",A=b.status==="running"||b.status==="suspended",E=P.some(k=>k.status==="pending"&&k.kind==="signal"&&k.name.startsWith("breakpoint")),$=v?`${v.step.runId}#${v.step.seq}`:void 0;return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--line)] px-7 py-5",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:b.workflow}),I&&p.jsx("span",{className:"mono rounded border border-rose-500/40 bg-rose-500/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-rose-300",children:"dlq"}),p.jsx(mv,{status:Rd(b,P)}),p.jsxs("span",{className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] text-zinc-500",children:["v",b.workflowVersion]}),p.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[P.length," ",P.length===1?"step":"steps"]})]}),p.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:b.id}),b.tags&&b.tags.length>0&&p.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:b.tags.map(k=>p.jsxs("span",{className:"mono rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400",children:["#",k]},k))}),b.searchAttributes&&Object.keys(b.searchAttributes).length>0&&p.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(b.searchAttributes).map(([k,j])=>p.jsxs("span",{className:"mono rounded border border-indigo-500/30 bg-indigo-500/10 px-1.5 text-[10px] text-indigo-300",title:"search attribute",children:[k,"=",String(j)]},k))}),(z=r==null?void 0:r.children)!=null&&z.length?p.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[p.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),(O=r.children)==null?void 0:O.map(k=>p.jsx("span",{onClick:()=>t(k),className:"mono cursor-pointer rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400 hover:border-zinc-500 hover:text-zinc-200",children:k},k))]}):null]}),p.jsxs("div",{className:"flex shrink-0 gap-2",children:[p.jsx("button",{type:"button",onClick:()=>m(!0),className:"mono rounded-md border border-[var(--line)] px-2.5 py-1.5 text-xs text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-100",title:"Run input / output",children:"{ }"}),E&&p.jsxs("button",{type:"button",disabled:d.isPending,onClick:()=>d.mutate(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/40 bg-amber-500/15 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-amber-200 transition-colors enabled:hover:bg-amber-500/25 disabled:opacity-30",children:[p.jsx(SS,{width:12,height:12}),"Continue"]}),p.jsxs("button",{type:"button",disabled:!F||u.isPending,onClick:()=>u.mutate(),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-emerald-300 transition-colors enabled:hover:bg-emerald-500/20 disabled:opacity-30",children:[p.jsx(Ya,{width:12,height:12}),"Retry"]}),(b.status==="dead"||b.status==="failed")&&p.jsxs("button",{type:"button",disabled:c.isPending,onClick:h,title:"Edit the input and re-run as a fresh linked run",className:"flex items-center gap-1.5 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-indigo-300 transition-colors enabled:hover:bg-indigo-500/20 disabled:opacity-30",children:[p.jsx(Ya,{width:12,height:12}),"Fix & replay"]}),A&&p.jsxs("button",{type:"button",disabled:f.isPending,onClick:()=>f.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"flex items-center gap-1.5 rounded-md border border-amber-600/30 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-amber-300/90 transition-colors enabled:hover:bg-amber-900/20 disabled:opacity-30",children:[p.jsx(Ya,{width:12,height:12}),"Cancel + Undo"]}),p.jsxs("button",{type:"button",disabled:!A||f.isPending,onClick:()=>f.mutate(!1),className:"flex items-center gap-1.5 rounded-md border border-zinc-700 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-zinc-300 transition-colors enabled:hover:bg-zinc-800 disabled:opacity-30",children:[p.jsx(ki,{width:12,height:12}),"Cancel"]})]})]}),D&&p.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[p.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:"⚠"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:D.title}),p.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:D.subtitle})]}),p.jsx("button",{type:"button",onClick:()=>t(D.id),className:"mono shrink-0 rounded-md border border-rose-500/40 bg-rose-500/15 px-2.5 py-1.5 text-[11px] text-rose-200 transition-colors hover:bg-rose-500/25",children:D.cta})]}),p.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:P.length>0?`1fr ${w}px`:"1fr"},children:[p.jsxs("div",{className:"relative min-h-0",children:[P.length===0?p.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):p.jsx(W3,{run:b,timeline:P,selectedKey:$,onSelect:(k,j)=>y({step:k,run:j}),onOpenRun:t,fmtDuration:Y3,expanded:x,onToggleChild:N}),(b.status==="failed"||b.status==="cancelled")&&b.error&&p.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:b.error.message})]}),P.length>0&&p.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-[var(--line)] bg-black/20",children:[p.jsx("div",{onPointerDown:M,className:"absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-emerald-500/40",title:"Drag to resize"}),p.jsx(CS,{run:b,timeline:P,selectedKey:$,onSelect:(k,j)=>y({step:k,run:j}),onOpenRun:t,expanded:x,onToggleChild:N})]}),v&&p.jsx(IS,{step:v.step,run:v.run,onClose:()=>y(void 0),onOpenRun:t}),S&&p.jsx(TS,{run:b,onClose:()=>m(!1)})]})]})}function Mp(){if(typeof window>"u")return;const e=window.location.hash.match(/^#\/run\/(.+)$/);return e?decodeURIComponent(e[1]):void 0}function e5(){const[e,t]=R.useState("all"),[n,r]=R.useState(""),[i,s]=R.useState(""),[o,l]=R.useState(()=>Mp()),a=R.useCallback(y=>{if(l(y),typeof window>"u")return;const S=y?`#/run/${encodeURIComponent(y)}`:"",m=S||window.location.pathname+window.location.search;window.location.hash!==S&&window.history.pushState(null,"",m)},[]);R.useEffect(()=>{const y=()=>l(Mp());return window.addEventListener("hashchange",y),window.addEventListener("popstate",y),()=>{window.removeEventListener("hashchange",y),window.removeEventListener("popstate",y)}},[]);const u=Xs(),f=i.split(",").map(y=>y.trim()).filter(Boolean),{data:d=[]}=pi({queryKey:["runs",n,f.join("|")],queryFn:()=>rt.runs(void 0,n||void 0,f.length?f:void 0),refetchInterval:3e3}),c=Yi({mutationFn:y=>rt.bulk(y,{status:e!=="all"?e:void 0,tag:n||void 0,attr:f.length?f:void 0}),onSuccess:()=>u.invalidateQueries({queryKey:["runs"]})}),h=d.reduce((y,S)=>(y[S.status]=(y[S.status]??0)+1,y),{}),v=e==="all"?d:d.filter(y=>y.status===e);return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"app-bg"}),p.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[p.jsx(K3,{counts:h,filter:e,onFilter:t}),p.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[p.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-[var(--line)]",children:[p.jsxs("div",{className:"border-b border-[var(--line)] p-2",children:[p.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-[var(--line)] px-2",children:[p.jsx("span",{className:"text-zinc-600",children:"#"}),p.jsx("input",{value:n,onChange:y=>r(y.target.value),placeholder:"filter by tag…",className:"mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none"}),n&&p.jsx("button",{type:"button",onClick:()=>r(""),className:"text-zinc-600 hover:text-zinc-300",title:"clear tag filter",children:p.jsx(ki,{width:12,height:12})})]}),p.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 rounded-md border border-[var(--line)] px-2",children:[p.jsx("span",{className:"text-zinc-600",children:"⛃"}),p.jsx("input",{value:i,onChange:y=>s(y.target.value),placeholder:"attrs e.g. amount:gte:200, tier:eq:pro",title:"Typed search attributes: comma-separated key:op:value (ops eq ne gt gte lt lte)",className:"mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none"}),i&&p.jsx("button",{type:"button",onClick:()=>s(""),className:"text-zinc-600 hover:text-zinc-300",title:"clear attribute filter",children:p.jsx(ki,{width:12,height:12})})]})]}),(e!=="all"||n||f.length>0)&&v.length>0&&p.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--line)] px-3 py-1.5",children:[p.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[v.length," ",e!=="all"?e:""," ",n&&`#${n}`,f.length>0&&` ⛃${f.length}`]}),p.jsx("button",{type:"button",disabled:c.isPending,onClick:()=>c.mutate("retry"),className:"mono ml-auto rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-300 transition-colors hover:bg-emerald-500/20 disabled:opacity-40",children:"retry all"}),p.jsx("button",{type:"button",disabled:c.isPending,onClick:()=>c.mutate("cancel"),className:"mono rounded border border-rose-500/30 bg-rose-500/10 px-1.5 py-0.5 text-[10px] text-rose-300 transition-colors hover:bg-rose-500/20 disabled:opacity-40",children:"cancel all"})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:p.jsx(Z3,{runs:v,selected:o,onSelect:a,onSelectTag:r})})]}),p.jsx("main",{className:"min-h-0",children:o?p.jsx(J3,{id:o,onOpenRun:a},o):p.jsx("div",{className:"grid h-full place-items-center text-center",children:p.jsxs("div",{children:[p.jsx("div",{className:"text-4xl text-zinc-800","aria-hidden":!0,children:"◆"}),p.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const t5=new Zx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});xg(document.getElementById("root")).render(p.jsx(R.StrictMode,{children:p.jsx(i1,{client:t5,children:p.jsx(e5,{})})}));
|