@dudousxd/nestjs-durable-dashboard 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var lf=e=>{throw TypeError(e)};var ka=(e,t,n)=>t.has(e)||lf("Cannot "+n);var C=(e,t,n)=>(ka(e,t,"read from private field"),n?n.call(e):t.get(e)),K=(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)=>(ka(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ee=(e,t,n)=>(ka(e,t,"access private method"),n);var oo=(e,t,n,r)=>({set _(i){V(e,t,i,n)},get _(){return C(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Hp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bp={exports:{}},Ll={},Vp={exports:{}},re={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Xs=Symbol.for("react.element"),yx=Symbol.for("react.portal"),vx=Symbol.for("react.fragment"),xx=Symbol.for("react.strict_mode"),wx=Symbol.for("react.profiler"),Sx=Symbol.for("react.provider"),kx=Symbol.for("react.context"),Ex=Symbol.for("react.forward_ref"),_x=Symbol.for("react.suspense"),Nx=Symbol.for("react.memo"),Cx=Symbol.for("react.lazy"),af=Symbol.iterator;function bx(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Up={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qp=Object.assign,Wp={};function Pi(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}Pi.prototype.isReactComponent={};Pi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Pi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qp(){}qp.prototype=Pi.prototype;function $c(e,t,n){this.props=e,this.context=t,this.refs=Wp,this.updater=n||Up}var Oc=$c.prototype=new qp;Oc.constructor=$c;Qp(Oc,Pi.prototype);Oc.isPureReactComponent=!0;var uf=Array.isArray,Xp=Object.prototype.hasOwnProperty,Dc={current:null},Yp={key:!0,ref:!0,__self:!0,__source:!0};function Kp(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Xp.call(t,r)&&!Yp.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Xs,type:e,key:s,ref:o,props:i,_owner:Dc.current}}function jx(e,t){return{$$typeof:Xs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ac(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xs}function Mx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cf=/\/+/g;function Ea(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Mx(""+e.key):t.toString(36)}function $o(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 Xs:case yx:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Ea(o,0):r,uf(i)?(n="",e!=null&&(n=e.replace(cf,"$&/")+"/"),$o(i,t,n,"",function(u){return u})):i!=null&&(Ac(i)&&(i=jx(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+Ea(s,l);o+=$o(s,t,n,a,i)}else if(a=bx(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=r+Ea(s,l++),o+=$o(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 lo(e,t,n){if(e==null)return e;var r=[],i=0;return $o(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Px(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},Oo={transition:null},zx={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Oo,ReactCurrentOwner:Dc};function Gp(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:lo,forEach:function(e,t,n){lo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return lo(e,function(){t++}),t},toArray:function(e){return lo(e,function(t){return t})||[]},only:function(e){if(!Ac(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Pi;re.Fragment=vx;re.Profiler=wx;re.PureComponent=$c;re.StrictMode=xx;re.Suspense=_x;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zx;re.act=Gp;re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Qp({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Dc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Xp.call(t,a)&&!Yp.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Xs,type:e.type,key:i,ref:s,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:kx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Sx,_context:e},e.Consumer=e};re.createElement=Kp;re.createFactory=function(e){var t=Kp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:Ex,render:e}};re.isValidElement=Ac;re.lazy=function(e){return{$$typeof:Cx,_payload:{_status:-1,_result:e},_init:Px}};re.memo=function(e,t){return{$$typeof:Nx,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Oo.transition;Oo.transition={};try{e()}finally{Oo.transition=t}};re.unstable_act=Gp;re.useCallback=function(e,t){return Qe.current.useCallback(e,t)};re.useContext=function(e){return Qe.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};re.useEffect=function(e,t){return Qe.current.useEffect(e,t)};re.useId=function(){return Qe.current.useId()};re.useImperativeHandle=function(e,t,n){return Qe.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Qe.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Qe.current.useReducer(e,t,n)};re.useRef=function(e){return Qe.current.useRef(e)};re.useState=function(e){return Qe.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Qe.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Qe.current.useTransition()};re.version="18.3.1";Vp.exports=re;var R=Vp.exports;const Ix=Hp(R);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Tx=R,Rx=Symbol.for("react.element"),$x=Symbol.for("react.fragment"),Ox=Object.prototype.hasOwnProperty,Dx=Tx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ax={key:!0,ref:!0,__self:!0,__source:!0};function Zp(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Ox.call(t,r)&&!Ax.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:Rx,type:e,key:s,ref:o,props:i,_owner:Dx.current}}Ll.Fragment=$x;Ll.jsx=Zp;Ll.jsxs=Zp;Bp.exports=Ll;var p=Bp.exports,Cr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yr=typeof window>"u"||"Deno"in globalThis;function pt(){}function Lx(e,t){return typeof e=="function"?e(t):e}function lu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Jp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ur(e,t){return typeof e=="function"?e(t):e}function Ct(e,t){return typeof e=="function"?e(t):e}function df(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Lc(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 Lc(e,t){return((t==null?void 0:t.queryKeyHashFn)||vr)(e)}function vr(e){return JSON.stringify(e,(t,n)=>au(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 Fc(e,t){if(e===t)return e;const n=hf(e)&&hf(t);if(n||au(e)&&au(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]=Fc(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&a++)}return i===o&&a===i?e:l}return t}function Jo(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 au(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 Fx(e){return new Promise(t=>{setTimeout(t,e)})}function uu(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Fc(e,t):t}function Hx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Bx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hc=Symbol();function e0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Hc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sr,Cn,Jr,Pp,Vx=(Pp=class extends Cr{constructor(){super();K(this,sr);K(this,Cn);K(this,Jr);V(this,Jr,t=>{if(!yr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Cn)||this.setEventListener(C(this,Jr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Cn))==null||t.call(this),V(this,Cn,void 0))}setEventListener(t){var n;V(this,Jr,t),(n=C(this,Cn))==null||n.call(this),V(this,Cn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,sr)!==t&&(V(this,sr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,sr)=="boolean"?C(this,sr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sr=new WeakMap,Cn=new WeakMap,Jr=new WeakMap,Pp),Bc=new Vx,ei,bn,ti,zp,Ux=(zp=class extends Cr{constructor(){super();K(this,ei,!0);K(this,bn);K(this,ti);V(this,ti,t=>{if(!yr&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,bn)||this.setEventListener(C(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,bn))==null||t.call(this),V(this,bn,void 0))}setEventListener(t){var n;V(this,ti,t),(n=C(this,bn))==null||n.call(this),V(this,bn,t(this.setOnline.bind(this)))}setOnline(t){C(this,ei)!==t&&(V(this,ei,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,ei)}},ei=new WeakMap,bn=new WeakMap,ti=new WeakMap,zp),el=new Ux;function cu(){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 Qx(e){return Math.min(1e3*2**e,3e4)}function t0(e){return(e??"online")==="online"?el.isOnline():!0}var n0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function _a(e){return e instanceof n0}function r0(e){let t=!1,n=0,r=!1,i;const s=cu(),o=v=>{var S;r||(c(new n0(v)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},a=()=>{t=!1},u=()=>Bc.isFocused()&&(e.networkMode==="always"||el.isOnline())&&e.canRun(),f=()=>t0(e.networkMode)&&e.canRun(),d=v=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,v),i==null||i(),s.resolve(v))},c=v=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,v),i==null||i(),s.reject(v))},h=()=>new Promise(v=>{var S;i=m=>{(r||u())&&v(m)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),y=()=>{if(r)return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var M;if(r)return;const x=e.retry??(yr?0:3),g=e.retryDelay??Qx,w=typeof g=="function"?g(n,m):g,_=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,m);if(t||!_){c(m);return}n++,(M=e.onFail)==null||M.call(e,n,m),Fx(w).then(()=>u()?void 0:h()).then(()=>{t?c(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 Wx(){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=Wx(),or,Ip,i0=(Ip=class{constructor(){K(this,or)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lu(this.gcTime)&&V(this,or,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yr?1/0:5*60*1e3))}clearGcTimeout(){C(this,or)&&(clearTimeout(C(this,or)),V(this,or,void 0))}},or=new WeakMap,Ip),ni,ri,dt,Ae,Bs,lr,Et,qt,Tp,qx=(Tp=class extends i0{constructor(t){super();K(this,Et);K(this,ni);K(this,ri);K(this,dt);K(this,Ae);K(this,Bs);K(this,lr);V(this,lr,!1),V(this,Bs,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,ni,Xx(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,Bs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,dt).remove(this)}setData(t,n){const r=uu(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===Hc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Jp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Ae)&&(C(this,lr)?C(this,Ae).cancel({revert:!0}):C(this,Ae).cancelRetry()),this.scheduleGc()),C(this,dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ee(this,Et,qt).call(this,{type:"invalidate"})}fetch(t,n){var a,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ae))return C(this,Ae).continueRetry(),C(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(c=>c.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(V(this,lr,!0),r.signal)})},s=()=>{const d=e0(this.options,n),c={queryKey:this.queryKey,meta:this.meta};return i(c),V(this,lr,!1),this.options.persister?this.options.persister(d,c,this):d(c)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(a=this.options.behavior)==null||a.onFetch(o,this),V(this,ri,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&ee(this,Et,qt).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=d=>{var c,h,y,v;_a(d)&&d.silent||ee(this,Et,qt).call(this,{type:"error",error:d}),_a(d)||((h=(c=C(this,dt).config).onError)==null||h.call(c,d,this),(v=(y=C(this,dt).config).onSettled)==null||v.call(y,this.state.data,d,this)),this.scheduleGc()};return V(this,Ae,r0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var c,h,y,v;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(S){l(S);return}(h=(c=C(this,dt).config).onSuccess)==null||h.call(c,d,this),(v=(y=C(this,dt).config).onSettled)==null||v.call(y,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,c)=>{ee(this,Et,qt).call(this,{type:"failed",failureCount:d,error:c})},onPause:()=>{ee(this,Et,qt).call(this,{type:"pause"})},onContinue:()=>{ee(this,Et,qt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),C(this,Ae).start()}},ni=new WeakMap,ri=new WeakMap,dt=new WeakMap,Ae=new WeakMap,Bs=new WeakMap,lr=new WeakMap,Et=new WeakSet,qt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...s0(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return _a(i)&&i.revert&&C(this,ri)?{...C(this,ri),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,dt).notify({query:this,type:"updated",action:t})})},Tp);function s0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:t0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dt,Rp,Yx=(Rp=class extends Cr{constructor(t={}){super();K(this,Dt);this.config=t,V(this,Dt,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Lc(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,Rp),At,He,ar,Lt,xn,$p,Kx=($p=class extends i0{constructor(t){super();K(this,Lt);K(this,At);K(this,He);K(this,ar);this.mutationId=t.mutationId,V(this,He,t.mutationCache),V(this,At,[]),this.state=t.state||o0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,At).includes(t)||(C(this,At).push(t),this.clearGcTimeout(),C(this,He).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,At,C(this,At).filter(n=>n!==t)),this.scheduleGc(),C(this,He).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,At).length||(this.state.status==="pending"?this.scheduleGc():C(this,He).remove(this))}continue(){var t;return((t=C(this,ar))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,l,a,u,f,d,c,h,y,v,S,m,x,g,w,_,M,N;V(this,ar,r0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(b,I)=>{ee(this,Lt,xn).call(this,{type:"failed",failureCount:b,error:I})},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 I=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));I!==this.state.context&&ee(this,Lt,xn).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const b=await C(this,ar).start();return await((u=(a=C(this,He).config).onSuccess)==null?void 0:u.call(a,b,t,this.state.context,this)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,b,t,this.state.context)),await((h=(c=C(this,He).config).onSettled)==null?void 0:h.call(c,b,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.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=(S=C(this,He).config).onError)==null?void 0:m.call(S,b,t,this.state.context,this)),await((g=(x=this.options).onError)==null?void 0:g.call(x,b,t,this.state.context)),await((_=(w=C(this,He).config).onSettled)==null?void 0:_.call(w,void 0,b,this.state.variables,this.state.context,this)),await((N=(M=this.options).onSettled)==null?void 0:N.call(M,void 0,b,t,this.state.context)),b}finally{ee(this,Lt,xn).call(this,{type:"error",error:b})}}finally{C(this,He).runNext(this)}}},At=new WeakMap,He=new WeakMap,ar=new WeakMap,Lt=new WeakSet,xn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ke.batch(()=>{C(this,At).forEach(r=>{r.onMutationUpdate(t)}),C(this,He).notify({mutation:this,type:"updated",action:t})})},$p);function o0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nt,Vs,Op,Gx=(Op=class extends Cr{constructor(t={}){super();K(this,nt);K(this,Vs);this.config=t,V(this,nt,new Map),V(this,Vs,Date.now())}build(t,n,r){const i=new Kx({mutationCache:this,mutationId:++oo(this,Vs)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=ao(t),r=C(this,nt).get(n)??[];r.push(t),C(this,nt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ao(t);if(C(this,nt).has(n)){const i=(r=C(this,nt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?C(this,nt).delete(n):C(this,nt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=C(this,nt).get(ao(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=C(this,nt).get(ao(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,nt).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))))}},nt=new WeakMap,Vs=new WeakMap,Op);function ao(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function mf(e){return{onFetch:(t,n)=>{var f,d,c,h,y;const r=t.options,i=(c=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:c.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let v=!1;const S=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},m=e0(t.options,t.fetchOptions),x=async(g,w,_)=>{if(v)return Promise.reject();if(w==null&&g.pages.length)return Promise.resolve(g);const M={queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};S(M);const N=await m(M),{maxPages:b}=t.options,I=_?Bx:Hx;return{pages:I(g.pages,N,b),pageParams:I(g.pageParams,w,b)}};if(i&&s.length){const g=i==="backward",w=g?Zx:gf,_={pages:s,pageParams:o},M=w(r,_);l=await x(_,M,g)}else{const g=e??s.length;do{const w=a===0?o[0]??r.initialPageParam:gf(r,l);if(a>0&&w==null)break;l=await x(l,w),a++}while(a<g)}return l};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,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 Zx(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var we,jn,Mn,ii,si,Pn,oi,li,Dp,Jx=(Dp=class{constructor(e={}){K(this,we);K(this,jn);K(this,Mn);K(this,ii);K(this,si);K(this,Pn);K(this,oi);K(this,li);V(this,we,e.queryCache||new Yx),V(this,jn,e.mutationCache||new Gx),V(this,Mn,e.defaultOptions||{}),V(this,ii,new Map),V(this,si,new Map),V(this,Pn,0)}mount(){oo(this,Pn)._++,C(this,Pn)===1&&(V(this,oi,Bc.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onFocus())})),V(this,li,el.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onOnline())})))}unmount(){var e,t;oo(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=Lx(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 el.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=Lc(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===Hc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,we).clear(),C(this,jn).clear()}},we=new WeakMap,jn=new WeakMap,Mn=new WeakMap,ii=new WeakMap,si=new WeakMap,Pn=new WeakMap,oi=new WeakMap,li=new WeakMap,Dp),qe,ie,Us,Be,ur,ai,zn,Ft,Qs,ui,ci,cr,dr,In,di,ue,Xi,du,fu,hu,pu,mu,gu,yu,l0,Ap,Vc=(Ap=class extends Cr{constructor(t,n){super();K(this,ue);K(this,qe);K(this,ie);K(this,Us);K(this,Be);K(this,ur);K(this,ai);K(this,zn);K(this,Ft);K(this,Qs);K(this,ui);K(this,ci);K(this,cr);K(this,dr);K(this,In);K(this,di,new Set);this.options=n,V(this,qe,t),V(this,Ft,null),V(this,zn,cu()),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,pu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vu(C(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vu(C(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ee(this,ue,mu).call(this),ee(this,ue,gu).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,yu).call(this),C(this,ie).setOptions(this.options),r._defaulted&&!Jo(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,du).call(this);const o=ee(this,ue,fu).call(this);s&&(C(this,ie)!==i||Ct(this.options.enabled,C(this,ie))!==Ct(r.enabled,C(this,ie))||o!==C(this,In))&&ee(this,ue,hu).call(this,o)}getOptimisticResult(t){const n=C(this,qe).getQueryCache().build(C(this,qe),t),r=this.createResult(n,t);return tw(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,Us),{state:f}=t;let d={...f},c=!1,h;if(n._optimisticResults){const I=this.hasListeners(),z=!I&&yf(t,n),D=I&&vf(t,r,n,i);(z||D)&&(d={...d,...s0(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:S}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(o==null?void 0:o.data)&&n.select===C(this,Qs))h=C(this,ui);else try{V(this,Qs,n.select),h=n.select(d.data),h=uu(s==null?void 0:s.data,h,n),V(this,ui,h),V(this,Ft,null)}catch(I){V(this,Ft,I)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let I;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))I=s.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((b=C(this,ci))==null?void 0:b.state.data,C(this,ci)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),V(this,Ft,null)}catch(z){V(this,Ft,z)}I!==void 0&&(S="success",h=uu(s==null?void 0:s.data,I,n),c=!0)}C(this,Ft)&&(y=C(this,Ft),h=C(this,ui),v=Date.now(),S="error");const m=d.fetchStatus==="fetching",x=S==="pending",g=S==="error",w=x&&m,_=h!==void 0,N={status:S,fetchStatus:d.fetchStatus,isPending:x,isSuccess:S==="success",isError:g,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!x,isLoadingError:g&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:c,isRefetchError:g&&_,isStale:Uc(t,n),refetch:this.refetch,promise:C(this,zn)};if(this.options.experimental_prefetchInRender){const I=F=>{N.status==="error"?F.reject(N.error):N.data!==void 0&&F.resolve(N.data)},z=()=>{const F=V(this,zn,N.promise=cu());I(F)},D=C(this,zn);switch(D.status){case"pending":t.queryHash===r.queryHash&&I(D);break;case"fulfilled":(N.status==="error"||N.data!==D.value)&&z();break;case"rejected":(N.status!=="error"||N.error!==D.reason)&&z();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)),Jo(r,n))return;V(this,Be,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!C(this,di).size)return!0;const a=new Set(l??C(this,di));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Be)).some(u=>{const f=u;return C(this,Be)[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ee(this,ue,l0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ee(this,ue,pu).call(this)}},qe=new WeakMap,ie=new WeakMap,Us=new WeakMap,Be=new WeakMap,ur=new WeakMap,ai=new WeakMap,zn=new WeakMap,Ft=new WeakMap,Qs=new WeakMap,ui=new WeakMap,ci=new WeakMap,cr=new WeakMap,dr=new WeakMap,In=new WeakMap,di=new WeakMap,ue=new WeakSet,Xi=function(t){ee(this,ue,yu).call(this);let n=C(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pt)),n},du=function(){ee(this,ue,mu).call(this);const t=Ur(this.options.staleTime,C(this,ie));if(yr||C(this,Be).isStale||!lu(t))return;const r=Jp(C(this,Be).dataUpdatedAt,t)+1;V(this,cr,setTimeout(()=>{C(this,Be).isStale||this.updateResult()},r))},fu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ie)):this.options.refetchInterval)??!1},hu=function(t){ee(this,ue,gu).call(this),V(this,In,t),!(yr||Ct(this.options.enabled,C(this,ie))===!1||!lu(C(this,In))||C(this,In)===0)&&V(this,dr,setInterval(()=>{(this.options.refetchIntervalInBackground||Bc.isFocused())&&ee(this,ue,Xi).call(this)},C(this,In)))},pu=function(){ee(this,ue,du).call(this),ee(this,ue,hu).call(this,ee(this,ue,fu).call(this))},mu=function(){C(this,cr)&&(clearTimeout(C(this,cr)),V(this,cr,void 0))},gu=function(){C(this,dr)&&(clearInterval(C(this,dr)),V(this,dr,void 0))},yu=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,Us,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},l0=function(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Be))}),C(this,qe).getQueryCache().notify({query:C(this,ie),type:"observerResultsUpdated"})})},Ap);function ew(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 ew(e,t)||e.state.data!==void 0&&vu(e,t,t.refetchOnMount)}function vu(e,t,n){if(Ct(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Uc(e,t)}return!1}function vf(e,t,n,r){return(e!==t||Ct(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Uc(e,n)}function Uc(e,t){return Ct(t.enabled,e)!==!1&&e.isStaleByTime(Ur(t.staleTime,e))}function tw(e,t){return!Jo(e.getCurrentResult(),t)}function xf(e,t){return e.filter(n=>!t.includes(n))}function nw(e,t,n){const r=e.slice(0);return r[t]=n,r}var fi,ft,fr,hi,ht,Tn,Ws,qs,ze,xu,wu,Do,Su,ku,Lp,rw=(Lp=class extends Cr{constructor(t,n,r){super();K(this,ze);K(this,fi);K(this,ft);K(this,fr);K(this,hi);K(this,ht);K(this,Tn);K(this,Ws);K(this,qs);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,Su).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,Do).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,Su).call(this,u,f)})}),ee(this,ze,ku).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,Do).call(this,t).map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[i,s=>ee(this,ze,wu).call(this,s??i,n),()=>ee(this,ze,xu).call(this,i,t)]}},fi=new WeakMap,ft=new WeakMap,fr=new WeakMap,hi=new WeakMap,ht=new WeakMap,Tn=new WeakMap,Ws=new WeakMap,qs=new WeakMap,ze=new WeakSet,xu=function(t,n){const r=ee(this,ze,Do).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)})})})},wu=function(t,n){return n?((!C(this,Tn)||C(this,ft)!==C(this,qs)||n!==C(this,Ws))&&(V(this,Ws,n),V(this,qs,C(this,ft)),V(this,Tn,Fc(C(this,Tn),n(t)))),C(this,Tn)):t},Do=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 Vc(C(this,fi),s)})}),r},Su=function(t,n){const r=C(this,ht).indexOf(t);r!==-1&&(V(this,ft,nw(C(this,ft),r,n)),ee(this,ze,ku).call(this))},ku=function(){var t;if(this.hasListeners()){const n=C(this,Tn),r=ee(this,ze,wu).call(this,ee(this,ze,xu).call(this,C(this,ft),C(this,fr)),(t=C(this,hi))==null?void 0:t.combine);n!==r&&ke.batch(()=>{this.listeners.forEach(i=>{i(C(this,ft))})})}},Lp),Rn,$n,Xe,Kt,rn,Ao,Eu,Fp,iw=(Fp=class extends Cr{constructor(n,r){super();K(this,rn);K(this,Rn);K(this,$n);K(this,Xe);K(this,Kt);V(this,Rn,n),this.setOptions(r),this.bindMethods(),ee(this,rn,Ao).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),Jo(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,Ao).call(this),ee(this,rn,Eu).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,Ao).call(this),ee(this,rn,Eu).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,Ao=function(){var r;const n=((r=C(this,Xe))==null?void 0:r.state)??o0();V(this,$n,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Eu=function(n){ke.batch(()=>{var r,i,s,o,l,a,u,f;if(C(this,Kt)&&this.hasListeners()){const d=C(this,$n).variables,c=C(this,$n).context;(n==null?void 0:n.type)==="success"?((i=(r=C(this,Kt)).onSuccess)==null||i.call(r,n.data,d,c),(o=(s=C(this,Kt)).onSettled)==null||o.call(s,n.data,null,d,c)):(n==null?void 0:n.type)==="error"&&((a=(l=C(this,Kt)).onError)==null||a.call(l,n.error,d,c),(f=(u=C(this,Kt)).onSettled)==null||f.call(u,void 0,n.error,d,c))}this.listeners.forEach(d=>{d(C(this,$n))})})},Fp),a0=R.createContext(void 0),Ys=e=>{const t=R.useContext(a0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sw=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(a0.Provider,{value:e,children:t})),u0=R.createContext(!1),c0=()=>R.useContext(u0);u0.Provider;function ow(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lw=R.createContext(ow()),d0=()=>R.useContext(lw);function f0(e,t){return typeof e=="function"?e(...t):!!e}function tl(){}var h0=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},p0=e=>{R.useEffect(()=>{e.clearReset()},[e])},m0=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&f0(n,[e.error,r]),g0=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},y0=(e,t)=>e.isLoading&&e.isFetching&&!t,_u=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function v0({queries:e,...t},n){const r=Ys(),i=c0(),s=d0(),o=R.useMemo(()=>e.map(y=>{const v=r.defaultQueryOptions(y);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[e,r,i]);o.forEach(y=>{g0(y),h0(y,s)}),p0(s);const[l]=R.useState(()=>new rw(r,o,t)),[a,u,f]=l.getOptimisticResult(o,t.combine);R.useSyncExternalStore(R.useCallback(y=>i?tl:l.subscribe(ke.batchCalls(y)),[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,t,{listeners:!1})},[o,t,l]);const c=a.some((y,v)=>_u(o[v],y))?a.flatMap((y,v)=>{const S=o[v];if(S){const m=new Vc(r,S);if(_u(S,y))return nl(S,m,s);y0(y,i)&&nl(S,m,s)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=a.find((y,v)=>{const S=o[v];return S&&m0({result:y,errorResetBoundary:s,throwOnError:S.throwOnError,query:r.getQueryCache().get(S.queryHash)})});if(h!=null&&h.error)throw h.error;return u(f())}function aw(e,t,n){var f,d,c,h,y;const r=Ys(),i=c0(),s=d0(),o=r.defaultQueryOptions(e);(d=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||d.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",g0(o),h0(o,s),p0(s);const l=!r.getQueryCache().get(o.queryHash),[a]=R.useState(()=>new t(r,o)),u=a.getOptimisticResult(o);if(R.useSyncExternalStore(R.useCallback(v=>{const S=i?tl:a.subscribe(ke.batchCalls(v));return a.updateResult(),S},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),R.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),_u(o,u))throw nl(o,a,s);if(m0({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((h=(c=r.getDefaultOptions().queries)==null?void 0:c._experimental_afterQuery)==null||h.call(c,o,u),o.experimental_prefetchInRender&&!yr&&y0(u,i)){const v=l?nl(o,a,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;v==null||v.catch(tl).finally(()=>{a.updateResult()})}return o.notifyOnChangeProps?u:a.trackResult(u)}function pi(e,t){return aw(e,Vc)}function Yi(e,t){const n=Ys(),[r]=R.useState(()=>new iw(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(tl)},[r]);if(i.error&&f0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var x0={exports:{}},ut={},w0={exports:{}},S0={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(k,j){var T=k.length;k.push(j);e:for(;0<T;){var A=T-1>>>1,H=k[A];if(0<i(H,j))k[A]=j,k[T]=H,T=A;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var j=k[0],T=k.pop();if(T!==j){k[0]=T;e:for(var A=0,H=k.length,Y=H>>>1;A<Y;){var U=2*(A+1)-1,W=k[U],X=U+1,Z=k[X];if(0>i(W,T))X<H&&0>i(Z,W)?(k[A]=Z,k[X]=T,A=X):(k[A]=W,k[U]=T,A=U);else if(X<H&&0>i(Z,T))k[A]=Z,k[X]=T,A=X;else break e}}return j}function i(k,j){var T=k.sortIndex-j.sortIndex;return T!==0?T:k.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],f=1,d=null,c=3,h=!1,y=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(k){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=k)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function w(k){if(v=!1,g(k),!y)if(n(a)!==null)y=!0,P(_);else{var j=n(u);j!==null&&O(w,j.startTime-k)}}function _(k,j){y=!1,v&&(v=!1,m(b),b=-1),h=!0;var T=c;try{for(g(j),d=n(a);d!==null&&(!(d.expirationTime>j)||k&&!D());){var A=d.callback;if(typeof A=="function"){d.callback=null,c=d.priorityLevel;var H=A(d.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),g(j)}else r(a);d=n(a)}if(d!==null)var Y=!0;else{var U=n(u);U!==null&&O(w,U.startTime-j),Y=!1}return Y}finally{d=null,c=T,h=!1}}var M=!1,N=null,b=-1,I=5,z=-1;function D(){return!(e.unstable_now()-z<I)}function F(){if(N!==null){var k=e.unstable_now();z=k;var j=!0;try{j=N(!0,k)}finally{j?L():(M=!1,N=null)}}else M=!1}var L;if(typeof x=="function")L=function(){x(F)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=F,L=function(){$.postMessage(null)}}else L=function(){S(F,0)};function P(k){N=k,M||(M=!0,L())}function O(k,j){b=S(function(){k(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,P(_))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return c},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(k){switch(c){case 1:case 2:case 3:var j=3;break;default:j=c}var T=c;c=j;try{return k()}finally{c=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,j){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var T=c;c=k;try{return j()}finally{c=T}},e.unstable_scheduleCallback=function(k,j,T){var A=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?A+T:A):T=A,k){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=T+H,k={id:f++,callback:j,priorityLevel:k,startTime:T,expirationTime:H,sortIndex:-1},T>A?(k.sortIndex=T,t(u,k),n(a)===null&&k===n(u)&&(v?(m(b),b=-1):v=!0,O(w,T-A))):(k.sortIndex=H,t(a,k),y||h||(y=!0,P(_))),k},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(k){var j=c;return function(){var T=c;c=j;try{return k.apply(this,arguments)}finally{c=T}}}})(S0);w0.exports=S0;var uw=w0.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 cw=R,lt=uw;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 k0=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++)k0.add(t[e])}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nu=Object.prototype.hasOwnProperty,dw=/^[: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 fw(e){return Nu.call(Sf,e)?!0:Nu.call(wf,e)?!1:dw.test(e)?Sf[e]=!0:(wf[e]=!0,!1)}function hw(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 pw(e,t,n,r){if(t===null||typeof t>"u"||hw(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 Qc=/[\-:]([a-z])/g;function Wc(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(Qc,Wc);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(Qc,Wc);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(Qc,Wc);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 qc(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")&&(pw(t,n,i,r)&&(n=null),r||i===null?fw(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=cw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,uo=Symbol.for("react.element"),Pr=Symbol.for("react.portal"),zr=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Cu=Symbol.for("react.profiler"),E0=Symbol.for("react.provider"),_0=Symbol.for("react.context"),Yc=Symbol.for("react.forward_ref"),bu=Symbol.for("react.suspense"),ju=Symbol.for("react.suspense_list"),Kc=Symbol.for("react.memo"),wn=Symbol.for("react.lazy"),N0=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,Na;function Ki(e){if(Na===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Na=t&&t[1]||""}return`
|
|
34
|
+
`+Na+e}var Ca=!1;function ba(e,t){if(!e||Ca)return"";Ca=!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{Ca=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ki(e):""}function mw(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=ba(e.type,!1),e;case 11:return e=ba(e.type.render,!1),e;case 1:return e=ba(e.type,!0),e;default:return""}}function Mu(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 Cu:return"Profiler";case Xc:return"StrictMode";case bu:return"Suspense";case ju:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _0:return(e.displayName||"Context")+".Consumer";case E0:return(e._context.displayName||"Context")+".Provider";case Yc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Kc:return t=e.displayName||null,t!==null?t:Mu(e.type)||"Memo";case wn:t=e._payload,e=e._init;try{return Mu(e(t))}catch{}}return null}function gw(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 Mu(t);case 8:return t===Xc?"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 C0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yw(e){var t=C0(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 co(e){e._valueTracker||(e._valueTracker=yw(e))}function b0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=C0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function rl(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 Pu(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 j0(e,t){t=t.checked,t!=null&&qc(e,"checked",t,!1)}function zu(e,t){j0(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")?Iu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Iu(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 Iu(e,t,n){(t!=="number"||rl(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 M0(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 P0(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 Ru(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?P0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var fo,z0=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(fo=fo||document.createElement("div"),fo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fo.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},vw=["Webkit","ms","Moz","O"];Object.keys(ns).forEach(function(e){vw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ns[t]=ns[e]})});function I0(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 T0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=I0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var xw=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 $u(e,t){if(t){if(xw[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 Ou(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 Du=null;function Gc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Au=null,Wr=null,qr=null;function bf(e){if(e=Zs(e)){if(typeof Au!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ul(t),Au(e.stateNode,e.type,t))}}function R0(e){Wr?qr?qr.push(e):qr=[e]:Wr=e}function $0(){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 O0(e,t){return e(t)}function D0(){}var ja=!1;function A0(e,t,n){if(ja)return e(t,n);ja=!0;try{return O0(e,t,n)}finally{ja=!1,(Wr!==null||qr!==null)&&(D0(),$0())}}function gs(e,t){var n=e.stateNode;if(n===null)return null;var r=Ul(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 Lu=!1;if(sn)try{var Li={};Object.defineProperty(Li,"passive",{get:function(){Lu=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Lu=!1}function ww(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,il=null,sl=!1,Fu=null,Sw={onError:function(e){rs=!0,il=e}};function kw(e,t,n,r,i,s,o,l,a){rs=!1,il=null,ww.apply(Sw,arguments)}function Ew(e,t,n,r,i,s,o,l,a){if(kw.apply(this,arguments),rs){if(rs){var u=il;rs=!1,il=null}else throw Error(B(198));sl||(sl=!0,Fu=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 L0(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 _w(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 F0(e){return e=_w(e),e!==null?H0(e):null}function H0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=H0(e);if(t!==null)return t;e=e.sibling}return null}var B0=lt.unstable_scheduleCallback,Mf=lt.unstable_cancelCallback,Nw=lt.unstable_shouldYield,Cw=lt.unstable_requestPaint,_e=lt.unstable_now,bw=lt.unstable_getCurrentPriorityLevel,Zc=lt.unstable_ImmediatePriority,V0=lt.unstable_UserBlockingPriority,ol=lt.unstable_NormalPriority,jw=lt.unstable_LowPriority,U0=lt.unstable_IdlePriority,Fl=null,Bt=null;function Mw(e){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Fl,e,void 0,(e.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:Iw,Pw=Math.log,zw=Math.LN2;function Iw(e){return e>>>=0,e===0?32:31-(Pw(e)/zw|0)|0}var ho=64,po=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 ll(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 Tw(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 Rw(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]=Tw(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function Hu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Q0(){var e=ho;return ho<<=1,!(ho&4194240)&&(ho=64),e}function Ma(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ks(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 $w(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 Jc(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 W0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var q0,ed,X0,Y0,K0,Bu=!1,mo=[],An=null,Ln=null,Fn=null,ys=new Map,vs=new Map,En=[],Ow="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=Zs(t),t!==null&&ed(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dw(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 G0(e){var t=tr(e.target);if(t!==null){var n=jr(t);if(n!==null){if(t=n.tag,t===13){if(t=L0(n),t!==null){e.blockedOn=t,K0(e.priority,function(){X0(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 Lo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Du=r,n.target.dispatchEvent(r),Du=null}else return t=Zs(n),t!==null&&ed(t),e.blockedOn=n,!1;t.shift()}return!0}function zf(e,t,n){Lo(e)&&n.delete(t)}function Aw(){Bu=!1,An!==null&&Lo(An)&&(An=null),Ln!==null&&Lo(Ln)&&(Ln=null),Fn!==null&&Lo(Fn)&&(Fn=null),ys.forEach(zf),vs.forEach(zf)}function Hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Bu||(Bu=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,Aw)))}function xs(e){function t(i){return Hi(i,e)}if(0<mo.length){Hi(mo[0],e);for(var n=1;n<mo.length;n++){var r=mo[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);)G0(n),n.blockedOn===null&&En.shift()}var Xr=cn.ReactCurrentBatchConfig,al=!0;function Lw(e,t,n,r){var i=ce,s=Xr.transition;Xr.transition=null;try{ce=1,td(e,t,n,r)}finally{ce=i,Xr.transition=s}}function Fw(e,t,n,r){var i=ce,s=Xr.transition;Xr.transition=null;try{ce=4,td(e,t,n,r)}finally{ce=i,Xr.transition=s}}function td(e,t,n,r){if(al){var i=Vu(e,t,n,r);if(i===null)La(e,t,r,ul,n),Pf(e,r);else if(Dw(i,e,t,n,r))r.stopPropagation();else if(Pf(e,r),t&4&&-1<Ow.indexOf(e)){for(;i!==null;){var s=Zs(i);if(s!==null&&q0(s),s=Vu(e,t,n,r),s===null&&La(e,t,r,ul,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else La(e,t,r,null,n)}}var ul=null;function Vu(e,t,n,r){if(ul=null,e=Gc(r),e=tr(e),e!==null)if(t=jr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=L0(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 ul=e,null}function Z0(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(bw()){case Zc:return 1;case V0:return 4;case ol:case jw:return 16;case U0:return 536870912;default:return 16}default:return 16}}var On=null,nd=null,Fo=null;function J0(){if(Fo)return Fo;var e,t=nd,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 Fo=i.slice(e,1<r?1-r:void 0)}function Ho(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 go(){return!0}function If(){return!1}function ct(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?go:If,this.isPropagationStopped=If,this}return xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=go)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=go)},persist:function(){},isPersistent:go}),t}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rd=ct(zi),Gs=xe({},zi,{view:0,detail:0}),Hw=ct(Gs),Pa,za,Bi,Hl=xe({},Gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:id,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"?(Pa=e.screenX-Bi.screenX,za=e.screenY-Bi.screenY):za=Pa=0,Bi=e),Pa)},movementY:function(e){return"movementY"in e?e.movementY:za}}),Tf=ct(Hl),Bw=xe({},Hl,{dataTransfer:0}),Vw=ct(Bw),Uw=xe({},Gs,{relatedTarget:0}),Ia=ct(Uw),Qw=xe({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ww=ct(Qw),qw=xe({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xw=ct(qw),Yw=xe({},zi,{data:0}),Rf=ct(Yw),Kw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gw={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"},Zw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zw[e])?!!t[e]:!1}function id(){return Jw}var e1=xe({},Gs,{key:function(e){if(e.key){var t=Kw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ho(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:id,charCode:function(e){return e.type==="keypress"?Ho(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ho(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t1=ct(e1),n1=xe({},Hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$f=ct(n1),r1=xe({},Gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:id}),i1=ct(r1),s1=xe({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),o1=ct(s1),l1=xe({},Hl,{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}),a1=ct(l1),u1=[9,13,27,32],sd=sn&&"CompositionEvent"in window,is=null;sn&&"documentMode"in document&&(is=document.documentMode);var c1=sn&&"TextEvent"in window&&!is,em=sn&&(!sd||is&&8<is&&11>=is),Of=" ",Df=!1;function tm(e,t){switch(e){case"keyup":return u1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function d1(e,t){switch(e){case"compositionend":return nm(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 f1(e,t){if(Ir)return e==="compositionend"||!sd&&tm(e,t)?(e=J0(),Fo=nd=On=null,Ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return em&&t.locale!=="ko"?null:t.data;default:return null}}var h1={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"?!!h1[e.type]:t==="textarea"}function rm(e,t,n,r){R0(r),t=cl(t,"onChange"),0<t.length&&(n=new rd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ss=null,ws=null;function p1(e){pm(e,0)}function Bl(e){var t=$r(e);if(b0(t))return e}function m1(e,t){if(e==="change")return t}var im=!1;if(sn){var Ta;if(sn){var Ra="oninput"in document;if(!Ra){var Lf=document.createElement("div");Lf.setAttribute("oninput","return;"),Ra=typeof Lf.oninput=="function"}Ta=Ra}else Ta=!1;im=Ta&&(!document.documentMode||9<document.documentMode)}function Ff(){ss&&(ss.detachEvent("onpropertychange",sm),ws=ss=null)}function sm(e){if(e.propertyName==="value"&&Bl(ws)){var t=[];rm(t,ws,e,Gc(e)),A0(p1,t)}}function g1(e,t,n){e==="focusin"?(Ff(),ss=t,ws=n,ss.attachEvent("onpropertychange",sm)):e==="focusout"&&Ff()}function y1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(ws)}function v1(e,t){if(e==="click")return Bl(t)}function x1(e,t){if(e==="input"||e==="change")return Bl(t)}function w1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:w1;function Ss(e,t){if(It(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Nu.call(t,i)||!It(e[i],t[i]))return!1}return!0}function Hf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bf(e,t){var n=Hf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hf(n)}}function om(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?om(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lm(){for(var e=window,t=rl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=rl(e.document)}return t}function od(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 S1(e){var t=lm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&om(n.ownerDocument.documentElement,n)){if(r!==null&&od(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 k1=sn&&"documentMode"in document&&11>=document.documentMode,Tr=null,Uu=null,os=null,Qu=!1;function Vf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qu||Tr==null||Tr!==rl(r)||(r=Tr,"selectionStart"in r&&od(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=cl(Uu,"onSelect"),0<r.length&&(t=new rd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function yo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rr={animationend:yo("Animation","AnimationEnd"),animationiteration:yo("Animation","AnimationIteration"),animationstart:yo("Animation","AnimationStart"),transitionend:yo("Transition","TransitionEnd")},$a={},am={};sn&&(am=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 Vl(e){if($a[e])return $a[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in am)return $a[e]=t[n];return e}var um=Vl("animationend"),cm=Vl("animationiteration"),dm=Vl("animationstart"),fm=Vl("transitionend"),hm=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){hm.set(e,t),br(t,[e])}for(var Oa=0;Oa<Uf.length;Oa++){var Da=Uf[Oa],E1=Da.toLowerCase(),_1=Da[0].toUpperCase()+Da.slice(1);Yn(E1,"on"+_1)}Yn(um,"onAnimationEnd");Yn(cm,"onAnimationIteration");Yn(dm,"onAnimationStart");Yn("dblclick","onDoubleClick");Yn("focusin","onFocus");Yn("focusout","onBlur");Yn(fm,"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(" "),N1=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,Ew(r,t,void 0,e),e.currentTarget=null}function pm(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(sl)throw e=Fu,sl=!1,Fu=null,e}function he(e,t){var n=t[Ku];n===void 0&&(n=t[Ku]=new Set);var r=e+"__bubble";n.has(r)||(mm(t,e,2,!1),n.add(r))}function Aa(e,t,n){var r=0;t&&(r|=4),mm(n,e,r,t)}var vo="_reactListening"+Math.random().toString(36).slice(2);function ks(e){if(!e[vo]){e[vo]=!0,k0.forEach(function(n){n!=="selectionchange"&&(N1.has(n)||Aa(n,!1,e),Aa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[vo]||(t[vo]=!0,Aa("selectionchange",!1,t))}}function mm(e,t,n,r){switch(Z0(t)){case 1:var i=Lw;break;case 4:i=Fw;break;default:i=td}n=i.bind(null,t,n,e),i=void 0,!Lu||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 La(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}A0(function(){var u=s,f=Gc(n),d=[];e:{var c=hm.get(e);if(c!==void 0){var h=rd,y=e;switch(e){case"keypress":if(Ho(n)===0)break e;case"keydown":case"keyup":h=t1;break;case"focusin":y="focus",h=Ia;break;case"focusout":y="blur",h=Ia;break;case"beforeblur":case"afterblur":h=Ia;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Tf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Vw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=i1;break;case um:case cm:case dm:h=Ww;break;case fm:h=o1;break;case"scroll":h=Hw;break;case"wheel":h=a1;break;case"copy":case"cut":case"paste":h=Xw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=$f}var v=(t&4)!==0,S=!v&&e==="scroll",m=v?c!==null?c+"Capture":null:c;v=[];for(var x=u,g;x!==null;){g=x;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=gs(x,m),w!=null&&v.push(Es(x,w,g)))),S)break;x=x.return}0<v.length&&(c=new h(c,y,null,n,f),d.push({event:c,listeners:v}))}}if(!(t&7)){e:{if(c=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",c&&n!==Du&&(y=n.relatedTarget||n.fromElement)&&(tr(y)||y[on]))break e;if((h||c)&&(c=f.window===f?f:(c=f.ownerDocument)?c.defaultView||c.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?tr(y):null,y!==null&&(S=jr(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(v=Tf,w="onMouseLeave",m="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=$f,w="onPointerLeave",m="onPointerEnter",x="pointer"),S=h==null?c:$r(h),g=y==null?c:$r(y),c=new v(w,x+"leave",h,n,f),c.target=S,c.relatedTarget=g,w=null,tr(f)===u&&(v=new v(m,x+"enter",y,n,f),v.target=g,v.relatedTarget=S,w=v),S=w,h&&y)t:{for(v=h,m=y,x=0,g=v;g;g=Mr(g))x++;for(g=0,w=m;w;w=Mr(w))g++;for(;0<x-g;)v=Mr(v),x--;for(;0<g-x;)m=Mr(m),g--;for(;x--;){if(v===m||m!==null&&v===m.alternate)break t;v=Mr(v),m=Mr(m)}v=null}else v=null;h!==null&&Wf(d,c,h,v,!1),y!==null&&S!==null&&Wf(d,S,y,v,!0)}}e:{if(c=u?$r(u):window,h=c.nodeName&&c.nodeName.toLowerCase(),h==="select"||h==="input"&&c.type==="file")var _=m1;else if(Af(c))if(im)_=x1;else{_=y1;var M=g1}else(h=c.nodeName)&&h.toLowerCase()==="input"&&(c.type==="checkbox"||c.type==="radio")&&(_=v1);if(_&&(_=_(e,u))){rm(d,_,n,f);break e}M&&M(e,c,u),e==="focusout"&&(M=c._wrapperState)&&M.controlled&&c.type==="number"&&Iu(c,"number",c.value)}switch(M=u?$r(u):window,e){case"focusin":(Af(M)||M.contentEditable==="true")&&(Tr=M,Uu=u,os=null);break;case"focusout":os=Uu=Tr=null;break;case"mousedown":Qu=!0;break;case"contextmenu":case"mouseup":case"dragend":Qu=!1,Vf(d,n,f);break;case"selectionchange":if(k1)break;case"keydown":case"keyup":Vf(d,n,f)}var N;if(sd)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Ir?tm(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(em&&n.locale!=="ko"&&(Ir||b!=="onCompositionStart"?b==="onCompositionEnd"&&Ir&&(N=J0()):(On=f,nd="value"in On?On.value:On.textContent,Ir=!0)),M=cl(u,b),0<M.length&&(b=new Rf(b,e,null,n,f),d.push({event:b,listeners:M}),N?b.data=N:(N=nm(n),N!==null&&(b.data=N)))),(N=c1?d1(e,n):f1(e,n))&&(u=cl(u,"onBeforeInput"),0<u.length&&(f=new Rf("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=N))}pm(d,t)})}function Es(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cl(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 C1=/\r\n?/g,b1=/\u0000|\uFFFD/g;function qf(e){return(typeof e=="string"?e:""+e).replace(C1,`
|
|
38
|
+
`).replace(b1,"")}function xo(e,t,n){if(t=qf(t),qf(e)!==t&&n)throw Error(B(425))}function dl(){}var Wu=null,qu=null;function Xu(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 Yu=typeof setTimeout=="function"?setTimeout:void 0,j1=typeof clearTimeout=="function"?clearTimeout:void 0,Xf=typeof Promise=="function"?Promise:void 0,M1=typeof queueMicrotask=="function"?queueMicrotask:typeof Xf<"u"?function(e){return Xf.resolve(null).then(e).catch(P1)}:Yu;function P1(e){setTimeout(function(){throw e})}function Fa(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),xs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);xs(t)}function Hn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Yf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ii=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Ii,_s="__reactProps$"+Ii,on="__reactContainer$"+Ii,Ku="__reactEvents$"+Ii,z1="__reactListeners$"+Ii,I1="__reactHandles$"+Ii;function tr(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yf(e);e!==null;){if(n=e[Ht])return n;e=Yf(e)}return t}e=n,n=e.parentNode}return null}function Zs(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 Ul(e){return e[_s]||null}var Gu=[],Or=-1;function Kn(e){return{current:e}}function pe(e){0>Or||(e.current=Gu[Or],Gu[Or]=null,Or--)}function de(e,t){Or++,Gu[Or]=e.current,e.current=t}var qn={},Fe=Kn(qn),Je=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 et(e){return e=e.childContextTypes,e!=null}function fl(){pe(Je),pe(Fe)}function Kf(e,t,n){if(Fe.current!==qn)throw Error(B(168));de(Fe,t),de(Je,n)}function gm(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,gw(e)||"Unknown",i));return xe({},n,r)}function hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qn,xr=Fe.current,de(Fe,e),de(Je,Je.current),!0}function Gf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=gm(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,pe(Je),pe(Fe),de(Fe,e)):pe(Je),de(Je,n)}var Yt=null,Ql=!1,Ha=!1;function ym(e){Yt===null?Yt=[e]:Yt.push(e)}function T1(e){Ql=!0,ym(e)}function Gn(){if(!Ha&&Yt!==null){Ha=!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,Ql=!1}catch(i){throw Yt!==null&&(Yt=Yt.slice(e+1)),B0(Zc,Gn),i}finally{ce=t,Ha=!1}}return null}var Dr=[],Ar=0,pl=null,ml=0,mt=[],gt=0,wr=null,Gt=1,Zt="";function Zn(e,t){Dr[Ar++]=ml,Dr[Ar++]=pl,pl=e,ml=t}function vm(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 ld(e){e.return!==null&&(Zn(e,1),vm(e,1,0))}function ad(e){for(;e===pl;)pl=Dr[--Ar],Dr[Ar]=null,ml=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 xm(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 Zu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ju(e){if(me){var t=st;if(t){var n=t;if(!Zf(e,t)){if(Zu(e))throw Error(B(418));t=Hn(n.nextSibling);var r=ot;t&&Zf(e,t)?xm(r,n):(e.flags=e.flags&-4097|2,me=!1,ot=e)}}else{if(Zu(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 wo(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"&&!Xu(e.type,e.memoizedProps)),t&&(t=st)){if(Zu(e))throw wm(),Error(B(418));for(;t;)xm(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 wm(){for(var e=st;e;)e=Hn(e.nextSibling)}function yi(){st=ot=null,me=!1}function ud(e){bt===null?bt=[e]:bt.push(e)}var R1=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 So(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 Sm(e){function t(m,x){if(e){var g=m.deletions;g===null?(m.deletions=[x],m.flags|=16):g.push(x)}}function n(m,x){if(!e)return null;for(;x!==null;)t(m,x),x=x.sibling;return null}function r(m,x){for(m=new Map;x!==null;)x.key!==null?m.set(x.key,x):m.set(x.index,x),x=x.sibling;return m}function i(m,x){return m=Qn(m,x),m.index=0,m.sibling=null,m}function s(m,x,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<x?(m.flags|=2,x):g):(m.flags|=2,x)):(m.flags|=1048576,x)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,x,g,w){return x===null||x.tag!==6?(x=Xa(g,m.mode,w),x.return=m,x):(x=i(x,g),x.return=m,x)}function a(m,x,g,w){var _=g.type;return _===zr?f(m,x,g.props.children,w,g.key):x!==null&&(x.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===x.type)?(w=i(x,g.props),w.ref=Vi(m,x,g),w.return=m,w):(w=Xo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,x,g),w.return=m,w)}function u(m,x,g,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==g.containerInfo||x.stateNode.implementation!==g.implementation?(x=Ya(g,m.mode,w),x.return=m,x):(x=i(x,g.children||[]),x.return=m,x)}function f(m,x,g,w,_){return x===null||x.tag!==7?(x=pr(g,m.mode,w,_),x.return=m,x):(x=i(x,g),x.return=m,x)}function d(m,x,g){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Xa(""+x,m.mode,g),x.return=m,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case uo:return g=Xo(x.type,x.key,x.props,null,m.mode,g),g.ref=Vi(m,null,x),g.return=m,g;case Pr:return x=Ya(x,m.mode,g),x.return=m,x;case wn:var w=x._init;return d(m,w(x._payload),g)}if(Gi(x)||Ai(x))return x=pr(x,m.mode,g,null),x.return=m,x;So(m,x)}return null}function c(m,x,g,w){var _=x!==null?x.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return _!==null?null:l(m,x,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case uo:return g.key===_?a(m,x,g,w):null;case Pr:return g.key===_?u(m,x,g,w):null;case wn:return _=g._init,c(m,x,_(g._payload),w)}if(Gi(g)||Ai(g))return _!==null?null:f(m,x,g,w,null);So(m,g)}return null}function h(m,x,g,w,_){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,l(x,m,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case uo:return m=m.get(w.key===null?g:w.key)||null,a(x,m,w,_);case Pr:return m=m.get(w.key===null?g:w.key)||null,u(x,m,w,_);case wn:var M=w._init;return h(m,x,g,M(w._payload),_)}if(Gi(w)||Ai(w))return m=m.get(g)||null,f(x,m,w,_,null);So(x,w)}return null}function y(m,x,g,w){for(var _=null,M=null,N=x,b=x=0,I=null;N!==null&&b<g.length;b++){N.index>b?(I=N,N=null):I=N.sibling;var z=c(m,N,g[b],w);if(z===null){N===null&&(N=I);break}e&&N&&z.alternate===null&&t(m,N),x=s(z,x,b),M===null?_=z:M.sibling=z,M=z,N=I}if(b===g.length)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;b<g.length;b++)N=d(m,g[b],w),N!==null&&(x=s(N,x,b),M===null?_=N:M.sibling=N,M=N);return me&&Zn(m,b),_}for(N=r(m,N);b<g.length;b++)I=h(N,m,b,g[b],w),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?b:I.key),x=s(I,x,b),M===null?_=I:M.sibling=I,M=I);return e&&N.forEach(function(D){return t(m,D)}),me&&Zn(m,b),_}function v(m,x,g,w){var _=Ai(g);if(typeof _!="function")throw Error(B(150));if(g=_.call(g),g==null)throw Error(B(151));for(var M=_=null,N=x,b=x=0,I=null,z=g.next();N!==null&&!z.done;b++,z=g.next()){N.index>b?(I=N,N=null):I=N.sibling;var D=c(m,N,z.value,w);if(D===null){N===null&&(N=I);break}e&&N&&D.alternate===null&&t(m,N),x=s(D,x,b),M===null?_=D:M.sibling=D,M=D,N=I}if(z.done)return n(m,N),me&&Zn(m,b),_;if(N===null){for(;!z.done;b++,z=g.next())z=d(m,z.value,w),z!==null&&(x=s(z,x,b),M===null?_=z:M.sibling=z,M=z);return me&&Zn(m,b),_}for(N=r(m,N);!z.done;b++,z=g.next())z=h(N,m,b,z.value,w),z!==null&&(e&&z.alternate!==null&&N.delete(z.key===null?b:z.key),x=s(z,x,b),M===null?_=z:M.sibling=z,M=z);return e&&N.forEach(function(F){return t(m,F)}),me&&Zn(m,b),_}function S(m,x,g,w){if(typeof g=="object"&&g!==null&&g.type===zr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case uo:e:{for(var _=g.key,M=x;M!==null;){if(M.key===_){if(_=g.type,_===zr){if(M.tag===7){n(m,M.sibling),x=i(M,g.props.children),x.return=m,m=x;break e}}else if(M.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===wn&&eh(_)===M.type){n(m,M.sibling),x=i(M,g.props),x.ref=Vi(m,M,g),x.return=m,m=x;break e}n(m,M);break}else t(m,M);M=M.sibling}g.type===zr?(x=pr(g.props.children,m.mode,w,g.key),x.return=m,m=x):(w=Xo(g.type,g.key,g.props,null,m.mode,w),w.ref=Vi(m,x,g),w.return=m,m=w)}return o(m);case Pr:e:{for(M=g.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===g.containerInfo&&x.stateNode.implementation===g.implementation){n(m,x.sibling),x=i(x,g.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else t(m,x);x=x.sibling}x=Ya(g,m.mode,w),x.return=m,m=x}return o(m);case wn:return M=g._init,S(m,x,M(g._payload),w)}if(Gi(g))return y(m,x,g,w);if(Ai(g))return v(m,x,g,w);So(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,g),x.return=m,m=x):(n(m,x),x=Xa(g,m.mode,w),x.return=m,m=x),o(m)):n(m,x)}return S}var vi=Sm(!0),km=Sm(!1),gl=Kn(null),yl=null,Lr=null,cd=null;function dd(){cd=Lr=yl=null}function fd(e){var t=gl.current;pe(gl),e._currentValue=t}function ec(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){yl=e,cd=Lr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(cd!==e)if(e={context:e,memoizedValue:t,next:null},Lr===null){if(yl===null)throw Error(B(308));Lr=e,yl.dependencies={lanes:0,firstContext:e}}else Lr=Lr.next=e;return t}var nr=null;function hd(e){nr===null?nr=[e]:nr.push(e)}function Em(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,hd(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 pd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _m(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,hd(r)):(t.next=i.next,i.next=t),r.interleaved=t,ln(e,n)}function Bo(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,Jc(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 vl(e,t,n,r){var i=e.updateQueue;Sn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=a))}if(s!==null){var d=i.baseState;o=0,f=u=a=null,l=s;do{var c=l.lane,h=l.eventTime;if((r&c)===c){f!==null&&(f=f.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(c=t,h=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(h,d,c);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,c=typeof y=="function"?y.call(h,d,c):y,c==null)break e;d=xe({},d,c);break e;case 2:Sn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,c=i.effects,c===null?i.effects=[l]:c.push(l))}else h={eventTime:h,lane:c,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=h,a=d):f=f.next=h,o|=c;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;c=l,l=c.next,c.next=null,i.lastBaseUpdate=c,i.shared.pending=null}}while(!0);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);kr|=o,e.lanes=o,e.memoizedState=d}}function nh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(B(191,i));i.call(r)}}}var Js={},Vt=Kn(Js),Ns=Kn(Js),Cs=Kn(Js);function rr(e){if(e===Js)throw Error(B(174));return e}function md(e,t){switch(de(Cs,t),de(Ns,e),de(Vt,Js),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ru(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ru(t,e)}pe(Vt),de(Vt,t)}function xi(){pe(Vt),pe(Ns),pe(Cs)}function Nm(e){rr(Cs.current);var t=rr(Vt.current),n=Ru(t,e.type);t!==n&&(de(Ns,e),de(Vt,n))}function gd(e){Ns.current===e&&(pe(Vt),pe(Ns))}var ye=Kn(0);function xl(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 Ba=[];function yd(){for(var e=0;e<Ba.length;e++)Ba[e]._workInProgressVersionPrimary=null;Ba.length=0}var Vo=cn.ReactCurrentDispatcher,Va=cn.ReactCurrentBatchConfig,Sr=0,ve=null,be=null,Me=null,wl=!1,ls=!1,bs=0,$1=0;function Oe(){throw Error(B(321))}function vd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!It(e[n],t[n]))return!1;return!0}function xd(e,t,n,r,i,s){if(Sr=s,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vo.current=e===null||e.memoizedState===null?L1:F1,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,Vo.current=H1,e=n(r,i)}while(ls)}if(Vo.current=Sl,t=be!==null&&be.next!==null,Sr=0,Me=be=ve=null,wl=!1,t)throw Error(B(300));return e}function wd(){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 Ua(e){var t=wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=be,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,a=null,u=s;do{var f=u.lane;if((Sr&f)===f)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,o=r):a=a.next=d,ve.lanes|=f,kr|=f}u=u.next}while(u!==null&&u!==s);a===null?o=r:a.next=l,It(r,t.memoizedState)||(Ge=!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 Qa(e){var t=wt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);It(s,t.memoizedState)||(Ge=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Cm(){}function bm(e,t){var n=ve,r=wt(),i=t(),s=!It(r.memoizedState,i);if(s&&(r.memoizedState=i,Ge=!0),r=r.queue,Sd(Pm.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Ms(9,Mm.bind(null,n,r,i,t),void 0,null),Pe===null)throw Error(B(349));Sr&30||jm(n,t,i)}return i}function jm(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 Mm(e,t,n,r){t.value=n,t.getSnapshot=r,zm(t)&&Im(e)}function Pm(e,t,n){return n(function(){zm(t)&&Im(e)})}function zm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!It(e,n)}catch{return!0}}function Im(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=A1.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 Tm(){return wt().memoizedState}function Uo(e,t,n,r){var i=Ot();ve.flags|=e,i.memoizedState=Ms(1|t,n,void 0,r===void 0?null:r)}function Wl(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&&vd(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 Uo(8390656,8,e,t)}function Sd(e,t){return Wl(2048,8,e,t)}function Rm(e,t){return Wl(4,2,e,t)}function $m(e,t){return Wl(4,4,e,t)}function Om(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 Dm(e,t,n){return n=n!=null?n.concat([e]):null,Wl(4,4,Om.bind(null,t,e),n)}function kd(){}function Am(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Lm(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Fm(e,t,n){return Sr&21?(It(n,t)||(n=Q0(),ve.lanes|=n,kr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=n)}function O1(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Va.transition;Va.transition={};try{e(!1),t()}finally{ce=n,Va.transition=r}}function Hm(){return wt().memoizedState}function D1(e,t,n){var r=Un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Bm(e))Vm(t,n);else if(n=Em(e,t,n,r),n!==null){var i=Ue();zt(n,e,r,i),Um(n,t,r)}}function A1(e,t,n){var r=Un(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bm(e))Vm(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,It(l,o)){var a=t.interleaved;a===null?(i.next=i,hd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Em(e,t,i,r),n!==null&&(i=Ue(),zt(n,e,r,i),Um(n,t,r))}}function Bm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Vm(e,t){ls=wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Um(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jc(e,n)}}var Sl={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},L1={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,Uo(4194308,4,Om.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uo(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=D1.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:rh,useDebugValue:kd,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=rh(!1),t=e[0];return e=O1.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||jm(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ih(Pm.bind(null,r,s,e),[e]),r.flags|=2048,Ms(9,Mm.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=$1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},F1={readContext:xt,useCallback:Am,useContext:xt,useEffect:Sd,useImperativeHandle:Dm,useInsertionEffect:Rm,useLayoutEffect:$m,useMemo:Lm,useReducer:Ua,useRef:Tm,useState:function(){return Ua(js)},useDebugValue:kd,useDeferredValue:function(e){var t=wt();return Fm(t,be.memoizedState,e)},useTransition:function(){var e=Ua(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Cm,useSyncExternalStore:bm,useId:Hm,unstable_isNewReconciler:!1},H1={readContext:xt,useCallback:Am,useContext:xt,useEffect:Sd,useImperativeHandle:Dm,useInsertionEffect:Rm,useLayoutEffect:$m,useMemo:Lm,useReducer:Qa,useRef:Tm,useState:function(){return Qa(js)},useDebugValue:kd,useDeferredValue:function(e){var t=wt();return be===null?t.memoizedState=e:Fm(t,be.memoizedState,e)},useTransition:function(){var e=Qa(js)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Cm,useSyncExternalStore:bm,useId:Hm,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 tc(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 ql={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),Bo(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),Bo(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),Bo(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 Qm(e,t,n){var r=!1,i=qn,s=t.contextType;return typeof s=="object"&&s!==null?s=xt(s):(i=et(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=ql,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&&ql.enqueueReplaceState(t,t.state,null)}function nc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},pd(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=xt(s):(s=et(t)?xr:Fe.current,i.context=gi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(tc(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&&ql.enqueueReplaceState(i,i.state,null),vl(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+=mw(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 Wa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var B1=typeof WeakMap=="function"?WeakMap:Map;function Wm(e,t,n){n=en(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){El||(El=!0,hc=r),rc(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(){rc(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){rc(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 B1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=nS.bind(null,e,t,n),t.then(e,e))}function ah(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function uh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=en(-1,1),t.tag=2,Bn(n,t,1))),n.lanes|=1),e)}var V1=cn.ReactCurrentOwner,Ge=!1;function Ve(e,t,n,r){t.child=e===null?km(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=xd(e,t,n,r,s,i),n=wd(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,an(e,t,i)):(me&&n&&ld(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"&&!Pd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Xm(e,t,s,r,i)):(e=Xo(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 Xm(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Ss(s,r)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,an(e,t,i)}return ic(e,t,n,r,i)}function Ym(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,rt),rt|=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,rt),rt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,de(Hr,rt),rt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,de(Hr,rt),rt|=r;return Ve(e,t,i,n),t.child}function Km(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ic(e,t,n,r,i){var s=et(n)?xr:Fe.current;return s=gi(t,s),Yr(t,i),n=xd(e,t,n,r,s,i),r=wd(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,an(e,t,i)):(me&&r&&ld(t),t.flags|=1,Ve(e,t,n,i),t.child)}function fh(e,t,n,r,i){if(et(n)){var s=!0;hl(t)}else s=!1;if(Yr(t,i),t.stateNode===null)Qo(e,t),Qm(t,n,r),nc(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=et(n)?xr:Fe.current,u=gi(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==u)&&oh(t,o,r,u),Sn=!1;var c=t.memoizedState;o.state=c,vl(t,r,o,i),a=t.memoizedState,l!==r||c!==a||Je.current||Sn?(typeof f=="function"&&(tc(t,n,f,r),a=t.memoizedState),(l=Sn||sh(t,n,l,r,c,a,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,_m(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:kt(t.type,l),o.props=u,d=t.pendingProps,c=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=xt(a):(a=et(n)?xr:Fe.current,a=gi(t,a));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||c!==a)&&oh(t,o,r,a),Sn=!1,c=t.memoizedState,o.state=c,vl(t,r,o,i);var y=t.memoizedState;l!==d||c!==y||Je.current||Sn?(typeof h=="function"&&(tc(t,n,h,r),y=t.memoizedState),(u=Sn||sh(t,n,u,r,c,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&&c===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===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&&c===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),r=!1)}return sc(e,t,n,r,s,i)}function sc(e,t,n,r,i,s){Km(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Gf(t,n,!1),an(e,t,s);r=t.stateNode,V1.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 Gm(e){var t=e.stateNode;t.pendingContext?Kf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kf(e,t.context,!1),md(e,t.containerInfo)}function hh(e,t,n,r,i){return yi(),ud(i),t.flags|=256,Ve(e,t,n,r),t.child}var oc={dehydrated:null,treeContext:null,retryLane:0};function lc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Zm(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 Ju(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=Kl(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=lc(n),t.memoizedState=oc,e):Ed(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return U1(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?lc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=oc,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 Ed(e,t){return t=Kl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ko(e,t,n,r){return r!==null&&ud(r),vi(t,e.child,null,n),e=Ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function U1(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Wa(Error(B(422))),ko(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Kl({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=lc(o),t.memoizedState=oc,s);if(!(t.mode&1))return ko(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=Wa(s,r,void 0),ko(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ge||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 Md(),r=Wa(Error(B(421))),ko(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=rS.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,st=Hn(i.nextSibling),ot=t,me=!0,bt=null,e!==null&&(mt[gt++]=Gt,mt[gt++]=Zt,mt[gt++]=wr,Gt=e.id,Zt=e.overflow,wr=t),t=Ed(t,r.children),t.flags|=4096,t)}function ph(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ec(e.return,t,n)}function qa(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 Jm(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&&xl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),qa(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&&xl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}qa(t,!0,n,null,s);break;case"together":qa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qo(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 Q1(e,t,n){switch(t.tag){case 3:Gm(t),yi();break;case 5:Nm(t);break;case 1:et(t.type)&&hl(t);break;case 4:md(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;de(gl,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?Zm(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 Jm(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,Ym(e,t,n)}return an(e,t,n)}var eg,ac,tg,ng;eg=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}};ac=function(){};tg=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=Pu(e,i),r=Pu(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=dl)}$u(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)}};ng=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 W1(e,t,n){var r=t.pendingProps;switch(ad(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 et(t.type)&&fl(),De(t),null;case 3:return r=t.stateNode,xi(),pe(Je),pe(Fe),yd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(wo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bt!==null&&(gc(bt),bt=null))),ac(e,t),De(t),null;case 5:gd(t);var i=rr(Cs.current);if(n=t.type,e!==null&&t.stateNode!=null)tg(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),wo(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)}$u(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&&xo(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&xo(r.textContent,l,e),i=["children",""+l]):ps.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&he("scroll",r)}switch(n){case"input":co(r),_f(r,s,!0);break;case"textarea":co(r),Cf(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=dl)}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=P0(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,eg(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ou(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=Pu(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}$u(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?T0(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&z0(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&&qc(e,s,a,o))}switch(n){case"input":co(e),_f(e,r,!1);break;case"textarea":co(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=dl)}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)ng(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),wo(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ht]=t,(s=r.nodeValue!==n)&&(e=ot,e!==null))switch(e.tag){case 3:xo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xo(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))wm(),yi(),t.flags|=98560,s=!1;else if(s=wo(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&&(gc(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):Md())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return xi(),ac(e,t),e===null&&ks(t.stateNode.containerInfo),De(t),null;case 10:return fd(t.type._context),De(t),null;case 17:return et(t.type)&&fl(),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=xl(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=xl(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 jd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?rt&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 q1(e,t){switch(ad(t),t.tag){case 1:return et(t.type)&&fl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xi(),pe(Je),pe(Fe),yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gd(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 fd(t.type._context),null;case 22:case 23:return jd(),null;case 24:return null;default:return null}}var Eo=!1,Le=!1,X1=typeof WeakSet=="function"?WeakSet:Set,q=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 uc(e,t,n){try{n()}catch(r){Se(e,t,r)}}var mh=!1;function Y1(e,t){if(Wu=al,e=lm(),od(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,f=0,d=e,c=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(l=o+i),d!==s||r!==0&&d.nodeType!==3||(a=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)c=d,d=h;for(;;){if(d===e)break t;if(c===n&&++u===i&&(l=o),c===s&&++f===r&&(a=o),(h=d.nextSibling)!==null)break;d=c,c=d.parentNode}d=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(qu={focusedElem:e,selectionRange:n},al=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;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 v=y.memoizedProps,S=y.memoizedState,m=t.stateNode,x=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:kt(t.type,v),S);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){Se(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=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&&uc(t,n,s)}i=i.next}while(i!==r)}}function Xl(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 cc(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 rg(e){var t=e.alternate;t!==null&&(e.alternate=null,rg(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[Ku],delete t[z1],delete t[I1])),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 ig(e){return e.tag===5||e.tag===3||e.tag===4}function gh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ig(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 dc(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=dl));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}function fc(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(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}var Ie=null,_t=!1;function pn(e,t,n){for(n=n.child;n!==null;)sg(e,t,n),n=n.sibling}function sg(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Fl,n)}catch{}switch(n.tag){case 5:Le||Fr(n,t);case 6:var r=Ie,i=_t;Ie=null,pn(e,t,n),Ie=r,_t=i,Ie!==null&&(_t?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(_t?(e=Ie,n=n.stateNode,e.nodeType===8?Fa(e.parentNode,n):e.nodeType===1&&Fa(e,n),xs(e)):Fa(Ie,n.stateNode));break;case 4:r=Ie,i=_t,Ie=n.stateNode.containerInfo,_t=!0,pn(e,t,n),Ie=r,_t=i;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&uc(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 X1),t.forEach(function(r){var i=iS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function St(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Ie=l.stateNode,_t=!1;break e;case 3:Ie=l.stateNode.containerInfo,_t=!0;break e;case 4:Ie=l.stateNode.containerInfo,_t=!0;break e}l=l.return}if(Ie===null)throw Error(B(160));sg(s,o,i),Ie=null,_t=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){Se(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)og(t,e),t=t.sibling}function og(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),Xl(3,e)}catch(v){Se(e,e.return,v)}try{as(5,e,e.return)}catch(v){Se(e,e.return,v)}}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(v){Se(e,e.return,v)}}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&&j0(i,s),Ou(l,o);var u=Ou(l,s);for(o=0;o<a.length;o+=2){var f=a[o],d=a[o+1];f==="style"?T0(i,d):f==="dangerouslySetInnerHTML"?z0(i,d):f==="children"?ms(i,d):qc(i,f,d,u)}switch(l){case"input":zu(i,s);break;case"textarea":M0(i,s);break;case"select":var c=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Qr(i,!!s.multiple,h,!1):c!==!!s.multiple&&(s.defaultValue!=null?Qr(i,!!s.multiple,s.defaultValue,!0):Qr(i,!!s.multiple,s.multiple?[]:"",!1))}i[_s]=s}catch(v){Se(e,e.return,v)}}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(v){Se(e,e.return,v)}}break;case 3:if(St(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xs(t.containerInfo)}catch(v){Se(e,e.return,v)}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||(Cd=_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(q=e,f=e.child;f!==null;){for(d=q=f;q!==null;){switch(c=q,h=c.child,c.tag){case 0:case 11:case 14:case 15:as(4,c,c.return);break;case 1:Fr(c,c.return);var y=c.stateNode;if(typeof y.componentWillUnmount=="function"){r=c,n=c.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:Fr(c,c.return);break;case 22:if(c.memoizedState!==null){xh(d);continue}}h!==null?(h.return=c,q=h):xh(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=I0("display",o))}catch(v){Se(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Se(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:St(t,e),$t(e),r&4&&yh(e);break;case 21:break;default:St(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ig(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);fc(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=gh(e);dc(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 K1(e,t,n){q=e,lg(e)}function lg(e,t,n){for(var r=(e.mode&1)!==0;q!==null;){var i=q,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Eo;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Le;l=Eo;var u=Le;if(Eo=o,(Le=a)&&!u)for(q=i;q!==null;)o=q,a=o.child,o.tag===22&&o.memoizedState!==null?wh(i):a!==null?(a.return=o,q=a):wh(i);for(;s!==null;)q=s,lg(s),s=s.sibling;q=i,Eo=l,Le=u}vh(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,q=s):vh(e)}}function vh(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Le||Xl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Le)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&nh(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nh(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&xs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Le||t.flags&512&&cc(t)}catch(c){Se(t,t.return,c)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function xh(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function wh(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Xl(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{cc(t)}catch(a){Se(t,s,a)}break;case 5:var o=t.return;try{cc(t)}catch(a){Se(t,o,a)}}}catch(a){Se(t,t.return,a)}if(t===e){q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,q=l;break}q=t.return}}var G1=Math.ceil,kl=cn.ReactCurrentDispatcher,_d=cn.ReactCurrentOwner,vt=cn.ReactCurrentBatchConfig,oe=0,Pe=null,Ne=null,Te=0,rt=0,Hr=Kn(0),je=0,Ps=null,kr=0,Yl=0,Nd=0,us=null,Ke=null,Cd=0,Si=1/0,Xt=null,El=!1,hc=null,Vn=null,_o=!1,Dn=null,_l=0,cs=0,pc=null,Wo=-1,qo=0;function Ue(){return oe&6?_e():Wo!==-1?Wo:Wo=_e()}function Un(e){return e.mode&1?oe&2&&Te!==0?Te&-Te:R1.transition!==null?(qo===0&&(qo=Q0()),qo):(e=ce,e!==0||(e=window.event,e=e===void 0?16:Z0(e.type)),e):1}function zt(e,t,n,r){if(50<cs)throw cs=0,pc=null,Error(B(185));Ks(e,n,r),(!(oe&2)||e!==Pe)&&(e===Pe&&(!(oe&2)&&(Yl|=n),je===4&&_n(e,Te)),tt(e,r),n===1&&oe===0&&!(t.mode&1)&&(Si=_e()+500,Ql&&Gn()))}function tt(e,t){var n=e.callbackNode;Rw(e,t);var r=ll(e,e===Pe?Te:0);if(r===0)n!==null&&Mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mf(n),t===1)e.tag===0?T1(Sh.bind(null,e)):ym(Sh.bind(null,e)),M1(function(){!(oe&6)&&Gn()}),n=null;else{switch(W0(r)){case 1:n=Zc;break;case 4:n=V0;break;case 16:n=ol;break;case 536870912:n=U0;break;default:n=ol}n=mg(n,ag.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ag(e,t){if(Wo=-1,qo=0,oe&6)throw Error(B(327));var n=e.callbackNode;if(Kr()&&e.callbackNode!==n)return null;var r=ll(e,e===Pe?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nl(e,r);else{t=r;var i=oe;oe|=2;var s=cg();(Pe!==e||Te!==t)&&(Xt=null,Si=_e()+500,hr(e,t));do try{eS();break}catch(l){ug(e,l)}while(!0);dd(),kl.current=s,oe=i,Ne!==null?t=0:(Pe=null,Te=0,t=je)}if(t!==0){if(t===2&&(i=Hu(e),i!==0&&(r=i,t=mc(e,i))),t===1)throw n=Ps,hr(e,0),_n(e,r),tt(e,_e()),n;if(t===6)_n(e,r);else{if(i=e.current.alternate,!(r&30)&&!Z1(i)&&(t=Nl(e,r),t===2&&(s=Hu(e),s!==0&&(r=s,t=mc(e,s))),t===1))throw n=Ps,hr(e,0),_n(e,r),tt(e,_e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Jn(e,Ke,Xt);break;case 3:if(_n(e,r),(r&130023424)===r&&(t=Cd+500-_e(),10<t)){if(ll(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ue(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Yu(Jn.bind(null,e,Ke,Xt),t);break}Jn(e,Ke,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*G1(r/1960))-r,10<r){e.timeoutHandle=Yu(Jn.bind(null,e,Ke,Xt),r);break}Jn(e,Ke,Xt);break;case 5:Jn(e,Ke,Xt);break;default:throw Error(B(329))}}}return tt(e,_e()),e.callbackNode===n?ag.bind(null,e):null}function mc(e,t){var n=us;return e.current.memoizedState.isDehydrated&&(hr(e,t).flags|=256),e=Nl(e,t),e!==2&&(t=Ke,Ke=n,t!==null&&gc(t)),e}function gc(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function Z1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!It(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _n(e,t){for(t&=~Nd,t&=~Yl,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=ll(e,0);if(!(t&1))return tt(e,_e()),null;var n=Nl(e,t);if(e.tag!==0&&n===2){var r=Hu(e);r!==0&&(t=r,n=mc(e,r))}if(n===1)throw n=Ps,hr(e,0),_n(e,t),tt(e,_e()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jn(e,Ke,Xt),tt(e,_e()),null}function bd(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Si=_e()+500,Ql&&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 jd(){rt=Hr.current,pe(Hr)}function hr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j1(n)),Ne!==null)for(n=Ne.return;n!==null;){var r=n;switch(ad(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fl();break;case 3:xi(),pe(Je),pe(Fe),yd();break;case 5:gd(r);break;case 4:xi();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:fd(r.type._context);break;case 22:case 23:jd()}n=n.return}if(Pe=e,Ne=e=Qn(e.current,null),Te=rt=t,je=0,Ps=null,Nd=Yl=kr=0,Ke=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 ug(e,t){do{var n=Ne;try{if(dd(),Vo.current=Sl,wl){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}wl=!1}if(Sr=0,Me=be=ve=null,ls=!1,bs=0,_d.current=null,n===null||n.return===null){je=1,Ps=t,Ne=null;break}e:{var s=e,o=n.return,l=n,a=t;if(t=Te,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var c=f.alternate;c?(f.updateQueue=c.updateQueue,f.memoizedState=c.memoizedState,f.lanes=c.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=ah(o);if(h!==null){h.flags&=-257,uh(h,o,l,s,t),h.mode&1&&lh(s,u,t),t=h,a=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(a),t.updateQueue=v}else y.add(a);break e}else{if(!(t&1)){lh(s,u,t),Md();break e}a=Error(B(426))}}else if(me&&l.mode&1){var S=ah(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),uh(S,o,l,s,t),ud(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=Wm(s,a,t);th(s,m);break e;case 1:l=a;var x=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Vn===null||!Vn.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=qm(s,l,t);th(s,w);break e}}s=s.return}while(s!==null)}fg(n)}catch(_){t=_,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(!0)}function cg(){var e=kl.current;return kl.current=Sl,e===null?Sl:e}function Md(){(je===0||je===3||je===2)&&(je=4),Pe===null||!(kr&268435455)&&!(Yl&268435455)||_n(Pe,Te)}function Nl(e,t){var n=oe;oe|=2;var r=cg();(Pe!==e||Te!==t)&&(Xt=null,hr(e,t));do try{J1();break}catch(i){ug(e,i)}while(!0);if(dd(),oe=n,kl.current=r,Ne!==null)throw Error(B(261));return Pe=null,Te=0,je}function J1(){for(;Ne!==null;)dg(Ne)}function eS(){for(;Ne!==null&&!Nw();)dg(Ne)}function dg(e){var t=pg(e.alternate,e,rt);e.memoizedProps=e.pendingProps,t===null?fg(e):Ne=t,_d.current=null}function fg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=q1(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=W1(n,t,rt),n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);je===0&&(je=5)}function Jn(e,t,n){var r=ce,i=vt.transition;try{vt.transition=null,ce=1,tS(e,t,n,r)}finally{vt.transition=i,ce=r}return null}function tS(e,t,n,r){do Kr();while(Dn!==null);if(oe&6)throw Error(B(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if($w(e,s),e===Pe&&(Ne=Pe=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||_o||(_o=!0,mg(ol,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,_d.current=null,Y1(e,n),og(n,e),S1(qu),al=!!Wu,qu=Wu=null,e.current=n,K1(n),Cw(),oe=l,ce=o,vt.transition=s}else e.current=n;if(_o&&(_o=!1,Dn=e,_l=i),s=e.pendingLanes,s===0&&(Vn=null),Mw(n.stateNode),tt(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(El)throw El=!1,e=hc,hc=null,e;return _l&1&&e.tag!==0&&Kr(),s=e.pendingLanes,s&1?e===pc?cs++:(cs=0,pc=e):cs=0,Gn(),null}function Kr(){if(Dn!==null){var e=W0(_l),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,_l=0,oe&6)throw Error(B(331));var i=oe;for(oe|=4,q=e.current;q!==null;){var s=q,o=s.child;if(q.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(q=u;q!==null;){var f=q;switch(f.tag){case 0:case 11:case 15:as(8,f,s)}var d=f.child;if(d!==null)d.return=f,q=d;else for(;q!==null;){f=q;var c=f.sibling,h=f.return;if(rg(f),f===u){q=null;break}if(c!==null){c.return=h,q=c;break}q=h}}}var y=s.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}q=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,q=o;else e:for(;q!==null;){if(s=q,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,q=m;break e}q=s.return}}var x=e.current;for(q=x;q!==null;){o=q;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,q=g;else e:for(o=x;q!==null;){if(l=q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Xl(9,l)}}catch(_){Se(l,l.return,_)}if(l===o){q=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,q=w;break e}q=l.return}}if(oe=i,Gn(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Fl,e)}catch{}r=!0}return r}finally{ce=n,vt.transition=t}}return!1}function kh(e,t,n){t=wi(n,t),t=Wm(e,t,1),e=Bn(e,t,1),t=Ue(),e!==null&&(Ks(e,1,t),tt(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&&(Ks(t,1,e),tt(t,e));break}}t=t.return}}function nS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ue(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Te&n)===n&&(je===4||je===3&&(Te&130023424)===Te&&500>_e()-Cd?hr(e,0):Nd|=n),tt(e,t)}function hg(e,t){t===0&&(e.mode&1?(t=po,po<<=1,!(po&130023424)&&(po=4194304)):t=1);var n=Ue();e=ln(e,t),e!==null&&(Ks(e,t,n),tt(e,n))}function rS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hg(e,n)}function iS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),hg(e,n)}var pg;pg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,Q1(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,me&&t.flags&1048576&&vm(t,ml,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qo(e,t),e=t.pendingProps;var i=gi(t,Fe.current);Yr(t,n),i=xd(null,t,r,e,i,n);var s=wd();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,et(r)?(s=!0,hl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,pd(t),i.updater=ql,t.stateNode=i,i._reactInternals=t,nc(t,r,e,n),t=sc(null,t,r,!0,s,n)):(t.tag=0,me&&s&&ld(t),Ve(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=oS(r),e=kt(r,e),i){case 0:t=ic(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),ic(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(Gm(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,i=s.element,_m(e,t),vl(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=km(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 Nm(t),e===null&&Ju(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Xu(r,i)?o=null:s!==null&&Xu(r,s)&&(t.flags|=32),Km(e,t),Ve(e,t,o,n),t.child;case 6:return e===null&&Ju(t),null;case 13:return Zm(e,t,n);case 4:return md(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(gl,r._currentValue),r._currentValue=o,s!==null)if(It(s.value,o)){if(s.children===i.children&&!Je.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),ec(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),ec(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 Xm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kt(r,i),Qo(e,t),t.tag=1,et(r)?(e=!0,hl(t)):e=!1,Yr(t,n),Qm(t,r,i),nc(t,r,i,n),sc(null,t,r,!0,e,n);case 19:return Jm(e,t,n);case 22:return Ym(e,t,n)}throw Error(B(156,t.tag))};function mg(e,t){return B0(e,t)}function sS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,r){return new sS(e,t,n,r)}function Pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oS(e){if(typeof e=="function")return Pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yc)return 11;if(e===Kc)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 Xo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Pd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case zr:return pr(n.children,i,s,t);case Xc:o=8,i|=8;break;case Cu:return e=yt(12,n,t,i|2),e.elementType=Cu,e.lanes=s,e;case bu:return e=yt(13,n,t,i),e.elementType=bu,e.lanes=s,e;case ju:return e=yt(19,n,t,i),e.elementType=ju,e.lanes=s,e;case N0:return Kl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E0:o=10;break e;case _0:o=9;break e;case Yc:o=11;break e;case Kc: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 Kl(e,t,n,r){return e=yt(22,e,r,t),e.elementType=N0,e.lanes=n,e.stateNode={isHidden:!1},e}function Xa(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Ya(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ma(0),this.expirationTimes=Ma(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function zd(e,t,n,r,i,s,o,l,a){return e=new lS(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=yt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pd(s),e}function aS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function gg(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(et(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(et(n))return gm(e,n,t)}return t}function yg(e,t,n,r,i,s,o,l,a){return e=zd(n,r,!0,e,i,s,o,l,a),e.context=gg(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,Ks(e,i,r),tt(e,r),e}function Gl(e,t,n,r){var i=t.current,s=Ue(),o=Un(i);return n=gg(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),Bo(e,i,o)),o}function Cl(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 Id(e,t){Eh(e,t),(e=e.alternate)&&Eh(e,t)}function uS(){return null}var vg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Td(e){this._internalRoot=e}Zl.prototype.render=Td.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Gl(e,t,null,null)};Zl.prototype.unmount=Td.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Er(function(){Gl(null,e,null,null)}),t[on]=null}};function Zl(e){this._internalRoot=e}Zl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Y0();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&&G0(e)}};function Rd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _h(){}function cS(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Cl(o);s.call(u)}}var o=yg(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=Cl(a);l.call(u)}}var a=zd(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(){Gl(t,a,n,r)}),a}function ea(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=Cl(o);l.call(a)}}Gl(t,o,e,i)}else o=cS(n,t,e,i,r);return Cl(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&&(Jc(t,n|1),tt(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)}}),Id(e,1)}};ed=function(e){if(e.tag===13){var t=ln(e,134217728);if(t!==null){var n=Ue();zt(t,e,134217728,n)}Id(e,134217728)}};X0=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)}Id(e,t)}};Y0=function(){return ce};K0=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};Au=function(e,t,n){switch(t){case"input":if(zu(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=Ul(r);if(!i)throw Error(B(90));b0(r),zu(r,i)}}}break;case"textarea":M0(e,n);break;case"select":t=n.value,t!=null&&Qr(e,!!n.multiple,t,!1)}};O0=bd;D0=Er;var dS={usingClientEntryPoint:!1,Events:[Zs,$r,Ul,R0,$0,bd]},Qi={findFiberByHostInstance:tr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fS={bundleType:Qi.bundleType,version:Qi.version,rendererPackageName:Qi.rendererPackageName,rendererConfig:Qi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=F0(e),e===null?null:e.stateNode},findFiberByHostInstance:Qi.findFiberByHostInstance||uS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var No=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!No.isDisabled&&No.supportsFiber)try{Fl=No.inject(fS),Bt=No}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dS;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rd(t))throw Error(B(200));return aS(e,t,null,n)};ut.createRoot=function(e,t){if(!Rd(e))throw Error(B(299));var n=!1,r="",i=vg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=zd(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=F0(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return Er(e)};ut.hydrate=function(e,t,n){if(!Jl(t))throw Error(B(200));return ea(null,e,t,!0,n)};ut.hydrateRoot=function(e,t,n){if(!Rd(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=vg;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=yg(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 Zl(t)};ut.render=function(e,t,n){if(!Jl(t))throw Error(B(200));return ea(null,e,t,!1,n)};ut.unmountComponentAtNode=function(e){if(!Jl(e))throw Error(B(40));return e._reactRootContainer?(Er(function(){ea(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};ut.unstable_batchedUpdates=bd;ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Jl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return ea(e,t,n,!1,r)};ut.version="18.3.1-next-f1338f8080-20240426";function xg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xg)}catch(e){console.error(e)}}xg(),x0.exports=ut;var hS=x0.exports,wg,Nh=hS;wg=Nh.createRoot,Nh.hydrateRoot;function pS(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function mS(e){const t=new Map,n=[];for(const i of e){const s=i.subId??i.name??i.process;if(s===void 0){n.push(i);continue}const o=t.get(s),l=o??{id:s,name:i.name??s,phases:[],logs:[]};o||t.set(s,l),i.name!==void 0&&(l.name=i.name),i.group!==void 0&&(l.group=i.group),i.status!==void 0?(l.terminal=i,l.status=i.status):i.phase!==void 0?l.phases.push(i):l.logs.push(i)}return{subs:[...t.values()].map(i=>{var f;const s=[...i.phases,...i.logs],o=[...s,...i.terminal?[i.terminal]:[]].map(d=>d.at),l=o.length?o.reduce((d,c)=>c<d?c:d,Number.POSITIVE_INFINITY):void 0,u=pS((f=i.terminal)==null?void 0:f.data)??(i.terminal&&l!==void 0&&s.length>0?i.terminal.at-l:void 0);return{...i,startedAt:l,durationMs:u}}),stepLogs:n}}function $d(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 Sg(){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(Sg()+e,t);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const Ye={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(`${Sg()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function gS(e,t){if(!e)return t;const n=new Map(e.timeline.map(r=>[r.seq,r]));return{...t,timeline:t.timeline.map(r=>{var s,o;if((r.status==="pending"||r.status==="running")&&(((s=r.events)==null?void 0:s.length)??0)===0){const l=(o=n.get(r.seq))==null?void 0:o.events;if(l!=null&&l.length)return{...r,events:l}}return r})}}function zs(e){const t="spawn:",n="signal:child:";if(e.name.startsWith(t))return e.name.slice(t.length);if(e.name.startsWith(n))return e.name.slice(n.length)}const Tt={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function kg(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),p.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function yS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function vS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"13",r:"8"}),p.jsx("path",{d:"M12 13V9M9 2h6"})]})}function xS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"12",cy:"12",r:"2"}),p.jsx("path",{d:"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14"})]})}function Eg(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"m4 12 5 5L20 6"})})}function ki(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function wS(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),p.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function Ka(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function _g(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function SS(e){return p.jsx("svg",{...Tt,...e,"aria-hidden":!0,children:p.jsx("path",{d:"M6 4l14 8-14 8z"})})}function Od(e){return p.jsxs("svg",{...Tt,...e,"aria-hidden":!0,children:[p.jsx("circle",{cx:"6",cy:"5",r:"2"}),p.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),p.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const kS={local:kg,remote:yS,sleep:vS,signal:xS,child:Od};function Dd(e){return kS[e]??kg}const yc={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function ES(e){const t=R.useMemo(()=>{const i=new Set;for(const s of e){const o=zs(s);o!==void 0&&i.add(o)}return[...i].sort()},[e]),n=v0({queries:t.map(i=>({queryKey:["run",i],queryFn:()=>Ye.run(i)}))}),r={};return t.forEach((i,s)=>{var l,a;const o=(a=(l=n[s])==null?void 0:l.data)==null?void 0:a.run.workflow;o&&(r[i]=o)}),r}function Ng(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const _S={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"},NS={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Ad({run:e,timeline:t,depth:n,selectedKey:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l}){const{span:a,rows:u}=R.useMemo(()=>{const y=t.map(_=>new Date(_.startedAt).getTime()),v=t.map(_=>new Date(_.finishedAt).getTime()),S=Math.min(new Date(e.createdAt).getTime(),...y),m=e.status==="running"||e.status==="suspended",x=Math.max(...v,m?Date.now():S+1),g=Math.max(x-S,1),w=t.map(_=>{const M=new Date(_.startedAt).getTime(),N=new Date(_.finishedAt).getTime();let b=M;const I=(_.events??[]).filter(z=>z.status).sort((z,D)=>z.at-D.at).map((z,D)=>{const F=Math.min(Math.max(z.at,M),N),L=b;return b=F,{key:`${z.name??"sub"}-${z.at}-${D}`,name:z.name??"sub-process",status:z.status,left:(L-S)/g*100,width:Math.max((F-L)/g*100,.8),ms:F-L}});return{step:_,left:(M-S)/g*100,width:Math.max((N-M)/g*100,.8),ms:N-M,subRows:I}});return{span:g,rows:w}},[e,t]),[f,d]=R.useState(new Set),c=y=>d(v=>{const S=new Set(v);return S.has(y)?S.delete(y):S.add(y),S}),h=ES(t);return p.jsx(p.Fragment,{children:u.map(({step:y,left:v,width:S,ms:m,subRows:x})=>{const g=y.status==="failed",w=zs(y),_=!!w,M=_?Od:Dd(y.kind),N=r===`${y.runId}#${y.seq}`,b=_&&w!==void 0&&o.has(w),I=x.length>0&&!_,z=f.has(y.seq);return p.jsxs("div",{children:[p.jsxs("button",{type:"button",onClick:()=>i(y,e),title:_?"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 ${N?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[p.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[_&&w!==void 0&&p.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(w)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:b?"Collapse child run":"Expand child run inline",children:p.jsx("span",{className:"inline-block transition-transform",style:{transform:b?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),I&&p.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),c(y.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:z?`Show ${x.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:g?"text-red-400":_?"text-indigo-300":"text-emerald-400",children:p.jsx(M,{width:12,height:12})}),p.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:w!==void 0?h[w]??"child workflow":y.name}),_&&w!==void 0&&p.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),s(w)},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] ${g?"bg-red-500/35 ring-1 ring-red-500/50":N?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${v}%`,width:`${S}%`}}),p.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500",style:{left:`min(${v+S}%, calc(100% - 44px))`},children:Ng(m)})]})]}),x.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:x.map(D=>p.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${D.name} — ${D.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 ${NS[D.status]}`}),p.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:D.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] ${_S[D.status]}`,style:{left:`${D.left}%`,width:`${D.width}%`}})]})]},D.key))}),_&&w!==void 0&&b&&p.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-[var(--line-soft)] pl-2",children:p.jsx(CS,{id:w,depth:n+1,selectedKey:r,onSelect:i,onOpenRun:s,expanded:o,onToggleChild:l})})]},y.seq)})})}function CS({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o}){const{data:l}=pi({queryKey:["run",e],queryFn:()=>Ye.run(e)});return t>6?null:l?p.jsxs("div",{className:"my-1 rounded-md border border-[var(--line)] bg-black/15",children:[p.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[p.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),p.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),p.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),p.jsx("button",{type:"button",onClick:()=>i(e),className:"ml-auto rounded border border-[var(--line)] px-1.5 text-zinc-400 hover:text-zinc-200",children:"open ↗"})]}),p.jsx(Ad,{run:l.run,timeline:l.timeline,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o})]}):p.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}function bS({run:e,timeline:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:s,onToggleChild:o}){const l=R.useMemo(()=>{const f=t.map(v=>new Date(v.startedAt).getTime()),d=t.map(v=>new Date(v.finishedAt).getTime()),c=Math.min(new Date(e.createdAt).getTime(),...f),h=e.status==="running"||e.status==="suspended",y=Math.max(...d,h?Date.now():c+1);return Math.max(y-c,1)},[e,t]),a=s??new Set,u=o??(()=>{});return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[p.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),p.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",Ng(l)]})]}),p.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:p.jsx(Ad,{run:e,timeline:t,depth:0,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:u})})]})}function bl(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 bl(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 Cg={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"},jS={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},MS=["ok","failed","skipped"];function bg({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 ${jS[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?Cg[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:bl(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:["+",bl(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(bg,{e:u},`${u.at}-${f}`))})]})]})}function PS({events:e}){const{subs:t,stepLogs:n}=mS(e),r=MS.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:Cg[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(bg,{e:s},`${s.at}-${o}`))})]})]})}function zS({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(Eg,{width:11,height:11}):p.jsx(wS,{width:11,height:11}),t?"copied":"copy"]})}function jl({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return 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(zS,{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 IS({id:e,onOpenRun:t}){const{data:n}=pi({queryKey:["run",e],queryFn:()=>Ye.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 TS({step:e,run:t,onClose:n,onOpenRun:r}){const i=zs(e),[s,o]=R.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",u=Dd(e.kind),f=Ch(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return p.jsxs("aside",{className:"absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-[var(--line)] bg-[var(--panel)]/95 shadow-2xl backdrop-blur-md rise",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${l?"bg-red-500/15 text-red-300":a?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:p.jsx(u,{width:13,height:13})}),p.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),p.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",yc[e.kind]??e.kind]})]}),p.jsx("button",{type:"button",onClick:n,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-[var(--line)] text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:p.jsx(ki,{})})]}),p.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[p.jsxs("div",{className:"rounded-lg border border-[var(--line)] bg-black/20 px-3.5 py-1",children:[p.jsx(gn,{k:"seq",v:`#${e.seq}`}),d>=1&&p.jsx(gn,{k:"queued",v:p.jsx("span",{className:"text-sky-300",children:bl(d)})}),p.jsx(gn,{k:"duration",v:a?p.jsx("span",{className:"text-amber-300",children:"running…"}):Ch(e.startedAt,e.finishedAt)}),p.jsx(gn,{k:"attempts",v:p.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&p.jsx(_g,{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(PS,{events:e.events}),i&&p.jsxs("section",{className:"rise",children:[p.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[p.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&p.jsx("button",{type:"button",onClick:()=>r(i),className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",children:"open ↗"})]}),p.jsxs("button",{type:"button",onClick:()=>o(c=>!c),className:"flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20",title:s?"Collapse child run":"Expand child run inline",children:[p.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:s?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),p.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:i})]}),s&&p.jsx(IS,{id:i,onOpenRun:r})]}),e.input!==void 0&&p.jsx(jl,{label:"input",value:e.input}),e.output!==void 0&&p.jsx(jl,{label:"output",value:e.output})]})]})}function RS({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(jl,{label:"input",value:e.input}),e.output!==void 0&&p.jsx(jl,{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 $S={value:()=>{}};function ta(){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 Yo(n)}function Yo(e){this._=e}function OS(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}})}Yo.prototype=ta.prototype={constructor:Yo,on:function(e,t){var n=this._,r=OS(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=DS(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 Yo(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 DS(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]=$S,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var vc="http://www.w3.org/1999/xhtml";const Ph={svg:"http://www.w3.org/2000/svg",xhtml:vc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(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 AS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vc&&t.documentElement.namespaceURI===vc?t.createElement(e):t.createElementNS(n,e)}}function LS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jg(e){var t=na(e);return(t.local?LS:AS)(t)}function FS(){}function Fd(e){return e==null?FS:function(){return this.querySelector(e)}}function HS(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 BS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function VS(){return[]}function Mg(e){return e==null?VS:function(){return this.querySelectorAll(e)}}function US(e){return function(){return BS(e.apply(this,arguments))}}function QS(e){typeof e=="function"?e=US(e):e=Mg(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 Pg(e){return function(){return this.matches(e)}}function zg(e){return function(t){return t.matches(e)}}var WS=Array.prototype.find;function qS(e){return function(){return WS.call(this.children,e)}}function XS(){return this.firstElementChild}function YS(e){return this.select(e==null?XS:qS(typeof e=="function"?e:zg(e)))}var KS=Array.prototype.filter;function GS(){return Array.from(this.children)}function ZS(e){return function(){return KS.call(this.children,e)}}function JS(e){return this.selectAll(e==null?GS:ZS(typeof e=="function"?e:zg(e)))}function ek(e){typeof e!="function"&&(e=Pg(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 Ig(e){return new Array(e.length)}function tk(){return new at(this._enter||this._groups.map(Ig),this._parents)}function Ml(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ml.prototype={constructor:Ml,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 nk(e){return function(){return e}}function rk(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 Ml(e,s[o]);for(;o<a;++o)(l=t[o])&&(i[o]=l)}function ik(e,t,n,r,i,s,o){var l,a,u=new Map,f=t.length,d=s.length,c=new Array(f),h;for(l=0;l<f;++l)(a=t[l])&&(c[l]=h=o.call(a,a.__data__,l,t)+"",u.has(h)?i[l]=a:u.set(h,a));for(l=0;l<d;++l)h=o.call(e,s[l],l,s)+"",(a=u.get(h))?(r[l]=a,a.__data__=s[l],u.delete(h)):n[l]=new Ml(e,s[l]);for(l=0;l<f;++l)(a=t[l])&&u.get(c[l])===a&&(i[l]=a)}function sk(e){return e.__data__}function ok(e,t){if(!arguments.length)return Array.from(this,sk);var n=t?ik:rk,r=this._parents,i=this._groups;typeof e!="function"&&(e=nk(e));for(var s=i.length,o=new Array(s),l=new Array(s),a=new Array(s),u=0;u<s;++u){var f=r[u],d=i[u],c=d.length,h=lk(e.call(f,f&&f.__data__,u,r)),y=h.length,v=l[u]=new Array(y),S=o[u]=new Array(y),m=a[u]=new Array(c);n(f,d,v,S,m,h,t);for(var x=0,g=0,w,_;x<y;++x)if(w=v[x]){for(x>=g&&(g=x+1);!(_=S[g])&&++g<y;);w._next=_||null}}return o=new at(o,r),o._enter=l,o._exit=a,o}function lk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ak(){return new at(this._exit||this._groups.map(Ig),this._parents)}function uk(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 ck(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),l=new Array(i),a=0;a<o;++a)for(var u=n[a],f=r[a],d=u.length,c=l[a]=new Array(d),h,y=0;y<d;++y)(h=u[y]||f[y])&&(c[y]=h);for(;a<i;++a)l[a]=n[a];return new at(l,this._parents)}function dk(){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 fk(e){e||(e=hk);function t(d,c){return d&&c?e(d.__data__,c.__data__):!d-!c}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],l=o.length,a=i[s]=new Array(l),u,f=0;f<l;++f)(u=o[f])&&(a[f]=u);a.sort(t)}return new at(i,this._parents).order()}function hk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mk(){return Array.from(this)}function gk(){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 yk(){let e=0;for(const t of this)++e;return e}function vk(){return!this.node()}function xk(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 wk(e){return function(){this.removeAttribute(e)}}function Sk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kk(e,t){return function(){this.setAttribute(e,t)}}function Ek(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _k(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Nk(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 Ck(e,t){var n=na(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?Sk:wk:typeof t=="function"?n.local?Nk:_k:n.local?Ek:kk)(n,t))}function Tg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bk(e){return function(){this.style.removeProperty(e)}}function jk(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Mk(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Pk(e,t,n){return arguments.length>1?this.each((t==null?bk:typeof t=="function"?Mk:jk)(e,t,n??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||Tg(e).getComputedStyle(e,null).getPropertyValue(t)}function zk(e){return function(){delete this[e]}}function Ik(e,t){return function(){this[e]=t}}function Tk(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Rk(e,t){return arguments.length>1?this.each((t==null?zk:typeof t=="function"?Tk:Ik)(e,t)):this.node()[e]}function Rg(e){return e.trim().split(/^|\s+/)}function Hd(e){return e.classList||new $g(e)}function $g(e){this._node=e,this._names=Rg(e.getAttribute("class")||"")}$g.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 Og(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Dg(e,t){for(var n=Hd(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function $k(e){return function(){Og(this,e)}}function Ok(e){return function(){Dg(this,e)}}function Dk(e,t){return function(){(t.apply(this,arguments)?Og:Dg)(this,e)}}function Ak(e,t){var n=Rg(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"?Dk:t?$k:Ok)(n,t))}function Lk(){this.textContent=""}function Fk(e){return function(){this.textContent=e}}function Hk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bk(e){return arguments.length?this.each(e==null?Lk:(typeof e=="function"?Hk:Fk)(e)):this.node().textContent}function Vk(){this.innerHTML=""}function Uk(e){return function(){this.innerHTML=e}}function Qk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Wk(e){return arguments.length?this.each(e==null?Vk:(typeof e=="function"?Qk:Uk)(e)):this.node().innerHTML}function qk(){this.nextSibling&&this.parentNode.appendChild(this)}function Xk(){return this.each(qk)}function Yk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Kk(){return this.each(Yk)}function Gk(e){var t=typeof e=="function"?e:jg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zk(){return null}function Jk(e,t){var n=typeof e=="function"?e:jg(e),r=t==null?Zk:typeof t=="function"?t:Fd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function e2(){var e=this.parentNode;e&&e.removeChild(this)}function t2(){return this.each(e2)}function n2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function r2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function i2(e){return this.select(e?r2:n2)}function s2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function o2(e){return function(t){e.call(this,t,this.__data__)}}function l2(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 a2(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 u2(e,t,n){return function(){var r=this.__on,i,s=o2(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 c2(e,t,n){var r=l2(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?u2:a2,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function Ag(e,t,n){var r=Tg(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 d2(e,t){return function(){return Ag(this,e,t)}}function f2(e,t){return function(){return Ag(this,e,t.apply(this,arguments))}}function h2(e,t){return this.each((typeof t=="function"?f2:d2)(e,t))}function*p2(){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 Lg=[null];function at(e,t){this._groups=e,this._parents=t}function eo(){return new at([[document.documentElement]],Lg)}function m2(){return this}at.prototype=eo.prototype={constructor:at,select:HS,selectAll:QS,selectChild:YS,selectChildren:JS,filter:ek,data:ok,enter:tk,exit:ak,join:uk,merge:ck,selection:m2,order:dk,sort:fk,call:pk,nodes:mk,node:gk,size:yk,empty:vk,each:xk,attr:Ck,style:Pk,property:Rk,classed:Ak,text:Bk,html:Wk,raise:Xk,lower:Kk,append:Gk,insert:Jk,remove:t2,clone:i2,datum:s2,on:c2,dispatch:h2,[Symbol.iterator]:p2};function it(e){return typeof e=="string"?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],Lg)}function g2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nt(e,t){if(e=g2(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 y2={passive:!1},Is={capture:!0,passive:!1};function Ga(e){e.stopImmediatePropagation()}function Gr(e){e.preventDefault(),e.stopImmediatePropagation()}function Fg(e){var t=e.document.documentElement,n=it(e).on("dragstart.drag",Gr,Is);"onselectstart"in t?n.on("selectstart.drag",Gr,Is):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Hg(e,t){var n=e.document.documentElement,r=it(e).on("dragstart.drag",null);t&&(r.on("click.drag",Gr,Is),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 Co=e=>()=>e;function xc(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}})}xc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function v2(e){return!e.ctrlKey&&!e.button}function x2(){return this.parentNode}function w2(e,t){return t??{x:e.x,y:e.y}}function S2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bg(){var e=v2,t=x2,n=w2,r=S2,i={},s=ta("start","drag","end"),o=0,l,a,u,f,d=0;function c(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",m,y2).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,_){if(!(f||!e.call(this,w,_))){var M=g(this,t.call(this,w,_),w,_,"mouse");M&&(it(w.view).on("mousemove.drag",y,Is).on("mouseup.drag",v,Is),Fg(w.view),Ga(w),u=!1,l=w.clientX,a=w.clientY,M("start",w))}}function y(w){if(Gr(w),!u){var _=w.clientX-l,M=w.clientY-a;u=_*_+M*M>d}i.mouse("drag",w)}function v(w){it(w.view).on("mousemove.drag mouseup.drag",null),Hg(w.view,u),Gr(w),i.mouse("end",w)}function S(w,_){if(e.call(this,w,_)){var M=w.changedTouches,N=t.call(this,w,_),b=M.length,I,z;for(I=0;I<b;++I)(z=g(this,N,w,_,M[I].identifier,M[I]))&&(Ga(w),z("start",w,M[I]))}}function m(w){var _=w.changedTouches,M=_.length,N,b;for(N=0;N<M;++N)(b=i[_[N].identifier])&&(Gr(w),b("drag",w,_[N]))}function x(w){var _=w.changedTouches,M=_.length,N,b;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),N=0;N<M;++N)(b=i[_[N].identifier])&&(Ga(w),b("end",w,_[N]))}function g(w,_,M,N,b,I){var z=s.copy(),D=Nt(I||M,_),F,L,E;if((E=n.call(w,new xc("beforestart",{sourceEvent:M,target:c,identifier:b,active:o,x:D[0],y:D[1],dx:0,dy:0,dispatch:z}),N))!=null)return F=E.x-D[0]||0,L=E.y-D[1]||0,function $(P,O,k){var j=D,T;switch(P){case"start":i[b]=$,T=o++;break;case"end":delete i[b],--o;case"drag":D=Nt(k||O,_),T=o;break}z.call(P,w,new xc(P,{sourceEvent:O,subject:E,target:c,identifier:b,active:T,x:D[0]+F,y:D[1]+L,dx:D[0]-j[0],dy:D[1]-j[1],dispatch:z}),N)}}return c.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Co(!!w),c):e},c.container=function(w){return arguments.length?(t=typeof w=="function"?w:Co(w),c):t},c.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Co(w),c):n},c.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Co(!!w),c):r},c.on=function(){var w=s.on.apply(s,arguments);return w===s?c:w},c.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,c):Math.sqrt(d)},c}function Bd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function to(){}var Ts=.7,Pl=1/Ts,Zr="\\s*([+-]?\\d+)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k2=/^#([0-9a-f]{3,8})$/,E2=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),_2=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),N2=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Rs}\\)$`),C2=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Rs}\\)$`),b2=new RegExp(`^hsl\\(${Rs},${Ut},${Ut}\\)$`),j2=new RegExp(`^hsla\\(${Rs},${Ut},${Ut},${Rs}\\)$`),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(to,$s,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ih,formatHex:Ih,formatHex8:M2,formatHsl:P2,formatRgb:Th,toString:Th});function Ih(){return this.rgb().formatHex()}function M2(){return this.rgb().formatHex8()}function P2(){return Ug(this).formatHsl()}function Th(){return this.rgb().formatRgb()}function $s(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=k2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rh(t):n===3?new Ze(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bo(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=E2.exec(e))?new Ze(t[1],t[2],t[3],1):(t=_2.exec(e))?new Ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=N2.exec(e))?bo(t[1],t[2],t[3],t[4]):(t=C2.exec(e))?bo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=b2.exec(e))?Dh(t[1],t[2]/100,t[3]/100,1):(t=j2.exec(e))?Dh(t[1],t[2]/100,t[3]/100,t[4]):zh.hasOwnProperty(e)?Rh(zh[e]):e==="transparent"?new Ze(NaN,NaN,NaN,0):null}function Rh(e){return new Ze(e>>16&255,e>>8&255,e&255,1)}function bo(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ze(e,t,n,r)}function z2(e){return e instanceof to||(e=$s(e)),e?(e=e.rgb(),new Ze(e.r,e.g,e.b,e.opacity)):new Ze}function wc(e,t,n,r){return arguments.length===1?z2(e):new Ze(e,t,n,r??1)}function Ze(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bd(Ze,wc,Vg(to,{brighter(e){return e=e==null?Pl:Math.pow(Pl,e),new Ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new Ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ze(mr(this.r),mr(this.g),mr(this.b),zl(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:I2,formatRgb:Oh,toString:Oh}));function $h(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function I2(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oh(){const e=zl(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function zl(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 Ug(e){if(e instanceof jt)return new jt(e.h,e.s,e.l,e.opacity);if(e instanceof to||(e=$s(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 T2(e,t,n,r){return arguments.length===1?Ug(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,T2,Vg(to,{brighter(e){return e=e==null?Pl:Math.pow(Pl,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 Ze(Za(e>=240?e-240:e+120,i,r),Za(e,i,r),Za(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new jt(Ah(this.h),jo(this.s),jo(this.l),zl(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=zl(this.opacity);return`${e===1?"hsl(":"hsla("}${Ah(this.h)}, ${jo(this.s)*100}%, ${jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ah(e){return e=(e||0)%360,e<0?e+360:e}function jo(e){return Math.max(0,Math.min(1,e||0))}function Za(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 Qg=e=>()=>e;function R2(e,t){return function(n){return e+n*t}}function $2(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 O2(e){return(e=+e)==1?Wg:function(t,n){return n-t?$2(t,n,e):Qg(isNaN(t)?n:t)}}function Wg(e,t){var n=t-e;return n?R2(e,n):Qg(isNaN(e)?t:e)}const Lh=function e(t){var n=O2(t);function r(i,s){var o=n((i=wc(i)).r,(s=wc(s)).r),l=n(i.g,s.g),a=n(i.b,s.b),u=Wg(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 Sc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ja=new RegExp(Sc.source,"g");function D2(e){return function(){return e}}function A2(e){return function(t){return e(t)+""}}function L2(e,t){var n=Sc.lastIndex=Ja.lastIndex=0,r,i,s,o=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Sc.exec(e))&&(i=Ja.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=Ja.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?a[0]?A2(a[0].x):D2(t):(t=a.length,function(u){for(var f=0,d;f<t;++f)l[(d=a[f]).i]=d.x(u);return l.join("")})}var Fh=180/Math.PI,kc={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 Mo;function F2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kc:qg(t.a,t.b,t.c,t.d,t.e,t.f)}function H2(e){return e==null||(Mo||(Mo=document.createElementNS("http://www.w3.org/2000/svg","g")),Mo.setAttribute("transform",e),!(e=Mo.transform.baseVal.consolidate()))?kc:(e=e.matrix,qg(e.a,e.b,e.c,e.d,e.e,e.f))}function Xg(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,f,d,c,h,y){if(u!==d||f!==c){var v=h.push("translate(",null,t,null,n);y.push({i:v-4,x:kn(u,d)},{i:v-2,x:kn(f,c)})}else(d||c)&&h.push("translate("+d+t+c+n)}function o(u,f,d,c){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),c.push({i:d.push(i(d)+"rotate(",null,r)-2,x:kn(u,f)})):f&&d.push(i(d)+"rotate("+f+r)}function l(u,f,d,c){u!==f?c.push({i:d.push(i(d)+"skewX(",null,r)-2,x:kn(u,f)}):f&&d.push(i(d)+"skewX("+f+r)}function a(u,f,d,c,h,y){if(u!==d||f!==c){var v=h.push(i(h)+"scale(",null,",",null,")");y.push({i:v-4,x:kn(u,d)},{i:v-2,x:kn(f,c)})}else(d!==1||c!==1)&&h.push(i(h)+"scale("+d+","+c+")")}return function(u,f){var d=[],c=[];return u=e(u),f=e(f),s(u.translateX,u.translateY,f.translateX,f.translateY,d,c),o(u.rotate,f.rotate,d,c),l(u.skewX,f.skewX,d,c),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,d,c),u=f=null,function(h){for(var y=-1,v=c.length,S;++y<v;)d[(S=c[y]).i]=S.x(h);return d.join("")}}}var B2=Xg(F2,"px, ","px)","deg)"),V2=Xg(H2,", ",")",")"),U2=1e-12;function Hh(e){return((e=Math.exp(e))+1/e)/2}function Q2(e){return((e=Math.exp(e))-1/e)/2}function W2(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],d=o[1],c=o[2],h=f-l,y=d-a,v=h*h+y*y,S,m;if(v<U2)m=Math.log(c/u)/t,S=function(N){return[l+N*h,a+N*y,u*Math.exp(t*N*m)]};else{var x=Math.sqrt(v),g=(c*c-u*u+r*v)/(2*u*n*x),w=(c*c-u*u-r*v)/(2*c*n*x),_=Math.log(Math.sqrt(g*g+1)-g),M=Math.log(Math.sqrt(w*w+1)-w);m=(M-_)/t,S=function(N){var b=N*m,I=Hh(_),z=u/(n*x)*(I*W2(t*b+_)-Q2(_));return[l+z*h,a+z*y,u*I/Hh(t*b+_)]}}return S.duration=m*1e3*t/Math.SQRT2,S}return i.rho=function(s){var o=Math.max(.001,+s),l=o*o,a=l*l;return e(o,l,a)},i}(Math.SQRT2,2,4);var _i=0,es=0,Wi=0,Yg=1e3,Il,ts,Tl=0,_r=0,ra=0,Os=typeof performance=="object"&&performance.now?performance:Date,Kg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vd(){return _r||(Kg(X2),_r=Os.now()+ra)}function X2(){_r=0}function Rl(){this._call=this._time=this._next=null}Rl.prototype=Gg.prototype={constructor:Rl,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:Il=this,ts=this),this._call=e,this._time=n,Ec()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ec())}};function Gg(e,t,n){var r=new Rl;return r.restart(e,t,n),r}function Y2(){Vd(),++_i;for(var e=Il,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_i}function Bh(){_r=(Tl=Os.now())+ra,_i=es=0;try{Y2()}finally{_i=0,G2(),_r=0}}function K2(){var e=Os.now(),t=e-Tl;t>Yg&&(ra-=t,Tl=e)}function G2(){for(var e,t=Il,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:Il=n);ts=e,Ec(r)}function Ec(e){if(!_i){es&&(es=clearTimeout(es));var t=e-_r;t>24?(e<1/0&&(es=setTimeout(Bh,e-Os.now()-ra)),Wi&&(Wi=clearInterval(Wi))):(Wi||(Tl=Os.now(),Wi=setInterval(K2,Yg)),_i=1,Kg(Bh))}}function Vh(e,t,n){var r=new Rl;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Z2=ta("start","end","cancel","interrupt"),J2=[],Zg=0,Uh=1,_c=2,Ko=3,Qh=4,Nc=5,Go=6;function ia(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;eE(e,n,{name:t,index:r,group:i,on:Z2,tween:J2,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Zg})}function Ud(e,t){var n=Rt(e,t);if(n.state>Zg)throw new Error("too late; already scheduled");return n}function Qt(e,t){var n=Rt(e,t);if(n.state>Ko)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 eE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Gg(s,0,n.time);function s(u){n.state=Uh,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var f,d,c,h;if(n.state!==Uh)return a();for(f in r)if(h=r[f],h.name===n.name){if(h.state===Ko)return Vh(o);h.state===Qh?(h.state=Go,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[f]):+f<t&&(h.state=Go,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[f])}if(Vh(function(){n.state===Ko&&(n.state=Qh,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=_c,n.on.call("start",e,e.__data__,n.index,n.group),n.state===_c){for(n.state=Ko,i=new Array(c=n.tween.length),f=0,d=-1;f<c;++f)(h=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function l(u){for(var f=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Nc,1),d=-1,c=i.length;++d<c;)i[d].call(e,f);n.state===Nc&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Go,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Zo(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>_c&&r.state<Nc,r.state=Go,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function tE(e){return this.each(function(){Zo(this,e)})}function nE(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 rE(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 iE(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?nE:rE)(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 Jg(e,t){var n;return(typeof t=="number"?kn:t instanceof $s?Lh:(n=$s(t))?(t=n,Lh):L2)(e,t)}function sE(e){return function(){this.removeAttribute(e)}}function oE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lE(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 aE(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 uE(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 cE(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 dE(e,t){var n=na(e),r=n==="transform"?V2:Jg;return this.attrTween(e,typeof t=="function"?(n.local?cE:uE)(n,r,Qd(this,"attr."+e,t)):t==null?(n.local?oE:sE)(n):(n.local?aE:lE)(n,r,t))}function fE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&hE(e,s)),n}return i._value=t,i}function mE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&fE(e,s)),n}return i._value=t,i}function gE(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=na(e);return this.tween(n,(r.local?pE:mE)(r,t))}function yE(e,t){return function(){Ud(this,e).delay=+t.apply(this,arguments)}}function vE(e,t){return t=+t,function(){Ud(this,e).delay=t}}function xE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yE:vE)(t,e)):Rt(this.node(),t).delay}function wE(e,t){return function(){Qt(this,e).duration=+t.apply(this,arguments)}}function SE(e,t){return t=+t,function(){Qt(this,e).duration=t}}function kE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wE:SE)(t,e)):Rt(this.node(),t).duration}function EE(e,t){if(typeof t!="function")throw new Error;return function(){Qt(this,e).ease=t}}function _E(e){var t=this._id;return arguments.length?this.each(EE(t,e)):Rt(this.node(),t).ease}function NE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qt(this,e).ease=n}}function CE(e){if(typeof e!="function")throw new Error;return this.each(NE(this._id,e))}function bE(e){typeof e!="function"&&(e=Pg(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 jE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),l=0;l<s;++l)for(var a=t[l],u=n[l],f=a.length,d=o[l]=new Array(f),c,h=0;h<f;++h)(c=a[h]||u[h])&&(d[h]=c);for(;l<r;++l)o[l]=t[l];return new un(o,this._parents,this._name,this._id)}function ME(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 PE(e,t,n){var r,i,s=ME(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 zE(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(PE(n,e,t))}function IE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function TE(){return this.on("end.remove",IE(this._id))}function RE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Fd(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var l=r[o],a=l.length,u=s[o]=new Array(a),f,d,c=0;c<a;++c)(f=l[c])&&(d=e.call(f,f.__data__,c,l))&&("__data__"in f&&(d.__data__=f.__data__),u[c]=d,ia(u[c],t,n,c,u,Rt(f,n)));return new un(s,this._parents,t,n)}function $E(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Mg(e));for(var r=this._groups,i=r.length,s=[],o=[],l=0;l<i;++l)for(var a=r[l],u=a.length,f,d=0;d<u;++d)if(f=a[d]){for(var c=e.call(f,f.__data__,d,a),h,y=Rt(f,n),v=0,S=c.length;v<S;++v)(h=c[v])&&ia(h,t,n,v,c,y);s.push(c),o.push(f)}return new un(s,o,t,n)}var OE=eo.prototype.constructor;function DE(){return new OE(this._groups,this._parents)}function AE(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 ey(e){return function(){this.style.removeProperty(e)}}function LE(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 FE(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 HE(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=ey(t)):void 0;(u!==n||i!==f)&&(r=(n=u).copy()).on(o,i=f),a.on=r}}function BE(e,t,n){var r=(e+="")=="transform"?B2:Jg;return t==null?this.styleTween(e,AE(e,r)).on("end.style."+e,ey(e)):typeof t=="function"?this.styleTween(e,FE(e,r,Qd(this,"style."+e,t))).each(HE(this._id,e)):this.styleTween(e,LE(e,r,t),n).on("end.style."+e,null)}function VE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function UE(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&VE(e,o,n)),r}return s._value=t,s}function QE(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,UE(e,t,n??""))}function WE(e){return function(){this.textContent=e}}function qE(e){return function(){var t=e(this);this.textContent=t??""}}function XE(e){return this.tween("text",typeof e=="function"?qE(Qd(this,"text",e)):WE(e==null?"":e+""))}function YE(e){return function(t){this.textContent=e.call(this,t)}}function KE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&YE(i)),t}return r._value=e,r}function GE(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,KE(e))}function ZE(){for(var e=this._name,t=this._id,n=ty(),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);ia(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 JE(){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 e_=0;function un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ty(){return++e_}var Wt=eo.prototype;un.prototype={constructor:un,select:RE,selectAll:$E,selectChild:Wt.selectChild,selectChildren:Wt.selectChildren,filter:bE,merge:jE,selection:DE,transition:ZE,call:Wt.call,nodes:Wt.nodes,node:Wt.node,size:Wt.size,empty:Wt.empty,each:Wt.each,on:zE,attr:dE,attrTween:gE,style:BE,styleTween:QE,text:XE,textTween:GE,remove:TE,tween:iE,delay:xE,duration:kE,ease:_E,easeVarying:CE,end:JE,[Symbol.iterator]:Wt[Symbol.iterator]};function t_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var n_={time:null,delay:0,duration:250,ease:t_};function r_(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 i_(e){var t,n;e instanceof un?(t=e._id,e=e._name):(t=ty(),(n=n_).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])&&ia(a,e,t,u,o,n||r_(a,t));return new un(r,this._parents,e,t)}eo.prototype.interrupt=tE;eo.prototype.transition=i_;const Po=e=>()=>e;function s_(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 sa=new Jt(1,0,0);ny.prototype=Jt.prototype;function ny(e){for(;!e.__zoom;)if(!(e=e.parentNode))return sa;return e.__zoom}function eu(e){e.stopImmediatePropagation()}function qi(e){e.preventDefault(),e.stopImmediatePropagation()}function o_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function l_(){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||sa}function a_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function u_(){return navigator.maxTouchPoints||"ontouchstart"in this}function c_(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 ry(){var e=o_,t=l_,n=c_,r=a_,i=u_,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,a=q2,u=ta("start","zoom","end"),f,d,c,h=500,y=150,v=0,S=10;function m(E){E.property("__zoom",Wh).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,$,P,O){var k=E.selection?E.selection():E;k.property("__zoom",Wh),E!==k?_(E,$,P,O):k.interrupt().each(function(){M(this,arguments).event(O).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},m.scaleBy=function(E,$,P,O){m.scaleTo(E,function(){var k=this.__zoom.k,j=typeof $=="function"?$.apply(this,arguments):$;return k*j},P,O)},m.scaleTo=function(E,$,P,O){m.transform(E,function(){var k=t.apply(this,arguments),j=this.__zoom,T=P==null?w(k):typeof P=="function"?P.apply(this,arguments):P,A=j.invert(T),H=typeof $=="function"?$.apply(this,arguments):$;return n(g(x(j,H),T,A),k,o)},P,O)},m.translateBy=function(E,$,P,O){m.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),o)},null,O)},m.translateTo=function(E,$,P,O,k){m.transform(E,function(){var j=t.apply(this,arguments),T=this.__zoom,A=O==null?w(j):typeof O=="function"?O.apply(this,arguments):O;return n(sa.translate(A[0],A[1]).scale(T.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof P=="function"?-P.apply(this,arguments):-P),j,o)},O,k)};function x(E,$){return $=Math.max(s[0],Math.min(s[1],$)),$===E.k?E:new Jt($,E.x,E.y)}function g(E,$,P){var O=$[0]-P[0]*E.k,k=$[1]-P[1]*E.k;return O===E.x&&k===E.y?E:new Jt(E.k,O,k)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function _(E,$,P,O){E.on("start.zoom",function(){M(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(O).end()}).tween("zoom",function(){var k=this,j=arguments,T=M(k,j).event(O),A=t.apply(k,j),H=P==null?w(A):typeof P=="function"?P.apply(k,j):P,Y=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),U=k.__zoom,W=typeof $=="function"?$.apply(k,j):$,X=a(U.invert(H).concat(Y/U.k),W.invert(H).concat(Y/W.k));return function(Z){if(Z===1)Z=W;else{var Q=X(Z),te=Y/Q[2];Z=new Jt(te,H[0]-Q[0]*te,H[1]-Q[1]*te)}T.zoom(null,Z)}})}function M(E,$,P){return!P&&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 s_(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),$)}};function b(E,...$){if(!e.apply(this,arguments))return;var P=M(this,$).event(E),O=this.__zoom,k=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,r.apply(this,arguments)))),j=Nt(E);if(P.wheel)(P.mouse[0][0]!==j[0]||P.mouse[0][1]!==j[1])&&(P.mouse[1]=O.invert(P.mouse[0]=j)),clearTimeout(P.wheel);else{if(O.k===k)return;P.mouse=[j,O.invert(j)],Zo(this),P.start()}qi(E),P.wheel=setTimeout(T,y),P.zoom("mouse",n(g(x(O,k),P.mouse[0],P.mouse[1]),P.extent,o));function T(){P.wheel=null,P.end()}}function I(E,...$){if(c||!e.apply(this,arguments))return;var P=E.currentTarget,O=M(this,$,!0).event(E),k=it(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",Y,!0),j=Nt(E,P),T=E.clientX,A=E.clientY;Fg(E.view),eu(E),O.mouse=[j,this.__zoom.invert(j)],Zo(this),O.start();function H(U){if(qi(U),!O.moved){var W=U.clientX-T,X=U.clientY-A;O.moved=W*W+X*X>v}O.event(U).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=Nt(U,P),O.mouse[1]),O.extent,o))}function Y(U){k.on("mousemove.zoom mouseup.zoom",null),Hg(U.view,O.moved),qi(U),O.event(U).end()}}function z(E,...$){if(e.apply(this,arguments)){var P=this.__zoom,O=Nt(E.changedTouches?E.changedTouches[0]:E,this),k=P.invert(O),j=P.k*(E.shiftKey?.5:2),T=n(g(x(P,j),O,k),t.apply(this,$),o);qi(E),l>0?it(this).transition().duration(l).call(_,T,O,E):it(this).call(m.transform,T,O,E)}}function D(E,...$){if(e.apply(this,arguments)){var P=E.touches,O=P.length,k=M(this,$,E.changedTouches.length===O).event(E),j,T,A,H;for(eu(E),T=0;T<O;++T)A=P[T],H=Nt(A,this),H=[H,this.__zoom.invert(H),A.identifier],k.touch0?!k.touch1&&k.touch0[2]!==H[2]&&(k.touch1=H,k.taps=0):(k.touch0=H,j=!0,k.taps=1+!!f);f&&(f=clearTimeout(f)),j&&(k.taps<2&&(d=H[0],f=setTimeout(function(){f=null},h)),Zo(this),k.start())}}function F(E,...$){if(this.__zooming){var P=M(this,$).event(E),O=E.changedTouches,k=O.length,j,T,A,H;for(qi(E),j=0;j<k;++j)T=O[j],A=Nt(T,this),P.touch0&&P.touch0[2]===T.identifier?P.touch0[0]=A:P.touch1&&P.touch1[2]===T.identifier&&(P.touch1[0]=A);if(T=P.that.__zoom,P.touch1){var Y=P.touch0[0],U=P.touch0[1],W=P.touch1[0],X=P.touch1[1],Z=(Z=W[0]-Y[0])*Z+(Z=W[1]-Y[1])*Z,Q=(Q=X[0]-U[0])*Q+(Q=X[1]-U[1])*Q;T=x(T,Math.sqrt(Z/Q)),A=[(Y[0]+W[0])/2,(Y[1]+W[1])/2],H=[(U[0]+X[0])/2,(U[1]+X[1])/2]}else if(P.touch0)A=P.touch0[0],H=P.touch0[1];else return;P.zoom("touch",n(g(T,A,H),P.extent,o))}}function L(E,...$){if(this.__zooming){var P=M(this,$).event(E),O=E.changedTouches,k=O.length,j,T;for(eu(E),c&&clearTimeout(c),c=setTimeout(function(){c=null},h),j=0;j<k;++j)T=O[j],P.touch0&&P.touch0[2]===T.identifier?delete P.touch0:P.touch1&&P.touch1[2]===T.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(T=Nt(T,this),Math.hypot(d[0]-T[0],d[1]-T[1])<S)){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:Po(+E),m):r},m.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Po(!!E),m):e},m.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Po(!!E),m):i},m.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Po([[+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?(v=(E=+E)*E,m):Math.sqrt(v)},m.tapDistance=function(E){return arguments.length?(S=+E,m):S},m}const dn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},Ds=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],iy=["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 As;(function(e){e.Partial="partial",e.Full="full"})(As||(As={}));const sy={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 $l;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($l||($l={}));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 oy(e){return e===null?null:e?"valid":"invalid"}const ly=e=>"id"in e&&"source"in e&&"target"in e,d_=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),no=(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}},f_=(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?Ol(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oa(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return la(n)},ro=(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=Ol(r);n=oa(n,i)}}),la(n)},ay=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const l={...io(t,[n,r,i]),width:t.width/i,height:t.height/i},a=[];for(const u of e.values()){const{measured:f,selectable:d=!0,hidden:c=!1}=u;if(o&&!d||c)continue;const h=f.width??u.width??u.initialWidth??null,y=f.height??u.height??u.initialHeight??null,v=Ls(l,bi(u)),S=(h??0)*(y??0),m=s&&v>0;(!u.internals.handleBounds||m||v>=S||u.dragging)&&a.push(u)}return a},h_=(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 Cc(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 bc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!1);const l=ro(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 uy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},f=o.origin??r;let d=i;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",dn.error005());else{const h=l.measured.width,y=l.measured.height;h&&y&&(d=[[a,u],[a+h,u+y]])}else l&&ji(o.extent)&&(d=[[o.extent[0][0]+a,o.extent[0][1]+u],[o.extent[1][0]+a,o.extent[1][1]+u]]);const c=ji(d)?Nr(t,d,o.measured):t;return{position:{x:c.x-a+o.measured.width*f[0],y:c.y-u+o.measured.height*f[1]},positionAbsolute:c}}async function p_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(c=>c.id)),o=[];for(const c of n){if(c.deletable===!1)continue;const h=s.has(c.id),y=!h&&c.parentId&&o.find(v=>v.id===c.parentId);(h||y)&&o.push(c)}const l=new Set(t.map(c=>c.id)),a=r.filter(c=>c.deletable!==!1),f=h_(o,a);for(const c of a)l.has(c.id)&&!f.find(y=>y.id===c.id)&&f.push(c);if(!i)return{edges:f,nodes:o};const d=await i({nodes:o,edges:f});return typeof d=="boolean"?d?{edges:f,nodes:o}:{edges:[],nodes:[]}:d}const Ci=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Nr=(e={x:0,y:0},t,n)=>({x:Ci(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ci(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function cy(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,dy=(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]},oa=(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)}),jc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),la=({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:no(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}},Ol=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Wd(e)?e.internals.positionAbsolute:no(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)}},fy=(e,t)=>la(oa(jc(e),jc(t))),Ls=(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),m_=(e,t)=>{},aa=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),io=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return s?aa(l,o):l},hy=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),qd=(e,t,n,r,i,s)=>{const o=t/(e.width*(1+s)),l=n/(e.height*(1+s)),a=Math.min(o,l),u=Ci(a,r,i),f=e.x+e.width/2,d=e.y+e.height/2,c=t/2-f*u,h=n/2-d*u;return{x:c,y:h,zoom:u}},Dl=()=>{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 py(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 my(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=io({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:a,y:u}=n?aa(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const ua=e=>({width:e.offsetWidth,height:e.offsetHeight}),gy=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},g_=["INPUT","SELECT","TEXTAREA"];function Mc(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 g_.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 yy=e=>"clientX"in e,tn=(e,t)=>{var s,o;const n=yy(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,...ua(o)}})};function vy({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:l}){const a=e*.125+i*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,f=Math.abs(a-e),d=Math.abs(u-t);return[a,u,f,d]}function zo(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-zo(t-r,s),n];case G.Right:return[t+zo(r-t,s),n];case G.Top:return[t,n-zo(n-i,s)];case G.Bottom:return[t,n+zo(i-n,s)]}}function xy({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top,curvature:o=.25}){const[l,a]=Gh({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[u,f]=Gh({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[d,c,h,y]=vy({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:f});return[`M${e},${t} C${l},${a} ${u},${f} ${r},${i}`,d,c,h,y]}function wy({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 y_({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 v_({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=oa(Ol(e),Ol(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 Ls(o,la(s))>0}const x_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,w_=(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)),S_=(e,t)=>{if(!e.source||!e.target)return t;let n;return ly(e)?n={...e}:n={...e,id:x_(e)},w_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Sy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,l]=wy({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}},k_=({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 E_({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=k_({source:a,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",c=f[d];let h=[],y,v;const S={x:0,y:0},m={x:0,y:0},[x,g,w,_]=wy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*l[d]===-1){y=i.x??x,v=i.y??g;const N=[{x:y,y:a.y},{x:y,y:u.y}],b=[{x:a.x,y:v},{x:u.x,y:v}];o[d]===c?h=d==="x"?N:b:h=d==="x"?b:N}else{const N=[{x:a.x,y:u.y}],b=[{x:u.x,y:a.y}];if(d==="x"?h=o.x===c?b:N:h=o.y===c?N:b,t===r){const L=Math.abs(e[d]-n[d]);if(L<=s){const E=Math.min(s-1,s-L);o[d]===c?S[d]=(a[d]>e[d]?-1:1)*E:m[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const L=d==="x"?"y":"x",E=o[d]===l[L],$=a[L]>u[L],P=a[L]<u[L];(o[d]===1&&(!E&&$||E&&P)||o[d]!==1&&(!E&&P||E&&$))&&(h=d==="x"?N:b)}const I={x:a.x+S.x,y:a.y+S.y},z={x:u.x+m.x,y:u.y+m.y},D=Math.max(Math.abs(I.x-h[0].x),Math.abs(z.x-h[0].x)),F=Math.max(Math.abs(I.y-h[0].y),Math.abs(z.y-h[0].y));D>=F?(y=(I.x+z.x)/2,v=h[0].y):(y=h[0].x,v=(I.y+z.y)/2)}return[[e,{x:a.x+S.x,y:a.y+S.y},...h,{x:u.x+m.x,y:u.y+m.y},n],y,v,w,_]}function __(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 Pc({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top,borderRadius:o=5,centerX:l,centerY:a,offset:u=20}){const[f,d,c,h,y]=E_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:a},offset:u});return[f.reduce((S,m,x)=>{let g="";return x>0&&x<f.length-1?g=__(f[x-1],m,f[x+1],o):g=`${x===0?"M":"L"}${m.x} ${m.y}`,S+=g,S},""),d,c,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 N_(e){var d;const{sourceNode:t,targetNode:n}=e;if(!ep(t)||!ep(n))return null;const r=t.internals.handleBounds||tp(t.handles),i=n.internals.handleBounds||tp(n.handles),s=np((r==null?void 0:r.source)??[],e.sourceHandle),o=np(e.connectionMode===Ni.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(d=e.onError)==null||d.call(e,"008",dn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||G.Bottom,a=(o==null?void 0:o.position)||G.Top,u=Fs(t,s,l),f=Fs(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 Fs(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 zc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function C_(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=zc(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:Ds,elevateNodesOnSelect:!0,defaults:{}},b_={...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 j_(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=no(i,r.nodeOrigin),o=ji(i.extent)?i.extent:r.nodeExtent,l=Nr(s,o,fn(i));i.internals.positionAbsolute=l}}function Ic(e,t,n,r){var l,a;const i=Yd(b_,r),s=new Map(t),o=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(i.checkEquality&&u===(f==null?void 0:f.internals.userNode))t.set(u.id,f);else{const d=no(u,i.nodeOrigin),c=ji(u.extent)?u.extent:i.nodeExtent,h=Nr(d,c,fn(u));f={...i.defaults,...u,measured:{width:(l=u.measured)==null?void 0:l.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:h,handleBounds:u.measured?f==null?void 0:f.internals.handleBounds:void 0,z:ky(u,o),userNode:u}},t.set(u.id,f)}u.parentId&&Kd(f,t,n,r)}}function M_(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}M_(e,n);const u=i?1e3:0,{x:f,y:d,z:c}=P_(e,a,s,o,u),{positionAbsolute:h}=e.internals,y=f!==h.x||d!==h.y;(y||c!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:f,y:d}:h,z:c})}function ky(e,t){return(Mt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function P_(e,t,n,r,i){const{x:s,y:o}=t.internals.positionAbsolute,l=fn(e),a=no(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=cy(f,l,t));const d=ky(e,i),c=t.internals.z??0;return{x:f.x,y:f.y,z:c>d?c:d}}function Gd(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??bi(a),f=fy(u,l.rect);s.set(l.parentId,{expandedRect:f,parent:a})}return s.size>0&&s.forEach(({expandedRect:l,parent:a},u)=>{var g;const f=a.internals.positionAbsolute,d=fn(a),c=a.origin??r,h=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,y=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),m=(v-d.width)*c[0],x=(S-d.height)*c[1];(h>0||y>0||m||x)&&(i.push({id:u,type:"position",position:{x:a.position.x-h+m,y:a.position.y-y+x}}),(g=n.get(u))==null||g.forEach(w=>{e.some(_=>_.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||h||y)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(h?c[0]*h-m:0),height:S+(y?c[1]*y-x:0)}})}),i}function z_(e,t,n,r,i,s){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const a=[],u=window.getComputedStyle(o),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const c of e.values()){const h=t.get(c.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const y=ua(c.nodeElement),v=h.measured.width!==y.width||h.measured.height!==y.height;if(!!(y.width&&y.height&&(v||!h.internals.handleBounds||c.force))){const m=c.nodeElement.getBoundingClientRect(),x=ji(h.extent)?h.extent:s;let{positionAbsolute:g}=h.internals;h.parentId&&h.extent==="parent"?g=cy(g,y,t.get(h.parentId)):x&&(g=Nr(g,x,y)),h.measured=y,h.internals={...h.internals,positionAbsolute:g,handleBounds:{source:Kh("source",c.nodeElement,m,f,h.id),target:Kh("target",c.nodeElement,m,f,h.id)}},h.parentId&&Kd(h,t,n,{nodeOrigin:i}),l=!0,v&&(a.push({id:h.id,type:"dimensions",dimensions:y}),h.expandParent&&h.parentId&&d.push({id:h.id,parentId:h.parentId,rect:bi(h,i)}))}}}if(d.length>0){const c=Gd(d,t,n,i);a.push(...c)}return{changes:a,updatedInternals:l}}async function I_({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 Ey(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:l=null}=r,a=`${i}-source-${o}`,u=`${s}-target-${l}`,f=e.get(a)||new Map,d=e.get(u)||new Map,c={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:l};t.set(r.id,r),e.set(a,f.set(`${s}-${l}`,c)),e.set(u,d.set(`${i}-${o}`,c))}}function _y(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:_y(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 T_(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!_y(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 tu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,a;const i=[];for(const[u,f]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&i.push({...d,position:f.position,dragging:r})}if(!e)return[i[0],i];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((a=t.get(e))==null?void 0:a.position)||s.position,dragging:r}:i[0],i]}function R_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,l=new Map,a=!1,u={x:0,y:0},f=null,d=!1,c=null,h=!1;function y({noDragClassName:S,handleSelector:m,domNode:x,isSelectable:g,nodeId:w,nodeClickDistance:_=0}){c=it(x);function M({x:z,y:D},F){const{nodeLookup:L,nodeExtent:E,snapGrid:$,snapToGrid:P,nodeOrigin:O,onNodeDrag:k,onSelectionDrag:j,onError:T,updateNodePositions:A}=t();s={x:z,y:D};let H=!1,Y={x:0,y:0,x2:0,y2:0};if(l.size>1&&E){const U=ro(l);Y=jc(U)}for(const[U,W]of l){if(!L.has(U))continue;let X={x:z-W.distance.x,y:D-W.distance.y};P&&(X=aa(X,$));let Z=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(l.size>1&&E&&!W.extent){const{positionAbsolute:se}=W.internals,ne=se.x-Y.x+E[0][0],J=se.x+W.measured.width-Y.x2+E[1][0],ae=se.y-Y.y+E[0][1],fe=se.y+W.measured.height-Y.y2+E[1][1];Z=[[ne,ae],[J,fe]]}const{position:Q,positionAbsolute:te}=uy({nodeId:U,nextPosition:X,nodeLookup:L,nodeExtent:Z,nodeOrigin:O,onError:T});H=H||W.position.x!==Q.x||W.position.y!==Q.y,W.position=Q,W.internals.positionAbsolute=te}if(H&&(A(l,!0),F&&(r||k||!w&&j))){const[U,W]=tu({nodeId:w,dragItems:l,nodeLookup:L});r==null||r(F,l,U,W),k==null||k(F,U,W),w||j==null||j(F,W)}}async function N(){if(!f)return;const{transform:z,panBy:D,autoPanSpeed:F}=t(),[L,E]=dy(u,f,F);(L!==0||E!==0)&&(s.x=(s.x??0)-L/z[2],s.y=(s.y??0)-E/z[2],await D({x:L,y:E})&&M(s,null)),o=requestAnimationFrame(N)}function b(z){var H;const{nodeLookup:D,multiSelectionActive:F,nodesDraggable:L,transform:E,snapGrid:$,snapToGrid:P,selectNodesOnDrag:O,onNodeDragStart:k,onSelectionDragStart:j,unselectNodesAndEdges:T}=t();d=!0,(!O||!g)&&!F&&w&&((H=D.get(w))!=null&&H.selected||T()),g&&O&&w&&(e==null||e(w));const A=ds(z.sourceEvent,{transform:E,snapGrid:$,snapToGrid:P,containerBounds:f});if(s=A,l=T_(D,L,A,w),l.size>0&&(n||k||!w&&j)){const[Y,U]=tu({nodeId:w,dragItems:l,nodeLookup:D});n==null||n(z.sourceEvent,l,Y,U),k==null||k(z.sourceEvent,Y,U),w||j==null||j(z.sourceEvent,U)}}const I=Bg().clickDistance(_).on("start",z=>{const{domNode:D,nodeDragThreshold:F,transform:L,snapGrid:E,snapToGrid:$}=t();f=(D==null?void 0:D.getBoundingClientRect())||null,h=!1,F===0&&b(z),s=ds(z.sourceEvent,{transform:L,snapGrid:E,snapToGrid:$,containerBounds:f}),u=tn(z.sourceEvent,f)}).on("drag",z=>{const{autoPanOnNodeDrag:D,transform:F,snapGrid:L,snapToGrid:E,nodeDragThreshold:$,nodeLookup:P}=t(),O=ds(z.sourceEvent,{transform:F,snapGrid:L,snapToGrid:E,containerBounds:f});if((z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||w&&!P.has(w))&&(h=!0),!h){if(!a&&D&&d&&(a=!0,N()),!d){const k=O.xSnapped-(s.x??0),j=O.ySnapped-(s.y??0);Math.sqrt(k*k+j*j)>$&&b(z)}(s.x!==O.xSnapped||s.y!==O.ySnapped)&&l&&d&&(u=tn(z.sourceEvent,f),M(O,z.sourceEvent))}}).on("end",z=>{if(!(!d||h)&&(a=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:D,updateNodePositions:F,onNodeDragStop:L,onSelectionDragStop:E}=t();if(F(l,!1),i||L||!w&&E){const[$,P]=tu({nodeId:w,dragItems:l,nodeLookup:D,dragging:!1});i==null||i(z.sourceEvent,l,$,P),L==null||L(z.sourceEvent,$,P),w||E==null||E(z.sourceEvent,P)}}}).filter(z=>{const D=z.target;return!z.button&&(!S||!rp(D,`.${S}`,x))&&(!m||rp(D,m,x))});c.call(I)}function v(){c==null||c.on(".drag",null)}return{update:y,destroy:v}}function $_(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())Ls(i,bi(s))>0&&r.push(s);return r}const O_=250;function D_(e,t,n,r){var l,a;let i=[],s=1/0;const o=$_(e,n,t+O_);for(const u of o){const f=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of f){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:c,y:h}=Fs(u,d,d.position,!0),y=Math.sqrt(Math.pow(c-e.x,2)+Math.pow(h-e.y,2));y>t||(y<s?(i=[{...d,x:c,y:h}],s=y):y===s&&i.push({...d,x:c,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(f=>f.type===u)??i[0]}return i[0]}function Ny(e,t,n,r,i,s=!1){var u,f,d;const o=r.get(e);if(!o)return null;const l=i==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((f=o.internals.handleBounds)==null?void 0:f.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(c=>c.id===n):l==null?void 0:l[0])??null;return a&&s?{...a,...Fs(o,a,a.position,!0)}:a}function Cy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function A_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const by=()=>!0;function L_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:f,flowId:d,panBy:c,cancelConnection:h,onConnectStart:y,onConnect:v,onConnectEnd:S,isValidConnection:m=by,onReconnectEnd:x,updateConnection:g,getTransform:w,getFromHandle:_,autoPanSpeed:M}){const N=gy(e.target);let b=0,I;const{x:z,y:D}=tn(e),F=N==null?void 0:N.elementFromPoint(z,D),L=Cy(s,F),E=l==null?void 0:l.getBoundingClientRect();if(!E||!L)return;const $=Ny(i,L,r,a,t);if(!$)return;let P=tn(e,E),O=!1,k=null,j=!1,T=null;function A(){if(!f||!E)return;const[te,se]=dy(P,E,M);c({x:te,y:se}),b=requestAnimationFrame(A)}const H={...$,nodeId:i,type:L,position:$.position},Y=a.get(i),W={inProgress:!0,isValid:null,from:Fs(Y,H,G.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:Y,to:P,toHandle:null,toPosition:qh[H.position],toNode:null};g(W);let X=W;y==null||y(e,{nodeId:i,handleId:r,handleType:L});function Z(te){if(!_()||!H){Q(te);return}const se=w();P=tn(te,E),I=D_(io(P,se,!1,[1,1]),n,a,H),O||(A(),O=!0);const ne=jy(te,{handle:I,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:m,doc:N,lib:u,flowId:d,nodeLookup:a});T=ne.handleDomNode,k=ne.connection,j=A_(!!I,ne.isValid);const J={...X,isValid:j,to:I&&j?hy({x:I.x,y:I.y},se):P,toHandle:ne.toHandle,toPosition:j&&ne.toHandle?ne.toHandle.position:qh[H.position],toNode:ne.toHandle?a.get(ne.toHandle.nodeId):null};j&&I&&X.toHandle&&J.toHandle&&X.toHandle.type===J.toHandle.type&&X.toHandle.nodeId===J.toHandle.nodeId&&X.toHandle.id===J.toHandle.id&&X.to.x===J.to.x&&X.to.y===J.to.y||(g(J),X=J)}function Q(te){(I||T)&&k&&j&&(v==null||v(k));const{inProgress:se,...ne}=X,J={...ne,toPosition:X.toHandle?X.toPosition:null};S==null||S(te,J),s&&(x==null||x(te,J)),h(),cancelAnimationFrame(b),O=!1,j=!1,k=null,T=null,N.removeEventListener("mousemove",Z),N.removeEventListener("mouseup",Q),N.removeEventListener("touchmove",Z),N.removeEventListener("touchend",Q)}N.addEventListener("mousemove",Z),N.addEventListener("mouseup",Q),N.addEventListener("touchmove",Z),N.addEventListener("touchend",Q)}function jy(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:l,flowId:a,isValidConnection:u=by,nodeLookup:f}){const d=s==="target",c=t?o.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y}=tn(e),v=o.elementFromPoint(h,y),S=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:c,m={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=Cy(void 0,S),g=S.getAttribute("data-nodeid"),w=S.getAttribute("data-handleid"),_=S.classList.contains("connectable"),M=S.classList.contains("connectableend");if(!g||!x)return m;const N={source:d?g:r,sourceHandle:d?w:i,target:d?r:g,targetHandle:d?i:w};m.connection=N;const I=_&&M&&(n===Ni.Strict?d&&x==="source"||!d&&x==="target":g!==r||w!==i);m.isValid=I&&u(N),m.toHandle=Ny(g,x,w,f,n,!1)}return m}const Tc={onPointerDown:L_,isValid:jy};function F_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=it(e);function s({translateExtent:l,width:a,height:u,zoomStep:f=10,pannable:d=!0,zoomable:c=!0,inversePan:h=!1}){const 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,M=w[2]*Math.pow(2,_);t.scaleTo(M)};let v=[0,0];const S=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const _=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],M=[_[0]-v[0],_[1]-v[1]];v=_;const N=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),b={x:w[0]-M[0]*N,y:w[1]-M[1]*N},I=[[0,0],[a,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},I,l)},x=ry().on("start",S).on("zoom",d?m:null).on("zoom.wheel",c?y:null);i.call(x,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:Nt}}const H_=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ca=e=>({x:e.x,y:e.y,zoom:e.k}),nu=({x:e,y:t,zoom:n})=>sa.translate(e,t).scale(n),Br=(e,t)=>e.target.closest(`.${t}`),My=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ru=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},Py=e=>{const t=e.ctrlKey&&Dl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function B_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return f=>{if(Br(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(f.ctrlKey&&o){const S=Nt(f),m=Py(f),x=d*Math.pow(2,m);r.scaleTo(n,x,S,f);return}const c=f.deltaMode===1?20:1;let h=i===gr.Vertical?0:f.deltaX*c,y=i===gr.Horizontal?0:f.deltaY*c;!Dl()&&f.shiftKey&&i!==gr.Vertical&&(h=f.deltaY*c,y=0),r.translateBy(n,-(h/d)*s,-(y/d)*s,{internal:!0});const v=ca(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,v)),e.isPanScrolling&&(a==null||a(f,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(f,v),e.isPanScrolling=!1},150))}}function V_({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 U_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,l;if((s=r.sourceEvent)!=null&&s.internal)return;const i=ca(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 Q_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&My(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,ca(s.transform)))}}function W_({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&&My(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&H_(e.prevViewport,o.transform))){const a=ca(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 d=e||t,c=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(Br(f,`${u}-flow__node`)||Br(f,`${u}-flow__edge`)))return!0;if(!r&&!d&&!i&&!s&&!n||o||Br(f,l)&&f.type==="wheel"||Br(f,a)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!d&&!i&&!c&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&h}}function X_({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:a,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=ry().clickDistance(!Mt(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=it(e).call(c);g({x:s.x,y:s.y,zoom:Ci(s.zoom,t,n)},[[0,0],[d.width,d.height]],i);const y=h.on("wheel.zoom"),v=h.on("dblclick.zoom");c.wheelDelta(Py);function S(F,L){return h?new Promise(E=>{c==null||c.transform(ru(h,L==null?void 0:L.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function m({noWheelClassName:F,noPanClassName:L,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:P,panOnDrag:O,panOnScrollMode:k,panOnScrollSpeed:j,preventScrolling:T,zoomOnPinch:A,zoomOnScroll:H,zoomOnDoubleClick:Y,zoomActivationKeyPressed:U,lib:W,onTransformChange:X}){$&&!f.isZoomingOrPanning&&x();const Q=P&&!U&&!$?B_({zoomPanValues:f,noWheelClassName:F,d3Selection:h,d3Zoom:c,panOnScrollMode:k,panOnScrollSpeed:j,zoomOnPinch:A,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:a}):V_({noWheelClassName:F,preventScrolling:T,d3ZoomHandler:y});if(h.on("wheel.zoom",Q,{passive:!1}),!$){const se=U_({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:l});c.on("start",se);const ne=Q_({zoomPanValues:f,panOnDrag:O,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:X});c.on("zoom",ne);const J=W_({zoomPanValues:f,panOnDrag:O,panOnScroll:P,onPaneContextMenu:E,onPanZoomEnd:a,onDraggingChange:u});c.on("end",J)}const te=q_({zoomActivationKeyPressed:U,panOnDrag:O,zoomOnScroll:H,panOnScroll:P,zoomOnDoubleClick:Y,zoomOnPinch:A,userSelectionActive:$,noPanClassName:L,noWheelClassName:F,lib:W});c.filter(te),Y?h.on("dblclick.zoom",v):h.on("dblclick.zoom",null)}function x(){c.on("zoom",null)}async function g(F,L,E){const $=nu(F),P=c==null?void 0:c.constrain()($,L,E);return P&&await S(P),new Promise(O=>O(P))}async function w(F,L){const E=nu(F);return await S(E,L),new Promise($=>$(E))}function _(F){if(h){const L=nu(F),E=h.property("__zoom");(E.k!==F.zoom||E.x!==F.x||E.y!==F.y)&&(c==null||c.transform(h,L,null,{sync:!0}))}}function M(){const F=h?ny(h.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function N(F,L){return h?new Promise(E=>{c==null||c.scaleTo(ru(h,L==null?void 0:L.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function b(F,L){return h?new Promise(E=>{c==null||c.scaleBy(ru(h,L==null?void 0:L.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function I(F){c==null||c.scaleExtent(F)}function z(F){c==null||c.translateExtent(F)}function D(F){const L=!Mt(F)||F<0?0:F;c==null||c.clickDistance(L)}return{update:m,destroy:x,setViewport:w,setViewportConstrained:g,getViewport:M,scaleTo:N,scaleBy:b,setScaleExtent:I,setTranslateExtent:z,syncViewport:_,setClickDistance:D}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function Y_({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 K_(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 Io(e,t,n){return Math.max(0,t-e,e-n)}function ip(e,t){return e?!t:t}function G_(e,t,n,r,i,s,o,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:f,isVertical:d}=t,c=f&&d,{xSnapped:h,ySnapped:y}=n,{minWidth:v,maxWidth:S,minHeight:m,maxHeight:x}=r,{x:g,y:w,width:_,height:M,aspectRatio:N}=e;let b=Math.floor(f?h-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const z=_+(a?-b:b),D=M+(u?-I:I),F=-s[0]*_,L=-s[1]*M;let E=Io(z,v,S),$=Io(D,m,x);if(o){let k=0,j=0;a&&b<0?k=yn(g+b+F,o[0][0]):!a&&b>0&&(k=vn(g+z+F,o[1][0])),u&&I<0?j=yn(w+I+L,o[0][1]):!u&&I>0&&(j=vn(w+D+L,o[1][1])),E=Math.max(E,k),$=Math.max($,j)}if(l){let k=0,j=0;a&&b>0?k=vn(g+b,l[0][0]):!a&&b<0&&(k=yn(g+z,l[1][0])),u&&I>0?j=vn(w+I,l[0][1]):!u&&I<0&&(j=yn(w+D,l[1][1])),E=Math.max(E,k),$=Math.max($,j)}if(i){if(f){const k=Io(z/N,m,x)*N;if(E=Math.max(E,k),o){let j=0;!a&&!u||a&&!u&&c?j=vn(w+L+z/N,o[1][1])*N:j=yn(w+L+(a?b:-b)/N,o[0][1])*N,E=Math.max(E,j)}if(l){let j=0;!a&&!u||a&&!u&&c?j=yn(w+z/N,l[1][1])*N:j=vn(w+(a?b:-b)/N,l[0][1])*N,E=Math.max(E,j)}}if(d){const k=Io(D*N,v,S)/N;if($=Math.max($,k),o){let j=0;!a&&!u||u&&!a&&c?j=vn(g+D*N+F,o[1][0])/N:j=yn(g+(u?I:-I)*N+F,o[0][0])/N,$=Math.max($,j)}if(l){let j=0;!a&&!u||u&&!a&&c?j=yn(g+D*N,l[1][0])/N:j=vn(g+(u?I:-I)*N,l[0][0])/N,$=Math.max($,j)}}}I=I+(I<0?$:-$),b=b+(b<0?E:-E),i&&(c?z>D*N?I=(ip(a,u)?-b:b)/N:b=(ip(a,u)?-I:I)*N:f?(I=b/N,u=a):(b=I*N,a=u));const P=a?g+b:g,O=u?w+I:w;return{width:_+(a?-b:b),height:M+(u?-I:I),x:s[0]*b*(a?-1:1)+P,y:s[1]*I*(u?-1:1)+O}}const zy={width:0,height:0,x:0,y:0},Z_={...zy,pointerX:0,pointerY:0,aspectRatio:1};function J_(e){return[[0,0],[e.measured.width,e.measured.height]]}function eN(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 tN({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=it(e);function o({controlPosition:a,boundaries:u,keepAspectRatio:f,onResizeStart:d,onResize:c,onResizeEnd:h,shouldResize:y}){let v={...zy},S={...Z_};const m=K_(a);let x,g=null,w=[],_,M,N;const b=Bg().on("start",I=>{const{nodeLookup:z,transform:D,snapGrid:F,snapToGrid:L,nodeOrigin:E,paneDomNode:$}=n();if(x=z.get(t),!x)return;g=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:P,ySnapped:O}=ds(I.sourceEvent,{transform:D,snapGrid:F,snapToGrid:L,containerBounds:g});v={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},S={...v,pointerX:P,pointerY:O,aspectRatio:v.width/v.height},_=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(_=z.get(x.parentId),M=_&&x.extent==="parent"?J_(_):void 0),w=[],N=void 0;for(const[k,j]of z)if(j.parentId===t&&(w.push({id:k,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const T=eN(j,x,j.origin??E);N?N=[[Math.min(T[0][0],N[0][0]),Math.min(T[0][1],N[0][1])],[Math.max(T[1][0],N[1][0]),Math.max(T[1][1],N[1][1])]]:N=T}d==null||d(I,{...v})}).on("drag",I=>{const{transform:z,snapGrid:D,snapToGrid:F,nodeOrigin:L}=n(),E=ds(I.sourceEvent,{transform:z,snapGrid:D,snapToGrid:F,containerBounds:g}),$=[];if(!x)return;const{x:P,y:O,width:k,height:j}=v,T={},A=x.origin??L,{width:H,height:Y,x:U,y:W}=G_(S,m,E,u,f,A,M,N),X=H!==k,Z=Y!==j,Q=U!==P&&X,te=W!==O&&Z;if(!Q&&!te&&!X&&!Z)return;if((Q||te||A[0]===1||A[1]===1)&&(T.x=Q?U:v.x,T.y=te?W:v.y,v.x=T.x,v.y=T.y,w.length>0)){const ae=U-P,fe=W-O;for(const $e of w)$e.position={x:$e.position.x-ae+A[0]*(H-k),y:$e.position.y-fe+A[1]*(Y-j)},$.push($e)}if((X||Z)&&(T.width=X?H:v.width,T.height=Z?Y:v.height,v.width=T.width,v.height=T.height),_&&x.expandParent){const ae=A[0]*(T.width??0);T.x&&T.x<ae&&(v.x=ae,S.x=S.x-(T.x-ae));const fe=A[1]*(T.height??0);T.y&&T.y<fe&&(v.y=fe,S.y=S.y-(T.y-fe))}const se=Y_({width:v.width,prevWidth:k,height:v.height,prevHeight:j,affectsX:m.affectsX,affectsY:m.affectsY}),ne={...v,direction:se};(y==null?void 0:y(I,ne))!==!1&&(c==null||c(I,ne),r(T,$))}).on("end",I=>{h==null||h(I,{...v}),i==null||i()});s.call(b)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var Iy={exports:{}},Ty={},Ry={exports:{}},$y={};/**
|
|
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 nN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rN=typeof Object.is=="function"?Object.is:nN,iN=Mi.useState,sN=Mi.useEffect,oN=Mi.useLayoutEffect,lN=Mi.useDebugValue;function aN(e,t){var n=t(),r=iN({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return oN(function(){i.value=n,i.getSnapshot=t,iu(i)&&s({inst:i})},[e,n,t]),sN(function(){return iu(i)&&s({inst:i}),e(function(){iu(i)&&s({inst:i})})},[e]),lN(n),n}function iu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rN(e,n)}catch{return!0}}function uN(e,t){return t()}var cN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uN:aN;$y.useSyncExternalStore=Mi.useSyncExternalStore!==void 0?Mi.useSyncExternalStore:cN;Ry.exports=$y;var dN=Ry.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 da=R,fN=dN;function hN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pN=typeof Object.is=="function"?Object.is:hN,mN=fN.useSyncExternalStore,gN=da.useRef,yN=da.useEffect,vN=da.useMemo,xN=da.useDebugValue;Ty.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=gN(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=vN(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 d=y}return d=h}if(y=d,pN(f,h))return y;var v=r(h);return i!==void 0&&i(y,v)?(f=h,y):(f=h,d=v)}var u=!1,f,d,c=n===void 0?null:n;return[function(){return a(t())},c===null?void 0:function(){return a(c())}]},[t,n,r,i]);var l=mN(e,s[0],s[1]);return yN(function(){o.hasValue=!0,o.value=l},[l]),xN(l),l};Iy.exports=Ty;var wN=Iy.exports;const SN=Hp(wN),kN={},sp=e=>{let t;const n=new Set,r=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const h=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,h))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(kN?"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},EN=e=>e?sp(e):sp,{useDebugValue:_N}=Ix,{useSyncExternalStoreWithSelector:NN}=SN,CN=e=>e;function Oy(e,t=CN,n){const r=NN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _N(r),r}const op=(e,t)=>{const n=EN(e),r=(i,s=t)=>Oy(n,i,s);return Object.assign(r,n),r},bN=(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 fa=R.createContext(null),jN=fa.Provider,Dy=dn.error001();function le(e,t){const n=R.useContext(fa);if(n===null)throw new Error(Dy);return Oy(n,e,t)}function ge(){const e=R.useContext(fa);if(e===null)throw new Error(Dy);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const lp={display:"none"},MN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ay="react-flow__node-desc",Ly="react-flow__edge-desc",PN="react-flow__aria-live",zN=e=>e.ariaLiveMessage;function IN({rfId:e}){const t=le(zN);return p.jsx("div",{id:`${PN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:MN,children:t})}function TN({rfId:e,disableKeyboardA11y:t}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{id:`${Ay}-${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:`${Ly}-${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(IN,{rfId:e})]})}const RN=e=>e.userSelectionActive?"none":"all",Zd=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const o=le(RN),l=`${e}`.split("-");return p.jsx("div",{className:Ce(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},ref:s,...i,children:t})});function $N({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 ON=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 DN(e,t){return Ee(e.selectedNodes.map(To),t.selectedNodes.map(To))&&Ee(e.selectedEdges.map(To),t.selectedEdges.map(To))}function AN({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le(ON,DN);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 LN=e=>!!e.onSelectionChangeHandlers;function FN({onSelectionChange:e}){const t=le(LN);return e||t?p.jsx(AN,{onSelectionChange:e}):null}const Fy=[0,0],HN={x:0,y:0,zoom:1},BN=["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=[...BN,"rfId"],VN=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:Ds,nodeOrigin:Fy,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function UN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=le(VN,Ee),f=ge();R.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=up,l()}),[]);const d=R.useRef(up);return R.useEffect(()=>{for(const c of ap){const h=e[c],y=d.current[c];h!==y&&(typeof e[c]>"u"||(c==="nodes"?t(h):c==="edges"?n(h):c==="minZoom"?r(h):c==="maxZoom"?i(h):c==="translateExtent"?s(h):c==="nodeExtent"?o(h):c==="paneClickDistance"?u(h):c==="fitView"?f.setState({fitViewOnInit:h}):c==="fitViewOptions"?f.setState({fitViewOnInitOptions:h}):f.setState({[c]:h})))}d.current=e},ap.map(c=>e[c])),null}function cp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function QN(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 Hs(e=null,t={target:dp,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),s=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),f=u.reduce((d,c)=>d.concat(...c),[]);return[u,f]}return[[],[]]},[e]);return R.useEffect(()=>{const a=(t==null?void 0:t.target)||dp;if(e!==null){const u=c=>{if(i.current=c.ctrlKey||c.metaKey||c.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Mc(c))return!1;const y=hp(c.code,l);s.current.add(c[y]),fp(o,s.current,!1)&&(c.preventDefault(),r(!0))},f=c=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Mc(c))return!1;const y=hp(c.code,l);fp(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(c[y]),c.key==="Meta"&&s.current.clear(),i.current=!1},d=()=>{s.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function fp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function hp(e,t){return t.includes(e)?"code":"key"}const WN=()=>{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=Cc(n,t),{width:a,height:u}=ua(o);return bc({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 io(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=hy(t,n);return{x:o.x+i,y:o.y+s}}}),[])};function Hy(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 XN(e,t){return Hy(e,t)}function YN(e,t){return Hy(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=>d_(e),KN=e=>ly(e);function By(e){return R.forwardRef(e)}const GN=typeof window<"u"?R.useLayoutEffect:R.useEffect;function yp(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>ZN(()=>n(i=>i+BigInt(1))));return GN(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function ZN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Vy=R.createContext(null);function JN({children:e}){const t=ge(),n=R.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:f,onNodesChange:d,nodeLookup:c}=t.getState();let h=a;for(const y of l)h=typeof y=="function"?y(h):y;f?u(h):d&&d(pp({items:h,lookup:c}))},[]),r=yp(n),i=R.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:f,onEdgesChange:d,edgeLookup:c}=t.getState();let h=a;for(const y of l)h=typeof y=="function"?y(h):y;f?u(h):d&&d(pp({items:h,lookup:c}))},[]),s=yp(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return p.jsx(Vy.Provider,{value:o,children:e})}function eC(){const e=R.useContext(Vy);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const tC=e=>!!e.panZoom;function Jd(){const e=WN(),t=ge(),n=eC(),r=le(tC),i=R.useMemo(()=>{const s=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var m,x;const{nodeLookup:c,nodeOrigin:h}=t.getState(),y=gp(d)?d:c.get(d.id),v=y.parentId?my(y.position,y.measured,y.parentId,c,h):y.position,S={...y,position:v,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((x=y.measured)==null?void 0:x.height)??y.height};return bi(S)},u=(d,c,h={replace:!1})=>{o(y=>y.map(v=>{if(v.id===d){const S=typeof c=="function"?c(v):c;return h.replace&&gp(S)?S:{...v,...S}}return v}))},f=(d,c,h={replace:!1})=>{l(y=>y.map(v=>{if(v.id===d){const S=typeof c=="function"?c(v):c;return h.replace&&KN(S)?S:{...v,...S}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var c;return(c=s(d))==null?void 0:c.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(c=>({...c}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const c=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...c])},addEdges:d=>{const c=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...c])},toObject:()=>{const{nodes:d=[],edges:c=[],transform:h}=t.getState(),[y,v,S]=h;return{nodes:d.map(m=>({...m})),edges:c.map(m=>({...m})),viewport:{x:y,y:v,zoom:S}}},deleteElements:async({nodes:d=[],edges:c=[]})=>{const{nodes:h,edges:y,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:m,triggerEdgeChanges:x,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:_,edges:M}=await p_({nodesToRemove:d,edgesToRemove:c,nodes:h,edges:y,onBeforeDelete:w}),N=M.length>0,b=_.length>0;if(N){const I=M.map(mp);S==null||S(M),x(I)}if(b){const I=_.map(mp);v==null||v(_),m(I)}return(b||N)&&(g==null||g({nodes:_,edges:M})),{deletedNodes:_,deletedEdges:M}},getIntersectingNodes:(d,c=!0,h)=>{const y=Yh(d),v=y?d:a(d),S=h!==void 0;return v?(h||t.getState().nodes).filter(m=>{const x=t.getState().nodeLookup.get(m.id);if(x&&!y&&(m.id===d.id||!x.internals.positionAbsolute))return!1;const g=bi(S?m:x),w=Ls(g,v);return c&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(d,c,h=!0)=>{const v=Yh(d)?d:a(d);if(!v)return!1;const S=Ls(v,c);return h&&S>0||S>=v.width*v.height},updateNode:u,updateNodeData:(d,c,h={replace:!1})=>{u(d,y=>{const v=typeof c=="function"?c(y):c;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},updateEdge:f,updateEdgeData:(d,c,h={replace:!1})=>{f(d,y=>{const v=typeof c=="function"?c(y):c;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},getNodesBounds:d=>{const{nodeLookup:c,nodeOrigin:h}=t.getState();return f_(d,{nodeLookup:c,nodeOrigin:h})},getHandleConnections:({type:d,id:c,nodeId:h})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${h}-${d}-${c??null}`))==null?void 0:y.values())??[])}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const vp=e=>e.selected,nC={actInsideInputWithModifier:!1},rC=typeof window<"u"?window:void 0;function iC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=Jd(),i=Hs(e,nC),s=Hs(t,{target:rC});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 sC(e){const t=ge();R.useEffect(()=>{const n=()=>{var i,s;if(!e.current)return!1;const r=ua(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 ha={position:"absolute",width:"100%",height:"100%",top:0,left:0},oC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function lC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=gr.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:f,maxZoom:d,zoomActivationKeyCode:c,preventScrolling:h=!0,children:y,noWheelClassName:v,noPanClassName:S,onViewportChange:m,isControlledViewport:x,paneClickDistance:g}){const w=ge(),_=R.useRef(null),{userSelectionActive:M,lib:N}=le(oC,Ee),b=Hs(c),I=R.useRef();sC(_);const z=R.useCallback(D=>{m==null||m({x:D[0],y:D[1],zoom:D[2]}),x||w.setState({transform:D})},[m,x]);return R.useEffect(()=>{if(_.current){I.current=X_({domNode:_.current,minZoom:f,maxZoom:d,translateExtent:u,viewport:a,paneClickDistance:g,onDraggingChange:E=>w.setState({paneDragging:E}),onPanZoomStart:(E,$)=>{const{onViewportChangeStart:P,onMoveStart:O}=w.getState();O==null||O(E,$),P==null||P($)},onPanZoom:(E,$)=>{const{onViewportChange:P,onMove:O}=w.getState();O==null||O(E,$),P==null||P($)},onPanZoomEnd:(E,$)=>{const{onViewportChangeEnd:P,onMoveEnd:O}=w.getState();O==null||O(E,$),P==null||P($)}});const{x:D,y:F,zoom:L}=I.current.getViewport();return w.setState({panZoom:I.current,transform:[D,F,L],domNode:_.current.closest(".react-flow")}),()=>{var E;(E=I.current)==null||E.destroy()}}},[]),R.useEffect(()=>{var D;(D=I.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:b,preventScrolling:h,noPanClassName:S,userSelectionActive:M,noWheelClassName:v,lib:N,onTransformChange:z})},[e,t,n,r,i,s,o,l,b,h,S,M,v,N,z]),p.jsx("div",{className:"react-flow__renderer",ref:_,style:ha,children:y})}const aC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function uC(){const{userSelectionActive:e,userSelectionRect:t}=le(aC,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 su=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},cC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function dC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=As.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:f,onPaneMouseMove:d,onPaneMouseLeave:c,children:h}){const y=R.useRef(null),v=ge(),S=R.useRef(0),m=R.useRef(0),x=R.useRef(),g=R.useRef(new Map),{userSelectionActive:w,elementsSelectable:_,dragging:M}=le(cC,Ee),N=_&&(e||w),b=R.useRef(!1),I=R.useRef(!1),z=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,m.current=0},D=k=>{if(b.current){b.current=!1;return}l==null||l(k),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},F=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}a==null||a(k)},L=u?k=>u(k):void 0,E=k=>{var U,W,X,Z;const{resetSelectedElements:j,domNode:T,edgeLookup:A}=v.getState();if(x.current=T==null?void 0:T.getBoundingClientRect(),!_||!e||k.button!==0||k.target!==y.current||!x.current)return;(W=(U=k.target)==null?void 0:U.setPointerCapture)==null||W.call(U,k.pointerId),I.current=!0,b.current=!1,g.current=new Map;for(const[Q,te]of A)g.current.set(te.source,((X=g.current.get(te.source))==null?void 0:X.add(Q))||new Set([Q])),g.current.set(te.target,((Z=g.current.get(te.target))==null?void 0:Z.add(Q))||new Set([Q]));const{x:H,y:Y}=tn(k.nativeEvent,x.current);j(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:Y,x:H,y:Y}}),s==null||s(k)},$=k=>{const{userSelectionRect:j,edgeLookup:T,transform:A,nodeLookup:H,triggerNodeChanges:Y,triggerEdgeChanges:U}=v.getState();if(!x.current||!j)return;b.current=!0;const{x:W,y:X}=tn(k.nativeEvent,x.current),{startX:Z,startY:Q}=j,te={startX:Z,startY:Q,x:W<Z?W:Z,y:X<Q?X:Q,width:Math.abs(W-Z),height:Math.abs(X-Q)},se=ay(H,te,A,n===As.Partial,!0),ne=new Set,J=new Set;for(const ae of se){J.add(ae.id);const fe=g.current.get(ae.id);if(fe)for(const $e of fe)ne.add($e)}if(S.current!==J.size){S.current=J.size;const ae=Vr(H,J,!0);Y(ae)}if(m.current!==ne.size){m.current=ne.size;const ae=Vr(T,ne);U(ae)}v.setState({userSelectionRect:te,userSelectionActive:!0,nodesSelectionActive:!1})},P=k=>{var T,A;if(k.button!==0||!I.current)return;(A=(T=k.target)==null?void 0:T.releasePointerCapture)==null||A.call(T,k.pointerId);const{userSelectionRect:j}=v.getState();!w&&j&&k.target===y.current&&(D==null||D(k)),S.current>0&&v.setState({nodesSelectionActive:!0}),z(),o==null||o(k),(t||i)&&(b.current=!1),I.current=!1},O=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:Ce(["react-flow__pane",{draggable:O,dragging:M,selection:e}]),onClick:N?void 0:su(D,y),onContextMenu:su(F,y),onWheel:su(L,y),onPointerEnter:N?void 0:f,onPointerDown:N?E:d,onPointerMove:N?$:d,onPointerUp:N?P:void 0,onPointerLeave:c,ref:y,style:ha,children:[h,p.jsx(uC,{})]})}function Rc({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 Uy({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=R_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Rc({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{var d,c;if(t)(d=f.current)==null||d.destroy();else if(e.current)return(c=f.current)==null||c.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=f.current)==null||h.destroy()}},[n,r,t,s,e,i]),a}const fC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Qy(){const e=ge();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:f}=e.getState(),d=new Map,c=fC(o),h=i?s[0]:5,y=i?s[1]:5,v=n.direction.x*h*n.factor,S=n.direction.y*y*n.factor;for(const[,m]of u){if(!c(m))continue;let x={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+S};i&&(x=aa(x,s));const{position:g,positionAbsolute:w}=uy({nodeId:m.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:f,onError:l});m.position=g,m.internals.positionAbsolute=w,d.set(m.id,m)}a(d)},[])}const ef=R.createContext(null),hC=ef.Provider;ef.Consumer;const Wy=()=>R.useContext(ef),pC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),mC=(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 gC({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:a,className:u,onMouseDown:f,onTouchStart:d,...c},h){var E,$;const y=o||null,v=e==="target",S=ge(),m=Wy(),{connectOnClick:x,noPanClassName:g,rfId:w}=le(pC,Ee),{connectingFrom:_,connectingTo:M,clickConnecting:N,isPossibleEndHandle:b,connectionInProcess:I,valid:z}=le(mC(m,y,e),Ee);m||($=(E=S.getState()).onError)==null||$.call(E,"010",dn.error010());const D=P=>{const{defaultEdgeOptions:O,onConnect:k,hasDefaultEdges:j}=S.getState(),T={...O,...P};if(j){const{edges:A,setEdges:H}=S.getState();H(S_(T,A))}k==null||k(T),l==null||l(T)},F=P=>{if(!m)return;const O=yy(P.nativeEvent);if(i&&(O&&P.button===0||!O)){const k=S.getState();Tc.onPointerDown(P.nativeEvent,{autoPanOnConnect:k.autoPanOnConnect,connectionMode:k.connectionMode,connectionRadius:k.connectionRadius,domNode:k.domNode,nodeLookup:k.nodeLookup,lib:k.lib,isTarget:v,handleId:y,nodeId:m,flowId:k.rfId,panBy:k.panBy,cancelConnection:k.cancelConnection,onConnectStart:k.onConnectStart,onConnectEnd:k.onConnectEnd,updateConnection:k.updateConnection,onConnect:D,isValidConnection:n||k.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:k.autoPanSpeed})}O?f==null||f(P):d==null||d(P)},L=P=>{const{onClickConnectStart:O,onClickConnectEnd:k,connectionClickStartHandle:j,connectionMode:T,isValidConnection:A,lib:H,rfId:Y,nodeLookup:U,connection:W}=S.getState();if(!m||!j&&!i)return;if(!j){O==null||O(P.nativeEvent,{nodeId:m,handleId:y,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const X=gy(P.target),Z=n||A,{connection:Q,isValid:te}=Tc.isValid(P.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:T,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:Z,flowId:Y,doc:X,lib:H,nodeLookup:U});te&&Q&&D(Q);const se=structuredClone(W);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,k==null||k(P,se),S.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:!v,target:v,connectable:r,connectablestart:i,connectableend:s,clickconnecting:N,connectingfrom:_,connectingto:M,valid:z,connectionindicator:r&&(!I||b)&&(I?s:i)}]),onMouseDown:F,onTouchStart:F,onClick:x?L:void 0,ref:h,...c,children:a})}const Xn=R.memo(By(gC));function yC({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 vC({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 xC(){return null}function wC({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 Al={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xp={input:yC,default:vC,output:wC,group:xC};function SC(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 kC=e=>{const{width:t,height:n,x:r,y:i}=ro(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 EC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:s,transformString:o,userSelectionActive:l}=le(kC,Ee),a=Qy(),u=R.useRef(null);if(R.useEffect(()=>{var c;n||(c=u.current)==null||c.focus({preventScroll:!0})},[n]),Uy({nodeRef:u}),l||!i||!s)return null;const f=e?c=>{const h=r.getState().nodes.filter(y=>y.selected);e(c,h)}:void 0,d=c=>{Object.prototype.hasOwnProperty.call(Al,c.key)&&(c.preventDefault(),a({direction:Al[c.key],factor:c.shiftKey?4:1}))};return p.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:p.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:s}})})}const wp=typeof window<"u"?window:void 0,_C=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:d,onSelectionStart:c,onSelectionEnd:h,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:m,zoomOnScroll:x,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:_,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:b,defaultViewport:I,translateExtent:z,minZoom:D,maxZoom:F,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:P,disableKeyboardA11y:O,onViewportChange:k,isControlledViewport:j}){const{nodesSelectionActive:T,userSelectionActive:A}=le(_C),H=Hs(u,{target:wp}),Y=Hs(v,{target:wp}),U=Y||b,W=Y||w,X=f&&U!==!0,Z=H||A||X;return iC({deleteKeyCode:a,multiSelectionKeyCode:y}),p.jsx(lC,{onPaneContextMenu:s,elementsSelectable:m,zoomOnScroll:x,zoomOnPinch:g,panOnScroll:W,panOnScrollSpeed:_,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:!H&&U,defaultViewport:I,translateExtent:z,minZoom:D,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:L,noWheelClassName:$,noPanClassName:P,onViewportChange:k,isControlledViewport:j,paneClickDistance:l,children:p.jsxs(dC,{onSelectionStart:c,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:U,isSelecting:!!Z,selectionMode:d,selectionKeyPressed:H,selectionOnDrag:X,children:[e,T&&p.jsx(EC,{onSelectionContextMenu:E,noPanClassName:P,disableKeyboardA11y:O})]})})}qy.displayName="FlowRenderer";const NC=R.memo(qy),CC=e=>t=>e?ay(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 bC(e){return le(R.useCallback(CC(e),[e]),Ee)}const jC=e=>e.updateNodeInternals;function MC(){const e=le(jC),[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 PC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ge(),s=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),a=R.useRef(e.targetPosition),u=R.useRef(t),f=n&&!!e.internals.handleBounds;return R.useEffect(()=>{s.current&&!e.hidden&&(!f||o.current!==s.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(s.current),o.current=s.current)},[f,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(s.current){const d=u.current!==t,c=l.current!==e.sourcePosition,h=a.current!==e.targetPosition;(d||c||h)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function zC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:f,resizeObserver:d,noDragClassName:c,noPanClassName:h,disableKeyboardA11y:y,rfId:v,nodeTypes:S,nodeExtent:m,nodeClickDistance:x,onError:g}){const{node:w,internals:_,isParent:M}=le(Q=>{const te=Q.nodeLookup.get(e),se=Q.parentLookup.has(e);return{node:te,internals:te.internals,isParent:se}},Ee);let N=w.type||"default",b=(S==null?void 0:S[N])||xp[N];b===void 0&&(g==null||g("003",dn.error003(N)),N="default",b=xp.default);const I=!!(w.draggable||l&&typeof w.draggable>"u"),z=!!(w.selectable||a&&typeof w.selectable>"u"),D=!!(w.connectable||u&&typeof w.connectable>"u"),F=!!(w.focusable||f&&typeof w.focusable>"u"),L=ge(),E=py(w),$=PC({node:w,nodeType:N,hasDimensions:E,resizeObserver:d}),P=Uy({nodeRef:$,disabled:w.hidden||!I,noDragClassName:c,handleSelector:w.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:x}),O=Qy();if(w.hidden)return null;const k=fn(w),j=SC(w),T=z||I||t||n||r||i,A=n?Q=>n(Q,{..._.userNode}):void 0,H=r?Q=>r(Q,{..._.userNode}):void 0,Y=i?Q=>i(Q,{..._.userNode}):void 0,U=s?Q=>s(Q,{..._.userNode}):void 0,W=o?Q=>o(Q,{..._.userNode}):void 0,X=Q=>{const{selectNodesOnDrag:te,nodeDragThreshold:se}=L.getState();z&&(!te||!I||se>0)&&Rc({id:e,store:L,nodeRef:$}),t&&t(Q,{..._.userNode})},Z=Q=>{if(!(Mc(Q.nativeEvent)||y))if(iy.includes(Q.key)&&z){const te=Q.key==="Escape";Rc({id:e,store:L,unselect:te,nodeRef:$})}else I&&w.selected&&Object.prototype.hasOwnProperty.call(Al,Q.key)&&(Q.preventDefault(),L.setState({ariaLiveMessage:`Moved selected node ${Q.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~_.positionAbsolute.x}, y: ${~~_.positionAbsolute.y}`}),O({direction:Al[Q.key],factor:Q.shiftKey?4:1}))};return p.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${N}`,{[h]:I},w.className,{selected:w.selected,selectable:z,parent:M,draggable:I,dragging:P}]),ref:$,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:E?"visible":"hidden",...w.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:H,onMouseLeave:Y,onContextMenu:U,onClick:X,onDoubleClick:W,onKeyDown:F?Z:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":y?void 0:`${Ay}-${v}`,"aria-label":w.ariaLabel,children:p.jsx(hC,{value:e,children:p.jsx(b,{id:e,data:w.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:w.selected,selectable:z,draggable:I,deletable:w.deletable??!0,isConnectable:D,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:P,dragHandle:w.dragHandle,zIndex:_.z,parentId:w.parentId,...k})})})}const IC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Xy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=le(IC,Ee),o=bC(e.onlyRenderVisibleElements),l=MC();return p.jsx("div",{className:"react-flow__nodes",style:ha,children:o.map(a=>p.jsx(zC,{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))})}Xy.displayName="NodeRenderer";const TC=R.memo(Xy);function RC(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&&v_({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const $C=({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"}),OC=({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={[$l.Arrow]:$C,[$l.ArrowClosed]:OC};function DC(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 AC=({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=DC(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},Yy=({defaultColor:e,rfId:t})=>{const n=le(s=>s.edges),r=le(s=>s.defaultEdgeOptions),i=R.useMemo(()=>C_(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(AC,{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};Yy.displayName="MarkerDefinitions";var LC=R.memo(Yy);function Ky({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:s={},labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...f}){const[d,c]=R.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",u]),y=R.useRef(null);return R.useEffect(()=>{if(y.current){const v=y.current.getBBox();c({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:p.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...f,children:[i&&p.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),p.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]})}Ky.displayName="EdgeText";const FC=R.memo(Ky);function pa({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(FC,{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 Gy({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:i,targetPosition:s=G.Top}){const[o,l]=kp({pos:n,x1:e,y1:t,x2:r,y2:i}),[a,u]=kp({pos:s,x1:r,y1:i,x2:e,y2:t}),[f,d,c,h]=vy({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${o},${l} ${a},${u} ${r},${i}`,f,d,c,h]}function Zy(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=G.Bottom,targetPosition:l=G.Top,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:m})=>{const[x,g,w]=Gy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l}),_=e.isInternal?void 0:t;return p.jsx(pa,{id:_,path:x,labelX:g,labelY:w,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:m})})}const HC=Zy({isInternal:!1}),Jy=Zy({isInternal:!0});HC.displayName="SimpleBezierEdge";Jy.displayName="SimpleBezierEdgeInternal";function ev(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,sourcePosition:h=G.Bottom,targetPosition:y=G.Top,markerEnd:v,markerStart:S,pathOptions:m,interactionWidth:x})=>{const[g,w,_]=Pc({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}),M=e.isInternal?void 0:t;return p.jsx(pa,{id:M,path:g,labelX:w,labelY:_,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:v,markerStart:S,interactionWidth:x})})}const tv=ev({isInternal:!1}),nv=ev({isInternal:!0});tv.displayName="SmoothStepEdge";nv.displayName="SmoothStepEdgeInternal";function rv(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return p.jsx(tv,{...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 BC=rv({isInternal:!1}),iv=rv({isInternal:!0});BC.displayName="StepEdge";iv.displayName="StepEdgeInternal";function sv(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:y,interactionWidth:v})=>{const[S,m,x]=Sy({sourceX:n,sourceY:r,targetX:i,targetY:s}),g=e.isInternal?void 0:t;return p.jsx(pa,{id:g,path:S,labelX:m,labelY:x,label:o,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:y,interactionWidth:v})})}const VC=sv({isInternal:!1}),ov=sv({isInternal:!0});VC.displayName="StraightEdge";ov.displayName="StraightEdgeInternal";function lv(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=G.Bottom,targetPosition:l=G.Top,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,pathOptions:m,interactionWidth:x})=>{const[g,w,_]=xy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l,curvature:m==null?void 0:m.curvature}),M=e.isInternal?void 0:t;return p.jsx(pa,{id:M,path:g,labelX:w,labelY:_,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:x})})}const UC=lv({isInternal:!1}),av=lv({isInternal:!0});UC.displayName="BezierEdge";av.displayName="BezierEdgeInternal";const Ep={default:av,straight:ov,step:iv,smoothstep:nv,simplebezier:Jy},_p={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},QC=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,WC=(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:QC(t,r,e),cy:WC(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:d,setReconnecting:c,setUpdateHover:h}){const y=ge(),v=(w,_)=>{if(w.button!==0)return;const{autoPanOnConnect:M,domNode:N,isValidConnection:b,connectionMode:I,connectionRadius:z,lib:D,onConnectStart:F,onConnectEnd:L,cancelConnection:E,nodeLookup:$,rfId:P,panBy:O,updateConnection:k}=y.getState(),j=_.type==="target";c(!0),f==null||f(w,n,_.type);const T=(H,Y)=>{c(!1),d==null||d(H,n,_.type,Y)},A=H=>u==null?void 0:u(n,H);Tc.onPointerDown(w.nativeEvent,{autoPanOnConnect:M,connectionMode:I,connectionRadius:z,domNode:N,handleId:_.id,nodeId:_.nodeId,nodeLookup:$,isTarget:j,edgeUpdaterType:_.type,lib:D,flowId:P,cancelConnection:E,panBy:O,isValidConnection:b,onConnect:A,onConnectStart:F,onConnectEnd:L,onReconnectEnd:T,updateConnection:k,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},S=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>h(!0),g=()=>h(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(Cp,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&p.jsx(Cp,{position:a,centerX:s,centerY:o,radius:t,onMouseDown:m,onMouseEnter:x,onMouseOut:g,type:"target"})]})}function XC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:f,onReconnect:d,onReconnectStart:c,onReconnectEnd:h,rfId:y,edgeTypes:v,noPanClassName:S,onError:m,disableKeyboardA11y:x}){let g=le(J=>J.edgeLookup.get(e));const w=le(J=>J.defaultEdgeOptions);g=w?{...w,...g}:g;let _=g.type||"default",M=(v==null?void 0:v[_])||Ep[_];M===void 0&&(m==null||m("011",dn.error011(_)),_="default",M=Ep.default);const N=!!(g.focusable||t&&typeof g.focusable>"u"),b=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),z=R.useRef(null),[D,F]=R.useState(!1),[L,E]=R.useState(!1),$=ge(),{zIndex:P,sourceX:O,sourceY:k,targetX:j,targetY:T,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=N_({id:e,sourceNode:ae,targetNode:fe,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:J.connectionMode,onError:m});return{zIndex:y_({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),Y=R.useMemo(()=>g.markerStart?`url('#${zc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),U=R.useMemo(()=>g.markerEnd?`url('#${zc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||O===null||k===null||j===null||T===null)return null;const W=J=>{var hn;const{addSelectedEdges:ae,unselectNodesAndEdges:fe,multiSelectionActive:$e}=$.getState();I&&($.setState({nodesSelectionActive:!1}),g.selected&&$e?(fe({nodes:[],edges:[g]}),(hn=z.current)==null||hn.blur()):ae([e])),i&&i(J,g)},X=s?J=>{s(J,{...g})}:void 0,Z=o?J=>{o(J,{...g})}:void 0,Q=l?J=>{l(J,{...g})}:void 0,te=a?J=>{a(J,{...g})}:void 0,se=u?J=>{u(J,{...g})}:void 0,ne=J=>{var ae;if(!x&&iy.includes(J.key)&&I){const{unselectNodesAndEdges:fe,addSelectedEdges:$e}=$.getState();J.key==="Escape"?((ae=z.current)==null||ae.blur(),fe({edges:[g]})):$e([e])}};return p.jsx("svg",{style:{zIndex:P},children:p.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${_}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!I&&!i,updating:D,selectable:I}]),onClick:W,onDoubleClick:X,onContextMenu:Z,onMouseEnter:Q,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?`${Ly}-${y}`:void 0,ref:z,children:[!L&&p.jsx(M,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:I,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:k,targetX:j,targetY:T,sourcePosition:A,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:Y,markerEnd:U,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),b&&p.jsx(qC,{edge:g,isReconnectable:b,reconnectRadius:f,onReconnect:d,onReconnectStart:c,onReconnectEnd:h,sourceX:O,sourceY:k,targetX:j,targetY:T,sourcePosition:A,targetPosition:H,setUpdateHover:F,setReconnecting:E})]})})}const YC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function uv({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:f,reconnectRadius:d,onEdgeDoubleClick:c,onReconnectStart:h,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:m,elementsSelectable:x,onError:g}=le(YC,Ee),w=RC(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(LC,{defaultColor:e,rfId:n}),w.map(_=>p.jsx(XC,{id:_,edgesFocusable:S,edgesReconnectable:m,elementsSelectable:x,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:f,reconnectRadius:d,onDoubleClick:c,onReconnectStart:h,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:v},_))]})}uv.displayName="EdgeRenderer";const KC=R.memo(uv),GC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ZC({children:e}){const t=le(GC);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function JC(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 e3=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function t3(e){const t=le(e3),n=ge();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function n3(e){return e.connection.inProgress?{...e.connection,to:io(e.connection.to,e.transform)}:{...e.connection}}function r3(e){return n3}function i3(e){const t=r3();return le(t,Ee)}const s3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function o3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:l,inProgress:a}=le(s3,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",oy(l)]),children:p.jsx(cv,{style:t,type:n,CustomComponent:r,isValid:l})})})}const cv=({style:e,type:t=Nn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:o,fromHandle:l,fromPosition:a,to:u,toNode:f,toHandle:d,toPosition:c}=i3();if(!i)return;if(n)return p.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:c,connectionStatus:oy(r),toNode:f,toHandle:d});let h="";const y={sourceX:s.x,sourceY:s.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:c};switch(t){case Nn.Bezier:[h]=xy(y);break;case Nn.SimpleBezier:[h]=Gy(y);break;case Nn.Step:[h]=Pc({...y,borderRadius:0});break;case Nn.SmoothStep:[h]=Pc(y);break;default:[h]=Sy(y)}return p.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};cv.displayName="ConnectionLine";const l3={};function bp(e=l3){R.useRef(e),ge(),R.useEffect(()=>{},[e])}function a3(){ge(),R.useRef(!1),R.useEffect(()=>{},[])}function dv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,onSelectionContextMenu:d,onSelectionStart:c,onSelectionEnd:h,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:m,selectionKeyCode:x,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:N,deleteKeyCode:b,onlyRenderVisibleElements:I,elementsSelectable:z,defaultViewport:D,translateExtent:F,minZoom:L,maxZoom:E,preventScrolling:$,defaultMarkerColor:P,zoomOnScroll:O,zoomOnPinch:k,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:Y,onPaneClick:U,onPaneMouseEnter:W,onPaneMouseMove:X,onPaneMouseLeave:Z,onPaneScroll:Q,onPaneContextMenu:te,paneClickDistance:se,nodeClickDistance:ne,onEdgeContextMenu:J,onEdgeMouseEnter:ae,onEdgeMouseMove:fe,onEdgeMouseLeave:$e,reconnectRadius:hn,onReconnect:ma,onReconnectStart:ga,onReconnectEnd:ya,noDragClassName:Ti,noWheelClassName:va,noPanClassName:Ri,disableKeyboardA11y:$i,nodeExtent:xa,rfId:Oi,viewport:Di,onViewportChange:so}){return bp(e),bp(t),a3(),JC(n),t3(Di),p.jsx(NC,{onPaneClick:U,onPaneMouseEnter:W,onPaneMouseMove:X,onPaneMouseLeave:Z,onPaneContextMenu:te,onPaneScroll:Q,paneClickDistance:se,deleteKeyCode:b,selectionKeyCode:x,selectionOnDrag:g,selectionMode:w,onSelectionStart:c,onSelectionEnd:h,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:N,elementsSelectable:z,zoomOnScroll:O,zoomOnPinch:k,zoomOnDoubleClick:H,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:A,panOnDrag:Y,defaultViewport:D,translateExtent:F,minZoom:L,maxZoom:E,onSelectionContextMenu:d,preventScrolling:$,noDragClassName:Ti,noWheelClassName:va,noPanClassName:Ri,disableKeyboardA11y:$i,onViewportChange:so,isControlledViewport:!!Di,children:p.jsxs(ZC,{children:[p.jsx(KC,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ma,onReconnectStart:ga,onReconnectEnd:ya,onlyRenderVisibleElements:I,onEdgeContextMenu:J,onEdgeMouseEnter:ae,onEdgeMouseMove:fe,onEdgeMouseLeave:$e,reconnectRadius:hn,defaultMarkerColor:P,noPanClassName:Ri,disableKeyboardA11y:$i,rfId:Oi}),p.jsx(o3,{style:v,type:y,component:S,containerStyle:m}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(TC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:f,nodeClickDistance:ne,onlyRenderVisibleElements:I,noPanClassName:Ri,noDragClassName:Ti,disableKeyboardA11y:$i,nodeExtent:xa,rfId:Oi}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}dv.displayName="GraphView";const u3=R.memo(dv),jp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a}={})=>{const u=new Map,f=new Map,d=new Map,c=new Map,h=r??t??[],y=n??e??[],v=l??[0,0],S=a??Ds;Ey(d,c,h),Ic(y,u,f,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:!1});let m=[0,0,1];if(o&&i&&s){const x=ro(u,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:g,y:w,zoom:_}=qd(x,i,s,.5,2,.1);m=[g,w,_]}return{rfId:"1",width:0,height:0,transform:m,nodes:y,nodeLookup:u,parentLookup:f,edges:h,edgeLookup:c,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Ds,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ni.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...sy},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:m_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},c3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a})=>bN((u,f)=>({...jp({nodes:e,edges:t,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:c,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:v}=f();Ic(d,c,h,{nodeOrigin:y,nodeExtent:a,elevateNodesOnSelect:v,checkEquality:!0}),u({nodes:d})},setEdges:d=>{const{connectionLookup:c,edgeLookup:h}=f();Ey(c,h,d),u({edges:d})},setDefaultNodesAndEdges:(d,c)=>{if(d){const{setNodes:h}=f();h(d),u({hasDefaultNodes:!0})}if(c){const{setEdges:h}=f();h(c),u({hasDefaultEdges:!0})}},updateNodeInternals:(d,c={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:y,parentLookup:v,fitViewOnInit:S,fitViewDone:m,fitViewOnInitOptions:x,domNode:g,nodeOrigin:w,nodeExtent:_,debug:M,fitViewSync:N}=f(),{changes:b,updatedInternals:I}=z_(d,y,v,g,w,_);if(I){if(j_(y,v,{nodeOrigin:w,nodeExtent:_}),c.triggerFitView){let z=m;!m&&S&&(z=N({...x,nodes:x==null?void 0:x.nodes})),u({fitViewDone:z})}else u({});(b==null?void 0:b.length)>0&&(M&&console.log("React Flow: trigger node changes",b),h==null||h(b))}},updateNodePositions:(d,c=!1)=>{const h=[],y=[];for(const[v,S]of d){const m=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(S!=null&&S.position)),x={id:v,type:"position",position:m?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:c};m&&h.push({id:v,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),y.push(x)}if(h.length>0){const{nodeLookup:v,parentLookup:S,nodeOrigin:m}=f(),x=Gd(h,v,S,m);y.push(...x)}f().triggerNodeChanges(y)},triggerNodeChanges:d=>{const{onNodesChange:c,setNodes:h,nodes:y,hasDefaultNodes:v,debug:S}=f();if(d!=null&&d.length){if(v){const m=XN(d,y);h(m)}S&&console.log("React Flow: trigger node changes",d),c==null||c(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:c,setEdges:h,edges:y,hasDefaultEdges:v,debug:S}=f();if(d!=null&&d.length){if(v){const m=YN(d,y);h(m)}S&&console.log("React Flow: trigger edge changes",d),c==null||c(d)}},addSelectedNodes:d=>{const{multiSelectionActive:c,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=f();if(c){const m=d.map(x=>er(x,!0));v(m);return}v(Vr(y,new Set([...d]),!0)),S(Vr(h))},addSelectedEdges:d=>{const{multiSelectionActive:c,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=f();if(c){const m=d.map(x=>er(x,!0));S(m);return}S(Vr(h,new Set([...d]))),v(Vr(y,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:c}={})=>{const{edges:h,nodes:y,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:m}=f(),x=d||y,g=c||h,w=x.map(M=>{const N=v.get(M.id);return N&&(N.selected=!1),er(M.id,!1)}),_=g.map(M=>er(M.id,!1));S(w),m(_)},setMinZoom:d=>{const{panZoom:c,maxZoom:h}=f();c==null||c.setScaleExtent([d,h]),u({minZoom:d})},setMaxZoom:d=>{const{panZoom:c,minZoom:h}=f();c==null||c.setScaleExtent([h,d]),u({maxZoom:d})},setTranslateExtent:d=>{var c;(c=f().panZoom)==null||c.setTranslateExtent(d),u({translateExtent:d})},setPaneClickDistance:d=>{var c;(c=f().panZoom)==null||c.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:c,triggerNodeChanges:h,triggerEdgeChanges:y}=f(),v=c.reduce((m,x)=>x.selected?[...m,er(x.id,!1)]:m,[]),S=d.reduce((m,x)=>x.selected?[...m,er(x.id,!1)]:m,[]);h(v),y(S)},setNodeExtent:d=>{const{nodes:c,nodeLookup:h,parentLookup:y,nodeOrigin:v,elevateNodesOnSelect:S,nodeExtent:m}=f();d[0][0]===m[0][0]&&d[0][1]===m[0][1]&&d[1][0]===m[1][0]&&d[1][1]===m[1][1]||(Ic(c,h,y,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!1}),u({nodeExtent:d}))},panBy:d=>{const{transform:c,width:h,height:y,panZoom:v,translateExtent:S}=f();return I_({delta:d,panZoom:v,transform:c,translateExtent:S,width:h,height:y})},fitView:d=>{const{panZoom:c,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:m}=f();if(!c)return Promise.resolve(!1);const x=Cc(m,d);return bc({nodes:x,width:h,height:y,panZoom:c,minZoom:v,maxZoom:S},d)},fitViewSync:d=>{const{panZoom:c,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:m}=f();if(!c)return!1;const x=Cc(m,d);return bc({nodes:x,width:h,height:y,panZoom:c,minZoom:v,maxZoom:S},d),x.size>0},cancelConnection:()=>{u({connection:{...sy}})},updateConnection:d=>{u({connection:d})},reset:()=>u({...jp()})}),Object.is);function d3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:o,nodeOrigin:l,nodeExtent:a,children:u}){const[f]=R.useState(()=>c3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:a}));return p.jsx(jN,{value:f,children:p.jsx(JN,{children:u})})}function f3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:o,fitView:l,nodeOrigin:a,nodeExtent:u}){return R.useContext(fa)?p.jsx(p.Fragment,{children:e}):p.jsx(d3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:l,nodeOrigin:a,nodeExtent:u,children:e})}const h3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function p3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:f,onMoveStart:d,onMoveEnd:c,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:m,onNodeMouseEnter:x,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:M,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:I,onNodesDelete:z,onEdgesDelete:D,onDelete:F,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:P,onSelectionContextMenu:O,onSelectionStart:k,onSelectionEnd:j,onBeforeDelete:T,connectionMode:A,connectionLineType:H=Nn.Bezier,connectionLineStyle:Y,connectionLineComponent:U,connectionLineContainerStyle:W,deleteKeyCode:X="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:Q=!1,selectionMode:te=As.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ne=Dl()?"Meta":"Control",zoomActivationKeyCode:J=Dl()?"Meta":"Control",snapToGrid:ae,snapGrid:fe,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:hn,nodesDraggable:ma,nodesConnectable:ga,nodesFocusable:ya,nodeOrigin:Ti=Fy,edgesFocusable:va,edgesReconnectable:Ri,elementsSelectable:$i=!0,defaultViewport:xa=HN,minZoom:Oi=.5,maxZoom:Di=2,translateExtent:so=Ds,preventScrolling:yv=!0,nodeExtent:wa,defaultMarkerColor:vv="#b1b1b7",zoomOnScroll:xv=!0,zoomOnPinch:wv=!0,panOnScroll:Sv=!1,panOnScrollSpeed:kv=.5,panOnScrollMode:Ev=gr.Free,zoomOnDoubleClick:_v=!0,panOnDrag:Nv=!0,onPaneClick:Cv,onPaneMouseEnter:bv,onPaneMouseMove:jv,onPaneMouseLeave:Mv,onPaneScroll:Pv,onPaneContextMenu:zv,paneClickDistance:tf=0,nodeClickDistance:Iv=0,children:Tv,onReconnect:Rv,onReconnectStart:$v,onReconnectEnd:Ov,onEdgeContextMenu:Dv,onEdgeDoubleClick:Av,onEdgeMouseEnter:Lv,onEdgeMouseMove:Fv,onEdgeMouseLeave:Hv,reconnectRadius:Bv=10,onNodesChange:Vv,onEdgesChange:Uv,noDragClassName:Qv="nodrag",noWheelClassName:Wv="nowheel",noPanClassName:nf="nopan",fitView:rf,fitViewOptions:qv,connectOnClick:Xv,attributionPosition:Yv,proOptions:Kv,defaultEdgeOptions:Gv,elevateNodesOnSelect:Zv,elevateEdgesOnSelect:Jv,disableKeyboardA11y:sf=!1,autoPanOnConnect:ex,autoPanOnNodeDrag:tx,autoPanSpeed:nx,connectionRadius:rx,isValidConnection:ix,onError:sx,style:ox,id:of,nodeDragThreshold:lx,viewport:ax,onViewportChange:ux,width:cx,height:dx,colorMode:fx="light",debug:hx,...px},mx){const Sa=of||"1",gx=QN(fx);return p.jsx("div",{"data-testid":"rf__wrapper",...px,style:{...ox,...h3},ref:mx,className:Ce(["react-flow",i,gx]),id:of,children:p.jsxs(f3,{nodes:e,edges:t,width:cx,height:dx,fitView:rf,nodeOrigin:Ti,nodeExtent:wa,children:[p.jsx(u3,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:x,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:M,nodeTypes:s,edgeTypes:o,connectionLineType:H,connectionLineStyle:Y,connectionLineComponent:U,connectionLineContainerStyle:W,selectionKeyCode:Z,selectionOnDrag:Q,selectionMode:te,deleteKeyCode:X,multiSelectionKeyCode:ne,panActivationKeyCode:se,zoomActivationKeyCode:J,onlyRenderVisibleElements:$e,defaultViewport:xa,translateExtent:so,minZoom:Oi,maxZoom:Di,preventScrolling:yv,zoomOnScroll:xv,zoomOnPinch:wv,zoomOnDoubleClick:_v,panOnScroll:Sv,panOnScrollSpeed:kv,panOnScrollMode:Ev,panOnDrag:Nv,onPaneClick:Cv,onPaneMouseEnter:bv,onPaneMouseMove:jv,onPaneMouseLeave:Mv,onPaneScroll:Pv,onPaneContextMenu:zv,paneClickDistance:tf,nodeClickDistance:Iv,onSelectionContextMenu:O,onSelectionStart:k,onSelectionEnd:j,onReconnect:Rv,onReconnectStart:$v,onReconnectEnd:Ov,onEdgeContextMenu:Dv,onEdgeDoubleClick:Av,onEdgeMouseEnter:Lv,onEdgeMouseMove:Fv,onEdgeMouseLeave:Hv,reconnectRadius:Bv,defaultMarkerColor:vv,noDragClassName:Qv,noWheelClassName:Wv,noPanClassName:nf,rfId:Sa,disableKeyboardA11y:sf,nodeExtent:wa,viewport:ax,onViewportChange:ux}),p.jsx(UN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:m,nodesDraggable:ma,nodesConnectable:ga,nodesFocusable:ya,edgesFocusable:va,edgesReconnectable:Ri,elementsSelectable:$i,elevateNodesOnSelect:Zv,elevateEdgesOnSelect:Jv,minZoom:Oi,maxZoom:Di,nodeExtent:wa,onNodesChange:Vv,onEdgesChange:Uv,snapToGrid:ae,snapGrid:fe,connectionMode:A,translateExtent:so,connectOnClick:Xv,defaultEdgeOptions:Gv,fitView:rf,fitViewOptions:qv,onNodesDelete:z,onEdgesDelete:D,onDelete:F,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:I,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:P,onMove:f,onMoveStart:d,onMoveEnd:c,noPanClassName:nf,nodeOrigin:Ti,rfId:Sa,autoPanOnConnect:ex,autoPanOnNodeDrag:tx,autoPanSpeed:nx,onError:sx,connectionRadius:rx,isValidConnection:ix,selectNodesOnDrag:hn,nodeDragThreshold:lx,onBeforeDelete:T,paneClickDistance:tf,debug:hx}),p.jsx(FN,{onSelectionChange:L}),Tv,p.jsx($N,{proOptions:Kv,position:Yv}),p.jsx(TN,{rfId:Sa,disableKeyboardA11y:sf})]})})}var m3=By(p3);function g3({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 y3({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 v3={[nn.Dots]:1,[nn.Lines]:1,[nn.Cross]:6},x3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function fv({id:e,variant:t=nn.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:o,bgColor:l,style:a,className:u,patternClassName:f}){const d=R.useRef(null),{transform:c,patternId:h}=le(x3,Ee),y=r||v3[t],v=t===nn.Dots,S=t===nn.Cross,m=Array.isArray(n)?n:[n,n],x=[m[0]*c[2]||1,m[1]*c[2]||1],g=y*c[2],w=Array.isArray(s)?s:[s,s],_=S?[g,g]:x,M=[w[0]*c[2]||1+_[0]/2,w[1]*c[2]||1+_[1]/2],N=`${h}${e||""}`;return p.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...ha,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[p.jsx("pattern",{id:N,x:c[0]%x[0],y:c[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:v?p.jsx(y3,{radius:g/2,className:f}):p.jsx(g3,{dimensions:_,lineWidth:i,variant:t,className:f})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}fv.displayName="Background";const w3=R.memo(fv);function S3(){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 k3(){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 E3(){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 _3(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 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 N3(){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 Ro({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const C3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function hv({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:a,className:u,children:f,position:d="bottom-left",orientation:c="vertical","aria-label":h="React Flow controls"}){const y=ge(),{isInteractive:v,minZoomReached:S,maxZoomReached:m}=le(C3,Ee),{zoomIn:x,zoomOut:g,fitView:w}=Jd(),_=()=>{x(),s==null||s()},M=()=>{g(),o==null||o()},N=()=>{w(i),l==null||l()},b=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},I=c==="horizontal"?"horizontal":"vertical";return p.jsxs(Zd,{className:Ce(["react-flow__controls",I,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(Ro,{onClick:_,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:p.jsx(S3,{})}),p.jsx(Ro,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:p.jsx(k3,{})})]}),n&&p.jsx(Ro,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view",children:p.jsx(E3,{})}),r&&p.jsx(Ro,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?p.jsx(N3,{}):p.jsx(_3,{})}),f]})}hv.displayName="Controls";const b3=R.memo(hv);function j3({id:e,x:t,y:n,width:r,height:i,style:s,color:o,strokeColor:l,strokeWidth:a,className:u,borderRadius:f,shapeRendering:d,selected:c,onClick:h}){const{background:y,backgroundColor:v}=s||{},S=o||y||v;return p.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:c},u]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:a},shapeRendering:d,onClick:h?m=>h(m,e):void 0})}const M3=R.memo(j3),P3=e=>e.nodes.map(t=>t.id),ou=e=>e instanceof Function?e:()=>e;function z3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=M3,onClick:o}){const l=le(P3,Ee),a=ou(t),u=ou(e),f=ou(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:l.map(c=>p.jsx(T3,{id:c,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:d},c))})}function I3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:a}){const{node:u,x:f,y:d,width:c,height:h}=le(y=>{const v=y.nodeLookup.get(e),{x:S,y:m}=v.internals.positionAbsolute,{width:x,height:g}=fn(v);return{node:v,x:S,y:m,width:x,height:g}},Ee);return!u||u.hidden||!py(u)?null:p.jsx(l,{x:f,y:d,width:c,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:a,id:u.id})}const T3=R.memo(I3);var R3=R.memo(z3);const $3=200,O3=150,D3=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?fy(ro(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},A3="react-flow__minimap-desc";function pv({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:f,maskStrokeWidth:d,position:c="bottom-right",onClick:h,onNodeClick:y,pannable:v=!1,zoomable:S=!1,ariaLabel:m="React Flow mini map",inversePan:x,zoomStep:g=10,offsetScale:w=5}){const _=ge(),M=R.useRef(null),{boundingRect:N,viewBB:b,rfId:I,panZoom:z,translateExtent:D,flowWidth:F,flowHeight:L}=le(D3,Ee),E=(e==null?void 0:e.width)??$3,$=(e==null?void 0:e.height)??O3,P=N.width/E,O=N.height/$,k=Math.max(P,O),j=k*E,T=k*$,A=w*k,H=N.x-(j-N.width)/2-A,Y=N.y-(T-N.height)/2-A,U=j+A*2,W=T+A*2,X=`${A3}-${I}`,Z=R.useRef(0),Q=R.useRef();Z.current=k,R.useEffect(()=>{if(M.current&&z)return Q.current=F_({domNode:M.current,panZoom:z,getTransform:()=>_.getState().transform,getViewScale:()=>Z.current}),()=>{var ne;(ne=Q.current)==null||ne.destroy()}},[z]),R.useEffect(()=>{var ne;(ne=Q.current)==null||ne.update({translateExtent:D,width:F,height:L,inversePan:x,pannable:v,zoomStep:g,zoomable:S})},[v,S,x,g,D,F,L]);const te=h?ne=>{var fe;const[J,ae]=((fe=Q.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:c,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*k:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="string"?o:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:E,height:$,viewBox:`${H} ${Y} ${U} ${W}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:M,onClick:te,children:[m&&p.jsx("title",{id:X,children:m}),p.jsx(R3,{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},${Y-A}h${U+A*2}v${W+A*2}h${-U-A*2}z
|
|
62
|
+
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pv.displayName="MiniMap";R.memo(pv);function L3({nodeId:e,position:t,variant:n=fs.Handle,className:r,style:i={},children:s,color:o,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:c,onResizeStart:h,onResize:y,onResizeEnd:v}){const S=Wy(),m=typeof e=="string"?e:S,x=ge(),g=R.useRef(null),w=n===fs.Line?"right":"bottom-right",_=t??w,M=R.useRef(null);R.useEffect(()=>{if(!(!g.current||!m))return M.current||(M.current=tN({domNode:g.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:z,transform:D,snapGrid:F,snapToGrid:L,nodeOrigin:E,domNode:$}=x.getState();return{nodeLookup:z,transform:D,snapGrid:F,snapToGrid:L,nodeOrigin:E,paneDomNode:$}},onChange:(z,D)=>{const{triggerNodeChanges:F,nodeLookup:L,parentLookup:E,nodeOrigin:$}=x.getState(),P=[],O={x:z.x,y:z.y},k=L.get(m);if(k&&k.expandParent&&k.parentId){const j=k.origin??$,T=z.width??k.measured.width,A=z.height??k.measured.height,H={id:k.id,parentId:k.parentId,rect:{width:T,height:A,...my({x:z.x??k.position.x,y:z.y??k.position.y},{width:T,height:A},k.parentId,L,j)}},Y=Gd([H],L,E,$);P.push(...Y),O.x=z.x?Math.max(j[0]*T,z.x):void 0,O.y=z.y?Math.max(j[1]*A,z.y):void 0}if(O.x!==void 0&&O.y!==void 0){const j={id:m,type:"position",position:{...O}};P.push(j)}if(z.width!==void 0&&z.height!==void 0){const j={id:m,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:z.width,height:z.height}};P.push(j)}for(const j of D){const T={...j,type:"position"};P.push(T)}F(P)},onEnd:()=>{const z={id:m,type:"dimensions",resizing:!1};x.getState().triggerNodeChanges([z])}})),M.current.update({controlPosition:_,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:f},keepAspectRatio:d,onResizeStart:h,onResize:y,onResizeEnd:v,shouldResize:c}),()=>{var z;(z=M.current)==null||z.destroy()}},[_,l,a,u,f,d,h,y,v,c]);const N=_.split("-"),b=n===fs.Line?"borderColor":"backgroundColor",I=o?{...i,[b]:o}:i;return p.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...N,n,r]),ref:g,style:I,children:s})}R.memo(L3);const F3=new Set;function H3(e){return e.startsWith("signal:child:")}function B3(e){const t=R.useMemo(()=>[...e].sort(),[e]),n=v0({queries:t.map(i=>({queryKey:["run",i],queryFn:()=>Ye.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 V3({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?yc.child:yc[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(Eg,{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(_g,{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 U3({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 Q3={step:V3,terminal:U3};function W3(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,selectedKey:n,onSelect:r,onOpenRun:i,fmtDuration:s,expanded:o,onToggleChild:l}){const a=o??F3,u=R.useMemo(()=>{const y=new Set(a);for(const v of t){const S=zs(v);S!==void 0&&y.add(S)}return y},[a,t]),f=B3(u),{nodes:d,edges:c}=(()=>{const S=[],m=[],x=e.status==="running"||e.status==="suspended",g=(I,z,D)=>({id:`${I}->${z}`,source:I,target:z,style:{stroke:D?"#f87171":"var(--line)",strokeWidth:1.5}}),w=(I,z)=>({id:`${I}=>${z}`,source:I,target:z,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function _(I,z,D,F,L){var k;let E=D,$,P,O=!1;for(const j of I){const T=`${F}s${j.seq}`,A=zs(j),H=A!==void 0&&a.has(A),Y=A!==void 0?((k=f[A])==null?void 0:k.run.workflow)??"child workflow":j.name;S.push({id:T,type:"step",draggable:!1,position:{x:E,y:z*150},data:{seq:j.seq,name:Y,kind:j.kind,status:j.status,workerGroup:j.workerGroup,attempts:j.attempts,duration:s(j.startedAt,j.finishedAt),subs:W3(j),selected:n===`${j.runId}#${j.seq}`,childRunId:A,onOpenRun:i,childExpanded:H,onToggleChild:l,depth:z,step:j,laneRun:L}}),$===void 0&&($=T),P!==void 0&&m.push(g(P,T,O));const U=A!==void 0&&H?f[A]:void 0;if(U){const W=_(U.timeline,z+1,E+248,`${A}:`,U.run);W.firstId!==void 0&&m.push(w(T,W.firstId)),H3(j.name)&&W.connectorId!==void 0?P=W.connectorId:P=T,E=Math.max(E+248,W.nextX)}else P=T,E+=248;O=j.status==="failed"}return{firstId:$,connectorId:P,nextX:E}}const M=248;S.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:e.workflow}});const N=_(t,0,M,"",e);N.firstId!==void 0&&m.push({id:"start->first",source:"start",target:N.firstId});const b=$d(e,t);return S.push({id:"end",type:"terminal",position:{x:Math.max(N.nextX,M),y:0},draggable:!1,data:{status:b,label:b}}),m.push({id:"exit->end",source:N.connectorId??"start",target:"end",animated:x,style:{stroke:x?"var(--accent)":"var(--line)",strokeWidth:x?2:1.5}}),{nodes:S,edges:m}})(),h=R.useCallback((y,v)=>{if(v.type!=="step")return;const S=v.data;S.step&&S.laneRun&&r(S.step,S.laneRun)},[r]);return p.jsxs(m3,{nodes:d,edges:c,nodeTypes:Q3,onNodeClick:h,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[p.jsx(w3,{variant:nn.Dots,gap:22,size:1,color:"#1c1c22"}),p.jsx(b3,{showInteractive:!1,position:"bottom-right"})]})}const X3=["pending","running","suspended","completed","failed","cancelled","dead"];function Y3(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 K3(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 mv({status:e}){const t=e==="running"||e==="awaiting";return p.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function gv({status:e}){return p.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[p.jsx(mv,{status:e}),e]})}function G3({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(mv,{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),X3.map(s=>i(s,s,e[s]??0))]}),p.jsx(Z3,{}),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 Z3(){const{data:e}=pi({queryKey:["workers"],queryFn:()=>Ye.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 J3({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(gv,{status:$d(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:Y3(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 e5({id:e,onOpenRun:t}){var P,O;const n=Ys(),{data:r}=pi({queryKey:["run",e],queryFn:async()=>gS(n.getQueryData(["run",e]),await Ye.run(e)),refetchInterval:k=>{var T;const j=(T=k.state.data)==null?void 0:T.run.status;return j==="running"||j==="suspended"?1500:!1}}),i=(r==null?void 0:r.run.status)==="dead"?`dlq:${e}`:void 0,{data:s}=pi({queryKey:["run",i],queryFn:()=>Ye.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 Ye.streamRun(e,k=>{if(k.type==="step.progress"&&k.event&&k.seq!=null){const j=k.seq,T=k.event;n.setQueryData(["run",e],A=>A&&{...A,timeline:A.timeline.map(H=>H.seq===j?{...H,events:[...H.events??[],T]}:H)});return}n.invalidateQueries({queryKey:["run",e]})})},[e,a,n]);const u=Yi({mutationFn:()=>Ye.retry(e),onSuccess:o}),f=Yi({mutationFn:k=>Ye.cancel(e,{compensate:k}),onSuccess:o}),d=Yi({mutationFn:()=>Ye.continue(e),onSuccess:o}),c=Yi({mutationFn:k=>Ye.retryWithInput(e,k),onSuccess:k=>{n.invalidateQueries({queryKey:["runs"]}),t(k.runId)}}),h=()=>{const k=JSON.stringify((r==null?void 0:r.run.input)??{},null,2),j=window.prompt("Fix the input, then replay as a fresh run:",k);if(j!=null)try{c.mutate(JSON.parse(j))}catch{window.alert("Invalid JSON")}},[y,v]=R.useState(),[S,m]=R.useState(!1),[x,g]=R.useState(new Set),[w,_]=R.useState(240);function M(k){k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId);const j=A=>_(H=>Math.max(120,Math.min(720,H-A.movementY))),T=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",T)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",T)}function N(k){g(j=>{const T=new Set(j);return T.has(k)?T.delete(k):T.add(k),T})}if(!r)return p.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:b,timeline:I}=r,z=b.id.startsWith("dlq:"),D=z?{id:b.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${b.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:s?{id:`dlq:${b.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,F=b.status==="failed"||b.status==="suspended",L=b.status==="running"||b.status==="suspended",E=I.some(k=>k.status==="pending"&&k.kind==="signal"&&k.name.startsWith("breakpoint")),$=y?`${y.step.runId}#${y.step.seq}`:void 0;return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--line)] px-7 py-5",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:b.workflow}),z&&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(gv,{status:$d(b,I)}),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:[I.length," ",I.length===1?"step":"steps"]})]}),p.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:b.id}),b.tags&&b.tags.length>0&&p.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:b.tags.map(k=>p.jsxs("span",{className:"mono rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400",children:["#",k]},k))}),b.searchAttributes&&Object.keys(b.searchAttributes).length>0&&p.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(b.searchAttributes).map(([k,j])=>p.jsxs("span",{className:"mono rounded border border-indigo-500/30 bg-indigo-500/10 px-1.5 text-[10px] text-indigo-300",title:"search attribute",children:[k,"=",String(j)]},k))}),(P=r==null?void 0:r.children)!=null&&P.length?p.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[p.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),(O=r.children)==null?void 0:O.map(k=>p.jsx("span",{onClick:()=>t(k),className:"mono cursor-pointer rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400 hover:border-zinc-500 hover:text-zinc-200",children:k},k))]}):null]}),p.jsxs("div",{className:"flex shrink-0 gap-2",children:[p.jsx("button",{type:"button",onClick:()=>m(!0),className:"mono rounded-md border border-[var(--line)] px-2.5 py-1.5 text-xs text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-100",title:"Run input / output",children:"{ }"}),E&&p.jsxs("button",{type:"button",disabled:d.isPending,onClick:()=>d.mutate(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/40 bg-amber-500/15 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-amber-200 transition-colors enabled:hover:bg-amber-500/25 disabled:opacity-30",children:[p.jsx(SS,{width:12,height:12}),"Continue"]}),p.jsxs("button",{type:"button",disabled:!F||u.isPending,onClick:()=>u.mutate(),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-emerald-300 transition-colors enabled:hover:bg-emerald-500/20 disabled:opacity-30",children:[p.jsx(Ka,{width:12,height:12}),"Retry"]}),(b.status==="dead"||b.status==="failed")&&p.jsxs("button",{type:"button",disabled:c.isPending,onClick:h,title:"Edit the input and re-run as a fresh linked run",className:"flex items-center gap-1.5 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-indigo-300 transition-colors enabled:hover:bg-indigo-500/20 disabled:opacity-30",children:[p.jsx(Ka,{width:12,height:12}),"Fix & replay"]}),L&&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(Ka,{width:12,height:12}),"Cancel + Undo"]}),p.jsxs("button",{type:"button",disabled:!L||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:I.length>0?`1fr ${w}px`:"1fr"},children:[p.jsxs("div",{className:"relative min-h-0",children:[I.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:I,selectedKey:$,onSelect:(k,j)=>v({step:k,run:j}),onOpenRun:t,fmtDuration:K3,expanded:x,onToggleChild:N}),(b.status==="failed"||b.status==="cancelled")&&b.error&&p.jsx("div",{className:"mono absolute inset-x-6 bottom-6 rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-300 backdrop-blur",children:b.error.message})]}),I.length>0&&p.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-[var(--line)] bg-black/20",children:[p.jsx("div",{onPointerDown:M,className:"absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-emerald-500/40",title:"Drag to resize"}),p.jsx(bS,{run:b,timeline:I,selectedKey:$,onSelect:(k,j)=>v({step:k,run:j}),onOpenRun:t,expanded:x,onToggleChild:N})]}),y&&p.jsx(TS,{step:y.step,run:y.run,onClose:()=>v(void 0),onOpenRun:t}),S&&p.jsx(RS,{run:b,onClose:()=>m(!1)})]})]})}function Mp(){if(typeof window>"u")return;const e=window.location.hash.match(/^#\/run\/(.+)$/);return e?decodeURIComponent(e[1]):void 0}function t5(){const[e,t]=R.useState("all"),[n,r]=R.useState(""),[i,s]=R.useState(""),[o,l]=R.useState(()=>Mp()),a=R.useCallback(v=>{if(l(v),typeof window>"u")return;const S=v?`#/run/${encodeURIComponent(v)}`:"",m=S||window.location.pathname+window.location.search;window.location.hash!==S&&window.history.pushState(null,"",m)},[]);R.useEffect(()=>{const v=()=>l(Mp());return window.addEventListener("hashchange",v),window.addEventListener("popstate",v),()=>{window.removeEventListener("hashchange",v),window.removeEventListener("popstate",v)}},[]);const u=Ys(),f=i.split(",").map(v=>v.trim()).filter(Boolean),{data:d=[]}=pi({queryKey:["runs",n,f.join("|")],queryFn:()=>Ye.runs(void 0,n||void 0,f.length?f:void 0),refetchInterval:3e3}),c=Yi({mutationFn:v=>Ye.bulk(v,{status:e!=="all"?e:void 0,tag:n||void 0,attr:f.length?f:void 0}),onSuccess:()=>u.invalidateQueries({queryKey:["runs"]})}),h=d.reduce((v,S)=>(v[S.status]=(v[S.status]??0)+1,v),{}),y=e==="all"?d:d.filter(v=>v.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(G3,{counts:h,filter:e,onFilter:t}),p.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[p.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-[var(--line)]",children:[p.jsxs("div",{className:"border-b border-[var(--line)] p-2",children:[p.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-[var(--line)] px-2",children:[p.jsx("span",{className:"text-zinc-600",children:"#"}),p.jsx("input",{value:n,onChange:v=>r(v.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:v=>s(v.target.value),placeholder:"attrs e.g. amount:gte:200, tier:eq:pro",title:"Typed search attributes: comma-separated key:op:value (ops eq ne gt gte lt lte)",className:"mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none"}),i&&p.jsx("button",{type:"button",onClick:()=>s(""),className:"text-zinc-600 hover:text-zinc-300",title:"clear attribute filter",children:p.jsx(ki,{width:12,height:12})})]})]}),(e!=="all"||n||f.length>0)&&y.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:[y.length," ",e!=="all"?e:""," ",n&&`#${n}`,f.length>0&&` ⛃${f.length}`]}),p.jsx("button",{type:"button",disabled:c.isPending,onClick:()=>c.mutate("retry"),className:"mono ml-auto rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-300 transition-colors hover:bg-emerald-500/20 disabled:opacity-40",children:"retry all"}),p.jsx("button",{type:"button",disabled:c.isPending,onClick:()=>c.mutate("cancel"),className:"mono rounded border border-rose-500/30 bg-rose-500/10 px-1.5 py-0.5 text-[10px] text-rose-300 transition-colors hover:bg-rose-500/20 disabled:opacity-40",children:"cancel all"})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:p.jsx(J3,{runs:y,selected:o,onSelect:a,onSelectTag:r})})]}),p.jsx("main",{className:"min-h-0",children:o?p.jsx(e5,{id:o,onOpenRun:a},o):p.jsx("div",{className:"grid h-full place-items-center text-center",children:p.jsxs("div",{children:[p.jsx("div",{className:"text-4xl text-zinc-800","aria-hidden":!0,children:"◆"}),p.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const n5=new Jx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});wg(document.getElementById("root")).render(p.jsx(R.StrictMode,{children:p.jsx(sw,{client:n5,children:p.jsx(t5,{})})}));
|