@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.
|
@@ -1,62 +0,0 @@
|
|
|
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 Fp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hp={exports:{}},Al={},Bp={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"),mx=Symbol.for("react.portal"),gx=Symbol.for("react.fragment"),yx=Symbol.for("react.strict_mode"),vx=Symbol.for("react.profiler"),xx=Symbol.for("react.provider"),wx=Symbol.for("react.context"),Sx=Symbol.for("react.forward_ref"),kx=Symbol.for("react.suspense"),Ex=Symbol.for("react.memo"),_x=Symbol.for("react.lazy"),af=Symbol.iterator;function Nx(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Vp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Up=Object.assign,Qp={};function Pi(e,t,n){this.props=e,this.context=t,this.refs=Qp,this.updater=n||Vp}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 Wp(){}Wp.prototype=Pi.prototype;function Rc(e,t,n){this.props=e,this.context=t,this.refs=Qp,this.updater=n||Vp}var $c=Rc.prototype=new Wp;$c.constructor=Rc;Up($c,Pi.prototype);$c.isPureReactComponent=!0;var uf=Array.isArray,qp=Object.prototype.hasOwnProperty,Oc={current:null},Xp={key:!0,ref:!0,__self:!0,__source:!0};function Yp(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)qp.call(t,r)&&!Xp.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 Cx(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 bx(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?bx(""+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 mx: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=Cx(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=Nx(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 jx(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},Mx={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:$o,ReactCurrentOwner:Oc};function Kp(){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=gx;re.Profiler=vx;re.PureComponent=Rc;re.StrictMode=yx;re.Suspense=kx;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mx;re.act=Kp;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=Up({},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)qp.call(t,a)&&!Xp.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:wx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xx,_context:e},e.Consumer=e};re.createElement=Yp;re.createFactory=function(e){var t=Yp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:Sx,render:e}};re.isValidElement=Dc;re.lazy=function(e){return{$$typeof:_x,_payload:{_status:-1,_result:e},_init:jx}};re.memo=function(e,t){return{$$typeof:Ex,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=Kp;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";Bp.exports=re;var R=Bp.exports;const Px=Fp(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 zx=R,Tx=Symbol.for("react.element"),Ix=Symbol.for("react.fragment"),Rx=Object.prototype.hasOwnProperty,$x=zx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ox={key:!0,ref:!0,__self:!0,__source:!0};function Gp(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)Rx.call(t,r)&&!Ox.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:$x.current}}Al.Fragment=Ix;Al.jsx=Gp;Al.jsxs=Gp;Hp.exports=Al;var p=Hp.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 Dx(e,t){return typeof e=="function"?e(t):e}function ou(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zp(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 Ax(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 Lx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Fx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Fc=Symbol();function Jp(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,Mp,Hx=(Mp=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,Mp),Hc=new Hx,ei,bn,ti,Pp,Bx=(Pp=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,Pp),Jo=new Bx;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 Vx(e){return Math.min(1e3*2**e,3e4)}function e0(e){return(e??"online")==="online"?Jo.isOnline():!0}var t0=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 t0}function n0(e){let t=!1,n=0,r=!1,i;const s=uu(),o=x=>{var k;r||(d(new t0(x)),(k=e.abort)==null||k.call(e))},l=()=>{t=!0},a=()=>{t=!1},u=()=>Hc.isFocused()&&(e.networkMode==="always"||Jo.isOnline())&&e.canRun(),f=()=>e0(e.networkMode)&&e.canRun(),c=x=>{var k;r||(r=!0,(k=e.onSuccess)==null||k.call(e,x),i==null||i(),s.resolve(x))},d=x=>{var k;r||(r=!0,(k=e.onError)==null||k.call(e,x),i==null||i(),s.reject(x))},h=()=>new Promise(x=>{var k;i=m=>{(r||u())&&x(m)},(k=e.onPause)==null||k.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;const k=n===0?e.initialPromise:void 0;try{x=k??e.fn()}catch(m){x=Promise.reject(m)}Promise.resolve(x).then(c).catch(m=>{var P;if(r)return;const v=e.retry??(yr?0:3),g=e.retryDelay??Vx,w=typeof g=="function"?g(n,m):g,_=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,m);if(t||!_){d(m);return}n++,(P=e.onFail)==null||P.call(e,n,m),Ax(w).then(()=>u()?void 0:h()).then(()=>{t?d(m):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:a,canStart:f,start:()=>(f()?y():h().then(y),s)}}function Ux(){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=Ux(),or,zp,r0=(zp=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,zp),ni,ri,dt,Ae,Hs,lr,Et,qt,Tp,Qx=(Tp=class extends r0{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,Wx(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||!Zp(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 c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(V(this,lr,!0),r.signal)})},s=()=>{const c=Jp(this.options,n),d={queryKey:this.queryKey,meta:this.meta};return i(d),V(this,lr,!1),this.options.persister?this.options.persister(c,d,this):c(d)},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=c=>{var d,h,y,x;Ea(c)&&c.silent||ee(this,Et,qt).call(this,{type:"error",error:c}),Ea(c)||((h=(d=C(this,dt).config).onError)==null||h.call(d,c,this),(x=(y=C(this,dt).config).onSettled)==null||x.call(y,this.state.data,c,this)),this.scheduleGc()};return V(this,Ae,n0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var d,h,y,x;if(c===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(k){l(k);return}(h=(d=C(this,dt).config).onSuccess)==null||h.call(d,c,this),(x=(y=C(this,dt).config).onSettled)==null||x.call(y,c,this.state.error,this),this.scheduleGc()},onError:l,onFail:(c,d)=>{ee(this,Et,qt).call(this,{type:"failed",failureCount:c,error:d})},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,...i0(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 i0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:e0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Wx(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,Ip,qx=(Ip=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 Qx({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,Ip),At,He,ar,Lt,xn,Rp,Xx=(Rp=class extends r0{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||s0(),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,c,d,h,y,x,k,m,v,g,w,_,P,N;V(this,ar,n0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(b,z)=>{ee(this,Lt,xn).call(this,{type:"failed",failureCount:b,error:z})},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 z=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));z!==this.state.context&&ee(this,Lt,xn).call(this,{type:"pending",context:z,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((c=(f=this.options).onSuccess)==null?void 0:c.call(f,b,t,this.state.context)),await((h=(d=C(this,He).config).onSettled)==null?void 0:h.call(d,b,null,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,b,null,t,this.state.context)),ee(this,Lt,xn).call(this,{type:"success",data:b}),b}catch(b){try{throw await((m=(k=C(this,He).config).onError)==null?void 0:m.call(k,b,t,this.state.context,this)),await((g=(v=this.options).onError)==null?void 0:g.call(v,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=(P=this.options).onSettled)==null?void 0:N.call(P,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})})},Rp);function s0(){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,$p,Yx=($p=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 Xx({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,$p);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,c,d,h,y;const r=t.options,i=(d=(c=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let x=!1;const k=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},m=Jp(t.options,t.fetchOptions),v=async(g,w,_)=>{if(x)return Promise.reject();if(w==null&&g.pages.length)return Promise.resolve(g);const P={queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};k(P);const N=await m(P),{maxPages:b}=t.options,z=_?Fx:Lx;return{pages:z(g.pages,N,b),pageParams:z(g.pageParams,w,b)}};if(i&&s.length){const g=i==="backward",w=g?Kx:gf,_={pages:s,pageParams:o},P=w(r,_);l=await v(_,P,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 v(l,w),a++}while(a<g)}return l};t.options.persister?t.fetchFn=()=>{var x,k;return(k=(x=t.options).persister)==null?void 0:k.call(x,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 Kx(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,Op,Gx=(Op=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 qx),V(this,jn,e.mutationCache||new Yx),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=Dx(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,Op),qe,ie,Vs,Be,ur,ai,zn,Ft,Us,ui,ci,cr,dr,Tn,di,ue,Xi,cu,du,fu,hu,pu,mu,gu,o0,Dp,Bc=(Dp=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,Tn);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,Tn))&&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 Jx(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 c={...f},d=!1,h;if(n._optimisticResults){const z=this.hasListeners(),T=!z&&yf(t,n),D=z&&vf(t,r,n,i);(T||D)&&(c={...c,...i0(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:k}=c;if(n.select&&c.data!==void 0)if(s&&c.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(c.data),h=au(s==null?void 0:s.data,h,n),V(this,ui,h),V(this,Ft,null)}catch(z){V(this,Ft,z)}else h=c.data;if(n.placeholderData!==void 0&&h===void 0&&k==="pending"){let z;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))z=s.data;else if(z=typeof n.placeholderData=="function"?n.placeholderData((b=C(this,ci))==null?void 0:b.state.data,C(this,ci)):n.placeholderData,n.select&&z!==void 0)try{z=n.select(z),V(this,Ft,null)}catch(T){V(this,Ft,T)}z!==void 0&&(k="success",h=au(s==null?void 0:s.data,z,n),d=!0)}C(this,Ft)&&(y=C(this,Ft),h=C(this,ui),x=Date.now(),k="error");const m=c.fetchStatus==="fetching",v=k==="pending",g=k==="error",w=v&&m,_=h!==void 0,N={status:k,fetchStatus:c.fetchStatus,isPending:v,isSuccess:k==="success",isError:g,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:g&&!_,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&_,isStale:Vc(t,n),refetch:this.refetch,promise:C(this,zn)};if(this.options.experimental_prefetchInRender){const z=L=>{N.status==="error"?L.reject(N.error):N.data!==void 0&&L.resolve(N.data)},T=()=>{const L=V(this,zn,N.promise=uu());z(L)},D=C(this,zn);switch(D.status){case"pending":t.queryHash===r.queryHash&&z(D);break;case"fulfilled":(N.status==="error"||N.data!==D.value)&&T();break;case"rejected":(N.status!=="error"||N.error!==D.reason)&&T();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,o0).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,Tn=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=Zp(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,Tn,t),!(yr||Ct(this.options.enabled,C(this,ie))===!1||!ou(C(this,Tn))||C(this,Tn)===0)&&V(this,dr,setInterval(()=>{(this.options.refetchIntervalInBackground||Hc.isFocused())&&ee(this,ue,Xi).call(this)},C(this,Tn)))},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))},o0=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"})})},Dp);function Zx(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 Zx(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 Jx(e,t){return!Zo(e.getCurrentResult(),t)}function xf(e,t){return e.filter(n=>!t.includes(n))}function e1(e,t,n){const r=e.slice(0);return r[t]=n,r}var fi,ft,fr,hi,ht,In,Qs,Ws,ze,vu,xu,Oo,wu,Su,Ap,t1=(Ap=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,In);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,In=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,In)||C(this,ft)!==C(this,Ws)||n!==C(this,Qs))&&(V(this,Qs,n),V(this,Ws,C(this,ft)),V(this,In,Lc(C(this,In),n(t)))),C(this,In)):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,e1(C(this,ft),r,n)),ee(this,ze,Su).call(this))},Su=function(){var t;if(this.hasListeners()){const n=C(this,In),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))})})}},Ap),Rn,$n,Xe,Kt,rn,Do,ku,Lp,n1=(Lp=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)??s0();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 c=C(this,$n).variables,d=C(this,$n).context;(n==null?void 0:n.type)==="success"?((i=(r=C(this,Kt)).onSuccess)==null||i.call(r,n.data,c,d),(o=(s=C(this,Kt)).onSettled)==null||o.call(s,n.data,null,c,d)):(n==null?void 0:n.type)==="error"&&((a=(l=C(this,Kt)).onError)==null||a.call(l,n.error,c,d),(f=(u=C(this,Kt)).onSettled)==null||f.call(u,void 0,n.error,c,d))}this.listeners.forEach(c=>{c(C(this,$n))})})},Lp),l0=R.createContext(void 0),Xs=e=>{const t=R.useContext(l0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},r1=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(l0.Provider,{value:e,children:t})),a0=R.createContext(!1),u0=()=>R.useContext(a0);a0.Provider;function i1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var s1=R.createContext(i1()),c0=()=>R.useContext(s1);function d0(e,t){return typeof e=="function"?e(...t):!!e}function el(){}var f0=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},h0=e=>{R.useEffect(()=>{e.clearReset()},[e])},p0=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&d0(n,[e.error,r]),m0=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},g0=(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 o1({queries:e,...t},n){const r=Xs(),i=u0(),s=c0(),o=R.useMemo(()=>e.map(y=>{const x=r.defaultQueryOptions(y);return x._optimisticResults=i?"isRestoring":"optimistic",x}),[e,r,i]);o.forEach(y=>{m0(y),f0(y,s)}),h0(s);const[l]=R.useState(()=>new t1(r,o,t)),[a,u,f]=l.getOptimisticResult(o,t.combine);R.useSyncExternalStore(R.useCallback(y=>i?el:l.subscribe(ke.batchCalls(y)),[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,t,{listeners:!1})},[o,t,l]);const d=a.some((y,x)=>Eu(o[x],y))?a.flatMap((y,x)=>{const k=o[x];if(k){const m=new Bc(r,k);if(Eu(k,y))return tl(k,m,s);g0(y,i)&&tl(k,m,s)}return[]}):[];if(d.length>0)throw Promise.all(d);const h=a.find((y,x)=>{const k=o[x];return k&&p0({result:y,errorResetBoundary:s,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash)})});if(h!=null&&h.error)throw h.error;return u(f())}function l1(e,t,n){var f,c,d,h,y;const r=Xs(),i=u0(),s=c0(),o=r.defaultQueryOptions(e);(c=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||c.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",m0(o),f0(o,s),h0(s);const l=!r.getQueryCache().get(o.queryHash),[a]=R.useState(()=>new t(r,o)),u=a.getOptimisticResult(o);if(R.useSyncExternalStore(R.useCallback(x=>{const k=i?el:a.subscribe(ke.batchCalls(x));return a.updateResult(),k},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),R.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Eu(o,u))throw tl(o,a,s);if(p0({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||h.call(d,o,u),o.experimental_prefetchInRender&&!yr&&g0(u,i)){const x=l?tl(o,a,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;x==null||x.catch(el).finally(()=>{a.updateResult()})}return o.notifyOnChangeProps?u:a.trackResult(u)}function pi(e,t){return l1(e,Bc)}function Yi(e,t){const n=Xs(),[r]=R.useState(()=>new n1(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&&d0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var y0={exports:{}},ut={},v0={exports:{}},x0={};/**
|
|
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(S,j){var I=S.length;S.push(j);e:for(;0<I;){var A=I-1>>>1,H=S[A];if(0<i(H,j))S[A]=j,S[I]=H,I=A;else break e}}function n(S){return S.length===0?null:S[0]}function r(S){if(S.length===0)return null;var j=S[0],I=S.pop();if(I!==j){S[0]=I;e:for(var A=0,H=S.length,K=H>>>1;A<K;){var Q=2*(A+1)-1,X=S[Q],q=Q+1,Z=S[q];if(0>i(X,I))q<H&&0>i(Z,X)?(S[A]=Z,S[q]=I,A=q):(S[A]=X,S[Q]=I,A=Q);else if(q<H&&0>i(Z,I))S[A]=Z,S[q]=I,A=q;else break e}}return j}function i(S,j){var I=S.sortIndex-j.sortIndex;return I!==0?I:S.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,c=null,d=3,h=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=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(S){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=S)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function w(S){if(x=!1,g(S),!y)if(n(a)!==null)y=!0,M(_);else{var j=n(u);j!==null&&O(w,j.startTime-S)}}function _(S,j){y=!1,x&&(x=!1,m(b),b=-1),h=!0;var I=d;try{for(g(j),c=n(a);c!==null&&(!(c.expirationTime>j)||S&&!D());){var A=c.callback;if(typeof A=="function"){c.callback=null,d=c.priorityLevel;var H=A(c.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(a)&&r(a),g(j)}else r(a);c=n(a)}if(c!==null)var K=!0;else{var Q=n(u);Q!==null&&O(w,Q.startTime-j),K=!1}return K}finally{c=null,d=I,h=!1}}var P=!1,N=null,b=-1,z=5,T=-1;function D(){return!(e.unstable_now()-T<z)}function L(){if(N!==null){var S=e.unstable_now();T=S;var j=!0;try{j=N(!0,S)}finally{j?F():(P=!1,N=null)}}else P=!1}var F;if(typeof v=="function")F=function(){v(L)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=L,F=function(){$.postMessage(null)}}else F=function(){k(L,0)};function M(S){N=S,P||(P=!0,F())}function O(S,j){b=k(function(){S(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(S){S.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,M(_))},e.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<S?Math.floor(1e3/S):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(S){switch(d){case 1:case 2:case 3:var j=3;break;default:j=d}var I=d;d=j;try{return S()}finally{d=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(S,j){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var I=d;d=S;try{return j()}finally{d=I}},e.unstable_scheduleCallback=function(S,j,I){var A=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?A+I:A):I=A,S){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=I+H,S={id:f++,callback:j,priorityLevel:S,startTime:I,expirationTime:H,sortIndex:-1},I>A?(S.sortIndex=I,t(u,S),n(a)===null&&S===n(u)&&(x?(m(b),b=-1):x=!0,O(w,I-A))):(S.sortIndex=H,t(a,S),y||h||(y=!0,M(_))),S},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(S){var j=d;return function(){var I=d;d=j;try{return S.apply(this,arguments)}finally{d=I}}}})(x0);v0.exports=x0;var a1=v0.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 u1=R,lt=a1;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 w0=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++)w0.add(t[e])}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,c1=/^[: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 d1(e){return _u.call(Sf,e)?!0:_u.call(wf,e)?!1:c1.test(e)?Sf[e]=!0:(wf[e]=!0,!1)}function f1(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 h1(e,t,n,r){if(t===null||typeof t>"u"||f1(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")&&(h1(t,n,i,r)&&(n=null),r||i===null?d1(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=u1.__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"),S0=Symbol.for("react.provider"),k0=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"),E0=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 p1(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 k0:return(e.displayName||"Context")+".Consumer";case S0: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 m1(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 _0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function g1(e){var t=_0(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=g1(e))}function N0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_0(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 C0(e,t){t=t.checked,t!=null&&Wc(e,"checked",t,!1)}function Pu(e,t){C0(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 Tu(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 b0(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 j0(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 Iu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?j0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var co,M0=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},y1=["Webkit","ms","Moz","O"];Object.keys(ns).forEach(function(e){y1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ns[t]=ns[e]})});function P0(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 z0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=P0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var v1=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(v1[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 I0(){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 R0(e,t){return e(t)}function $0(){}var ba=!1;function O0(e,t,n){if(ba)return e(t,n);ba=!0;try{return R0(e,t,n)}finally{ba=!1,(Wr!==null||qr!==null)&&($0(),I0())}}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 x1(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,w1={onError:function(e){rs=!0,rl=e}};function S1(e,t,n,r,i,s,o,l,a){rs=!1,rl=null,x1.apply(w1,arguments)}function k1(e,t,n,r,i,s,o,l,a){if(S1.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 D0(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 E1(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 A0(e){return e=E1(e),e!==null?L0(e):null}function L0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=L0(e);if(t!==null)return t;e=e.sibling}return null}var F0=lt.unstable_scheduleCallback,Mf=lt.unstable_cancelCallback,_1=lt.unstable_shouldYield,N1=lt.unstable_requestPaint,_e=lt.unstable_now,C1=lt.unstable_getCurrentPriorityLevel,Gc=lt.unstable_ImmediatePriority,H0=lt.unstable_UserBlockingPriority,sl=lt.unstable_NormalPriority,b1=lt.unstable_LowPriority,B0=lt.unstable_IdlePriority,Ll=null,Bt=null;function j1(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:z1,M1=Math.log,P1=Math.LN2;function z1(e){return e>>>=0,e===0?32:31-(M1(e)/P1|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 I1(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 V0(){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 R1(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 U0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Q0,Jc,W0,q0,X0,Hu=!1,po=[],An=null,Ln=null,Fn=null,ys=new Map,vs=new Map,En=[],$1="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 O1(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 Y0(e){var t=tr(e.target);if(t!==null){var n=jr(t);if(n!==null){if(t=n.tag,t===13){if(t=D0(n),t!==null){e.blockedOn=t,X0(e.priority,function(){W0(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 D1(){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,D1)))}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);)Y0(n),n.blockedOn===null&&En.shift()}var Xr=cn.ReactCurrentBatchConfig,ll=!0;function A1(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 L1(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(O1(i,e,t,n,r))r.stopPropagation();else if(Pf(e,r),t&4&&-1<$1.indexOf(e)){for(;i!==null;){var s=Gs(i);if(s!==null&&Q0(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=D0(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 K0(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(C1()){case Gc:return 1;case H0:return 4;case sl:case b1:return 16;case B0:return 536870912;default:return 16}default:return 16}}var On=null,td=null,Lo=null;function G0(){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 Tf(){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:Tf,this.isPropagationStopped=Tf,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}),F1=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}}),If=ct(Fl),H1=xe({},Fl,{dataTransfer:0}),B1=ct(H1),V1=xe({},Ks,{relatedTarget:0}),za=ct(V1),U1=xe({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),Q1=ct(U1),W1=xe({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),q1=ct(W1),X1=xe({},zi,{data:0}),Rf=ct(X1),Y1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K1={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"},G1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G1[e])?!!t[e]:!1}function rd(){return Z1}var J1=xe({},Ks,{key:function(e){if(e.key){var t=Y1[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"?K1[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}}),ew=ct(J1),tw=xe({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$f=ct(tw),nw=xe({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rd}),rw=ct(nw),iw=xe({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),sw=ct(iw),ow=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}),lw=ct(ow),aw=[9,13,27,32],id=sn&&"CompositionEvent"in window,is=null;sn&&"documentMode"in document&&(is=document.documentMode);var uw=sn&&"TextEvent"in window&&!is,Z0=sn&&(!id||is&&8<is&&11>=is),Of=" ",Df=!1;function J0(e,t){switch(e){case"keyup":return aw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tr=!1;function cw(e,t){switch(e){case"compositionend":return em(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 dw(e,t){if(Tr)return e==="compositionend"||!id&&J0(e,t)?(e=G0(),Lo=td=On=null,Tr=!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 Z0&&t.locale!=="ko"?null:t.data;default:return null}}var fw={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"?!!fw[e.type]:t==="textarea"}function tm(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 hw(e){fm(e,0)}function Hl(e){var t=$r(e);if(N0(t))return e}function pw(e,t){if(e==="change")return t}var nm=!1;if(sn){var Ta;if(sn){var Ia="oninput"in document;if(!Ia){var Lf=document.createElement("div");Lf.setAttribute("oninput","return;"),Ia=typeof Lf.oninput=="function"}Ta=Ia}else Ta=!1;nm=Ta&&(!document.documentMode||9<document.documentMode)}function Ff(){ss&&(ss.detachEvent("onpropertychange",rm),ws=ss=null)}function rm(e){if(e.propertyName==="value"&&Hl(ws)){var t=[];tm(t,ws,e,Kc(e)),O0(hw,t)}}function mw(e,t,n){e==="focusin"?(Ff(),ss=t,ws=n,ss.attachEvent("onpropertychange",rm)):e==="focusout"&&Ff()}function gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hl(ws)}function yw(e,t){if(e==="click")return Hl(t)}function vw(e,t){if(e==="input"||e==="change")return Hl(t)}function xw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:xw;function Ss(e,t){if(Tt(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)||!Tt(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 im(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?im(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sm(){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 ww(e){var t=sm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&im(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 Sw=sn&&"documentMode"in document&&11>=document.documentMode,Ir=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||Ir==null||Ir!==nl(r)||(r=Ir,"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=Ir)))}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={},om={};sn&&(om=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 om)return Ra[e]=t[n];return e}var lm=Bl("animationend"),am=Bl("animationiteration"),um=Bl("animationstart"),cm=Bl("transitionend"),dm=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){dm.set(e,t),br(t,[e])}for(var $a=0;$a<Uf.length;$a++){var Oa=Uf[$a],kw=Oa.toLowerCase(),Ew=Oa[0].toUpperCase()+Oa.slice(1);Yn(kw,"on"+Ew)}Yn(lm,"onAnimationEnd");Yn(am,"onAnimationIteration");Yn(um,"onAnimationStart");Yn("dblclick","onDoubleClick");Yn("focusin","onFocus");Yn("focusout","onBlur");Yn(cm,"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(" "),_w=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,k1(r,t,void 0,e),e.currentTarget=null}function fm(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)||(hm(t,e,2,!1),n.add(r))}function Da(e,t,n){var r=0;t&&(r|=4),hm(n,e,r,t)}var yo="_reactListening"+Math.random().toString(36).slice(2);function ks(e){if(!e[yo]){e[yo]=!0,w0.forEach(function(n){n!=="selectionchange"&&(_w.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 hm(e,t,n,r){switch(K0(t)){case 1:var i=A1;break;case 4:i=L1;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}O0(function(){var u=s,f=Kc(n),c=[];e:{var d=dm.get(e);if(d!==void 0){var h=nd,y=e;switch(e){case"keypress":if(Fo(n)===0)break e;case"keydown":case"keyup":h=ew;break;case"focusin":y="focus",h=za;break;case"focusout":y="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=If;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=B1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=rw;break;case lm:case am:case um:h=Q1;break;case cm:h=sw;break;case"scroll":h=F1;break;case"wheel":h=lw;break;case"copy":case"cut":case"paste":h=q1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=$f}var x=(t&4)!==0,k=!x&&e==="scroll",m=x?d!==null?d+"Capture":null:d;x=[];for(var v=u,g;v!==null;){g=v;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=gs(v,m),w!=null&&x.push(Es(v,w,g)))),k)break;v=v.return}0<x.length&&(d=new h(d,y,null,n,f),c.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==Ou&&(y=n.relatedTarget||n.fromElement)&&(tr(y)||y[on]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?tr(y):null,y!==null&&(k=jr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(x=If,w="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=$f,w="onPointerLeave",m="onPointerEnter",v="pointer"),k=h==null?d:$r(h),g=y==null?d:$r(y),d=new x(w,v+"leave",h,n,f),d.target=k,d.relatedTarget=g,w=null,tr(f)===u&&(x=new x(m,v+"enter",y,n,f),x.target=g,x.relatedTarget=k,w=x),k=w,h&&y)t:{for(x=h,m=y,v=0,g=x;g;g=Mr(g))v++;for(g=0,w=m;w;w=Mr(w))g++;for(;0<v-g;)x=Mr(x),v--;for(;0<g-v;)m=Mr(m),g--;for(;v--;){if(x===m||m!==null&&x===m.alternate)break t;x=Mr(x),m=Mr(m)}x=null}else x=null;h!==null&&Wf(c,d,h,x,!1),y!==null&&k!==null&&Wf(c,k,y,x,!0)}}e:{if(d=u?$r(u):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var _=pw;else if(Af(d))if(nm)_=vw;else{_=gw;var P=mw}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(_=yw);if(_&&(_=_(e,u))){tm(c,_,n,f);break e}P&&P(e,d,u),e==="focusout"&&(P=d._wrapperState)&&P.controlled&&d.type==="number"&&zu(d,"number",d.value)}switch(P=u?$r(u):window,e){case"focusin":(Af(P)||P.contentEditable==="true")&&(Ir=P,Vu=u,os=null);break;case"focusout":os=Vu=Ir=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Vf(c,n,f);break;case"selectionchange":if(Sw)break;case"keydown":case"keyup":Vf(c,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 Tr?J0(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(Z0&&n.locale!=="ko"&&(Tr||b!=="onCompositionStart"?b==="onCompositionEnd"&&Tr&&(N=G0()):(On=f,td="value"in On?On.value:On.textContent,Tr=!0)),P=ul(u,b),0<P.length&&(b=new Rf(b,e,null,n,f),c.push({event:b,listeners:P}),N?b.data=N:(N=em(n),N!==null&&(b.data=N)))),(N=uw?cw(e,n):dw(e,n))&&(u=ul(u,"onBeforeInput"),0<u.length&&(f=new Rf("onBeforeInput","beforeinput",null,n,f),c.push({event:f,listeners:u}),f.data=N))}fm(c,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 Nw=/\r\n?/g,Cw=/\u0000|\uFFFD/g;function qf(e){return(typeof e=="string"?e:""+e).replace(Nw,`
|
|
38
|
-
`).replace(Cw,"")}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,bw=typeof clearTimeout=="function"?clearTimeout:void 0,Xf=typeof Promise=="function"?Promise:void 0,jw=typeof queueMicrotask=="function"?queueMicrotask:typeof Xf<"u"?function(e){return Xf.resolve(null).then(e).catch(Mw)}:Xu;function Mw(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 Ti=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Ti,_s="__reactProps$"+Ti,on="__reactContainer$"+Ti,Yu="__reactEvents$"+Ti,Pw="__reactListeners$"+Ti,zw="__reactHandles$"+Ti;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 pm(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,m1(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=pm(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 mm(e){Yt===null?Yt=[e]:Yt.push(e)}function Tw(e){Ul=!0,mm(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)),F0(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 gm(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),gm(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 ym(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)?ym(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 vm(),Error(B(418));for(;t;)ym(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 vm(){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 Iw=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 xm(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function i(m,v){return m=Qn(m,v),m.index=0,m.sibling=null,m}function s(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,v,g,w){return v===null||v.tag!==6?(v=qa(g,m.mode,w),v.return=m,v):(v=i(v,g),v.return=m,v)}function a(m,v,g,w){var _=g.type;return _===zr?f(m,v,g.props.children,w,g.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===v.type)?(w=i(v,g.props),w.ref=Vi(m,v,g),w.return=m,w):(w=qo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,v,g),w.return=m,w)}function u(m,v,g,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=Xa(g,m.mode,w),v.return=m,v):(v=i(v,g.children||[]),v.return=m,v)}function f(m,v,g,w,_){return v===null||v.tag!==7?(v=pr(g,m.mode,w,_),v.return=m,v):(v=i(v,g),v.return=m,v)}function c(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=qa(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ao:return g=qo(v.type,v.key,v.props,null,m.mode,g),g.ref=Vi(m,null,v),g.return=m,g;case Pr:return v=Xa(v,m.mode,g),v.return=m,v;case wn:var w=v._init;return c(m,w(v._payload),g)}if(Gi(v)||Ai(v))return v=pr(v,m.mode,g,null),v.return=m,v;wo(m,v)}return null}function d(m,v,g,w){var _=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return _!==null?null:l(m,v,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ao:return g.key===_?a(m,v,g,w):null;case Pr:return g.key===_?u(m,v,g,w):null;case wn:return _=g._init,d(m,v,_(g._payload),w)}if(Gi(g)||Ai(g))return _!==null?null:f(m,v,g,w,null);wo(m,g)}return null}function h(m,v,g,w,_){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,l(v,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(v,m,w,_);case Pr:return m=m.get(w.key===null?g:w.key)||null,u(v,m,w,_);case wn:var P=w._init;return h(m,v,g,P(w._payload),_)}if(Gi(w)||Ai(w))return m=m.get(g)||null,f(v,m,w,_,null);wo(v,w)}return null}function y(m,v,g,w){for(var _=null,P=null,N=v,b=v=0,z=null;N!==null&&b<g.length;b++){N.index>b?(z=N,N=null):z=N.sibling;var T=d(m,N,g[b],w);if(T===null){N===null&&(N=z);break}e&&N&&T.alternate===null&&t(m,N),v=s(T,v,b),P===null?_=T:P.sibling=T,P=T,N=z}if(b===g.length)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;b<g.length;b++)N=c(m,g[b],w),N!==null&&(v=s(N,v,b),P===null?_=N:P.sibling=N,P=N);return me&&Zn(m,b),_}for(N=r(m,N);b<g.length;b++)z=h(N,m,b,g[b],w),z!==null&&(e&&z.alternate!==null&&N.delete(z.key===null?b:z.key),v=s(z,v,b),P===null?_=z:P.sibling=z,P=z);return e&&N.forEach(function(D){return t(m,D)}),me&&Zn(m,b),_}function x(m,v,g,w){var _=Ai(g);if(typeof _!="function")throw Error(B(150));if(g=_.call(g),g==null)throw Error(B(151));for(var P=_=null,N=v,b=v=0,z=null,T=g.next();N!==null&&!T.done;b++,T=g.next()){N.index>b?(z=N,N=null):z=N.sibling;var D=d(m,N,T.value,w);if(D===null){N===null&&(N=z);break}e&&N&&D.alternate===null&&t(m,N),v=s(D,v,b),P===null?_=D:P.sibling=D,P=D,N=z}if(T.done)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;!T.done;b++,T=g.next())T=c(m,T.value,w),T!==null&&(v=s(T,v,b),P===null?_=T:P.sibling=T,P=T);return me&&Zn(m,b),_}for(N=r(m,N);!T.done;b++,T=g.next())T=h(N,m,b,T.value,w),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?b:T.key),v=s(T,v,b),P===null?_=T:P.sibling=T,P=T);return e&&N.forEach(function(L){return t(m,L)}),me&&Zn(m,b),_}function k(m,v,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,P=v;P!==null;){if(P.key===_){if(_=g.type,_===zr){if(P.tag===7){n(m,P.sibling),v=i(P,g.props.children),v.return=m,m=v;break e}}else if(P.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===P.type){n(m,P.sibling),v=i(P,g.props),v.ref=Vi(m,P,g),v.return=m,m=v;break e}n(m,P);break}else t(m,P);P=P.sibling}g.type===zr?(v=pr(g.props.children,m.mode,w,g.key),v.return=m,m=v):(w=qo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,v,g),w.return=m,m=w)}return o(m);case Pr:e:{for(P=g.key;v!==null;){if(v.key===P)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=i(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=Xa(g,m.mode,w),v.return=m,m=v}return o(m);case wn:return P=g._init,k(m,v,P(g._payload),w)}if(Gi(g))return y(m,v,g,w);if(Ai(g))return x(m,v,g,w);wo(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=i(v,g),v.return=m,m=v):(n(m,v),v=qa(g,m.mode,w),v.return=m,m=v),o(m)):n(m,v)}return k}var vi=xm(!0),wm=xm(!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 Sm(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 km(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 c=i.baseState;o=0,f=u=a=null,l=s;do{var d=l.lane,h=l.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(d=t,h=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){c=y.call(h,c,d);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,d=typeof y=="function"?y.call(h,c,d):y,d==null)break e;c=xe({},c,d);break e;case 2:Sn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[l]:d.push(l))}else h={eventTime:h,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=h,a=c):f=f.next=h,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;d=l,l=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(f===null&&(a=c),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=c}}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:Iu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iu(t,e)}pe(Vt),de(Vt,t)}function xi(){pe(Vt),pe(Ns),pe(Cs)}function Em(e){rr(Cs.current);var t=rr(Vt.current),n=Iu(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,Rw=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(!Tt(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?Aw:Lw,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=Fw,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 c={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=c,o=r):a=a.next=c,ve.lanes|=f,kr|=f}u=u.next}while(u!==null&&u!==s);a===null?o=r:a.next=l,Tt(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);Tt(s,t.memoizedState)||(Ke=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function _m(){}function Nm(e,t){var n=ve,r=wt(),i=t(),s=!Tt(r.memoizedState,i);if(s&&(r.memoizedState=i,Ke=!0),r=r.queue,wd(jm.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Ms(9,bm.bind(null,n,r,i,t),void 0,null),Pe===null)throw Error(B(349));Sr&30||Cm(n,t,i)}return i}function Cm(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 bm(e,t,n,r){t.value=n,t.getSnapshot=r,Mm(t)&&Pm(e)}function jm(e,t,n){return n(function(){Mm(t)&&Pm(e)})}function Mm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tt(e,n)}catch{return!0}}function Pm(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=Dw.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 zm(){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 Im(e,t){return Ql(4,4,e,t)}function Rm(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 $m(e,t,n){return n=n!=null?n.concat([e]):null,Ql(4,4,Rm.bind(null,t,e),n)}function Sd(){}function Om(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 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]:(e=e(),n.memoizedState=[e,t],e)}function Am(e,t,n){return Sr&21?(Tt(n,t)||(n=V0(),ve.lanes|=n,kr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function $w(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 Lm(){return wt().memoizedState}function Ow(e,t,n){var r=Un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fm(e))Hm(t,n);else if(n=Sm(e,t,n,r),n!==null){var i=Ue();zt(n,e,r,i),Bm(n,t,r)}}function Dw(e,t,n){var r=Un(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fm(e))Hm(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,Tt(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=Sm(e,t,i,r),n!==null&&(i=Ue(),zt(n,e,r,i),Bm(n,t,r))}}function Fm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Hm(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 Bm(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},Aw={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,Rm.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=Ow.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=$w.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||Cm(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ih(jm.bind(null,r,s,e),[e]),r.flags|=2048,Ms(9,bm.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=Rw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Lw={readContext:xt,useCallback:Om,useContext:xt,useEffect:wd,useImperativeHandle:$m,useInsertionEffect:Tm,useLayoutEffect:Im,useMemo:Dm,useReducer:Va,useRef:zm,useState:function(){return Va(js)},useDebugValue:Sd,useDeferredValue:function(e){var t=wt();return Am(t,be.memoizedState,e)},useTransition:function(){var e=Va(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:_m,useSyncExternalStore:Nm,useId:Lm,unstable_isNewReconciler:!1},Fw={readContext:xt,useCallback:Om,useContext:xt,useEffect:wd,useImperativeHandle:$m,useInsertionEffect:Tm,useLayoutEffect:Im,useMemo:Dm,useReducer:Ua,useRef:zm,useState:function(){return Ua(js)},useDebugValue:Sd,useDeferredValue:function(e){var t=wt();return be===null?t.memoizedState=e:Am(t,be.memoizedState,e)},useTransition:function(){var e=Ua(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:_m,useSyncExternalStore:Nm,useId:Lm,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 Vm(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+=p1(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 Hw=typeof WeakMap=="function"?WeakMap:Map;function Um(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 Qm(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 Hw;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=tS.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 Bw=cn.ReactCurrentOwner,Ke=!1;function Ve(e,t,n,r){t.child=e===null?wm(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,Wm(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 Wm(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 qm(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 Xm(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),Vm(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,c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==u)&&oh(t,o,r,u),Sn=!1;var d=t.memoizedState;o.state=d,yl(t,r,o,i),a=t.memoizedState,l!==r||d!==a||Ze.current||Sn?(typeof f=="function"&&(ec(t,n,f,r),a=t.memoizedState),(l=Sn||sh(t,n,l,r,d,a,u))?(c||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,km(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:kt(t.type,l),o.props=u,c=t.pendingProps,d=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!==c||d!==a)&&oh(t,o,r,a),Sn=!1,d=t.memoizedState,o.state=d,yl(t,r,o,i);var y=t.memoizedState;l!==c||d!==y||Ze.current||Sn?(typeof h=="function"&&(ec(t,n,h,r),y=t.memoizedState),(u=Sn||sh(t,n,u,r,d,y,a)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=a,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ic(e,t,n,r,s,i)}function ic(e,t,n,r,i,s){Xm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Gf(t,n,!1),an(e,t,s);r=t.stateNode,Bw.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 Ym(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 Km(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 Vw(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 Vw(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=nS.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 Gm(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 Uw(e,t,n){switch(t.tag){case 3:Ym(t),yi();break;case 5:Em(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?Km(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 Gm(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,qm(e,t,n)}return an(e,t,n)}var Zm,lc,Jm,eg;Zm=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(){};Jm=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=Tu(e,i),r=Tu(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)}};eg=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 Qw(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)Jm(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=j0(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,Zm(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=Tu(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"?z0(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&M0(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)eg(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))vm(),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 Ww(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,qw=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 Xw(e,t){if(Qu=ll,e=sm(),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,c=e,d=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(l=o+i),c!==s||r!==0&&c.nodeType!==3||(a=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)d=c,c=h;for(;;){if(c===e)break t;if(d===n&&++u===i&&(l=o),d===s&&++f===r&&(a=o),(h=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,k=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:kt(t.type,x),k);m.__reactInternalSnapshotBeforeUpdate=v}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 y=mh,mh=!1,y}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 tg(e){var t=e.alternate;t!==null&&(e.alternate=null,tg(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[Pw],delete t[zw])),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 ng(e){return e.tag===5||e.tag===3||e.tag===4}function gh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ng(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 Te=null,_t=!1;function pn(e,t,n){for(n=n.child;n!==null;)rg(e,t,n),n=n.sibling}function rg(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=Te,i=_t;Te=null,pn(e,t,n),Te=r,_t=i,Te!==null&&(_t?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(_t?(e=Te,n=n.stateNode,e.nodeType===8?La(e.parentNode,n):e.nodeType===1&&La(e,n),xs(e)):La(Te,n.stateNode));break;case 4:r=Te,i=_t,Te=n.stateNode.containerInfo,_t=!0,pn(e,t,n),Te=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 qw),t.forEach(function(r){var i=rS.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:Te=l.stateNode,_t=!1;break e;case 3:Te=l.stateNode.containerInfo,_t=!0;break e;case 4:Te=l.stateNode.containerInfo,_t=!0;break e}l=l.return}if(Te===null)throw Error(B(160));rg(s,o,i),Te=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;)ig(t,e),t=t.sibling}function ig(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(x){Se(e,e.return,x)}try{as(5,e,e.return)}catch(x){Se(e,e.return,x)}}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(x){Se(e,e.return,x)}}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&&C0(i,s),$u(l,o);var u=$u(l,s);for(o=0;o<a.length;o+=2){var f=a[o],c=a[o+1];f==="style"?z0(i,c):f==="dangerouslySetInnerHTML"?M0(i,c):f==="children"?ms(i,c):Wc(i,f,c,u)}switch(l){case"input":Pu(i,s);break;case"textarea":b0(i,s);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Qr(i,!!s.multiple,h,!1):d!==!!s.multiple&&(s.defaultValue!=null?Qr(i,!!s.multiple,s.defaultValue,!0):Qr(i,!!s.multiple,s.multiple?[]:"",!1))}i[_s]=s}catch(x){Se(e,e.return,x)}}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(x){Se(e,e.return,x)}}break;case 3:if(St(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xs(t.containerInfo)}catch(x){Se(e,e.return,x)}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(c=W=f;W!==null;){switch(d=W,h=d.child,d.tag){case 0:case 11:case 14:case 15:as(4,d,d.return);break;case 1:Fr(d,d.return);var y=d.stateNode;if(typeof y.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){Se(r,n,x)}}break;case 5:Fr(d,d.return);break;case 22:if(d.memoizedState!==null){xh(c);continue}}h!==null?(h.return=d,W=h):xh(c)}f=f.sibling}e:for(f=null,c=e;;){if(c.tag===5){if(f===null){f=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=c.stateNode,a=c.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=P0("display",o))}catch(x){Se(e,e.return,x)}}}else if(c.tag===6){if(f===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(x){Se(e,e.return,x)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.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(ng(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 Yw(e,t,n){W=e,sg(e)}function sg(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,sg(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 c=f.dehydrated;c!==null&&xs(c)}}}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(d){Se(t,t.return,d)}}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 Kw=Math.ceil,Sl=cn.ReactCurrentDispatcher,Ed=cn.ReactCurrentOwner,vt=cn.ReactCurrentBatchConfig,oe=0,Pe=null,Ne=null,Ie=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&&Ie!==0?Ie&-Ie:Iw.transition!==null?(Wo===0&&(Wo=V0()),Wo):(e=ce,e!==0||(e=window.event,e=e===void 0?16:K0(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,Ie)),et(e,r),n===1&&oe===0&&!(t.mode&1)&&(Si=_e()+500,Ul&&Gn()))}function et(e,t){var n=e.callbackNode;I1(e,t);var r=ol(e,e===Pe?Ie: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)):mm(Sh.bind(null,e)),jw(function(){!(oe&6)&&Gn()}),n=null;else{switch(U0(r)){case 1:n=Gc;break;case 4:n=H0;break;case 16:n=sl;break;case 536870912:n=B0;break;default:n=sl}n=hg(n,og.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function og(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?Ie: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=ag();(Pe!==e||Ie!==t)&&(Xt=null,Si=_e()+500,hr(e,t));do try{Jw();break}catch(l){lg(e,l)}while(!0);cd(),Sl.current=s,oe=i,Ne!==null?t=0:(Pe=null,Ie=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)&&!Gw(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*Kw(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?og.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 Gw(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(!Tt(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,bw(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),Ie=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 lg(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=Ie,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,f=l,c=f.tag;if(!(f.mode&1)&&(c===0||c===11||c===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.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 y=t.updateQueue;if(y===null){var x=new Set;x.add(a),t.updateQueue=x}else y.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 k=ah(o);if(k!==null){!(k.flags&65536)&&(k.flags|=256),uh(k,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=Um(s,a,t);th(s,m);break e;case 1:l=a;var v=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Vn===null||!Vn.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=Qm(s,l,t);th(s,w);break e}}s=s.return}while(s!==null)}cg(n)}catch(_){t=_,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(!0)}function ag(){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,Ie)}function _l(e,t){var n=oe;oe|=2;var r=ag();(Pe!==e||Ie!==t)&&(Xt=null,hr(e,t));do try{Zw();break}catch(i){lg(e,i)}while(!0);if(cd(),oe=n,Sl.current=r,Ne!==null)throw Error(B(261));return Pe=null,Ie=0,je}function Zw(){for(;Ne!==null;)ug(Ne)}function Jw(){for(;Ne!==null&&!_1();)ug(Ne)}function ug(e){var t=fg(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?cg(e):Ne=t,Ed.current=null}function cg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Ww(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=Qw(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,eS(e,t,n,r)}finally{vt.transition=i,ce=r}return null}function eS(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(R1(e,s),e===Pe&&(Ne=Pe=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Eo||(Eo=!0,hg(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,Xw(e,n),ig(n,e),ww(Wu),ll=!!Qu,Wu=Qu=null,e.current=n,Yw(n),N1(),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),j1(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=U0(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 c=f.child;if(c!==null)c.return=f,W=c;else for(;W!==null;){f=W;var d=f.sibling,h=f.return;if(tg(f),f===u){W=null;break}if(d!==null){d.return=h,W=d;break}W=h}}}var y=s.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var k=x.sibling;x.sibling=null,x=k}while(x!==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 v=e.current;for(W=v;W!==null;){o=W;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,W=g;else e:for(o=v;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=Um(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=Qm(t,e,1),t=Bn(t,e,1),e=Ue(),t!==null&&(Ys(t,1,e),et(t,e));break}}t=t.return}}function tS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ue(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Ie&n)===n&&(je===4||je===3&&(Ie&130023424)===Ie&&500>_e()-Nd?hr(e,0):_d|=n),et(e,t)}function dg(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 nS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dg(e,n)}function rS(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),dg(e,n)}var fg;fg=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,Uw(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,me&&t.flags&1048576&&gm(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=sS(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(Ym(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,i=s.element,km(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=wm(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 Em(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),Xm(e,t),Ve(e,t,o,n),t.child;case 6:return e===null&&Zu(t),null;case 13:return Km(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(Tt(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 Wm(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),Vm(t,r,i),tc(t,r,i,n),ic(null,t,r,!0,e,n);case 19:return Gm(e,t,n);case 22:return qm(e,t,n)}throw Error(B(156,t.tag))};function hg(e,t){return F0(e,t)}function iS(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 iS(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sS(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 E0:return Yl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S0:o=10;break e;case k0: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=E0,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 oS(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 oS(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 lS(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 pg(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 pm(e,n,t)}return t}function mg(e,t,n,r,i,s,o,l,a){return e=Pd(n,r,!0,e,i,s,o,l,a),e.context=pg(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=pg(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 aS(){return null}var gg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Td(e){this._internalRoot=e}Gl.prototype.render=Td.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Kl(e,t,null,null)};Gl.prototype.unmount=Td.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=q0();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&&Y0(e)}};function Id(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 uS(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=mg(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=uS(n,t,e,i,r);return Nl(o)}Q0=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)}};W0=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)}};q0=function(){return ce};X0=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));N0(r),Pu(r,i)}}}break;case"textarea":b0(e,n);break;case"select":t=n.value,t!=null&&Qr(e,!!n.multiple,t,!1)}};R0=Cd;$0=Er;var cS={usingClientEntryPoint:!1,Events:[Gs,$r,Vl,T0,I0,Cd]},Qi={findFiberByHostInstance:tr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dS={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=A0(e),e===null?null:e.stateNode},findFiberByHostInstance:Qi.findFiberByHostInstance||aS,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(dS),Bt=_o}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cS;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Id(t))throw Error(B(200));return lS(e,t,null,n)};ut.createRoot=function(e,t){if(!Id(e))throw Error(B(299));var n=!1,r="",i=gg;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 Td(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=A0(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(!Id(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=gg;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=mg(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 yg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yg)}catch(e){console.error(e)}}yg(),y0.exports=ut;var fS=y0.exports,vg,Nh=fS;vg=Nh.createRoot,Nh.hydrateRoot;function hS(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function pS(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(c=>c.at),l=o.length?o.reduce((c,d)=>d<c?d:c,Number.POSITIVE_INFINITY):void 0,u=hS((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 xg(){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(xg()+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(`${xg()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function mS(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 It={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function wg(e){return p.jsxs("svg",{...It,...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 gS(e){return p.jsxs("svg",{...It,...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 yS(e){return p.jsxs("svg",{...It,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"13",r:"8"}),p.jsx("path",{d:"M12 13V9M9 2h6"})]})}function vS(e){return p.jsxs("svg",{...It,...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 Sg(e){return p.jsx("svg",{...It,...e,"aria-hidden":!0,children:p.jsx("path",{d:"m4 12 5 5L20 6"})})}function ki(e){return p.jsx("svg",{...It,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function xS(e){return p.jsxs("svg",{...It,...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",{...It,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function kg(e){return p.jsx("svg",{...It,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function wS(e){return p.jsx("svg",{...It,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 4l14 8-14 8z"})})}function Od(e){return p.jsxs("svg",{...It,...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 SS={local:wg,remote:gS,sleep:yS,signal:vS,child:Od};function Dd(e){return SS[e]??wg}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 Eg(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const kS={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"},ES={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Ad({run:e,timeline:t,depth:n,selected:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l}){const{span:a,rows:u}=R.useMemo(()=>{const h=t.map(_=>new Date(_.startedAt).getTime()),y=t.map(_=>new Date(_.finishedAt).getTime()),x=Math.min(new Date(e.createdAt).getTime(),...h),k=e.status==="running"||e.status==="suspended",m=Math.max(...y,k?Date.now():x+1),v=Math.max(m-x,1);let g=x;const w=t.map(_=>{const P=new Date(_.finishedAt).getTime(),N=g;g=P;const b=new Date(_.startedAt).getTime();let z=b;const T=(_.events??[]).filter(D=>D.status).sort((D,L)=>D.at-L.at).map((D,L)=>{const F=Math.min(Math.max(D.at,b),P),E=z;return z=F,{key:`${D.name??"sub"}-${D.at}-${L}`,name:D.name??"sub-process",status:D.status,left:(E-x)/v*100,width:Math.max((F-E)/v*100,.8),ms:F-E}});return{step:_,left:(N-x)/v*100,width:Math.max((P-N)/v*100,.8),ms:P-N,subRows:T}});return{span:v,rows:w}},[e,t]),[f,c]=R.useState(new Set),d=h=>c(y=>{const x=new Set(y);return x.has(h)?x.delete(h):x.add(h),x});return p.jsx(p.Fragment,{children:u.map(({step:h,left:y,width:x,ms:k,subRows:m})=>{const v=h.status==="failed",g=$d(h),w=!!g,_=w?Od:Dd(h.kind),P=r===h.seq,N=w&&g!==void 0&&o.has(g),b=m.length>0&&!w,z=f.has(h.seq);return p.jsxs("div",{children:[p.jsxs("button",{type:"button",onClick:()=>i(h.seq),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 ${P?"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:T=>{T.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:T=>{T.stopPropagation(),d(h.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:z?`Show ${m.length} sub-process(es)`:"Hide sub-processes",children:p.jsx("span",{className:"inline-block transition-transform",style:{transform:z?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),p.jsx("span",{className:v?"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:T=>{T.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] ${v?"bg-red-500/35 ring-1 ring-red-500/50":P?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${y}%`,width:`${x}%`}}),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(${y+x}%, calc(100% - 44px))`},children:Eg(k)})]})]}),m.length>0&&!z&&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(T=>p.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${T.name} — ${T.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 ${ES[T.status]}`}),p.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:T.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] ${kS[T.status]}`,style:{left:`${T.left}%`,width:`${T.width}%`}})]})]},T.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(_S,{id:g,depth:n+1,selected:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l})})]},h.seq)})})}function _S({id:e,depth:t,selected: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,selected: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 NS({run:e,timeline:t,selected:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o}){const l=R.useMemo(()=>{const f=t.map(x=>new Date(x.startedAt).getTime()),c=t.map(x=>new Date(x.finishedAt).getTime()),d=Math.min(new Date(e.createdAt).getTime(),...f),h=e.status==="running"||e.status==="suspended",y=Math.max(...c,h?Date.now():d+1);return Math.max(y-d,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 ",Eg(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,selected: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 _g={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"},CS={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},bS=["ok","failed","skipped"];function Ng({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 ${CS[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?_g[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(Ng,{e:u},`${u.at}-${f}`))})]})]})}function jS({events:e}){const{subs:t,stepLogs:n}=pS(e),r=bS.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:_g[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(Ng,{e:s},`${s.at}-${o}`))})]})]})}function MS({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(Sg,{width:11,height:11}):p.jsx(xS,{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(MS,{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 PS({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 zS({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),c=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}`}),c>=1&&p.jsx(gn,{k:"queued",v:p.jsx("span",{className:"text-sky-300",children:Cl(c)})}),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(kg,{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(jS,{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(d=>!d),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(PS,{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 IS={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 RS(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=RS(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=$S(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 $S(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]=IS,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 OS(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 DS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cg(e){var t=ta(e);return(t.local?DS:OS)(t)}function AS(){}function Fd(e){return e==null?AS:function(){return this.querySelector(e)}}function LS(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 FS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function HS(){return[]}function bg(e){return e==null?HS:function(){return this.querySelectorAll(e)}}function BS(e){return function(){return FS(e.apply(this,arguments))}}function VS(e){typeof e=="function"?e=BS(e):e=bg(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 jg(e){return function(){return this.matches(e)}}function Mg(e){return function(t){return t.matches(e)}}var US=Array.prototype.find;function QS(e){return function(){return US.call(this.children,e)}}function WS(){return this.firstElementChild}function qS(e){return this.select(e==null?WS:QS(typeof e=="function"?e:Mg(e)))}var XS=Array.prototype.filter;function YS(){return Array.from(this.children)}function KS(e){return function(){return XS.call(this.children,e)}}function GS(e){return this.selectAll(e==null?YS:KS(typeof e=="function"?e:Mg(e)))}function ZS(e){typeof e!="function"&&(e=jg(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 Pg(e){return new Array(e.length)}function JS(){return new at(this._enter||this._groups.map(Pg),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 ek(e){return function(){return e}}function tk(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 nk(e,t,n,r,i,s,o){var l,a,u=new Map,f=t.length,c=s.length,d=new Array(f),h;for(l=0;l<f;++l)(a=t[l])&&(d[l]=h=o.call(a,a.__data__,l,t)+"",u.has(h)?i[l]=a:u.set(h,a));for(l=0;l<c;++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(d[l])===a&&(i[l]=a)}function rk(e){return e.__data__}function ik(e,t){if(!arguments.length)return Array.from(this,rk);var n=t?nk:tk,r=this._parents,i=this._groups;typeof e!="function"&&(e=ek(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],c=i[u],d=c.length,h=sk(e.call(f,f&&f.__data__,u,r)),y=h.length,x=l[u]=new Array(y),k=o[u]=new Array(y),m=a[u]=new Array(d);n(f,c,x,k,m,h,t);for(var v=0,g=0,w,_;v<y;++v)if(w=x[v]){for(v>=g&&(g=v+1);!(_=k[g])&&++g<y;);w._next=_||null}}return o=new at(o,r),o._enter=l,o._exit=a,o}function sk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ok(){return new at(this._exit||this._groups.map(Pg),this._parents)}function lk(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 ak(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],c=u.length,d=l[a]=new Array(c),h,y=0;y<c;++y)(h=u[y]||f[y])&&(d[y]=h);for(;a<i;++a)l[a]=n[a];return new at(l,this._parents)}function uk(){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 ck(e){e||(e=dk);function t(c,d){return c&&d?e(c.__data__,d.__data__):!c-!d}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 dk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function fk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hk(){return Array.from(this)}function pk(){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 mk(){let e=0;for(const t of this)++e;return e}function gk(){return!this.node()}function yk(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 vk(e){return function(){this.removeAttribute(e)}}function xk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wk(e,t){return function(){this.setAttribute(e,t)}}function Sk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kk(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ek(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 _k(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?xk:vk:typeof t=="function"?n.local?Ek:kk:n.local?Sk:wk)(n,t))}function zg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nk(e){return function(){this.style.removeProperty(e)}}function Ck(e,t,n){return function(){this.style.setProperty(e,t,n)}}function bk(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function jk(e,t,n){return arguments.length>1?this.each((t==null?Nk:typeof t=="function"?bk:Ck)(e,t,n??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||zg(e).getComputedStyle(e,null).getPropertyValue(t)}function Mk(e){return function(){delete this[e]}}function Pk(e,t){return function(){this[e]=t}}function zk(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?Mk:typeof t=="function"?zk:Pk)(e,t)):this.node()[e]}function Tg(e){return e.trim().split(/^|\s+/)}function Hd(e){return e.classList||new Ig(e)}function Ig(e){this._node=e,this._names=Tg(e.getAttribute("class")||"")}Ig.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 Rg(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function $g(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ik(e){return function(){Rg(this,e)}}function Rk(e){return function(){$g(this,e)}}function $k(e,t){return function(){(t.apply(this,arguments)?Rg:$g)(this,e)}}function Ok(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"?$k:t?Ik:Rk)(n,t))}function Dk(){this.textContent=""}function Ak(e){return function(){this.textContent=e}}function Lk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fk(e){return arguments.length?this.each(e==null?Dk:(typeof e=="function"?Lk:Ak)(e)):this.node().textContent}function Hk(){this.innerHTML=""}function Bk(e){return function(){this.innerHTML=e}}function Vk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Uk(e){return arguments.length?this.each(e==null?Hk:(typeof e=="function"?Vk:Bk)(e)):this.node().innerHTML}function Qk(){this.nextSibling&&this.parentNode.appendChild(this)}function Wk(){return this.each(Qk)}function qk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Xk(){return this.each(qk)}function Yk(e){var t=typeof e=="function"?e:Cg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Kk(){return null}function Gk(e,t){var n=typeof e=="function"?e:Cg(e),r=t==null?Kk:typeof t=="function"?t:Fd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Zk(){var e=this.parentNode;e&&e.removeChild(this)}function Jk(){return this.each(Zk)}function e2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function n2(e){return this.select(e?t2:e2)}function r2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function i2(e){return function(t){e.call(this,t,this.__data__)}}function s2(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 o2(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 l2(e,t,n){return function(){var r=this.__on,i,s=i2(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 a2(e,t,n){var r=s2(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?l2:o2,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function Og(e,t,n){var r=zg(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 u2(e,t){return function(){return Og(this,e,t)}}function c2(e,t){return function(){return Og(this,e,t.apply(this,arguments))}}function d2(e,t){return this.each((typeof t=="function"?c2:u2)(e,t))}function*f2(){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 Dg=[null];function at(e,t){this._groups=e,this._parents=t}function Js(){return new at([[document.documentElement]],Dg)}function h2(){return this}at.prototype=Js.prototype={constructor:at,select:LS,selectAll:VS,selectChild:qS,selectChildren:GS,filter:ZS,data:ik,enter:JS,exit:ok,join:lk,merge:ak,selection:h2,order:uk,sort:ck,call:fk,nodes:hk,node:pk,size:mk,empty:gk,each:yk,attr:_k,style:jk,property:Tk,classed:Ok,text:Fk,html:Uk,raise:Wk,lower:Xk,append:Yk,insert:Gk,remove:Jk,clone:n2,datum:r2,on:a2,dispatch:d2,[Symbol.iterator]:f2};function it(e){return typeof e=="string"?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],Dg)}function p2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nt(e,t){if(e=p2(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 m2={passive:!1},zs={capture:!0,passive:!1};function Ka(e){e.stopImmediatePropagation()}function Gr(e){e.preventDefault(),e.stopImmediatePropagation()}function Ag(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 Lg(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 g2(e){return!e.ctrlKey&&!e.button}function y2(){return this.parentNode}function v2(e,t){return t??{x:e.x,y:e.y}}function x2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fg(){var e=g2,t=y2,n=v2,r=x2,i={},s=ea("start","drag","end"),o=0,l,a,u,f,c=0;function d(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",k).on("touchmove.drag",m,m2).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,_){if(!(f||!e.call(this,w,_))){var P=g(this,t.call(this,w,_),w,_,"mouse");P&&(it(w.view).on("mousemove.drag",y,zs).on("mouseup.drag",x,zs),Ag(w.view),Ka(w),u=!1,l=w.clientX,a=w.clientY,P("start",w))}}function y(w){if(Gr(w),!u){var _=w.clientX-l,P=w.clientY-a;u=_*_+P*P>c}i.mouse("drag",w)}function x(w){it(w.view).on("mousemove.drag mouseup.drag",null),Lg(w.view,u),Gr(w),i.mouse("end",w)}function k(w,_){if(e.call(this,w,_)){var P=w.changedTouches,N=t.call(this,w,_),b=P.length,z,T;for(z=0;z<b;++z)(T=g(this,N,w,_,P[z].identifier,P[z]))&&(Ka(w),T("start",w,P[z]))}}function m(w){var _=w.changedTouches,P=_.length,N,b;for(N=0;N<P;++N)(b=i[_[N].identifier])&&(Gr(w),b("drag",w,_[N]))}function v(w){var _=w.changedTouches,P=_.length,N,b;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),N=0;N<P;++N)(b=i[_[N].identifier])&&(Ka(w),b("end",w,_[N]))}function g(w,_,P,N,b,z){var T=s.copy(),D=Nt(z||P,_),L,F,E;if((E=n.call(w,new vc("beforestart",{sourceEvent:P,target:d,identifier:b,active:o,x:D[0],y:D[1],dx:0,dy:0,dispatch:T}),N))!=null)return L=E.x-D[0]||0,F=E.y-D[1]||0,function $(M,O,S){var j=D,I;switch(M){case"start":i[b]=$,I=o++;break;case"end":delete i[b],--o;case"drag":D=Nt(S||O,_),I=o;break}T.call(M,w,new vc(M,{sourceEvent:O,subject:E,target:d,identifier:b,active:I,x:D[0]+L,y:D[1]+F,dx:D[0]-j[0],dy:D[1]-j[1],dispatch:T}),N)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:No(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:No(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:No(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:No(!!w),d):r},d.on=function(){var w=s.on.apply(s,arguments);return w===s?d:w},d.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,d):Math.sqrt(c)},d}function Bd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function eo(){}var Ts=.7,Ml=1/Ts,Zr="\\s*([+-]?\\d+)\\s*",Is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",w2=/^#([0-9a-f]{3,8})$/,S2=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),k2=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),E2=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Is}\\)$`),_2=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Is}\\)$`),N2=new RegExp(`^hsl\\(${Is},${Ut},${Ut}\\)$`),C2=new RegExp(`^hsla\\(${Is},${Ut},${Ut},${Is}\\)$`),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:Th,formatHex:Th,formatHex8:b2,formatHsl:j2,formatRgb:Ih,toString:Ih});function Th(){return this.rgb().formatHex()}function b2(){return this.rgb().formatHex8()}function j2(){return Bg(this).formatHsl()}function Ih(){return this.rgb().formatRgb()}function Rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=w2.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=S2.exec(e))?new Ge(t[1],t[2],t[3],1):(t=k2.exec(e))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=E2.exec(e))?Co(t[1],t[2],t[3],t[4]):(t=_2.exec(e))?Co(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=N2.exec(e))?Dh(t[1],t[2]/100,t[3]/100,1):(t=C2.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 M2(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?M2(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,Hg(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?Ts:Math.pow(Ts,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:P2,formatRgb:Oh,toString:Oh}));function $h(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function P2(){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 Bg(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 z2(e,t,n,r){return arguments.length===1?Bg(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,z2,Hg(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?Ts:Math.pow(Ts,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 Vg=e=>()=>e;function T2(e,t){return function(n){return e+n*t}}function I2(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 R2(e){return(e=+e)==1?Ug:function(t,n){return n-t?I2(t,n,e):Vg(isNaN(t)?n:t)}}function Ug(e,t){var n=t-e;return n?T2(e,n):Vg(isNaN(e)?t:e)}const Lh=function e(t){var n=R2(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=Ug(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 $2(e){return function(){return e}}function O2(e){return function(t){return e(t)+""}}function D2(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]?O2(a[0].x):$2(t):(t=a.length,function(u){for(var f=0,c;f<t;++f)l[(c=a[f]).i]=c.x(u);return l.join("")})}var Fh=180/Math.PI,Sc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Qg(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 A2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Sc:Qg(t.a,t.b,t.c,t.d,t.e,t.f)}function L2(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,Qg(e.a,e.b,e.c,e.d,e.e,e.f))}function Wg(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,f,c,d,h,y){if(u!==c||f!==d){var x=h.push("translate(",null,t,null,n);y.push({i:x-4,x:kn(u,c)},{i:x-2,x:kn(f,d)})}else(c||d)&&h.push("translate("+c+t+d+n)}function o(u,f,c,d){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),d.push({i:c.push(i(c)+"rotate(",null,r)-2,x:kn(u,f)})):f&&c.push(i(c)+"rotate("+f+r)}function l(u,f,c,d){u!==f?d.push({i:c.push(i(c)+"skewX(",null,r)-2,x:kn(u,f)}):f&&c.push(i(c)+"skewX("+f+r)}function a(u,f,c,d,h,y){if(u!==c||f!==d){var x=h.push(i(h)+"scale(",null,",",null,")");y.push({i:x-4,x:kn(u,c)},{i:x-2,x:kn(f,d)})}else(c!==1||d!==1)&&h.push(i(h)+"scale("+c+","+d+")")}return function(u,f){var c=[],d=[];return u=e(u),f=e(f),s(u.translateX,u.translateY,f.translateX,f.translateY,c,d),o(u.rotate,f.rotate,c,d),l(u.skewX,f.skewX,c,d),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,d),u=f=null,function(h){for(var y=-1,x=d.length,k;++y<x;)c[(k=d[y]).i]=k.x(h);return c.join("")}}}var F2=Wg(A2,"px, ","px)","deg)"),H2=Wg(L2,", ",")",")"),B2=1e-12;function Hh(e){return((e=Math.exp(e))+1/e)/2}function V2(e){return((e=Math.exp(e))-1/e)/2}function U2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Q2=function e(t,n,r){function i(s,o){var l=s[0],a=s[1],u=s[2],f=o[0],c=o[1],d=o[2],h=f-l,y=c-a,x=h*h+y*y,k,m;if(x<B2)m=Math.log(d/u)/t,k=function(N){return[l+N*h,a+N*y,u*Math.exp(t*N*m)]};else{var v=Math.sqrt(x),g=(d*d-u*u+r*x)/(2*u*n*v),w=(d*d-u*u-r*x)/(2*d*n*v),_=Math.log(Math.sqrt(g*g+1)-g),P=Math.log(Math.sqrt(w*w+1)-w);m=(P-_)/t,k=function(N){var b=N*m,z=Hh(_),T=u/(n*v)*(z*U2(t*b+_)-V2(_));return[l+T*h,a+T*y,u*z/Hh(t*b+_)]}}return k.duration=m*1e3*t/Math.SQRT2,k}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,qg=1e3,zl,ts,Tl=0,_r=0,na=0,$s=typeof performance=="object"&&performance.now?performance:Date,Xg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vd(){return _r||(Xg(W2),_r=$s.now()+na)}function W2(){_r=0}function Il(){this._call=this._time=this._next=null}Il.prototype=Yg.prototype={constructor:Il,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 Yg(e,t,n){var r=new Il;return r.restart(e,t,n),r}function q2(){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=(Tl=$s.now())+na,_i=es=0;try{q2()}finally{_i=0,Y2(),_r=0}}function X2(){var e=$s.now(),t=e-Tl;t>qg&&(na-=t,Tl=e)}function Y2(){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||(Tl=$s.now(),Wi=setInterval(X2,qg)),_i=1,Xg(Bh))}}function Vh(e,t,n){var r=new Il;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var K2=ea("start","end","cancel","interrupt"),G2=[],Kg=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;Z2(e,n,{name:t,index:r,group:i,on:K2,tween:G2,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Kg})}function Ud(e,t){var n=Rt(e,t);if(n.state>Kg)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 Z2(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Yg(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,c,d,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(d=n.tween.length),f=0,c=-1;f<d;++f)(h=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+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),c=-1,d=i.length;++c<d;)i[c].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 J2(e){return this.each(function(){Go(this,e)})}function eE(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 tE(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 nE(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?eE:tE)(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 Gg(e,t){var n;return(typeof t=="number"?kn:t instanceof Rs?Lh:(n=Rs(t))?(t=n,Lh):D2)(e,t)}function rE(e){return function(){this.removeAttribute(e)}}function iE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sE(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 oE(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 lE(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 aE(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 uE(e,t){var n=ta(e),r=n==="transform"?H2:Gg;return this.attrTween(e,typeof t=="function"?(n.local?aE:lE)(n,r,Qd(this,"attr."+e,t)):t==null?(n.local?iE:rE)(n):(n.local?oE:sE)(n,r,t))}function cE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function dE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function fE(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 hE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&cE(e,s)),n}return i._value=t,i}function pE(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?fE:hE)(r,t))}function mE(e,t){return function(){Ud(this,e).delay=+t.apply(this,arguments)}}function gE(e,t){return t=+t,function(){Ud(this,e).delay=t}}function yE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mE:gE)(t,e)):Rt(this.node(),t).delay}function vE(e,t){return function(){Qt(this,e).duration=+t.apply(this,arguments)}}function xE(e,t){return t=+t,function(){Qt(this,e).duration=t}}function wE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vE:xE)(t,e)):Rt(this.node(),t).duration}function SE(e,t){if(typeof t!="function")throw new Error;return function(){Qt(this,e).ease=t}}function kE(e){var t=this._id;return arguments.length?this.each(SE(t,e)):Rt(this.node(),t).ease}function EE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qt(this,e).ease=n}}function _E(e){if(typeof e!="function")throw new Error;return this.each(EE(this._id,e))}function NE(e){typeof e!="function"&&(e=jg(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 CE(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,c=o[l]=new Array(f),d,h=0;h<f;++h)(d=a[h]||u[h])&&(c[h]=d);for(;l<r;++l)o[l]=t[l];return new un(o,this._parents,this._name,this._id)}function bE(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 jE(e,t,n){var r,i,s=bE(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 ME(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(jE(n,e,t))}function PE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function zE(){return this.on("end.remove",PE(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,c,d=0;d<a;++d)(f=l[d])&&(c=e.call(f,f.__data__,d,l))&&("__data__"in f&&(c.__data__=f.__data__),u[d]=c,ra(u[d],t,n,d,u,Rt(f,n)));return new un(s,this._parents,t,n)}function IE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bg(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,c=0;c<u;++c)if(f=a[c]){for(var d=e.call(f,f.__data__,c,a),h,y=Rt(f,n),x=0,k=d.length;x<k;++x)(h=d[x])&&ra(h,t,n,x,d,y);s.push(d),o.push(f)}return new un(s,o,t,n)}var RE=Js.prototype.constructor;function $E(){return new RE(this._groups,this._parents)}function OE(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 Zg(e){return function(){this.style.removeProperty(e)}}function DE(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 AE(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 LE(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=Zg(t)):void 0;(u!==n||i!==f)&&(r=(n=u).copy()).on(o,i=f),a.on=r}}function FE(e,t,n){var r=(e+="")=="transform"?F2:Gg;return t==null?this.styleTween(e,OE(e,r)).on("end.style."+e,Zg(e)):typeof t=="function"?this.styleTween(e,AE(e,r,Qd(this,"style."+e,t))).each(LE(this._id,e)):this.styleTween(e,DE(e,r,t),n).on("end.style."+e,null)}function HE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function BE(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&HE(e,o,n)),r}return s._value=t,s}function VE(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,BE(e,t,n??""))}function UE(e){return function(){this.textContent=e}}function QE(e){return function(){var t=e(this);this.textContent=t??""}}function WE(e){return this.tween("text",typeof e=="function"?QE(Qd(this,"text",e)):UE(e==null?"":e+""))}function qE(e){return function(t){this.textContent=e.call(this,t)}}function XE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&qE(i)),t}return r._value=e,r}function YE(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,XE(e))}function KE(){for(var e=this._name,t=this._id,n=Jg(),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 GE(){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 ZE=0;function un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Jg(){return++ZE}var Wt=Js.prototype;un.prototype={constructor:un,select:TE,selectAll:IE,selectChild:Wt.selectChild,selectChildren:Wt.selectChildren,filter:NE,merge:CE,selection:$E,transition:KE,call:Wt.call,nodes:Wt.nodes,node:Wt.node,size:Wt.size,empty:Wt.empty,each:Wt.each,on:ME,attr:uE,attrTween:pE,style:FE,styleTween:VE,text:WE,textTween:YE,remove:zE,tween:nE,delay:yE,duration:wE,ease:kE,easeVarying:_E,end:GE,[Symbol.iterator]:Wt[Symbol.iterator]};function JE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var e_={time:null,delay:0,duration:250,ease:JE};function t_(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function n_(e){var t,n;e instanceof un?(t=e._id,e=e._name):(t=Jg(),(n=e_).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||t_(a,t));return new un(r,this._parents,e,t)}Js.prototype.interrupt=J2;Js.prototype.transition=n_;const Mo=e=>()=>e;function r_(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);ey.prototype=Jt.prototype;function ey(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 i_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function s_(){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 o_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function l_(){return navigator.maxTouchPoints||"ontouchstart"in this}function a_(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 ty(){var e=i_,t=s_,n=a_,r=o_,i=l_,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Q2,u=ea("start","zoom","end"),f,c,d,h=500,y=150,x=0,k=10;function m(E){E.property("__zoom",Wh).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,$,M,O){var S=E.selection?E.selection():E;S.property("__zoom",Wh),E!==S?_(E,$,M,O):S.interrupt().each(function(){P(this,arguments).event(O).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},m.scaleBy=function(E,$,M,O){m.scaleTo(E,function(){var S=this.__zoom.k,j=typeof $=="function"?$.apply(this,arguments):$;return S*j},M,O)},m.scaleTo=function(E,$,M,O){m.transform(E,function(){var S=t.apply(this,arguments),j=this.__zoom,I=M==null?w(S):typeof M=="function"?M.apply(this,arguments):M,A=j.invert(I),H=typeof $=="function"?$.apply(this,arguments):$;return n(g(v(j,H),I,A),S,o)},M,O)},m.translateBy=function(E,$,M,O){m.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,O)},m.translateTo=function(E,$,M,O,S){m.transform(E,function(){var j=t.apply(this,arguments),I=this.__zoom,A=O==null?w(j):typeof O=="function"?O.apply(this,arguments):O;return n(ia.translate(A[0],A[1]).scale(I.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof M=="function"?-M.apply(this,arguments):-M),j,o)},O,S)};function v(E,$){return $=Math.max(s[0],Math.min(s[1],$)),$===E.k?E:new Jt($,E.x,E.y)}function g(E,$,M){var O=$[0]-M[0]*E.k,S=$[1]-M[1]*E.k;return O===E.x&&S===E.y?E:new Jt(E.k,O,S)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function _(E,$,M,O){E.on("start.zoom",function(){P(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(O).end()}).tween("zoom",function(){var S=this,j=arguments,I=P(S,j).event(O),A=t.apply(S,j),H=M==null?w(A):typeof M=="function"?M.apply(S,j):M,K=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),Q=S.__zoom,X=typeof $=="function"?$.apply(S,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)}I.zoom(null,Z)}})}function P(E,$,M){return!M&&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 r_(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),$)}};function b(E,...$){if(!e.apply(this,arguments))return;var M=P(this,$).event(E),O=this.__zoom,S=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,r.apply(this,arguments)))),j=Nt(E);if(M.wheel)(M.mouse[0][0]!==j[0]||M.mouse[0][1]!==j[1])&&(M.mouse[1]=O.invert(M.mouse[0]=j)),clearTimeout(M.wheel);else{if(O.k===S)return;M.mouse=[j,O.invert(j)],Go(this),M.start()}qi(E),M.wheel=setTimeout(I,y),M.zoom("mouse",n(g(v(O,S),M.mouse[0],M.mouse[1]),M.extent,o));function I(){M.wheel=null,M.end()}}function z(E,...$){if(d||!e.apply(this,arguments))return;var M=E.currentTarget,O=P(this,$,!0).event(E),S=it(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",K,!0),j=Nt(E,M),I=E.clientX,A=E.clientY;Ag(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-I,q=Q.clientY-A;O.moved=X*X+q*q>x}O.event(Q).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=Nt(Q,M),O.mouse[1]),O.extent,o))}function K(Q){S.on("mousemove.zoom mouseup.zoom",null),Lg(Q.view,O.moved),qi(Q),O.event(Q).end()}}function T(E,...$){if(e.apply(this,arguments)){var M=this.__zoom,O=Nt(E.changedTouches?E.changedTouches[0]:E,this),S=M.invert(O),j=M.k*(E.shiftKey?.5:2),I=n(g(v(M,j),O,S),t.apply(this,$),o);qi(E),l>0?it(this).transition().duration(l).call(_,I,O,E):it(this).call(m.transform,I,O,E)}}function D(E,...$){if(e.apply(this,arguments)){var M=E.touches,O=M.length,S=P(this,$,E.changedTouches.length===O).event(E),j,I,A,H;for(Ja(E),I=0;I<O;++I)A=M[I],H=Nt(A,this),H=[H,this.__zoom.invert(H),A.identifier],S.touch0?!S.touch1&&S.touch0[2]!==H[2]&&(S.touch1=H,S.taps=0):(S.touch0=H,j=!0,S.taps=1+!!f);f&&(f=clearTimeout(f)),j&&(S.taps<2&&(c=H[0],f=setTimeout(function(){f=null},h)),Go(this),S.start())}}function L(E,...$){if(this.__zooming){var M=P(this,$).event(E),O=E.changedTouches,S=O.length,j,I,A,H;for(qi(E),j=0;j<S;++j)I=O[j],A=Nt(I,this),M.touch0&&M.touch0[2]===I.identifier?M.touch0[0]=A:M.touch1&&M.touch1[2]===I.identifier&&(M.touch1[0]=A);if(I=M.that.__zoom,M.touch1){var K=M.touch0[0],Q=M.touch0[1],X=M.touch1[0],q=M.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;I=v(I,Math.sqrt(Z/U)),A=[(K[0]+X[0])/2,(K[1]+X[1])/2],H=[(Q[0]+q[0])/2,(Q[1]+q[1])/2]}else if(M.touch0)A=M.touch0[0],H=M.touch0[1];else return;M.zoom("touch",n(g(I,A,H),M.extent,o))}}function F(E,...$){if(this.__zooming){var M=P(this,$).event(E),O=E.changedTouches,S=O.length,j,I;for(Ja(E),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),j=0;j<S;++j)I=O[j],M.touch0&&M.touch0[2]===I.identifier?delete M.touch0:M.touch1&&M.touch1[2]===I.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(I=Nt(I,this),Math.hypot(c[0]-I[0],c[1]-I[1])<k)){var A=it(this).on("dblclick.zoom");A&&A.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?(x=(E=+E)*E,m):Math.sqrt(x)},m.tapDistance=function(E){return arguments.length?(k=+E,m):k},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]],ny=["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 ry={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 iy(e){return e===null?null:e?"valid":"invalid"}const sy=e=>"id"in e&&"source"in e&&"target"in e,u_=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}},c_=(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)},oy=(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:c=!0,hidden:d=!1}=u;if(o&&!c||d)continue;const h=f.width??u.width??u.initialWidth??null,y=f.height??u.height??u.initialHeight??null,x=As(l,bi(u)),k=(h??0)*(y??0),m=s&&x>0;(!u.internals.handleBounds||m||x>=k||u.dragging)&&a.push(u)}return a},d_=(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 ly({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 c=i;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",dn.error005());else{const h=l.measured.width,y=l.measured.height;h&&y&&(c=[[a,u],[a+h,u+y]])}else l&&ji(o.extent)&&(c=[[o.extent[0][0]+a,o.extent[0][1]+u],[o.extent[1][0]+a,o.extent[1][1]+u]]);const d=ji(c)?Nr(t,c,o.measured):t;return{position:{x:d.x-a+o.measured.width*f[0],y:d.y-u+o.measured.height*f[1]},positionAbsolute:d}}async function f_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(d=>d.id)),o=[];for(const d of n){if(d.deletable===!1)continue;const h=s.has(d.id),y=!h&&d.parentId&&o.find(x=>x.id===d.parentId);(h||y)&&o.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),f=d_(o,a);for(const d of a)l.has(d.id)&&!f.find(y=>y.id===d.id)&&f.push(d);if(!i)return{edges:f,nodes:o};const c=await i({nodes:o,edges:f});return typeof c=="boolean"?c?{edges:f,nodes:o}:{edges:[],nodes:[]}:c}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 ay(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,uy=(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)}},cy=(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),h_=(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},dy=({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,c=e.y+e.height/2,d=t/2-f*u,h=n/2-c*u;return{x:d,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 fy(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 hy(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}),py=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},p_=["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 p_.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 my=e=>"clientX"in e,tn=(e,t)=>{var s,o;const n=my(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 gy({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),c=Math.abs(u-t);return[a,u,f,c]}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 yy({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}),[c,d,h,y]=gy({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}`,c,d,h,y]}function vy({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 m_({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 g_({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 y_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,v_=(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)),x_=(e,t)=>{if(!e.source||!e.target)return t;let n;return sy(e)?n={...e}:n={...e,id:y_(e)},v_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function xy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,l]=vy({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}},w_=({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 S_({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=w_({source:a,sourcePosition:t,target:u}),c=f.x!==0?"x":"y",d=f[c];let h=[],y,x;const k={x:0,y:0},m={x:0,y:0},[v,g,w,_]=vy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[c]*l[c]===-1){y=i.x??v,x=i.y??g;const N=[{x:y,y:a.y},{x:y,y:u.y}],b=[{x:a.x,y:x},{x:u.x,y:x}];o[c]===d?h=c==="x"?N:b:h=c==="x"?b:N}else{const N=[{x:a.x,y:u.y}],b=[{x:u.x,y:a.y}];if(c==="x"?h=o.x===d?b:N:h=o.y===d?N:b,t===r){const F=Math.abs(e[c]-n[c]);if(F<=s){const E=Math.min(s-1,s-F);o[c]===d?k[c]=(a[c]>e[c]?-1:1)*E:m[c]=(u[c]>n[c]?-1:1)*E}}if(t!==r){const F=c==="x"?"y":"x",E=o[c]===l[F],$=a[F]>u[F],M=a[F]<u[F];(o[c]===1&&(!E&&$||E&&M)||o[c]!==1&&(!E&&M||E&&$))&&(h=c==="x"?N:b)}const z={x:a.x+k.x,y:a.y+k.y},T={x:u.x+m.x,y:u.y+m.y},D=Math.max(Math.abs(z.x-h[0].x),Math.abs(T.x-h[0].x)),L=Math.max(Math.abs(z.y-h[0].y),Math.abs(T.y-h[0].y));D>=L?(y=(z.x+T.x)/2,x=h[0].y):(y=h[0].x,x=(z.y+T.y)/2)}return[[e,{x:a.x+k.x,y:a.y+k.y},...h,{x:u.x+m.x,y:u.y+m.y},n],y,x,w,_]}function k_(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,c,d,h,y]=S_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:a},offset:u});return[f.reduce((k,m,v)=>{let g="";return v>0&&v<f.length-1?g=k_(f[v-1],m,f[v+1],o):g=`${v===0?"M":"L"}${m.x} ${m.y}`,k+=g,k},""),c,d,h,y]}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_(e){var c;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(c=e.onError)==null||c.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 __(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:{}},N_={...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 C_(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(N_,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 c=to(u,i.nodeOrigin),d=ji(u.extent)?u.extent:i.nodeExtent,h=Nr(c,d,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:wy(u,o),userNode:u}},t.set(u.id,f)}u.parentId&&Kd(f,t,n,r)}}function b_(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}b_(e,n);const u=i?1e3:0,{x:f,y:c,z:d}=j_(e,a,s,o,u),{positionAbsolute:h}=e.internals,y=f!==h.x||c!==h.y;(y||d!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:f,y:c}:h,z:d})}function wy(e,t){return(Mt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function j_(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=ay(f,l,t));const c=wy(e,i),d=t.internals.z??0;return{x:f.x,y:f.y,z:d>c?d:c}}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=cy(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,c=fn(a),d=a.origin??r,h=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,y=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,x=Math.max(c.width,Math.round(l.width)),k=Math.max(c.height,Math.round(l.height)),m=(x-c.width)*d[0],v=(k-c.height)*d[1];(h>0||y>0||m||v)&&(i.push({id:u,type:"position",position:{x:a.position.x-h+m,y:a.position.y-y+v}}),(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+y}})})),(c.width<l.width||c.height<l.height||h||y)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?d[0]*h-m:0),height:k+(y?d[1]*y-v:0)}})}),i}function M_(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),c=[];for(const d of e.values()){const h=t.get(d.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const y=aa(d.nodeElement),x=h.measured.width!==y.width||h.measured.height!==y.height;if(!!(y.width&&y.height&&(x||!h.internals.handleBounds||d.force))){const m=d.nodeElement.getBoundingClientRect(),v=ji(h.extent)?h.extent:s;let{positionAbsolute:g}=h.internals;h.parentId&&h.extent==="parent"?g=ay(g,y,t.get(h.parentId)):v&&(g=Nr(g,v,y)),h.measured=y,h.internals={...h.internals,positionAbsolute:g,handleBounds:{source:Kh("source",d.nodeElement,m,f,h.id),target:Kh("target",d.nodeElement,m,f,h.id)}},h.parentId&&Kd(h,t,n,{nodeOrigin:i}),l=!0,x&&(a.push({id:h.id,type:"dimensions",dimensions:y}),h.expandParent&&h.parentId&&c.push({id:h.id,parentId:h.parentId,rect:bi(h,i)}))}}}if(c.length>0){const d=Gd(c,t,n,i);a.push(...d)}return{changes:a,updatedInternals:l}}async function P_({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 Sy(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,c=e.get(u)||new Map,d={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:l};t.set(r.id,r),e.set(a,f.set(`${s}-${l}`,d)),e.set(u,c.set(`${i}-${o}`,d))}}function ky(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ky(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 z_(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!ky(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 c=(o=n.get(u))==null?void 0:o.internals.userNode;c&&i.push({...c,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,c=!1,d=null,h=!1;function y({noDragClassName:k,handleSelector:m,domNode:v,isSelectable:g,nodeId:w,nodeClickDistance:_=0}){d=it(v);function P({x:T,y:D},L){const{nodeLookup:F,nodeExtent:E,snapGrid:$,snapToGrid:M,nodeOrigin:O,onNodeDrag:S,onSelectionDrag:j,onError:I,updateNodePositions:A}=t();s={x:T,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(!F.has(Q))continue;let q={x:T-X.distance.x,y:D-X.distance.y};M&&(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}=ly({nodeId:Q,nextPosition:q,nodeLookup:F,nodeExtent:Z,nodeOrigin:O,onError:I});H=H||X.position.x!==U.x||X.position.y!==U.y,X.position=U,X.internals.positionAbsolute=te}if(H&&(A(l,!0),L&&(r||S||!w&&j))){const[Q,X]=eu({nodeId:w,dragItems:l,nodeLookup:F});r==null||r(L,l,Q,X),S==null||S(L,Q,X),w||j==null||j(L,X)}}async function N(){if(!f)return;const{transform:T,panBy:D,autoPanSpeed:L}=t(),[F,E]=uy(u,f,L);(F!==0||E!==0)&&(s.x=(s.x??0)-F/T[2],s.y=(s.y??0)-E/T[2],await D({x:F,y:E})&&P(s,null)),o=requestAnimationFrame(N)}function b(T){var H;const{nodeLookup:D,multiSelectionActive:L,nodesDraggable:F,transform:E,snapGrid:$,snapToGrid:M,selectNodesOnDrag:O,onNodeDragStart:S,onSelectionDragStart:j,unselectNodesAndEdges:I}=t();c=!0,(!O||!g)&&!L&&w&&((H=D.get(w))!=null&&H.selected||I()),g&&O&&w&&(e==null||e(w));const A=ds(T.sourceEvent,{transform:E,snapGrid:$,snapToGrid:M,containerBounds:f});if(s=A,l=z_(D,F,A,w),l.size>0&&(n||S||!w&&j)){const[K,Q]=eu({nodeId:w,dragItems:l,nodeLookup:D});n==null||n(T.sourceEvent,l,K,Q),S==null||S(T.sourceEvent,K,Q),w||j==null||j(T.sourceEvent,Q)}}const z=Fg().clickDistance(_).on("start",T=>{const{domNode:D,nodeDragThreshold:L,transform:F,snapGrid:E,snapToGrid:$}=t();f=(D==null?void 0:D.getBoundingClientRect())||null,h=!1,L===0&&b(T),s=ds(T.sourceEvent,{transform:F,snapGrid:E,snapToGrid:$,containerBounds:f}),u=tn(T.sourceEvent,f)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:L,snapGrid:F,snapToGrid:E,nodeDragThreshold:$,nodeLookup:M}=t(),O=ds(T.sourceEvent,{transform:L,snapGrid:F,snapToGrid:E,containerBounds:f});if((T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||w&&!M.has(w))&&(h=!0),!h){if(!a&&D&&c&&(a=!0,N()),!c){const S=O.xSnapped-(s.x??0),j=O.ySnapped-(s.y??0);Math.sqrt(S*S+j*j)>$&&b(T)}(s.x!==O.xSnapped||s.y!==O.ySnapped)&&l&&c&&(u=tn(T.sourceEvent,f),P(O,T.sourceEvent))}}).on("end",T=>{if(!(!c||h)&&(a=!1,c=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:D,updateNodePositions:L,onNodeDragStop:F,onSelectionDragStop:E}=t();if(L(l,!1),i||F||!w&&E){const[$,M]=eu({nodeId:w,dragItems:l,nodeLookup:D,dragging:!1});i==null||i(T.sourceEvent,l,$,M),F==null||F(T.sourceEvent,$,M),w||E==null||E(T.sourceEvent,M)}}}).filter(T=>{const D=T.target;return!T.button&&(!k||!rp(D,`.${k}`,v))&&(!m||rp(D,m,v))});d.call(z)}function x(){d==null||d.on(".drag",null)}return{update:y,destroy:x}}function I_(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 R_=250;function $_(e,t,n,r){var l,a;let i=[],s=1/0;const o=I_(e,n,t+R_);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 c of f){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:d,y:h}=Ls(u,c,c.position,!0),y=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));y>t||(y<s?(i=[{...c,x:d,y:h}],s=y):y===s&&i.push({...c,x:d,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 Ey(e,t,n,r,i,s=!1){var u,f,c;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)??[],...((c=o.internals.handleBounds)==null?void 0:c.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&s?{...a,...Ls(o,a,a.position,!0)}:a}function _y(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function O_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ny=()=>!0;function D_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:f,flowId:c,panBy:d,cancelConnection:h,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:m=Ny,onReconnectEnd:v,updateConnection:g,getTransform:w,getFromHandle:_,autoPanSpeed:P}){const N=py(e.target);let b=0,z;const{x:T,y:D}=tn(e),L=N==null?void 0:N.elementFromPoint(T,D),F=_y(s,L),E=l==null?void 0:l.getBoundingClientRect();if(!E||!F)return;const $=Ey(i,F,r,a,t);if(!$)return;let M=tn(e,E),O=!1,S=null,j=!1,I=null;function A(){if(!f||!E)return;const[te,se]=uy(M,E,P);d({x:te,y:se}),b=requestAnimationFrame(A)}const H={...$,nodeId:i,type:F,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:M,toHandle:null,toPosition:qh[H.position],toNode:null};g(X);let q=X;y==null||y(e,{nodeId:i,handleId:r,handleType:F});function Z(te){if(!_()||!H){U(te);return}const se=w();M=tn(te,E),z=$_(ro(M,se,!1,[1,1]),n,a,H),O||(A(),O=!0);const ne=Cy(te,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:m,doc:N,lib:u,flowId:c,nodeLookup:a});I=ne.handleDomNode,S=ne.connection,j=O_(!!z,ne.isValid);const J={...q,isValid:j,to:z&&j?dy({x:z.x,y:z.y},se):M,toHandle:ne.toHandle,toPosition:j&&ne.toHandle?ne.toHandle.position:qh[H.position],toNode:ne.toHandle?a.get(ne.toHandle.nodeId):null};j&&z&&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){(z||I)&&S&&j&&(x==null||x(S));const{inProgress:se,...ne}=q,J={...ne,toPosition:q.toHandle?q.toPosition:null};k==null||k(te,J),s&&(v==null||v(te,J)),h(),cancelAnimationFrame(b),O=!1,j=!1,S=null,I=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 Cy(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:l,flowId:a,isValidConnection:u=Ny,nodeLookup:f}){const c=s==="target",d=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}=tn(e),x=o.elementFromPoint(h,y),k=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:d,m={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const v=_y(void 0,k),g=k.getAttribute("data-nodeid"),w=k.getAttribute("data-handleid"),_=k.classList.contains("connectable"),P=k.classList.contains("connectableend");if(!g||!v)return m;const N={source:c?g:r,sourceHandle:c?w:i,target:c?r:g,targetHandle:c?i:w};m.connection=N;const z=_&&P&&(n===Ni.Strict?c&&v==="source"||!c&&v==="target":g!==r||w!==i);m.isValid=z&&u(N),m.toHandle=Ey(g,v,w,f,n,!1)}return m}const Tc={onPointerDown:D_,isValid:Cy};function A_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=it(e);function s({translateExtent:l,width:a,height:u,zoomStep:f=10,pannable:c=!0,zoomable:d=!0,inversePan:h=!1}){const y=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,P=w[2]*Math.pow(2,_);t.scaleTo(P)};let x=[0,0];const k=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[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],P=[_[0]-x[0],_[1]-x[1]];x=_;const N=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),b={x:w[0]-P[0]*N,y:w[1]-P[1]*N},z=[[0,0],[a,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},z,l)},v=ty().on("start",k).on("zoom",c?m:null).on("zoom.wheel",d?y:null);i.call(v,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:Nt}}const L_=(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}`),by=(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},jy=e=>{const t=e.ctrlKey&&Ol()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function F_({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 c=n.property("__zoom").k||1;if(f.ctrlKey&&o){const k=Nt(f),m=jy(f),v=c*Math.pow(2,m);r.scaleTo(n,v,k,f);return}const d=f.deltaMode===1?20:1;let h=i===gr.Vertical?0:f.deltaX*d,y=i===gr.Horizontal?0:f.deltaY*d;!Ol()&&f.shiftKey&&i!==gr.Vertical&&(h=f.deltaY*d,y=0),r.translateBy(n,-(h/c)*s,-(y/c)*s,{internal:!0});const x=ua(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,x)),e.isPanScrolling&&(a==null||a(f,x),e.panScrollTimeout=setTimeout(()=>{u==null||u(f,x),e.isPanScrolling=!1},150))}}function H_({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 B_({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 V_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&by(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 U_({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&&by(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&L_(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 Q_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:a,lib:u}){return f=>{var y;const c=e||t,d=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(Br(f,`${u}-flow__node`)||Br(f,`${u}-flow__edge`)))return!0;if(!r&&!c&&!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"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!c&&!i&&!d&&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 W_({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},c=e.getBoundingClientRect(),d=ty().clickDistance(!Mt(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=it(e).call(d);g({x:s.x,y:s.y,zoom:Ci(s.zoom,t,n)},[[0,0],[c.width,c.height]],i);const y=h.on("wheel.zoom"),x=h.on("dblclick.zoom");d.wheelDelta(jy);function k(L,F){return h?new Promise(E=>{d==null||d.transform(nu(h,F==null?void 0:F.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function m({noWheelClassName:L,noPanClassName:F,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:M,panOnDrag:O,panOnScrollMode:S,panOnScrollSpeed:j,preventScrolling:I,zoomOnPinch:A,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:Q,lib:X,onTransformChange:q}){$&&!f.isZoomingOrPanning&&v();const U=M&&!Q&&!$?F_({zoomPanValues:f,noWheelClassName:L,d3Selection:h,d3Zoom:d,panOnScrollMode:S,panOnScrollSpeed:j,zoomOnPinch:A,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:a}):H_({noWheelClassName:L,preventScrolling:I,d3ZoomHandler:y});if(h.on("wheel.zoom",U,{passive:!1}),!$){const se=B_({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:l});d.on("start",se);const ne=V_({zoomPanValues:f,panOnDrag:O,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:q});d.on("zoom",ne);const J=U_({zoomPanValues:f,panOnDrag:O,panOnScroll:M,onPaneContextMenu:E,onPanZoomEnd:a,onDraggingChange:u});d.on("end",J)}const te=Q_({zoomActivationKeyPressed:Q,panOnDrag:O,zoomOnScroll:H,panOnScroll:M,zoomOnDoubleClick:K,zoomOnPinch:A,userSelectionActive:$,noPanClassName:F,noWheelClassName:L,lib:X});d.filter(te),K?h.on("dblclick.zoom",x):h.on("dblclick.zoom",null)}function v(){d.on("zoom",null)}async function g(L,F,E){const $=tu(L),M=d==null?void 0:d.constrain()($,F,E);return M&&await k(M),new Promise(O=>O(M))}async function w(L,F){const E=tu(L);return await k(E,F),new Promise($=>$(E))}function _(L){if(h){const F=tu(L),E=h.property("__zoom");(E.k!==L.zoom||E.x!==L.x||E.y!==L.y)&&(d==null||d.transform(h,F,null,{sync:!0}))}}function P(){const L=h?ey(h.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function N(L,F){return h?new Promise(E=>{d==null||d.scaleTo(nu(h,F==null?void 0:F.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function b(L,F){return h?new Promise(E=>{d==null||d.scaleBy(nu(h,F==null?void 0:F.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function z(L){d==null||d.scaleExtent(L)}function T(L){d==null||d.translateExtent(L)}function D(L){const F=!Mt(L)||L<0?0:L;d==null||d.clickDistance(F)}return{update:m,destroy:v,setViewport:w,setViewportConstrained:g,getViewport:P,scaleTo:N,scaleBy:b,setScaleExtent:z,setTranslateExtent:T,syncViewport:_,setClickDistance:D}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function q_({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 X_(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 Y_(e,t,n,r,i,s,o,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:f,isVertical:c}=t,d=f&&c,{xSnapped:h,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:m,maxHeight:v}=r,{x:g,y:w,width:_,height:P,aspectRatio:N}=e;let b=Math.floor(f?h-e.pointerX:0),z=Math.floor(c?y-e.pointerY:0);const T=_+(a?-b:b),D=P+(u?-z:z),L=-s[0]*_,F=-s[1]*P;let E=zo(T,x,k),$=zo(D,m,v);if(o){let S=0,j=0;a&&b<0?S=yn(g+b+L,o[0][0]):!a&&b>0&&(S=vn(g+T+L,o[1][0])),u&&z<0?j=yn(w+z+F,o[0][1]):!u&&z>0&&(j=vn(w+D+F,o[1][1])),E=Math.max(E,S),$=Math.max($,j)}if(l){let S=0,j=0;a&&b>0?S=vn(g+b,l[0][0]):!a&&b<0&&(S=yn(g+T,l[1][0])),u&&z>0?j=vn(w+z,l[0][1]):!u&&z<0&&(j=yn(w+D,l[1][1])),E=Math.max(E,S),$=Math.max($,j)}if(i){if(f){const S=zo(T/N,m,v)*N;if(E=Math.max(E,S),o){let j=0;!a&&!u||a&&!u&&d?j=vn(w+F+T/N,o[1][1])*N:j=yn(w+F+(a?b:-b)/N,o[0][1])*N,E=Math.max(E,j)}if(l){let j=0;!a&&!u||a&&!u&&d?j=yn(w+T/N,l[1][1])*N:j=vn(w+(a?b:-b)/N,l[0][1])*N,E=Math.max(E,j)}}if(c){const S=zo(D*N,x,k)/N;if($=Math.max($,S),o){let j=0;!a&&!u||u&&!a&&d?j=vn(g+D*N+L,o[1][0])/N:j=yn(g+(u?z:-z)*N+L,o[0][0])/N,$=Math.max($,j)}if(l){let j=0;!a&&!u||u&&!a&&d?j=yn(g+D*N,l[1][0])/N:j=vn(g+(u?z:-z)*N,l[0][0])/N,$=Math.max($,j)}}}z=z+(z<0?$:-$),b=b+(b<0?E:-E),i&&(d?T>D*N?z=(ip(a,u)?-b:b)/N:b=(ip(a,u)?-z:z)*N:f?(z=b/N,u=a):(b=z*N,a=u));const M=a?g+b:g,O=u?w+z:w;return{width:_+(a?-b:b),height:P+(u?-z:z),x:s[0]*b*(a?-1:1)+M,y:s[1]*z*(u?-1:1)+O}}const My={width:0,height:0,x:0,y:0},K_={...My,pointerX:0,pointerY:0,aspectRatio:1};function G_(e){return[[0,0],[e.measured.width,e.measured.height]]}function Z_(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 J_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=it(e);function o({controlPosition:a,boundaries:u,keepAspectRatio:f,onResizeStart:c,onResize:d,onResizeEnd:h,shouldResize:y}){let x={...My},k={...K_};const m=X_(a);let v,g=null,w=[],_,P,N;const b=Fg().on("start",z=>{const{nodeLookup:T,transform:D,snapGrid:L,snapToGrid:F,nodeOrigin:E,paneDomNode:$}=n();if(v=T.get(t),!v)return;g=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:O}=ds(z.sourceEvent,{transform:D,snapGrid:L,snapToGrid:F,containerBounds:g});x={width:v.measured.width??0,height:v.measured.height??0,x:v.position.x??0,y:v.position.y??0},k={...x,pointerX:M,pointerY:O,aspectRatio:x.width/x.height},_=void 0,v.parentId&&(v.extent==="parent"||v.expandParent)&&(_=T.get(v.parentId),P=_&&v.extent==="parent"?G_(_):void 0),w=[],N=void 0;for(const[S,j]of T)if(j.parentId===t&&(w.push({id:S,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const I=Z_(j,v,j.origin??E);N?N=[[Math.min(I[0][0],N[0][0]),Math.min(I[0][1],N[0][1])],[Math.max(I[1][0],N[1][0]),Math.max(I[1][1],N[1][1])]]:N=I}c==null||c(z,{...x})}).on("drag",z=>{const{transform:T,snapGrid:D,snapToGrid:L,nodeOrigin:F}=n(),E=ds(z.sourceEvent,{transform:T,snapGrid:D,snapToGrid:L,containerBounds:g}),$=[];if(!v)return;const{x:M,y:O,width:S,height:j}=x,I={},A=v.origin??F,{width:H,height:K,x:Q,y:X}=Y_(k,m,E,u,f,A,P,N),q=H!==S,Z=K!==j,U=Q!==M&&q,te=X!==O&&Z;if(!U&&!te&&!q&&!Z)return;if((U||te||A[0]===1||A[1]===1)&&(I.x=U?Q:x.x,I.y=te?X:x.y,x.x=I.x,x.y=I.y,w.length>0)){const ae=Q-M,fe=X-O;for(const $e of w)$e.position={x:$e.position.x-ae+A[0]*(H-S),y:$e.position.y-fe+A[1]*(K-j)},$.push($e)}if((q||Z)&&(I.width=q?H:x.width,I.height=Z?K:x.height,x.width=I.width,x.height=I.height),_&&v.expandParent){const ae=A[0]*(I.width??0);I.x&&I.x<ae&&(x.x=ae,k.x=k.x-(I.x-ae));const fe=A[1]*(I.height??0);I.y&&I.y<fe&&(x.y=fe,k.y=k.y-(I.y-fe))}const se=q_({width:x.width,prevWidth:S,height:x.height,prevHeight:j,affectsX:m.affectsX,affectsY:m.affectsY}),ne={...x,direction:se};(y==null?void 0:y(z,ne))!==!1&&(d==null||d(z,ne),r(I,$))}).on("end",z=>{h==null||h(z,{...x}),i==null||i()});s.call(b)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var Py={exports:{}},zy={},Ty={exports:{}},Iy={};/**
|
|
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 eN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tN=typeof Object.is=="function"?Object.is:eN,nN=Mi.useState,rN=Mi.useEffect,iN=Mi.useLayoutEffect,sN=Mi.useDebugValue;function oN(e,t){var n=t(),r=nN({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return iN(function(){i.value=n,i.getSnapshot=t,ru(i)&&s({inst:i})},[e,n,t]),rN(function(){return ru(i)&&s({inst:i}),e(function(){ru(i)&&s({inst:i})})},[e]),sN(n),n}function ru(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tN(e,n)}catch{return!0}}function lN(e,t){return t()}var aN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lN:oN;Iy.useSyncExternalStore=Mi.useSyncExternalStore!==void 0?Mi.useSyncExternalStore:aN;Ty.exports=Iy;var uN=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,cN=uN;function dN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fN=typeof Object.is=="function"?Object.is:dN,hN=cN.useSyncExternalStore,pN=ca.useRef,mN=ca.useEffect,gN=ca.useMemo,yN=ca.useDebugValue;zy.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=pN(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=gN(function(){function a(h){if(!u){if(u=!0,f=h,h=r(h),i!==void 0&&o.hasValue){var y=o.value;if(i(y,h))return c=y}return c=h}if(y=c,fN(f,h))return y;var x=r(h);return i!==void 0&&i(y,x)?(f=h,y):(f=h,c=x)}var u=!1,f,c,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,i]);var l=hN(e,s[0],s[1]);return mN(function(){o.hasValue=!0,o.value=l},[l]),yN(l),l};Py.exports=zy;var vN=Py.exports;const xN=Fp(vN),wN={},sp=e=>{let t;const n=new Set,r=(f,c)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const h=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(y=>y(t,h))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(wN?"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},SN=e=>e?sp(e):sp,{useDebugValue:kN}=Px,{useSyncExternalStoreWithSelector:EN}=xN,_N=e=>e;function Ry(e,t=_N,n){const r=EN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kN(r),r}const op=(e,t)=>{const n=SN(e),r=(i,s=t)=>Ry(n,i,s);return Object.assign(r,n),r},NN=(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),CN=da.Provider,$y=dn.error001();function le(e,t){const n=R.useContext(da);if(n===null)throw new Error($y);return Ry(n,e,t)}function ge(){const e=R.useContext(da);if(e===null)throw new Error($y);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const lp={display:"none"},bN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Oy="react-flow__node-desc",Dy="react-flow__edge-desc",jN="react-flow__aria-live",MN=e=>e.ariaLiveMessage;function PN({rfId:e}){const t=le(MN);return p.jsx("div",{id:`${jN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:bN,children:t})}function zN({rfId:e,disableKeyboardA11y:t}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{id:`${Oy}-${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:`${Dy}-${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(PN,{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 IN({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 RN=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}},To=e=>e.id;function $N(e,t){return Ee(e.selectedNodes.map(To),t.selectedNodes.map(To))&&Ee(e.selectedEdges.map(To),t.selectedEdges.map(To))}function ON({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le(RN,$N);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 DN=e=>!!e.onSelectionChangeHandlers;function AN({onSelectionChange:e}){const t=le(DN);return e||t?p.jsx(ON,{onSelectionChange:e}):null}const Ay=[0,0],LN={x:0,y:0,zoom:1},FN=["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=[...FN,"rfId"],HN=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:Ay,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function BN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=le(HN,Ee),f=ge();R.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=up,l()}),[]);const c=R.useRef(up);return R.useEffect(()=>{for(const d of ap){const h=e[d],y=c.current[d];h!==y&&(typeof e[d]>"u"||(d==="nodes"?t(h):d==="edges"?n(h):d==="minZoom"?r(h):d==="maxZoom"?i(h):d==="translateExtent"?s(h):d==="nodeExtent"?o(h):d==="paneClickDistance"?u(h):d==="fitView"?f.setState({fitViewOnInit:h}):d==="fitViewOptions"?f.setState({fitViewOnInitOptions:h}):f.setState({[d]:h})))}c.current=e},ap.map(d=>e[d])),null}function cp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function VN(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(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),f=u.reduce((c,d)=>c.concat(...d),[]);return[u,f]}return[[],[]]},[e]);return R.useEffect(()=>{const a=(t==null?void 0:t.target)||dp;if(e!==null){const u=d=>{if(i.current=d.ctrlKey||d.metaKey||d.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&jc(d))return!1;const y=hp(d.code,l);s.current.add(d[y]),fp(o,s.current,!1)&&(d.preventDefault(),r(!0))},f=d=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&jc(d))return!1;const y=hp(d.code,l);fp(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(d[y]),d.key==="Meta"&&s.current.clear(),i.current=!1},c=()=>{s.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[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 UN=()=>{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=dy(t,n);return{x:o.x+i,y:o.y+s}}}),[])};function Ly(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)QN(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 QN(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 WN(e,t){return Ly(e,t)}function qN(e,t){return Ly(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=>u_(e),XN=e=>sy(e);function Fy(e){return R.forwardRef(e)}const YN=typeof window<"u"?R.useLayoutEffect:R.useEffect;function yp(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>KN(()=>n(i=>i+BigInt(1))));return YN(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function KN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Hy=R.createContext(null);function GN({children:e}){const t=ge(),n=R.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:f,onNodesChange:c,nodeLookup:d}=t.getState();let h=a;for(const y of l)h=typeof y=="function"?y(h):y;f?u(h):c&&c(pp({items:h,lookup:d}))},[]),r=yp(n),i=R.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:f,onEdgesChange:c,edgeLookup:d}=t.getState();let h=a;for(const y of l)h=typeof y=="function"?y(h):y;f?u(h):c&&c(pp({items:h,lookup:d}))},[]),s=yp(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return p.jsx(Hy.Provider,{value:o,children:e})}function ZN(){const e=R.useContext(Hy);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const JN=e=>!!e.panZoom;function Jd(){const e=UN(),t=ge(),n=ZN(),r=le(JN),i=R.useMemo(()=>{const s=c=>t.getState().nodeLookup.get(c),o=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},a=c=>{var m,v;const{nodeLookup:d,nodeOrigin:h}=t.getState(),y=gp(c)?c:d.get(c.id),x=y.parentId?hy(y.position,y.measured,y.parentId,d,h):y.position,k={...y,position:x,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return bi(k)},u=(c,d,h={replace:!1})=>{o(y=>y.map(x=>{if(x.id===c){const k=typeof d=="function"?d(x):d;return h.replace&&gp(k)?k:{...x,...k}}return x}))},f=(c,d,h={replace:!1})=>{l(y=>y.map(x=>{if(x.id===c){const k=typeof d=="function"?d(x):d;return h.replace&&XN(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var d;return(d=s(c))==null?void 0:d.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(d=>({...d}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:o,setEdges:l,addNodes:c=>{const d=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...d])},addEdges:c=>{const d=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:c=[],edges:d=[],transform:h}=t.getState(),[y,x,k]=h;return{nodes:c.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:c=[],edges:d=[]})=>{const{nodes:h,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:_,edges:P}=await f_({nodesToRemove:c,edgesToRemove:d,nodes:h,edges:y,onBeforeDelete:w}),N=P.length>0,b=_.length>0;if(N){const z=P.map(mp);k==null||k(P),v(z)}if(b){const z=_.map(mp);x==null||x(_),m(z)}return(b||N)&&(g==null||g({nodes:_,edges:P})),{deletedNodes:_,deletedEdges:P}},getIntersectingNodes:(c,d=!0,h)=>{const y=Yh(c),x=y?c:a(c),k=h!==void 0;return x?(h||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===c.id||!v.internals.positionAbsolute))return!1;const g=bi(k?m:v),w=As(g,x);return d&&w>0||w>=x.width*x.height}):[]},isNodeIntersecting:(c,d,h=!0)=>{const x=Yh(c)?c:a(c);if(!x)return!1;const k=As(x,d);return h&&k>0||k>=x.width*x.height},updateNode:u,updateNodeData:(c,d,h={replace:!1})=>{u(c,y=>{const x=typeof d=="function"?d(y):d;return h.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},h)},updateEdge:f,updateEdgeData:(c,d,h={replace:!1})=>{f(c,y=>{const x=typeof d=="function"?d(y):d;return h.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},h)},getNodesBounds:c=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return c_(c,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:c,id:d,nodeId:h})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${h}-${c}-${d??null}`))==null?void 0:y.values())??[])}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const vp=e=>e.selected,eC={actInsideInputWithModifier:!1},tC=typeof window<"u"?window:void 0;function nC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=Jd(),i=Fs(e,eC),s=Fs(t,{target:tC});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 rC(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},iC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function sC({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:c,zoomActivationKeyCode:d,preventScrolling:h=!0,children:y,noWheelClassName:x,noPanClassName:k,onViewportChange:m,isControlledViewport:v,paneClickDistance:g}){const w=ge(),_=R.useRef(null),{userSelectionActive:P,lib:N}=le(iC,Ee),b=Fs(d),z=R.useRef();rC(_);const T=R.useCallback(D=>{m==null||m({x:D[0],y:D[1],zoom:D[2]}),v||w.setState({transform:D})},[m,v]);return R.useEffect(()=>{if(_.current){z.current=W_({domNode:_.current,minZoom:f,maxZoom:c,translateExtent:u,viewport:a,paneClickDistance:g,onDraggingChange:E=>w.setState({paneDragging:E}),onPanZoomStart:(E,$)=>{const{onViewportChangeStart:M,onMoveStart:O}=w.getState();O==null||O(E,$),M==null||M($)},onPanZoom:(E,$)=>{const{onViewportChange:M,onMove:O}=w.getState();O==null||O(E,$),M==null||M($)},onPanZoomEnd:(E,$)=>{const{onViewportChangeEnd:M,onMoveEnd:O}=w.getState();O==null||O(E,$),M==null||M($)}});const{x:D,y:L,zoom:F}=z.current.getViewport();return w.setState({panZoom:z.current,transform:[D,L,F],domNode:_.current.closest(".react-flow")}),()=>{var E;(E=z.current)==null||E.destroy()}}},[]),R.useEffect(()=>{var D;(D=z.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:k,userSelectionActive:P,noWheelClassName:x,lib:N,onTransformChange:T})},[e,t,n,r,i,s,o,l,b,h,k,P,x,N,T]),p.jsx("div",{className:"react-flow__renderer",ref:_,style:fa,children:y})}const oC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lC(){const{userSelectionActive:e,userSelectionRect:t}=le(oC,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))},aC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function uC({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:c,onPaneMouseLeave:d,children:h}){const y=R.useRef(null),x=ge(),k=R.useRef(0),m=R.useRef(0),v=R.useRef(),g=R.useRef(new Map),{userSelectionActive:w,elementsSelectable:_,dragging:P}=le(aC,Ee),N=_&&(e||w),b=R.useRef(!1),z=R.useRef(!1),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),k.current=0,m.current=0},D=S=>{if(b.current){b.current=!1;return}l==null||l(S),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},L=S=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){S.preventDefault();return}a==null||a(S)},F=u?S=>u(S):void 0,E=S=>{var Q,X,q,Z;const{resetSelectedElements:j,domNode:I,edgeLookup:A}=x.getState();if(v.current=I==null?void 0:I.getBoundingClientRect(),!_||!e||S.button!==0||S.target!==y.current||!v.current)return;(X=(Q=S.target)==null?void 0:Q.setPointerCapture)==null||X.call(Q,S.pointerId),z.current=!0,b.current=!1,g.current=new Map;for(const[U,te]of A)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(S.nativeEvent,v.current);j(),x.setState({userSelectionRect:{width:0,height:0,startX:H,startY:K,x:H,y:K}}),s==null||s(S)},$=S=>{const{userSelectionRect:j,edgeLookup:I,transform:A,nodeLookup:H,triggerNodeChanges:K,triggerEdgeChanges:Q}=x.getState();if(!v.current||!j)return;b.current=!0;const{x:X,y:q}=tn(S.nativeEvent,v.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=oy(H,te,A,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(k.current!==J.size){k.current=J.size;const ae=Vr(H,J,!0);K(ae)}if(m.current!==ne.size){m.current=ne.size;const ae=Vr(I,ne);Q(ae)}x.setState({userSelectionRect:te,userSelectionActive:!0,nodesSelectionActive:!1})},M=S=>{var I,A;if(S.button!==0||!z.current)return;(A=(I=S.target)==null?void 0:I.releasePointerCapture)==null||A.call(I,S.pointerId);const{userSelectionRect:j}=x.getState();!w&&j&&S.target===y.current&&(D==null||D(S)),k.current>0&&x.setState({nodesSelectionActive:!0}),T(),o==null||o(S),(t||i)&&(b.current=!1),z.current=!1},O=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:Ce(["react-flow__pane",{draggable:O,dragging:P,selection:e}]),onClick:N?void 0:iu(D,y),onContextMenu:iu(L,y),onWheel:iu(F,y),onPointerEnter:N?void 0:f,onPointerDown:N?E:c,onPointerMove:N?$:c,onPointerUp:N?M:void 0,onPointerLeave:d,ref:y,style:fa,children:[h,p.jsx(lC,{})]})}function Ic({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 By({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:c=>{Ic({id:c,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{var c,d;if(t)(c=f.current)==null||c.destroy();else if(e.current)return(d=f.current)==null||d.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 cC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Vy(){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(),c=new Map,d=cC(o),h=i?s[0]:5,y=i?s[1]:5,x=n.direction.x*h*n.factor,k=n.direction.y*y*n.factor;for(const[,m]of u){if(!d(m))continue;let v={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+k};i&&(v=la(v,s));const{position:g,positionAbsolute:w}=ly({nodeId:m.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:f,onError:l});m.position=g,m.internals.positionAbsolute=w,c.set(m.id,m)}a(c)},[])}const ef=R.createContext(null),dC=ef.Provider;ef.Consumer;const Uy=()=>R.useContext(ef),fC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hC=(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 pC({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:c,...d},h){var E,$;const y=o||null,x=e==="target",k=ge(),m=Uy(),{connectOnClick:v,noPanClassName:g,rfId:w}=le(fC,Ee),{connectingFrom:_,connectingTo:P,clickConnecting:N,isPossibleEndHandle:b,connectionInProcess:z,valid:T}=le(hC(m,y,e),Ee);m||($=(E=k.getState()).onError)==null||$.call(E,"010",dn.error010());const D=M=>{const{defaultEdgeOptions:O,onConnect:S,hasDefaultEdges:j}=k.getState(),I={...O,...M};if(j){const{edges:A,setEdges:H}=k.getState();H(x_(I,A))}S==null||S(I),l==null||l(I)},L=M=>{if(!m)return;const O=my(M.nativeEvent);if(i&&(O&&M.button===0||!O)){const S=k.getState();Tc.onPointerDown(M.nativeEvent,{autoPanOnConnect:S.autoPanOnConnect,connectionMode:S.connectionMode,connectionRadius:S.connectionRadius,domNode:S.domNode,nodeLookup:S.nodeLookup,lib:S.lib,isTarget:x,handleId:y,nodeId:m,flowId:S.rfId,panBy:S.panBy,cancelConnection:S.cancelConnection,onConnectStart:S.onConnectStart,onConnectEnd:S.onConnectEnd,updateConnection:S.updateConnection,onConnect:D,isValidConnection:n||S.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:S.autoPanSpeed})}O?f==null||f(M):c==null||c(M)},F=M=>{const{onClickConnectStart:O,onClickConnectEnd:S,connectionClickStartHandle:j,connectionMode:I,isValidConnection:A,lib:H,rfId:K,nodeLookup:Q,connection:X}=k.getState();if(!m||!j&&!i)return;if(!j){O==null||O(M.nativeEvent,{nodeId:m,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const q=py(M.target),Z=n||A,{connection:U,isValid:te}=Tc.isValid(M.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:I,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,S==null||S(M,se),k.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${y}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:s,clickconnecting:N,connectingfrom:_,connectingto:P,valid:T,connectionindicator:r&&(!z||b)&&(z?s:i)}]),onMouseDown:L,onTouchStart:L,onClick:v?F:void 0,ref:h,...d,children:a})}const Xn=R.memo(Fy(pC));function mC({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 gC({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 yC(){return null}function vC({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:mC,default:gC,output:vC,group:yC};function xC(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 wC=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 SC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:s,transformString:o,userSelectionActive:l}=le(wC,Ee),a=Vy(),u=R.useRef(null);if(R.useEffect(()=>{var d;n||(d=u.current)==null||d.focus({preventScroll:!0})},[n]),By({nodeRef:u}),l||!i||!s)return null;const f=e?d=>{const h=r.getState().nodes.filter(y=>y.selected);e(d,h)}:void 0,c=d=>{Object.prototype.hasOwnProperty.call(Dl,d.key)&&(d.preventDefault(),a({direction:Dl[d.key],factor:d.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:c,style:{width:i,height:s}})})}const wp=typeof window<"u"?window:void 0,kC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Qy({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:f,selectionMode:c,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:_,panOnScrollMode:P,zoomOnDoubleClick:N,panOnDrag:b,defaultViewport:z,translateExtent:T,minZoom:D,maxZoom:L,preventScrolling:F,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:S,isControlledViewport:j}){const{nodesSelectionActive:I,userSelectionActive:A}=le(kC),H=Fs(u,{target:wp}),K=Fs(x,{target:wp}),Q=K||b,X=K||w,q=f&&Q!==!0,Z=H||A||q;return nC({deleteKeyCode:a,multiSelectionKeyCode:y}),p.jsx(sC,{onPaneContextMenu:s,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:X,panOnScrollSpeed:_,panOnScrollMode:P,zoomOnDoubleClick:N,panOnDrag:!H&&Q,defaultViewport:z,translateExtent:T,minZoom:D,maxZoom:L,zoomActivationKeyCode:k,preventScrolling:F,noWheelClassName:$,noPanClassName:M,onViewportChange:S,isControlledViewport:j,paneClickDistance:l,children:p.jsxs(uC,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:Q,isSelecting:!!Z,selectionMode:c,selectionKeyPressed:H,selectionOnDrag:q,children:[e,I&&p.jsx(SC,{onSelectionContextMenu:E,noPanClassName:M,disableKeyboardA11y:O})]})})}Qy.displayName="FlowRenderer";const EC=R.memo(Qy),_C=e=>t=>e?oy(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 NC(e){return le(R.useCallback(_C(e),[e]),Ee)}const CC=e=>e.updateNodeInternals;function bC(){const e=le(CC),[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 jC({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 c=u.current!==t,d=l.current!==e.sourcePosition,h=a.current!==e.targetPosition;(c||d||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 MC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:f,resizeObserver:c,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeExtent:m,nodeClickDistance:v,onError:g}){const{node:w,internals:_,isParent:P}=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=(k==null?void 0:k[N])||xp[N];b===void 0&&(g==null||g("003",dn.error003(N)),N="default",b=xp.default);const z=!!(w.draggable||l&&typeof w.draggable>"u"),T=!!(w.selectable||a&&typeof w.selectable>"u"),D=!!(w.connectable||u&&typeof w.connectable>"u"),L=!!(w.focusable||f&&typeof w.focusable>"u"),F=ge(),E=fy(w),$=jC({node:w,nodeType:N,hasDimensions:E,resizeObserver:c}),M=By({nodeRef:$,disabled:w.hidden||!z,noDragClassName:d,handleSelector:w.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:v}),O=Vy();if(w.hidden)return null;const S=fn(w),j=xC(w),I=T||z||t||n||r||i,A=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}=F.getState();T&&(!te||!z||se>0)&&Ic({id:e,store:F,nodeRef:$}),t&&t(U,{..._.userNode})},Z=U=>{if(!(jc(U.nativeEvent)||y))if(ny.includes(U.key)&&T){const te=U.key==="Escape";Ic({id:e,store:F,unselect:te,nodeRef:$})}else z&&w.selected&&Object.prototype.hasOwnProperty.call(Dl,U.key)&&(U.preventDefault(),F.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]:z},w.className,{selected:w.selected,selectable:T,parent:P,draggable:z,dragging:M}]),ref:$,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:E?"visible":"hidden",...w.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:H,onMouseLeave:K,onContextMenu:Q,onClick:q,onDoubleClick:X,onKeyDown:L?Z:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":y?void 0:`${Oy}-${x}`,"aria-label":w.ariaLabel,children:p.jsx(dC,{value:e,children:p.jsx(b,{id:e,data:w.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:w.selected,selectable:T,draggable:z,deletable:w.deletable??!0,isConnectable:D,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:M,dragHandle:w.dragHandle,zIndex:_.z,parentId:w.parentId,...S})})})}const PC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Wy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=le(PC,Ee),o=NC(e.onlyRenderVisibleElements),l=bC();return p.jsx("div",{className:"react-flow__nodes",style:fa,children:o.map(a=>p.jsx(MC,{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))})}Wy.displayName="NodeRenderer";const zC=R.memo(Wy);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&&g_({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const IC=({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"}),RC=({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]:IC,[Rl.ArrowClosed]:RC};function $C(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 OC=({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=$C(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},qy=({defaultColor:e,rfId:t})=>{const n=le(s=>s.edges),r=le(s=>s.defaultEdgeOptions),i=R.useMemo(()=>__(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(OC,{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};qy.displayName="MarkerDefinitions";var DC=R.memo(qy);function Xy({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[c,d]=R.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",u]),y=R.useRef(null);return R.useEffect(()=>{if(y.current){const x=y.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:p.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...f,children:[i&&p.jsx("rect",{width:c.width+2*o[0],x:-o[0],y:-o[1],height:c.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),p.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]})}Xy.displayName="EdgeText";const AC=R.memo(Xy);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(AC,{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 Yy({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,c,d,h]=gy({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,c,d,h]}function Ky(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:c,labelBgPadding:d,labelBgBorderRadius:h,style:y,markerEnd:x,markerStart:k,interactionWidth:m})=>{const[v,g,w]=Yy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l}),_=e.isInternal?void 0:t;return p.jsx(ha,{id:_,path:v,labelX:g,labelY:w,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:y,markerEnd:x,markerStart:k,interactionWidth:m})})}const LC=Ky({isInternal:!1}),Gy=Ky({isInternal:!0});LC.displayName="SimpleBezierEdge";Gy.displayName="SimpleBezierEdgeInternal";function Zy(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:c,style:d,sourcePosition:h=G.Bottom,targetPosition:y=G.Top,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,_]=Mc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:s,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset}),P=e.isInternal?void 0:t;return p.jsx(ha,{id:P,path:g,labelX:w,labelY:_,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:x,markerStart:k,interactionWidth:v})})}const Jy=Zy({isInternal:!1}),ev=Zy({isInternal:!0});Jy.displayName="SmoothStepEdge";ev.displayName="SmoothStepEdgeInternal";function tv(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return p.jsx(Jy,{...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 FC=tv({isInternal:!1}),nv=tv({isInternal:!0});FC.displayName="StepEdge";nv.displayName="StepEdgeInternal";function rv(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:c,style:d,markerEnd:h,markerStart:y,interactionWidth:x})=>{const[k,m,v]=xy({sourceX:n,sourceY:r,targetX:i,targetY:s}),g=e.isInternal?void 0:t;return p.jsx(ha,{id:g,path:k,labelX:m,labelY:v,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:y,interactionWidth:x})})}const HC=rv({isInternal:!1}),iv=rv({isInternal:!0});HC.displayName="StraightEdge";iv.displayName="StraightEdgeInternal";function sv(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:c,labelBgPadding:d,labelBgBorderRadius:h,style:y,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,_]=yy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l,curvature:m==null?void 0:m.curvature}),P=e.isInternal?void 0:t;return p.jsx(ha,{id:P,path:g,labelX:w,labelY:_,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:y,markerEnd:x,markerStart:k,interactionWidth:v})})}const BC=sv({isInternal:!1}),ov=sv({isInternal:!0});BC.displayName="BezierEdge";ov.displayName="BezierEdgeInternal";const Ep={default:ov,straight:iv,step:nv,smoothstep:ev,simplebezier:Gy},_p={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},VC=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,UC=(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:VC(t,r,e),cy:UC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function QC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:f,onReconnectEnd:c,setReconnecting:d,setUpdateHover:h}){const y=ge(),x=(w,_)=>{if(w.button!==0)return;const{autoPanOnConnect:P,domNode:N,isValidConnection:b,connectionMode:z,connectionRadius:T,lib:D,onConnectStart:L,onConnectEnd:F,cancelConnection:E,nodeLookup:$,rfId:M,panBy:O,updateConnection:S}=y.getState(),j=_.type==="target";d(!0),f==null||f(w,n,_.type);const I=(H,K)=>{d(!1),c==null||c(H,n,_.type,K)},A=H=>u==null?void 0:u(n,H);Tc.onPointerDown(w.nativeEvent,{autoPanOnConnect:P,connectionMode:z,connectionRadius:T,domNode:N,handleId:_.id,nodeId:_.nodeId,nodeLookup:$,isTarget:j,edgeUpdaterType:_.type,lib:D,flowId:M,cancelConnection:E,panBy:O,isValidConnection:b,onConnect:A,onConnectStart:L,onConnectEnd:F,onReconnectEnd:I,updateConnection:S,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},k=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>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:k,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&p.jsx(Cp,{position:a,centerX:s,centerY:o,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function WC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,rfId:y,edgeTypes:x,noPanClassName:k,onError:m,disableKeyboardA11y:v}){let g=le(J=>J.edgeLookup.get(e));const w=le(J=>J.defaultEdgeOptions);g=w?{...w,...g}:g;let _=g.type||"default",P=(x==null?void 0:x[_])||Ep[_];P===void 0&&(m==null||m("011",dn.error011(_)),_="default",P=Ep.default);const N=!!(g.focusable||t&&typeof g.focusable>"u"),b=typeof c<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),z=!!(g.selectable||r&&typeof g.selectable>"u"),T=R.useRef(null),[D,L]=R.useState(!1),[F,E]=R.useState(!1),$=ge(),{zIndex:M,sourceX:O,sourceY:S,targetX:j,targetY:I,sourcePosition:A,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=E_({id:e,sourceNode:ae,targetNode:fe,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:J.connectionMode,onError:m});return{zIndex:m_({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,y)}')`:void 0,[g.markerStart,y]),Q=R.useMemo(()=>g.markerEnd?`url('#${Pc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||O===null||S===null||j===null||I===null)return null;const X=J=>{var hn;const{addSelectedEdges:ae,unselectNodesAndEdges:fe,multiSelectionActive:$e}=$.getState();z&&($.setState({nodesSelectionActive:!1}),g.selected&&$e?(fe({nodes:[],edges:[g]}),(hn=T.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(!v&&ny.includes(J.key)&&z){const{unselectNodesAndEdges:fe,addSelectedEdges:$e}=$.getState();J.key==="Escape"?((ae=T.current)==null||ae.blur(),fe({edges:[g]})):$e([e])}};return p.jsx("svg",{style:{zIndex:M},children:p.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${_}`,g.className,k,{selected:g.selected,animated:g.animated,inactive:!z&&!i,updating:D,selectable:z}]),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?`${Dy}-${y}`:void 0,ref:T,children:[!F&&p.jsx(P,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:z,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:S,targetX:j,targetY:I,sourcePosition:A,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(QC,{edge:g,isReconnectable:b,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,sourceX:O,sourceY:S,targetX:j,targetY:I,sourcePosition:A,targetPosition:H,setUpdateHover:L,setReconnecting:E})]})})}const qC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function lv({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:f,reconnectRadius:c,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,onError:g}=le(qC,Ee),w=TC(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(DC,{defaultColor:e,rfId:n}),w.map(_=>p.jsx(WC,{id:_,edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:f,reconnectRadius:c,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:x},_))]})}lv.displayName="EdgeRenderer";const XC=R.memo(lv),YC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function KC({children:e}){const t=le(YC);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function GC(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 ZC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function JC(e){const t=le(ZC),n=ge();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function e3(e){return e.connection.inProgress?{...e.connection,to:ro(e.connection.to,e.transform)}:{...e.connection}}function t3(e){return e3}function n3(e){const t=t3();return le(t,Ee)}const r3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function i3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:l,inProgress:a}=le(r3,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",iy(l)]),children:p.jsx(av,{style:t,type:n,CustomComponent:r,isValid:l})})})}const av=({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:c,toPosition:d}=n3();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:d,connectionStatus:iy(r),toNode:f,toHandle:c});let h="";const y={sourceX:s.x,sourceY:s.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:d};switch(t){case Nn.Bezier:[h]=yy(y);break;case Nn.SimpleBezier:[h]=Yy(y);break;case Nn.Step:[h]=Mc({...y,borderRadius:0});break;case Nn.SmoothStep:[h]=Mc(y);break;default:[h]=xy(y)}return p.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};av.displayName="ConnectionLine";const s3={};function bp(e=s3){R.useRef(e),ge(),R.useEffect(()=>{},[e])}function o3(){ge(),R.useRef(!1),R.useEffect(()=>{},[])}function uv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,onSelectionContextMenu:c,onSelectionStart:d,onSelectionEnd:h,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:_,panActivationKeyCode:P,zoomActivationKeyCode:N,deleteKeyCode:b,onlyRenderVisibleElements:z,elementsSelectable:T,defaultViewport:D,translateExtent:L,minZoom:F,maxZoom:E,preventScrolling:$,defaultMarkerColor:M,zoomOnScroll:O,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:I,panOnScrollMode:A,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:Ii,noWheelClassName:ya,noPanClassName:Ri,disableKeyboardA11y:$i,nodeExtent:va,rfId:Oi,viewport:Di,onViewportChange:io}){return bp(e),bp(t),o3(),GC(n),JC(Di),p.jsx(EC,{onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:te,onPaneScroll:U,paneClickDistance:se,deleteKeyCode:b,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:_,panActivationKeyCode:P,zoomActivationKeyCode:N,elementsSelectable:T,zoomOnScroll:O,zoomOnPinch:S,zoomOnDoubleClick:H,panOnScroll:j,panOnScrollSpeed:I,panOnScrollMode:A,panOnDrag:K,defaultViewport:D,translateExtent:L,minZoom:F,maxZoom:E,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:Ii,noWheelClassName:ya,noPanClassName:Ri,disableKeyboardA11y:$i,onViewportChange:io,isControlledViewport:!!Di,children:p.jsxs(KC,{children:[p.jsx(XC,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pa,onReconnectStart:ma,onReconnectEnd:ga,onlyRenderVisibleElements:z,onEdgeContextMenu:J,onEdgeMouseEnter:ae,onEdgeMouseMove:fe,onEdgeMouseLeave:$e,reconnectRadius:hn,defaultMarkerColor:M,noPanClassName:Ri,disableKeyboardA11y:$i,rfId:Oi}),p.jsx(i3,{style:x,type:y,component:k,containerStyle:m}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(zC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,nodeClickDistance:ne,onlyRenderVisibleElements:z,noPanClassName:Ri,noDragClassName:Ii,disableKeyboardA11y:$i,nodeExtent:va,rfId:Oi}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}uv.displayName="GraphView";const l3=R.memo(uv),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,c=new Map,d=new Map,h=r??t??[],y=n??e??[],x=l??[0,0],k=a??Os;Sy(c,d,h),zc(y,u,f,{nodeOrigin:x,nodeExtent:k,elevateNodesOnSelect:!1});let m=[0,0,1];if(o&&i&&s){const v=no(u,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:g,y:w,zoom:_}=qd(v,i,s,.5,2,.1);m=[g,w,_]}return{rfId:"1",width:0,height:0,transform:m,nodes:y,nodeLookup:u,parentLookup:f,edges:h,edgeLookup:d,connectionLookup:c,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Os,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ni.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...ry},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:h_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},a3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a})=>NN((u,f)=>({...jp({nodes:e,edges:t,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:c=>{const{nodeLookup:d,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:x}=f();zc(c,d,h,{nodeOrigin:y,nodeExtent:a,elevateNodesOnSelect:x,checkEquality:!0}),u({nodes:c})},setEdges:c=>{const{connectionLookup:d,edgeLookup:h}=f();Sy(d,h,c),u({edges:c})},setDefaultNodesAndEdges:(c,d)=>{if(c){const{setNodes:h}=f();h(c),u({hasDefaultNodes:!0})}if(d){const{setEdges:h}=f();h(d),u({hasDefaultEdges:!0})}},updateNodeInternals:(c,d={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:y,parentLookup:x,fitViewOnInit:k,fitViewDone:m,fitViewOnInitOptions:v,domNode:g,nodeOrigin:w,nodeExtent:_,debug:P,fitViewSync:N}=f(),{changes:b,updatedInternals:z}=M_(c,y,x,g,w,_);if(z){if(C_(y,x,{nodeOrigin:w,nodeExtent:_}),d.triggerFitView){let T=m;!m&&k&&(T=N({...v,nodes:v==null?void 0:v.nodes})),u({fitViewDone:T})}else u({});(b==null?void 0:b.length)>0&&(P&&console.log("React Flow: trigger node changes",b),h==null||h(b))}},updateNodePositions:(c,d=!1)=>{const h=[],y=[];for(const[x,k]of c){const m=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&(k!=null&&k.position)),v={id:x,type:"position",position:m?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:d};m&&h.push({id:x,parentId:k.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width,height:k.measured.height}}),y.push(v)}if(h.length>0){const{nodeLookup:x,parentLookup:k,nodeOrigin:m}=f(),v=Gd(h,x,k,m);y.push(...v)}f().triggerNodeChanges(y)},triggerNodeChanges:c=>{const{onNodesChange:d,setNodes:h,nodes:y,hasDefaultNodes:x,debug:k}=f();if(c!=null&&c.length){if(x){const m=WN(c,y);h(m)}k&&console.log("React Flow: trigger node changes",c),d==null||d(c)}},triggerEdgeChanges:c=>{const{onEdgesChange:d,setEdges:h,edges:y,hasDefaultEdges:x,debug:k}=f();if(c!=null&&c.length){if(x){const m=qN(c,y);h(m)}k&&console.log("React Flow: trigger edge changes",c),d==null||d(c)}},addSelectedNodes:c=>{const{multiSelectionActive:d,edgeLookup:h,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(d){const m=c.map(v=>er(v,!0));x(m);return}x(Vr(y,new Set([...c]),!0)),k(Vr(h))},addSelectedEdges:c=>{const{multiSelectionActive:d,edgeLookup:h,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(d){const m=c.map(v=>er(v,!0));k(m);return}k(Vr(h,new Set([...c]))),x(Vr(y,new Set,!0))},unselectNodesAndEdges:({nodes:c,edges:d}={})=>{const{edges:h,nodes:y,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:m}=f(),v=c||y,g=d||h,w=v.map(P=>{const N=x.get(P.id);return N&&(N.selected=!1),er(P.id,!1)}),_=g.map(P=>er(P.id,!1));k(w),m(_)},setMinZoom:c=>{const{panZoom:d,maxZoom:h}=f();d==null||d.setScaleExtent([c,h]),u({minZoom:c})},setMaxZoom:c=>{const{panZoom:d,minZoom:h}=f();d==null||d.setScaleExtent([h,c]),u({maxZoom:c})},setTranslateExtent:c=>{var d;(d=f().panZoom)==null||d.setTranslateExtent(c),u({translateExtent:c})},setPaneClickDistance:c=>{var d;(d=f().panZoom)==null||d.setClickDistance(c)},resetSelectedElements:()=>{const{edges:c,nodes:d,triggerNodeChanges:h,triggerEdgeChanges:y}=f(),x=d.reduce((m,v)=>v.selected?[...m,er(v.id,!1)]:m,[]),k=c.reduce((m,v)=>v.selected?[...m,er(v.id,!1)]:m,[]);h(x),y(k)},setNodeExtent:c=>{const{nodes:d,nodeLookup:h,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:k,nodeExtent:m}=f();c[0][0]===m[0][0]&&c[0][1]===m[0][1]&&c[1][0]===m[1][0]&&c[1][1]===m[1][1]||(zc(d,h,y,{nodeOrigin:x,nodeExtent:c,elevateNodesOnSelect:k,checkEquality:!1}),u({nodeExtent:c}))},panBy:c=>{const{transform:d,width:h,height:y,panZoom:x,translateExtent:k}=f();return P_({delta:c,panZoom:x,transform:d,translateExtent:k,width:h,height:y})},fitView:c=>{const{panZoom:d,width:h,height:y,minZoom:x,maxZoom:k,nodeLookup:m}=f();if(!d)return Promise.resolve(!1);const v=Nc(m,c);return Cc({nodes:v,width:h,height:y,panZoom:d,minZoom:x,maxZoom:k},c)},fitViewSync:c=>{const{panZoom:d,width:h,height:y,minZoom:x,maxZoom:k,nodeLookup:m}=f();if(!d)return!1;const v=Nc(m,c);return Cc({nodes:v,width:h,height:y,panZoom:d,minZoom:x,maxZoom:k},c),v.size>0},cancelConnection:()=>{u({connection:{...ry}})},updateConnection:c=>{u({connection:c})},reset:()=>u({...jp()})}),Object.is);function u3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:o,nodeOrigin:l,nodeExtent:a,children:u}){const[f]=R.useState(()=>a3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a}));return p.jsx(CN,{value:f,children:p.jsx(GN,{children:u})})}function c3({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(u3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:l,nodeOrigin:a,nodeExtent:u,children:e})}const d3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function f3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:f,onMoveStart:c,onMoveEnd:d,onConnect:h,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:P,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:z,onNodesDelete:T,onEdgesDelete:D,onDelete:L,onSelectionChange:F,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:M,onSelectionContextMenu:O,onSelectionStart:S,onSelectionEnd:j,onBeforeDelete:I,connectionMode:A,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:Ii=Ay,edgesFocusable:ya,edgesReconnectable:Ri,elementsSelectable:$i=!0,defaultViewport:va=LN,minZoom:Oi=.5,maxZoom:Di=2,translateExtent:io=Os,preventScrolling:mv=!0,nodeExtent:xa,defaultMarkerColor:gv="#b1b1b7",zoomOnScroll:yv=!0,zoomOnPinch:vv=!0,panOnScroll:xv=!1,panOnScrollSpeed:wv=.5,panOnScrollMode:Sv=gr.Free,zoomOnDoubleClick:kv=!0,panOnDrag:Ev=!0,onPaneClick:_v,onPaneMouseEnter:Nv,onPaneMouseMove:Cv,onPaneMouseLeave:bv,onPaneScroll:jv,onPaneContextMenu:Mv,paneClickDistance:tf=0,nodeClickDistance:Pv=0,children:zv,onReconnect:Tv,onReconnectStart:Iv,onReconnectEnd:Rv,onEdgeContextMenu:$v,onEdgeDoubleClick:Ov,onEdgeMouseEnter:Dv,onEdgeMouseMove:Av,onEdgeMouseLeave:Lv,reconnectRadius:Fv=10,onNodesChange:Hv,onEdgesChange:Bv,noDragClassName:Vv="nodrag",noWheelClassName:Uv="nowheel",noPanClassName:nf="nopan",fitView:rf,fitViewOptions:Qv,connectOnClick:Wv,attributionPosition:qv,proOptions:Xv,defaultEdgeOptions:Yv,elevateNodesOnSelect:Kv,elevateEdgesOnSelect:Gv,disableKeyboardA11y:sf=!1,autoPanOnConnect:Zv,autoPanOnNodeDrag:Jv,autoPanSpeed:ex,connectionRadius:tx,isValidConnection:nx,onError:rx,style:ix,id:of,nodeDragThreshold:sx,viewport:ox,onViewportChange:lx,width:ax,height:ux,colorMode:cx="light",debug:dx,...fx},hx){const wa=of||"1",px=VN(cx);return p.jsx("div",{"data-testid":"rf__wrapper",...fx,style:{...ix,...d3},ref:hx,className:Ce(["react-flow",i,px]),id:of,children:p.jsxs(c3,{nodes:e,edges:t,width:ax,height:ux,fitView:rf,nodeOrigin:Ii,nodeExtent:xa,children:[p.jsx(l3,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:P,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:mv,zoomOnScroll:yv,zoomOnPinch:vv,zoomOnDoubleClick:kv,panOnScroll:xv,panOnScrollSpeed:wv,panOnScrollMode:Sv,panOnDrag:Ev,onPaneClick:_v,onPaneMouseEnter:Nv,onPaneMouseMove:Cv,onPaneMouseLeave:bv,onPaneScroll:jv,onPaneContextMenu:Mv,paneClickDistance:tf,nodeClickDistance:Pv,onSelectionContextMenu:O,onSelectionStart:S,onSelectionEnd:j,onReconnect:Tv,onReconnectStart:Iv,onReconnectEnd:Rv,onEdgeContextMenu:$v,onEdgeDoubleClick:Ov,onEdgeMouseEnter:Dv,onEdgeMouseMove:Av,onEdgeMouseLeave:Lv,reconnectRadius:Fv,defaultMarkerColor:gv,noDragClassName:Vv,noWheelClassName:Uv,noPanClassName:nf,rfId:wa,disableKeyboardA11y:sf,nodeExtent:xa,viewport:ox,onViewportChange:lx}),p.jsx(BN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,nodesDraggable:pa,nodesConnectable:ma,nodesFocusable:ga,edgesFocusable:ya,edgesReconnectable:Ri,elementsSelectable:$i,elevateNodesOnSelect:Kv,elevateEdgesOnSelect:Gv,minZoom:Oi,maxZoom:Di,nodeExtent:xa,onNodesChange:Hv,onEdgesChange:Bv,snapToGrid:ae,snapGrid:fe,connectionMode:A,translateExtent:io,connectOnClick:Wv,defaultEdgeOptions:Yv,fitView:rf,fitViewOptions:Qv,onNodesDelete:T,onEdgesDelete:D,onDelete:L,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:z,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:M,onMove:f,onMoveStart:c,onMoveEnd:d,noPanClassName:nf,nodeOrigin:Ii,rfId:wa,autoPanOnConnect:Zv,autoPanOnNodeDrag:Jv,autoPanSpeed:ex,onError:rx,connectionRadius:tx,isValidConnection:nx,selectNodesOnDrag:hn,nodeDragThreshold:sx,onBeforeDelete:I,paneClickDistance:tf,debug:dx}),p.jsx(AN,{onSelectionChange:F}),zv,p.jsx(IN,{proOptions:Xv,position:qv}),p.jsx(zN,{rfId:wa,disableKeyboardA11y:sf})]})})}var h3=Fy(f3);function p3({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 m3({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 g3={[nn.Dots]:1,[nn.Lines]:1,[nn.Cross]:6},y3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cv({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 c=R.useRef(null),{transform:d,patternId:h}=le(y3,Ee),y=r||g3[t],x=t===nn.Dots,k=t===nn.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*d[2]||1,m[1]*d[2]||1],g=y*d[2],w=Array.isArray(s)?s:[s,s],_=k?[g,g]:v,P=[w[0]*d[2]||1+_[0]/2,w[1]*d[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:c,"data-testid":"rf__background",children:[p.jsx("pattern",{id:N,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:x?p.jsx(m3,{radius:g/2,className:f}):p.jsx(p3,{dimensions:_,lineWidth:i,variant:t,className:f})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}cv.displayName="Background";const v3=R.memo(cv);function x3(){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 w3(){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 S3(){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 k3(){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 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 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 Io({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const _3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function dv({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:c="bottom-left",orientation:d="vertical","aria-label":h="React Flow controls"}){const y=ge(),{isInteractive:x,minZoomReached:k,maxZoomReached:m}=le(_3,Ee),{zoomIn:v,zoomOut:g,fitView:w}=Jd(),_=()=>{v(),s==null||s()},P=()=>{g(),o==null||o()},N=()=>{w(i),l==null||l()},b=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},z=d==="horizontal"?"horizontal":"vertical";return p.jsxs(Zd,{className:Ce(["react-flow__controls",z,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(Io,{onClick:_,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:p.jsx(x3,{})}),p.jsx(Io,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:k,children:p.jsx(w3,{})})]}),n&&p.jsx(Io,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view",children:p.jsx(S3,{})}),r&&p.jsx(Io,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity",children:x?p.jsx(E3,{}):p.jsx(k3,{})}),f]})}dv.displayName="Controls";const N3=R.memo(dv);function C3({id:e,x:t,y:n,width:r,height:i,style:s,color:o,strokeColor:l,strokeWidth:a,className:u,borderRadius:f,shapeRendering:c,selected:d,onClick:h}){const{background:y,backgroundColor:x}=s||{},k=o||y||x;return p.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:d},u]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:c,onClick:h?m=>h(m,e):void 0})}const b3=R.memo(C3),j3=e=>e.nodes.map(t=>t.id),su=e=>e instanceof Function?e:()=>e;function M3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=b3,onClick:o}){const l=le(j3,Ee),a=su(t),u=su(e),f=su(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:l.map(d=>p.jsx(z3,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:c},d))})}function P3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:a}){const{node:u,x:f,y:c,width:d,height:h}=le(y=>{const x=y.nodeLookup.get(e),{x:k,y:m}=x.internals.positionAbsolute,{width:v,height:g}=fn(x);return{node:x,x:k,y:m,width:v,height:g}},Ee);return!u||u.hidden||!fy(u)?null:p.jsx(l,{x:f,y:c,width:d,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 z3=R.memo(P3);var T3=R.memo(M3);const I3=200,R3=150,$3=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?cy(no(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},O3="react-flow__minimap-desc";function fv({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:f,maskStrokeWidth:c,position:d="bottom-right",onClick:h,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:m="React Flow mini map",inversePan:v,zoomStep:g=10,offsetScale:w=5}){const _=ge(),P=R.useRef(null),{boundingRect:N,viewBB:b,rfId:z,panZoom:T,translateExtent:D,flowWidth:L,flowHeight:F}=le($3,Ee),E=(e==null?void 0:e.width)??I3,$=(e==null?void 0:e.height)??R3,M=N.width/E,O=N.height/$,S=Math.max(M,O),j=S*E,I=S*$,A=w*S,H=N.x-(j-N.width)/2-A,K=N.y-(I-N.height)/2-A,Q=j+A*2,X=I+A*2,q=`${O3}-${z}`,Z=R.useRef(0),U=R.useRef();Z.current=S,R.useEffect(()=>{if(P.current&&T)return U.current=A_({domNode:P.current,panZoom:T,getTransform:()=>_.getState().transform,getViewScale:()=>Z.current}),()=>{var ne;(ne=U.current)==null||ne.destroy()}},[T]),R.useEffect(()=>{var ne;(ne=U.current)==null||ne.update({translateExtent:D,width:L,height:F,inversePan:v,pannable:x,zoomStep:g,zoomable:k})},[x,k,v,g,D,L,F]);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=y?R.useCallback((ne,J)=>{const ae=_.getState().nodeLookup.get(J);y(ne,ae)},[]):void 0;return p.jsx(Zd,{position:d,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 c=="number"?c*S: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:P,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-A},${K-A}h${Q+A*2}v${X+A*2}h${-Q-A*2}z
|
|
62
|
-
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}fv.displayName="MiniMap";R.memo(fv);function D3({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:c=!1,shouldResize:d,onResizeStart:h,onResize:y,onResizeEnd:x}){const k=Uy(),m=typeof e=="string"?e:k,v=ge(),g=R.useRef(null),w=n===fs.Line?"right":"bottom-right",_=t??w,P=R.useRef(null);R.useEffect(()=>{if(!(!g.current||!m))return P.current||(P.current=J_({domNode:g.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:T,transform:D,snapGrid:L,snapToGrid:F,nodeOrigin:E,domNode:$}=v.getState();return{nodeLookup:T,transform:D,snapGrid:L,snapToGrid:F,nodeOrigin:E,paneDomNode:$}},onChange:(T,D)=>{const{triggerNodeChanges:L,nodeLookup:F,parentLookup:E,nodeOrigin:$}=v.getState(),M=[],O={x:T.x,y:T.y},S=F.get(m);if(S&&S.expandParent&&S.parentId){const j=S.origin??$,I=T.width??S.measured.width,A=T.height??S.measured.height,H={id:S.id,parentId:S.parentId,rect:{width:I,height:A,...hy({x:T.x??S.position.x,y:T.y??S.position.y},{width:I,height:A},S.parentId,F,j)}},K=Gd([H],F,E,$);M.push(...K),O.x=T.x?Math.max(j[0]*I,T.x):void 0,O.y=T.y?Math.max(j[1]*A,T.y):void 0}if(O.x!==void 0&&O.y!==void 0){const j={id:m,type:"position",position:{...O}};M.push(j)}if(T.width!==void 0&&T.height!==void 0){const j={id:m,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:T.width,height:T.height}};M.push(j)}for(const j of D){const I={...j,type:"position"};M.push(I)}L(M)},onEnd:()=>{const T={id:m,type:"dimensions",resizing:!1};v.getState().triggerNodeChanges([T])}})),P.current.update({controlPosition:_,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:f},keepAspectRatio:c,onResizeStart:h,onResize:y,onResizeEnd:x,shouldResize:d}),()=>{var T;(T=P.current)==null||T.destroy()}},[_,l,a,u,f,c,h,y,x,d]);const N=_.split("-"),b=n===fs.Line?"borderColor":"backgroundColor",z=o?{...i,[b]:o}:i;return p.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...N,n,r]),ref:g,style:z,children:s})}R.memo(D3);const A3=new Set;function L3(e){return e.startsWith("signal:child:")}function F3(e){const t=R.useMemo(()=>[...e].sort(),[e]),n=o1({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 H3({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(Sg,{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(kg,{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 B3({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 V3={step:H3,terminal:B3};function U3(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 Q3({run:e,timeline:t,selected:n,onSelect:r,onOpenRun:i,fmtDuration:s,expanded:o,onToggleChild:l}){const a=o??A3,u=F3(a),{nodes:f,edges:c}=(()=>{const x=[],k=[],m=e.status==="running"||e.status==="suspended",v=(b,z,T)=>({id:`${b}->${z}`,source:b,target:z,style:{stroke:T?"#f87171":"var(--line)",strokeWidth:1.5}}),g=(b,z)=>({id:`${b}=>${z}`,source:b,target:z,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function w(b,z,T,D){let L=T,F,E,$=!1;for(const M of b){const O=`${D}s${M.seq}`,S=$d(M),j=S!==void 0&&a.has(S);x.push({id:O,type:"step",draggable:!1,position:{x:L,y:z*150},data:{seq:M.seq,name:M.name,kind:M.kind,status:M.status,workerGroup:M.workerGroup,attempts:M.attempts,duration:s(M.startedAt,M.finishedAt),subs:U3(M),selected:z===0&&n===M.seq,childRunId:S,onOpenRun:i,childExpanded:j,onToggleChild:l,depth:z}}),F===void 0&&(F=O),E!==void 0&&k.push(v(E,O,$));const I=S!==void 0&&j?u[S]:void 0;if(I){const A=w(I.timeline,z+1,L+248,`${S}:`);A.firstId!==void 0&&k.push(g(O,A.firstId)),L3(M.name)&&A.connectorId!==void 0?E=A.connectorId:E=O,L=Math.max(L+248,A.nextX)}else E=O,L+=248;$=M.status==="failed"}return{firstId:F,connectorId:E,nextX:L}}const _=248;x.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:e.workflow}});const P=w(t,0,_,"");P.firstId!==void 0&&k.push({id:"start->first",source:"start",target:P.firstId});const N=Rd(e,t);return x.push({id:"end",type:"terminal",position:{x:Math.max(P.nextX,_),y:0},draggable:!1,data:{status:N,label:N}}),k.push({id:"exit->end",source:P.connectorId??"start",target:"end",animated:m,style:{stroke:m?"var(--accent)":"var(--line)",strokeWidth:m?2:1.5}}),{nodes:x,edges:k}})(),d=R.useCallback((h,y)=>{if(y.type!=="step")return;const x=y.data;x.depth&&x.depth>0||r(x.seq)},[r]);return p.jsxs(h3,{nodes:f,edges:c,nodeTypes:V3,onNodeClick:d,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[p.jsx(v3,{variant:nn.Dots,gap:22,size:1,color:"#1c1c22"}),p.jsx(N3,{showInteractive:!1,position:"bottom-right"})]})}const W3=["pending","running","suspended","completed","failed","cancelled","dead"];function q3(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 X3(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 hv({status:e}){const t=e==="running"||e==="awaiting";return p.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function pv({status:e}){return p.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[p.jsx(hv,{status:e}),e]})}function Y3({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(hv,{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),W3.map(s=>i(s,s,e[s]??0))]}),p.jsx(K3,{}),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 K3(){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 G3({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(pv,{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:q3(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 Z3({id:e,onOpenRun:t}){var M,O;const n=Xs(),{data:r}=pi({queryKey:["run",e],queryFn:async()=>mS(n.getQueryData(["run",e]),await rt.run(e)),refetchInterval:S=>{var I;const j=(I=S.state.data)==null?void 0:I.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,S=>{if(S.type==="step.progress"&&S.event&&S.seq!=null){const j=S.seq,I=S.event;n.setQueryData(["run",e],A=>A&&{...A,timeline:A.timeline.map(H=>H.seq===j?{...H,events:[...H.events??[],I]}:H)});return}n.invalidateQueries({queryKey:["run",e]})})},[e,a,n]);const u=Yi({mutationFn:()=>rt.retry(e),onSuccess:o}),f=Yi({mutationFn:S=>rt.cancel(e,{compensate:S}),onSuccess:o}),c=Yi({mutationFn:()=>rt.continue(e),onSuccess:o}),d=Yi({mutationFn:S=>rt.retryWithInput(e,S),onSuccess:S=>{n.invalidateQueries({queryKey:["runs"]}),t(S.runId)}}),h=()=>{const S=JSON.stringify((r==null?void 0:r.run.input)??{},null,2),j=window.prompt("Fix the input, then replay as a fresh run:",S);if(j!=null)try{d.mutate(JSON.parse(j))}catch{window.alert("Invalid JSON")}},[y,x]=R.useState(),[k,m]=R.useState(!1),[v,g]=R.useState(new Set),[w,_]=R.useState(240);function P(S){S.preventDefault(),S.currentTarget.setPointerCapture(S.pointerId);const j=A=>_(H=>Math.max(120,Math.min(720,H-A.movementY))),I=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",I)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",I)}function N(S){g(j=>{const I=new Set(j);return I.has(S)?I.delete(S):I.add(S),I})}if(!r)return p.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:b,timeline:z}=r,T=b.id.startsWith("dlq:"),D=T?{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,L=b.status==="failed"||b.status==="suspended",F=b.status==="running"||b.status==="suspended",E=z.some(S=>S.status==="pending"&&S.kind==="signal"&&S.name.startsWith("breakpoint")),$=z.find(S=>S.seq===y);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}),T&&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(pv,{status:Rd(b,z)}),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:[z.length," ",z.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(S=>p.jsxs("span",{className:"mono rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400",children:["#",S]},S))}),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(([S,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:[S,"=",String(j)]},S))}),(M=r==null?void 0:r.children)!=null&&M.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(S=>p.jsx("span",{onClick:()=>t(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))]}):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:c.isPending,onClick:()=>c.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(wS,{width:12,height:12}),"Continue"]}),p.jsxs("button",{type:"button",disabled:!L||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:d.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"]}),F&&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:!F||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:z.length>0?`1fr ${w}px`:"1fr"},children:[p.jsxs("div",{className:"relative min-h-0",children:[z.length===0?p.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):p.jsx(Q3,{run:b,timeline:z,selected:y,onSelect:x,onOpenRun:t,fmtDuration:X3,expanded:v,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})]}),z.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:P,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(NS,{run:b,timeline:z,selected:y,onSelect:x,onOpenRun:t,expanded:v,onToggleChild:N})]}),$&&p.jsx(zS,{step:$,run:b,onClose:()=>x(void 0),onOpenRun:t}),k&&p.jsx(TS,{run:b,onClose:()=>m(!1)})]})]})}function J3(){const[e,t]=R.useState("all"),[n,r]=R.useState(""),[i,s]=R.useState(""),[o,l]=R.useState(),a=Xs(),u=i.split(",").map(y=>y.trim()).filter(Boolean),{data:f=[]}=pi({queryKey:["runs",n,u.join("|")],queryFn:()=>rt.runs(void 0,n||void 0,u.length?u:void 0),refetchInterval:3e3}),c=Yi({mutationFn:y=>rt.bulk(y,{status:e!=="all"?e:void 0,tag:n||void 0,attr:u.length?u:void 0}),onSuccess:()=>a.invalidateQueries({queryKey:["runs"]})}),d=f.reduce((y,x)=>(y[x.status]=(y[x.status]??0)+1,y),{}),h=e==="all"?f:f.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(Y3,{counts:d,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||u.length>0)&&h.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:[h.length," ",e!=="all"?e:""," ",n&&`#${n}`,u.length>0&&` ⛃${u.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(G3,{runs:h,selected:o,onSelect:l,onSelectTag:r})})]}),p.jsx("main",{className:"min-h-0",children:o?p.jsx(Z3,{id:o,onOpenRun:l},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 e5=new Gx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});vg(document.getElementById("root")).render(p.jsx(R.StrictMode,{children:p.jsx(r1,{client:e5,children:p.jsx(J3,{})})}));
|