@dudousxd/nestjs-durable-dashboard 0.1.0 → 0.1.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.
@@ -6,7 +6,7 @@ var Rf=e=>{throw TypeError(e)};var iu=(e,t,n)=>t.has(e)||Rf("Cannot "+n);var N=(
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var $o=Symbol.for("react.element"),Rv=Symbol.for("react.portal"),$v=Symbol.for("react.fragment"),Dv=Symbol.for("react.strict_mode"),Lv=Symbol.for("react.profiler"),Av=Symbol.for("react.provider"),Ov=Symbol.for("react.context"),bv=Symbol.for("react.forward_ref"),Fv=Symbol.for("react.suspense"),Hv=Symbol.for("react.memo"),Vv=Symbol.for("react.lazy"),$f=Symbol.iterator;function Bv(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gp=Object.assign,yp={};function vi(e,t,n){this.props=e,this.context=t,this.refs=yp,this.updater=n||mp}vi.prototype.isReactComponent={};vi.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")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vp(){}vp.prototype=vi.prototype;function dc(e,t,n){this.props=e,this.context=t,this.refs=yp,this.updater=n||mp}var hc=dc.prototype=new vp;hc.constructor=dc;gp(hc,vi.prototype);hc.isPureReactComponent=!0;var Df=Array.isArray,xp=Object.prototype.hasOwnProperty,pc={current:null},wp={key:!0,ref:!0,__self:!0,__source:!0};function Sp(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)xp.call(t,r)&&!wp.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:$o,type:e,key:o,ref:s,props:i,_owner:pc.current}}function Uv(e,t){return{$$typeof:$o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function mc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$o}function Qv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Lf=/\/+/g;function ou(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Qv(""+e.key):t.toString(36)}function ws(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case $o:case Rv:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ou(s,0):r,Df(i)?(n="",e!=null&&(n=e.replace(Lf,"$&/")+"/"),ws(i,t,n,"",function(a){return a})):i!=null&&(mc(i)&&(i=Uv(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Lf,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Df(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+ou(o,l);s+=ws(o,t,n,u,i)}else if(u=Bv(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+ou(o,l++),s+=ws(o,t,n,u,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Wo(e,t,n){if(e==null)return e;var r=[],i=0;return ws(e,r,"","",function(o){return t.call(n,o,i++)}),r}function Wv(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 Ue={current:null},Ss={transition:null},Xv={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Ss,ReactCurrentOwner:pc};function Ep(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Wo,forEach:function(e,t,n){Wo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wo(e,function(){t++}),t},toArray:function(e){return Wo(e,function(t){return t})||[]},only:function(e){if(!mc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=vi;re.Fragment=$v;re.Profiler=Lv;re.PureComponent=dc;re.StrictMode=Dv;re.Suspense=Fv;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xv;re.act=Ep;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=gp({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=pc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)xp.call(t,u)&&!wp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:$o,type:e.type,key:i,ref:o,props:r,_owner:s}};re.createContext=function(e){return e={$$typeof:Ov,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Av,_context:e},e.Consumer=e};re.createElement=Sp;re.createFactory=function(e){var t=Sp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:bv,render:e}};re.isValidElement=mc;re.lazy=function(e){return{$$typeof:Vv,_payload:{_status:-1,_result:e},_init:Wv}};re.memo=function(e,t){return{$$typeof:Hv,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Ss.transition;Ss.transition={};try{e()}finally{Ss.transition=t}};re.unstable_act=Ep;re.useCallback=function(e,t){return Ue.current.useCallback(e,t)};re.useContext=function(e){return Ue.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};re.useEffect=function(e,t){return Ue.current.useEffect(e,t)};re.useId=function(){return Ue.current.useId()};re.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Ue.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};re.useRef=function(e){return Ue.current.useRef(e)};re.useState=function(e){return Ue.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Ue.current.useTransition()};re.version="18.3.1";pp.exports=re;var D=pp.exports;const Yv=dp(D);/**
9
+ */var $o=Symbol.for("react.element"),$v=Symbol.for("react.portal"),Dv=Symbol.for("react.fragment"),Av=Symbol.for("react.strict_mode"),Lv=Symbol.for("react.profiler"),Ov=Symbol.for("react.provider"),bv=Symbol.for("react.context"),Fv=Symbol.for("react.forward_ref"),Hv=Symbol.for("react.suspense"),Vv=Symbol.for("react.memo"),Bv=Symbol.for("react.lazy"),$f=Symbol.iterator;function Uv(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gp=Object.assign,yp={};function vi(e,t,n){this.props=e,this.context=t,this.refs=yp,this.updater=n||mp}vi.prototype.isReactComponent={};vi.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")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vp(){}vp.prototype=vi.prototype;function dc(e,t,n){this.props=e,this.context=t,this.refs=yp,this.updater=n||mp}var hc=dc.prototype=new vp;hc.constructor=dc;gp(hc,vi.prototype);hc.isPureReactComponent=!0;var Df=Array.isArray,xp=Object.prototype.hasOwnProperty,pc={current:null},wp={key:!0,ref:!0,__self:!0,__source:!0};function Sp(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)xp.call(t,r)&&!wp.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:$o,type:e,key:o,ref:s,props:i,_owner:pc.current}}function Qv(e,t){return{$$typeof:$o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function mc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$o}function Wv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Af=/\/+/g;function ou(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wv(""+e.key):t.toString(36)}function ws(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case $o:case $v:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ou(s,0):r,Df(i)?(n="",e!=null&&(n=e.replace(Af,"$&/")+"/"),ws(i,t,n,"",function(a){return a})):i!=null&&(mc(i)&&(i=Qv(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Af,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Df(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+ou(o,l);s+=ws(o,t,n,u,i)}else if(u=Uv(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+ou(o,l++),s+=ws(o,t,n,u,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Wo(e,t,n){if(e==null)return e;var r=[],i=0;return ws(e,r,"","",function(o){return t.call(n,o,i++)}),r}function Xv(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 Ue={current:null},Ss={transition:null},Yv={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Ss,ReactCurrentOwner:pc};function Ep(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Wo,forEach:function(e,t,n){Wo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wo(e,function(){t++}),t},toArray:function(e){return Wo(e,function(t){return t})||[]},only:function(e){if(!mc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=vi;re.Fragment=Dv;re.Profiler=Lv;re.PureComponent=dc;re.StrictMode=Av;re.Suspense=Hv;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yv;re.act=Ep;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=gp({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=pc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)xp.call(t,u)&&!wp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:$o,type:e.type,key:i,ref:o,props:r,_owner:s}};re.createContext=function(e){return e={$$typeof:bv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ov,_context:e},e.Consumer=e};re.createElement=Sp;re.createFactory=function(e){var t=Sp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:Fv,render:e}};re.isValidElement=mc;re.lazy=function(e){return{$$typeof:Bv,_payload:{_status:-1,_result:e},_init:Xv}};re.memo=function(e,t){return{$$typeof:Vv,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Ss.transition;Ss.transition={};try{e()}finally{Ss.transition=t}};re.unstable_act=Ep;re.useCallback=function(e,t){return Ue.current.useCallback(e,t)};re.useContext=function(e){return Ue.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};re.useEffect=function(e,t){return Ue.current.useEffect(e,t)};re.useId=function(){return Ue.current.useId()};re.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Ue.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};re.useRef=function(e){return Ue.current.useRef(e)};re.useState=function(e){return Ue.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Ue.current.useTransition()};re.version="18.3.1";pp.exports=re;var D=pp.exports;const Kv=dp(D);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ var Rf=e=>{throw TypeError(e)};var iu=(e,t,n)=>t.has(e)||Rf("Cannot "+n);var N=(
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Kv=D,qv=Symbol.for("react.element"),Gv=Symbol.for("react.fragment"),Zv=Object.prototype.hasOwnProperty,Jv=Kv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ex={key:!0,ref:!0,__self:!0,__source:!0};function _p(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Zv.call(t,r)&&!ex.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:qv,type:e,key:o,ref:s,props:i,_owner:Jv.current}}wl.Fragment=Gv;wl.jsx=_p;wl.jsxs=_p;hp.exports=wl;var w=hp.exports,xi=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(){}},cr=typeof window>"u"||"Deno"in globalThis;function ct(){}function tx(e,t){return typeof e=="function"?e(t):e}function Vu(e){return typeof e=="number"&&e>=0&&e!==1/0}function kp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Lr(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function Af(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==gc(s,t.options))return!1}else if(!to(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function Of(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(fr(t.options.mutationKey)!==fr(o))return!1}else if(!to(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gc(e,t){return((t==null?void 0:t.queryKeyHashFn)||fr)(e)}function fr(e){return JSON.stringify(e,(t,n)=>Bu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function to(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!to(e[n],t[n])):!1}function Cp(e,t){if(e===t)return e;const n=bf(e)&&bf(t);if(n||Bu(e)&&Bu(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,l=n?[]:{};let u=0;for(let a=0;a<s;a++){const d=n?a:o[a];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,u++):(l[d]=Cp(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&u++)}return i===s&&u===i?e:l}return t}function Os(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 bf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bu(e){if(!Ff(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ff(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ff(e){return Object.prototype.toString.call(e)==="[object Object]"}function nx(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?Cp(e,t):t}function rx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ix(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yc=Symbol();function Np(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Jn,wn,Qr,np,ox=(np=class extends xi{constructor(){super();J(this,Jn);J(this,wn);J(this,Qr);Q(this,Qr,t=>{if(!cr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,wn)||this.setEventListener(N(this,Qr))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,wn))==null||t.call(this),Q(this,wn,void 0))}setEventListener(t){var n;Q(this,Qr,t),(n=N(this,wn))==null||n.call(this),Q(this,wn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,Jn)!==t&&(Q(this,Jn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,Jn)=="boolean"?N(this,Jn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jn=new WeakMap,wn=new WeakMap,Qr=new WeakMap,np),vc=new ox,Wr,Sn,Xr,rp,sx=(rp=class extends xi{constructor(){super();J(this,Wr,!0);J(this,Sn);J(this,Xr);Q(this,Xr,t=>{if(!cr&&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(){N(this,Sn)||this.setEventListener(N(this,Xr))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Sn))==null||t.call(this),Q(this,Sn,void 0))}setEventListener(t){var n;Q(this,Xr,t),(n=N(this,Sn))==null||n.call(this),Q(this,Sn,t(this.setOnline.bind(this)))}setOnline(t){N(this,Wr)!==t&&(Q(this,Wr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,Wr)}},Wr=new WeakMap,Sn=new WeakMap,Xr=new WeakMap,rp),bs=new sx;function Qu(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});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 lx(e){return Math.min(1e3*2**e,3e4)}function Mp(e){return(e??"online")==="online"?bs.isOnline():!0}var Pp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function su(e){return e instanceof Pp}function Tp(e){let t=!1,n=0,r=!1,i;const o=Qu(),s=v=>{var S;r||(f(new Pp(v)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},a=()=>vc.isFocused()&&(e.networkMode==="always"||bs.isOnline())&&e.canRun(),d=()=>Mp(e.networkMode)&&e.canRun(),c=v=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,v),i==null||i(),o.resolve(v))},f=v=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,v),i==null||i(),o.reject(v))},h=()=>new Promise(v=>{var S;i=p=>{(r||a())&&v(p)},(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(p){v=Promise.reject(p)}Promise.resolve(v).then(c).catch(p=>{var z;if(r)return;const g=e.retry??(cr?0:3),m=e.retryDelay??lx,x=typeof m=="function"?m(n,p):m,k=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,p);if(t||!k){f(p);return}n++,(z=e.onFail)==null||z.call(e,n,p),nx(x).then(()=>a()?void 0:h()).then(()=>{t?f(p):y()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?y():h().then(y),o)}}function ux(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const o=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||s()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Me=ux(),er,ip,zp=(ip=class{constructor(){J(this,er)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vu(this.gcTime)&&Q(this,er,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cr?1/0:5*60*1e3))}clearGcTimeout(){N(this,er)&&(clearTimeout(N(this,er)),Q(this,er,void 0))}},er=new WeakMap,ip),Yr,Kr,at,Ae,zo,tr,xt,Vt,op,ax=(op=class extends zp{constructor(t){super();J(this,xt);J(this,Yr);J(this,Kr);J(this,at);J(this,Ae);J(this,zo);J(this,tr);Q(this,tr,!1),Q(this,zo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,at,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Yr,cx(this.options)),this.state=t.state??N(this,Yr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Ae))==null?void 0:t.promise}setOptions(t){this.options={...N(this,zo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,at).remove(this)}setData(t,n){const r=Uu(this.state.data,t,this.options);return te(this,xt,Vt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){te(this,xt,Vt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=N(this,Ae))==null?void 0:r.promise;return(i=N(this,Ae))==null||i.cancel(t),n?n.then(ct).catch(ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Yr))}isActive(){return this.observers.some(t=>Et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yc||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||!kp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,at).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Ae)&&(N(this,tr)?N(this,Ae).cancel({revert:!0}):N(this,Ae).cancelRetry()),this.scheduleGc()),N(this,at).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,xt,Vt).call(this,{type:"invalidate"})}fetch(t,n){var u,a,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Ae))return N(this,Ae).continueRetry(),N(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(Q(this,tr,!0),r.signal)})},o=()=>{const c=Np(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),Q(this,tr,!1),this.options.persister?this.options.persister(c,f,this):c(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),Q(this,Kr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=s.fetchOptions)==null?void 0:a.meta))&&te(this,xt,Vt).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=c=>{var f,h,y,v;su(c)&&c.silent||te(this,xt,Vt).call(this,{type:"error",error:c}),su(c)||((h=(f=N(this,at).config).onError)==null||h.call(f,c,this),(v=(y=N(this,at).config).onSettled)==null||v.call(y,this.state.data,c,this)),this.scheduleGc()};return Q(this,Ae,Tp({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,h,y,v;if(c===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(S){l(S);return}(h=(f=N(this,at).config).onSuccess)==null||h.call(f,c,this),(v=(y=N(this,at).config).onSettled)==null||v.call(y,c,this.state.error,this),this.scheduleGc()},onError:l,onFail:(c,f)=>{te(this,xt,Vt).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{te(this,xt,Vt).call(this,{type:"pause"})},onContinue:()=>{te(this,xt,Vt).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),N(this,Ae).start()}},Yr=new WeakMap,Kr=new WeakMap,at=new WeakMap,Ae=new WeakMap,zo=new WeakMap,tr=new WeakMap,xt=new WeakSet,Vt=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,...Ip(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 su(i)&&i.revert&&N(this,Kr)?{...N(this,Kr),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),Me.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,at).notify({query:this,type:"updated",action:t})})},op);function Ip(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cx(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 jt,sp,fx=(sp=class extends xi{constructor(t={}){super();J(this,jt);this.config=t,Q(this,jt,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??gc(i,n);let s=this.get(o);return s||(s=new ax({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){N(this,jt).has(t.queryHash)||(N(this,jt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,jt).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,jt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,jt).get(t)}getAll(){return[...N(this,jt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Af(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Af(t,r)):n}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Me.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Me.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jt=new WeakMap,sp),Rt,Fe,nr,$t,hn,lp,dx=(lp=class extends zp{constructor(t){super();J(this,$t);J(this,Rt);J(this,Fe);J(this,nr);this.mutationId=t.mutationId,Q(this,Fe,t.mutationCache),Q(this,Rt,[]),this.state=t.state||jp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Rt).includes(t)||(N(this,Rt).push(t),this.clearGcTimeout(),N(this,Fe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Rt,N(this,Rt).filter(n=>n!==t)),this.scheduleGc(),N(this,Fe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():N(this,Fe).remove(this))}continue(){var t;return((t=N(this,nr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,l,u,a,d,c,f,h,y,v,S,p,g,m,x,k,z,C;Q(this,nr,Tp({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{te(this,$t,hn).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{te(this,$t,hn).call(this,{type:"pause"})},onContinue:()=>{te(this,$t,hn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Fe).canRun(this)}));const n=this.state.status==="pending",r=!N(this,nr).canStart();try{if(!n){te(this,$t,hn).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=N(this,Fe).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));I!==this.state.context&&te(this,$t,hn).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const M=await N(this,nr).start();return await((a=(u=N(this,Fe).config).onSuccess)==null?void 0:a.call(u,M,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,M,t,this.state.context)),await((h=(f=N(this,Fe).config).onSettled)==null?void 0:h.call(f,M,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,M,null,t,this.state.context)),te(this,$t,hn).call(this,{type:"success",data:M}),M}catch(M){try{throw await((p=(S=N(this,Fe).config).onError)==null?void 0:p.call(S,M,t,this.state.context,this)),await((m=(g=this.options).onError)==null?void 0:m.call(g,M,t,this.state.context)),await((k=(x=N(this,Fe).config).onSettled)==null?void 0:k.call(x,void 0,M,this.state.variables,this.state.context,this)),await((C=(z=this.options).onSettled)==null?void 0:C.call(z,void 0,M,t,this.state.context)),M}finally{te(this,$t,hn).call(this,{type:"error",error:M})}}finally{N(this,Fe).runNext(this)}}},Rt=new WeakMap,Fe=new WeakMap,nr=new WeakMap,$t=new WeakSet,hn=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),Me.batch(()=>{N(this,Rt).forEach(r=>{r.onMutationUpdate(t)}),N(this,Fe).notify({mutation:this,type:"updated",action:t})})},lp);function jp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et,Io,up,hx=(up=class extends xi{constructor(t={}){super();J(this,et);J(this,Io);this.config=t,Q(this,et,new Map),Q(this,Io,Date.now())}build(t,n,r){const i=new dx({mutationCache:this,mutationId:++Qo(this,Io)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Xo(t),r=N(this,et).get(n)??[];r.push(t),N(this,et).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Xo(t);if(N(this,et).has(n)){const i=(r=N(this,et).get(n))==null?void 0:r.filter(o=>o!==t);i&&(i.length===0?N(this,et).delete(n):N(this,et).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=N(this,et).get(Xo(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=N(this,et).get(Xo(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...N(this,et).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Of(n,r))}findAll(t={}){return this.getAll().filter(n=>Of(t,n))}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Me.batch(()=>Promise.all(t.map(n=>n.continue().catch(ct))))}},et=new WeakMap,Io=new WeakMap,up);function Xo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Hf(e){return{onFetch:(t,n)=>{var d,c,f,h,y;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const a=async()=>{let v=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},p=Np(t.options,t.fetchOptions),g=async(m,x,k)=>{if(v)return Promise.reject();if(x==null&&m.pages.length)return Promise.resolve(m);const z={queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};S(z);const C=await p(z),{maxPages:M}=t.options,I=k?ix:rx;return{pages:I(m.pages,C,M),pageParams:I(m.pageParams,x,M)}};if(i&&o.length){const m=i==="backward",x=m?px:Vf,k={pages:o,pageParams:s},z=x(r,k);l=await g(k,z,m)}else{const m=e??o.length;do{const x=u===0?s[0]??r.initialPageParam:Vf(r,l);if(u>0&&x==null)break;l=await g(l,x),u++}while(u<m)}return l};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=a}}}function Vf(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 px(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,En,_n,qr,Gr,kn,Zr,Jr,ap,mx=(ap=class{constructor(e={}){J(this,we);J(this,En);J(this,_n);J(this,qr);J(this,Gr);J(this,kn);J(this,Zr);J(this,Jr);Q(this,we,e.queryCache||new fx),Q(this,En,e.mutationCache||new hx),Q(this,_n,e.defaultOptions||{}),Q(this,qr,new Map),Q(this,Gr,new Map),Q(this,kn,0)}mount(){Qo(this,kn)._++,N(this,kn)===1&&(Q(this,Zr,vc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),Q(this,Jr,bs.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;Qo(this,kn)._--,N(this,kn)===0&&((e=N(this,Zr))==null||e.call(this),Q(this,Zr,void 0),(t=N(this,Jr))==null||t.call(this),Q(this,Jr,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,En).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Lr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(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=N(this,we).get(r.queryHash),o=i==null?void 0:i.state.data,s=tx(t,o);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Me.batch(()=>N(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=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Me.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we),r={type:"active",...e};return Me.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Me.batch(()=>N(this,we).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ct).catch(ct)}invalidateQueries(e,t={}){return Me.batch(()=>{if(N(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=Me.batch(()=>N(this,we).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ct)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ct)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(Lr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ct).catch(ct)}fetchInfiniteQuery(e){return e.behavior=Hf(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ct).catch(ct)}ensureInfiniteQueryData(e){return e.behavior=Hf(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bs.isOnline()?N(this,En).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,En)}getDefaultOptions(){return N(this,_n)}setDefaultOptions(e){Q(this,_n,e)}setQueryDefaults(e,t){N(this,qr).set(fr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,qr).values()],n={};return t.forEach(r=>{to(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,Gr).set(fr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Gr).values()];let n={};return t.forEach(r=>{to(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gc(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===yc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,En).clear()}},we=new WeakMap,En=new WeakMap,_n=new WeakMap,qr=new WeakMap,Gr=new WeakMap,kn=new WeakMap,Zr=new WeakMap,Jr=new WeakMap,ap),We,ie,jo,He,rr,ei,Cn,Dt,Ro,ti,ni,ir,or,Nn,ri,ae,Ai,Wu,Xu,Yu,Ku,qu,Gu,Zu,Rp,cp,gx=(cp=class extends xi{constructor(t,n){super();J(this,ae);J(this,We);J(this,ie);J(this,jo);J(this,He);J(this,rr);J(this,ei);J(this,Cn);J(this,Dt);J(this,Ro);J(this,ti);J(this,ni);J(this,ir);J(this,or);J(this,Nn);J(this,ri,new Set);this.options=n,Q(this,We,t),Q(this,Dt,null),Q(this,Cn,Qu()),this.options.experimental_prefetchInRender||N(this,Cn).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&&(N(this,ie).addObserver(this),Bf(N(this,ie),this.options)?te(this,ae,Ai).call(this):this.updateResult(),te(this,ae,Ku).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ju(N(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ju(N(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,ae,qu).call(this),te(this,ae,Gu).call(this),N(this,ie).removeObserver(this)}setOptions(t,n){const r=this.options,i=N(this,ie);if(this.options=N(this,We).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Et(this.options.enabled,N(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,ae,Zu).call(this),N(this,ie).setOptions(this.options),r._defaulted&&!Os(this.options,r)&&N(this,We).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,ie),observer:this});const o=this.hasListeners();o&&Uf(N(this,ie),i,this.options,r)&&te(this,ae,Ai).call(this),this.updateResult(n),o&&(N(this,ie)!==i||Et(this.options.enabled,N(this,ie))!==Et(r.enabled,N(this,ie))||Lr(this.options.staleTime,N(this,ie))!==Lr(r.staleTime,N(this,ie)))&&te(this,ae,Wu).call(this);const s=te(this,ae,Xu).call(this);o&&(N(this,ie)!==i||Et(this.options.enabled,N(this,ie))!==Et(r.enabled,N(this,ie))||s!==N(this,Nn))&&te(this,ae,Yu).call(this,s)}getOptimisticResult(t){const n=N(this,We).getQueryCache().build(N(this,We),t),r=this.createResult(n,t);return vx(this,r)&&(Q(this,He,r),Q(this,ei,this.options),Q(this,rr,N(this,ie).state)),r}getCurrentResult(){return N(this,He)}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){N(this,ri).add(t)}getCurrentQuery(){return N(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,We).defaultQueryOptions(t),r=N(this,We).getQueryCache().build(N(this,We),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return te(this,ae,Ai).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,He)))}createResult(t,n){var M;const r=N(this,ie),i=this.options,o=N(this,He),s=N(this,rr),l=N(this,ei),a=t!==r?t.state:N(this,jo),{state:d}=t;let c={...d},f=!1,h;if(n._optimisticResults){const I=this.hasListeners(),j=!I&&Bf(t,n),A=I&&Uf(t,r,n,i);(j||A)&&(c={...c,...Ip(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:S}=c;if(n.select&&c.data!==void 0)if(o&&c.data===(s==null?void 0:s.data)&&n.select===N(this,Ro))h=N(this,ti);else try{Q(this,Ro,n.select),h=n.select(c.data),h=Uu(o==null?void 0:o.data,h,n),Q(this,ti,h),Q(this,Dt,null)}catch(I){Q(this,Dt,I)}else h=c.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let I;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))I=o.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((M=N(this,ni))==null?void 0:M.state.data,N(this,ni)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),Q(this,Dt,null)}catch(j){Q(this,Dt,j)}I!==void 0&&(S="success",h=Uu(o==null?void 0:o.data,I,n),f=!0)}N(this,Dt)&&(y=N(this,Dt),h=N(this,ti),v=Date.now(),S="error");const p=c.fetchStatus==="fetching",g=S==="pending",m=S==="error",x=g&&p,k=h!==void 0,C={status:S,fetchStatus:c.fetchStatus,isPending:g,isSuccess:S==="success",isError:m,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!g,isLoadingError:m&&!k,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:m&&k,isStale:xc(t,n),refetch:this.refetch,promise:N(this,Cn)};if(this.options.experimental_prefetchInRender){const I=F=>{C.status==="error"?F.reject(C.error):C.data!==void 0&&F.resolve(C.data)},j=()=>{const F=Q(this,Cn,C.promise=Qu());I(F)},A=N(this,Cn);switch(A.status){case"pending":t.queryHash===r.queryHash&&I(A);break;case"fulfilled":(C.status==="error"||C.data!==A.value)&&j();break;case"rejected":(C.status!=="error"||C.error!==A.reason)&&j();break}}return C}updateResult(t){const n=N(this,He),r=this.createResult(N(this,ie),this.options);if(Q(this,rr,N(this,ie).state),Q(this,ei,this.options),N(this,rr).data!==void 0&&Q(this,ni,N(this,ie)),Os(r,n))return;Q(this,He,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!N(this,ri).size)return!0;const u=new Set(l??N(this,ri));return this.options.throwOnError&&u.add("error"),Object.keys(N(this,He)).some(a=>{const d=a;return N(this,He)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),te(this,ae,Rp).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,ae,Ku).call(this)}},We=new WeakMap,ie=new WeakMap,jo=new WeakMap,He=new WeakMap,rr=new WeakMap,ei=new WeakMap,Cn=new WeakMap,Dt=new WeakMap,Ro=new WeakMap,ti=new WeakMap,ni=new WeakMap,ir=new WeakMap,or=new WeakMap,Nn=new WeakMap,ri=new WeakMap,ae=new WeakSet,Ai=function(t){te(this,ae,Zu).call(this);let n=N(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ct)),n},Wu=function(){te(this,ae,qu).call(this);const t=Lr(this.options.staleTime,N(this,ie));if(cr||N(this,He).isStale||!Vu(t))return;const r=kp(N(this,He).dataUpdatedAt,t)+1;Q(this,ir,setTimeout(()=>{N(this,He).isStale||this.updateResult()},r))},Xu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,ie)):this.options.refetchInterval)??!1},Yu=function(t){te(this,ae,Gu).call(this),Q(this,Nn,t),!(cr||Et(this.options.enabled,N(this,ie))===!1||!Vu(N(this,Nn))||N(this,Nn)===0)&&Q(this,or,setInterval(()=>{(this.options.refetchIntervalInBackground||vc.isFocused())&&te(this,ae,Ai).call(this)},N(this,Nn)))},Ku=function(){te(this,ae,Wu).call(this),te(this,ae,Yu).call(this,te(this,ae,Xu).call(this))},qu=function(){N(this,ir)&&(clearTimeout(N(this,ir)),Q(this,ir,void 0))},Gu=function(){N(this,or)&&(clearInterval(N(this,or)),Q(this,or,void 0))},Zu=function(){const t=N(this,We).getQueryCache().build(N(this,We),this.options);if(t===N(this,ie))return;const n=N(this,ie);Q(this,ie,t),Q(this,jo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Rp=function(t){Me.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,He))}),N(this,We).getQueryCache().notify({query:N(this,ie),type:"observerResultsUpdated"})})},cp);function yx(e,t){return Et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Bf(e,t){return yx(e,t)||e.state.data!==void 0&&Ju(e,t,t.refetchOnMount)}function Ju(e,t,n){if(Et(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xc(e,t)}return!1}function Uf(e,t,n,r){return(e!==t||Et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xc(e,n)}function xc(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(Lr(t.staleTime,e))}function vx(e,t){return!Os(e.getCurrentResult(),t)}var Mn,Pn,Xe,Qt,Zt,Es,ea,fp,xx=(fp=class extends xi{constructor(n,r){super();J(this,Zt);J(this,Mn);J(this,Pn);J(this,Xe);J(this,Qt);Q(this,Mn,n),this.setOptions(r),this.bindMethods(),te(this,Zt,Es).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=N(this,Mn).defaultMutationOptions(n),Os(this.options,r)||N(this,Mn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Xe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&fr(r.mutationKey)!==fr(this.options.mutationKey)?this.reset():((i=N(this,Xe))==null?void 0:i.state.status)==="pending"&&N(this,Xe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=N(this,Xe))==null||n.removeObserver(this)}onMutationUpdate(n){te(this,Zt,Es).call(this),te(this,Zt,ea).call(this,n)}getCurrentResult(){return N(this,Pn)}reset(){var n;(n=N(this,Xe))==null||n.removeObserver(this),Q(this,Xe,void 0),te(this,Zt,Es).call(this),te(this,Zt,ea).call(this)}mutate(n,r){var i;return Q(this,Qt,r),(i=N(this,Xe))==null||i.removeObserver(this),Q(this,Xe,N(this,Mn).getMutationCache().build(N(this,Mn),this.options)),N(this,Xe).addObserver(this),N(this,Xe).execute(n)}},Mn=new WeakMap,Pn=new WeakMap,Xe=new WeakMap,Qt=new WeakMap,Zt=new WeakSet,Es=function(){var r;const n=((r=N(this,Xe))==null?void 0:r.state)??jp();Q(this,Pn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ea=function(n){Me.batch(()=>{var r,i,o,s,l,u,a,d;if(N(this,Qt)&&this.hasListeners()){const c=N(this,Pn).variables,f=N(this,Pn).context;(n==null?void 0:n.type)==="success"?((i=(r=N(this,Qt)).onSuccess)==null||i.call(r,n.data,c,f),(s=(o=N(this,Qt)).onSettled)==null||s.call(o,n.data,null,c,f)):(n==null?void 0:n.type)==="error"&&((u=(l=N(this,Qt)).onError)==null||u.call(l,n.error,c,f),(d=(a=N(this,Qt)).onSettled)==null||d.call(a,void 0,n.error,c,f))}this.listeners.forEach(c=>{c(N(this,Pn))})})},fp),$p=D.createContext(void 0),wc=e=>{const t=D.useContext($p);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wx=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx($p.Provider,{value:e,children:t})),Dp=D.createContext(!1),Sx=()=>D.useContext(Dp);Dp.Provider;function Ex(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _x=D.createContext(Ex()),kx=()=>D.useContext(_x);function Lp(e,t){return typeof e=="function"?e(...t):!!e}function ta(){}var Cx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Nx=e=>{D.useEffect(()=>{e.clearReset()},[e])},Mx=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Lp(n,[e.error,r]),Px=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Tx=(e,t)=>e.isLoading&&e.isFetching&&!t,zx=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Qf=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ix(e,t,n){var d,c,f,h,y;const r=wc(),i=Sx(),o=kx(),s=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",Px(s),Cx(s,o),Nx(o);const l=!r.getQueryCache().get(s.queryHash),[u]=D.useState(()=>new t(r,s)),a=u.getOptimisticResult(s);if(D.useSyncExternalStore(D.useCallback(v=>{const S=i?ta:u.subscribe(Me.batchCalls(v));return u.updateResult(),S},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),D.useEffect(()=>{u.setOptions(s,{listeners:!1})},[s,u]),zx(s,a))throw Qf(s,u,o);if(Mx({result:a,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw a.error;if((h=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||h.call(f,s,a),s.experimental_prefetchInRender&&!cr&&Tx(a,i)){const v=l?Qf(s,u,o):(y=r.getQueryCache().get(s.queryHash))==null?void 0:y.promise;v==null||v.catch(ta).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?a:u.trackResult(a)}function Ap(e,t){return Ix(e,gx)}function Wf(e,t){const n=wc(),[r]=D.useState(()=>new xx(n,e));D.useEffect(()=>{r.setOptions(e)},[r,e]);const i=D.useSyncExternalStore(D.useCallback(s=>r.subscribe(Me.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=D.useCallback((s,l)=>{r.mutate(s,l).catch(ta)},[r]);if(i.error&&Lp(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Op={exports:{}},lt={},bp={exports:{}},Fp={};/**
17
+ */var qv=D,Gv=Symbol.for("react.element"),Zv=Symbol.for("react.fragment"),Jv=Object.prototype.hasOwnProperty,ex=qv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tx={key:!0,ref:!0,__self:!0,__source:!0};function _p(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Jv.call(t,r)&&!tx.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:Gv,type:e,key:o,ref:s,props:i,_owner:ex.current}}wl.Fragment=Zv;wl.jsx=_p;wl.jsxs=_p;hp.exports=wl;var w=hp.exports,xi=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(){}},cr=typeof window>"u"||"Deno"in globalThis;function ct(){}function nx(e,t){return typeof e=="function"?e(t):e}function Vu(e){return typeof e=="number"&&e>=0&&e!==1/0}function kp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ar(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function Lf(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==gc(s,t.options))return!1}else if(!to(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function Of(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(fr(t.options.mutationKey)!==fr(o))return!1}else if(!to(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gc(e,t){return((t==null?void 0:t.queryKeyHashFn)||fr)(e)}function fr(e){return JSON.stringify(e,(t,n)=>Bu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function to(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!to(e[n],t[n])):!1}function Cp(e,t){if(e===t)return e;const n=bf(e)&&bf(t);if(n||Bu(e)&&Bu(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,l=n?[]:{};let u=0;for(let a=0;a<s;a++){const d=n?a:o[a];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,u++):(l[d]=Cp(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&u++)}return i===s&&u===i?e:l}return t}function Os(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 bf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bu(e){if(!Ff(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ff(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ff(e){return Object.prototype.toString.call(e)==="[object Object]"}function rx(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?Cp(e,t):t}function ix(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ox(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yc=Symbol();function Np(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Jn,Sn,Qr,np,sx=(np=class extends xi{constructor(){super();J(this,Jn);J(this,Sn);J(this,Qr);Q(this,Qr,t=>{if(!cr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Sn)||this.setEventListener(N(this,Qr))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Sn))==null||t.call(this),Q(this,Sn,void 0))}setEventListener(t){var n;Q(this,Qr,t),(n=N(this,Sn))==null||n.call(this),Q(this,Sn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,Jn)!==t&&(Q(this,Jn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,Jn)=="boolean"?N(this,Jn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jn=new WeakMap,Sn=new WeakMap,Qr=new WeakMap,np),vc=new sx,Wr,En,Xr,rp,lx=(rp=class extends xi{constructor(){super();J(this,Wr,!0);J(this,En);J(this,Xr);Q(this,Xr,t=>{if(!cr&&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(){N(this,En)||this.setEventListener(N(this,Xr))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,En))==null||t.call(this),Q(this,En,void 0))}setEventListener(t){var n;Q(this,Xr,t),(n=N(this,En))==null||n.call(this),Q(this,En,t(this.setOnline.bind(this)))}setOnline(t){N(this,Wr)!==t&&(Q(this,Wr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,Wr)}},Wr=new WeakMap,En=new WeakMap,Xr=new WeakMap,rp),bs=new lx;function Qu(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function ux(e){return Math.min(1e3*2**e,3e4)}function Mp(e){return(e??"online")==="online"?bs.isOnline():!0}var Pp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function su(e){return e instanceof Pp}function Tp(e){let t=!1,n=0,r=!1,i;const o=Qu(),s=v=>{var S;r||(f(new Pp(v)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},a=()=>vc.isFocused()&&(e.networkMode==="always"||bs.isOnline())&&e.canRun(),d=()=>Mp(e.networkMode)&&e.canRun(),c=v=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,v),i==null||i(),o.resolve(v))},f=v=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,v),i==null||i(),o.reject(v))},h=()=>new Promise(v=>{var S;i=p=>{(r||a())&&v(p)},(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(p){v=Promise.reject(p)}Promise.resolve(v).then(c).catch(p=>{var z;if(r)return;const g=e.retry??(cr?0:3),m=e.retryDelay??ux,x=typeof m=="function"?m(n,p):m,k=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,p);if(t||!k){f(p);return}n++,(z=e.onFail)==null||z.call(e,n,p),rx(x).then(()=>a()?void 0:h()).then(()=>{t?f(p):y()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?y():h().then(y),o)}}function ax(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const o=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||s()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Me=ax(),er,ip,zp=(ip=class{constructor(){J(this,er)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vu(this.gcTime)&&Q(this,er,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cr?1/0:5*60*1e3))}clearGcTimeout(){N(this,er)&&(clearTimeout(N(this,er)),Q(this,er,void 0))}},er=new WeakMap,ip),Yr,Kr,at,Le,zo,tr,xt,Vt,op,cx=(op=class extends zp{constructor(t){super();J(this,xt);J(this,Yr);J(this,Kr);J(this,at);J(this,Le);J(this,zo);J(this,tr);Q(this,tr,!1),Q(this,zo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,at,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Yr,fx(this.options)),this.state=t.state??N(this,Yr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Le))==null?void 0:t.promise}setOptions(t){this.options={...N(this,zo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,at).remove(this)}setData(t,n){const r=Uu(this.state.data,t,this.options);return te(this,xt,Vt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){te(this,xt,Vt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=N(this,Le))==null?void 0:r.promise;return(i=N(this,Le))==null||i.cancel(t),n?n.then(ct).catch(ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Yr))}isActive(){return this.observers.some(t=>Et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yc||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||!kp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Le))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Le))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,at).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Le)&&(N(this,tr)?N(this,Le).cancel({revert:!0}):N(this,Le).cancelRetry()),this.scheduleGc()),N(this,at).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,xt,Vt).call(this,{type:"invalidate"})}fetch(t,n){var u,a,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Le))return N(this,Le).continueRetry(),N(this,Le).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(Q(this,tr,!0),r.signal)})},o=()=>{const c=Np(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),Q(this,tr,!1),this.options.persister?this.options.persister(c,f,this):c(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),Q(this,Kr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=s.fetchOptions)==null?void 0:a.meta))&&te(this,xt,Vt).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=c=>{var f,h,y,v;su(c)&&c.silent||te(this,xt,Vt).call(this,{type:"error",error:c}),su(c)||((h=(f=N(this,at).config).onError)==null||h.call(f,c,this),(v=(y=N(this,at).config).onSettled)==null||v.call(y,this.state.data,c,this)),this.scheduleGc()};return Q(this,Le,Tp({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,h,y,v;if(c===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(S){l(S);return}(h=(f=N(this,at).config).onSuccess)==null||h.call(f,c,this),(v=(y=N(this,at).config).onSettled)==null||v.call(y,c,this.state.error,this),this.scheduleGc()},onError:l,onFail:(c,f)=>{te(this,xt,Vt).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{te(this,xt,Vt).call(this,{type:"pause"})},onContinue:()=>{te(this,xt,Vt).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),N(this,Le).start()}},Yr=new WeakMap,Kr=new WeakMap,at=new WeakMap,Le=new WeakMap,zo=new WeakMap,tr=new WeakMap,xt=new WeakSet,Vt=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,...Ip(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 su(i)&&i.revert&&N(this,Kr)?{...N(this,Kr),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),Me.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,at).notify({query:this,type:"updated",action:t})})},op);function Ip(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fx(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 jt,sp,dx=(sp=class extends xi{constructor(t={}){super();J(this,jt);this.config=t,Q(this,jt,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??gc(i,n);let s=this.get(o);return s||(s=new cx({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){N(this,jt).has(t.queryHash)||(N(this,jt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,jt).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,jt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,jt).get(t)}getAll(){return[...N(this,jt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Lf(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Lf(t,r)):n}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Me.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Me.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jt=new WeakMap,sp),Rt,Fe,nr,$t,pn,lp,hx=(lp=class extends zp{constructor(t){super();J(this,$t);J(this,Rt);J(this,Fe);J(this,nr);this.mutationId=t.mutationId,Q(this,Fe,t.mutationCache),Q(this,Rt,[]),this.state=t.state||jp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Rt).includes(t)||(N(this,Rt).push(t),this.clearGcTimeout(),N(this,Fe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Rt,N(this,Rt).filter(n=>n!==t)),this.scheduleGc(),N(this,Fe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():N(this,Fe).remove(this))}continue(){var t;return((t=N(this,nr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,l,u,a,d,c,f,h,y,v,S,p,g,m,x,k,z,C;Q(this,nr,Tp({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{te(this,$t,pn).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{te(this,$t,pn).call(this,{type:"pause"})},onContinue:()=>{te(this,$t,pn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Fe).canRun(this)}));const n=this.state.status==="pending",r=!N(this,nr).canStart();try{if(!n){te(this,$t,pn).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=N(this,Fe).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));I!==this.state.context&&te(this,$t,pn).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const M=await N(this,nr).start();return await((a=(u=N(this,Fe).config).onSuccess)==null?void 0:a.call(u,M,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,M,t,this.state.context)),await((h=(f=N(this,Fe).config).onSettled)==null?void 0:h.call(f,M,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,M,null,t,this.state.context)),te(this,$t,pn).call(this,{type:"success",data:M}),M}catch(M){try{throw await((p=(S=N(this,Fe).config).onError)==null?void 0:p.call(S,M,t,this.state.context,this)),await((m=(g=this.options).onError)==null?void 0:m.call(g,M,t,this.state.context)),await((k=(x=N(this,Fe).config).onSettled)==null?void 0:k.call(x,void 0,M,this.state.variables,this.state.context,this)),await((C=(z=this.options).onSettled)==null?void 0:C.call(z,void 0,M,t,this.state.context)),M}finally{te(this,$t,pn).call(this,{type:"error",error:M})}}finally{N(this,Fe).runNext(this)}}},Rt=new WeakMap,Fe=new WeakMap,nr=new WeakMap,$t=new WeakSet,pn=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),Me.batch(()=>{N(this,Rt).forEach(r=>{r.onMutationUpdate(t)}),N(this,Fe).notify({mutation:this,type:"updated",action:t})})},lp);function jp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et,Io,up,px=(up=class extends xi{constructor(t={}){super();J(this,et);J(this,Io);this.config=t,Q(this,et,new Map),Q(this,Io,Date.now())}build(t,n,r){const i=new hx({mutationCache:this,mutationId:++Qo(this,Io)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Xo(t),r=N(this,et).get(n)??[];r.push(t),N(this,et).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Xo(t);if(N(this,et).has(n)){const i=(r=N(this,et).get(n))==null?void 0:r.filter(o=>o!==t);i&&(i.length===0?N(this,et).delete(n):N(this,et).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=N(this,et).get(Xo(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=N(this,et).get(Xo(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...N(this,et).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Of(n,r))}findAll(t={}){return this.getAll().filter(n=>Of(t,n))}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Me.batch(()=>Promise.all(t.map(n=>n.continue().catch(ct))))}},et=new WeakMap,Io=new WeakMap,up);function Xo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Hf(e){return{onFetch:(t,n)=>{var d,c,f,h,y;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const a=async()=>{let v=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},p=Np(t.options,t.fetchOptions),g=async(m,x,k)=>{if(v)return Promise.reject();if(x==null&&m.pages.length)return Promise.resolve(m);const z={queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};S(z);const C=await p(z),{maxPages:M}=t.options,I=k?ox:ix;return{pages:I(m.pages,C,M),pageParams:I(m.pageParams,x,M)}};if(i&&o.length){const m=i==="backward",x=m?mx:Vf,k={pages:o,pageParams:s},z=x(r,k);l=await g(k,z,m)}else{const m=e??o.length;do{const x=u===0?s[0]??r.initialPageParam:Vf(r,l);if(u>0&&x==null)break;l=await g(l,x),u++}while(u<m)}return l};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=a}}}function Vf(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 mx(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,_n,kn,qr,Gr,Cn,Zr,Jr,ap,gx=(ap=class{constructor(e={}){J(this,we);J(this,_n);J(this,kn);J(this,qr);J(this,Gr);J(this,Cn);J(this,Zr);J(this,Jr);Q(this,we,e.queryCache||new dx),Q(this,_n,e.mutationCache||new px),Q(this,kn,e.defaultOptions||{}),Q(this,qr,new Map),Q(this,Gr,new Map),Q(this,Cn,0)}mount(){Qo(this,Cn)._++,N(this,Cn)===1&&(Q(this,Zr,vc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),Q(this,Jr,bs.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;Qo(this,Cn)._--,N(this,Cn)===0&&((e=N(this,Zr))==null||e.call(this),Q(this,Zr,void 0),(t=N(this,Jr))==null||t.call(this),Q(this,Jr,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,_n).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ar(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(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=N(this,we).get(r.queryHash),o=i==null?void 0:i.state.data,s=nx(t,o);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Me.batch(()=>N(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=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Me.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we),r={type:"active",...e};return Me.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Me.batch(()=>N(this,we).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ct).catch(ct)}invalidateQueries(e,t={}){return Me.batch(()=>{if(N(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=Me.batch(()=>N(this,we).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ct)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ct)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(Ar(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ct).catch(ct)}fetchInfiniteQuery(e){return e.behavior=Hf(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ct).catch(ct)}ensureInfiniteQueryData(e){return e.behavior=Hf(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bs.isOnline()?N(this,_n).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,_n)}getDefaultOptions(){return N(this,kn)}setDefaultOptions(e){Q(this,kn,e)}setQueryDefaults(e,t){N(this,qr).set(fr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,qr).values()],n={};return t.forEach(r=>{to(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,Gr).set(fr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Gr).values()];let n={};return t.forEach(r=>{to(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,kn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gc(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===yc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,kn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,_n).clear()}},we=new WeakMap,_n=new WeakMap,kn=new WeakMap,qr=new WeakMap,Gr=new WeakMap,Cn=new WeakMap,Zr=new WeakMap,Jr=new WeakMap,ap),We,ie,jo,He,rr,ei,Nn,Dt,Ro,ti,ni,ir,or,Mn,ri,ae,Li,Wu,Xu,Yu,Ku,qu,Gu,Zu,Rp,cp,yx=(cp=class extends xi{constructor(t,n){super();J(this,ae);J(this,We);J(this,ie);J(this,jo);J(this,He);J(this,rr);J(this,ei);J(this,Nn);J(this,Dt);J(this,Ro);J(this,ti);J(this,ni);J(this,ir);J(this,or);J(this,Mn);J(this,ri,new Set);this.options=n,Q(this,We,t),Q(this,Dt,null),Q(this,Nn,Qu()),this.options.experimental_prefetchInRender||N(this,Nn).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&&(N(this,ie).addObserver(this),Bf(N(this,ie),this.options)?te(this,ae,Li).call(this):this.updateResult(),te(this,ae,Ku).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ju(N(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ju(N(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,ae,qu).call(this),te(this,ae,Gu).call(this),N(this,ie).removeObserver(this)}setOptions(t,n){const r=this.options,i=N(this,ie);if(this.options=N(this,We).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Et(this.options.enabled,N(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,ae,Zu).call(this),N(this,ie).setOptions(this.options),r._defaulted&&!Os(this.options,r)&&N(this,We).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,ie),observer:this});const o=this.hasListeners();o&&Uf(N(this,ie),i,this.options,r)&&te(this,ae,Li).call(this),this.updateResult(n),o&&(N(this,ie)!==i||Et(this.options.enabled,N(this,ie))!==Et(r.enabled,N(this,ie))||Ar(this.options.staleTime,N(this,ie))!==Ar(r.staleTime,N(this,ie)))&&te(this,ae,Wu).call(this);const s=te(this,ae,Xu).call(this);o&&(N(this,ie)!==i||Et(this.options.enabled,N(this,ie))!==Et(r.enabled,N(this,ie))||s!==N(this,Mn))&&te(this,ae,Yu).call(this,s)}getOptimisticResult(t){const n=N(this,We).getQueryCache().build(N(this,We),t),r=this.createResult(n,t);return xx(this,r)&&(Q(this,He,r),Q(this,ei,this.options),Q(this,rr,N(this,ie).state)),r}getCurrentResult(){return N(this,He)}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){N(this,ri).add(t)}getCurrentQuery(){return N(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,We).defaultQueryOptions(t),r=N(this,We).getQueryCache().build(N(this,We),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return te(this,ae,Li).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,He)))}createResult(t,n){var M;const r=N(this,ie),i=this.options,o=N(this,He),s=N(this,rr),l=N(this,ei),a=t!==r?t.state:N(this,jo),{state:d}=t;let c={...d},f=!1,h;if(n._optimisticResults){const I=this.hasListeners(),j=!I&&Bf(t,n),L=I&&Uf(t,r,n,i);(j||L)&&(c={...c,...Ip(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:S}=c;if(n.select&&c.data!==void 0)if(o&&c.data===(s==null?void 0:s.data)&&n.select===N(this,Ro))h=N(this,ti);else try{Q(this,Ro,n.select),h=n.select(c.data),h=Uu(o==null?void 0:o.data,h,n),Q(this,ti,h),Q(this,Dt,null)}catch(I){Q(this,Dt,I)}else h=c.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let I;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))I=o.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((M=N(this,ni))==null?void 0:M.state.data,N(this,ni)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),Q(this,Dt,null)}catch(j){Q(this,Dt,j)}I!==void 0&&(S="success",h=Uu(o==null?void 0:o.data,I,n),f=!0)}N(this,Dt)&&(y=N(this,Dt),h=N(this,ti),v=Date.now(),S="error");const p=c.fetchStatus==="fetching",g=S==="pending",m=S==="error",x=g&&p,k=h!==void 0,C={status:S,fetchStatus:c.fetchStatus,isPending:g,isSuccess:S==="success",isError:m,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!g,isLoadingError:m&&!k,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:m&&k,isStale:xc(t,n),refetch:this.refetch,promise:N(this,Nn)};if(this.options.experimental_prefetchInRender){const I=F=>{C.status==="error"?F.reject(C.error):C.data!==void 0&&F.resolve(C.data)},j=()=>{const F=Q(this,Nn,C.promise=Qu());I(F)},L=N(this,Nn);switch(L.status){case"pending":t.queryHash===r.queryHash&&I(L);break;case"fulfilled":(C.status==="error"||C.data!==L.value)&&j();break;case"rejected":(C.status!=="error"||C.error!==L.reason)&&j();break}}return C}updateResult(t){const n=N(this,He),r=this.createResult(N(this,ie),this.options);if(Q(this,rr,N(this,ie).state),Q(this,ei,this.options),N(this,rr).data!==void 0&&Q(this,ni,N(this,ie)),Os(r,n))return;Q(this,He,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!N(this,ri).size)return!0;const u=new Set(l??N(this,ri));return this.options.throwOnError&&u.add("error"),Object.keys(N(this,He)).some(a=>{const d=a;return N(this,He)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),te(this,ae,Rp).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,ae,Ku).call(this)}},We=new WeakMap,ie=new WeakMap,jo=new WeakMap,He=new WeakMap,rr=new WeakMap,ei=new WeakMap,Nn=new WeakMap,Dt=new WeakMap,Ro=new WeakMap,ti=new WeakMap,ni=new WeakMap,ir=new WeakMap,or=new WeakMap,Mn=new WeakMap,ri=new WeakMap,ae=new WeakSet,Li=function(t){te(this,ae,Zu).call(this);let n=N(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ct)),n},Wu=function(){te(this,ae,qu).call(this);const t=Ar(this.options.staleTime,N(this,ie));if(cr||N(this,He).isStale||!Vu(t))return;const r=kp(N(this,He).dataUpdatedAt,t)+1;Q(this,ir,setTimeout(()=>{N(this,He).isStale||this.updateResult()},r))},Xu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,ie)):this.options.refetchInterval)??!1},Yu=function(t){te(this,ae,Gu).call(this),Q(this,Mn,t),!(cr||Et(this.options.enabled,N(this,ie))===!1||!Vu(N(this,Mn))||N(this,Mn)===0)&&Q(this,or,setInterval(()=>{(this.options.refetchIntervalInBackground||vc.isFocused())&&te(this,ae,Li).call(this)},N(this,Mn)))},Ku=function(){te(this,ae,Wu).call(this),te(this,ae,Yu).call(this,te(this,ae,Xu).call(this))},qu=function(){N(this,ir)&&(clearTimeout(N(this,ir)),Q(this,ir,void 0))},Gu=function(){N(this,or)&&(clearInterval(N(this,or)),Q(this,or,void 0))},Zu=function(){const t=N(this,We).getQueryCache().build(N(this,We),this.options);if(t===N(this,ie))return;const n=N(this,ie);Q(this,ie,t),Q(this,jo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Rp=function(t){Me.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,He))}),N(this,We).getQueryCache().notify({query:N(this,ie),type:"observerResultsUpdated"})})},cp);function vx(e,t){return Et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Bf(e,t){return vx(e,t)||e.state.data!==void 0&&Ju(e,t,t.refetchOnMount)}function Ju(e,t,n){if(Et(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xc(e,t)}return!1}function Uf(e,t,n,r){return(e!==t||Et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xc(e,n)}function xc(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(Ar(t.staleTime,e))}function xx(e,t){return!Os(e.getCurrentResult(),t)}var Pn,Tn,Xe,Qt,Zt,Es,ea,fp,wx=(fp=class extends xi{constructor(n,r){super();J(this,Zt);J(this,Pn);J(this,Tn);J(this,Xe);J(this,Qt);Q(this,Pn,n),this.setOptions(r),this.bindMethods(),te(this,Zt,Es).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=N(this,Pn).defaultMutationOptions(n),Os(this.options,r)||N(this,Pn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Xe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&fr(r.mutationKey)!==fr(this.options.mutationKey)?this.reset():((i=N(this,Xe))==null?void 0:i.state.status)==="pending"&&N(this,Xe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=N(this,Xe))==null||n.removeObserver(this)}onMutationUpdate(n){te(this,Zt,Es).call(this),te(this,Zt,ea).call(this,n)}getCurrentResult(){return N(this,Tn)}reset(){var n;(n=N(this,Xe))==null||n.removeObserver(this),Q(this,Xe,void 0),te(this,Zt,Es).call(this),te(this,Zt,ea).call(this)}mutate(n,r){var i;return Q(this,Qt,r),(i=N(this,Xe))==null||i.removeObserver(this),Q(this,Xe,N(this,Pn).getMutationCache().build(N(this,Pn),this.options)),N(this,Xe).addObserver(this),N(this,Xe).execute(n)}},Pn=new WeakMap,Tn=new WeakMap,Xe=new WeakMap,Qt=new WeakMap,Zt=new WeakSet,Es=function(){var r;const n=((r=N(this,Xe))==null?void 0:r.state)??jp();Q(this,Tn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ea=function(n){Me.batch(()=>{var r,i,o,s,l,u,a,d;if(N(this,Qt)&&this.hasListeners()){const c=N(this,Tn).variables,f=N(this,Tn).context;(n==null?void 0:n.type)==="success"?((i=(r=N(this,Qt)).onSuccess)==null||i.call(r,n.data,c,f),(s=(o=N(this,Qt)).onSettled)==null||s.call(o,n.data,null,c,f)):(n==null?void 0:n.type)==="error"&&((u=(l=N(this,Qt)).onError)==null||u.call(l,n.error,c,f),(d=(a=N(this,Qt)).onSettled)==null||d.call(a,void 0,n.error,c,f))}this.listeners.forEach(c=>{c(N(this,Tn))})})},fp),$p=D.createContext(void 0),wc=e=>{const t=D.useContext($p);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sx=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx($p.Provider,{value:e,children:t})),Dp=D.createContext(!1),Ex=()=>D.useContext(Dp);Dp.Provider;function _x(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kx=D.createContext(_x()),Cx=()=>D.useContext(kx);function Ap(e,t){return typeof e=="function"?e(...t):!!e}function ta(){}var Nx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Mx=e=>{D.useEffect(()=>{e.clearReset()},[e])},Px=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Ap(n,[e.error,r]),Tx=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},zx=(e,t)=>e.isLoading&&e.isFetching&&!t,Ix=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Qf=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jx(e,t,n){var d,c,f,h,y;const r=wc(),i=Ex(),o=Cx(),s=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",Tx(s),Nx(s,o),Mx(o);const l=!r.getQueryCache().get(s.queryHash),[u]=D.useState(()=>new t(r,s)),a=u.getOptimisticResult(s);if(D.useSyncExternalStore(D.useCallback(v=>{const S=i?ta:u.subscribe(Me.batchCalls(v));return u.updateResult(),S},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),D.useEffect(()=>{u.setOptions(s,{listeners:!1})},[s,u]),Ix(s,a))throw Qf(s,u,o);if(Px({result:a,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw a.error;if((h=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||h.call(f,s,a),s.experimental_prefetchInRender&&!cr&&zx(a,i)){const v=l?Qf(s,u,o):(y=r.getQueryCache().get(s.queryHash))==null?void 0:y.promise;v==null||v.catch(ta).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?a:u.trackResult(a)}function Lp(e,t){return jx(e,yx)}function Wf(e,t){const n=wc(),[r]=D.useState(()=>new wx(n,e));D.useEffect(()=>{r.setOptions(e)},[r,e]);const i=D.useSyncExternalStore(D.useCallback(s=>r.subscribe(Me.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=D.useCallback((s,l)=>{r.mutate(s,l).catch(ta)},[r]);if(i.error&&Ap(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Op={exports:{}},lt={},bp={exports:{}},Fp={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ var Rf=e=>{throw TypeError(e)};var iu=(e,t,n)=>t.has(e)||Rf("Cannot "+n);var N=(
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(_,P){var R=_.length;_.push(P);e:for(;0<R;){var O=R-1>>>1,H=_[O];if(0<i(H,P))_[O]=P,_[R]=H,R=O;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var P=_[0],R=_.pop();if(R!==P){_[0]=R;e:for(var O=0,H=_.length,K=H>>>1;O<K;){var U=2*(O+1)-1,Y=_[U],X=U+1,G=_[X];if(0>i(Y,R))X<H&&0>i(G,Y)?(_[O]=G,_[X]=R,O=X):(_[O]=Y,_[U]=R,O=U);else if(X<H&&0>i(G,R))_[O]=G,_[X]=R,O=X;else break e}}return P}function i(_,P){var R=_.sortIndex-P.sortIndex;return R!==0?R:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],d=1,c=null,f=3,h=!1,y=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(_){for(var P=n(a);P!==null;){if(P.callback===null)r(a);else if(P.startTime<=_)r(a),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(a)}}function x(_){if(v=!1,m(_),!y)if(n(u)!==null)y=!0,T(k);else{var P=n(a);P!==null&&L(x,P.startTime-_)}}function k(_,P){y=!1,v&&(v=!1,p(M),M=-1),h=!0;var R=f;try{for(m(P),c=n(u);c!==null&&(!(c.expirationTime>P)||_&&!A());){var O=c.callback;if(typeof O=="function"){c.callback=null,f=c.priorityLevel;var H=O(c.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(u)&&r(u),m(P)}else r(u);c=n(u)}if(c!==null)var K=!0;else{var U=n(a);U!==null&&L(x,U.startTime-P),K=!1}return K}finally{c=null,f=R,h=!1}}var z=!1,C=null,M=-1,I=5,j=-1;function A(){return!(e.unstable_now()-j<I)}function F(){if(C!==null){var _=e.unstable_now();j=_;var P=!0;try{P=C(!0,_)}finally{P?b():(z=!1,C=null)}}else z=!1}var b;if(typeof g=="function")b=function(){g(F)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=F,b=function(){$.postMessage(null)}}else b=function(){S(F,0)};function T(_){C=_,z||(z=!0,b())}function L(_,P){M=S(function(){_(e.unstable_now())},P)}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(_){_.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,T(k))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var R=f;f=P;try{return _()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var R=f;f=_;try{return P()}finally{f=R}},e.unstable_scheduleCallback=function(_,P,R){var O=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?O+R:O):R=O,_){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=R+H,_={id:d++,callback:P,priorityLevel:_,startTime:R,expirationTime:H,sortIndex:-1},R>O?(_.sortIndex=R,t(a,_),n(u)===null&&_===n(a)&&(v?(p(M),M=-1):v=!0,L(x,R-O))):(_.sortIndex=H,t(u,_),y||h||(y=!0,T(k))),_},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(_){var P=f;return function(){var R=f;f=P;try{return _.apply(this,arguments)}finally{f=R}}}})(Fp);bp.exports=Fp;var jx=bp.exports;/**
25
+ */(function(e){function t(_,P){var R=_.length;_.push(P);e:for(;0<R;){var O=R-1>>>1,H=_[O];if(0<i(H,P))_[O]=P,_[R]=H,R=O;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var P=_[0],R=_.pop();if(R!==P){_[0]=R;e:for(var O=0,H=_.length,K=H>>>1;O<K;){var U=2*(O+1)-1,Y=_[U],X=U+1,G=_[X];if(0>i(Y,R))X<H&&0>i(G,Y)?(_[O]=G,_[X]=R,O=X):(_[O]=Y,_[U]=R,O=U);else if(X<H&&0>i(G,R))_[O]=G,_[X]=R,O=X;else break e}}return P}function i(_,P){var R=_.sortIndex-P.sortIndex;return R!==0?R:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],d=1,c=null,f=3,h=!1,y=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(_){for(var P=n(a);P!==null;){if(P.callback===null)r(a);else if(P.startTime<=_)r(a),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(a)}}function x(_){if(v=!1,m(_),!y)if(n(u)!==null)y=!0,T(k);else{var P=n(a);P!==null&&A(x,P.startTime-_)}}function k(_,P){y=!1,v&&(v=!1,p(M),M=-1),h=!0;var R=f;try{for(m(P),c=n(u);c!==null&&(!(c.expirationTime>P)||_&&!L());){var O=c.callback;if(typeof O=="function"){c.callback=null,f=c.priorityLevel;var H=O(c.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(u)&&r(u),m(P)}else r(u);c=n(u)}if(c!==null)var K=!0;else{var U=n(a);U!==null&&A(x,U.startTime-P),K=!1}return K}finally{c=null,f=R,h=!1}}var z=!1,C=null,M=-1,I=5,j=-1;function L(){return!(e.unstable_now()-j<I)}function F(){if(C!==null){var _=e.unstable_now();j=_;var P=!0;try{P=C(!0,_)}finally{P?b():(z=!1,C=null)}}else z=!1}var b;if(typeof g=="function")b=function(){g(F)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=F,b=function(){$.postMessage(null)}}else b=function(){S(F,0)};function T(_){C=_,z||(z=!0,b())}function A(_,P){M=S(function(){_(e.unstable_now())},P)}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(_){_.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,T(k))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var R=f;f=P;try{return _()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var R=f;f=_;try{return P()}finally{f=R}},e.unstable_scheduleCallback=function(_,P,R){var O=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?O+R:O):R=O,_){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=R+H,_={id:d++,callback:P,priorityLevel:_,startTime:R,expirationTime:H,sortIndex:-1},R>O?(_.sortIndex=R,t(a,_),n(u)===null&&_===n(a)&&(v?(p(M),M=-1):v=!0,A(x,R-O))):(_.sortIndex=H,t(u,_),y||h||(y=!0,T(k))),_},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(_){var P=f;return function(){var R=f;f=P;try{return _.apply(this,arguments)}finally{f=R}}}})(Fp);bp.exports=Fp;var Rx=bp.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ var Rf=e=>{throw TypeError(e)};var iu=(e,t,n)=>t.has(e)||Rf("Cannot "+n);var N=(
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Rx=D,ot=jx;function V(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 Hp=new Set,no={};function xr(e,t){ii(e,t),ii(e+"Capture",t)}function ii(e,t){for(no[e]=t,e=0;e<t.length;e++)Hp.add(t[e])}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),na=Object.prototype.hasOwnProperty,$x=/^[: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]*$/,Xf={},Yf={};function Dx(e){return na.call(Yf,e)?!0:na.call(Xf,e)?!1:$x.test(e)?Yf[e]=!0:(Xf[e]=!0,!1)}function Lx(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 Ax(e,t,n,r){if(t===null||typeof t>"u"||Lx(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 Qe(e,t,n,r,i,o,s){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=o,this.removeEmptyString=s}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Qe(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 Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Qe(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 Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sc=/[\-:]([a-z])/g;function Ec(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(Sc,Ec);Re[t]=new Qe(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(Sc,Ec);Re[t]=new Qe(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(Sc,Ec);Re[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function _c(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")&&(Ax(t,n,i,r)&&(n=null),r||i===null?Dx(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 on=Rx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Yo=Symbol.for("react.element"),Er=Symbol.for("react.portal"),_r=Symbol.for("react.fragment"),kc=Symbol.for("react.strict_mode"),ra=Symbol.for("react.profiler"),Vp=Symbol.for("react.provider"),Bp=Symbol.for("react.context"),Cc=Symbol.for("react.forward_ref"),ia=Symbol.for("react.suspense"),oa=Symbol.for("react.suspense_list"),Nc=Symbol.for("react.memo"),pn=Symbol.for("react.lazy"),Up=Symbol.for("react.offscreen"),Kf=Symbol.iterator;function Mi(e){return e===null||typeof e!="object"?null:(e=Kf&&e[Kf]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,lu;function Oi(e){if(lu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lu=t&&t[1]||""}return`
33
+ */var $x=D,ot=Rx;function V(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 Hp=new Set,no={};function xr(e,t){ii(e,t),ii(e+"Capture",t)}function ii(e,t){for(no[e]=t,e=0;e<t.length;e++)Hp.add(t[e])}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),na=Object.prototype.hasOwnProperty,Dx=/^[: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]*$/,Xf={},Yf={};function Ax(e){return na.call(Yf,e)?!0:na.call(Xf,e)?!1:Dx.test(e)?Yf[e]=!0:(Xf[e]=!0,!1)}function Lx(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 Ox(e,t,n,r){if(t===null||typeof t>"u"||Lx(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 Qe(e,t,n,r,i,o,s){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=o,this.removeEmptyString=s}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Qe(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 Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Qe(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 Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sc=/[\-:]([a-z])/g;function Ec(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(Sc,Ec);Re[t]=new Qe(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(Sc,Ec);Re[t]=new Qe(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(Sc,Ec);Re[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function _c(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")&&(Ox(t,n,i,r)&&(n=null),r||i===null?Ax(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 on=$x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Yo=Symbol.for("react.element"),Er=Symbol.for("react.portal"),_r=Symbol.for("react.fragment"),kc=Symbol.for("react.strict_mode"),ra=Symbol.for("react.profiler"),Vp=Symbol.for("react.provider"),Bp=Symbol.for("react.context"),Cc=Symbol.for("react.forward_ref"),ia=Symbol.for("react.suspense"),oa=Symbol.for("react.suspense_list"),Nc=Symbol.for("react.memo"),mn=Symbol.for("react.lazy"),Up=Symbol.for("react.offscreen"),Kf=Symbol.iterator;function Mi(e){return e===null||typeof e!="object"?null:(e=Kf&&e[Kf]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,lu;function Oi(e){if(lu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lu=t&&t[1]||""}return`
34
34
  `+lu+e}var uu=!1;function au(e,t){if(!e||uu)return"";uu=!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(a){var r=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){r=a}e.call(t.prototype)}else{try{throw Error()}catch(a){r=a}e()}}catch(a){if(a&&r&&typeof a.stack=="string"){for(var i=a.stack.split(`
35
35
  `),o=r.stack.split(`
36
36
  `),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==o[l]){var u=`
37
- `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{uu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Oi(e):""}function Ox(e){switch(e.tag){case 5:return Oi(e.type);case 16:return Oi("Lazy");case 13:return Oi("Suspense");case 19:return Oi("SuspenseList");case 0:case 2:case 15:return e=au(e.type,!1),e;case 11:return e=au(e.type.render,!1),e;case 1:return e=au(e.type,!0),e;default:return""}}function sa(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 _r:return"Fragment";case Er:return"Portal";case ra:return"Profiler";case kc:return"StrictMode";case ia:return"Suspense";case oa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bp:return(e.displayName||"Context")+".Consumer";case Vp:return(e._context.displayName||"Context")+".Provider";case Cc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nc:return t=e.displayName||null,t!==null?t:sa(e.type)||"Memo";case pn:t=e._payload,e=e._init;try{return sa(e(t))}catch{}}return null}function bx(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 sa(t);case 8:return t===kc?"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 bn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fx(e){var t=Qp(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){e._valueTracker||(e._valueTracker=Fx(e))}function Wp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(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 la(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=bn(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 Xp(e,t){t=t.checked,t!=null&&_c(e,"checked",t,!1)}function ua(e,t){Xp(e,t);var n=bn(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")?aa(e,t.type,n):t.hasOwnProperty("defaultValue")&&aa(e,t.type,bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gf(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 aa(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bi=Array.isArray;function Ar(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=""+bn(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 ca(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(bi(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:bn(n)}}function Yp(e,t){var n=bn(t.value),r=bn(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 Jf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kp(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 fa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qo,qp=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(qo=qo||document.createElement("div"),qo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ro(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ui={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},Hx=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(e){Hx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ui[t]=Ui[e]})});function Gp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ui.hasOwnProperty(e)&&Ui[e]?(""+t).trim():t+"px"}function Zp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Gp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Vx=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 da(e,t){if(t){if(Vx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function ha(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 pa=null;function Mc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ma=null,Or=null,br=null;function ed(e){if(e=Ao(e)){if(typeof ma!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Cl(t),ma(e.stateNode,e.type,t))}}function Jp(e){Or?br?br.push(e):br=[e]:Or=e}function em(){if(Or){var e=Or,t=br;if(br=Or=null,ed(e),t)for(e=0;e<t.length;e++)ed(t[e])}}function tm(e,t){return e(t)}function nm(){}var cu=!1;function rm(e,t,n){if(cu)return e(t,n);cu=!0;try{return tm(e,t,n)}finally{cu=!1,(Or!==null||br!==null)&&(nm(),em())}}function io(e,t){var n=e.stateNode;if(n===null)return null;var r=Cl(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(V(231,t,typeof n));return n}var ga=!1;if(Jt)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){ga=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{ga=!1}function Bx(e,t,n,r,i,o,s,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(d){this.onError(d)}}var Qi=!1,Hs=null,Vs=!1,ya=null,Ux={onError:function(e){Qi=!0,Hs=e}};function Qx(e,t,n,r,i,o,s,l,u){Qi=!1,Hs=null,Bx.apply(Ux,arguments)}function Wx(e,t,n,r,i,o,s,l,u){if(Qx.apply(this,arguments),Qi){if(Qi){var a=Hs;Qi=!1,Hs=null}else throw Error(V(198));Vs||(Vs=!0,ya=a)}}function wr(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 im(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 td(e){if(wr(e)!==e)throw Error(V(188))}function Xx(e){var t=e.alternate;if(!t){if(t=wr(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return td(i),e;if(o===r)return td(i),t;o=o.sibling}throw Error(V(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function om(e){return e=Xx(e),e!==null?sm(e):null}function sm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sm(e);if(t!==null)return t;e=e.sibling}return null}var lm=ot.unstable_scheduleCallback,nd=ot.unstable_cancelCallback,Yx=ot.unstable_shouldYield,Kx=ot.unstable_requestPaint,_e=ot.unstable_now,qx=ot.unstable_getCurrentPriorityLevel,Pc=ot.unstable_ImmediatePriority,um=ot.unstable_UserBlockingPriority,Bs=ot.unstable_NormalPriority,Gx=ot.unstable_LowPriority,am=ot.unstable_IdlePriority,Sl=null,At=null;function Zx(e){if(At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Sl,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:tw,Jx=Math.log,ew=Math.LN2;function tw(e){return e>>>=0,e===0?32:31-(Jx(e)/ew|0)|0}var Go=64,Zo=4194304;function Fi(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 Us(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Fi(l):(o&=s,o!==0&&(r=Fi(o)))}else s=n&~i,s!==0?r=Fi(s):o!==0&&(r=Fi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),i=1<<n,r|=e[n],t&=~i;return r}function nw(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,o=e.pendingLanes;0<o;){var s=31-Nt(o),l=1<<s,u=i[s];u===-1?(!(l&n)||l&r)&&(i[s]=nw(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function va(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cm(){var e=Go;return Go<<=1,!(Go&4194240)&&(Go=64),e}function fu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Do(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function iw(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-Nt(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function Tc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ce=0;function fm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dm,zc,hm,pm,mm,xa=!1,Jo=[],In=null,jn=null,Rn=null,oo=new Map,so=new Map,yn=[],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 rd(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":jn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(t.pointerId)}}function Ti(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Ao(t),t!==null&&zc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function sw(e,t,n,r,i){switch(t){case"focusin":return In=Ti(In,e,t,n,r,i),!0;case"dragenter":return jn=Ti(jn,e,t,n,r,i),!0;case"mouseover":return Rn=Ti(Rn,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return oo.set(o,Ti(oo.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,so.set(o,Ti(so.get(o)||null,e,t,n,r,i)),!0}return!1}function gm(e){var t=Kn(e.target);if(t!==null){var n=wr(t);if(n!==null){if(t=n.tag,t===13){if(t=im(n),t!==null){e.blockedOn=t,mm(e.priority,function(){hm(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 _s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pa=r,n.target.dispatchEvent(r),pa=null}else return t=Ao(n),t!==null&&zc(t),e.blockedOn=n,!1;t.shift()}return!0}function id(e,t,n){_s(e)&&n.delete(t)}function lw(){xa=!1,In!==null&&_s(In)&&(In=null),jn!==null&&_s(jn)&&(jn=null),Rn!==null&&_s(Rn)&&(Rn=null),oo.forEach(id),so.forEach(id)}function zi(e,t){e.blockedOn===t&&(e.blockedOn=null,xa||(xa=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,lw)))}function lo(e){function t(i){return zi(i,e)}if(0<Jo.length){zi(Jo[0],e);for(var n=1;n<Jo.length;n++){var r=Jo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&zi(In,e),jn!==null&&zi(jn,e),Rn!==null&&zi(Rn,e),oo.forEach(t),so.forEach(t),n=0;n<yn.length;n++)r=yn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<yn.length&&(n=yn[0],n.blockedOn===null);)gm(n),n.blockedOn===null&&yn.shift()}var Fr=on.ReactCurrentBatchConfig,Qs=!0;function uw(e,t,n,r){var i=ce,o=Fr.transition;Fr.transition=null;try{ce=1,Ic(e,t,n,r)}finally{ce=i,Fr.transition=o}}function aw(e,t,n,r){var i=ce,o=Fr.transition;Fr.transition=null;try{ce=4,Ic(e,t,n,r)}finally{ce=i,Fr.transition=o}}function Ic(e,t,n,r){if(Qs){var i=wa(e,t,n,r);if(i===null)Su(e,t,r,Ws,n),rd(e,r);else if(sw(i,e,t,n,r))r.stopPropagation();else if(rd(e,r),t&4&&-1<ow.indexOf(e)){for(;i!==null;){var o=Ao(i);if(o!==null&&dm(o),o=wa(e,t,n,r),o===null&&Su(e,t,r,Ws,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Su(e,t,r,null,n)}}var Ws=null;function wa(e,t,n,r){if(Ws=null,e=Mc(r),e=Kn(e),e!==null)if(t=wr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=im(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 Ws=e,null}function ym(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(qx()){case Pc:return 1;case um:return 4;case Bs:case Gx:return 16;case am:return 536870912;default:return 16}default:return 16}}var Tn=null,jc=null,ks=null;function vm(){if(ks)return ks;var e,t=jc,n=t.length,r,i="value"in Tn?Tn.value:Tn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return ks=i.slice(e,1<r?1-r:void 0)}function Cs(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 es(){return!0}function od(){return!1}function ut(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?es:od,this.isPropagationStopped=od,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=es)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=es)},persist:function(){},isPersistent:es}),t}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rc=ut(wi),Lo=xe({},wi,{view:0,detail:0}),cw=ut(Lo),du,hu,Ii,El=xe({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$c,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!==Ii&&(Ii&&e.type==="mousemove"?(du=e.screenX-Ii.screenX,hu=e.screenY-Ii.screenY):hu=du=0,Ii=e),du)},movementY:function(e){return"movementY"in e?e.movementY:hu}}),sd=ut(El),fw=xe({},El,{dataTransfer:0}),dw=ut(fw),hw=xe({},Lo,{relatedTarget:0}),pu=ut(hw),pw=xe({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),mw=ut(pw),gw=xe({},wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yw=ut(gw),vw=xe({},wi,{data:0}),ld=ut(vw),xw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ww={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"},Sw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ew(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sw[e])?!!t[e]:!1}function $c(){return Ew}var _w=xe({},Lo,{key:function(e){if(e.key){var t=xw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ww[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$c,charCode:function(e){return e.type==="keypress"?Cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kw=ut(_w),Cw=xe({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ud=ut(Cw),Nw=xe({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$c}),Mw=ut(Nw),Pw=xe({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tw=ut(Pw),zw=xe({},El,{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}),Iw=ut(zw),jw=[9,13,27,32],Dc=Jt&&"CompositionEvent"in window,Wi=null;Jt&&"documentMode"in document&&(Wi=document.documentMode);var Rw=Jt&&"TextEvent"in window&&!Wi,xm=Jt&&(!Dc||Wi&&8<Wi&&11>=Wi),ad=" ",cd=!1;function wm(e,t){switch(e){case"keyup":return jw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kr=!1;function $w(e,t){switch(e){case"compositionend":return Sm(t);case"keypress":return t.which!==32?null:(cd=!0,ad);case"textInput":return e=t.data,e===ad&&cd?null:e;default:return null}}function Dw(e,t){if(kr)return e==="compositionend"||!Dc&&wm(e,t)?(e=vm(),ks=jc=Tn=null,kr=!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 xm&&t.locale!=="ko"?null:t.data;default:return null}}var Lw={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 fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lw[e.type]:t==="textarea"}function Em(e,t,n,r){Jp(r),t=Xs(t,"onChange"),0<t.length&&(n=new Rc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xi=null,uo=null;function Aw(e){Rm(e,0)}function _l(e){var t=Mr(e);if(Wp(t))return e}function Ow(e,t){if(e==="change")return t}var _m=!1;if(Jt){var mu;if(Jt){var gu="oninput"in document;if(!gu){var dd=document.createElement("div");dd.setAttribute("oninput","return;"),gu=typeof dd.oninput=="function"}mu=gu}else mu=!1;_m=mu&&(!document.documentMode||9<document.documentMode)}function hd(){Xi&&(Xi.detachEvent("onpropertychange",km),uo=Xi=null)}function km(e){if(e.propertyName==="value"&&_l(uo)){var t=[];Em(t,uo,e,Mc(e)),rm(Aw,t)}}function bw(e,t,n){e==="focusin"?(hd(),Xi=t,uo=n,Xi.attachEvent("onpropertychange",km)):e==="focusout"&&hd()}function Fw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _l(uo)}function Hw(e,t){if(e==="click")return _l(t)}function Vw(e,t){if(e==="input"||e==="change")return _l(t)}function Bw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Bw;function ao(e,t){if(Pt(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(!na.call(t,i)||!Pt(e[i],t[i]))return!1}return!0}function pd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function md(e,t){var n=pd(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=pd(n)}}function Cm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nm(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Lc(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 Uw(e){var t=Nm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cm(n.ownerDocument.documentElement,n)){if(r!==null&&Lc(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,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=md(n,o);var s=md(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 Qw=Jt&&"documentMode"in document&&11>=document.documentMode,Cr=null,Sa=null,Yi=null,Ea=!1;function gd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ea||Cr==null||Cr!==Fs(r)||(r=Cr,"selectionStart"in r&&Lc(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}),Yi&&ao(Yi,r)||(Yi=r,r=Xs(Sa,"onSelect"),0<r.length&&(t=new Rc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function ts(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Nr={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionend:ts("Transition","TransitionEnd")},yu={},Mm={};Jt&&(Mm=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function kl(e){if(yu[e])return yu[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mm)return yu[e]=t[n];return e}var Pm=kl("animationend"),Tm=kl("animationiteration"),zm=kl("animationstart"),Im=kl("transitionend"),jm=new Map,yd="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 Vn(e,t){jm.set(e,t),xr(t,[e])}for(var vu=0;vu<yd.length;vu++){var xu=yd[vu],Ww=xu.toLowerCase(),Xw=xu[0].toUpperCase()+xu.slice(1);Vn(Ww,"on"+Xw)}Vn(Pm,"onAnimationEnd");Vn(Tm,"onAnimationIteration");Vn(zm,"onAnimationStart");Vn("dblclick","onDoubleClick");Vn("focusin","onFocus");Vn("focusout","onBlur");Vn(Im,"onTransitionEnd");ii("onMouseEnter",["mouseout","mouseover"]);ii("onMouseLeave",["mouseout","mouseover"]);ii("onPointerEnter",["pointerout","pointerover"]);ii("onPointerLeave",["pointerout","pointerover"]);xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),Yw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hi));function vd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Wx(r,t,void 0,e),e.currentTarget=null}function Rm(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 o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==o&&i.isPropagationStopped())break e;vd(i,l,a),o=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,a=l.currentTarget,l=l.listener,u!==o&&i.isPropagationStopped())break e;vd(i,l,a),o=u}}}if(Vs)throw e=ya,Vs=!1,ya=null,e}function he(e,t){var n=t[Ma];n===void 0&&(n=t[Ma]=new Set);var r=e+"__bubble";n.has(r)||($m(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),$m(n,e,r,t)}var ns="_reactListening"+Math.random().toString(36).slice(2);function co(e){if(!e[ns]){e[ns]=!0,Hp.forEach(function(n){n!=="selectionchange"&&(Yw.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ns]||(t[ns]=!0,wu("selectionchange",!1,t))}}function $m(e,t,n,r){switch(ym(t)){case 1:var i=uw;break;case 4:i=aw;break;default:i=Ic}n=i.bind(null,t,n,e),i=void 0,!ga||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 Su(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Kn(l),s===null)return;if(u=s.tag,u===5||u===6){r=o=s;continue e}l=l.parentNode}}r=r.return}rm(function(){var a=o,d=Mc(n),c=[];e:{var f=jm.get(e);if(f!==void 0){var h=Rc,y=e;switch(e){case"keypress":if(Cs(n)===0)break e;case"keydown":case"keyup":h=kw;break;case"focusin":y="focus",h=pu;break;case"focusout":y="blur",h=pu;break;case"beforeblur":case"afterblur":h=pu;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=sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=dw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Mw;break;case Pm:case Tm:case zm:h=mw;break;case Im:h=Tw;break;case"scroll":h=cw;break;case"wheel":h=Iw;break;case"copy":case"cut":case"paste":h=yw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ud}var v=(t&4)!==0,S=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var g=a,m;g!==null;){m=g;var x=m.stateNode;if(m.tag===5&&x!==null&&(m=x,p!==null&&(x=io(g,p),x!=null&&v.push(fo(g,x,m)))),S)break;g=g.return}0<v.length&&(f=new h(f,y,null,n,d),c.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==pa&&(y=n.relatedTarget||n.fromElement)&&(Kn(y)||y[en]))break e;if((h||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=a,y=y?Kn(y):null,y!==null&&(S=wr(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=a),h!==y)){if(v=sd,x="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=ud,x="onPointerLeave",p="onPointerEnter",g="pointer"),S=h==null?f:Mr(h),m=y==null?f:Mr(y),f=new v(x,g+"leave",h,n,d),f.target=S,f.relatedTarget=m,x=null,Kn(d)===a&&(v=new v(p,g+"enter",y,n,d),v.target=m,v.relatedTarget=S,x=v),S=x,h&&y)t:{for(v=h,p=y,g=0,m=v;m;m=Sr(m))g++;for(m=0,x=p;x;x=Sr(x))m++;for(;0<g-m;)v=Sr(v),g--;for(;0<m-g;)p=Sr(p),m--;for(;g--;){if(v===p||p!==null&&v===p.alternate)break t;v=Sr(v),p=Sr(p)}v=null}else v=null;h!==null&&xd(c,f,h,v,!1),y!==null&&S!==null&&xd(c,S,y,v,!0)}}e:{if(f=a?Mr(a):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=Ow;else if(fd(f))if(_m)k=Vw;else{k=Fw;var z=bw}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Hw);if(k&&(k=k(e,a))){Em(c,k,n,d);break e}z&&z(e,f,a),e==="focusout"&&(z=f._wrapperState)&&z.controlled&&f.type==="number"&&aa(f,"number",f.value)}switch(z=a?Mr(a):window,e){case"focusin":(fd(z)||z.contentEditable==="true")&&(Cr=z,Sa=a,Yi=null);break;case"focusout":Yi=Sa=Cr=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,gd(c,n,d);break;case"selectionchange":if(Qw)break;case"keydown":case"keyup":gd(c,n,d)}var C;if(Dc)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else kr?wm(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(xm&&n.locale!=="ko"&&(kr||M!=="onCompositionStart"?M==="onCompositionEnd"&&kr&&(C=vm()):(Tn=d,jc="value"in Tn?Tn.value:Tn.textContent,kr=!0)),z=Xs(a,M),0<z.length&&(M=new ld(M,e,null,n,d),c.push({event:M,listeners:z}),C?M.data=C:(C=Sm(n),C!==null&&(M.data=C)))),(C=Rw?$w(e,n):Dw(e,n))&&(a=Xs(a,"onBeforeInput"),0<a.length&&(d=new ld("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:a}),d.data=C))}Rm(c,t)})}function fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xs(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=io(e,n),o!=null&&r.unshift(fo(e,o,i)),o=io(e,t),o!=null&&r.push(fo(e,o,i))),e=e.return}return r}function Sr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xd(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,i?(u=io(n,o),u!=null&&s.unshift(fo(n,u,l))):i||(u=io(n,o),u!=null&&s.push(fo(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Kw=/\r\n?/g,qw=/\u0000|\uFFFD/g;function wd(e){return(typeof e=="string"?e:""+e).replace(Kw,`
38
- `).replace(qw,"")}function rs(e,t,n){if(t=wd(t),wd(e)!==t&&n)throw Error(V(425))}function Ys(){}var _a=null,ka=null;function Ca(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 Na=typeof setTimeout=="function"?setTimeout:void 0,Gw=typeof clearTimeout=="function"?clearTimeout:void 0,Sd=typeof Promise=="function"?Promise:void 0,Zw=typeof queueMicrotask=="function"?queueMicrotask:typeof Sd<"u"?function(e){return Sd.resolve(null).then(e).catch(Jw)}:Na;function Jw(e){setTimeout(function(){throw e})}function Eu(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),lo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);lo(t)}function $n(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 Ed(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 Si=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Si,ho="__reactProps$"+Si,en="__reactContainer$"+Si,Ma="__reactEvents$"+Si,e1="__reactListeners$"+Si,t1="__reactHandles$"+Si;function Kn(e){var t=e[Lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[Lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ed(e);e!==null;){if(n=e[Lt])return n;e=Ed(e)}return t}e=n,n=e.parentNode}return null}function Ao(e){return e=e[Lt]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function Cl(e){return e[ho]||null}var Pa=[],Pr=-1;function Bn(e){return{current:e}}function pe(e){0>Pr||(e.current=Pa[Pr],Pa[Pr]=null,Pr--)}function fe(e,t){Pr++,Pa[Pr]=e.current,e.current=t}var Fn={},be=Bn(Fn),Ge=Bn(!1),dr=Fn;function oi(e,t){var n=e.type.contextTypes;if(!n)return Fn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ze(e){return e=e.childContextTypes,e!=null}function Ks(){pe(Ge),pe(be)}function _d(e,t,n){if(be.current!==Fn)throw Error(V(168));fe(be,t),fe(Ge,n)}function Dm(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(V(108,bx(e)||"Unknown",i));return xe({},n,r)}function qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fn,dr=be.current,fe(be,e),fe(Ge,Ge.current),!0}function kd(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=Dm(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,pe(Ge),pe(be),fe(be,e)):pe(Ge),fe(Ge,n)}var Ut=null,Nl=!1,_u=!1;function Lm(e){Ut===null?Ut=[e]:Ut.push(e)}function n1(e){Nl=!0,Lm(e)}function Un(){if(!_u&&Ut!==null){_u=!0;var e=0,t=ce;try{var n=Ut;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ut=null,Nl=!1}catch(i){throw Ut!==null&&(Ut=Ut.slice(e+1)),lm(Pc,Un),i}finally{ce=t,_u=!1}}return null}var Tr=[],zr=0,Gs=null,Zs=0,ft=[],dt=0,hr=null,Wt=1,Xt="";function Wn(e,t){Tr[zr++]=Zs,Tr[zr++]=Gs,Gs=e,Zs=t}function Am(e,t,n){ft[dt++]=Wt,ft[dt++]=Xt,ft[dt++]=hr,hr=e;var r=Wt;e=Xt;var i=32-Nt(r)-1;r&=~(1<<i),n+=1;var o=32-Nt(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Wt=1<<32-Nt(t)+i|n<<i|r,Xt=o+e}else Wt=1<<o|n<<i|r,Xt=e}function Ac(e){e.return!==null&&(Wn(e,1),Am(e,1,0))}function Oc(e){for(;e===Gs;)Gs=Tr[--zr],Tr[zr]=null,Zs=Tr[--zr],Tr[zr]=null;for(;e===hr;)hr=ft[--dt],ft[dt]=null,Xt=ft[--dt],ft[dt]=null,Wt=ft[--dt],ft[dt]=null}var it=null,rt=null,me=!1,_t=null;function Om(e,t){var n=ht(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 Cd(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,it=e,rt=$n(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,it=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hr!==null?{id:Wt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,it=e,rt=null,!0):!1;default:return!1}}function Ta(e){return(e.mode&1)!==0&&(e.flags&128)===0}function za(e){if(me){var t=rt;if(t){var n=t;if(!Cd(e,t)){if(Ta(e))throw Error(V(418));t=$n(n.nextSibling);var r=it;t&&Cd(e,t)?Om(r,n):(e.flags=e.flags&-4097|2,me=!1,it=e)}}else{if(Ta(e))throw Error(V(418));e.flags=e.flags&-4097|2,me=!1,it=e}}}function Nd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;it=e}function is(e){if(e!==it)return!1;if(!me)return Nd(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ca(e.type,e.memoizedProps)),t&&(t=rt)){if(Ta(e))throw bm(),Error(V(418));for(;t;)Om(e,t),t=$n(t.nextSibling)}if(Nd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rt=$n(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=it?$n(e.stateNode.nextSibling):null;return!0}function bm(){for(var e=rt;e;)e=$n(e.nextSibling)}function si(){rt=it=null,me=!1}function bc(e){_t===null?_t=[e]:_t.push(e)}var r1=on.ReactCurrentBatchConfig;function ji(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(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var l=i.refs;s===null?delete l[o]:l[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function os(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Md(e){var t=e._init;return t(e._payload)}function Fm(e){function t(p,g){if(e){var m=p.deletions;m===null?(p.deletions=[g],p.flags|=16):m.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function i(p,g){return p=On(p,g),p.index=0,p.sibling=null,p}function o(p,g,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<g?(p.flags|=2,g):m):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,g,m,x){return g===null||g.tag!==6?(g=zu(m,p.mode,x),g.return=p,g):(g=i(g,m),g.return=p,g)}function u(p,g,m,x){var k=m.type;return k===_r?d(p,g,m.props.children,x,m.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===pn&&Md(k)===g.type)?(x=i(g,m.props),x.ref=ji(p,g,m),x.return=p,x):(x=js(m.type,m.key,m.props,null,p.mode,x),x.ref=ji(p,g,m),x.return=p,x)}function a(p,g,m,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==m.containerInfo||g.stateNode.implementation!==m.implementation?(g=Iu(m,p.mode,x),g.return=p,g):(g=i(g,m.children||[]),g.return=p,g)}function d(p,g,m,x,k){return g===null||g.tag!==7?(g=lr(m,p.mode,x,k),g.return=p,g):(g=i(g,m),g.return=p,g)}function c(p,g,m){if(typeof g=="string"&&g!==""||typeof g=="number")return g=zu(""+g,p.mode,m),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Yo:return m=js(g.type,g.key,g.props,null,p.mode,m),m.ref=ji(p,null,g),m.return=p,m;case Er:return g=Iu(g,p.mode,m),g.return=p,g;case pn:var x=g._init;return c(p,x(g._payload),m)}if(bi(g)||Mi(g))return g=lr(g,p.mode,m,null),g.return=p,g;os(p,g)}return null}function f(p,g,m,x){var k=g!==null?g.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return k!==null?null:l(p,g,""+m,x);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Yo:return m.key===k?u(p,g,m,x):null;case Er:return m.key===k?a(p,g,m,x):null;case pn:return k=m._init,f(p,g,k(m._payload),x)}if(bi(m)||Mi(m))return k!==null?null:d(p,g,m,x,null);os(p,m)}return null}function h(p,g,m,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(m)||null,l(g,p,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Yo:return p=p.get(x.key===null?m:x.key)||null,u(g,p,x,k);case Er:return p=p.get(x.key===null?m:x.key)||null,a(g,p,x,k);case pn:var z=x._init;return h(p,g,m,z(x._payload),k)}if(bi(x)||Mi(x))return p=p.get(m)||null,d(g,p,x,k,null);os(g,x)}return null}function y(p,g,m,x){for(var k=null,z=null,C=g,M=g=0,I=null;C!==null&&M<m.length;M++){C.index>M?(I=C,C=null):I=C.sibling;var j=f(p,C,m[M],x);if(j===null){C===null&&(C=I);break}e&&C&&j.alternate===null&&t(p,C),g=o(j,g,M),z===null?k=j:z.sibling=j,z=j,C=I}if(M===m.length)return n(p,C),me&&Wn(p,M),k;if(C===null){for(;M<m.length;M++)C=c(p,m[M],x),C!==null&&(g=o(C,g,M),z===null?k=C:z.sibling=C,z=C);return me&&Wn(p,M),k}for(C=r(p,C);M<m.length;M++)I=h(C,p,M,m[M],x),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?M:I.key),g=o(I,g,M),z===null?k=I:z.sibling=I,z=I);return e&&C.forEach(function(A){return t(p,A)}),me&&Wn(p,M),k}function v(p,g,m,x){var k=Mi(m);if(typeof k!="function")throw Error(V(150));if(m=k.call(m),m==null)throw Error(V(151));for(var z=k=null,C=g,M=g=0,I=null,j=m.next();C!==null&&!j.done;M++,j=m.next()){C.index>M?(I=C,C=null):I=C.sibling;var A=f(p,C,j.value,x);if(A===null){C===null&&(C=I);break}e&&C&&A.alternate===null&&t(p,C),g=o(A,g,M),z===null?k=A:z.sibling=A,z=A,C=I}if(j.done)return n(p,C),me&&Wn(p,M),k;if(C===null){for(;!j.done;M++,j=m.next())j=c(p,j.value,x),j!==null&&(g=o(j,g,M),z===null?k=j:z.sibling=j,z=j);return me&&Wn(p,M),k}for(C=r(p,C);!j.done;M++,j=m.next())j=h(C,p,M,j.value,x),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?M:j.key),g=o(j,g,M),z===null?k=j:z.sibling=j,z=j);return e&&C.forEach(function(F){return t(p,F)}),me&&Wn(p,M),k}function S(p,g,m,x){if(typeof m=="object"&&m!==null&&m.type===_r&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Yo:e:{for(var k=m.key,z=g;z!==null;){if(z.key===k){if(k=m.type,k===_r){if(z.tag===7){n(p,z.sibling),g=i(z,m.props.children),g.return=p,p=g;break e}}else if(z.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===pn&&Md(k)===z.type){n(p,z.sibling),g=i(z,m.props),g.ref=ji(p,z,m),g.return=p,p=g;break e}n(p,z);break}else t(p,z);z=z.sibling}m.type===_r?(g=lr(m.props.children,p.mode,x,m.key),g.return=p,p=g):(x=js(m.type,m.key,m.props,null,p.mode,x),x.ref=ji(p,g,m),x.return=p,p=x)}return s(p);case Er:e:{for(z=m.key;g!==null;){if(g.key===z)if(g.tag===4&&g.stateNode.containerInfo===m.containerInfo&&g.stateNode.implementation===m.implementation){n(p,g.sibling),g=i(g,m.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Iu(m,p.mode,x),g.return=p,p=g}return s(p);case pn:return z=m._init,S(p,g,z(m._payload),x)}if(bi(m))return y(p,g,m,x);if(Mi(m))return v(p,g,m,x);os(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,g!==null&&g.tag===6?(n(p,g.sibling),g=i(g,m),g.return=p,p=g):(n(p,g),g=zu(m,p.mode,x),g.return=p,p=g),s(p)):n(p,g)}return S}var li=Fm(!0),Hm=Fm(!1),Js=Bn(null),el=null,Ir=null,Fc=null;function Hc(){Fc=Ir=el=null}function Vc(e){var t=Js.current;pe(Js),e._currentValue=t}function Ia(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 Hr(e,t){el=e,Fc=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Fc!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(el===null)throw Error(V(308));Ir=e,el.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var qn=null;function Bc(e){qn===null?qn=[e]:qn.push(e)}function Vm(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bc(t)):(n.next=i.next,i.next=n),t.interleaved=n,tn(e,r)}function tn(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 mn=!1;function Uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bm(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 Kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,tn(e,n)}return i=r.interleaved,i===null?(t.next=t,Bc(r)):(t.next=i.next,i.next=t),r.interleaved=t,tn(e,n)}function Ns(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,Tc(e,n)}}function Pd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tl(e,t,n,r){var i=e.updateQueue;mn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?o=a:s.next=a,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=a:l.next=a,d.lastBaseUpdate=u))}if(o!==null){var c=i.baseState;s=0,d=a=u=null,l=o;do{var f=l.lane,h=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,h=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(h,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(h,c,f):y,f==null)break e;c=xe({},c,f);break e;case 2:mn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(a=d=h,u=c):d=d.next=h,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(u=c),i.baseState=u,i.firstBaseUpdate=a,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);mr|=s,e.lanes=s,e.memoizedState=c}}function Td(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(V(191,i));i.call(r)}}}var Oo={},Ot=Bn(Oo),po=Bn(Oo),mo=Bn(Oo);function Gn(e){if(e===Oo)throw Error(V(174));return e}function Qc(e,t){switch(fe(mo,t),fe(po,e),fe(Ot,Oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fa(t,e)}pe(Ot),fe(Ot,t)}function ui(){pe(Ot),pe(po),pe(mo)}function Um(e){Gn(mo.current);var t=Gn(Ot.current),n=fa(t,e.type);t!==n&&(fe(po,e),fe(Ot,n))}function Wc(e){po.current===e&&(pe(Ot),pe(po))}var ye=Bn(0);function nl(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 ku=[];function Xc(){for(var e=0;e<ku.length;e++)ku[e]._workInProgressVersionPrimary=null;ku.length=0}var Ms=on.ReactCurrentDispatcher,Cu=on.ReactCurrentBatchConfig,pr=0,ve=null,Ne=null,Te=null,rl=!1,Ki=!1,go=0,i1=0;function De(){throw Error(V(321))}function Yc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function Kc(e,t,n,r,i,o){if(pr=o,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?u1:a1,e=n(r,i),Ki){o=0;do{if(Ki=!1,go=0,25<=o)throw Error(V(301));o+=1,Te=Ne=null,t.updateQueue=null,Ms.current=c1,e=n(r,i)}while(Ki)}if(Ms.current=il,t=Ne!==null&&Ne.next!==null,pr=0,Te=Ne=ve=null,rl=!1,t)throw Error(V(300));return e}function qc(){var e=go!==0;return go=0,e}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ve.memoizedState=Te=e:Te=Te.next=e,Te}function gt(){if(Ne===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Te===null?ve.memoizedState:Te.next;if(t!==null)Te=t,Ne=e;else{if(e===null)throw Error(V(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Te===null?ve.memoizedState=Te=e:Te=Te.next=e}return Te}function yo(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=gt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=Ne,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,u=null,a=o;do{var d=a.lane;if((pr&d)===d)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var c={lane:d,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=c,s=r):u=u.next=c,ve.lanes|=d,mr|=d}a=a.next}while(a!==null&&a!==o);u===null?s=r:u.next=l,Pt(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,ve.lanes|=o,mr|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mu(e){var t=gt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Pt(o,t.memoizedState)||(Ke=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Qm(){}function Wm(e,t){var n=ve,r=gt(),i=t(),o=!Pt(r.memoizedState,i);if(o&&(r.memoizedState=i,Ke=!0),r=r.queue,Gc(Km.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Te!==null&&Te.memoizedState.tag&1){if(n.flags|=2048,vo(9,Ym.bind(null,n,r,i,t),void 0,null),ze===null)throw Error(V(349));pr&30||Xm(n,t,i)}return i}function Xm(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 Ym(e,t,n,r){t.value=n,t.getSnapshot=r,qm(t)&&Gm(e)}function Km(e,t,n){return n(function(){qm(t)&&Gm(e)})}function qm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function Gm(e){var t=tn(e,1);t!==null&&Mt(t,e,1,-1)}function zd(e){var t=It();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:e},t.queue=e,e=e.dispatch=l1.bind(null,ve,e),[t.memoizedState,e]}function vo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Zm(){return gt().memoizedState}function Ps(e,t,n,r){var i=It();ve.flags|=e,i.memoizedState=vo(1|t,n,void 0,r===void 0?null:r)}function Ml(e,t,n,r){var i=gt();r=r===void 0?null:r;var o=void 0;if(Ne!==null){var s=Ne.memoizedState;if(o=s.destroy,r!==null&&Yc(r,s.deps)){i.memoizedState=vo(t,n,o,r);return}}ve.flags|=e,i.memoizedState=vo(1|t,n,o,r)}function Id(e,t){return Ps(8390656,8,e,t)}function Gc(e,t){return Ml(2048,8,e,t)}function Jm(e,t){return Ml(4,2,e,t)}function eg(e,t){return Ml(4,4,e,t)}function tg(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 ng(e,t,n){return n=n!=null?n.concat([e]):null,Ml(4,4,tg.bind(null,t,e),n)}function Zc(){}function rg(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ig(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function og(e,t,n){return pr&21?(Pt(n,t)||(n=cm(),ve.lanes|=n,mr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function o1(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Cu.transition;Cu.transition={};try{e(!1),t()}finally{ce=n,Cu.transition=r}}function sg(){return gt().memoizedState}function s1(e,t,n){var r=An(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lg(e))ug(t,n);else if(n=Vm(e,t,n,r),n!==null){var i=Be();Mt(n,e,r,i),ag(n,t,r)}}function l1(e,t,n){var r=An(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lg(e))ug(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Pt(l,s)){var u=t.interleaved;u===null?(i.next=i,Bc(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Vm(e,t,i,r),n!==null&&(i=Be(),Mt(n,e,r,i),ag(n,t,r))}}function lg(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function ug(e,t){Ki=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ag(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tc(e,n)}}var il={readContext:mt,useCallback:De,useContext:De,useEffect:De,useImperativeHandle:De,useInsertionEffect:De,useLayoutEffect:De,useMemo:De,useReducer:De,useRef:De,useState:De,useDebugValue:De,useDeferredValue:De,useTransition:De,useMutableSource:De,useSyncExternalStore:De,useId:De,unstable_isNewReconciler:!1},u1={readContext:mt,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Id,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ps(4194308,4,tg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var n=It();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=It();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=s1.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:zd,useDebugValue:Zc,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=zd(!1),t=e[0];return e=o1.bind(null,e[1]),It().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,i=It();if(me){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),ze===null)throw Error(V(349));pr&30||Xm(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Id(Km.bind(null,r,o,e),[e]),r.flags|=2048,vo(9,Ym.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=It(),t=ze.identifierPrefix;if(me){var n=Xt,r=Wt;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=go++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=i1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},a1={readContext:mt,useCallback:rg,useContext:mt,useEffect:Gc,useImperativeHandle:ng,useInsertionEffect:Jm,useLayoutEffect:eg,useMemo:ig,useReducer:Nu,useRef:Zm,useState:function(){return Nu(yo)},useDebugValue:Zc,useDeferredValue:function(e){var t=gt();return og(t,Ne.memoizedState,e)},useTransition:function(){var e=Nu(yo)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Qm,useSyncExternalStore:Wm,useId:sg,unstable_isNewReconciler:!1},c1={readContext:mt,useCallback:rg,useContext:mt,useEffect:Gc,useImperativeHandle:ng,useInsertionEffect:Jm,useLayoutEffect:eg,useMemo:ig,useReducer:Mu,useRef:Zm,useState:function(){return Mu(yo)},useDebugValue:Zc,useDeferredValue:function(e){var t=gt();return Ne===null?t.memoizedState=e:og(t,Ne.memoizedState,e)},useTransition:function(){var e=Mu(yo)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Qm,useSyncExternalStore:Wm,useId:sg,unstable_isNewReconciler:!1};function vt(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 ja(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 Pl={isMounted:function(e){return(e=e._reactInternals)?wr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Be(),i=An(e),o=Kt(r,i);o.payload=t,n!=null&&(o.callback=n),t=Dn(e,o,i),t!==null&&(Mt(t,e,i,r),Ns(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Be(),i=An(e),o=Kt(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Dn(e,o,i),t!==null&&(Mt(t,e,i,r),Ns(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Be(),r=An(e),i=Kt(n,r);i.tag=2,t!=null&&(i.callback=t),t=Dn(e,i,r),t!==null&&(Mt(t,e,r,n),Ns(t,e,r))}};function jd(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!ao(n,r)||!ao(i,o):!0}function cg(e,t,n){var r=!1,i=Fn,o=t.contextType;return typeof o=="object"&&o!==null?o=mt(o):(i=Ze(t)?dr:be.current,r=t.contextTypes,o=(r=r!=null)?oi(e,i):Fn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Pl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Rd(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&&Pl.enqueueReplaceState(t,t.state,null)}function Ra(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Uc(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=mt(o):(o=Ze(t)?dr:be.current,i.context=oi(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(ja(e,t,o,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&&Pl.enqueueReplaceState(i,i.state,null),tl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ai(e,t){try{var n="",r=t;do n+=Ox(r),r=r.return;while(r);var i=n}catch(o){i=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{uu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Oi(e):""}function bx(e){switch(e.tag){case 5:return Oi(e.type);case 16:return Oi("Lazy");case 13:return Oi("Suspense");case 19:return Oi("SuspenseList");case 0:case 2:case 15:return e=au(e.type,!1),e;case 11:return e=au(e.type.render,!1),e;case 1:return e=au(e.type,!0),e;default:return""}}function sa(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 _r:return"Fragment";case Er:return"Portal";case ra:return"Profiler";case kc:return"StrictMode";case ia:return"Suspense";case oa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bp:return(e.displayName||"Context")+".Consumer";case Vp:return(e._context.displayName||"Context")+".Provider";case Cc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nc:return t=e.displayName||null,t!==null?t:sa(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return sa(e(t))}catch{}}return null}function Fx(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 sa(t);case 8:return t===kc?"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 Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hx(e){var t=Qp(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){e._valueTracker||(e._valueTracker=Hx(e))}function Wp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(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 la(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fn(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 Xp(e,t){t=t.checked,t!=null&&_c(e,"checked",t,!1)}function ua(e,t){Xp(e,t);var n=Fn(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")?aa(e,t.type,n):t.hasOwnProperty("defaultValue")&&aa(e,t.type,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gf(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 aa(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bi=Array.isArray;function Lr(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=""+Fn(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 ca(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(bi(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fn(n)}}function Yp(e,t){var n=Fn(t.value),r=Fn(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 Jf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kp(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 fa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qo,qp=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(qo=qo||document.createElement("div"),qo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ro(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ui={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},Vx=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(e){Vx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ui[t]=Ui[e]})});function Gp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ui.hasOwnProperty(e)&&Ui[e]?(""+t).trim():t+"px"}function Zp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Gp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Bx=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 da(e,t){if(t){if(Bx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function ha(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 pa=null;function Mc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ma=null,Or=null,br=null;function ed(e){if(e=Lo(e)){if(typeof ma!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Cl(t),ma(e.stateNode,e.type,t))}}function Jp(e){Or?br?br.push(e):br=[e]:Or=e}function em(){if(Or){var e=Or,t=br;if(br=Or=null,ed(e),t)for(e=0;e<t.length;e++)ed(t[e])}}function tm(e,t){return e(t)}function nm(){}var cu=!1;function rm(e,t,n){if(cu)return e(t,n);cu=!0;try{return tm(e,t,n)}finally{cu=!1,(Or!==null||br!==null)&&(nm(),em())}}function io(e,t){var n=e.stateNode;if(n===null)return null;var r=Cl(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(V(231,t,typeof n));return n}var ga=!1;if(Jt)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){ga=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{ga=!1}function Ux(e,t,n,r,i,o,s,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(d){this.onError(d)}}var Qi=!1,Hs=null,Vs=!1,ya=null,Qx={onError:function(e){Qi=!0,Hs=e}};function Wx(e,t,n,r,i,o,s,l,u){Qi=!1,Hs=null,Ux.apply(Qx,arguments)}function Xx(e,t,n,r,i,o,s,l,u){if(Wx.apply(this,arguments),Qi){if(Qi){var a=Hs;Qi=!1,Hs=null}else throw Error(V(198));Vs||(Vs=!0,ya=a)}}function wr(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 im(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 td(e){if(wr(e)!==e)throw Error(V(188))}function Yx(e){var t=e.alternate;if(!t){if(t=wr(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return td(i),e;if(o===r)return td(i),t;o=o.sibling}throw Error(V(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function om(e){return e=Yx(e),e!==null?sm(e):null}function sm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sm(e);if(t!==null)return t;e=e.sibling}return null}var lm=ot.unstable_scheduleCallback,nd=ot.unstable_cancelCallback,Kx=ot.unstable_shouldYield,qx=ot.unstable_requestPaint,_e=ot.unstable_now,Gx=ot.unstable_getCurrentPriorityLevel,Pc=ot.unstable_ImmediatePriority,um=ot.unstable_UserBlockingPriority,Bs=ot.unstable_NormalPriority,Zx=ot.unstable_LowPriority,am=ot.unstable_IdlePriority,Sl=null,Lt=null;function Jx(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Sl,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:nw,ew=Math.log,tw=Math.LN2;function nw(e){return e>>>=0,e===0?32:31-(ew(e)/tw|0)|0}var Go=64,Zo=4194304;function Fi(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 Us(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Fi(l):(o&=s,o!==0&&(r=Fi(o)))}else s=n&~i,s!==0?r=Fi(s):o!==0&&(r=Fi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),i=1<<n,r|=e[n],t&=~i;return r}function rw(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 iw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-Nt(o),l=1<<s,u=i[s];u===-1?(!(l&n)||l&r)&&(i[s]=rw(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function va(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cm(){var e=Go;return Go<<=1,!(Go&4194240)&&(Go=64),e}function fu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Do(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function ow(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-Nt(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function Tc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ce=0;function fm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dm,zc,hm,pm,mm,xa=!1,Jo=[],jn=null,Rn=null,$n=null,oo=new Map,so=new Map,vn=[],sw="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 rd(e,t){switch(e){case"focusin":case"focusout":jn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(t.pointerId)}}function Ti(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Lo(t),t!==null&&zc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function lw(e,t,n,r,i){switch(t){case"focusin":return jn=Ti(jn,e,t,n,r,i),!0;case"dragenter":return Rn=Ti(Rn,e,t,n,r,i),!0;case"mouseover":return $n=Ti($n,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return oo.set(o,Ti(oo.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,so.set(o,Ti(so.get(o)||null,e,t,n,r,i)),!0}return!1}function gm(e){var t=Kn(e.target);if(t!==null){var n=wr(t);if(n!==null){if(t=n.tag,t===13){if(t=im(n),t!==null){e.blockedOn=t,mm(e.priority,function(){hm(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 _s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pa=r,n.target.dispatchEvent(r),pa=null}else return t=Lo(n),t!==null&&zc(t),e.blockedOn=n,!1;t.shift()}return!0}function id(e,t,n){_s(e)&&n.delete(t)}function uw(){xa=!1,jn!==null&&_s(jn)&&(jn=null),Rn!==null&&_s(Rn)&&(Rn=null),$n!==null&&_s($n)&&($n=null),oo.forEach(id),so.forEach(id)}function zi(e,t){e.blockedOn===t&&(e.blockedOn=null,xa||(xa=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,uw)))}function lo(e){function t(i){return zi(i,e)}if(0<Jo.length){zi(Jo[0],e);for(var n=1;n<Jo.length;n++){var r=Jo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(jn!==null&&zi(jn,e),Rn!==null&&zi(Rn,e),$n!==null&&zi($n,e),oo.forEach(t),so.forEach(t),n=0;n<vn.length;n++)r=vn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<vn.length&&(n=vn[0],n.blockedOn===null);)gm(n),n.blockedOn===null&&vn.shift()}var Fr=on.ReactCurrentBatchConfig,Qs=!0;function aw(e,t,n,r){var i=ce,o=Fr.transition;Fr.transition=null;try{ce=1,Ic(e,t,n,r)}finally{ce=i,Fr.transition=o}}function cw(e,t,n,r){var i=ce,o=Fr.transition;Fr.transition=null;try{ce=4,Ic(e,t,n,r)}finally{ce=i,Fr.transition=o}}function Ic(e,t,n,r){if(Qs){var i=wa(e,t,n,r);if(i===null)Su(e,t,r,Ws,n),rd(e,r);else if(lw(i,e,t,n,r))r.stopPropagation();else if(rd(e,r),t&4&&-1<sw.indexOf(e)){for(;i!==null;){var o=Lo(i);if(o!==null&&dm(o),o=wa(e,t,n,r),o===null&&Su(e,t,r,Ws,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Su(e,t,r,null,n)}}var Ws=null;function wa(e,t,n,r){if(Ws=null,e=Mc(r),e=Kn(e),e!==null)if(t=wr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=im(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 Ws=e,null}function ym(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(Gx()){case Pc:return 1;case um:return 4;case Bs:case Zx:return 16;case am:return 536870912;default:return 16}default:return 16}}var zn=null,jc=null,ks=null;function vm(){if(ks)return ks;var e,t=jc,n=t.length,r,i="value"in zn?zn.value:zn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return ks=i.slice(e,1<r?1-r:void 0)}function Cs(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 es(){return!0}function od(){return!1}function ut(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?es:od,this.isPropagationStopped=od,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=es)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=es)},persist:function(){},isPersistent:es}),t}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rc=ut(wi),Ao=xe({},wi,{view:0,detail:0}),fw=ut(Ao),du,hu,Ii,El=xe({},Ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$c,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!==Ii&&(Ii&&e.type==="mousemove"?(du=e.screenX-Ii.screenX,hu=e.screenY-Ii.screenY):hu=du=0,Ii=e),du)},movementY:function(e){return"movementY"in e?e.movementY:hu}}),sd=ut(El),dw=xe({},El,{dataTransfer:0}),hw=ut(dw),pw=xe({},Ao,{relatedTarget:0}),pu=ut(pw),mw=xe({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),gw=ut(mw),yw=xe({},wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vw=ut(yw),xw=xe({},wi,{data:0}),ld=ut(xw),ww={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sw={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"},Ew={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _w(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ew[e])?!!t[e]:!1}function $c(){return _w}var kw=xe({},Ao,{key:function(e){if(e.key){var t=ww[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$c,charCode:function(e){return e.type==="keypress"?Cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cw=ut(kw),Nw=xe({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ud=ut(Nw),Mw=xe({},Ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$c}),Pw=ut(Mw),Tw=xe({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),zw=ut(Tw),Iw=xe({},El,{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}),jw=ut(Iw),Rw=[9,13,27,32],Dc=Jt&&"CompositionEvent"in window,Wi=null;Jt&&"documentMode"in document&&(Wi=document.documentMode);var $w=Jt&&"TextEvent"in window&&!Wi,xm=Jt&&(!Dc||Wi&&8<Wi&&11>=Wi),ad=" ",cd=!1;function wm(e,t){switch(e){case"keyup":return Rw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kr=!1;function Dw(e,t){switch(e){case"compositionend":return Sm(t);case"keypress":return t.which!==32?null:(cd=!0,ad);case"textInput":return e=t.data,e===ad&&cd?null:e;default:return null}}function Aw(e,t){if(kr)return e==="compositionend"||!Dc&&wm(e,t)?(e=vm(),ks=jc=zn=null,kr=!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 xm&&t.locale!=="ko"?null:t.data;default:return null}}var Lw={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 fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lw[e.type]:t==="textarea"}function Em(e,t,n,r){Jp(r),t=Xs(t,"onChange"),0<t.length&&(n=new Rc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xi=null,uo=null;function Ow(e){Rm(e,0)}function _l(e){var t=Mr(e);if(Wp(t))return e}function bw(e,t){if(e==="change")return t}var _m=!1;if(Jt){var mu;if(Jt){var gu="oninput"in document;if(!gu){var dd=document.createElement("div");dd.setAttribute("oninput","return;"),gu=typeof dd.oninput=="function"}mu=gu}else mu=!1;_m=mu&&(!document.documentMode||9<document.documentMode)}function hd(){Xi&&(Xi.detachEvent("onpropertychange",km),uo=Xi=null)}function km(e){if(e.propertyName==="value"&&_l(uo)){var t=[];Em(t,uo,e,Mc(e)),rm(Ow,t)}}function Fw(e,t,n){e==="focusin"?(hd(),Xi=t,uo=n,Xi.attachEvent("onpropertychange",km)):e==="focusout"&&hd()}function Hw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _l(uo)}function Vw(e,t){if(e==="click")return _l(t)}function Bw(e,t){if(e==="input"||e==="change")return _l(t)}function Uw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Uw;function ao(e,t){if(Pt(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(!na.call(t,i)||!Pt(e[i],t[i]))return!1}return!0}function pd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function md(e,t){var n=pd(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=pd(n)}}function Cm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nm(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Ac(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 Qw(e){var t=Nm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cm(n.ownerDocument.documentElement,n)){if(r!==null&&Ac(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,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=md(n,o);var s=md(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 Ww=Jt&&"documentMode"in document&&11>=document.documentMode,Cr=null,Sa=null,Yi=null,Ea=!1;function gd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ea||Cr==null||Cr!==Fs(r)||(r=Cr,"selectionStart"in r&&Ac(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}),Yi&&ao(Yi,r)||(Yi=r,r=Xs(Sa,"onSelect"),0<r.length&&(t=new Rc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function ts(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Nr={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionend:ts("Transition","TransitionEnd")},yu={},Mm={};Jt&&(Mm=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function kl(e){if(yu[e])return yu[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mm)return yu[e]=t[n];return e}var Pm=kl("animationend"),Tm=kl("animationiteration"),zm=kl("animationstart"),Im=kl("transitionend"),jm=new Map,yd="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 Bn(e,t){jm.set(e,t),xr(t,[e])}for(var vu=0;vu<yd.length;vu++){var xu=yd[vu],Xw=xu.toLowerCase(),Yw=xu[0].toUpperCase()+xu.slice(1);Bn(Xw,"on"+Yw)}Bn(Pm,"onAnimationEnd");Bn(Tm,"onAnimationIteration");Bn(zm,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(Im,"onTransitionEnd");ii("onMouseEnter",["mouseout","mouseover"]);ii("onMouseLeave",["mouseout","mouseover"]);ii("onPointerEnter",["pointerout","pointerover"]);ii("onPointerLeave",["pointerout","pointerover"]);xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),Kw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hi));function vd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Xx(r,t,void 0,e),e.currentTarget=null}function Rm(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 o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==o&&i.isPropagationStopped())break e;vd(i,l,a),o=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,a=l.currentTarget,l=l.listener,u!==o&&i.isPropagationStopped())break e;vd(i,l,a),o=u}}}if(Vs)throw e=ya,Vs=!1,ya=null,e}function he(e,t){var n=t[Ma];n===void 0&&(n=t[Ma]=new Set);var r=e+"__bubble";n.has(r)||($m(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),$m(n,e,r,t)}var ns="_reactListening"+Math.random().toString(36).slice(2);function co(e){if(!e[ns]){e[ns]=!0,Hp.forEach(function(n){n!=="selectionchange"&&(Kw.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ns]||(t[ns]=!0,wu("selectionchange",!1,t))}}function $m(e,t,n,r){switch(ym(t)){case 1:var i=aw;break;case 4:i=cw;break;default:i=Ic}n=i.bind(null,t,n,e),i=void 0,!ga||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 Su(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Kn(l),s===null)return;if(u=s.tag,u===5||u===6){r=o=s;continue e}l=l.parentNode}}r=r.return}rm(function(){var a=o,d=Mc(n),c=[];e:{var f=jm.get(e);if(f!==void 0){var h=Rc,y=e;switch(e){case"keypress":if(Cs(n)===0)break e;case"keydown":case"keyup":h=Cw;break;case"focusin":y="focus",h=pu;break;case"focusout":y="blur",h=pu;break;case"beforeblur":case"afterblur":h=pu;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=sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=hw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Pw;break;case Pm:case Tm:case zm:h=gw;break;case Im:h=zw;break;case"scroll":h=fw;break;case"wheel":h=jw;break;case"copy":case"cut":case"paste":h=vw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ud}var v=(t&4)!==0,S=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var g=a,m;g!==null;){m=g;var x=m.stateNode;if(m.tag===5&&x!==null&&(m=x,p!==null&&(x=io(g,p),x!=null&&v.push(fo(g,x,m)))),S)break;g=g.return}0<v.length&&(f=new h(f,y,null,n,d),c.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==pa&&(y=n.relatedTarget||n.fromElement)&&(Kn(y)||y[en]))break e;if((h||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=a,y=y?Kn(y):null,y!==null&&(S=wr(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=a),h!==y)){if(v=sd,x="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=ud,x="onPointerLeave",p="onPointerEnter",g="pointer"),S=h==null?f:Mr(h),m=y==null?f:Mr(y),f=new v(x,g+"leave",h,n,d),f.target=S,f.relatedTarget=m,x=null,Kn(d)===a&&(v=new v(p,g+"enter",y,n,d),v.target=m,v.relatedTarget=S,x=v),S=x,h&&y)t:{for(v=h,p=y,g=0,m=v;m;m=Sr(m))g++;for(m=0,x=p;x;x=Sr(x))m++;for(;0<g-m;)v=Sr(v),g--;for(;0<m-g;)p=Sr(p),m--;for(;g--;){if(v===p||p!==null&&v===p.alternate)break t;v=Sr(v),p=Sr(p)}v=null}else v=null;h!==null&&xd(c,f,h,v,!1),y!==null&&S!==null&&xd(c,S,y,v,!0)}}e:{if(f=a?Mr(a):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=bw;else if(fd(f))if(_m)k=Bw;else{k=Hw;var z=Fw}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Vw);if(k&&(k=k(e,a))){Em(c,k,n,d);break e}z&&z(e,f,a),e==="focusout"&&(z=f._wrapperState)&&z.controlled&&f.type==="number"&&aa(f,"number",f.value)}switch(z=a?Mr(a):window,e){case"focusin":(fd(z)||z.contentEditable==="true")&&(Cr=z,Sa=a,Yi=null);break;case"focusout":Yi=Sa=Cr=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,gd(c,n,d);break;case"selectionchange":if(Ww)break;case"keydown":case"keyup":gd(c,n,d)}var C;if(Dc)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else kr?wm(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(xm&&n.locale!=="ko"&&(kr||M!=="onCompositionStart"?M==="onCompositionEnd"&&kr&&(C=vm()):(zn=d,jc="value"in zn?zn.value:zn.textContent,kr=!0)),z=Xs(a,M),0<z.length&&(M=new ld(M,e,null,n,d),c.push({event:M,listeners:z}),C?M.data=C:(C=Sm(n),C!==null&&(M.data=C)))),(C=$w?Dw(e,n):Aw(e,n))&&(a=Xs(a,"onBeforeInput"),0<a.length&&(d=new ld("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:a}),d.data=C))}Rm(c,t)})}function fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xs(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=io(e,n),o!=null&&r.unshift(fo(e,o,i)),o=io(e,t),o!=null&&r.push(fo(e,o,i))),e=e.return}return r}function Sr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xd(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,i?(u=io(n,o),u!=null&&s.unshift(fo(n,u,l))):i||(u=io(n,o),u!=null&&s.push(fo(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var qw=/\r\n?/g,Gw=/\u0000|\uFFFD/g;function wd(e){return(typeof e=="string"?e:""+e).replace(qw,`
38
+ `).replace(Gw,"")}function rs(e,t,n){if(t=wd(t),wd(e)!==t&&n)throw Error(V(425))}function Ys(){}var _a=null,ka=null;function Ca(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 Na=typeof setTimeout=="function"?setTimeout:void 0,Zw=typeof clearTimeout=="function"?clearTimeout:void 0,Sd=typeof Promise=="function"?Promise:void 0,Jw=typeof queueMicrotask=="function"?queueMicrotask:typeof Sd<"u"?function(e){return Sd.resolve(null).then(e).catch(e1)}:Na;function e1(e){setTimeout(function(){throw e})}function Eu(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),lo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);lo(t)}function Dn(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 Ed(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 Si=Math.random().toString(36).slice(2),At="__reactFiber$"+Si,ho="__reactProps$"+Si,en="__reactContainer$"+Si,Ma="__reactEvents$"+Si,t1="__reactListeners$"+Si,n1="__reactHandles$"+Si;function Kn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ed(e);e!==null;){if(n=e[At])return n;e=Ed(e)}return t}e=n,n=e.parentNode}return null}function Lo(e){return e=e[At]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function Cl(e){return e[ho]||null}var Pa=[],Pr=-1;function Un(e){return{current:e}}function pe(e){0>Pr||(e.current=Pa[Pr],Pa[Pr]=null,Pr--)}function fe(e,t){Pr++,Pa[Pr]=e.current,e.current=t}var Hn={},be=Un(Hn),Ge=Un(!1),dr=Hn;function oi(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ze(e){return e=e.childContextTypes,e!=null}function Ks(){pe(Ge),pe(be)}function _d(e,t,n){if(be.current!==Hn)throw Error(V(168));fe(be,t),fe(Ge,n)}function Dm(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(V(108,Fx(e)||"Unknown",i));return xe({},n,r)}function qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,dr=be.current,fe(be,e),fe(Ge,Ge.current),!0}function kd(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=Dm(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,pe(Ge),pe(be),fe(be,e)):pe(Ge),fe(Ge,n)}var Ut=null,Nl=!1,_u=!1;function Am(e){Ut===null?Ut=[e]:Ut.push(e)}function r1(e){Nl=!0,Am(e)}function Qn(){if(!_u&&Ut!==null){_u=!0;var e=0,t=ce;try{var n=Ut;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ut=null,Nl=!1}catch(i){throw Ut!==null&&(Ut=Ut.slice(e+1)),lm(Pc,Qn),i}finally{ce=t,_u=!1}}return null}var Tr=[],zr=0,Gs=null,Zs=0,ft=[],dt=0,hr=null,Wt=1,Xt="";function Wn(e,t){Tr[zr++]=Zs,Tr[zr++]=Gs,Gs=e,Zs=t}function Lm(e,t,n){ft[dt++]=Wt,ft[dt++]=Xt,ft[dt++]=hr,hr=e;var r=Wt;e=Xt;var i=32-Nt(r)-1;r&=~(1<<i),n+=1;var o=32-Nt(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Wt=1<<32-Nt(t)+i|n<<i|r,Xt=o+e}else Wt=1<<o|n<<i|r,Xt=e}function Lc(e){e.return!==null&&(Wn(e,1),Lm(e,1,0))}function Oc(e){for(;e===Gs;)Gs=Tr[--zr],Tr[zr]=null,Zs=Tr[--zr],Tr[zr]=null;for(;e===hr;)hr=ft[--dt],ft[dt]=null,Xt=ft[--dt],ft[dt]=null,Wt=ft[--dt],ft[dt]=null}var it=null,rt=null,me=!1,_t=null;function Om(e,t){var n=ht(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 Cd(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,it=e,rt=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,it=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hr!==null?{id:Wt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,it=e,rt=null,!0):!1;default:return!1}}function Ta(e){return(e.mode&1)!==0&&(e.flags&128)===0}function za(e){if(me){var t=rt;if(t){var n=t;if(!Cd(e,t)){if(Ta(e))throw Error(V(418));t=Dn(n.nextSibling);var r=it;t&&Cd(e,t)?Om(r,n):(e.flags=e.flags&-4097|2,me=!1,it=e)}}else{if(Ta(e))throw Error(V(418));e.flags=e.flags&-4097|2,me=!1,it=e}}}function Nd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;it=e}function is(e){if(e!==it)return!1;if(!me)return Nd(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ca(e.type,e.memoizedProps)),t&&(t=rt)){if(Ta(e))throw bm(),Error(V(418));for(;t;)Om(e,t),t=Dn(t.nextSibling)}if(Nd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rt=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=it?Dn(e.stateNode.nextSibling):null;return!0}function bm(){for(var e=rt;e;)e=Dn(e.nextSibling)}function si(){rt=it=null,me=!1}function bc(e){_t===null?_t=[e]:_t.push(e)}var i1=on.ReactCurrentBatchConfig;function ji(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(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var l=i.refs;s===null?delete l[o]:l[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function os(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Md(e){var t=e._init;return t(e._payload)}function Fm(e){function t(p,g){if(e){var m=p.deletions;m===null?(p.deletions=[g],p.flags|=16):m.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function i(p,g){return p=bn(p,g),p.index=0,p.sibling=null,p}function o(p,g,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<g?(p.flags|=2,g):m):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,g,m,x){return g===null||g.tag!==6?(g=zu(m,p.mode,x),g.return=p,g):(g=i(g,m),g.return=p,g)}function u(p,g,m,x){var k=m.type;return k===_r?d(p,g,m.props.children,x,m.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===mn&&Md(k)===g.type)?(x=i(g,m.props),x.ref=ji(p,g,m),x.return=p,x):(x=js(m.type,m.key,m.props,null,p.mode,x),x.ref=ji(p,g,m),x.return=p,x)}function a(p,g,m,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==m.containerInfo||g.stateNode.implementation!==m.implementation?(g=Iu(m,p.mode,x),g.return=p,g):(g=i(g,m.children||[]),g.return=p,g)}function d(p,g,m,x,k){return g===null||g.tag!==7?(g=lr(m,p.mode,x,k),g.return=p,g):(g=i(g,m),g.return=p,g)}function c(p,g,m){if(typeof g=="string"&&g!==""||typeof g=="number")return g=zu(""+g,p.mode,m),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Yo:return m=js(g.type,g.key,g.props,null,p.mode,m),m.ref=ji(p,null,g),m.return=p,m;case Er:return g=Iu(g,p.mode,m),g.return=p,g;case mn:var x=g._init;return c(p,x(g._payload),m)}if(bi(g)||Mi(g))return g=lr(g,p.mode,m,null),g.return=p,g;os(p,g)}return null}function f(p,g,m,x){var k=g!==null?g.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return k!==null?null:l(p,g,""+m,x);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Yo:return m.key===k?u(p,g,m,x):null;case Er:return m.key===k?a(p,g,m,x):null;case mn:return k=m._init,f(p,g,k(m._payload),x)}if(bi(m)||Mi(m))return k!==null?null:d(p,g,m,x,null);os(p,m)}return null}function h(p,g,m,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(m)||null,l(g,p,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Yo:return p=p.get(x.key===null?m:x.key)||null,u(g,p,x,k);case Er:return p=p.get(x.key===null?m:x.key)||null,a(g,p,x,k);case mn:var z=x._init;return h(p,g,m,z(x._payload),k)}if(bi(x)||Mi(x))return p=p.get(m)||null,d(g,p,x,k,null);os(g,x)}return null}function y(p,g,m,x){for(var k=null,z=null,C=g,M=g=0,I=null;C!==null&&M<m.length;M++){C.index>M?(I=C,C=null):I=C.sibling;var j=f(p,C,m[M],x);if(j===null){C===null&&(C=I);break}e&&C&&j.alternate===null&&t(p,C),g=o(j,g,M),z===null?k=j:z.sibling=j,z=j,C=I}if(M===m.length)return n(p,C),me&&Wn(p,M),k;if(C===null){for(;M<m.length;M++)C=c(p,m[M],x),C!==null&&(g=o(C,g,M),z===null?k=C:z.sibling=C,z=C);return me&&Wn(p,M),k}for(C=r(p,C);M<m.length;M++)I=h(C,p,M,m[M],x),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?M:I.key),g=o(I,g,M),z===null?k=I:z.sibling=I,z=I);return e&&C.forEach(function(L){return t(p,L)}),me&&Wn(p,M),k}function v(p,g,m,x){var k=Mi(m);if(typeof k!="function")throw Error(V(150));if(m=k.call(m),m==null)throw Error(V(151));for(var z=k=null,C=g,M=g=0,I=null,j=m.next();C!==null&&!j.done;M++,j=m.next()){C.index>M?(I=C,C=null):I=C.sibling;var L=f(p,C,j.value,x);if(L===null){C===null&&(C=I);break}e&&C&&L.alternate===null&&t(p,C),g=o(L,g,M),z===null?k=L:z.sibling=L,z=L,C=I}if(j.done)return n(p,C),me&&Wn(p,M),k;if(C===null){for(;!j.done;M++,j=m.next())j=c(p,j.value,x),j!==null&&(g=o(j,g,M),z===null?k=j:z.sibling=j,z=j);return me&&Wn(p,M),k}for(C=r(p,C);!j.done;M++,j=m.next())j=h(C,p,M,j.value,x),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?M:j.key),g=o(j,g,M),z===null?k=j:z.sibling=j,z=j);return e&&C.forEach(function(F){return t(p,F)}),me&&Wn(p,M),k}function S(p,g,m,x){if(typeof m=="object"&&m!==null&&m.type===_r&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Yo:e:{for(var k=m.key,z=g;z!==null;){if(z.key===k){if(k=m.type,k===_r){if(z.tag===7){n(p,z.sibling),g=i(z,m.props.children),g.return=p,p=g;break e}}else if(z.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===mn&&Md(k)===z.type){n(p,z.sibling),g=i(z,m.props),g.ref=ji(p,z,m),g.return=p,p=g;break e}n(p,z);break}else t(p,z);z=z.sibling}m.type===_r?(g=lr(m.props.children,p.mode,x,m.key),g.return=p,p=g):(x=js(m.type,m.key,m.props,null,p.mode,x),x.ref=ji(p,g,m),x.return=p,p=x)}return s(p);case Er:e:{for(z=m.key;g!==null;){if(g.key===z)if(g.tag===4&&g.stateNode.containerInfo===m.containerInfo&&g.stateNode.implementation===m.implementation){n(p,g.sibling),g=i(g,m.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Iu(m,p.mode,x),g.return=p,p=g}return s(p);case mn:return z=m._init,S(p,g,z(m._payload),x)}if(bi(m))return y(p,g,m,x);if(Mi(m))return v(p,g,m,x);os(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,g!==null&&g.tag===6?(n(p,g.sibling),g=i(g,m),g.return=p,p=g):(n(p,g),g=zu(m,p.mode,x),g.return=p,p=g),s(p)):n(p,g)}return S}var li=Fm(!0),Hm=Fm(!1),Js=Un(null),el=null,Ir=null,Fc=null;function Hc(){Fc=Ir=el=null}function Vc(e){var t=Js.current;pe(Js),e._currentValue=t}function Ia(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 Hr(e,t){el=e,Fc=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Fc!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(el===null)throw Error(V(308));Ir=e,el.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var qn=null;function Bc(e){qn===null?qn=[e]:qn.push(e)}function Vm(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bc(t)):(n.next=i.next,i.next=n),t.interleaved=n,tn(e,r)}function tn(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 gn=!1;function Uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bm(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 Kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,tn(e,n)}return i=r.interleaved,i===null?(t.next=t,Bc(r)):(t.next=i.next,i.next=t),r.interleaved=t,tn(e,n)}function Ns(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,Tc(e,n)}}function Pd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tl(e,t,n,r){var i=e.updateQueue;gn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?o=a:s.next=a,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=a:l.next=a,d.lastBaseUpdate=u))}if(o!==null){var c=i.baseState;s=0,d=a=u=null,l=o;do{var f=l.lane,h=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,h=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(h,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(h,c,f):y,f==null)break e;c=xe({},c,f);break e;case 2:gn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(a=d=h,u=c):d=d.next=h,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(u=c),i.baseState=u,i.firstBaseUpdate=a,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);mr|=s,e.lanes=s,e.memoizedState=c}}function Td(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(V(191,i));i.call(r)}}}var Oo={},Ot=Un(Oo),po=Un(Oo),mo=Un(Oo);function Gn(e){if(e===Oo)throw Error(V(174));return e}function Qc(e,t){switch(fe(mo,t),fe(po,e),fe(Ot,Oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fa(t,e)}pe(Ot),fe(Ot,t)}function ui(){pe(Ot),pe(po),pe(mo)}function Um(e){Gn(mo.current);var t=Gn(Ot.current),n=fa(t,e.type);t!==n&&(fe(po,e),fe(Ot,n))}function Wc(e){po.current===e&&(pe(Ot),pe(po))}var ye=Un(0);function nl(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 ku=[];function Xc(){for(var e=0;e<ku.length;e++)ku[e]._workInProgressVersionPrimary=null;ku.length=0}var Ms=on.ReactCurrentDispatcher,Cu=on.ReactCurrentBatchConfig,pr=0,ve=null,Ne=null,Te=null,rl=!1,Ki=!1,go=0,o1=0;function De(){throw Error(V(321))}function Yc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function Kc(e,t,n,r,i,o){if(pr=o,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?a1:c1,e=n(r,i),Ki){o=0;do{if(Ki=!1,go=0,25<=o)throw Error(V(301));o+=1,Te=Ne=null,t.updateQueue=null,Ms.current=f1,e=n(r,i)}while(Ki)}if(Ms.current=il,t=Ne!==null&&Ne.next!==null,pr=0,Te=Ne=ve=null,rl=!1,t)throw Error(V(300));return e}function qc(){var e=go!==0;return go=0,e}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ve.memoizedState=Te=e:Te=Te.next=e,Te}function gt(){if(Ne===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Te===null?ve.memoizedState:Te.next;if(t!==null)Te=t,Ne=e;else{if(e===null)throw Error(V(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Te===null?ve.memoizedState=Te=e:Te=Te.next=e}return Te}function yo(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=gt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=Ne,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,u=null,a=o;do{var d=a.lane;if((pr&d)===d)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var c={lane:d,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=c,s=r):u=u.next=c,ve.lanes|=d,mr|=d}a=a.next}while(a!==null&&a!==o);u===null?s=r:u.next=l,Pt(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,ve.lanes|=o,mr|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mu(e){var t=gt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Pt(o,t.memoizedState)||(Ke=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Qm(){}function Wm(e,t){var n=ve,r=gt(),i=t(),o=!Pt(r.memoizedState,i);if(o&&(r.memoizedState=i,Ke=!0),r=r.queue,Gc(Km.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Te!==null&&Te.memoizedState.tag&1){if(n.flags|=2048,vo(9,Ym.bind(null,n,r,i,t),void 0,null),ze===null)throw Error(V(349));pr&30||Xm(n,t,i)}return i}function Xm(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 Ym(e,t,n,r){t.value=n,t.getSnapshot=r,qm(t)&&Gm(e)}function Km(e,t,n){return n(function(){qm(t)&&Gm(e)})}function qm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function Gm(e){var t=tn(e,1);t!==null&&Mt(t,e,1,-1)}function zd(e){var t=It();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:e},t.queue=e,e=e.dispatch=u1.bind(null,ve,e),[t.memoizedState,e]}function vo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Zm(){return gt().memoizedState}function Ps(e,t,n,r){var i=It();ve.flags|=e,i.memoizedState=vo(1|t,n,void 0,r===void 0?null:r)}function Ml(e,t,n,r){var i=gt();r=r===void 0?null:r;var o=void 0;if(Ne!==null){var s=Ne.memoizedState;if(o=s.destroy,r!==null&&Yc(r,s.deps)){i.memoizedState=vo(t,n,o,r);return}}ve.flags|=e,i.memoizedState=vo(1|t,n,o,r)}function Id(e,t){return Ps(8390656,8,e,t)}function Gc(e,t){return Ml(2048,8,e,t)}function Jm(e,t){return Ml(4,2,e,t)}function eg(e,t){return Ml(4,4,e,t)}function tg(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 ng(e,t,n){return n=n!=null?n.concat([e]):null,Ml(4,4,tg.bind(null,t,e),n)}function Zc(){}function rg(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ig(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function og(e,t,n){return pr&21?(Pt(n,t)||(n=cm(),ve.lanes|=n,mr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function s1(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Cu.transition;Cu.transition={};try{e(!1),t()}finally{ce=n,Cu.transition=r}}function sg(){return gt().memoizedState}function l1(e,t,n){var r=On(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lg(e))ug(t,n);else if(n=Vm(e,t,n,r),n!==null){var i=Be();Mt(n,e,r,i),ag(n,t,r)}}function u1(e,t,n){var r=On(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lg(e))ug(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Pt(l,s)){var u=t.interleaved;u===null?(i.next=i,Bc(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Vm(e,t,i,r),n!==null&&(i=Be(),Mt(n,e,r,i),ag(n,t,r))}}function lg(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function ug(e,t){Ki=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ag(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tc(e,n)}}var il={readContext:mt,useCallback:De,useContext:De,useEffect:De,useImperativeHandle:De,useInsertionEffect:De,useLayoutEffect:De,useMemo:De,useReducer:De,useRef:De,useState:De,useDebugValue:De,useDeferredValue:De,useTransition:De,useMutableSource:De,useSyncExternalStore:De,useId:De,unstable_isNewReconciler:!1},a1={readContext:mt,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Id,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ps(4194308,4,tg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var n=It();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=It();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=l1.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:zd,useDebugValue:Zc,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=zd(!1),t=e[0];return e=s1.bind(null,e[1]),It().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,i=It();if(me){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),ze===null)throw Error(V(349));pr&30||Xm(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Id(Km.bind(null,r,o,e),[e]),r.flags|=2048,vo(9,Ym.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=It(),t=ze.identifierPrefix;if(me){var n=Xt,r=Wt;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=go++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=o1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},c1={readContext:mt,useCallback:rg,useContext:mt,useEffect:Gc,useImperativeHandle:ng,useInsertionEffect:Jm,useLayoutEffect:eg,useMemo:ig,useReducer:Nu,useRef:Zm,useState:function(){return Nu(yo)},useDebugValue:Zc,useDeferredValue:function(e){var t=gt();return og(t,Ne.memoizedState,e)},useTransition:function(){var e=Nu(yo)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Qm,useSyncExternalStore:Wm,useId:sg,unstable_isNewReconciler:!1},f1={readContext:mt,useCallback:rg,useContext:mt,useEffect:Gc,useImperativeHandle:ng,useInsertionEffect:Jm,useLayoutEffect:eg,useMemo:ig,useReducer:Mu,useRef:Zm,useState:function(){return Mu(yo)},useDebugValue:Zc,useDeferredValue:function(e){var t=gt();return Ne===null?t.memoizedState=e:og(t,Ne.memoizedState,e)},useTransition:function(){var e=Mu(yo)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Qm,useSyncExternalStore:Wm,useId:sg,unstable_isNewReconciler:!1};function vt(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 ja(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 Pl={isMounted:function(e){return(e=e._reactInternals)?wr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Be(),i=On(e),o=Kt(r,i);o.payload=t,n!=null&&(o.callback=n),t=An(e,o,i),t!==null&&(Mt(t,e,i,r),Ns(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Be(),i=On(e),o=Kt(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=An(e,o,i),t!==null&&(Mt(t,e,i,r),Ns(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Be(),r=On(e),i=Kt(n,r);i.tag=2,t!=null&&(i.callback=t),t=An(e,i,r),t!==null&&(Mt(t,e,r,n),Ns(t,e,r))}};function jd(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!ao(n,r)||!ao(i,o):!0}function cg(e,t,n){var r=!1,i=Hn,o=t.contextType;return typeof o=="object"&&o!==null?o=mt(o):(i=Ze(t)?dr:be.current,r=t.contextTypes,o=(r=r!=null)?oi(e,i):Hn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Pl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Rd(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&&Pl.enqueueReplaceState(t,t.state,null)}function Ra(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Uc(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=mt(o):(o=Ze(t)?dr:be.current,i.context=oi(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(ja(e,t,o,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&&Pl.enqueueReplaceState(i,i.state,null),tl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ai(e,t){try{var n="",r=t;do n+=bx(r),r=r.return;while(r);var i=n}catch(o){i=`
39
39
  Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:i,digest:null}}function Pu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $a(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var f1=typeof WeakMap=="function"?WeakMap:Map;function fg(e,t,n){n=Kt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,Ua=r),$a(e,t)},n}function dg(e,t,n){n=Kt(-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(){$a(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){$a(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function $d(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new f1;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=C1.bind(null,e,t,n),t.then(e,e))}function Dd(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 Ld(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=Kt(-1,1),t.tag=2,Dn(n,t,1))),n.lanes|=1),e)}var d1=on.ReactCurrentOwner,Ke=!1;function Ve(e,t,n,r){t.child=e===null?Hm(t,null,n,r):li(t,e.child,n,r)}function Ad(e,t,n,r,i){n=n.render;var o=t.ref;return Hr(t,i),r=Kc(e,t,n,r,o,i),n=qc(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(me&&n&&Ac(t),t.flags|=1,Ve(e,t,r,i),t.child)}function Od(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!lf(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,hg(e,t,o,r,i)):(e=js(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:ao,n(s,r)&&e.ref===t.ref)return nn(e,t,i)}return t.flags|=1,e=On(o,r),e.ref=t.ref,e.return=t,t.child=e}function hg(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(ao(o,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,nn(e,t,i)}return Da(e,t,n,r,i)}function pg(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Rr,tt),tt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Rr,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Rr,tt),tt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Rr,tt),tt|=r;return Ve(e,t,i,n),t.child}function mg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Da(e,t,n,r,i){var o=Ze(n)?dr:be.current;return o=oi(t,o),Hr(t,i),n=Kc(e,t,n,r,o,i),r=qc(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(me&&r&&Ac(t),t.flags|=1,Ve(e,t,n,i),t.child)}function bd(e,t,n,r,i){if(Ze(n)){var o=!0;qs(t)}else o=!1;if(Hr(t,i),t.stateNode===null)Ts(e,t),cg(t,n,r),Ra(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,a=n.contextType;typeof a=="object"&&a!==null?a=mt(a):(a=Ze(n)?dr:be.current,a=oi(t,a));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==a)&&Rd(t,s,r,a),mn=!1;var f=t.memoizedState;s.state=f,tl(t,r,s,i),u=t.memoizedState,l!==r||f!==u||Ge.current||mn?(typeof d=="function"&&(ja(t,n,d,r),u=t.memoizedState),(l=mn||jd(t,n,l,r,f,u,a))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Bm(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:vt(t.type,l),s.props=a,c=t.pendingProps,f=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=mt(u):(u=Ze(n)?dr:be.current,u=oi(t,u));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==c||f!==u)&&Rd(t,s,r,u),mn=!1,f=t.memoizedState,s.state=f,tl(t,r,s,i);var y=t.memoizedState;l!==c||f!==y||Ge.current||mn?(typeof h=="function"&&(ja(t,n,h,r),y=t.memoizedState),(a=mn||jd(t,n,a,r,f,y,u)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=u,r=a):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return La(e,t,n,r,o,i)}function La(e,t,n,r,i,o){mg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&kd(t,n,!1),nn(e,t,o);r=t.stateNode,d1.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=li(t,e.child,null,o),t.child=li(t,null,l,o)):Ve(e,t,l,o),t.memoizedState=r.state,i&&kd(t,n,!0),t.child}function gg(e){var t=e.stateNode;t.pendingContext?_d(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_d(e,t.context,!1),Qc(e,t.containerInfo)}function Fd(e,t,n,r,i){return si(),bc(i),t.flags|=256,Ve(e,t,n,r),t.child}var Aa={dehydrated:null,treeContext:null,retryLane:0};function Oa(e){return{baseLanes:e,cachePool:null,transitions:null}}function yg(e,t,n){var r=t.pendingProps,i=ye.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),fe(ye,i&1),e===null)return za(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):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Il(s,r,0,null),e=lr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Oa(n),t.memoizedState=Aa,e):Jc(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return h1(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=On(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=On(l,o):(o=lr(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?Oa(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Aa,r}return o=e.child,e=o.sibling,r=On(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Jc(e,t){return t=Il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ss(e,t,n,r){return r!==null&&bc(r),li(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function h1(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Pu(Error(V(422))),ss(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Il({mode:"visible",children:r.children},i,0,null),o=lr(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&li(t,e.child,null,s),t.child.memoizedState=Oa(s),t.memoizedState=Aa,o);if(!(t.mode&1))return ss(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(V(419)),r=Pu(o,r,void 0),ss(e,t,s,r)}if(l=(s&e.childLanes)!==0,Ke||l){if(r=ze,r!==null){switch(s&-s){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|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,tn(e,i),Mt(r,e,i,-1))}return sf(),r=Pu(Error(V(421))),ss(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=N1.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,rt=$n(i.nextSibling),it=t,me=!0,_t=null,e!==null&&(ft[dt++]=Wt,ft[dt++]=Xt,ft[dt++]=hr,Wt=e.id,Xt=e.overflow,hr=t),t=Jc(t,r.children),t.flags|=4096,t)}function Hd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ia(e.return,t,n)}function Tu(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function vg(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=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&&Hd(e,n,t);else if(e.tag===19)Hd(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(fe(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&&nl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tu(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&nl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tu(t,!0,n,null,o);break;case"together":Tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ts(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=On(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=On(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function p1(e,t,n){switch(t.tag){case 3:gg(t),si();break;case 5:Um(t);break;case 1:Ze(t.type)&&qs(t);break;case 4:Qc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;fe(Js,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?yg(e,t,n):(fe(ye,ye.current&1),e=nn(e,t,n),e!==null?e.sibling:null);fe(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return vg(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),fe(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,pg(e,t,n)}return nn(e,t,n)}var xg,ba,wg,Sg;xg=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}};ba=function(){};wg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Gn(Ot.current);var o=null;switch(n){case"input":i=la(e,i),r=la(e,r),o=[];break;case"select":i=xe({},i,{value:void 0}),r=xe({},r,{value:void 0}),o=[];break;case"textarea":i=ca(e,i),r=ca(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ys)}da(n,r);var s;n=null;for(a in i)if(!r.hasOwnProperty(a)&&i.hasOwnProperty(a)&&i[a]!=null)if(a==="style"){var l=i[a];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(no.hasOwnProperty(a)?o||(o=[]):(o=o||[]).push(a,null));for(a in r){var u=r[a];if(l=i!=null?i[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(o||(o=[]),o.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(no.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&he("scroll",e),o||l===u||(o=[])):(o=o||[]).push(a,u))}n&&(o=o||[]).push("style",n);var a=o;(t.updateQueue=a)&&(t.flags|=4)}};Sg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ri(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 Le(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 m1(e,t,n){var r=t.pendingProps;switch(Oc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Ze(t.type)&&Ks(),Le(t),null;case 3:return r=t.stateNode,ui(),pe(Ge),pe(be),Xc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(is(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_t!==null&&(Xa(_t),_t=null))),ba(e,t),Le(t),null;case 5:Wc(t);var i=Gn(mo.current);if(n=t.type,e!==null&&t.stateNode!=null)wg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return Le(t),null}if(e=Gn(Ot.current),is(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Lt]=t,r[ho]=o,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<Hi.length;i++)he(Hi[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":qf(r,o),he("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},he("invalid",r);break;case"textarea":Zf(r,o),he("invalid",r)}da(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&rs(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&rs(r.textContent,l,e),i=["children",""+l]):no.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&he("scroll",r)}switch(n){case"input":Ko(r),Gf(r,o,!0);break;case"textarea":Ko(r),Jf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Ys)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Lt]=t,e[ho]=r,xg(e,t,!1,!1),t.stateNode=e;e:{switch(s=ha(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<Hi.length;i++)he(Hi[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":qf(e,r),i=la(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":Zf(e,r),i=ca(e,r),he("invalid",e);break;default:i=r}da(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?Zp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&qp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ro(e,u):typeof u=="number"&&ro(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(no.hasOwnProperty(o)?u!=null&&o==="onScroll"&&he("scroll",e):u!=null&&_c(e,o,u,s))}switch(n){case"input":Ko(e),Gf(e,r,!1);break;case"textarea":Ko(e),Jf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+bn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Ar(e,!!r.multiple,o,!1):r.defaultValue!=null&&Ar(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ys)}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 Le(t),null;case 6:if(e&&t.stateNode!=null)Sg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Gn(mo.current),Gn(Ot.current),is(t)){if(r=t.stateNode,n=t.memoizedProps,r[Lt]=t,(o=r.nodeValue!==n)&&(e=it,e!==null))switch(e.tag){case 3:rs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rs(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lt]=t,t.stateNode=r}return Le(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&rt!==null&&t.mode&1&&!(t.flags&128))bm(),si(),t.flags|=98560,o=!1;else if(o=is(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(V(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(V(317));o[Lt]=t}else si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Le(t),o=!1}else _t!==null&&(Xa(_t),_t=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?Pe===0&&(Pe=3):sf())),t.updateQueue!==null&&(t.flags|=4),Le(t),null);case 4:return ui(),ba(e,t),e===null&&co(t.stateNode.containerInfo),Le(t),null;case 10:return Vc(t.type._context),Le(t),null;case 17:return Ze(t.type)&&Ks(),Le(t),null;case 19:if(pe(ye),o=t.memoizedState,o===null)return Le(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Ri(o,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=nl(e),s!==null){for(t.flags|=128,Ri(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(ye,ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&_e()>ci&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304)}else{if(!r)if(e=nl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!me)return Le(t),null}else 2*_e()-o.renderingStartTime>ci&&n!==1073741824&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=ye.current,fe(ye,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return of(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function g1(e,t){switch(Oc(t),t.tag){case 1:return Ze(t.type)&&Ks(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ui(),pe(Ge),pe(be),Xc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wc(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return ui(),null;case 10:return Vc(t.type._context),null;case 22:case 23:return of(),null;case 24:return null;default:return null}}var ls=!1,Oe=!1,y1=typeof WeakSet=="function"?WeakSet:Set,W=null;function jr(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 Fa(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Vd=!1;function v1(e,t){if(_a=Qs,e=Nm(),Lc(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,d=0,c=e,f=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(l=s+i),c!==o||r!==0&&c.nodeType!==3||(u=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(h=c.firstChild)!==null;)f=c,c=h;for(;;){if(c===e)break t;if(f===n&&++a===i&&(l=s),f===o&&++d===r&&(u=s),(h=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ka={focusedElem:e,selectionRange:n},Qs=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,S=y.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:vt(t.type,v),S);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(x){Se(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Vd,Vd=!1,y}function qi(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 o=i.destroy;i.destroy=void 0,o!==void 0&&Fa(t,n,o)}i=i.next}while(i!==r)}}function Tl(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 Ha(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 Eg(e){var t=e.alternate;t!==null&&(e.alternate=null,Eg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[ho],delete t[Ma],delete t[e1],delete t[t1])),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 _g(e){return e.tag===5||e.tag===3||e.tag===4}function Bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_g(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 Va(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=Ys));else if(r!==4&&(e=e.child,e!==null))for(Va(e,t,n),e=e.sibling;e!==null;)Va(e,t,n),e=e.sibling}function Ba(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(Ba(e,t,n),e=e.sibling;e!==null;)Ba(e,t,n),e=e.sibling}var Ie=null,wt=!1;function cn(e,t,n){for(n=n.child;n!==null;)kg(e,t,n),n=n.sibling}function kg(e,t,n){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:Oe||jr(n,t);case 6:var r=Ie,i=wt;Ie=null,cn(e,t,n),Ie=r,wt=i,Ie!==null&&(wt?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(wt?(e=Ie,n=n.stateNode,e.nodeType===8?Eu(e.parentNode,n):e.nodeType===1&&Eu(e,n),lo(e)):Eu(Ie,n.stateNode));break;case 4:r=Ie,i=wt,Ie=n.stateNode.containerInfo,wt=!0,cn(e,t,n),Ie=r,wt=i;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Fa(n,t,s),i=i.next}while(i!==r)}cn(e,t,n);break;case 1:if(!Oe&&(jr(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)}cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,cn(e,t,n),Oe=r):cn(e,t,n);break;default:cn(e,t,n)}}function Ud(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new y1),t.forEach(function(r){var i=M1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function yt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Ie=l.stateNode,wt=!1;break e;case 3:Ie=l.stateNode.containerInfo,wt=!0;break e;case 4:Ie=l.stateNode.containerInfo,wt=!0;break e}l=l.return}if(Ie===null)throw Error(V(160));kg(o,s,i),Ie=null,wt=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(a){Se(i,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cg(t,e),t=t.sibling}function Cg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),zt(e),r&4){try{qi(3,e,e.return),Tl(3,e)}catch(v){Se(e,e.return,v)}try{qi(5,e,e.return)}catch(v){Se(e,e.return,v)}}break;case 1:yt(t,e),zt(e),r&512&&n!==null&&jr(n,n.return);break;case 5:if(yt(t,e),zt(e),r&512&&n!==null&&jr(n,n.return),e.flags&32){var i=e.stateNode;try{ro(i,"")}catch(v){Se(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Xp(i,o),ha(l,s);var a=ha(l,o);for(s=0;s<u.length;s+=2){var d=u[s],c=u[s+1];d==="style"?Zp(i,c):d==="dangerouslySetInnerHTML"?qp(i,c):d==="children"?ro(i,c):_c(i,d,c,a)}switch(l){case"input":ua(i,o);break;case"textarea":Yp(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Ar(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Ar(i,!!o.multiple,o.defaultValue,!0):Ar(i,!!o.multiple,o.multiple?[]:"",!1))}i[ho]=o}catch(v){Se(e,e.return,v)}}break;case 6:if(yt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(V(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){Se(e,e.return,v)}}break;case 3:if(yt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{lo(t.containerInfo)}catch(v){Se(e,e.return,v)}break;case 4:yt(t,e),zt(e);break;case 13:yt(t,e),zt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(nf=_e())),r&4&&Ud(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(a=Oe)||d,yt(t,e),Oe=a):yt(t,e),zt(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(c=W=d;W!==null;){switch(f=W,h=f.child,f.tag){case 0:case 11:case 14:case 15:qi(4,f,f.return);break;case 1:jr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:jr(f,f.return);break;case 22:if(f.memoizedState!==null){Wd(c);continue}}h!==null?(h.return=f,W=h):Wd(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,a?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=c.stateNode,u=c.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Gp("display",s))}catch(v){Se(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(v){Se(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:yt(t,e),zt(e),r&4&&Ud(e);break;case 21:break;default:yt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_g(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ro(i,""),r.flags&=-33);var o=Bd(e);Ba(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Bd(e);Va(e,l,s);break;default:throw Error(V(161))}}catch(u){Se(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x1(e,t,n){W=e,Ng(e)}function Ng(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||ls;if(!s){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Oe;l=ls;var a=Oe;if(ls=s,(Oe=u)&&!a)for(W=i;W!==null;)s=W,u=s.child,s.tag===22&&s.memoizedState!==null?Xd(i):u!==null?(u.return=s,W=u):Xd(i);for(;o!==null;)W=o,Ng(o),o=o.sibling;W=i,ls=l,Oe=a}Qd(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,W=o):Qd(e)}}function Qd(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||Tl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Td(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Td(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var d=a.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&lo(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}Oe||t.flags&512&&Ha(t)}catch(f){Se(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Wd(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Xd(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Tl(4,t)}catch(u){Se(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Se(t,i,u)}}var o=t.return;try{Ha(t)}catch(u){Se(t,o,u)}break;case 5:var s=t.return;try{Ha(t)}catch(u){Se(t,s,u)}}}catch(u){Se(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var w1=Math.ceil,ol=on.ReactCurrentDispatcher,ef=on.ReactCurrentOwner,pt=on.ReactCurrentBatchConfig,se=0,ze=null,ke=null,je=0,tt=0,Rr=Bn(0),Pe=0,xo=null,mr=0,zl=0,tf=0,Gi=null,Ye=null,nf=0,ci=1/0,Bt=null,sl=!1,Ua=null,Ln=null,us=!1,zn=null,ll=0,Zi=0,Qa=null,zs=-1,Is=0;function Be(){return se&6?_e():zs!==-1?zs:zs=_e()}function An(e){return e.mode&1?se&2&&je!==0?je&-je:r1.transition!==null?(Is===0&&(Is=cm()),Is):(e=ce,e!==0||(e=window.event,e=e===void 0?16:ym(e.type)),e):1}function Mt(e,t,n,r){if(50<Zi)throw Zi=0,Qa=null,Error(V(185));Do(e,n,r),(!(se&2)||e!==ze)&&(e===ze&&(!(se&2)&&(zl|=n),Pe===4&&vn(e,je)),Je(e,r),n===1&&se===0&&!(t.mode&1)&&(ci=_e()+500,Nl&&Un()))}function Je(e,t){var n=e.callbackNode;rw(e,t);var r=Us(e,e===ze?je:0);if(r===0)n!==null&&nd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&nd(n),t===1)e.tag===0?n1(Yd.bind(null,e)):Lm(Yd.bind(null,e)),Zw(function(){!(se&6)&&Un()}),n=null;else{switch(fm(r)){case 1:n=Pc;break;case 4:n=um;break;case 16:n=Bs;break;case 536870912:n=am;break;default:n=Bs}n=$g(n,Mg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mg(e,t){if(zs=-1,Is=0,se&6)throw Error(V(327));var n=e.callbackNode;if(Vr()&&e.callbackNode!==n)return null;var r=Us(e,e===ze?je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ul(e,r);else{t=r;var i=se;se|=2;var o=Tg();(ze!==e||je!==t)&&(Bt=null,ci=_e()+500,sr(e,t));do try{_1();break}catch(l){Pg(e,l)}while(!0);Hc(),ol.current=o,se=i,ke!==null?t=0:(ze=null,je=0,t=Pe)}if(t!==0){if(t===2&&(i=va(e),i!==0&&(r=i,t=Wa(e,i))),t===1)throw n=xo,sr(e,0),vn(e,r),Je(e,_e()),n;if(t===6)vn(e,r);else{if(i=e.current.alternate,!(r&30)&&!S1(i)&&(t=ul(e,r),t===2&&(o=va(e),o!==0&&(r=o,t=Wa(e,o))),t===1))throw n=xo,sr(e,0),vn(e,r),Je(e,_e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:Xn(e,Ye,Bt);break;case 3:if(vn(e,r),(r&130023424)===r&&(t=nf+500-_e(),10<t)){if(Us(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Be(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Na(Xn.bind(null,e,Ye,Bt),t);break}Xn(e,Ye,Bt);break;case 4:if(vn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Nt(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}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*w1(r/1960))-r,10<r){e.timeoutHandle=Na(Xn.bind(null,e,Ye,Bt),r);break}Xn(e,Ye,Bt);break;case 5:Xn(e,Ye,Bt);break;default:throw Error(V(329))}}}return Je(e,_e()),e.callbackNode===n?Mg.bind(null,e):null}function Wa(e,t){var n=Gi;return e.current.memoizedState.isDehydrated&&(sr(e,t).flags|=256),e=ul(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&Xa(t)),e}function Xa(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function S1(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],o=i.getSnapshot;i=i.value;try{if(!Pt(o(),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 vn(e,t){for(t&=~tf,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Yd(e){if(se&6)throw Error(V(327));Vr();var t=Us(e,0);if(!(t&1))return Je(e,_e()),null;var n=ul(e,t);if(e.tag!==0&&n===2){var r=va(e);r!==0&&(t=r,n=Wa(e,r))}if(n===1)throw n=xo,sr(e,0),vn(e,t),Je(e,_e()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Xn(e,Ye,Bt),Je(e,_e()),null}function rf(e,t){var n=se;se|=1;try{return e(t)}finally{se=n,se===0&&(ci=_e()+500,Nl&&Un())}}function gr(e){zn!==null&&zn.tag===0&&!(se&6)&&Vr();var t=se;se|=1;var n=pt.transition,r=ce;try{if(pt.transition=null,ce=1,e)return e()}finally{ce=r,pt.transition=n,se=t,!(se&6)&&Un()}}function of(){tt=Rr.current,pe(Rr)}function sr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Gw(n)),ke!==null)for(n=ke.return;n!==null;){var r=n;switch(Oc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ks();break;case 3:ui(),pe(Ge),pe(be),Xc();break;case 5:Wc(r);break;case 4:ui();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:Vc(r.type._context);break;case 22:case 23:of()}n=n.return}if(ze=e,ke=e=On(e.current,null),je=tt=t,Pe=0,xo=null,tf=zl=mr=0,Ye=Gi=null,qn!==null){for(t=0;t<qn.length;t++)if(n=qn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}qn=null}return e}function Pg(e,t){do{var n=ke;try{if(Hc(),Ms.current=il,rl){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rl=!1}if(pr=0,Te=Ne=ve=null,Ki=!1,go=0,ef.current=null,n===null||n.return===null){Pe=1,xo=t,ke=null;break}e:{var o=e,s=n.return,l=n,u=t;if(t=je,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,d=l,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Dd(s);if(h!==null){h.flags&=-257,Ld(h,s,l,o,t),h.mode&1&&$d(o,a,t),t=h,u=a;var y=t.updateQueue;if(y===null){var v=new Set;v.add(u),t.updateQueue=v}else y.add(u);break e}else{if(!(t&1)){$d(o,a,t),sf();break e}u=Error(V(426))}}else if(me&&l.mode&1){var S=Dd(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Ld(S,s,l,o,t),bc(ai(u,l));break e}}o=u=ai(u,l),Pe!==4&&(Pe=2),Gi===null?Gi=[o]:Gi.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=fg(o,u,t);Pd(o,p);break e;case 1:l=u;var g=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof g.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ln===null||!Ln.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=dg(o,l,t);Pd(o,x);break e}}o=o.return}while(o!==null)}Ig(n)}catch(k){t=k,ke===n&&n!==null&&(ke=n=n.return);continue}break}while(!0)}function Tg(){var e=ol.current;return ol.current=il,e===null?il:e}function sf(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),ze===null||!(mr&268435455)&&!(zl&268435455)||vn(ze,je)}function ul(e,t){var n=se;se|=2;var r=Tg();(ze!==e||je!==t)&&(Bt=null,sr(e,t));do try{E1();break}catch(i){Pg(e,i)}while(!0);if(Hc(),se=n,ol.current=r,ke!==null)throw Error(V(261));return ze=null,je=0,Pe}function E1(){for(;ke!==null;)zg(ke)}function _1(){for(;ke!==null&&!Yx();)zg(ke)}function zg(e){var t=Rg(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Ig(e):ke=t,ef.current=null}function Ig(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=g1(n,t),n!==null){n.flags&=32767,ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pe=6,ke=null;return}}else if(n=m1(n,t,tt),n!==null){ke=n;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Pe===0&&(Pe=5)}function Xn(e,t,n){var r=ce,i=pt.transition;try{pt.transition=null,ce=1,k1(e,t,n,r)}finally{pt.transition=i,ce=r}return null}function k1(e,t,n,r){do Vr();while(zn!==null);if(se&6)throw Error(V(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(V(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(iw(e,o),e===ze&&(ke=ze=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||us||(us=!0,$g(Bs,function(){return Vr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=pt.transition,pt.transition=null;var s=ce;ce=1;var l=se;se|=4,ef.current=null,v1(e,n),Cg(n,e),Uw(ka),Qs=!!_a,ka=_a=null,e.current=n,x1(n),Kx(),se=l,ce=s,pt.transition=o}else e.current=n;if(us&&(us=!1,zn=e,ll=i),o=e.pendingLanes,o===0&&(Ln=null),Zx(n.stateNode),Je(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(sl)throw sl=!1,e=Ua,Ua=null,e;return ll&1&&e.tag!==0&&Vr(),o=e.pendingLanes,o&1?e===Qa?Zi++:(Zi=0,Qa=e):Zi=0,Un(),null}function Vr(){if(zn!==null){var e=fm(ll),t=pt.transition,n=ce;try{if(pt.transition=null,ce=16>e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,ll=0,se&6)throw Error(V(331));var i=se;for(se|=4,W=e.current;W!==null;){var o=W,s=o.child;if(W.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(W=a;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:qi(8,d,o)}var c=d.child;if(c!==null)c.return=d,W=c;else for(;W!==null;){d=W;var f=d.sibling,h=d.return;if(Eg(d),d===a){W=null;break}if(f!==null){f.return=h,W=f;break}W=h}}}var y=o.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)}}W=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,W=s;else e:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:qi(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,W=p;break e}W=o.return}}var g=e.current;for(W=g;W!==null;){s=W;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,W=m;else e:for(s=g;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Tl(9,l)}}catch(k){Se(l,l.return,k)}if(l===s){W=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,W=x;break e}W=l.return}}if(se=i,Un(),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Sl,e)}catch{}r=!0}return r}finally{ce=n,pt.transition=t}}return!1}function Kd(e,t,n){t=ai(n,t),t=fg(e,t,1),e=Dn(e,t,1),t=Be(),e!==null&&(Do(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)Kd(e,e,n);else for(;t!==null;){if(t.tag===3){Kd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=ai(n,e),e=dg(t,e,1),t=Dn(t,e,1),e=Be(),t!==null&&(Do(t,1,e),Je(t,e));break}}t=t.return}}function C1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Be(),e.pingedLanes|=e.suspendedLanes&n,ze===e&&(je&n)===n&&(Pe===4||Pe===3&&(je&130023424)===je&&500>_e()-nf?sr(e,0):tf|=n),Je(e,t)}function jg(e,t){t===0&&(e.mode&1?(t=Zo,Zo<<=1,!(Zo&130023424)&&(Zo=4194304)):t=1);var n=Be();e=tn(e,t),e!==null&&(Do(e,t,n),Je(e,n))}function N1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jg(e,n)}function M1(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(V(314))}r!==null&&r.delete(t),jg(e,n)}var Rg;Rg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,p1(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,me&&t.flags&1048576&&Am(t,Zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ts(e,t),e=t.pendingProps;var i=oi(t,be.current);Hr(t,n),i=Kc(null,t,r,e,i,n);var o=qc();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,Ze(r)?(o=!0,qs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uc(t),i.updater=Pl,t.stateNode=i,i._reactInternals=t,Ra(t,r,e,n),t=La(null,t,r,!0,o,n)):(t.tag=0,me&&o&&Ac(t),Ve(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ts(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=T1(r),e=vt(r,e),i){case 0:t=Da(null,t,r,e,n);break e;case 1:t=bd(null,t,r,e,n);break e;case 11:t=Ad(null,t,r,e,n);break e;case 14:t=Od(null,t,r,vt(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Da(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),bd(e,t,r,i,n);case 3:e:{if(gg(t),e===null)throw Error(V(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Bm(e,t),tl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ai(Error(V(423)),t),t=Fd(e,t,r,n,i);break e}else if(r!==i){i=ai(Error(V(424)),t),t=Fd(e,t,r,n,i);break e}else for(rt=$n(t.stateNode.containerInfo.firstChild),it=t,me=!0,_t=null,n=Hm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(si(),r===i){t=nn(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return Um(t),e===null&&za(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ca(r,i)?s=null:o!==null&&Ca(r,o)&&(t.flags|=32),mg(e,t),Ve(e,t,s,n),t.child;case 6:return e===null&&za(t),null;case 13:return yg(e,t,n);case 4:return Qc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=li(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:vt(r,i),Ad(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,o=t.memoizedProps,s=i.value,fe(Js,r._currentValue),r._currentValue=s,o!==null)if(Pt(o.value,s)){if(o.children===i.children&&!Ge.current){t=nn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Kt(-1,n&-n),u.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var d=a.pending;d===null?u.next=u:(u.next=d.next,d.next=u),a.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ia(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(V(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ia(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ve(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hr(t,n),i=mt(i),r=r(i),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,i=vt(r,t.pendingProps),i=vt(r.type,i),Od(e,t,r,i,n);case 15:return hg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Ts(e,t),t.tag=1,Ze(r)?(e=!0,qs(t)):e=!1,Hr(t,n),cg(t,r,i),Ra(t,r,i,n),La(null,t,r,!0,e,n);case 19:return vg(e,t,n);case 22:return pg(e,t,n)}throw Error(V(156,t.tag))};function $g(e,t){return lm(e,t)}function P1(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 ht(e,t,n,r){return new P1(e,t,n,r)}function lf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T1(e){if(typeof e=="function")return lf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cc)return 11;if(e===Nc)return 14}return 2}function On(e,t){var n=e.alternate;return n===null?(n=ht(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 js(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")lf(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case _r:return lr(n.children,i,o,t);case kc:s=8,i|=8;break;case ra:return e=ht(12,n,t,i|2),e.elementType=ra,e.lanes=o,e;case ia:return e=ht(13,n,t,i),e.elementType=ia,e.lanes=o,e;case oa:return e=ht(19,n,t,i),e.elementType=oa,e.lanes=o,e;case Up:return Il(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vp:s=10;break e;case Bp:s=9;break e;case Cc:s=11;break e;case Nc:s=14;break e;case pn:s=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=ht(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=ht(7,e,r,t),e.lanes=n,e}function Il(e,t,n,r){return e=ht(22,e,r,t),e.elementType=Up,e.lanes=n,e.stateNode={isHidden:!1},e}function zu(e,t,n){return e=ht(6,e,null,t),e.lanes=n,e}function Iu(e,t,n){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function z1(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=fu(0),this.expirationTimes=fu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uf(e,t,n,r,i,o,s,l,u){return e=new z1(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ht(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uc(o),e}function I1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Er,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Dg(e){if(!e)return Fn;e=e._reactInternals;e:{if(wr(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(Ze(n))return Dm(e,n,t)}return t}function Lg(e,t,n,r,i,o,s,l,u){return e=uf(n,r,!0,e,i,o,s,l,u),e.context=Dg(null),n=e.current,r=Be(),i=An(n),o=Kt(r,i),o.callback=t??null,Dn(n,o,i),e.current.lanes=i,Do(e,i,r),Je(e,r),e}function jl(e,t,n,r){var i=t.current,o=Be(),s=An(i);return n=Dg(n),t.context===null?t.context=n:t.pendingContext=n,t=Kt(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dn(i,t,s),e!==null&&(Mt(e,i,s,o),Ns(e,i,s)),s}function al(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 qd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function af(e,t){qd(e,t),(e=e.alternate)&&qd(e,t)}function j1(){return null}var Ag=typeof reportError=="function"?reportError:function(e){console.error(e)};function cf(e){this._internalRoot=e}Rl.prototype.render=cf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));jl(e,t,null,null)};Rl.prototype.unmount=cf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){jl(null,e,null,null)}),t[en]=null}};function Rl(e){this._internalRoot=e}Rl.prototype.unstable_scheduleHydration=function(e){if(e){var t=pm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<yn.length&&t!==0&&t<yn[n].priority;n++);yn.splice(n,0,e),n===0&&gm(e)}};function ff(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gd(){}function R1(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var a=al(s);o.call(a)}}var s=Lg(t,r,e,0,null,!1,!1,"",Gd);return e._reactRootContainer=s,e[en]=s.current,co(e.nodeType===8?e.parentNode:e),gr(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var a=al(u);l.call(a)}}var u=uf(e,0,!1,null,null,!1,!1,"",Gd);return e._reactRootContainer=u,e[en]=u.current,co(e.nodeType===8?e.parentNode:e),gr(function(){jl(t,u,n,r)}),u}function Dl(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var u=al(s);l.call(u)}}jl(t,s,e,i)}else s=R1(n,t,e,i,r);return al(s)}dm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Fi(t.pendingLanes);n!==0&&(Tc(t,n|1),Je(t,_e()),!(se&6)&&(ci=_e()+500,Un()))}break;case 13:gr(function(){var r=tn(e,1);if(r!==null){var i=Be();Mt(r,e,1,i)}}),af(e,1)}};zc=function(e){if(e.tag===13){var t=tn(e,134217728);if(t!==null){var n=Be();Mt(t,e,134217728,n)}af(e,134217728)}};hm=function(e){if(e.tag===13){var t=An(e),n=tn(e,t);if(n!==null){var r=Be();Mt(n,e,t,r)}af(e,t)}};pm=function(){return ce};mm=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};ma=function(e,t,n){switch(t){case"input":if(ua(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=Cl(r);if(!i)throw Error(V(90));Wp(r),ua(r,i)}}}break;case"textarea":Yp(e,n);break;case"select":t=n.value,t!=null&&Ar(e,!!n.multiple,t,!1)}};tm=rf;nm=gr;var $1={usingClientEntryPoint:!1,Events:[Ao,Mr,Cl,Jp,em,rf]},$i={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},D1={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:on.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=om(e),e===null?null:e.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||j1,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 as=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!as.isDisabled&&as.supportsFiber)try{Sl=as.inject(D1),At=as}catch{}}lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$1;lt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ff(t))throw Error(V(200));return I1(e,t,null,n)};lt.createRoot=function(e,t){if(!ff(e))throw Error(V(299));var n=!1,r="",i=Ag;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uf(e,1,!1,null,null,n,!1,r,i),e[en]=t.current,co(e.nodeType===8?e.parentNode:e),new cf(t)};lt.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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=om(t),e=e===null?null:e.stateNode,e};lt.flushSync=function(e){return gr(e)};lt.hydrate=function(e,t,n){if(!$l(t))throw Error(V(200));return Dl(null,e,t,!0,n)};lt.hydrateRoot=function(e,t,n){if(!ff(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=Ag;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Lg(t,null,e,1,n??null,i,!1,o,s),e[en]=t.current,co(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 Rl(t)};lt.render=function(e,t,n){if(!$l(t))throw Error(V(200));return Dl(null,e,t,!1,n)};lt.unmountComponentAtNode=function(e){if(!$l(e))throw Error(V(40));return e._reactRootContainer?(gr(function(){Dl(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1};lt.unstable_batchedUpdates=rf;lt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$l(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Dl(e,t,n,!1,r)};lt.version="18.3.1-next-f1338f8080-20240426";function Og(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Og)}catch(e){console.error(e)}}Og(),Op.exports=lt;var L1=Op.exports,bg,Zd=L1;bg=Zd.createRoot,Zd.hydrateRoot;function A1(){return`${typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}/api`}async function cs(e,t){const n=await fetch(A1()+e,t);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const Rs={runs(e){return cs(e?`/runs?status=${e}`:"/runs")},run(e){return cs(`/runs/${encodeURIComponent(e)}`)},retry(e){return cs(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},cancel(e){return cs(`/runs/${encodeURIComponent(e)}/cancel`,{method:"POST"})}},sn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function Fg(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),w.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function O1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function b1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"13",r:"8"}),w.jsx("path",{d:"M12 13V9M9 2h6"})]})}function F1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"12",r:"2"}),w.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 Hg(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"m4 12 5 5L20 6"})})}function Ll(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function H1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),w.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function V1(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Vg(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}const B1={local:Fg,remote:O1,sleep:b1,signal:F1};function df(e){return B1[e]??Fg}const Bg={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal"};function Jd(e,t){const n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}m`}function eh(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}function U1({value:e}){const[t,n]=D.useState(!1);return w.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?w.jsx(Hg,{width:11,height:11}):w.jsx(H1,{width:11,height:11}),t?"copied":"copy"]})}function Ya({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return w.jsxs("section",{className:"rise",children:[w.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[w.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),w.jsx(U1,{value:n})]}),w.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 Qn({k:e,v:t,mono:n=!0}){return w.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[w.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),w.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function Q1({step:e,run:t,onClose:n}){const r=e.status==="failed",i=df(e.kind),o=Jd(t.createdAt,e.startedAt);return w.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:[w.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${r?"bg-red-500/15 text-red-300":"bg-emerald-500/15 text-emerald-300"}`,children:w.jsx(i,{width:13,height:13})}),w.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),w.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",Bg[e.kind]??e.kind]})]}),w.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:w.jsx(Ll,{})})]}),w.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[w.jsxs("div",{className:"rounded-lg border border-[var(--line)] bg-black/20 px-3.5 py-1",children:[w.jsx(Qn,{k:"seq",v:`#${e.seq}`}),w.jsx(Qn,{k:"duration",v:Jd(e.startedAt,e.finishedAt)}),w.jsx(Qn,{k:"attempts",v:w.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&w.jsx(Vg,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&w.jsx(Qn,{k:"worker",v:`@${e.workerGroup}`}),w.jsx(Qn,{k:"started",v:eh(e.startedAt)}),w.jsx(Qn,{k:"finished",v:eh(e.finishedAt)}),w.jsx(Qn,{k:"offset",v:`+${o}`})]}),r&&e.error&&w.jsxs("section",{className:"rise",children:[w.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),w.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.output!==void 0&&w.jsx(Ya,{label:"output",value:e.output})]})]})}function W1({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return w.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:[w.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),w.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),w.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:w.jsx(Ll,{})})]}),w.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&w.jsxs("section",{className:"rise",children:[w.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),w.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&&w.jsx(Ya,{label:"input",value:e.input}),e.output!==void 0&&w.jsx(Ya,{label:"output",value:e.output}),n&&w.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function th(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function X1({run:e,timeline:t,selected:n,onSelect:r}){const{span:i,rows:o}=D.useMemo(()=>{const s=t.map(y=>new Date(y.startedAt).getTime()),l=t.map(y=>new Date(y.finishedAt).getTime()),u=Math.min(new Date(e.createdAt).getTime(),...s),a=e.status==="running"||e.status==="suspended",d=Math.max(...l,a?Date.now():u+1),c=Math.max(d-u,1);let f=u;const h=t.map(y=>{const v=new Date(y.finishedAt).getTime(),S=f;return f=v,{step:y,left:(S-u)/c*100,width:Math.max((v-S)/c*100,.8),ms:v-S}});return{span:c,rows:h}},[e,t]);return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[w.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),w.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",th(i)]})]}),w.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:o.map(({step:s,left:l,width:u,ms:a})=>{const d=s.status==="failed",c=df(s.kind),f=n===s.seq;return w.jsxs("button",{type:"button",onClick:()=>r(s.seq),className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${f?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[w.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[w.jsx("span",{className:d?"text-red-400":"text-emerald-400",children:w.jsx(c,{width:12,height:12})}),w.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:s.name})]}),w.jsxs("span",{className:"relative h-5",children:[w.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),w.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] ${d?"bg-red-500/35 ring-1 ring-red-500/50":f?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${l}%`,width:`${u}%`}}),w.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(${l+u}%, calc(100% - 44px))`},children:th(a)})]})]},s.seq)})})]})}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 Y1={value:()=>{}};function Al(){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 $s(n)}function $s(e){this._=e}function K1(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}})}$s.prototype=Al.prototype={constructor:$s,on:function(e,t){var n=this._,r=K1(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=q1(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=nh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nh(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 $s(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function q1(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Y1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ka="http://www.w3.org/1999/xhtml";const rh={svg:"http://www.w3.org/2000/svg",xhtml:Ka,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ol(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),rh.hasOwnProperty(t)?{space:rh[t],local:e}:e}function G1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ka&&t.documentElement.namespaceURI===Ka?t.createElement(e):t.createElementNS(n,e)}}function Z1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ug(e){var t=Ol(e);return(t.local?Z1:G1)(t)}function J1(){}function hf(e){return e==null?J1:function(){return this.querySelector(e)}}function eS(e){typeof e!="function"&&(e=hf(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=new Array(s),u,a,d=0;d<s;++d)(u=o[d])&&(a=e.call(u,u.__data__,d,o))&&("__data__"in u&&(a.__data__=u.__data__),l[d]=a);return new st(r,this._parents)}function tS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nS(){return[]}function Qg(e){return e==null?nS:function(){return this.querySelectorAll(e)}}function rS(e){return function(){return tS(e.apply(this,arguments))}}function iS(e){typeof e=="function"?e=rS(e):e=Qg(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&(r.push(e.call(u,u.__data__,a,s)),i.push(u));return new st(r,i)}function Wg(e){return function(){return this.matches(e)}}function Xg(e){return function(t){return t.matches(e)}}var oS=Array.prototype.find;function sS(e){return function(){return oS.call(this.children,e)}}function lS(){return this.firstElementChild}function uS(e){return this.select(e==null?lS:sS(typeof e=="function"?e:Xg(e)))}var aS=Array.prototype.filter;function cS(){return Array.from(this.children)}function fS(e){return function(){return aS.call(this.children,e)}}function dS(e){return this.selectAll(e==null?cS:fS(typeof e=="function"?e:Xg(e)))}function hS(e){typeof e!="function"&&(e=Wg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new st(r,this._parents)}function Yg(e){return new Array(e.length)}function pS(){return new st(this._enter||this._groups.map(Yg),this._parents)}function cl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}cl.prototype={constructor:cl,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 mS(e){return function(){return e}}function gS(e,t,n,r,i,o){for(var s=0,l,u=t.length,a=o.length;s<a;++s)(l=t[s])?(l.__data__=o[s],r[s]=l):n[s]=new cl(e,o[s]);for(;s<u;++s)(l=t[s])&&(i[s]=l)}function yS(e,t,n,r,i,o,s){var l,u,a=new Map,d=t.length,c=o.length,f=new Array(d),h;for(l=0;l<d;++l)(u=t[l])&&(f[l]=h=s.call(u,u.__data__,l,t)+"",a.has(h)?i[l]=u:a.set(h,u));for(l=0;l<c;++l)h=s.call(e,o[l],l,o)+"",(u=a.get(h))?(r[l]=u,u.__data__=o[l],a.delete(h)):n[l]=new cl(e,o[l]);for(l=0;l<d;++l)(u=t[l])&&a.get(f[l])===u&&(i[l]=u)}function vS(e){return e.__data__}function xS(e,t){if(!arguments.length)return Array.from(this,vS);var n=t?yS:gS,r=this._parents,i=this._groups;typeof e!="function"&&(e=mS(e));for(var o=i.length,s=new Array(o),l=new Array(o),u=new Array(o),a=0;a<o;++a){var d=r[a],c=i[a],f=c.length,h=wS(e.call(d,d&&d.__data__,a,r)),y=h.length,v=l[a]=new Array(y),S=s[a]=new Array(y),p=u[a]=new Array(f);n(d,c,v,S,p,h,t);for(var g=0,m=0,x,k;g<y;++g)if(x=v[g]){for(g>=m&&(m=g+1);!(k=S[m])&&++m<y;);x._next=k||null}}return s=new st(s,r),s._enter=l,s._exit=u,s}function wS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SS(){return new st(this._exit||this._groups.map(Yg),this._parents)}function ES(e,t,n){var r=this.enter(),i=this,o=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?o.remove():n(o),r&&i?r.merge(i).order():i}function _S(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),u=0;u<s;++u)for(var a=n[u],d=r[u],c=a.length,f=l[u]=new Array(c),h,y=0;y<c;++y)(h=a[y]||d[y])&&(f[y]=h);for(;u<i;++u)l[u]=n[u];return new st(l,this._parents)}function kS(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function CS(e){e||(e=NS);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,u=i[o]=new Array(l),a,d=0;d<l;++d)(a=s[d])&&(u[d]=a);u.sort(t)}return new st(i,this._parents).order()}function NS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function MS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function PS(){return Array.from(this)}function TS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function zS(){let e=0;for(const t of this)++e;return e}function IS(){return!this.node()}function jS(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&e.call(l,l.__data__,o,i);return this}function RS(e){return function(){this.removeAttribute(e)}}function $S(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DS(e,t){return function(){this.setAttribute(e,t)}}function LS(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function AS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function OS(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 bS(e,t){var n=Ol(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?$S:RS:typeof t=="function"?n.local?OS:AS:n.local?LS:DS)(n,t))}function Kg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function FS(e){return function(){this.style.removeProperty(e)}}function HS(e,t,n){return function(){this.style.setProperty(e,t,n)}}function VS(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function BS(e,t,n){return arguments.length>1?this.each((t==null?FS:typeof t=="function"?VS:HS)(e,t,n??"")):fi(this.node(),e)}function fi(e,t){return e.style.getPropertyValue(t)||Kg(e).getComputedStyle(e,null).getPropertyValue(t)}function US(e){return function(){delete this[e]}}function QS(e,t){return function(){this[e]=t}}function WS(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function XS(e,t){return arguments.length>1?this.each((t==null?US:typeof t=="function"?WS:QS)(e,t)):this.node()[e]}function qg(e){return e.trim().split(/^|\s+/)}function pf(e){return e.classList||new Gg(e)}function Gg(e){this._node=e,this._names=qg(e.getAttribute("class")||"")}Gg.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 Zg(e,t){for(var n=pf(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Jg(e,t){for(var n=pf(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function YS(e){return function(){Zg(this,e)}}function KS(e){return function(){Jg(this,e)}}function qS(e,t){return function(){(t.apply(this,arguments)?Zg:Jg)(this,e)}}function GS(e,t){var n=qg(e+"");if(arguments.length<2){for(var r=pf(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?qS:t?YS:KS)(n,t))}function ZS(){this.textContent=""}function JS(e){return function(){this.textContent=e}}function eE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tE(e){return arguments.length?this.each(e==null?ZS:(typeof e=="function"?eE:JS)(e)):this.node().textContent}function nE(){this.innerHTML=""}function rE(e){return function(){this.innerHTML=e}}function iE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function oE(e){return arguments.length?this.each(e==null?nE:(typeof e=="function"?iE:rE)(e)):this.node().innerHTML}function sE(){this.nextSibling&&this.parentNode.appendChild(this)}function lE(){return this.each(sE)}function uE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aE(){return this.each(uE)}function cE(e){var t=typeof e=="function"?e:Ug(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fE(){return null}function dE(e,t){var n=typeof e=="function"?e:Ug(e),r=t==null?fE:typeof t=="function"?t:hf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function hE(){var e=this.parentNode;e&&e.removeChild(this)}function pE(){return this.each(hE)}function mE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yE(e){return this.select(e?gE:mE)}function vE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function xE(e){return function(t){e.call(this,t,this.__data__)}}function wE(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 SE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function EE(e,t,n){return function(){var r=this.__on,i,o=xE(t);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function _E(e,t,n){var r=wE(e+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,d;u<a;++u)for(i=0,d=l[u];i<o;++i)if((s=r[i]).type===d.type&&s.name===d.name)return d.value}return}for(l=t?EE:SE,i=0;i<o;++i)this.each(l(r[i],t,n));return this}function e0(e,t,n){var r=Kg(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 kE(e,t){return function(){return e0(this,e,t)}}function CE(e,t){return function(){return e0(this,e,t.apply(this,arguments))}}function NE(e,t){return this.each((typeof t=="function"?CE:kE)(e,t))}function*ME(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var t0=[null];function st(e,t){this._groups=e,this._parents=t}function bo(){return new st([[document.documentElement]],t0)}function PE(){return this}st.prototype=bo.prototype={constructor:st,select:eS,selectAll:iS,selectChild:uS,selectChildren:dS,filter:hS,data:xS,enter:pS,exit:SS,join:ES,merge:_S,selection:PE,order:kS,sort:CS,call:MS,nodes:PS,node:TS,size:zS,empty:IS,each:jS,attr:bS,style:BS,property:XS,classed:GS,text:tE,html:oE,raise:lE,lower:aE,append:cE,insert:dE,remove:pE,clone:yE,datum:vE,on:_E,dispatch:NE,[Symbol.iterator]:ME};function nt(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],t0)}function TE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function St(e,t){if(e=TE(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 zE={passive:!1},wo={capture:!0,passive:!1};function ju(e){e.stopImmediatePropagation()}function Br(e){e.preventDefault(),e.stopImmediatePropagation()}function n0(e){var t=e.document.documentElement,n=nt(e).on("dragstart.drag",Br,wo);"onselectstart"in t?n.on("selectstart.drag",Br,wo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function r0(e,t){var n=e.document.documentElement,r=nt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Br,wo),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 fs=e=>()=>e;function qa(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:u,dy:a,dispatch:d}){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:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:d}})}qa.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function IE(e){return!e.ctrlKey&&!e.button}function jE(){return this.parentNode}function RE(e,t){return t??{x:e.x,y:e.y}}function $E(){return navigator.maxTouchPoints||"ontouchstart"in this}function i0(){var e=IE,t=jE,n=RE,r=$E,i={},o=Al("start","drag","end"),s=0,l,u,a,d,c=0;function f(x){x.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,zE).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(x,k){if(!(d||!e.call(this,x,k))){var z=m(this,t.call(this,x,k),x,k,"mouse");z&&(nt(x.view).on("mousemove.drag",y,wo).on("mouseup.drag",v,wo),n0(x.view),ju(x),a=!1,l=x.clientX,u=x.clientY,z("start",x))}}function y(x){if(Br(x),!a){var k=x.clientX-l,z=x.clientY-u;a=k*k+z*z>c}i.mouse("drag",x)}function v(x){nt(x.view).on("mousemove.drag mouseup.drag",null),r0(x.view,a),Br(x),i.mouse("end",x)}function S(x,k){if(e.call(this,x,k)){var z=x.changedTouches,C=t.call(this,x,k),M=z.length,I,j;for(I=0;I<M;++I)(j=m(this,C,x,k,z[I].identifier,z[I]))&&(ju(x),j("start",x,z[I]))}}function p(x){var k=x.changedTouches,z=k.length,C,M;for(C=0;C<z;++C)(M=i[k[C].identifier])&&(Br(x),M("drag",x,k[C]))}function g(x){var k=x.changedTouches,z=k.length,C,M;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),C=0;C<z;++C)(M=i[k[C].identifier])&&(ju(x),M("end",x,k[C]))}function m(x,k,z,C,M,I){var j=o.copy(),A=St(I||z,k),F,b,E;if((E=n.call(x,new qa("beforestart",{sourceEvent:z,target:f,identifier:M,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:j}),C))!=null)return F=E.x-A[0]||0,b=E.y-A[1]||0,function $(T,L,_){var P=A,R;switch(T){case"start":i[M]=$,R=s++;break;case"end":delete i[M],--s;case"drag":A=St(_||L,k),R=s;break}j.call(T,x,new qa(T,{sourceEvent:L,subject:E,target:f,identifier:M,active:R,x:A[0]+F,y:A[1]+b,dx:A[0]-P[0],dy:A[1]-P[1],dispatch:j}),C)}}return f.filter=function(x){return arguments.length?(e=typeof x=="function"?x:fs(!!x),f):e},f.container=function(x){return arguments.length?(t=typeof x=="function"?x:fs(x),f):t},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:fs(x),f):n},f.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:fs(!!x),f):r},f.on=function(){var x=o.on.apply(o,arguments);return x===o?f:x},f.clickDistance=function(x){return arguments.length?(c=(x=+x)*x,f):Math.sqrt(c)},f}function mf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function o0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fo(){}var So=.7,fl=1/So,Ur="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DE=/^#([0-9a-f]{3,8})$/,LE=new RegExp(`^rgb\\(${Ur},${Ur},${Ur}\\)$`),AE=new RegExp(`^rgb\\(${bt},${bt},${bt}\\)$`),OE=new RegExp(`^rgba\\(${Ur},${Ur},${Ur},${Eo}\\)$`),bE=new RegExp(`^rgba\\(${bt},${bt},${bt},${Eo}\\)$`),FE=new RegExp(`^hsl\\(${Eo},${bt},${bt}\\)$`),HE=new RegExp(`^hsla\\(${Eo},${bt},${bt},${Eo}\\)$`),ih={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};mf(Fo,_o,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oh,formatHex:oh,formatHex8:VE,formatHsl:BE,formatRgb:sh,toString:sh});function oh(){return this.rgb().formatHex()}function VE(){return this.rgb().formatHex8()}function BE(){return s0(this).formatHsl()}function sh(){return this.rgb().formatRgb()}function _o(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?lh(t):n===3?new qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ds(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ds(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=LE.exec(e))?new qe(t[1],t[2],t[3],1):(t=AE.exec(e))?new qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=OE.exec(e))?ds(t[1],t[2],t[3],t[4]):(t=bE.exec(e))?ds(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FE.exec(e))?ch(t[1],t[2]/100,t[3]/100,1):(t=HE.exec(e))?ch(t[1],t[2]/100,t[3]/100,t[4]):ih.hasOwnProperty(e)?lh(ih[e]):e==="transparent"?new qe(NaN,NaN,NaN,0):null}function lh(e){return new qe(e>>16&255,e>>8&255,e&255,1)}function ds(e,t,n,r){return r<=0&&(e=t=n=NaN),new qe(e,t,n,r)}function UE(e){return e instanceof Fo||(e=_o(e)),e?(e=e.rgb(),new qe(e.r,e.g,e.b,e.opacity)):new qe}function Ga(e,t,n,r){return arguments.length===1?UE(e):new qe(e,t,n,r??1)}function qe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mf(qe,Ga,o0(Fo,{brighter(e){return e=e==null?fl:Math.pow(fl,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?So:Math.pow(So,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qe(ur(this.r),ur(this.g),ur(this.b),dl(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:uh,formatHex:uh,formatHex8:QE,formatRgb:ah,toString:ah}));function uh(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}`}function QE(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}${Zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ah(){const e=dl(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function dl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zn(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kt(e,t,n,r)}function s0(e){if(e instanceof kt)return new kt(e.h,e.s,e.l,e.opacity);if(e instanceof Fo||(e=_o(e)),!e)return new kt;if(e instanceof kt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,u=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=u<.5?o+i:2-o-i,s*=60):l=u>0&&u<1?0:s,new kt(s,l,u,e.opacity)}function WE(e,t,n,r){return arguments.length===1?s0(e):new kt(e,t,n,r??1)}function kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mf(kt,WE,o0(Fo,{brighter(e){return e=e==null?fl:Math.pow(fl,e),new kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?So:Math.pow(So,e),new kt(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 qe(Ru(e>=240?e-240:e+120,i,r),Ru(e,i,r),Ru(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kt(fh(this.h),hs(this.s),hs(this.l),dl(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=dl(this.opacity);return`${e===1?"hsl(":"hsla("}${fh(this.h)}, ${hs(this.s)*100}%, ${hs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fh(e){return e=(e||0)%360,e<0?e+360:e}function hs(e){return Math.max(0,Math.min(1,e||0))}function Ru(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 l0=e=>()=>e;function XE(e,t){return function(n){return e+n*t}}function YE(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 KE(e){return(e=+e)==1?u0:function(t,n){return n-t?YE(t,n,e):l0(isNaN(t)?n:t)}}function u0(e,t){var n=t-e;return n?XE(e,n):l0(isNaN(e)?t:e)}const dh=function e(t){var n=KE(t);function r(i,o){var s=n((i=Ga(i)).r,(o=Ga(o)).r),l=n(i.g,o.g),u=n(i.b,o.b),a=u0(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=l(d),i.b=u(d),i.opacity=a(d),i+""}}return r.gamma=e,r}(1);function gn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Za=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$u=new RegExp(Za.source,"g");function qE(e){return function(){return e}}function GE(e){return function(t){return e(t)+""}}function ZE(e,t){var n=Za.lastIndex=$u.lastIndex=0,r,i,o,s=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Za.exec(e))&&(i=$u.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:gn(r,i)})),n=$u.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?u[0]?GE(u[0].x):qE(t):(t=u.length,function(a){for(var d=0,c;d<t;++d)l[(c=u[d]).i]=c.x(a);return l.join("")})}var hh=180/Math.PI,Ja={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function a0(e,t,n,r,i,o){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*hh,skewX:Math.atan(u)*hh,scaleX:s,scaleY:l}}var ps;function JE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ja:a0(t.a,t.b,t.c,t.d,t.e,t.f)}function e_(e){return e==null||(ps||(ps=document.createElementNS("http://www.w3.org/2000/svg","g")),ps.setAttribute("transform",e),!(e=ps.transform.baseVal.consolidate()))?Ja:(e=e.matrix,a0(e.a,e.b,e.c,e.d,e.e,e.f))}function c0(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function o(a,d,c,f,h,y){if(a!==c||d!==f){var v=h.push("translate(",null,t,null,n);y.push({i:v-4,x:gn(a,c)},{i:v-2,x:gn(d,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function s(a,d,c,f){a!==d?(a-d>180?d+=360:d-a>180&&(a+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:gn(a,d)})):d&&c.push(i(c)+"rotate("+d+r)}function l(a,d,c,f){a!==d?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:gn(a,d)}):d&&c.push(i(c)+"skewX("+d+r)}function u(a,d,c,f,h,y){if(a!==c||d!==f){var v=h.push(i(h)+"scale(",null,",",null,")");y.push({i:v-4,x:gn(a,c)},{i:v-2,x:gn(d,f)})}else(c!==1||f!==1)&&h.push(i(h)+"scale("+c+","+f+")")}return function(a,d){var c=[],f=[];return a=e(a),d=e(d),o(a.translateX,a.translateY,d.translateX,d.translateY,c,f),s(a.rotate,d.rotate,c,f),l(a.skewX,d.skewX,c,f),u(a.scaleX,a.scaleY,d.scaleX,d.scaleY,c,f),a=d=null,function(h){for(var y=-1,v=f.length,S;++y<v;)c[(S=f[y]).i]=S.x(h);return c.join("")}}}var t_=c0(JE,"px, ","px)","deg)"),n_=c0(e_,", ",")",")"),r_=1e-12;function ph(e){return((e=Math.exp(e))+1/e)/2}function i_(e){return((e=Math.exp(e))-1/e)/2}function o_(e){return((e=Math.exp(2*e))-1)/(e+1)}const s_=function e(t,n,r){function i(o,s){var l=o[0],u=o[1],a=o[2],d=s[0],c=s[1],f=s[2],h=d-l,y=c-u,v=h*h+y*y,S,p;if(v<r_)p=Math.log(f/a)/t,S=function(C){return[l+C*h,u+C*y,a*Math.exp(t*C*p)]};else{var g=Math.sqrt(v),m=(f*f-a*a+r*v)/(2*a*n*g),x=(f*f-a*a-r*v)/(2*f*n*g),k=Math.log(Math.sqrt(m*m+1)-m),z=Math.log(Math.sqrt(x*x+1)-x);p=(z-k)/t,S=function(C){var M=C*p,I=ph(k),j=a/(n*g)*(I*o_(t*M+k)-i_(k));return[l+j*h,u+j*y,a*I/ph(t*M+k)]}}return S.duration=p*1e3*t/Math.SQRT2,S}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,u=l*l;return e(s,l,u)},i}(Math.SQRT2,2,4);var di=0,Vi=0,Di=0,f0=1e3,hl,Bi,pl=0,yr=0,bl=0,ko=typeof performance=="object"&&performance.now?performance:Date,d0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function gf(){return yr||(d0(l_),yr=ko.now()+bl)}function l_(){yr=0}function ml(){this._call=this._time=this._next=null}ml.prototype=h0.prototype={constructor:ml,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?gf():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:hl=this,Bi=this),this._call=e,this._time=n,ec()},stop:function(){this._call&&(this._call=null,this._time=1/0,ec())}};function h0(e,t,n){var r=new ml;return r.restart(e,t,n),r}function u_(){gf(),++di;for(var e=hl,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--di}function mh(){yr=(pl=ko.now())+bl,di=Vi=0;try{u_()}finally{di=0,c_(),yr=0}}function a_(){var e=ko.now(),t=e-pl;t>f0&&(bl-=t,pl=e)}function c_(){for(var e,t=hl,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:hl=n);Bi=e,ec(r)}function ec(e){if(!di){Vi&&(Vi=clearTimeout(Vi));var t=e-yr;t>24?(e<1/0&&(Vi=setTimeout(mh,e-ko.now()-bl)),Di&&(Di=clearInterval(Di))):(Di||(pl=ko.now(),Di=setInterval(a_,f0)),di=1,d0(mh))}}function gh(e,t,n){var r=new ml;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var f_=Al("start","end","cancel","interrupt"),d_=[],p0=0,yh=1,tc=2,Ds=3,vh=4,nc=5,Ls=6;function Fl(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;h_(e,n,{name:t,index:r,group:i,on:f_,tween:d_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:p0})}function yf(e,t){var n=Tt(e,t);if(n.state>p0)throw new Error("too late; already scheduled");return n}function Ft(e,t){var n=Tt(e,t);if(n.state>Ds)throw new Error("too late; already running");return n}function Tt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function h_(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=h0(o,0,n.time);function o(a){n.state=yh,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var d,c,f,h;if(n.state!==yh)return u();for(d in r)if(h=r[d],h.name===n.name){if(h.state===Ds)return gh(s);h.state===vh?(h.state=Ls,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=Ls,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(gh(function(){n.state===Ds&&(n.state=vh,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=tc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tc){for(n.state=Ds,i=new Array(f=n.tween.length),d=0,c=-1;d<f;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function l(a){for(var d=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=nc,1),c=-1,f=i.length;++c<f;)i[c].call(e,d);n.state===nc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Ls,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function As(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>tc&&r.state<nc,r.state=Ls,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function p_(e){return this.each(function(){As(this,e)})}function m_(e,t){var n,r;return function(){var i=Ft(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function g_(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ft(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var l={name:t,value:n},u=0,a=i.length;u<a;++u)if(i[u].name===t){i[u]=l;break}u===a&&i.push(l)}o.tween=i}}function y_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Tt(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?m_:g_)(n,e,t))}function vf(e,t,n){var r=e._id;return e.each(function(){var i=Ft(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Tt(i,r).value[t]}}function m0(e,t){var n;return(typeof t=="number"?gn:t instanceof _o?dh:(n=_o(t))?(t=n,dh):ZE)(e,t)}function v_(e){return function(){this.removeAttribute(e)}}function x_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function w_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function S_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function E_(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function __(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function k_(e,t){var n=Ol(e),r=n==="transform"?n_:m0;return this.attrTween(e,typeof t=="function"?(n.local?__:E_)(n,r,vf(this,"attr."+e,t)):t==null?(n.local?x_:v_)(n):(n.local?S_:w_)(n,r,t))}function C_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function N_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function M_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&N_(e,o)),n}return i._value=t,i}function P_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&C_(e,o)),n}return i._value=t,i}function T_(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=Ol(e);return this.tween(n,(r.local?M_:P_)(r,t))}function z_(e,t){return function(){yf(this,e).delay=+t.apply(this,arguments)}}function I_(e,t){return t=+t,function(){yf(this,e).delay=t}}function j_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?z_:I_)(t,e)):Tt(this.node(),t).delay}function R_(e,t){return function(){Ft(this,e).duration=+t.apply(this,arguments)}}function $_(e,t){return t=+t,function(){Ft(this,e).duration=t}}function D_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?R_:$_)(t,e)):Tt(this.node(),t).duration}function L_(e,t){if(typeof t!="function")throw new Error;return function(){Ft(this,e).ease=t}}function A_(e){var t=this._id;return arguments.length?this.each(L_(t,e)):Tt(this.node(),t).ease}function O_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ft(this,e).ease=n}}function b_(e){if(typeof e!="function")throw new Error;return this.each(O_(this._id,e))}function F_(e){typeof e!="function"&&(e=Wg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new rn(r,this._parents,this._name,this._id)}function H_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),l=0;l<o;++l)for(var u=t[l],a=n[l],d=u.length,c=s[l]=new Array(d),f,h=0;h<d;++h)(f=u[h]||a[h])&&(c[h]=f);for(;l<r;++l)s[l]=t[l];return new rn(s,this._parents,this._name,this._id)}function V_(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 B_(e,t,n){var r,i,o=V_(t)?yf:Ft;return function(){var s=o(this,e),l=s.on;l!==r&&(i=(r=l).copy()).on(t,n),s.on=i}}function U_(e,t){var n=this._id;return arguments.length<2?Tt(this.node(),n).on.on(e):this.each(B_(n,e,t))}function Q_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function W_(){return this.on("end.remove",Q_(this._id))}function X_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hf(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var l=r[s],u=l.length,a=o[s]=new Array(u),d,c,f=0;f<u;++f)(d=l[f])&&(c=e.call(d,d.__data__,f,l))&&("__data__"in d&&(c.__data__=d.__data__),a[f]=c,Fl(a[f],t,n,f,a,Tt(d,n)));return new rn(o,this._parents,t,n)}function Y_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qg(e));for(var r=this._groups,i=r.length,o=[],s=[],l=0;l<i;++l)for(var u=r[l],a=u.length,d,c=0;c<a;++c)if(d=u[c]){for(var f=e.call(d,d.__data__,c,u),h,y=Tt(d,n),v=0,S=f.length;v<S;++v)(h=f[v])&&Fl(h,t,n,v,f,y);o.push(f),s.push(d)}return new rn(o,s,t,n)}var K_=bo.prototype.constructor;function q_(){return new K_(this._groups,this._parents)}function G_(e,t){var n,r,i;return function(){var o=fi(this,e),s=(this.style.removeProperty(e),fi(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function g0(e){return function(){this.style.removeProperty(e)}}function Z_(e,t,n){var r,i=n+"",o;return function(){var s=fi(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function J_(e,t,n){var r,i,o;return function(){var s=fi(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),fi(this,e))),s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l))}}function e2(e,t){var n,r,i,o="style."+t,s="end."+o,l;return function(){var u=Ft(this,e),a=u.on,d=u.value[o]==null?l||(l=g0(t)):void 0;(a!==n||i!==d)&&(r=(n=a).copy()).on(s,i=d),u.on=r}}function t2(e,t,n){var r=(e+="")=="transform"?t_:m0;return t==null?this.styleTween(e,G_(e,r)).on("end.style."+e,g0(e)):typeof t=="function"?this.styleTween(e,J_(e,r,vf(this,"style."+e,t))).each(e2(this._id,e)):this.styleTween(e,Z_(e,r,t),n).on("end.style."+e,null)}function n2(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function r2(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&n2(e,s,n)),r}return o._value=t,o}function i2(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,r2(e,t,n??""))}function o2(e){return function(){this.textContent=e}}function s2(e){return function(){var t=e(this);this.textContent=t??""}}function l2(e){return this.tween("text",typeof e=="function"?s2(vf(this,"text",e)):o2(e==null?"":e+""))}function u2(e){return function(t){this.textContent=e.call(this,t)}}function a2(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&u2(i)),t}return r._value=e,r}function c2(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,a2(e))}function f2(){for(var e=this._name,t=this._id,n=y0(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)if(u=s[a]){var d=Tt(u,t);Fl(u,e,n,a,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new rn(r,this._parents,e,n)}function d2(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var l={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var a=Ft(this,r),d=a.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),i===0&&o()})}var h2=0;function rn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function y0(){return++h2}var Ht=bo.prototype;rn.prototype={constructor:rn,select:X_,selectAll:Y_,selectChild:Ht.selectChild,selectChildren:Ht.selectChildren,filter:F_,merge:H_,selection:q_,transition:f2,call:Ht.call,nodes:Ht.nodes,node:Ht.node,size:Ht.size,empty:Ht.empty,each:Ht.each,on:U_,attr:k_,attrTween:T_,style:t2,styleTween:i2,text:l2,textTween:c2,remove:W_,tween:y_,delay:j_,duration:D_,ease:A_,easeVarying:b_,end:d2,[Symbol.iterator]:Ht[Symbol.iterator]};function p2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var m2={time:null,delay:0,duration:250,ease:p2};function g2(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 y2(e){var t,n;e instanceof rn?(t=e._id,e=e._name):(t=y0(),(n=m2).time=gf(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&Fl(u,e,t,a,s,n||g2(u,t));return new rn(r,this._parents,e,t)}bo.prototype.interrupt=p_;bo.prototype.transition=y2;const ms=e=>()=>e;function v2(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 Yt(e,t,n){this.k=e,this.x=t,this.y=n}Yt.prototype={constructor:Yt,scale:function(e){return e===1?this:new Yt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Yt(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 Hl=new Yt(1,0,0);v0.prototype=Yt.prototype;function v0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hl;return e.__zoom}function Du(e){e.stopImmediatePropagation()}function Li(e){e.preventDefault(),e.stopImmediatePropagation()}function x2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function w2(){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 xh(){return this.__zoom||Hl}function S2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function E2(){return navigator.maxTouchPoints||"ontouchstart"in this}function _2(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function x0(){var e=x2,t=w2,n=_2,r=S2,i=E2,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=s_,a=Al("start","zoom","end"),d,c,f,h=500,y=150,v=0,S=10;function p(E){E.property("__zoom",xh).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",b).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,$,T,L){var _=E.selection?E.selection():E;_.property("__zoom",xh),E!==_?k(E,$,T,L):_.interrupt().each(function(){z(this,arguments).event(L).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},p.scaleBy=function(E,$,T,L){p.scaleTo(E,function(){var _=this.__zoom.k,P=typeof $=="function"?$.apply(this,arguments):$;return _*P},T,L)},p.scaleTo=function(E,$,T,L){p.transform(E,function(){var _=t.apply(this,arguments),P=this.__zoom,R=T==null?x(_):typeof T=="function"?T.apply(this,arguments):T,O=P.invert(R),H=typeof $=="function"?$.apply(this,arguments):$;return n(m(g(P,H),R,O),_,s)},T,L)},p.translateBy=function(E,$,T,L){p.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,L)},p.translateTo=function(E,$,T,L,_){p.transform(E,function(){var P=t.apply(this,arguments),R=this.__zoom,O=L==null?x(P):typeof L=="function"?L.apply(this,arguments):L;return n(Hl.translate(O[0],O[1]).scale(R.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof T=="function"?-T.apply(this,arguments):-T),P,s)},L,_)};function g(E,$){return $=Math.max(o[0],Math.min(o[1],$)),$===E.k?E:new Yt($,E.x,E.y)}function m(E,$,T){var L=$[0]-T[0]*E.k,_=$[1]-T[1]*E.k;return L===E.x&&_===E.y?E:new Yt(E.k,L,_)}function x(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,$,T,L){E.on("start.zoom",function(){z(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(L).end()}).tween("zoom",function(){var _=this,P=arguments,R=z(_,P).event(L),O=t.apply(_,P),H=T==null?x(O):typeof T=="function"?T.apply(_,P):T,K=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),U=_.__zoom,Y=typeof $=="function"?$.apply(_,P):$,X=u(U.invert(H).concat(K/U.k),Y.invert(H).concat(K/Y.k));return function(G){if(G===1)G=Y;else{var B=X(G),ee=K/B[2];G=new Yt(ee,H[0]-B[0]*ee,H[1]-B[1]*ee)}R.zoom(null,G)}})}function z(E,$,T){return!T&&E.__zooming||new C(E,$)}function C(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}C.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 $=nt(this.that).datum();a.call(E,this.that,new v2(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:a}),$)}};function M(E,...$){if(!e.apply(this,arguments))return;var T=z(this,$).event(E),L=this.__zoom,_=Math.max(o[0],Math.min(o[1],L.k*Math.pow(2,r.apply(this,arguments)))),P=St(E);if(T.wheel)(T.mouse[0][0]!==P[0]||T.mouse[0][1]!==P[1])&&(T.mouse[1]=L.invert(T.mouse[0]=P)),clearTimeout(T.wheel);else{if(L.k===_)return;T.mouse=[P,L.invert(P)],As(this),T.start()}Li(E),T.wheel=setTimeout(R,y),T.zoom("mouse",n(m(g(L,_),T.mouse[0],T.mouse[1]),T.extent,s));function R(){T.wheel=null,T.end()}}function I(E,...$){if(f||!e.apply(this,arguments))return;var T=E.currentTarget,L=z(this,$,!0).event(E),_=nt(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",K,!0),P=St(E,T),R=E.clientX,O=E.clientY;n0(E.view),Du(E),L.mouse=[P,this.__zoom.invert(P)],As(this),L.start();function H(U){if(Li(U),!L.moved){var Y=U.clientX-R,X=U.clientY-O;L.moved=Y*Y+X*X>v}L.event(U).zoom("mouse",n(m(L.that.__zoom,L.mouse[0]=St(U,T),L.mouse[1]),L.extent,s))}function K(U){_.on("mousemove.zoom mouseup.zoom",null),r0(U.view,L.moved),Li(U),L.event(U).end()}}function j(E,...$){if(e.apply(this,arguments)){var T=this.__zoom,L=St(E.changedTouches?E.changedTouches[0]:E,this),_=T.invert(L),P=T.k*(E.shiftKey?.5:2),R=n(m(g(T,P),L,_),t.apply(this,$),s);Li(E),l>0?nt(this).transition().duration(l).call(k,R,L,E):nt(this).call(p.transform,R,L,E)}}function A(E,...$){if(e.apply(this,arguments)){var T=E.touches,L=T.length,_=z(this,$,E.changedTouches.length===L).event(E),P,R,O,H;for(Du(E),R=0;R<L;++R)O=T[R],H=St(O,this),H=[H,this.__zoom.invert(H),O.identifier],_.touch0?!_.touch1&&_.touch0[2]!==H[2]&&(_.touch1=H,_.taps=0):(_.touch0=H,P=!0,_.taps=1+!!d);d&&(d=clearTimeout(d)),P&&(_.taps<2&&(c=H[0],d=setTimeout(function(){d=null},h)),As(this),_.start())}}function F(E,...$){if(this.__zooming){var T=z(this,$).event(E),L=E.changedTouches,_=L.length,P,R,O,H;for(Li(E),P=0;P<_;++P)R=L[P],O=St(R,this),T.touch0&&T.touch0[2]===R.identifier?T.touch0[0]=O:T.touch1&&T.touch1[2]===R.identifier&&(T.touch1[0]=O);if(R=T.that.__zoom,T.touch1){var K=T.touch0[0],U=T.touch0[1],Y=T.touch1[0],X=T.touch1[1],G=(G=Y[0]-K[0])*G+(G=Y[1]-K[1])*G,B=(B=X[0]-U[0])*B+(B=X[1]-U[1])*B;R=g(R,Math.sqrt(G/B)),O=[(K[0]+Y[0])/2,(K[1]+Y[1])/2],H=[(U[0]+X[0])/2,(U[1]+X[1])/2]}else if(T.touch0)O=T.touch0[0],H=T.touch0[1];else return;T.zoom("touch",n(m(R,O,H),T.extent,s))}}function b(E,...$){if(this.__zooming){var T=z(this,$).event(E),L=E.changedTouches,_=L.length,P,R;for(Du(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),P=0;P<_;++P)R=L[P],T.touch0&&T.touch0[2]===R.identifier?delete T.touch0:T.touch1&&T.touch1[2]===R.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(R=St(R,this),Math.hypot(c[0]-R[0],c[1]-R[1])<S)){var O=nt(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:ms(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:ms(!!E),p):e},p.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:ms(!!E),p):i},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:ms([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],p):[o[0],o[1]]},p.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(u=E,p):u},p.on=function(){var E=a.on.apply(a,arguments);return E===a?p:E},p.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,p):Math.sqrt(v)},p.tapDistance=function(E){return arguments.length?(S=+E,p):S},p}const ln={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.`},Co=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],w0=["Enter"," ","Escape"];var hi;(function(e){e.Strict="strict",e.Loose="loose"})(hi||(hi={}));var ar;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ar||(ar={}));var No;(function(e){e.Partial="partial",e.Full="full"})(No||(No={}));const S0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var xn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(xn||(xn={}));var gl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gl||(gl={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));const wh={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top};function E0(e){return e===null?null:e?"valid":"invalid"}const _0=e=>"id"in e&&"source"in e&&"target"in e,k2=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),xf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ho=(e,t=[0,0])=>{const{width:n,height:r}=un(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},C2=(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 o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):xf(i)?i:t.nodeLookup.get(i.id));const l=s?yl(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Vl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Bl(n)},Vo=(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=yl(r);n=Vl(n,i)}}),Bl(n)},k0=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const l={...Bo(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const a of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=a;if(s&&!c||f)continue;const h=d.width??a.width??a.initialWidth??null,y=d.height??a.height??a.initialHeight??null,v=Mo(l,mi(a)),S=(h??0)*(y??0),p=o&&v>0;(!a.internals.handleBounds||p||v>=S||a.dragging)&&u.push(a)}return u},N2=(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 rc(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 ic({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!1);const l=Vo(e),u=wf(l,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function C0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=i;if(s.extent==="parent"&&!s.expandParent)if(!l)o==null||o("005",ln.error005());else{const h=l.measured.width,y=l.measured.height;h&&y&&(c=[[u,a],[u+h,a+y]])}else l&&gi(s.extent)&&(c=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const f=gi(c)?vr(t,c,s.measured):t;return{position:{x:f.x-u+s.measured.width*d[0],y:f.y-a+s.measured.height*d[1]},positionAbsolute:f}}async function M2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),y=!h&&f.parentId&&s.find(v=>v.id===f.parentId);(h||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),d=N2(s,u);for(const f of u)l.has(f.id)&&!d.find(y=>y.id===f.id)&&d.push(f);if(!i)return{edges:d,nodes:s};const c=await i({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const pi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),vr=(e={x:0,y:0},t,n)=>({x:pi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:pi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function N0(e,t,n){const{width:r,height:i}=un(n),{x:o,y:s}=n.internals.positionAbsolute;return vr(e,[[o,s],[o+r,s+i]],t)}const Sh=(e,t,n)=>e<t?pi(Math.abs(e-t),1,t)/t:e>n?-pi(Math.abs(e-n),1,t)/t:0,M0=(e,t,n=15,r=40)=>{const i=Sh(e.x,r,t.width-r)*n,o=Sh(e.y,r,t.height-r)*n;return[i,o]},Vl=(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)}),oc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Bl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mi=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=xf(e)?e.internals.positionAbsolute:Ho(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},yl=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=xf(e)?e.internals.positionAbsolute:Ho(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},P0=(e,t)=>Bl(Vl(oc(e),oc(t))),Mo=(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)},Eh=e=>Ct(e.width)&&Ct(e.height)&&Ct(e.x)&&Ct(e.y),Ct=e=>!isNaN(e)&&isFinite(e),P2=(e,t)=>{},Ul=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Bo=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?Ul(l,s):l},T0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),wf=(e,t,n,r,i,o)=>{const s=t/(e.width*(1+o)),l=n/(e.height*(1+o)),u=Math.min(s,l),a=pi(u,r,i),d=e.x+e.width/2,c=e.y+e.height/2,f=t/2-d*a,h=n/2-c*a;return{x:f,y:h,zoom:a}},vl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gi(e){return e!==void 0&&e!=="parent"}function un(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 z0(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 I0(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const l=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Ji(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=qt(e),l=Bo({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:u,y:a}=n?Ul(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const Ql=e=>({width:e.offsetWidth,height:e.offsetHeight}),j0=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},T2=["INPUT","SELECT","TEXTAREA"];function sc(e){var r,i,o;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return T2.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const R0=e=>"clientX"in e,qt=(e,t)=>{var o,s;const n=R0(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},_h=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Ql(s)}})};function $0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:l}){const u=e*.125+i*.375+s*.375+n*.125,a=t*.125+o*.375+l*.375+r*.125,d=Math.abs(u-e),c=Math.abs(a-t);return[u,a,d,c]}function gs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function kh({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case q.Left:return[t-gs(t-r,o),n];case q.Right:return[t+gs(r-t,o),n];case q.Top:return[t,n-gs(n-i,o)];case q.Bottom:return[t,n+gs(i-n,o)]}}function D0({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top,curvature:s=.25}){const[l,u]=kh({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[a,d]=kh({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[c,f,h,y]=$0({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${u} ${a},${d} ${r},${i}`,c,f,h,y]}function L0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[o,l,i,s]}function z2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const o=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?s:0)}function I2({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=Vl(yl(e),yl(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Mo(s,Bl(o))>0}const j2=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,R2=(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)),$2=(e,t)=>{if(!e.source||!e.target)return t;let n;return _0(e)?n={...e}:n={...e,id:j2(e)},R2(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function A0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,l]=L0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,l]}const Ch={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},D2=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.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},Nh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function L2({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:r=q.Top,center:i,offset:o}){const s=Ch[t],l=Ch[r],u={x:e.x+s.x*o,y:e.y+s.y*o},a={x:n.x+l.x*o,y:n.y+l.y*o},d=D2({source:u,sourcePosition:t,target:a}),c=d.x!==0?"x":"y",f=d[c];let h=[],y,v;const S={x:0,y:0},p={x:0,y:0},[g,m,x,k]=L0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[c]*l[c]===-1){y=i.x??g,v=i.y??m;const C=[{x:y,y:u.y},{x:y,y:a.y}],M=[{x:u.x,y:v},{x:a.x,y:v}];s[c]===f?h=c==="x"?C:M:h=c==="x"?M:C}else{const C=[{x:u.x,y:a.y}],M=[{x:a.x,y:u.y}];if(c==="x"?h=s.x===f?M:C:h=s.y===f?C:M,t===r){const b=Math.abs(e[c]-n[c]);if(b<=o){const E=Math.min(o-1,o-b);s[c]===f?S[c]=(u[c]>e[c]?-1:1)*E:p[c]=(a[c]>n[c]?-1:1)*E}}if(t!==r){const b=c==="x"?"y":"x",E=s[c]===l[b],$=u[b]>a[b],T=u[b]<a[b];(s[c]===1&&(!E&&$||E&&T)||s[c]!==1&&(!E&&T||E&&$))&&(h=c==="x"?C:M)}const I={x:u.x+S.x,y:u.y+S.y},j={x:a.x+p.x,y:a.y+p.y},A=Math.max(Math.abs(I.x-h[0].x),Math.abs(j.x-h[0].x)),F=Math.max(Math.abs(I.y-h[0].y),Math.abs(j.y-h[0].y));A>=F?(y=(I.x+j.x)/2,v=h[0].y):(y=h[0].x,v=(I.y+j.y)/2)}return[[e,{x:u.x+S.x,y:u.y+S.y},...h,{x:a.x+p.x,y:a.y+p.y},n],y,v,x,k]}function A2(e,t,n,r){const i=Math.min(Nh(e,t)/2,Nh(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${o+i*a},${s}Q ${o},${s} ${o},${s+i*d}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${s+i*u}Q ${o},${s} ${o+i*l},${s}`}function lc({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top,borderRadius:s=5,centerX:l,centerY:u,offset:a=20}){const[d,c,f,h,y]=L2({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:u},offset:a});return[d.reduce((S,p,g)=>{let m="";return g>0&&g<d.length-1?m=A2(d[g-1],p,d[g+1],s):m=`${g===0?"M":"L"}${p.x} ${p.y}`,S+=m,S},""),c,f,h,y]}function Mh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function O2(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Mh(t)||!Mh(n))return null;const r=t.internals.handleBounds||Ph(t.handles),i=n.internals.handleBounds||Ph(n.handles),o=Th((r==null?void 0:r.source)??[],e.sourceHandle),s=Th(e.connectionMode===hi.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(c=e.onError)==null||c.call(e,"008",ln.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||q.Bottom,u=(s==null?void 0:s.position)||q.Top,a=Po(t,o,l),d=Po(n,s,u);return{sourceX:a.x,sourceY:a.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:u}}function Ph(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 Po(e,t,n=q.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??un(e);if(r)return{x:i+s/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case q.Top:return{x:i+s/2,y:o};case q.Right:return{x:i+s,y:o+l/2};case q.Bottom:return{x:i+s/2,y:o+l};case q.Left:return{x:i,y:o+l/2}}}function Th(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function uc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function b2(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const a=uc(u,t);o.has(a)||(s.push({id:a,color:u.color||n,...u}),o.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Sf={nodeOrigin:[0,0],nodeExtent:Co,elevateNodesOnSelect:!0,defaults:{}},F2={...Sf,checkEquality:!0};function Ef(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function H2(e,t,n){const r=Ef(Sf,n);for(const i of e.values())if(i.parentId)_f(i,e,t,r);else{const o=Ho(i,r.nodeOrigin),s=gi(i.extent)?i.extent:r.nodeExtent,l=vr(o,s,un(i));i.internals.positionAbsolute=l}}function ac(e,t,n,r){var l,u;const i=Ef(F2,r),o=new Map(t),s=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const a of e){let d=o.get(a.id);if(i.checkEquality&&a===(d==null?void 0:d.internals.userNode))t.set(a.id,d);else{const c=Ho(a,i.nodeOrigin),f=gi(a.extent)?a.extent:i.nodeExtent,h=vr(c,f,un(a));d={...i.defaults,...a,measured:{width:(l=a.measured)==null?void 0:l.width,height:(u=a.measured)==null?void 0:u.height},internals:{positionAbsolute:h,handleBounds:a.measured?d==null?void 0:d.internals.handleBounds:void 0,z:O0(a,s),userNode:a}},t.set(a.id,d)}a.parentId&&_f(d,t,n,r)}}function V2(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 _f(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=Ef(Sf,r),l=e.parentId,u=t.get(l);if(!u){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}V2(e,n);const a=i?1e3:0,{x:d,y:c,z:f}=B2(e,u,o,s,a),{positionAbsolute:h}=e.internals,y=d!==h.x||c!==h.y;(y||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:d,y:c}:h,z:f})}function O0(e,t){return(Ct(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function B2(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,l=un(e),u=Ho(e,n),a=gi(e.extent)?vr(u,e.extent,l):u;let d=vr({x:o+a.x,y:s+a.y},r,l);e.extent==="parent"&&(d=N0(d,l,t));const c=O0(e,i),f=t.internals.z??0;return{x:d.x,y:d.y,z:f>c?f:c}}function kf(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=o.get(l.parentId))==null?void 0:s.expandedRect)??mi(u),d=P0(a,l.rect);o.set(l.parentId,{expandedRect:d,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},a)=>{var m;const d=u.internals.positionAbsolute,c=un(u),f=u.origin??r,h=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,y=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,v=Math.max(c.width,Math.round(l.width)),S=Math.max(c.height,Math.round(l.height)),p=(v-c.width)*f[0],g=(S-c.height)*f[1];(h>0||y>0||p||g)&&(i.push({id:a,type:"position",position:{x:u.position.x-h+p,y:u.position.y-y+g}}),(m=n.get(a))==null||m.forEach(x=>{e.some(k=>k.id===x.id)||i.push({id:x.id,type:"position",position:{x:x.position.x+h,y:x.position.y+y}})})),(c.width<l.width||c.height<l.height||h||y)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:v+(h?f[0]*h-p:0),height:S+(y?f[1]*y-g:0)}})}),i}function U2(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const u=[],a=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(a.transform),c=[];for(const f of e.values()){const h=t.get(f.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const y=Ql(f.nodeElement),v=h.measured.width!==y.width||h.measured.height!==y.height;if(!!(y.width&&y.height&&(v||!h.internals.handleBounds||f.force))){const p=f.nodeElement.getBoundingClientRect(),g=gi(h.extent)?h.extent:o;let{positionAbsolute:m}=h.internals;h.parentId&&h.extent==="parent"?m=N0(m,y,t.get(h.parentId)):g&&(m=vr(m,g,y)),h.measured=y,h.internals={...h.internals,positionAbsolute:m,handleBounds:{source:_h("source",f.nodeElement,p,d,h.id),target:_h("target",f.nodeElement,p,d,h.id)}},h.parentId&&_f(h,t,n,{nodeOrigin:i}),l=!0,v&&(u.push({id:h.id,type:"dimensions",dimensions:y}),h.expandParent&&h.parentId&&c.push({id:h.id,parentId:h.parentId,rect:mi(h,i)}))}}}if(c.length>0){const f=kf(c,t,n,i);u.push(...f)}return{changes:u,updatedInternals:l}}async function Q2({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function b0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:l=null}=r,u=`${i}-source-${s}`,a=`${o}-target-${l}`,d=e.get(u)||new Map,c=e.get(a)||new Map,f={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:l};t.set(r.id,r),e.set(u,d.set(`${o}-${l}`,f)),e.set(a,c.set(`${i}-${s}`,f))}}function F0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:F0(n,t):!1}function zh(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 W2(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!F0(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(o);l&&i.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Lu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const i=[];for(const[a,d]of t){const c=(s=n.get(a))==null?void 0:s.internals.userNode;c&&i.push({...c,position:d.position,dragging:r})}if(!e)return[i[0],i];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function X2({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},d=null,c=!1,f=null,h=!1;function y({noDragClassName:S,handleSelector:p,domNode:g,isSelectable:m,nodeId:x,nodeClickDistance:k=0}){f=nt(g);function z({x:j,y:A},F){const{nodeLookup:b,nodeExtent:E,snapGrid:$,snapToGrid:T,nodeOrigin:L,onNodeDrag:_,onSelectionDrag:P,onError:R,updateNodePositions:O}=t();o={x:j,y:A};let H=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&E){const U=Vo(l);K=oc(U)}for(const[U,Y]of l){if(!b.has(U))continue;let X={x:j-Y.distance.x,y:A-Y.distance.y};T&&(X=Ul(X,$));let G=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(l.size>1&&E&&!Y.extent){const{positionAbsolute:oe}=Y.internals,ne=oe.x-K.x+E[0][0],Z=oe.x+Y.measured.width-K.x2+E[1][0],ue=oe.y-K.y+E[0][1],de=oe.y+Y.measured.height-K.y2+E[1][1];G=[[ne,ue],[Z,de]]}const{position:B,positionAbsolute:ee}=C0({nodeId:U,nextPosition:X,nodeLookup:b,nodeExtent:G,nodeOrigin:L,onError:R});H=H||Y.position.x!==B.x||Y.position.y!==B.y,Y.position=B,Y.internals.positionAbsolute=ee}if(H&&(O(l,!0),F&&(r||_||!x&&P))){const[U,Y]=Lu({nodeId:x,dragItems:l,nodeLookup:b});r==null||r(F,l,U,Y),_==null||_(F,U,Y),x||P==null||P(F,Y)}}async function C(){if(!d)return;const{transform:j,panBy:A,autoPanSpeed:F}=t(),[b,E]=M0(a,d,F);(b!==0||E!==0)&&(o.x=(o.x??0)-b/j[2],o.y=(o.y??0)-E/j[2],await A({x:b,y:E})&&z(o,null)),s=requestAnimationFrame(C)}function M(j){var H;const{nodeLookup:A,multiSelectionActive:F,nodesDraggable:b,transform:E,snapGrid:$,snapToGrid:T,selectNodesOnDrag:L,onNodeDragStart:_,onSelectionDragStart:P,unselectNodesAndEdges:R}=t();c=!0,(!L||!m)&&!F&&x&&((H=A.get(x))!=null&&H.selected||R()),m&&L&&x&&(e==null||e(x));const O=Ji(j.sourceEvent,{transform:E,snapGrid:$,snapToGrid:T,containerBounds:d});if(o=O,l=W2(A,b,O,x),l.size>0&&(n||_||!x&&P)){const[K,U]=Lu({nodeId:x,dragItems:l,nodeLookup:A});n==null||n(j.sourceEvent,l,K,U),_==null||_(j.sourceEvent,K,U),x||P==null||P(j.sourceEvent,U)}}const I=i0().clickDistance(k).on("start",j=>{const{domNode:A,nodeDragThreshold:F,transform:b,snapGrid:E,snapToGrid:$}=t();d=(A==null?void 0:A.getBoundingClientRect())||null,h=!1,F===0&&M(j),o=Ji(j.sourceEvent,{transform:b,snapGrid:E,snapToGrid:$,containerBounds:d}),a=qt(j.sourceEvent,d)}).on("drag",j=>{const{autoPanOnNodeDrag:A,transform:F,snapGrid:b,snapToGrid:E,nodeDragThreshold:$,nodeLookup:T}=t(),L=Ji(j.sourceEvent,{transform:F,snapGrid:b,snapToGrid:E,containerBounds:d});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||x&&!T.has(x))&&(h=!0),!h){if(!u&&A&&c&&(u=!0,C()),!c){const _=L.xSnapped-(o.x??0),P=L.ySnapped-(o.y??0);Math.sqrt(_*_+P*P)>$&&M(j)}(o.x!==L.xSnapped||o.y!==L.ySnapped)&&l&&c&&(a=qt(j.sourceEvent,d),z(L,j.sourceEvent))}}).on("end",j=>{if(!(!c||h)&&(u=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:A,updateNodePositions:F,onNodeDragStop:b,onSelectionDragStop:E}=t();if(F(l,!1),i||b||!x&&E){const[$,T]=Lu({nodeId:x,dragItems:l,nodeLookup:A,dragging:!1});i==null||i(j.sourceEvent,l,$,T),b==null||b(j.sourceEvent,$,T),x||E==null||E(j.sourceEvent,T)}}}).filter(j=>{const A=j.target;return!j.button&&(!S||!zh(A,`.${S}`,g))&&(!p||zh(A,p,g))});f.call(I)}function v(){f==null||f.on(".drag",null)}return{update:y,destroy:v}}function Y2(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Mo(i,mi(o))>0&&r.push(o);return r}const K2=250;function q2(e,t,n,r){var l,u;let i=[],o=1/0;const s=Y2(e,n,t+K2);for(const a of s){const d=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:h}=Po(a,c,c.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));y>t||(y<o?(i=[{...c,x:f,y:h}],o=y):y===o&&i.push({...c,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(d=>d.type===a)??i[0]}return i[0]}function H0(e,t,n,r,i,o=!1){var a,d,c;const s=r.get(e);if(!s)return null;const l=i==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Po(s,u,u.position,!0)}:u}function V0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function G2(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const B0=()=>!0;function Z2(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:h,onConnectStart:y,onConnect:v,onConnectEnd:S,isValidConnection:p=B0,onReconnectEnd:g,updateConnection:m,getTransform:x,getFromHandle:k,autoPanSpeed:z}){const C=j0(e.target);let M=0,I;const{x:j,y:A}=qt(e),F=C==null?void 0:C.elementFromPoint(j,A),b=V0(o,F),E=l==null?void 0:l.getBoundingClientRect();if(!E||!b)return;const $=H0(i,b,r,u,t);if(!$)return;let T=qt(e,E),L=!1,_=null,P=!1,R=null;function O(){if(!d||!E)return;const[ee,oe]=M0(T,E,z);f({x:ee,y:oe}),M=requestAnimationFrame(O)}const H={...$,nodeId:i,type:b,position:$.position},K=u.get(i),Y={inProgress:!0,isValid:null,from:Po(K,H,q.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:K,to:T,toHandle:null,toPosition:wh[H.position],toNode:null};m(Y);let X=Y;y==null||y(e,{nodeId:i,handleId:r,handleType:b});function G(ee){if(!k()||!H){B(ee);return}const oe=x();T=qt(ee,E),I=q2(Bo(T,oe,!1,[1,1]),n,u,H),L||(O(),L=!0);const ne=U0(ee,{handle:I,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:C,lib:a,flowId:c,nodeLookup:u});R=ne.handleDomNode,_=ne.connection,P=G2(!!I,ne.isValid);const Z={...X,isValid:P,to:I&&P?T0({x:I.x,y:I.y},oe):T,toHandle:ne.toHandle,toPosition:P&&ne.toHandle?ne.toHandle.position:wh[H.position],toNode:ne.toHandle?u.get(ne.toHandle.nodeId):null};P&&I&&X.toHandle&&Z.toHandle&&X.toHandle.type===Z.toHandle.type&&X.toHandle.nodeId===Z.toHandle.nodeId&&X.toHandle.id===Z.toHandle.id&&X.to.x===Z.to.x&&X.to.y===Z.to.y||(m(Z),X=Z)}function B(ee){(I||R)&&_&&P&&(v==null||v(_));const{inProgress:oe,...ne}=X,Z={...ne,toPosition:X.toHandle?X.toPosition:null};S==null||S(ee,Z),o&&(g==null||g(ee,Z)),h(),cancelAnimationFrame(M),L=!1,P=!1,_=null,R=null,C.removeEventListener("mousemove",G),C.removeEventListener("mouseup",B),C.removeEventListener("touchmove",G),C.removeEventListener("touchend",B)}C.addEventListener("mousemove",G),C.addEventListener("mouseup",B),C.addEventListener("touchmove",G),C.addEventListener("touchend",B)}function U0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:l,flowId:u,isValidConnection:a=B0,nodeLookup:d}){const c=o==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y}=qt(e),v=s.elementFromPoint(h,y),S=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const g=V0(void 0,S),m=S.getAttribute("data-nodeid"),x=S.getAttribute("data-handleid"),k=S.classList.contains("connectable"),z=S.classList.contains("connectableend");if(!m||!g)return p;const C={source:c?m:r,sourceHandle:c?x:i,target:c?r:m,targetHandle:c?i:x};p.connection=C;const I=k&&z&&(n===hi.Strict?c&&g==="source"||!c&&g==="target":m!==r||x!==i);p.isValid=I&&a(C),p.toHandle=H0(m,g,x,d,n,!1)}return p}const cc={onPointerDown:Z2,isValid:U0};function J2({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=nt(e);function o({translateExtent:l,width:u,height:a,zoomStep:d=10,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const y=m=>{const x=n();if(m.sourceEvent.type!=="wheel"||!t)return;const k=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,z=x[2]*Math.pow(2,k);t.scaleTo(z)};let v=[0,0];const S=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(v=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},p=m=>{const x=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const k=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],z=[k[0]-v[0],k[1]-v[1]];v=k;const C=r()*Math.max(x[2],Math.log(x[2]))*(h?-1:1),M={x:x[0]-z[0]*C,y:x[1]-z[1]*C},I=[[0,0],[u,a]];t.setViewportConstrained({x:M.x,y:M.y,zoom:x[2]},I,l)},g=x0().on("start",S).on("zoom",c?p:null).on("zoom.wheel",f?y:null);i.call(g,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:St}}const ek=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wl=e=>({x:e.x,y:e.y,zoom:e.k}),Au=({x:e,y:t,zoom:n})=>Hl.translate(e,t).scale(n),$r=(e,t)=>e.target.closest(`.${t}`),Q0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ou=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},W0=e=>{const t=e.ctrlKey&&vl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function tk({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return d=>{if($r(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const S=St(d),p=W0(d),g=c*Math.pow(2,p);r.scaleTo(n,g,S,d);return}const f=d.deltaMode===1?20:1;let h=i===ar.Vertical?0:d.deltaX*f,y=i===ar.Horizontal?0:d.deltaY*f;!vl()&&d.shiftKey&&i!==ar.Vertical&&(h=d.deltaY*f,y=0),r.translateBy(n,-(h/c)*o,-(y/c)*o,{internal:!0});const v=Wl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(d,v)),e.isPanScrolling&&(u==null||u(d,v),e.panScrollTimeout=setTimeout(()=>{a==null||a(d,v),e.isPanScrolling=!1},150))}}function nk({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||$r(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function rk({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,l;if((o=r.sourceEvent)!=null&&o.internal)return;const i=Wl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.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 ik({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,l;e.usedRightMouseButton=!!(n&&Q0(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((l=o.sourceEvent)!=null&&l.internal)&&(i==null||i(o.sourceEvent,Wl(o.transform)))}}function ok({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&Q0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&ek(e.prevViewport,s.transform))){const u=Wl(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},n?150:0)}}}function sk({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a}){return d=>{var y;const c=e||t,f=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&($r(d,`${a}-flow__node`)||$r(d,`${a}-flow__edge`)))return!0;if(!r&&!c&&!i&&!o&&!n||s||$r(d,l)&&d.type==="wheel"||$r(d,u)&&(d.type!=="wheel"||i&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((y=d.touches)==null?void 0:y.length)>1)return d.preventDefault(),!1;if(!c&&!i&&!f&&d.type==="wheel"||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&h}}function lk({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:a}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),f=x0().clickDistance(!Ct(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=nt(e).call(f);m({x:o.x,y:o.y,zoom:pi(o.zoom,t,n)},[[0,0],[c.width,c.height]],i);const y=h.on("wheel.zoom"),v=h.on("dblclick.zoom");f.wheelDelta(W0);function S(F,b){return h?new Promise(E=>{f==null||f.transform(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function p({noWheelClassName:F,noPanClassName:b,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:T,panOnDrag:L,panOnScrollMode:_,panOnScrollSpeed:P,preventScrolling:R,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:U,lib:Y,onTransformChange:X}){$&&!d.isZoomingOrPanning&&g();const B=T&&!U&&!$?tk({zoomPanValues:d,noWheelClassName:F,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:P,zoomOnPinch:O,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}):nk({noWheelClassName:F,preventScrolling:R,d3ZoomHandler:y});if(h.on("wheel.zoom",B,{passive:!1}),!$){const oe=rk({zoomPanValues:d,onDraggingChange:a,onPanZoomStart:l});f.on("start",oe);const ne=ik({zoomPanValues:d,panOnDrag:L,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:X});f.on("zoom",ne);const Z=ok({zoomPanValues:d,panOnDrag:L,panOnScroll:T,onPaneContextMenu:E,onPanZoomEnd:u,onDraggingChange:a});f.on("end",Z)}const ee=sk({zoomActivationKeyPressed:U,panOnDrag:L,zoomOnScroll:H,panOnScroll:T,zoomOnDoubleClick:K,zoomOnPinch:O,userSelectionActive:$,noPanClassName:b,noWheelClassName:F,lib:Y});f.filter(ee),K?h.on("dblclick.zoom",v):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function m(F,b,E){const $=Au(F),T=f==null?void 0:f.constrain()($,b,E);return T&&await S(T),new Promise(L=>L(T))}async function x(F,b){const E=Au(F);return await S(E,b),new Promise($=>$(E))}function k(F){if(h){const b=Au(F),E=h.property("__zoom");(E.k!==F.zoom||E.x!==F.x||E.y!==F.y)&&(f==null||f.transform(h,b,null,{sync:!0}))}}function z(){const F=h?v0(h.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function C(F,b){return h?new Promise(E=>{f==null||f.scaleTo(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function M(F,b){return h?new Promise(E=>{f==null||f.scaleBy(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function I(F){f==null||f.scaleExtent(F)}function j(F){f==null||f.translateExtent(F)}function A(F){const b=!Ct(F)||F<0?0:F;f==null||f.clickDistance(b)}return{update:p,destroy:g,setViewport:x,setViewportConstrained:m,getViewport:z,scaleTo:C,scaleBy:M,setScaleExtent:I,setTranslateExtent:j,syncViewport:k,setClickDistance:A}}var eo;(function(e){e.Line="line",e.Handle="handle"})(eo||(eo={}));function uk({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function ak(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 fn(e,t){return Math.max(0,t-e)}function dn(e,t){return Math.max(0,e-t)}function ys(e,t,n){return Math.max(0,t-e,e-n)}function Ih(e,t){return e?!t:t}function ck(e,t,n,r,i,o,s,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:h,ySnapped:y}=n,{minWidth:v,maxWidth:S,minHeight:p,maxHeight:g}=r,{x:m,y:x,width:k,height:z,aspectRatio:C}=e;let M=Math.floor(d?h-e.pointerX:0),I=Math.floor(c?y-e.pointerY:0);const j=k+(u?-M:M),A=z+(a?-I:I),F=-o[0]*k,b=-o[1]*z;let E=ys(j,v,S),$=ys(A,p,g);if(s){let _=0,P=0;u&&M<0?_=fn(m+M+F,s[0][0]):!u&&M>0&&(_=dn(m+j+F,s[1][0])),a&&I<0?P=fn(x+I+b,s[0][1]):!a&&I>0&&(P=dn(x+A+b,s[1][1])),E=Math.max(E,_),$=Math.max($,P)}if(l){let _=0,P=0;u&&M>0?_=dn(m+M,l[0][0]):!u&&M<0&&(_=fn(m+j,l[1][0])),a&&I>0?P=dn(x+I,l[0][1]):!a&&I<0&&(P=fn(x+A,l[1][1])),E=Math.max(E,_),$=Math.max($,P)}if(i){if(d){const _=ys(j/C,p,g)*C;if(E=Math.max(E,_),s){let P=0;!u&&!a||u&&!a&&f?P=dn(x+b+j/C,s[1][1])*C:P=fn(x+b+(u?M:-M)/C,s[0][1])*C,E=Math.max(E,P)}if(l){let P=0;!u&&!a||u&&!a&&f?P=fn(x+j/C,l[1][1])*C:P=dn(x+(u?M:-M)/C,l[0][1])*C,E=Math.max(E,P)}}if(c){const _=ys(A*C,v,S)/C;if($=Math.max($,_),s){let P=0;!u&&!a||a&&!u&&f?P=dn(m+A*C+F,s[1][0])/C:P=fn(m+(a?I:-I)*C+F,s[0][0])/C,$=Math.max($,P)}if(l){let P=0;!u&&!a||a&&!u&&f?P=fn(m+A*C,l[1][0])/C:P=dn(m+(a?I:-I)*C,l[0][0])/C,$=Math.max($,P)}}}I=I+(I<0?$:-$),M=M+(M<0?E:-E),i&&(f?j>A*C?I=(Ih(u,a)?-M:M)/C:M=(Ih(u,a)?-I:I)*C:d?(I=M/C,a=u):(M=I*C,u=a));const T=u?m+M:m,L=a?x+I:x;return{width:k+(u?-M:M),height:z+(a?-I:I),x:o[0]*M*(u?-1:1)+T,y:o[1]*I*(a?-1:1)+L}}const X0={width:0,height:0,x:0,y:0},fk={...X0,pointerX:0,pointerY:0,aspectRatio:1};function dk(e){return[[0,0],[e.measured.width,e.measured.height]]}function hk(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,l=n[0]*o,u=n[1]*s;return[[r-l,i-u],[r+o-l,i+s-u]]}function pk({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=nt(e);function s({controlPosition:u,boundaries:a,keepAspectRatio:d,onResizeStart:c,onResize:f,onResizeEnd:h,shouldResize:y}){let v={...X0},S={...fk};const p=ak(u);let g,m=null,x=[],k,z,C;const M=i0().on("start",I=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:b,nodeOrigin:E,paneDomNode:$}=n();if(g=j.get(t),!g)return;m=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:T,ySnapped:L}=Ji(I.sourceEvent,{transform:A,snapGrid:F,snapToGrid:b,containerBounds:m});v={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},S={...v,pointerX:T,pointerY:L,aspectRatio:v.width/v.height},k=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(k=j.get(g.parentId),z=k&&g.extent==="parent"?dk(k):void 0),x=[],C=void 0;for(const[_,P]of j)if(P.parentId===t&&(x.push({id:_,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const R=hk(P,g,P.origin??E);C?C=[[Math.min(R[0][0],C[0][0]),Math.min(R[0][1],C[0][1])],[Math.max(R[1][0],C[1][0]),Math.max(R[1][1],C[1][1])]]:C=R}c==null||c(I,{...v})}).on("drag",I=>{const{transform:j,snapGrid:A,snapToGrid:F,nodeOrigin:b}=n(),E=Ji(I.sourceEvent,{transform:j,snapGrid:A,snapToGrid:F,containerBounds:m}),$=[];if(!g)return;const{x:T,y:L,width:_,height:P}=v,R={},O=g.origin??b,{width:H,height:K,x:U,y:Y}=ck(S,p,E,a,d,O,z,C),X=H!==_,G=K!==P,B=U!==T&&X,ee=Y!==L&&G;if(!B&&!ee&&!X&&!G)return;if((B||ee||O[0]===1||O[1]===1)&&(R.x=B?U:v.x,R.y=ee?Y:v.y,v.x=R.x,v.y=R.y,x.length>0)){const ue=U-T,de=Y-L;for(const $e of x)$e.position={x:$e.position.x-ue+O[0]*(H-_),y:$e.position.y-de+O[1]*(K-P)},$.push($e)}if((X||G)&&(R.width=X?H:v.width,R.height=G?K:v.height,v.width=R.width,v.height=R.height),k&&g.expandParent){const ue=O[0]*(R.width??0);R.x&&R.x<ue&&(v.x=ue,S.x=S.x-(R.x-ue));const de=O[1]*(R.height??0);R.y&&R.y<de&&(v.y=de,S.y=S.y-(R.y-de))}const oe=uk({width:v.width,prevWidth:_,height:v.height,prevHeight:P,affectsX:p.affectsX,affectsY:p.affectsY}),ne={...v,direction:oe};(y==null?void 0:y(I,ne))!==!1&&(f==null||f(I,ne),r(R,$))}).on("end",I=>{h==null||h(I,{...v}),i==null||i()});o.call(M)}function l(){o.on(".drag",null)}return{update:s,destroy:l}}var Y0={exports:{}},K0={},q0={exports:{}},G0={};/**
40
+ `+o.stack}return{value:e,source:t,stack:i,digest:null}}function Pu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $a(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var d1=typeof WeakMap=="function"?WeakMap:Map;function fg(e,t,n){n=Kt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,Ua=r),$a(e,t)},n}function dg(e,t,n){n=Kt(-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(){$a(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){$a(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function $d(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new d1;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=N1.bind(null,e,t,n),t.then(e,e))}function Dd(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 Ad(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=Kt(-1,1),t.tag=2,An(n,t,1))),n.lanes|=1),e)}var h1=on.ReactCurrentOwner,Ke=!1;function Ve(e,t,n,r){t.child=e===null?Hm(t,null,n,r):li(t,e.child,n,r)}function Ld(e,t,n,r,i){n=n.render;var o=t.ref;return Hr(t,i),r=Kc(e,t,n,r,o,i),n=qc(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(me&&n&&Lc(t),t.flags|=1,Ve(e,t,r,i),t.child)}function Od(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!lf(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,hg(e,t,o,r,i)):(e=js(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:ao,n(s,r)&&e.ref===t.ref)return nn(e,t,i)}return t.flags|=1,e=bn(o,r),e.ref=t.ref,e.return=t,t.child=e}function hg(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(ao(o,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,nn(e,t,i)}return Da(e,t,n,r,i)}function pg(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Rr,tt),tt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Rr,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Rr,tt),tt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Rr,tt),tt|=r;return Ve(e,t,i,n),t.child}function mg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Da(e,t,n,r,i){var o=Ze(n)?dr:be.current;return o=oi(t,o),Hr(t,i),n=Kc(e,t,n,r,o,i),r=qc(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(me&&r&&Lc(t),t.flags|=1,Ve(e,t,n,i),t.child)}function bd(e,t,n,r,i){if(Ze(n)){var o=!0;qs(t)}else o=!1;if(Hr(t,i),t.stateNode===null)Ts(e,t),cg(t,n,r),Ra(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,a=n.contextType;typeof a=="object"&&a!==null?a=mt(a):(a=Ze(n)?dr:be.current,a=oi(t,a));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==a)&&Rd(t,s,r,a),gn=!1;var f=t.memoizedState;s.state=f,tl(t,r,s,i),u=t.memoizedState,l!==r||f!==u||Ge.current||gn?(typeof d=="function"&&(ja(t,n,d,r),u=t.memoizedState),(l=gn||jd(t,n,l,r,f,u,a))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Bm(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:vt(t.type,l),s.props=a,c=t.pendingProps,f=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=mt(u):(u=Ze(n)?dr:be.current,u=oi(t,u));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==c||f!==u)&&Rd(t,s,r,u),gn=!1,f=t.memoizedState,s.state=f,tl(t,r,s,i);var y=t.memoizedState;l!==c||f!==y||Ge.current||gn?(typeof h=="function"&&(ja(t,n,h,r),y=t.memoizedState),(a=gn||jd(t,n,a,r,f,y,u)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=u,r=a):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Aa(e,t,n,r,o,i)}function Aa(e,t,n,r,i,o){mg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&kd(t,n,!1),nn(e,t,o);r=t.stateNode,h1.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=li(t,e.child,null,o),t.child=li(t,null,l,o)):Ve(e,t,l,o),t.memoizedState=r.state,i&&kd(t,n,!0),t.child}function gg(e){var t=e.stateNode;t.pendingContext?_d(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_d(e,t.context,!1),Qc(e,t.containerInfo)}function Fd(e,t,n,r,i){return si(),bc(i),t.flags|=256,Ve(e,t,n,r),t.child}var La={dehydrated:null,treeContext:null,retryLane:0};function Oa(e){return{baseLanes:e,cachePool:null,transitions:null}}function yg(e,t,n){var r=t.pendingProps,i=ye.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),fe(ye,i&1),e===null)return za(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):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Il(s,r,0,null),e=lr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Oa(n),t.memoizedState=La,e):Jc(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return p1(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=bn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=bn(l,o):(o=lr(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?Oa(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=La,r}return o=e.child,e=o.sibling,r=bn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Jc(e,t){return t=Il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ss(e,t,n,r){return r!==null&&bc(r),li(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function p1(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Pu(Error(V(422))),ss(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Il({mode:"visible",children:r.children},i,0,null),o=lr(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&li(t,e.child,null,s),t.child.memoizedState=Oa(s),t.memoizedState=La,o);if(!(t.mode&1))return ss(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(V(419)),r=Pu(o,r,void 0),ss(e,t,s,r)}if(l=(s&e.childLanes)!==0,Ke||l){if(r=ze,r!==null){switch(s&-s){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|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,tn(e,i),Mt(r,e,i,-1))}return sf(),r=Pu(Error(V(421))),ss(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=M1.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,rt=Dn(i.nextSibling),it=t,me=!0,_t=null,e!==null&&(ft[dt++]=Wt,ft[dt++]=Xt,ft[dt++]=hr,Wt=e.id,Xt=e.overflow,hr=t),t=Jc(t,r.children),t.flags|=4096,t)}function Hd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ia(e.return,t,n)}function Tu(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function vg(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=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&&Hd(e,n,t);else if(e.tag===19)Hd(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(fe(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&&nl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tu(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&nl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tu(t,!0,n,null,o);break;case"together":Tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ts(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function m1(e,t,n){switch(t.tag){case 3:gg(t),si();break;case 5:Um(t);break;case 1:Ze(t.type)&&qs(t);break;case 4:Qc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;fe(Js,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?yg(e,t,n):(fe(ye,ye.current&1),e=nn(e,t,n),e!==null?e.sibling:null);fe(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return vg(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),fe(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,pg(e,t,n)}return nn(e,t,n)}var xg,ba,wg,Sg;xg=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}};ba=function(){};wg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Gn(Ot.current);var o=null;switch(n){case"input":i=la(e,i),r=la(e,r),o=[];break;case"select":i=xe({},i,{value:void 0}),r=xe({},r,{value:void 0}),o=[];break;case"textarea":i=ca(e,i),r=ca(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ys)}da(n,r);var s;n=null;for(a in i)if(!r.hasOwnProperty(a)&&i.hasOwnProperty(a)&&i[a]!=null)if(a==="style"){var l=i[a];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(no.hasOwnProperty(a)?o||(o=[]):(o=o||[]).push(a,null));for(a in r){var u=r[a];if(l=i!=null?i[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(o||(o=[]),o.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(no.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&he("scroll",e),o||l===u||(o=[])):(o=o||[]).push(a,u))}n&&(o=o||[]).push("style",n);var a=o;(t.updateQueue=a)&&(t.flags|=4)}};Sg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ri(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 Ae(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 g1(e,t,n){var r=t.pendingProps;switch(Oc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ae(t),null;case 1:return Ze(t.type)&&Ks(),Ae(t),null;case 3:return r=t.stateNode,ui(),pe(Ge),pe(be),Xc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(is(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_t!==null&&(Xa(_t),_t=null))),ba(e,t),Ae(t),null;case 5:Wc(t);var i=Gn(mo.current);if(n=t.type,e!==null&&t.stateNode!=null)wg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return Ae(t),null}if(e=Gn(Ot.current),is(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[At]=t,r[ho]=o,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<Hi.length;i++)he(Hi[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":qf(r,o),he("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},he("invalid",r);break;case"textarea":Zf(r,o),he("invalid",r)}da(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&rs(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&rs(r.textContent,l,e),i=["children",""+l]):no.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&he("scroll",r)}switch(n){case"input":Ko(r),Gf(r,o,!0);break;case"textarea":Ko(r),Jf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Ys)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[At]=t,e[ho]=r,xg(e,t,!1,!1),t.stateNode=e;e:{switch(s=ha(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<Hi.length;i++)he(Hi[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":qf(e,r),i=la(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":Zf(e,r),i=ca(e,r),he("invalid",e);break;default:i=r}da(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?Zp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&qp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ro(e,u):typeof u=="number"&&ro(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(no.hasOwnProperty(o)?u!=null&&o==="onScroll"&&he("scroll",e):u!=null&&_c(e,o,u,s))}switch(n){case"input":Ko(e),Gf(e,r,!1);break;case"textarea":Ko(e),Jf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Lr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ys)}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 Ae(t),null;case 6:if(e&&t.stateNode!=null)Sg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Gn(mo.current),Gn(Ot.current),is(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(o=r.nodeValue!==n)&&(e=it,e!==null))switch(e.tag){case 3:rs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rs(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return Ae(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&rt!==null&&t.mode&1&&!(t.flags&128))bm(),si(),t.flags|=98560,o=!1;else if(o=is(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(V(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(V(317));o[At]=t}else si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ae(t),o=!1}else _t!==null&&(Xa(_t),_t=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?Pe===0&&(Pe=3):sf())),t.updateQueue!==null&&(t.flags|=4),Ae(t),null);case 4:return ui(),ba(e,t),e===null&&co(t.stateNode.containerInfo),Ae(t),null;case 10:return Vc(t.type._context),Ae(t),null;case 17:return Ze(t.type)&&Ks(),Ae(t),null;case 19:if(pe(ye),o=t.memoizedState,o===null)return Ae(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Ri(o,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=nl(e),s!==null){for(t.flags|=128,Ri(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(ye,ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&_e()>ci&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304)}else{if(!r)if(e=nl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!me)return Ae(t),null}else 2*_e()-o.renderingStartTime>ci&&n!==1073741824&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=ye.current,fe(ye,r?n&1|2:n&1),t):(Ae(t),null);case 22:case 23:return of(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function y1(e,t){switch(Oc(t),t.tag){case 1:return Ze(t.type)&&Ks(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ui(),pe(Ge),pe(be),Xc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wc(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return ui(),null;case 10:return Vc(t.type._context),null;case 22:case 23:return of(),null;case 24:return null;default:return null}}var ls=!1,Oe=!1,v1=typeof WeakSet=="function"?WeakSet:Set,W=null;function jr(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 Fa(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Vd=!1;function x1(e,t){if(_a=Qs,e=Nm(),Ac(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,d=0,c=e,f=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(l=s+i),c!==o||r!==0&&c.nodeType!==3||(u=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(h=c.firstChild)!==null;)f=c,c=h;for(;;){if(c===e)break t;if(f===n&&++a===i&&(l=s),f===o&&++d===r&&(u=s),(h=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ka={focusedElem:e,selectionRange:n},Qs=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,S=y.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:vt(t.type,v),S);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(x){Se(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Vd,Vd=!1,y}function qi(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 o=i.destroy;i.destroy=void 0,o!==void 0&&Fa(t,n,o)}i=i.next}while(i!==r)}}function Tl(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 Ha(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 Eg(e){var t=e.alternate;t!==null&&(e.alternate=null,Eg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[ho],delete t[Ma],delete t[t1],delete t[n1])),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 _g(e){return e.tag===5||e.tag===3||e.tag===4}function Bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_g(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 Va(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=Ys));else if(r!==4&&(e=e.child,e!==null))for(Va(e,t,n),e=e.sibling;e!==null;)Va(e,t,n),e=e.sibling}function Ba(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(Ba(e,t,n),e=e.sibling;e!==null;)Ba(e,t,n),e=e.sibling}var Ie=null,wt=!1;function cn(e,t,n){for(n=n.child;n!==null;)kg(e,t,n),n=n.sibling}function kg(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:Oe||jr(n,t);case 6:var r=Ie,i=wt;Ie=null,cn(e,t,n),Ie=r,wt=i,Ie!==null&&(wt?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(wt?(e=Ie,n=n.stateNode,e.nodeType===8?Eu(e.parentNode,n):e.nodeType===1&&Eu(e,n),lo(e)):Eu(Ie,n.stateNode));break;case 4:r=Ie,i=wt,Ie=n.stateNode.containerInfo,wt=!0,cn(e,t,n),Ie=r,wt=i;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Fa(n,t,s),i=i.next}while(i!==r)}cn(e,t,n);break;case 1:if(!Oe&&(jr(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)}cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,cn(e,t,n),Oe=r):cn(e,t,n);break;default:cn(e,t,n)}}function Ud(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new v1),t.forEach(function(r){var i=P1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function yt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Ie=l.stateNode,wt=!1;break e;case 3:Ie=l.stateNode.containerInfo,wt=!0;break e;case 4:Ie=l.stateNode.containerInfo,wt=!0;break e}l=l.return}if(Ie===null)throw Error(V(160));kg(o,s,i),Ie=null,wt=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(a){Se(i,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cg(t,e),t=t.sibling}function Cg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),zt(e),r&4){try{qi(3,e,e.return),Tl(3,e)}catch(v){Se(e,e.return,v)}try{qi(5,e,e.return)}catch(v){Se(e,e.return,v)}}break;case 1:yt(t,e),zt(e),r&512&&n!==null&&jr(n,n.return);break;case 5:if(yt(t,e),zt(e),r&512&&n!==null&&jr(n,n.return),e.flags&32){var i=e.stateNode;try{ro(i,"")}catch(v){Se(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Xp(i,o),ha(l,s);var a=ha(l,o);for(s=0;s<u.length;s+=2){var d=u[s],c=u[s+1];d==="style"?Zp(i,c):d==="dangerouslySetInnerHTML"?qp(i,c):d==="children"?ro(i,c):_c(i,d,c,a)}switch(l){case"input":ua(i,o);break;case"textarea":Yp(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Lr(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Lr(i,!!o.multiple,o.defaultValue,!0):Lr(i,!!o.multiple,o.multiple?[]:"",!1))}i[ho]=o}catch(v){Se(e,e.return,v)}}break;case 6:if(yt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(V(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){Se(e,e.return,v)}}break;case 3:if(yt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{lo(t.containerInfo)}catch(v){Se(e,e.return,v)}break;case 4:yt(t,e),zt(e);break;case 13:yt(t,e),zt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(nf=_e())),r&4&&Ud(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(a=Oe)||d,yt(t,e),Oe=a):yt(t,e),zt(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(c=W=d;W!==null;){switch(f=W,h=f.child,f.tag){case 0:case 11:case 14:case 15:qi(4,f,f.return);break;case 1:jr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:jr(f,f.return);break;case 22:if(f.memoizedState!==null){Wd(c);continue}}h!==null?(h.return=f,W=h):Wd(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,a?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=c.stateNode,u=c.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Gp("display",s))}catch(v){Se(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(v){Se(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:yt(t,e),zt(e),r&4&&Ud(e);break;case 21:break;default:yt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_g(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ro(i,""),r.flags&=-33);var o=Bd(e);Ba(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Bd(e);Va(e,l,s);break;default:throw Error(V(161))}}catch(u){Se(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function w1(e,t,n){W=e,Ng(e)}function Ng(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||ls;if(!s){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Oe;l=ls;var a=Oe;if(ls=s,(Oe=u)&&!a)for(W=i;W!==null;)s=W,u=s.child,s.tag===22&&s.memoizedState!==null?Xd(i):u!==null?(u.return=s,W=u):Xd(i);for(;o!==null;)W=o,Ng(o),o=o.sibling;W=i,ls=l,Oe=a}Qd(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,W=o):Qd(e)}}function Qd(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||Tl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Td(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Td(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var d=a.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&lo(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}Oe||t.flags&512&&Ha(t)}catch(f){Se(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Wd(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Xd(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Tl(4,t)}catch(u){Se(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Se(t,i,u)}}var o=t.return;try{Ha(t)}catch(u){Se(t,o,u)}break;case 5:var s=t.return;try{Ha(t)}catch(u){Se(t,s,u)}}}catch(u){Se(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var S1=Math.ceil,ol=on.ReactCurrentDispatcher,ef=on.ReactCurrentOwner,pt=on.ReactCurrentBatchConfig,se=0,ze=null,ke=null,je=0,tt=0,Rr=Un(0),Pe=0,xo=null,mr=0,zl=0,tf=0,Gi=null,Ye=null,nf=0,ci=1/0,Bt=null,sl=!1,Ua=null,Ln=null,us=!1,In=null,ll=0,Zi=0,Qa=null,zs=-1,Is=0;function Be(){return se&6?_e():zs!==-1?zs:zs=_e()}function On(e){return e.mode&1?se&2&&je!==0?je&-je:i1.transition!==null?(Is===0&&(Is=cm()),Is):(e=ce,e!==0||(e=window.event,e=e===void 0?16:ym(e.type)),e):1}function Mt(e,t,n,r){if(50<Zi)throw Zi=0,Qa=null,Error(V(185));Do(e,n,r),(!(se&2)||e!==ze)&&(e===ze&&(!(se&2)&&(zl|=n),Pe===4&&xn(e,je)),Je(e,r),n===1&&se===0&&!(t.mode&1)&&(ci=_e()+500,Nl&&Qn()))}function Je(e,t){var n=e.callbackNode;iw(e,t);var r=Us(e,e===ze?je:0);if(r===0)n!==null&&nd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&nd(n),t===1)e.tag===0?r1(Yd.bind(null,e)):Am(Yd.bind(null,e)),Jw(function(){!(se&6)&&Qn()}),n=null;else{switch(fm(r)){case 1:n=Pc;break;case 4:n=um;break;case 16:n=Bs;break;case 536870912:n=am;break;default:n=Bs}n=$g(n,Mg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mg(e,t){if(zs=-1,Is=0,se&6)throw Error(V(327));var n=e.callbackNode;if(Vr()&&e.callbackNode!==n)return null;var r=Us(e,e===ze?je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ul(e,r);else{t=r;var i=se;se|=2;var o=Tg();(ze!==e||je!==t)&&(Bt=null,ci=_e()+500,sr(e,t));do try{k1();break}catch(l){Pg(e,l)}while(!0);Hc(),ol.current=o,se=i,ke!==null?t=0:(ze=null,je=0,t=Pe)}if(t!==0){if(t===2&&(i=va(e),i!==0&&(r=i,t=Wa(e,i))),t===1)throw n=xo,sr(e,0),xn(e,r),Je(e,_e()),n;if(t===6)xn(e,r);else{if(i=e.current.alternate,!(r&30)&&!E1(i)&&(t=ul(e,r),t===2&&(o=va(e),o!==0&&(r=o,t=Wa(e,o))),t===1))throw n=xo,sr(e,0),xn(e,r),Je(e,_e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:Xn(e,Ye,Bt);break;case 3:if(xn(e,r),(r&130023424)===r&&(t=nf+500-_e(),10<t)){if(Us(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Be(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Na(Xn.bind(null,e,Ye,Bt),t);break}Xn(e,Ye,Bt);break;case 4:if(xn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Nt(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}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*S1(r/1960))-r,10<r){e.timeoutHandle=Na(Xn.bind(null,e,Ye,Bt),r);break}Xn(e,Ye,Bt);break;case 5:Xn(e,Ye,Bt);break;default:throw Error(V(329))}}}return Je(e,_e()),e.callbackNode===n?Mg.bind(null,e):null}function Wa(e,t){var n=Gi;return e.current.memoizedState.isDehydrated&&(sr(e,t).flags|=256),e=ul(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&Xa(t)),e}function Xa(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function E1(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],o=i.getSnapshot;i=i.value;try{if(!Pt(o(),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 xn(e,t){for(t&=~tf,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Yd(e){if(se&6)throw Error(V(327));Vr();var t=Us(e,0);if(!(t&1))return Je(e,_e()),null;var n=ul(e,t);if(e.tag!==0&&n===2){var r=va(e);r!==0&&(t=r,n=Wa(e,r))}if(n===1)throw n=xo,sr(e,0),xn(e,t),Je(e,_e()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Xn(e,Ye,Bt),Je(e,_e()),null}function rf(e,t){var n=se;se|=1;try{return e(t)}finally{se=n,se===0&&(ci=_e()+500,Nl&&Qn())}}function gr(e){In!==null&&In.tag===0&&!(se&6)&&Vr();var t=se;se|=1;var n=pt.transition,r=ce;try{if(pt.transition=null,ce=1,e)return e()}finally{ce=r,pt.transition=n,se=t,!(se&6)&&Qn()}}function of(){tt=Rr.current,pe(Rr)}function sr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Zw(n)),ke!==null)for(n=ke.return;n!==null;){var r=n;switch(Oc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ks();break;case 3:ui(),pe(Ge),pe(be),Xc();break;case 5:Wc(r);break;case 4:ui();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:Vc(r.type._context);break;case 22:case 23:of()}n=n.return}if(ze=e,ke=e=bn(e.current,null),je=tt=t,Pe=0,xo=null,tf=zl=mr=0,Ye=Gi=null,qn!==null){for(t=0;t<qn.length;t++)if(n=qn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}qn=null}return e}function Pg(e,t){do{var n=ke;try{if(Hc(),Ms.current=il,rl){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rl=!1}if(pr=0,Te=Ne=ve=null,Ki=!1,go=0,ef.current=null,n===null||n.return===null){Pe=1,xo=t,ke=null;break}e:{var o=e,s=n.return,l=n,u=t;if(t=je,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,d=l,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Dd(s);if(h!==null){h.flags&=-257,Ad(h,s,l,o,t),h.mode&1&&$d(o,a,t),t=h,u=a;var y=t.updateQueue;if(y===null){var v=new Set;v.add(u),t.updateQueue=v}else y.add(u);break e}else{if(!(t&1)){$d(o,a,t),sf();break e}u=Error(V(426))}}else if(me&&l.mode&1){var S=Dd(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Ad(S,s,l,o,t),bc(ai(u,l));break e}}o=u=ai(u,l),Pe!==4&&(Pe=2),Gi===null?Gi=[o]:Gi.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=fg(o,u,t);Pd(o,p);break e;case 1:l=u;var g=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof g.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ln===null||!Ln.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=dg(o,l,t);Pd(o,x);break e}}o=o.return}while(o!==null)}Ig(n)}catch(k){t=k,ke===n&&n!==null&&(ke=n=n.return);continue}break}while(!0)}function Tg(){var e=ol.current;return ol.current=il,e===null?il:e}function sf(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),ze===null||!(mr&268435455)&&!(zl&268435455)||xn(ze,je)}function ul(e,t){var n=se;se|=2;var r=Tg();(ze!==e||je!==t)&&(Bt=null,sr(e,t));do try{_1();break}catch(i){Pg(e,i)}while(!0);if(Hc(),se=n,ol.current=r,ke!==null)throw Error(V(261));return ze=null,je=0,Pe}function _1(){for(;ke!==null;)zg(ke)}function k1(){for(;ke!==null&&!Kx();)zg(ke)}function zg(e){var t=Rg(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Ig(e):ke=t,ef.current=null}function Ig(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=y1(n,t),n!==null){n.flags&=32767,ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pe=6,ke=null;return}}else if(n=g1(n,t,tt),n!==null){ke=n;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Pe===0&&(Pe=5)}function Xn(e,t,n){var r=ce,i=pt.transition;try{pt.transition=null,ce=1,C1(e,t,n,r)}finally{pt.transition=i,ce=r}return null}function C1(e,t,n,r){do Vr();while(In!==null);if(se&6)throw Error(V(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(V(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(ow(e,o),e===ze&&(ke=ze=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||us||(us=!0,$g(Bs,function(){return Vr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=pt.transition,pt.transition=null;var s=ce;ce=1;var l=se;se|=4,ef.current=null,x1(e,n),Cg(n,e),Qw(ka),Qs=!!_a,ka=_a=null,e.current=n,w1(n),qx(),se=l,ce=s,pt.transition=o}else e.current=n;if(us&&(us=!1,In=e,ll=i),o=e.pendingLanes,o===0&&(Ln=null),Jx(n.stateNode),Je(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(sl)throw sl=!1,e=Ua,Ua=null,e;return ll&1&&e.tag!==0&&Vr(),o=e.pendingLanes,o&1?e===Qa?Zi++:(Zi=0,Qa=e):Zi=0,Qn(),null}function Vr(){if(In!==null){var e=fm(ll),t=pt.transition,n=ce;try{if(pt.transition=null,ce=16>e?16:e,In===null)var r=!1;else{if(e=In,In=null,ll=0,se&6)throw Error(V(331));var i=se;for(se|=4,W=e.current;W!==null;){var o=W,s=o.child;if(W.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(W=a;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:qi(8,d,o)}var c=d.child;if(c!==null)c.return=d,W=c;else for(;W!==null;){d=W;var f=d.sibling,h=d.return;if(Eg(d),d===a){W=null;break}if(f!==null){f.return=h,W=f;break}W=h}}}var y=o.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)}}W=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,W=s;else e:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:qi(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,W=p;break e}W=o.return}}var g=e.current;for(W=g;W!==null;){s=W;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,W=m;else e:for(s=g;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Tl(9,l)}}catch(k){Se(l,l.return,k)}if(l===s){W=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,W=x;break e}W=l.return}}if(se=i,Qn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Sl,e)}catch{}r=!0}return r}finally{ce=n,pt.transition=t}}return!1}function Kd(e,t,n){t=ai(n,t),t=fg(e,t,1),e=An(e,t,1),t=Be(),e!==null&&(Do(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)Kd(e,e,n);else for(;t!==null;){if(t.tag===3){Kd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=ai(n,e),e=dg(t,e,1),t=An(t,e,1),e=Be(),t!==null&&(Do(t,1,e),Je(t,e));break}}t=t.return}}function N1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Be(),e.pingedLanes|=e.suspendedLanes&n,ze===e&&(je&n)===n&&(Pe===4||Pe===3&&(je&130023424)===je&&500>_e()-nf?sr(e,0):tf|=n),Je(e,t)}function jg(e,t){t===0&&(e.mode&1?(t=Zo,Zo<<=1,!(Zo&130023424)&&(Zo=4194304)):t=1);var n=Be();e=tn(e,t),e!==null&&(Do(e,t,n),Je(e,n))}function M1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jg(e,n)}function P1(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(V(314))}r!==null&&r.delete(t),jg(e,n)}var Rg;Rg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,m1(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,me&&t.flags&1048576&&Lm(t,Zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ts(e,t),e=t.pendingProps;var i=oi(t,be.current);Hr(t,n),i=Kc(null,t,r,e,i,n);var o=qc();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,Ze(r)?(o=!0,qs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uc(t),i.updater=Pl,t.stateNode=i,i._reactInternals=t,Ra(t,r,e,n),t=Aa(null,t,r,!0,o,n)):(t.tag=0,me&&o&&Lc(t),Ve(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ts(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=z1(r),e=vt(r,e),i){case 0:t=Da(null,t,r,e,n);break e;case 1:t=bd(null,t,r,e,n);break e;case 11:t=Ld(null,t,r,e,n);break e;case 14:t=Od(null,t,r,vt(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Da(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),bd(e,t,r,i,n);case 3:e:{if(gg(t),e===null)throw Error(V(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Bm(e,t),tl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ai(Error(V(423)),t),t=Fd(e,t,r,n,i);break e}else if(r!==i){i=ai(Error(V(424)),t),t=Fd(e,t,r,n,i);break e}else for(rt=Dn(t.stateNode.containerInfo.firstChild),it=t,me=!0,_t=null,n=Hm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(si(),r===i){t=nn(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return Um(t),e===null&&za(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ca(r,i)?s=null:o!==null&&Ca(r,o)&&(t.flags|=32),mg(e,t),Ve(e,t,s,n),t.child;case 6:return e===null&&za(t),null;case 13:return yg(e,t,n);case 4:return Qc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=li(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:vt(r,i),Ld(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,o=t.memoizedProps,s=i.value,fe(Js,r._currentValue),r._currentValue=s,o!==null)if(Pt(o.value,s)){if(o.children===i.children&&!Ge.current){t=nn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Kt(-1,n&-n),u.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var d=a.pending;d===null?u.next=u:(u.next=d.next,d.next=u),a.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ia(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(V(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ia(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ve(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hr(t,n),i=mt(i),r=r(i),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,i=vt(r,t.pendingProps),i=vt(r.type,i),Od(e,t,r,i,n);case 15:return hg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Ts(e,t),t.tag=1,Ze(r)?(e=!0,qs(t)):e=!1,Hr(t,n),cg(t,r,i),Ra(t,r,i,n),Aa(null,t,r,!0,e,n);case 19:return vg(e,t,n);case 22:return pg(e,t,n)}throw Error(V(156,t.tag))};function $g(e,t){return lm(e,t)}function T1(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 ht(e,t,n,r){return new T1(e,t,n,r)}function lf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function z1(e){if(typeof e=="function")return lf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cc)return 11;if(e===Nc)return 14}return 2}function bn(e,t){var n=e.alternate;return n===null?(n=ht(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 js(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")lf(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case _r:return lr(n.children,i,o,t);case kc:s=8,i|=8;break;case ra:return e=ht(12,n,t,i|2),e.elementType=ra,e.lanes=o,e;case ia:return e=ht(13,n,t,i),e.elementType=ia,e.lanes=o,e;case oa:return e=ht(19,n,t,i),e.elementType=oa,e.lanes=o,e;case Up:return Il(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vp:s=10;break e;case Bp:s=9;break e;case Cc:s=11;break e;case Nc:s=14;break e;case mn:s=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=ht(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=ht(7,e,r,t),e.lanes=n,e}function Il(e,t,n,r){return e=ht(22,e,r,t),e.elementType=Up,e.lanes=n,e.stateNode={isHidden:!1},e}function zu(e,t,n){return e=ht(6,e,null,t),e.lanes=n,e}function Iu(e,t,n){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I1(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=fu(0),this.expirationTimes=fu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uf(e,t,n,r,i,o,s,l,u){return e=new I1(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ht(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uc(o),e}function j1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Er,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Dg(e){if(!e)return Hn;e=e._reactInternals;e:{if(wr(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(Ze(n))return Dm(e,n,t)}return t}function Ag(e,t,n,r,i,o,s,l,u){return e=uf(n,r,!0,e,i,o,s,l,u),e.context=Dg(null),n=e.current,r=Be(),i=On(n),o=Kt(r,i),o.callback=t??null,An(n,o,i),e.current.lanes=i,Do(e,i,r),Je(e,r),e}function jl(e,t,n,r){var i=t.current,o=Be(),s=On(i);return n=Dg(n),t.context===null?t.context=n:t.pendingContext=n,t=Kt(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=An(i,t,s),e!==null&&(Mt(e,i,s,o),Ns(e,i,s)),s}function al(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 qd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function af(e,t){qd(e,t),(e=e.alternate)&&qd(e,t)}function R1(){return null}var Lg=typeof reportError=="function"?reportError:function(e){console.error(e)};function cf(e){this._internalRoot=e}Rl.prototype.render=cf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));jl(e,t,null,null)};Rl.prototype.unmount=cf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){jl(null,e,null,null)}),t[en]=null}};function Rl(e){this._internalRoot=e}Rl.prototype.unstable_scheduleHydration=function(e){if(e){var t=pm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<vn.length&&t!==0&&t<vn[n].priority;n++);vn.splice(n,0,e),n===0&&gm(e)}};function ff(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gd(){}function $1(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var a=al(s);o.call(a)}}var s=Ag(t,r,e,0,null,!1,!1,"",Gd);return e._reactRootContainer=s,e[en]=s.current,co(e.nodeType===8?e.parentNode:e),gr(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var a=al(u);l.call(a)}}var u=uf(e,0,!1,null,null,!1,!1,"",Gd);return e._reactRootContainer=u,e[en]=u.current,co(e.nodeType===8?e.parentNode:e),gr(function(){jl(t,u,n,r)}),u}function Dl(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var u=al(s);l.call(u)}}jl(t,s,e,i)}else s=$1(n,t,e,i,r);return al(s)}dm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Fi(t.pendingLanes);n!==0&&(Tc(t,n|1),Je(t,_e()),!(se&6)&&(ci=_e()+500,Qn()))}break;case 13:gr(function(){var r=tn(e,1);if(r!==null){var i=Be();Mt(r,e,1,i)}}),af(e,1)}};zc=function(e){if(e.tag===13){var t=tn(e,134217728);if(t!==null){var n=Be();Mt(t,e,134217728,n)}af(e,134217728)}};hm=function(e){if(e.tag===13){var t=On(e),n=tn(e,t);if(n!==null){var r=Be();Mt(n,e,t,r)}af(e,t)}};pm=function(){return ce};mm=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};ma=function(e,t,n){switch(t){case"input":if(ua(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=Cl(r);if(!i)throw Error(V(90));Wp(r),ua(r,i)}}}break;case"textarea":Yp(e,n);break;case"select":t=n.value,t!=null&&Lr(e,!!n.multiple,t,!1)}};tm=rf;nm=gr;var D1={usingClientEntryPoint:!1,Events:[Lo,Mr,Cl,Jp,em,rf]},$i={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A1={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:on.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=om(e),e===null?null:e.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||R1,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 as=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!as.isDisabled&&as.supportsFiber)try{Sl=as.inject(A1),Lt=as}catch{}}lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D1;lt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ff(t))throw Error(V(200));return j1(e,t,null,n)};lt.createRoot=function(e,t){if(!ff(e))throw Error(V(299));var n=!1,r="",i=Lg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uf(e,1,!1,null,null,n,!1,r,i),e[en]=t.current,co(e.nodeType===8?e.parentNode:e),new cf(t)};lt.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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=om(t),e=e===null?null:e.stateNode,e};lt.flushSync=function(e){return gr(e)};lt.hydrate=function(e,t,n){if(!$l(t))throw Error(V(200));return Dl(null,e,t,!0,n)};lt.hydrateRoot=function(e,t,n){if(!ff(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=Lg;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Ag(t,null,e,1,n??null,i,!1,o,s),e[en]=t.current,co(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 Rl(t)};lt.render=function(e,t,n){if(!$l(t))throw Error(V(200));return Dl(null,e,t,!1,n)};lt.unmountComponentAtNode=function(e){if(!$l(e))throw Error(V(40));return e._reactRootContainer?(gr(function(){Dl(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1};lt.unstable_batchedUpdates=rf;lt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$l(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Dl(e,t,n,!1,r)};lt.version="18.3.1-next-f1338f8080-20240426";function Og(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Og)}catch(e){console.error(e)}}Og(),Op.exports=lt;var L1=Op.exports,bg,Zd=L1;bg=Zd.createRoot,Zd.hydrateRoot;function O1(){return`${typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}/api`}async function cs(e,t){const n=await fetch(O1()+e,t);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const Rs={runs(e){return cs(e?`/runs?status=${e}`:"/runs")},run(e){return cs(`/runs/${encodeURIComponent(e)}`)},retry(e){return cs(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},cancel(e){return cs(`/runs/${encodeURIComponent(e)}/cancel`,{method:"POST"})}},sn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function Fg(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),w.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function b1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function F1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"13",r:"8"}),w.jsx("path",{d:"M12 13V9M9 2h6"})]})}function H1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("circle",{cx:"12",cy:"12",r:"2"}),w.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 Hg(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"m4 12 5 5L20 6"})})}function Al(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function V1(e){return w.jsxs("svg",{...sn,...e,"aria-hidden":!0,children:[w.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),w.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function B1(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Vg(e){return w.jsx("svg",{...sn,...e,"aria-hidden":!0,children:w.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}const U1={local:Fg,remote:b1,sleep:F1,signal:H1};function df(e){return U1[e]??Fg}const Bg={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal"};function Ug(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Jd(e,t){return Ug(new Date(t).getTime()-new Date(e).getTime())}function eh(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}function Q1({value:e}){const[t,n]=D.useState(!1);return w.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?w.jsx(Hg,{width:11,height:11}):w.jsx(V1,{width:11,height:11}),t?"copied":"copy"]})}function Ya({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return w.jsxs("section",{className:"rise",children:[w.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[w.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),w.jsx(Q1,{value:n})]}),w.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 fn({k:e,v:t,mono:n=!0}){return w.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[w.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),w.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function W1({step:e,run:t,onClose:n}){const r=e.status==="failed",i=df(e.kind),o=Jd(t.createdAt,e.startedAt),s=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return w.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:[w.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${r?"bg-red-500/15 text-red-300":"bg-emerald-500/15 text-emerald-300"}`,children:w.jsx(i,{width:13,height:13})}),w.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),w.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",Bg[e.kind]??e.kind]})]}),w.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:w.jsx(Al,{})})]}),w.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[w.jsxs("div",{className:"rounded-lg border border-[var(--line)] bg-black/20 px-3.5 py-1",children:[w.jsx(fn,{k:"seq",v:`#${e.seq}`}),s>=1&&w.jsx(fn,{k:"queued",v:w.jsx("span",{className:"text-sky-300",children:Ug(s)})}),w.jsx(fn,{k:"duration",v:Jd(e.startedAt,e.finishedAt)}),w.jsx(fn,{k:"attempts",v:w.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&w.jsx(Vg,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&w.jsx(fn,{k:"worker",v:`@${e.workerGroup}`}),w.jsx(fn,{k:"started",v:eh(e.startedAt)}),w.jsx(fn,{k:"finished",v:eh(e.finishedAt)}),w.jsx(fn,{k:"offset",v:`+${o}`})]}),r&&e.error&&w.jsxs("section",{className:"rise",children:[w.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),w.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.output!==void 0&&w.jsx(Ya,{label:"output",value:e.output})]})]})}function X1({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return w.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:[w.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),w.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),w.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:w.jsx(Al,{})})]}),w.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&w.jsxs("section",{className:"rise",children:[w.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),w.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&&w.jsx(Ya,{label:"input",value:e.input}),e.output!==void 0&&w.jsx(Ya,{label:"output",value:e.output}),n&&w.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function th(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Y1({run:e,timeline:t,selected:n,onSelect:r}){const{span:i,rows:o}=D.useMemo(()=>{const s=t.map(y=>new Date(y.startedAt).getTime()),l=t.map(y=>new Date(y.finishedAt).getTime()),u=Math.min(new Date(e.createdAt).getTime(),...s),a=e.status==="running"||e.status==="suspended",d=Math.max(...l,a?Date.now():u+1),c=Math.max(d-u,1);let f=u;const h=t.map(y=>{const v=new Date(y.finishedAt).getTime(),S=f;return f=v,{step:y,left:(S-u)/c*100,width:Math.max((v-S)/c*100,.8),ms:v-S}});return{span:c,rows:h}},[e,t]);return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[w.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),w.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",th(i)]})]}),w.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:o.map(({step:s,left:l,width:u,ms:a})=>{const d=s.status==="failed",c=df(s.kind),f=n===s.seq;return w.jsxs("button",{type:"button",onClick:()=>r(s.seq),className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${f?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[w.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[w.jsx("span",{className:d?"text-red-400":"text-emerald-400",children:w.jsx(c,{width:12,height:12})}),w.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:s.name})]}),w.jsxs("span",{className:"relative h-5",children:[w.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),w.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] ${d?"bg-red-500/35 ring-1 ring-red-500/50":f?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${l}%`,width:`${u}%`}}),w.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(${l+u}%, calc(100% - 44px))`},children:th(a)})]})]},s.seq)})})]})}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 K1={value:()=>{}};function Ll(){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 $s(n)}function $s(e){this._=e}function q1(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}})}$s.prototype=Ll.prototype={constructor:$s,on:function(e,t){var n=this._,r=q1(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=G1(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=nh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nh(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 $s(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function G1(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=K1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ka="http://www.w3.org/1999/xhtml";const rh={svg:"http://www.w3.org/2000/svg",xhtml:Ka,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ol(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),rh.hasOwnProperty(t)?{space:rh[t],local:e}:e}function Z1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ka&&t.documentElement.namespaceURI===Ka?t.createElement(e):t.createElementNS(n,e)}}function J1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qg(e){var t=Ol(e);return(t.local?J1:Z1)(t)}function eS(){}function hf(e){return e==null?eS:function(){return this.querySelector(e)}}function tS(e){typeof e!="function"&&(e=hf(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=new Array(s),u,a,d=0;d<s;++d)(u=o[d])&&(a=e.call(u,u.__data__,d,o))&&("__data__"in u&&(a.__data__=u.__data__),l[d]=a);return new st(r,this._parents)}function nS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rS(){return[]}function Wg(e){return e==null?rS:function(){return this.querySelectorAll(e)}}function iS(e){return function(){return nS(e.apply(this,arguments))}}function oS(e){typeof e=="function"?e=iS(e):e=Wg(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&(r.push(e.call(u,u.__data__,a,s)),i.push(u));return new st(r,i)}function Xg(e){return function(){return this.matches(e)}}function Yg(e){return function(t){return t.matches(e)}}var sS=Array.prototype.find;function lS(e){return function(){return sS.call(this.children,e)}}function uS(){return this.firstElementChild}function aS(e){return this.select(e==null?uS:lS(typeof e=="function"?e:Yg(e)))}var cS=Array.prototype.filter;function fS(){return Array.from(this.children)}function dS(e){return function(){return cS.call(this.children,e)}}function hS(e){return this.selectAll(e==null?fS:dS(typeof e=="function"?e:Yg(e)))}function pS(e){typeof e!="function"&&(e=Xg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new st(r,this._parents)}function Kg(e){return new Array(e.length)}function mS(){return new st(this._enter||this._groups.map(Kg),this._parents)}function cl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}cl.prototype={constructor:cl,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 gS(e){return function(){return e}}function yS(e,t,n,r,i,o){for(var s=0,l,u=t.length,a=o.length;s<a;++s)(l=t[s])?(l.__data__=o[s],r[s]=l):n[s]=new cl(e,o[s]);for(;s<u;++s)(l=t[s])&&(i[s]=l)}function vS(e,t,n,r,i,o,s){var l,u,a=new Map,d=t.length,c=o.length,f=new Array(d),h;for(l=0;l<d;++l)(u=t[l])&&(f[l]=h=s.call(u,u.__data__,l,t)+"",a.has(h)?i[l]=u:a.set(h,u));for(l=0;l<c;++l)h=s.call(e,o[l],l,o)+"",(u=a.get(h))?(r[l]=u,u.__data__=o[l],a.delete(h)):n[l]=new cl(e,o[l]);for(l=0;l<d;++l)(u=t[l])&&a.get(f[l])===u&&(i[l]=u)}function xS(e){return e.__data__}function wS(e,t){if(!arguments.length)return Array.from(this,xS);var n=t?vS:yS,r=this._parents,i=this._groups;typeof e!="function"&&(e=gS(e));for(var o=i.length,s=new Array(o),l=new Array(o),u=new Array(o),a=0;a<o;++a){var d=r[a],c=i[a],f=c.length,h=SS(e.call(d,d&&d.__data__,a,r)),y=h.length,v=l[a]=new Array(y),S=s[a]=new Array(y),p=u[a]=new Array(f);n(d,c,v,S,p,h,t);for(var g=0,m=0,x,k;g<y;++g)if(x=v[g]){for(g>=m&&(m=g+1);!(k=S[m])&&++m<y;);x._next=k||null}}return s=new st(s,r),s._enter=l,s._exit=u,s}function SS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ES(){return new st(this._exit||this._groups.map(Kg),this._parents)}function _S(e,t,n){var r=this.enter(),i=this,o=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?o.remove():n(o),r&&i?r.merge(i).order():i}function kS(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),u=0;u<s;++u)for(var a=n[u],d=r[u],c=a.length,f=l[u]=new Array(c),h,y=0;y<c;++y)(h=a[y]||d[y])&&(f[y]=h);for(;u<i;++u)l[u]=n[u];return new st(l,this._parents)}function CS(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function NS(e){e||(e=MS);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,u=i[o]=new Array(l),a,d=0;d<l;++d)(a=s[d])&&(u[d]=a);u.sort(t)}return new st(i,this._parents).order()}function MS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function PS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function TS(){return Array.from(this)}function zS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function IS(){let e=0;for(const t of this)++e;return e}function jS(){return!this.node()}function RS(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&e.call(l,l.__data__,o,i);return this}function $S(e){return function(){this.removeAttribute(e)}}function DS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AS(e,t){return function(){this.setAttribute(e,t)}}function LS(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function bS(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 FS(e,t){var n=Ol(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?DS:$S:typeof t=="function"?n.local?bS:OS:n.local?LS:AS)(n,t))}function qg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function HS(e){return function(){this.style.removeProperty(e)}}function VS(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BS(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function US(e,t,n){return arguments.length>1?this.each((t==null?HS:typeof t=="function"?BS:VS)(e,t,n??"")):fi(this.node(),e)}function fi(e,t){return e.style.getPropertyValue(t)||qg(e).getComputedStyle(e,null).getPropertyValue(t)}function QS(e){return function(){delete this[e]}}function WS(e,t){return function(){this[e]=t}}function XS(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function YS(e,t){return arguments.length>1?this.each((t==null?QS:typeof t=="function"?XS:WS)(e,t)):this.node()[e]}function Gg(e){return e.trim().split(/^|\s+/)}function pf(e){return e.classList||new Zg(e)}function Zg(e){this._node=e,this._names=Gg(e.getAttribute("class")||"")}Zg.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 Jg(e,t){for(var n=pf(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function e0(e,t){for(var n=pf(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KS(e){return function(){Jg(this,e)}}function qS(e){return function(){e0(this,e)}}function GS(e,t){return function(){(t.apply(this,arguments)?Jg:e0)(this,e)}}function ZS(e,t){var n=Gg(e+"");if(arguments.length<2){for(var r=pf(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?GS:t?KS:qS)(n,t))}function JS(){this.textContent=""}function eE(e){return function(){this.textContent=e}}function tE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function nE(e){return arguments.length?this.each(e==null?JS:(typeof e=="function"?tE:eE)(e)):this.node().textContent}function rE(){this.innerHTML=""}function iE(e){return function(){this.innerHTML=e}}function oE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function sE(e){return arguments.length?this.each(e==null?rE:(typeof e=="function"?oE:iE)(e)):this.node().innerHTML}function lE(){this.nextSibling&&this.parentNode.appendChild(this)}function uE(){return this.each(lE)}function aE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cE(){return this.each(aE)}function fE(e){var t=typeof e=="function"?e:Qg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dE(){return null}function hE(e,t){var n=typeof e=="function"?e:Qg(e),r=t==null?dE:typeof t=="function"?t:hf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pE(){var e=this.parentNode;e&&e.removeChild(this)}function mE(){return this.each(pE)}function gE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vE(e){return this.select(e?yE:gE)}function xE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function wE(e){return function(t){e.call(this,t,this.__data__)}}function SE(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 EE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function _E(e,t,n){return function(){var r=this.__on,i,o=wE(t);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function kE(e,t,n){var r=SE(e+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,d;u<a;++u)for(i=0,d=l[u];i<o;++i)if((s=r[i]).type===d.type&&s.name===d.name)return d.value}return}for(l=t?_E:EE,i=0;i<o;++i)this.each(l(r[i],t,n));return this}function t0(e,t,n){var r=qg(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 CE(e,t){return function(){return t0(this,e,t)}}function NE(e,t){return function(){return t0(this,e,t.apply(this,arguments))}}function ME(e,t){return this.each((typeof t=="function"?NE:CE)(e,t))}function*PE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var n0=[null];function st(e,t){this._groups=e,this._parents=t}function bo(){return new st([[document.documentElement]],n0)}function TE(){return this}st.prototype=bo.prototype={constructor:st,select:tS,selectAll:oS,selectChild:aS,selectChildren:hS,filter:pS,data:wS,enter:mS,exit:ES,join:_S,merge:kS,selection:TE,order:CS,sort:NS,call:PS,nodes:TS,node:zS,size:IS,empty:jS,each:RS,attr:FS,style:US,property:YS,classed:ZS,text:nE,html:sE,raise:uE,lower:cE,append:fE,insert:hE,remove:mE,clone:vE,datum:xE,on:kE,dispatch:ME,[Symbol.iterator]:PE};function nt(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],n0)}function zE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function St(e,t){if(e=zE(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 IE={passive:!1},wo={capture:!0,passive:!1};function ju(e){e.stopImmediatePropagation()}function Br(e){e.preventDefault(),e.stopImmediatePropagation()}function r0(e){var t=e.document.documentElement,n=nt(e).on("dragstart.drag",Br,wo);"onselectstart"in t?n.on("selectstart.drag",Br,wo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function i0(e,t){var n=e.document.documentElement,r=nt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Br,wo),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 fs=e=>()=>e;function qa(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:u,dy:a,dispatch:d}){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:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:d}})}qa.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function jE(e){return!e.ctrlKey&&!e.button}function RE(){return this.parentNode}function $E(e,t){return t??{x:e.x,y:e.y}}function DE(){return navigator.maxTouchPoints||"ontouchstart"in this}function o0(){var e=jE,t=RE,n=$E,r=DE,i={},o=Ll("start","drag","end"),s=0,l,u,a,d,c=0;function f(x){x.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,IE).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(x,k){if(!(d||!e.call(this,x,k))){var z=m(this,t.call(this,x,k),x,k,"mouse");z&&(nt(x.view).on("mousemove.drag",y,wo).on("mouseup.drag",v,wo),r0(x.view),ju(x),a=!1,l=x.clientX,u=x.clientY,z("start",x))}}function y(x){if(Br(x),!a){var k=x.clientX-l,z=x.clientY-u;a=k*k+z*z>c}i.mouse("drag",x)}function v(x){nt(x.view).on("mousemove.drag mouseup.drag",null),i0(x.view,a),Br(x),i.mouse("end",x)}function S(x,k){if(e.call(this,x,k)){var z=x.changedTouches,C=t.call(this,x,k),M=z.length,I,j;for(I=0;I<M;++I)(j=m(this,C,x,k,z[I].identifier,z[I]))&&(ju(x),j("start",x,z[I]))}}function p(x){var k=x.changedTouches,z=k.length,C,M;for(C=0;C<z;++C)(M=i[k[C].identifier])&&(Br(x),M("drag",x,k[C]))}function g(x){var k=x.changedTouches,z=k.length,C,M;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),C=0;C<z;++C)(M=i[k[C].identifier])&&(ju(x),M("end",x,k[C]))}function m(x,k,z,C,M,I){var j=o.copy(),L=St(I||z,k),F,b,E;if((E=n.call(x,new qa("beforestart",{sourceEvent:z,target:f,identifier:M,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:j}),C))!=null)return F=E.x-L[0]||0,b=E.y-L[1]||0,function $(T,A,_){var P=L,R;switch(T){case"start":i[M]=$,R=s++;break;case"end":delete i[M],--s;case"drag":L=St(_||A,k),R=s;break}j.call(T,x,new qa(T,{sourceEvent:A,subject:E,target:f,identifier:M,active:R,x:L[0]+F,y:L[1]+b,dx:L[0]-P[0],dy:L[1]-P[1],dispatch:j}),C)}}return f.filter=function(x){return arguments.length?(e=typeof x=="function"?x:fs(!!x),f):e},f.container=function(x){return arguments.length?(t=typeof x=="function"?x:fs(x),f):t},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:fs(x),f):n},f.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:fs(!!x),f):r},f.on=function(){var x=o.on.apply(o,arguments);return x===o?f:x},f.clickDistance=function(x){return arguments.length?(c=(x=+x)*x,f):Math.sqrt(c)},f}function mf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function s0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fo(){}var So=.7,fl=1/So,Ur="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",AE=/^#([0-9a-f]{3,8})$/,LE=new RegExp(`^rgb\\(${Ur},${Ur},${Ur}\\)$`),OE=new RegExp(`^rgb\\(${bt},${bt},${bt}\\)$`),bE=new RegExp(`^rgba\\(${Ur},${Ur},${Ur},${Eo}\\)$`),FE=new RegExp(`^rgba\\(${bt},${bt},${bt},${Eo}\\)$`),HE=new RegExp(`^hsl\\(${Eo},${bt},${bt}\\)$`),VE=new RegExp(`^hsla\\(${Eo},${bt},${bt},${Eo}\\)$`),ih={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};mf(Fo,_o,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oh,formatHex:oh,formatHex8:BE,formatHsl:UE,formatRgb:sh,toString:sh});function oh(){return this.rgb().formatHex()}function BE(){return this.rgb().formatHex8()}function UE(){return l0(this).formatHsl()}function sh(){return this.rgb().formatRgb()}function _o(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=AE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?lh(t):n===3?new qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ds(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ds(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=LE.exec(e))?new qe(t[1],t[2],t[3],1):(t=OE.exec(e))?new qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bE.exec(e))?ds(t[1],t[2],t[3],t[4]):(t=FE.exec(e))?ds(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HE.exec(e))?ch(t[1],t[2]/100,t[3]/100,1):(t=VE.exec(e))?ch(t[1],t[2]/100,t[3]/100,t[4]):ih.hasOwnProperty(e)?lh(ih[e]):e==="transparent"?new qe(NaN,NaN,NaN,0):null}function lh(e){return new qe(e>>16&255,e>>8&255,e&255,1)}function ds(e,t,n,r){return r<=0&&(e=t=n=NaN),new qe(e,t,n,r)}function QE(e){return e instanceof Fo||(e=_o(e)),e?(e=e.rgb(),new qe(e.r,e.g,e.b,e.opacity)):new qe}function Ga(e,t,n,r){return arguments.length===1?QE(e):new qe(e,t,n,r??1)}function qe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mf(qe,Ga,s0(Fo,{brighter(e){return e=e==null?fl:Math.pow(fl,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?So:Math.pow(So,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qe(ur(this.r),ur(this.g),ur(this.b),dl(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:uh,formatHex:uh,formatHex8:WE,formatRgb:ah,toString:ah}));function uh(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}`}function WE(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}${Zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ah(){const e=dl(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function dl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zn(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kt(e,t,n,r)}function l0(e){if(e instanceof kt)return new kt(e.h,e.s,e.l,e.opacity);if(e instanceof Fo||(e=_o(e)),!e)return new kt;if(e instanceof kt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,u=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=u<.5?o+i:2-o-i,s*=60):l=u>0&&u<1?0:s,new kt(s,l,u,e.opacity)}function XE(e,t,n,r){return arguments.length===1?l0(e):new kt(e,t,n,r??1)}function kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mf(kt,XE,s0(Fo,{brighter(e){return e=e==null?fl:Math.pow(fl,e),new kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?So:Math.pow(So,e),new kt(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 qe(Ru(e>=240?e-240:e+120,i,r),Ru(e,i,r),Ru(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kt(fh(this.h),hs(this.s),hs(this.l),dl(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=dl(this.opacity);return`${e===1?"hsl(":"hsla("}${fh(this.h)}, ${hs(this.s)*100}%, ${hs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fh(e){return e=(e||0)%360,e<0?e+360:e}function hs(e){return Math.max(0,Math.min(1,e||0))}function Ru(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 u0=e=>()=>e;function YE(e,t){return function(n){return e+n*t}}function KE(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 qE(e){return(e=+e)==1?a0:function(t,n){return n-t?KE(t,n,e):u0(isNaN(t)?n:t)}}function a0(e,t){var n=t-e;return n?YE(e,n):u0(isNaN(e)?t:e)}const dh=function e(t){var n=qE(t);function r(i,o){var s=n((i=Ga(i)).r,(o=Ga(o)).r),l=n(i.g,o.g),u=n(i.b,o.b),a=a0(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=l(d),i.b=u(d),i.opacity=a(d),i+""}}return r.gamma=e,r}(1);function yn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Za=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$u=new RegExp(Za.source,"g");function GE(e){return function(){return e}}function ZE(e){return function(t){return e(t)+""}}function JE(e,t){var n=Za.lastIndex=$u.lastIndex=0,r,i,o,s=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Za.exec(e))&&(i=$u.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:yn(r,i)})),n=$u.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?u[0]?ZE(u[0].x):GE(t):(t=u.length,function(a){for(var d=0,c;d<t;++d)l[(c=u[d]).i]=c.x(a);return l.join("")})}var hh=180/Math.PI,Ja={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function c0(e,t,n,r,i,o){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*hh,skewX:Math.atan(u)*hh,scaleX:s,scaleY:l}}var ps;function e_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ja:c0(t.a,t.b,t.c,t.d,t.e,t.f)}function t_(e){return e==null||(ps||(ps=document.createElementNS("http://www.w3.org/2000/svg","g")),ps.setAttribute("transform",e),!(e=ps.transform.baseVal.consolidate()))?Ja:(e=e.matrix,c0(e.a,e.b,e.c,e.d,e.e,e.f))}function f0(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function o(a,d,c,f,h,y){if(a!==c||d!==f){var v=h.push("translate(",null,t,null,n);y.push({i:v-4,x:yn(a,c)},{i:v-2,x:yn(d,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function s(a,d,c,f){a!==d?(a-d>180?d+=360:d-a>180&&(a+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:yn(a,d)})):d&&c.push(i(c)+"rotate("+d+r)}function l(a,d,c,f){a!==d?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:yn(a,d)}):d&&c.push(i(c)+"skewX("+d+r)}function u(a,d,c,f,h,y){if(a!==c||d!==f){var v=h.push(i(h)+"scale(",null,",",null,")");y.push({i:v-4,x:yn(a,c)},{i:v-2,x:yn(d,f)})}else(c!==1||f!==1)&&h.push(i(h)+"scale("+c+","+f+")")}return function(a,d){var c=[],f=[];return a=e(a),d=e(d),o(a.translateX,a.translateY,d.translateX,d.translateY,c,f),s(a.rotate,d.rotate,c,f),l(a.skewX,d.skewX,c,f),u(a.scaleX,a.scaleY,d.scaleX,d.scaleY,c,f),a=d=null,function(h){for(var y=-1,v=f.length,S;++y<v;)c[(S=f[y]).i]=S.x(h);return c.join("")}}}var n_=f0(e_,"px, ","px)","deg)"),r_=f0(t_,", ",")",")"),i_=1e-12;function ph(e){return((e=Math.exp(e))+1/e)/2}function o_(e){return((e=Math.exp(e))-1/e)/2}function s_(e){return((e=Math.exp(2*e))-1)/(e+1)}const l_=function e(t,n,r){function i(o,s){var l=o[0],u=o[1],a=o[2],d=s[0],c=s[1],f=s[2],h=d-l,y=c-u,v=h*h+y*y,S,p;if(v<i_)p=Math.log(f/a)/t,S=function(C){return[l+C*h,u+C*y,a*Math.exp(t*C*p)]};else{var g=Math.sqrt(v),m=(f*f-a*a+r*v)/(2*a*n*g),x=(f*f-a*a-r*v)/(2*f*n*g),k=Math.log(Math.sqrt(m*m+1)-m),z=Math.log(Math.sqrt(x*x+1)-x);p=(z-k)/t,S=function(C){var M=C*p,I=ph(k),j=a/(n*g)*(I*s_(t*M+k)-o_(k));return[l+j*h,u+j*y,a*I/ph(t*M+k)]}}return S.duration=p*1e3*t/Math.SQRT2,S}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,u=l*l;return e(s,l,u)},i}(Math.SQRT2,2,4);var di=0,Vi=0,Di=0,d0=1e3,hl,Bi,pl=0,yr=0,bl=0,ko=typeof performance=="object"&&performance.now?performance:Date,h0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function gf(){return yr||(h0(u_),yr=ko.now()+bl)}function u_(){yr=0}function ml(){this._call=this._time=this._next=null}ml.prototype=p0.prototype={constructor:ml,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?gf():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:hl=this,Bi=this),this._call=e,this._time=n,ec()},stop:function(){this._call&&(this._call=null,this._time=1/0,ec())}};function p0(e,t,n){var r=new ml;return r.restart(e,t,n),r}function a_(){gf(),++di;for(var e=hl,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--di}function mh(){yr=(pl=ko.now())+bl,di=Vi=0;try{a_()}finally{di=0,f_(),yr=0}}function c_(){var e=ko.now(),t=e-pl;t>d0&&(bl-=t,pl=e)}function f_(){for(var e,t=hl,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:hl=n);Bi=e,ec(r)}function ec(e){if(!di){Vi&&(Vi=clearTimeout(Vi));var t=e-yr;t>24?(e<1/0&&(Vi=setTimeout(mh,e-ko.now()-bl)),Di&&(Di=clearInterval(Di))):(Di||(pl=ko.now(),Di=setInterval(c_,d0)),di=1,h0(mh))}}function gh(e,t,n){var r=new ml;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var d_=Ll("start","end","cancel","interrupt"),h_=[],m0=0,yh=1,tc=2,Ds=3,vh=4,nc=5,As=6;function Fl(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;p_(e,n,{name:t,index:r,group:i,on:d_,tween:h_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:m0})}function yf(e,t){var n=Tt(e,t);if(n.state>m0)throw new Error("too late; already scheduled");return n}function Ft(e,t){var n=Tt(e,t);if(n.state>Ds)throw new Error("too late; already running");return n}function Tt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function p_(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=p0(o,0,n.time);function o(a){n.state=yh,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var d,c,f,h;if(n.state!==yh)return u();for(d in r)if(h=r[d],h.name===n.name){if(h.state===Ds)return gh(s);h.state===vh?(h.state=As,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=As,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(gh(function(){n.state===Ds&&(n.state=vh,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=tc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tc){for(n.state=Ds,i=new Array(f=n.tween.length),d=0,c=-1;d<f;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function l(a){for(var d=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=nc,1),c=-1,f=i.length;++c<f;)i[c].call(e,d);n.state===nc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=As,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Ls(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>tc&&r.state<nc,r.state=As,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function m_(e){return this.each(function(){Ls(this,e)})}function g_(e,t){var n,r;return function(){var i=Ft(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function y_(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ft(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var l={name:t,value:n},u=0,a=i.length;u<a;++u)if(i[u].name===t){i[u]=l;break}u===a&&i.push(l)}o.tween=i}}function v_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Tt(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?g_:y_)(n,e,t))}function vf(e,t,n){var r=e._id;return e.each(function(){var i=Ft(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Tt(i,r).value[t]}}function g0(e,t){var n;return(typeof t=="number"?yn:t instanceof _o?dh:(n=_o(t))?(t=n,dh):JE)(e,t)}function x_(e){return function(){this.removeAttribute(e)}}function w_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function S_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function E_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function __(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function k_(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function C_(e,t){var n=Ol(e),r=n==="transform"?r_:g0;return this.attrTween(e,typeof t=="function"?(n.local?k_:__)(n,r,vf(this,"attr."+e,t)):t==null?(n.local?w_:x_)(n):(n.local?E_:S_)(n,r,t))}function N_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function M_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function P_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&M_(e,o)),n}return i._value=t,i}function T_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&N_(e,o)),n}return i._value=t,i}function z_(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=Ol(e);return this.tween(n,(r.local?P_:T_)(r,t))}function I_(e,t){return function(){yf(this,e).delay=+t.apply(this,arguments)}}function j_(e,t){return t=+t,function(){yf(this,e).delay=t}}function R_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I_:j_)(t,e)):Tt(this.node(),t).delay}function $_(e,t){return function(){Ft(this,e).duration=+t.apply(this,arguments)}}function D_(e,t){return t=+t,function(){Ft(this,e).duration=t}}function A_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$_:D_)(t,e)):Tt(this.node(),t).duration}function L_(e,t){if(typeof t!="function")throw new Error;return function(){Ft(this,e).ease=t}}function O_(e){var t=this._id;return arguments.length?this.each(L_(t,e)):Tt(this.node(),t).ease}function b_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ft(this,e).ease=n}}function F_(e){if(typeof e!="function")throw new Error;return this.each(b_(this._id,e))}function H_(e){typeof e!="function"&&(e=Xg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new rn(r,this._parents,this._name,this._id)}function V_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),l=0;l<o;++l)for(var u=t[l],a=n[l],d=u.length,c=s[l]=new Array(d),f,h=0;h<d;++h)(f=u[h]||a[h])&&(c[h]=f);for(;l<r;++l)s[l]=t[l];return new rn(s,this._parents,this._name,this._id)}function B_(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 U_(e,t,n){var r,i,o=B_(t)?yf:Ft;return function(){var s=o(this,e),l=s.on;l!==r&&(i=(r=l).copy()).on(t,n),s.on=i}}function Q_(e,t){var n=this._id;return arguments.length<2?Tt(this.node(),n).on.on(e):this.each(U_(n,e,t))}function W_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function X_(){return this.on("end.remove",W_(this._id))}function Y_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hf(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var l=r[s],u=l.length,a=o[s]=new Array(u),d,c,f=0;f<u;++f)(d=l[f])&&(c=e.call(d,d.__data__,f,l))&&("__data__"in d&&(c.__data__=d.__data__),a[f]=c,Fl(a[f],t,n,f,a,Tt(d,n)));return new rn(o,this._parents,t,n)}function K_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wg(e));for(var r=this._groups,i=r.length,o=[],s=[],l=0;l<i;++l)for(var u=r[l],a=u.length,d,c=0;c<a;++c)if(d=u[c]){for(var f=e.call(d,d.__data__,c,u),h,y=Tt(d,n),v=0,S=f.length;v<S;++v)(h=f[v])&&Fl(h,t,n,v,f,y);o.push(f),s.push(d)}return new rn(o,s,t,n)}var q_=bo.prototype.constructor;function G_(){return new q_(this._groups,this._parents)}function Z_(e,t){var n,r,i;return function(){var o=fi(this,e),s=(this.style.removeProperty(e),fi(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function y0(e){return function(){this.style.removeProperty(e)}}function J_(e,t,n){var r,i=n+"",o;return function(){var s=fi(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function e2(e,t,n){var r,i,o;return function(){var s=fi(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),fi(this,e))),s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l))}}function t2(e,t){var n,r,i,o="style."+t,s="end."+o,l;return function(){var u=Ft(this,e),a=u.on,d=u.value[o]==null?l||(l=y0(t)):void 0;(a!==n||i!==d)&&(r=(n=a).copy()).on(s,i=d),u.on=r}}function n2(e,t,n){var r=(e+="")=="transform"?n_:g0;return t==null?this.styleTween(e,Z_(e,r)).on("end.style."+e,y0(e)):typeof t=="function"?this.styleTween(e,e2(e,r,vf(this,"style."+e,t))).each(t2(this._id,e)):this.styleTween(e,J_(e,r,t),n).on("end.style."+e,null)}function r2(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function i2(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&r2(e,s,n)),r}return o._value=t,o}function o2(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,i2(e,t,n??""))}function s2(e){return function(){this.textContent=e}}function l2(e){return function(){var t=e(this);this.textContent=t??""}}function u2(e){return this.tween("text",typeof e=="function"?l2(vf(this,"text",e)):s2(e==null?"":e+""))}function a2(e){return function(t){this.textContent=e.call(this,t)}}function c2(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&a2(i)),t}return r._value=e,r}function f2(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,c2(e))}function d2(){for(var e=this._name,t=this._id,n=v0(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)if(u=s[a]){var d=Tt(u,t);Fl(u,e,n,a,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new rn(r,this._parents,e,n)}function h2(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var l={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var a=Ft(this,r),d=a.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),i===0&&o()})}var p2=0;function rn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function v0(){return++p2}var Ht=bo.prototype;rn.prototype={constructor:rn,select:Y_,selectAll:K_,selectChild:Ht.selectChild,selectChildren:Ht.selectChildren,filter:H_,merge:V_,selection:G_,transition:d2,call:Ht.call,nodes:Ht.nodes,node:Ht.node,size:Ht.size,empty:Ht.empty,each:Ht.each,on:Q_,attr:C_,attrTween:z_,style:n2,styleTween:o2,text:u2,textTween:f2,remove:X_,tween:v_,delay:R_,duration:A_,ease:O_,easeVarying:F_,end:h2,[Symbol.iterator]:Ht[Symbol.iterator]};function m2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g2={time:null,delay:0,duration:250,ease:m2};function y2(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 v2(e){var t,n;e instanceof rn?(t=e._id,e=e._name):(t=v0(),(n=g2).time=gf(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&Fl(u,e,t,a,s,n||y2(u,t));return new rn(r,this._parents,e,t)}bo.prototype.interrupt=m_;bo.prototype.transition=v2;const ms=e=>()=>e;function x2(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 Yt(e,t,n){this.k=e,this.x=t,this.y=n}Yt.prototype={constructor:Yt,scale:function(e){return e===1?this:new Yt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Yt(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 Hl=new Yt(1,0,0);x0.prototype=Yt.prototype;function x0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hl;return e.__zoom}function Du(e){e.stopImmediatePropagation()}function Ai(e){e.preventDefault(),e.stopImmediatePropagation()}function w2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function S2(){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 xh(){return this.__zoom||Hl}function E2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _2(){return navigator.maxTouchPoints||"ontouchstart"in this}function k2(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function w0(){var e=w2,t=S2,n=k2,r=E2,i=_2,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=l_,a=Ll("start","zoom","end"),d,c,f,h=500,y=150,v=0,S=10;function p(E){E.property("__zoom",xh).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",b).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,$,T,A){var _=E.selection?E.selection():E;_.property("__zoom",xh),E!==_?k(E,$,T,A):_.interrupt().each(function(){z(this,arguments).event(A).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},p.scaleBy=function(E,$,T,A){p.scaleTo(E,function(){var _=this.__zoom.k,P=typeof $=="function"?$.apply(this,arguments):$;return _*P},T,A)},p.scaleTo=function(E,$,T,A){p.transform(E,function(){var _=t.apply(this,arguments),P=this.__zoom,R=T==null?x(_):typeof T=="function"?T.apply(this,arguments):T,O=P.invert(R),H=typeof $=="function"?$.apply(this,arguments):$;return n(m(g(P,H),R,O),_,s)},T,A)},p.translateBy=function(E,$,T,A){p.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,A)},p.translateTo=function(E,$,T,A,_){p.transform(E,function(){var P=t.apply(this,arguments),R=this.__zoom,O=A==null?x(P):typeof A=="function"?A.apply(this,arguments):A;return n(Hl.translate(O[0],O[1]).scale(R.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof T=="function"?-T.apply(this,arguments):-T),P,s)},A,_)};function g(E,$){return $=Math.max(o[0],Math.min(o[1],$)),$===E.k?E:new Yt($,E.x,E.y)}function m(E,$,T){var A=$[0]-T[0]*E.k,_=$[1]-T[1]*E.k;return A===E.x&&_===E.y?E:new Yt(E.k,A,_)}function x(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,$,T,A){E.on("start.zoom",function(){z(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(A).end()}).tween("zoom",function(){var _=this,P=arguments,R=z(_,P).event(A),O=t.apply(_,P),H=T==null?x(O):typeof T=="function"?T.apply(_,P):T,K=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),U=_.__zoom,Y=typeof $=="function"?$.apply(_,P):$,X=u(U.invert(H).concat(K/U.k),Y.invert(H).concat(K/Y.k));return function(G){if(G===1)G=Y;else{var B=X(G),ee=K/B[2];G=new Yt(ee,H[0]-B[0]*ee,H[1]-B[1]*ee)}R.zoom(null,G)}})}function z(E,$,T){return!T&&E.__zooming||new C(E,$)}function C(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}C.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 $=nt(this.that).datum();a.call(E,this.that,new x2(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:a}),$)}};function M(E,...$){if(!e.apply(this,arguments))return;var T=z(this,$).event(E),A=this.__zoom,_=Math.max(o[0],Math.min(o[1],A.k*Math.pow(2,r.apply(this,arguments)))),P=St(E);if(T.wheel)(T.mouse[0][0]!==P[0]||T.mouse[0][1]!==P[1])&&(T.mouse[1]=A.invert(T.mouse[0]=P)),clearTimeout(T.wheel);else{if(A.k===_)return;T.mouse=[P,A.invert(P)],Ls(this),T.start()}Ai(E),T.wheel=setTimeout(R,y),T.zoom("mouse",n(m(g(A,_),T.mouse[0],T.mouse[1]),T.extent,s));function R(){T.wheel=null,T.end()}}function I(E,...$){if(f||!e.apply(this,arguments))return;var T=E.currentTarget,A=z(this,$,!0).event(E),_=nt(E.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",K,!0),P=St(E,T),R=E.clientX,O=E.clientY;r0(E.view),Du(E),A.mouse=[P,this.__zoom.invert(P)],Ls(this),A.start();function H(U){if(Ai(U),!A.moved){var Y=U.clientX-R,X=U.clientY-O;A.moved=Y*Y+X*X>v}A.event(U).zoom("mouse",n(m(A.that.__zoom,A.mouse[0]=St(U,T),A.mouse[1]),A.extent,s))}function K(U){_.on("mousemove.zoom mouseup.zoom",null),i0(U.view,A.moved),Ai(U),A.event(U).end()}}function j(E,...$){if(e.apply(this,arguments)){var T=this.__zoom,A=St(E.changedTouches?E.changedTouches[0]:E,this),_=T.invert(A),P=T.k*(E.shiftKey?.5:2),R=n(m(g(T,P),A,_),t.apply(this,$),s);Ai(E),l>0?nt(this).transition().duration(l).call(k,R,A,E):nt(this).call(p.transform,R,A,E)}}function L(E,...$){if(e.apply(this,arguments)){var T=E.touches,A=T.length,_=z(this,$,E.changedTouches.length===A).event(E),P,R,O,H;for(Du(E),R=0;R<A;++R)O=T[R],H=St(O,this),H=[H,this.__zoom.invert(H),O.identifier],_.touch0?!_.touch1&&_.touch0[2]!==H[2]&&(_.touch1=H,_.taps=0):(_.touch0=H,P=!0,_.taps=1+!!d);d&&(d=clearTimeout(d)),P&&(_.taps<2&&(c=H[0],d=setTimeout(function(){d=null},h)),Ls(this),_.start())}}function F(E,...$){if(this.__zooming){var T=z(this,$).event(E),A=E.changedTouches,_=A.length,P,R,O,H;for(Ai(E),P=0;P<_;++P)R=A[P],O=St(R,this),T.touch0&&T.touch0[2]===R.identifier?T.touch0[0]=O:T.touch1&&T.touch1[2]===R.identifier&&(T.touch1[0]=O);if(R=T.that.__zoom,T.touch1){var K=T.touch0[0],U=T.touch0[1],Y=T.touch1[0],X=T.touch1[1],G=(G=Y[0]-K[0])*G+(G=Y[1]-K[1])*G,B=(B=X[0]-U[0])*B+(B=X[1]-U[1])*B;R=g(R,Math.sqrt(G/B)),O=[(K[0]+Y[0])/2,(K[1]+Y[1])/2],H=[(U[0]+X[0])/2,(U[1]+X[1])/2]}else if(T.touch0)O=T.touch0[0],H=T.touch0[1];else return;T.zoom("touch",n(m(R,O,H),T.extent,s))}}function b(E,...$){if(this.__zooming){var T=z(this,$).event(E),A=E.changedTouches,_=A.length,P,R;for(Du(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),P=0;P<_;++P)R=A[P],T.touch0&&T.touch0[2]===R.identifier?delete T.touch0:T.touch1&&T.touch1[2]===R.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(R=St(R,this),Math.hypot(c[0]-R[0],c[1]-R[1])<S)){var O=nt(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:ms(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:ms(!!E),p):e},p.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:ms(!!E),p):i},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:ms([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],p):[o[0],o[1]]},p.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(u=E,p):u},p.on=function(){var E=a.on.apply(a,arguments);return E===a?p:E},p.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,p):Math.sqrt(v)},p.tapDistance=function(E){return arguments.length?(S=+E,p):S},p}const ln={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.`},Co=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],S0=["Enter"," ","Escape"];var hi;(function(e){e.Strict="strict",e.Loose="loose"})(hi||(hi={}));var ar;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ar||(ar={}));var No;(function(e){e.Partial="partial",e.Full="full"})(No||(No={}));const E0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var wn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wn||(wn={}));var gl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gl||(gl={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));const wh={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top};function _0(e){return e===null?null:e?"valid":"invalid"}const k0=e=>"id"in e&&"source"in e&&"target"in e,C2=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),xf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ho=(e,t=[0,0])=>{const{width:n,height:r}=un(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},N2=(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 o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):xf(i)?i:t.nodeLookup.get(i.id));const l=s?yl(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Vl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Bl(n)},Vo=(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=yl(r);n=Vl(n,i)}}),Bl(n)},C0=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const l={...Bo(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const a of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=a;if(s&&!c||f)continue;const h=d.width??a.width??a.initialWidth??null,y=d.height??a.height??a.initialHeight??null,v=Mo(l,mi(a)),S=(h??0)*(y??0),p=o&&v>0;(!a.internals.handleBounds||p||v>=S||a.dragging)&&u.push(a)}return u},M2=(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 rc(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 ic({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!1);const l=Vo(e),u=wf(l,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function N0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=i;if(s.extent==="parent"&&!s.expandParent)if(!l)o==null||o("005",ln.error005());else{const h=l.measured.width,y=l.measured.height;h&&y&&(c=[[u,a],[u+h,a+y]])}else l&&gi(s.extent)&&(c=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const f=gi(c)?vr(t,c,s.measured):t;return{position:{x:f.x-u+s.measured.width*d[0],y:f.y-a+s.measured.height*d[1]},positionAbsolute:f}}async function P2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),y=!h&&f.parentId&&s.find(v=>v.id===f.parentId);(h||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),d=M2(s,u);for(const f of u)l.has(f.id)&&!d.find(y=>y.id===f.id)&&d.push(f);if(!i)return{edges:d,nodes:s};const c=await i({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const pi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),vr=(e={x:0,y:0},t,n)=>({x:pi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:pi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function M0(e,t,n){const{width:r,height:i}=un(n),{x:o,y:s}=n.internals.positionAbsolute;return vr(e,[[o,s],[o+r,s+i]],t)}const Sh=(e,t,n)=>e<t?pi(Math.abs(e-t),1,t)/t:e>n?-pi(Math.abs(e-n),1,t)/t:0,P0=(e,t,n=15,r=40)=>{const i=Sh(e.x,r,t.width-r)*n,o=Sh(e.y,r,t.height-r)*n;return[i,o]},Vl=(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)}),oc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Bl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mi=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=xf(e)?e.internals.positionAbsolute:Ho(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},yl=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=xf(e)?e.internals.positionAbsolute:Ho(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},T0=(e,t)=>Bl(Vl(oc(e),oc(t))),Mo=(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)},Eh=e=>Ct(e.width)&&Ct(e.height)&&Ct(e.x)&&Ct(e.y),Ct=e=>!isNaN(e)&&isFinite(e),T2=(e,t)=>{},Ul=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Bo=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?Ul(l,s):l},z0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),wf=(e,t,n,r,i,o)=>{const s=t/(e.width*(1+o)),l=n/(e.height*(1+o)),u=Math.min(s,l),a=pi(u,r,i),d=e.x+e.width/2,c=e.y+e.height/2,f=t/2-d*a,h=n/2-c*a;return{x:f,y:h,zoom:a}},vl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gi(e){return e!==void 0&&e!=="parent"}function un(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 I0(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 j0(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const l=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Ji(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=qt(e),l=Bo({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:u,y:a}=n?Ul(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const Ql=e=>({width:e.offsetWidth,height:e.offsetHeight}),R0=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},z2=["INPUT","SELECT","TEXTAREA"];function sc(e){var r,i,o;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return z2.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const $0=e=>"clientX"in e,qt=(e,t)=>{var o,s;const n=$0(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},_h=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Ql(s)}})};function D0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:l}){const u=e*.125+i*.375+s*.375+n*.125,a=t*.125+o*.375+l*.375+r*.125,d=Math.abs(u-e),c=Math.abs(a-t);return[u,a,d,c]}function gs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function kh({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case q.Left:return[t-gs(t-r,o),n];case q.Right:return[t+gs(r-t,o),n];case q.Top:return[t,n-gs(n-i,o)];case q.Bottom:return[t,n+gs(i-n,o)]}}function A0({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top,curvature:s=.25}){const[l,u]=kh({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[a,d]=kh({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[c,f,h,y]=D0({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${u} ${a},${d} ${r},${i}`,c,f,h,y]}function L0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[o,l,i,s]}function I2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const o=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?s:0)}function j2({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=Vl(yl(e),yl(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Mo(s,Bl(o))>0}const R2=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,$2=(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)),D2=(e,t)=>{if(!e.source||!e.target)return t;let n;return k0(e)?n={...e}:n={...e,id:R2(e)},$2(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function O0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,l]=L0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,l]}const Ch={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},A2=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.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},Nh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function L2({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:r=q.Top,center:i,offset:o}){const s=Ch[t],l=Ch[r],u={x:e.x+s.x*o,y:e.y+s.y*o},a={x:n.x+l.x*o,y:n.y+l.y*o},d=A2({source:u,sourcePosition:t,target:a}),c=d.x!==0?"x":"y",f=d[c];let h=[],y,v;const S={x:0,y:0},p={x:0,y:0},[g,m,x,k]=L0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[c]*l[c]===-1){y=i.x??g,v=i.y??m;const C=[{x:y,y:u.y},{x:y,y:a.y}],M=[{x:u.x,y:v},{x:a.x,y:v}];s[c]===f?h=c==="x"?C:M:h=c==="x"?M:C}else{const C=[{x:u.x,y:a.y}],M=[{x:a.x,y:u.y}];if(c==="x"?h=s.x===f?M:C:h=s.y===f?C:M,t===r){const b=Math.abs(e[c]-n[c]);if(b<=o){const E=Math.min(o-1,o-b);s[c]===f?S[c]=(u[c]>e[c]?-1:1)*E:p[c]=(a[c]>n[c]?-1:1)*E}}if(t!==r){const b=c==="x"?"y":"x",E=s[c]===l[b],$=u[b]>a[b],T=u[b]<a[b];(s[c]===1&&(!E&&$||E&&T)||s[c]!==1&&(!E&&T||E&&$))&&(h=c==="x"?C:M)}const I={x:u.x+S.x,y:u.y+S.y},j={x:a.x+p.x,y:a.y+p.y},L=Math.max(Math.abs(I.x-h[0].x),Math.abs(j.x-h[0].x)),F=Math.max(Math.abs(I.y-h[0].y),Math.abs(j.y-h[0].y));L>=F?(y=(I.x+j.x)/2,v=h[0].y):(y=h[0].x,v=(I.y+j.y)/2)}return[[e,{x:u.x+S.x,y:u.y+S.y},...h,{x:a.x+p.x,y:a.y+p.y},n],y,v,x,k]}function O2(e,t,n,r){const i=Math.min(Nh(e,t)/2,Nh(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${o+i*a},${s}Q ${o},${s} ${o},${s+i*d}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${s+i*u}Q ${o},${s} ${o+i*l},${s}`}function lc({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top,borderRadius:s=5,centerX:l,centerY:u,offset:a=20}){const[d,c,f,h,y]=L2({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:u},offset:a});return[d.reduce((S,p,g)=>{let m="";return g>0&&g<d.length-1?m=O2(d[g-1],p,d[g+1],s):m=`${g===0?"M":"L"}${p.x} ${p.y}`,S+=m,S},""),c,f,h,y]}function Mh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function b2(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Mh(t)||!Mh(n))return null;const r=t.internals.handleBounds||Ph(t.handles),i=n.internals.handleBounds||Ph(n.handles),o=Th((r==null?void 0:r.source)??[],e.sourceHandle),s=Th(e.connectionMode===hi.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(c=e.onError)==null||c.call(e,"008",ln.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||q.Bottom,u=(s==null?void 0:s.position)||q.Top,a=Po(t,o,l),d=Po(n,s,u);return{sourceX:a.x,sourceY:a.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:u}}function Ph(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 Po(e,t,n=q.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??un(e);if(r)return{x:i+s/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case q.Top:return{x:i+s/2,y:o};case q.Right:return{x:i+s,y:o+l/2};case q.Bottom:return{x:i+s/2,y:o+l};case q.Left:return{x:i,y:o+l/2}}}function Th(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function uc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function F2(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const a=uc(u,t);o.has(a)||(s.push({id:a,color:u.color||n,...u}),o.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Sf={nodeOrigin:[0,0],nodeExtent:Co,elevateNodesOnSelect:!0,defaults:{}},H2={...Sf,checkEquality:!0};function Ef(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function V2(e,t,n){const r=Ef(Sf,n);for(const i of e.values())if(i.parentId)_f(i,e,t,r);else{const o=Ho(i,r.nodeOrigin),s=gi(i.extent)?i.extent:r.nodeExtent,l=vr(o,s,un(i));i.internals.positionAbsolute=l}}function ac(e,t,n,r){var l,u;const i=Ef(H2,r),o=new Map(t),s=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const a of e){let d=o.get(a.id);if(i.checkEquality&&a===(d==null?void 0:d.internals.userNode))t.set(a.id,d);else{const c=Ho(a,i.nodeOrigin),f=gi(a.extent)?a.extent:i.nodeExtent,h=vr(c,f,un(a));d={...i.defaults,...a,measured:{width:(l=a.measured)==null?void 0:l.width,height:(u=a.measured)==null?void 0:u.height},internals:{positionAbsolute:h,handleBounds:a.measured?d==null?void 0:d.internals.handleBounds:void 0,z:b0(a,s),userNode:a}},t.set(a.id,d)}a.parentId&&_f(d,t,n,r)}}function B2(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 _f(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=Ef(Sf,r),l=e.parentId,u=t.get(l);if(!u){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}B2(e,n);const a=i?1e3:0,{x:d,y:c,z:f}=U2(e,u,o,s,a),{positionAbsolute:h}=e.internals,y=d!==h.x||c!==h.y;(y||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:d,y:c}:h,z:f})}function b0(e,t){return(Ct(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function U2(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,l=un(e),u=Ho(e,n),a=gi(e.extent)?vr(u,e.extent,l):u;let d=vr({x:o+a.x,y:s+a.y},r,l);e.extent==="parent"&&(d=M0(d,l,t));const c=b0(e,i),f=t.internals.z??0;return{x:d.x,y:d.y,z:f>c?f:c}}function kf(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=o.get(l.parentId))==null?void 0:s.expandedRect)??mi(u),d=T0(a,l.rect);o.set(l.parentId,{expandedRect:d,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},a)=>{var m;const d=u.internals.positionAbsolute,c=un(u),f=u.origin??r,h=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,y=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,v=Math.max(c.width,Math.round(l.width)),S=Math.max(c.height,Math.round(l.height)),p=(v-c.width)*f[0],g=(S-c.height)*f[1];(h>0||y>0||p||g)&&(i.push({id:a,type:"position",position:{x:u.position.x-h+p,y:u.position.y-y+g}}),(m=n.get(a))==null||m.forEach(x=>{e.some(k=>k.id===x.id)||i.push({id:x.id,type:"position",position:{x:x.position.x+h,y:x.position.y+y}})})),(c.width<l.width||c.height<l.height||h||y)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:v+(h?f[0]*h-p:0),height:S+(y?f[1]*y-g:0)}})}),i}function Q2(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const u=[],a=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(a.transform),c=[];for(const f of e.values()){const h=t.get(f.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const y=Ql(f.nodeElement),v=h.measured.width!==y.width||h.measured.height!==y.height;if(!!(y.width&&y.height&&(v||!h.internals.handleBounds||f.force))){const p=f.nodeElement.getBoundingClientRect(),g=gi(h.extent)?h.extent:o;let{positionAbsolute:m}=h.internals;h.parentId&&h.extent==="parent"?m=M0(m,y,t.get(h.parentId)):g&&(m=vr(m,g,y)),h.measured=y,h.internals={...h.internals,positionAbsolute:m,handleBounds:{source:_h("source",f.nodeElement,p,d,h.id),target:_h("target",f.nodeElement,p,d,h.id)}},h.parentId&&_f(h,t,n,{nodeOrigin:i}),l=!0,v&&(u.push({id:h.id,type:"dimensions",dimensions:y}),h.expandParent&&h.parentId&&c.push({id:h.id,parentId:h.parentId,rect:mi(h,i)}))}}}if(c.length>0){const f=kf(c,t,n,i);u.push(...f)}return{changes:u,updatedInternals:l}}async function W2({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function F0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:l=null}=r,u=`${i}-source-${s}`,a=`${o}-target-${l}`,d=e.get(u)||new Map,c=e.get(a)||new Map,f={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:l};t.set(r.id,r),e.set(u,d.set(`${o}-${l}`,f)),e.set(a,c.set(`${i}-${s}`,f))}}function H0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:H0(n,t):!1}function zh(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 X2(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!H0(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(o);l&&i.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Au({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const i=[];for(const[a,d]of t){const c=(s=n.get(a))==null?void 0:s.internals.userNode;c&&i.push({...c,position:d.position,dragging:r})}if(!e)return[i[0],i];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function Y2({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},d=null,c=!1,f=null,h=!1;function y({noDragClassName:S,handleSelector:p,domNode:g,isSelectable:m,nodeId:x,nodeClickDistance:k=0}){f=nt(g);function z({x:j,y:L},F){const{nodeLookup:b,nodeExtent:E,snapGrid:$,snapToGrid:T,nodeOrigin:A,onNodeDrag:_,onSelectionDrag:P,onError:R,updateNodePositions:O}=t();o={x:j,y:L};let H=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&E){const U=Vo(l);K=oc(U)}for(const[U,Y]of l){if(!b.has(U))continue;let X={x:j-Y.distance.x,y:L-Y.distance.y};T&&(X=Ul(X,$));let G=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(l.size>1&&E&&!Y.extent){const{positionAbsolute:oe}=Y.internals,ne=oe.x-K.x+E[0][0],Z=oe.x+Y.measured.width-K.x2+E[1][0],ue=oe.y-K.y+E[0][1],de=oe.y+Y.measured.height-K.y2+E[1][1];G=[[ne,ue],[Z,de]]}const{position:B,positionAbsolute:ee}=N0({nodeId:U,nextPosition:X,nodeLookup:b,nodeExtent:G,nodeOrigin:A,onError:R});H=H||Y.position.x!==B.x||Y.position.y!==B.y,Y.position=B,Y.internals.positionAbsolute=ee}if(H&&(O(l,!0),F&&(r||_||!x&&P))){const[U,Y]=Au({nodeId:x,dragItems:l,nodeLookup:b});r==null||r(F,l,U,Y),_==null||_(F,U,Y),x||P==null||P(F,Y)}}async function C(){if(!d)return;const{transform:j,panBy:L,autoPanSpeed:F}=t(),[b,E]=P0(a,d,F);(b!==0||E!==0)&&(o.x=(o.x??0)-b/j[2],o.y=(o.y??0)-E/j[2],await L({x:b,y:E})&&z(o,null)),s=requestAnimationFrame(C)}function M(j){var H;const{nodeLookup:L,multiSelectionActive:F,nodesDraggable:b,transform:E,snapGrid:$,snapToGrid:T,selectNodesOnDrag:A,onNodeDragStart:_,onSelectionDragStart:P,unselectNodesAndEdges:R}=t();c=!0,(!A||!m)&&!F&&x&&((H=L.get(x))!=null&&H.selected||R()),m&&A&&x&&(e==null||e(x));const O=Ji(j.sourceEvent,{transform:E,snapGrid:$,snapToGrid:T,containerBounds:d});if(o=O,l=X2(L,b,O,x),l.size>0&&(n||_||!x&&P)){const[K,U]=Au({nodeId:x,dragItems:l,nodeLookup:L});n==null||n(j.sourceEvent,l,K,U),_==null||_(j.sourceEvent,K,U),x||P==null||P(j.sourceEvent,U)}}const I=o0().clickDistance(k).on("start",j=>{const{domNode:L,nodeDragThreshold:F,transform:b,snapGrid:E,snapToGrid:$}=t();d=(L==null?void 0:L.getBoundingClientRect())||null,h=!1,F===0&&M(j),o=Ji(j.sourceEvent,{transform:b,snapGrid:E,snapToGrid:$,containerBounds:d}),a=qt(j.sourceEvent,d)}).on("drag",j=>{const{autoPanOnNodeDrag:L,transform:F,snapGrid:b,snapToGrid:E,nodeDragThreshold:$,nodeLookup:T}=t(),A=Ji(j.sourceEvent,{transform:F,snapGrid:b,snapToGrid:E,containerBounds:d});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||x&&!T.has(x))&&(h=!0),!h){if(!u&&L&&c&&(u=!0,C()),!c){const _=A.xSnapped-(o.x??0),P=A.ySnapped-(o.y??0);Math.sqrt(_*_+P*P)>$&&M(j)}(o.x!==A.xSnapped||o.y!==A.ySnapped)&&l&&c&&(a=qt(j.sourceEvent,d),z(A,j.sourceEvent))}}).on("end",j=>{if(!(!c||h)&&(u=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:L,updateNodePositions:F,onNodeDragStop:b,onSelectionDragStop:E}=t();if(F(l,!1),i||b||!x&&E){const[$,T]=Au({nodeId:x,dragItems:l,nodeLookup:L,dragging:!1});i==null||i(j.sourceEvent,l,$,T),b==null||b(j.sourceEvent,$,T),x||E==null||E(j.sourceEvent,T)}}}).filter(j=>{const L=j.target;return!j.button&&(!S||!zh(L,`.${S}`,g))&&(!p||zh(L,p,g))});f.call(I)}function v(){f==null||f.on(".drag",null)}return{update:y,destroy:v}}function K2(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Mo(i,mi(o))>0&&r.push(o);return r}const q2=250;function G2(e,t,n,r){var l,u;let i=[],o=1/0;const s=K2(e,n,t+q2);for(const a of s){const d=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:h}=Po(a,c,c.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));y>t||(y<o?(i=[{...c,x:f,y:h}],o=y):y===o&&i.push({...c,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(d=>d.type===a)??i[0]}return i[0]}function V0(e,t,n,r,i,o=!1){var a,d,c;const s=r.get(e);if(!s)return null;const l=i==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Po(s,u,u.position,!0)}:u}function B0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Z2(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const U0=()=>!0;function J2(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:h,onConnectStart:y,onConnect:v,onConnectEnd:S,isValidConnection:p=U0,onReconnectEnd:g,updateConnection:m,getTransform:x,getFromHandle:k,autoPanSpeed:z}){const C=R0(e.target);let M=0,I;const{x:j,y:L}=qt(e),F=C==null?void 0:C.elementFromPoint(j,L),b=B0(o,F),E=l==null?void 0:l.getBoundingClientRect();if(!E||!b)return;const $=V0(i,b,r,u,t);if(!$)return;let T=qt(e,E),A=!1,_=null,P=!1,R=null;function O(){if(!d||!E)return;const[ee,oe]=P0(T,E,z);f({x:ee,y:oe}),M=requestAnimationFrame(O)}const H={...$,nodeId:i,type:b,position:$.position},K=u.get(i),Y={inProgress:!0,isValid:null,from:Po(K,H,q.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:K,to:T,toHandle:null,toPosition:wh[H.position],toNode:null};m(Y);let X=Y;y==null||y(e,{nodeId:i,handleId:r,handleType:b});function G(ee){if(!k()||!H){B(ee);return}const oe=x();T=qt(ee,E),I=G2(Bo(T,oe,!1,[1,1]),n,u,H),A||(O(),A=!0);const ne=Q0(ee,{handle:I,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:C,lib:a,flowId:c,nodeLookup:u});R=ne.handleDomNode,_=ne.connection,P=Z2(!!I,ne.isValid);const Z={...X,isValid:P,to:I&&P?z0({x:I.x,y:I.y},oe):T,toHandle:ne.toHandle,toPosition:P&&ne.toHandle?ne.toHandle.position:wh[H.position],toNode:ne.toHandle?u.get(ne.toHandle.nodeId):null};P&&I&&X.toHandle&&Z.toHandle&&X.toHandle.type===Z.toHandle.type&&X.toHandle.nodeId===Z.toHandle.nodeId&&X.toHandle.id===Z.toHandle.id&&X.to.x===Z.to.x&&X.to.y===Z.to.y||(m(Z),X=Z)}function B(ee){(I||R)&&_&&P&&(v==null||v(_));const{inProgress:oe,...ne}=X,Z={...ne,toPosition:X.toHandle?X.toPosition:null};S==null||S(ee,Z),o&&(g==null||g(ee,Z)),h(),cancelAnimationFrame(M),A=!1,P=!1,_=null,R=null,C.removeEventListener("mousemove",G),C.removeEventListener("mouseup",B),C.removeEventListener("touchmove",G),C.removeEventListener("touchend",B)}C.addEventListener("mousemove",G),C.addEventListener("mouseup",B),C.addEventListener("touchmove",G),C.addEventListener("touchend",B)}function Q0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:l,flowId:u,isValidConnection:a=U0,nodeLookup:d}){const c=o==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y}=qt(e),v=s.elementFromPoint(h,y),S=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const g=B0(void 0,S),m=S.getAttribute("data-nodeid"),x=S.getAttribute("data-handleid"),k=S.classList.contains("connectable"),z=S.classList.contains("connectableend");if(!m||!g)return p;const C={source:c?m:r,sourceHandle:c?x:i,target:c?r:m,targetHandle:c?i:x};p.connection=C;const I=k&&z&&(n===hi.Strict?c&&g==="source"||!c&&g==="target":m!==r||x!==i);p.isValid=I&&a(C),p.toHandle=V0(m,g,x,d,n,!1)}return p}const cc={onPointerDown:J2,isValid:Q0};function ek({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=nt(e);function o({translateExtent:l,width:u,height:a,zoomStep:d=10,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const y=m=>{const x=n();if(m.sourceEvent.type!=="wheel"||!t)return;const k=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,z=x[2]*Math.pow(2,k);t.scaleTo(z)};let v=[0,0];const S=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(v=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},p=m=>{const x=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const k=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],z=[k[0]-v[0],k[1]-v[1]];v=k;const C=r()*Math.max(x[2],Math.log(x[2]))*(h?-1:1),M={x:x[0]-z[0]*C,y:x[1]-z[1]*C},I=[[0,0],[u,a]];t.setViewportConstrained({x:M.x,y:M.y,zoom:x[2]},I,l)},g=w0().on("start",S).on("zoom",c?p:null).on("zoom.wheel",f?y:null);i.call(g,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:St}}const tk=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wl=e=>({x:e.x,y:e.y,zoom:e.k}),Lu=({x:e,y:t,zoom:n})=>Hl.translate(e,t).scale(n),$r=(e,t)=>e.target.closest(`.${t}`),W0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ou=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},X0=e=>{const t=e.ctrlKey&&vl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function nk({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return d=>{if($r(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const S=St(d),p=X0(d),g=c*Math.pow(2,p);r.scaleTo(n,g,S,d);return}const f=d.deltaMode===1?20:1;let h=i===ar.Vertical?0:d.deltaX*f,y=i===ar.Horizontal?0:d.deltaY*f;!vl()&&d.shiftKey&&i!==ar.Vertical&&(h=d.deltaY*f,y=0),r.translateBy(n,-(h/c)*o,-(y/c)*o,{internal:!0});const v=Wl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(d,v)),e.isPanScrolling&&(u==null||u(d,v),e.panScrollTimeout=setTimeout(()=>{a==null||a(d,v),e.isPanScrolling=!1},150))}}function rk({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||$r(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function ik({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,l;if((o=r.sourceEvent)!=null&&o.internal)return;const i=Wl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.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 ok({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,l;e.usedRightMouseButton=!!(n&&W0(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((l=o.sourceEvent)!=null&&l.internal)&&(i==null||i(o.sourceEvent,Wl(o.transform)))}}function sk({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&W0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&tk(e.prevViewport,s.transform))){const u=Wl(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},n?150:0)}}}function lk({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a}){return d=>{var y;const c=e||t,f=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&($r(d,`${a}-flow__node`)||$r(d,`${a}-flow__edge`)))return!0;if(!r&&!c&&!i&&!o&&!n||s||$r(d,l)&&d.type==="wheel"||$r(d,u)&&(d.type!=="wheel"||i&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((y=d.touches)==null?void 0:y.length)>1)return d.preventDefault(),!1;if(!c&&!i&&!f&&d.type==="wheel"||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&h}}function uk({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:a}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),f=w0().clickDistance(!Ct(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=nt(e).call(f);m({x:o.x,y:o.y,zoom:pi(o.zoom,t,n)},[[0,0],[c.width,c.height]],i);const y=h.on("wheel.zoom"),v=h.on("dblclick.zoom");f.wheelDelta(X0);function S(F,b){return h?new Promise(E=>{f==null||f.transform(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function p({noWheelClassName:F,noPanClassName:b,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:T,panOnDrag:A,panOnScrollMode:_,panOnScrollSpeed:P,preventScrolling:R,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:U,lib:Y,onTransformChange:X}){$&&!d.isZoomingOrPanning&&g();const B=T&&!U&&!$?nk({zoomPanValues:d,noWheelClassName:F,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:P,zoomOnPinch:O,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}):rk({noWheelClassName:F,preventScrolling:R,d3ZoomHandler:y});if(h.on("wheel.zoom",B,{passive:!1}),!$){const oe=ik({zoomPanValues:d,onDraggingChange:a,onPanZoomStart:l});f.on("start",oe);const ne=ok({zoomPanValues:d,panOnDrag:A,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:X});f.on("zoom",ne);const Z=sk({zoomPanValues:d,panOnDrag:A,panOnScroll:T,onPaneContextMenu:E,onPanZoomEnd:u,onDraggingChange:a});f.on("end",Z)}const ee=lk({zoomActivationKeyPressed:U,panOnDrag:A,zoomOnScroll:H,panOnScroll:T,zoomOnDoubleClick:K,zoomOnPinch:O,userSelectionActive:$,noPanClassName:b,noWheelClassName:F,lib:Y});f.filter(ee),K?h.on("dblclick.zoom",v):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function m(F,b,E){const $=Lu(F),T=f==null?void 0:f.constrain()($,b,E);return T&&await S(T),new Promise(A=>A(T))}async function x(F,b){const E=Lu(F);return await S(E,b),new Promise($=>$(E))}function k(F){if(h){const b=Lu(F),E=h.property("__zoom");(E.k!==F.zoom||E.x!==F.x||E.y!==F.y)&&(f==null||f.transform(h,b,null,{sync:!0}))}}function z(){const F=h?x0(h.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function C(F,b){return h?new Promise(E=>{f==null||f.scaleTo(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function M(F,b){return h?new Promise(E=>{f==null||f.scaleBy(Ou(h,b==null?void 0:b.duration,()=>E(!0)),F)}):Promise.resolve(!1)}function I(F){f==null||f.scaleExtent(F)}function j(F){f==null||f.translateExtent(F)}function L(F){const b=!Ct(F)||F<0?0:F;f==null||f.clickDistance(b)}return{update:p,destroy:g,setViewport:x,setViewportConstrained:m,getViewport:z,scaleTo:C,scaleBy:M,setScaleExtent:I,setTranslateExtent:j,syncViewport:k,setClickDistance:L}}var eo;(function(e){e.Line="line",e.Handle="handle"})(eo||(eo={}));function ak({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function ck(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 dn(e,t){return Math.max(0,t-e)}function hn(e,t){return Math.max(0,e-t)}function ys(e,t,n){return Math.max(0,t-e,e-n)}function Ih(e,t){return e?!t:t}function fk(e,t,n,r,i,o,s,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:h,ySnapped:y}=n,{minWidth:v,maxWidth:S,minHeight:p,maxHeight:g}=r,{x:m,y:x,width:k,height:z,aspectRatio:C}=e;let M=Math.floor(d?h-e.pointerX:0),I=Math.floor(c?y-e.pointerY:0);const j=k+(u?-M:M),L=z+(a?-I:I),F=-o[0]*k,b=-o[1]*z;let E=ys(j,v,S),$=ys(L,p,g);if(s){let _=0,P=0;u&&M<0?_=dn(m+M+F,s[0][0]):!u&&M>0&&(_=hn(m+j+F,s[1][0])),a&&I<0?P=dn(x+I+b,s[0][1]):!a&&I>0&&(P=hn(x+L+b,s[1][1])),E=Math.max(E,_),$=Math.max($,P)}if(l){let _=0,P=0;u&&M>0?_=hn(m+M,l[0][0]):!u&&M<0&&(_=dn(m+j,l[1][0])),a&&I>0?P=hn(x+I,l[0][1]):!a&&I<0&&(P=dn(x+L,l[1][1])),E=Math.max(E,_),$=Math.max($,P)}if(i){if(d){const _=ys(j/C,p,g)*C;if(E=Math.max(E,_),s){let P=0;!u&&!a||u&&!a&&f?P=hn(x+b+j/C,s[1][1])*C:P=dn(x+b+(u?M:-M)/C,s[0][1])*C,E=Math.max(E,P)}if(l){let P=0;!u&&!a||u&&!a&&f?P=dn(x+j/C,l[1][1])*C:P=hn(x+(u?M:-M)/C,l[0][1])*C,E=Math.max(E,P)}}if(c){const _=ys(L*C,v,S)/C;if($=Math.max($,_),s){let P=0;!u&&!a||a&&!u&&f?P=hn(m+L*C+F,s[1][0])/C:P=dn(m+(a?I:-I)*C+F,s[0][0])/C,$=Math.max($,P)}if(l){let P=0;!u&&!a||a&&!u&&f?P=dn(m+L*C,l[1][0])/C:P=hn(m+(a?I:-I)*C,l[0][0])/C,$=Math.max($,P)}}}I=I+(I<0?$:-$),M=M+(M<0?E:-E),i&&(f?j>L*C?I=(Ih(u,a)?-M:M)/C:M=(Ih(u,a)?-I:I)*C:d?(I=M/C,a=u):(M=I*C,u=a));const T=u?m+M:m,A=a?x+I:x;return{width:k+(u?-M:M),height:z+(a?-I:I),x:o[0]*M*(u?-1:1)+T,y:o[1]*I*(a?-1:1)+A}}const Y0={width:0,height:0,x:0,y:0},dk={...Y0,pointerX:0,pointerY:0,aspectRatio:1};function hk(e){return[[0,0],[e.measured.width,e.measured.height]]}function pk(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,l=n[0]*o,u=n[1]*s;return[[r-l,i-u],[r+o-l,i+s-u]]}function mk({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=nt(e);function s({controlPosition:u,boundaries:a,keepAspectRatio:d,onResizeStart:c,onResize:f,onResizeEnd:h,shouldResize:y}){let v={...Y0},S={...dk};const p=ck(u);let g,m=null,x=[],k,z,C;const M=o0().on("start",I=>{const{nodeLookup:j,transform:L,snapGrid:F,snapToGrid:b,nodeOrigin:E,paneDomNode:$}=n();if(g=j.get(t),!g)return;m=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:T,ySnapped:A}=Ji(I.sourceEvent,{transform:L,snapGrid:F,snapToGrid:b,containerBounds:m});v={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},S={...v,pointerX:T,pointerY:A,aspectRatio:v.width/v.height},k=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(k=j.get(g.parentId),z=k&&g.extent==="parent"?hk(k):void 0),x=[],C=void 0;for(const[_,P]of j)if(P.parentId===t&&(x.push({id:_,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const R=pk(P,g,P.origin??E);C?C=[[Math.min(R[0][0],C[0][0]),Math.min(R[0][1],C[0][1])],[Math.max(R[1][0],C[1][0]),Math.max(R[1][1],C[1][1])]]:C=R}c==null||c(I,{...v})}).on("drag",I=>{const{transform:j,snapGrid:L,snapToGrid:F,nodeOrigin:b}=n(),E=Ji(I.sourceEvent,{transform:j,snapGrid:L,snapToGrid:F,containerBounds:m}),$=[];if(!g)return;const{x:T,y:A,width:_,height:P}=v,R={},O=g.origin??b,{width:H,height:K,x:U,y:Y}=fk(S,p,E,a,d,O,z,C),X=H!==_,G=K!==P,B=U!==T&&X,ee=Y!==A&&G;if(!B&&!ee&&!X&&!G)return;if((B||ee||O[0]===1||O[1]===1)&&(R.x=B?U:v.x,R.y=ee?Y:v.y,v.x=R.x,v.y=R.y,x.length>0)){const ue=U-T,de=Y-A;for(const $e of x)$e.position={x:$e.position.x-ue+O[0]*(H-_),y:$e.position.y-de+O[1]*(K-P)},$.push($e)}if((X||G)&&(R.width=X?H:v.width,R.height=G?K:v.height,v.width=R.width,v.height=R.height),k&&g.expandParent){const ue=O[0]*(R.width??0);R.x&&R.x<ue&&(v.x=ue,S.x=S.x-(R.x-ue));const de=O[1]*(R.height??0);R.y&&R.y<de&&(v.y=de,S.y=S.y-(R.y-de))}const oe=ak({width:v.width,prevWidth:_,height:v.height,prevHeight:P,affectsX:p.affectsX,affectsY:p.affectsY}),ne={...v,direction:oe};(y==null?void 0:y(I,ne))!==!1&&(f==null||f(I,ne),r(R,$))}).on("end",I=>{h==null||h(I,{...v}),i==null||i()});o.call(M)}function l(){o.on(".drag",null)}return{update:s,destroy:l}}var K0={exports:{}},q0={},G0={exports:{}},Z0={};/**
41
41
  * @license React
42
42
  * use-sync-external-store-shim.production.js
43
43
  *
@@ -45,7 +45,7 @@ Error generating stack: `+o.message+`
45
45
  *
46
46
  * This source code is licensed under the MIT license found in the
47
47
  * LICENSE file in the root directory of this source tree.
48
- */var yi=D;function mk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gk=typeof Object.is=="function"?Object.is:mk,yk=yi.useState,vk=yi.useEffect,xk=yi.useLayoutEffect,wk=yi.useDebugValue;function Sk(e,t){var n=t(),r=yk({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return xk(function(){i.value=n,i.getSnapshot=t,bu(i)&&o({inst:i})},[e,n,t]),vk(function(){return bu(i)&&o({inst:i}),e(function(){bu(i)&&o({inst:i})})},[e]),wk(n),n}function bu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gk(e,n)}catch{return!0}}function Ek(e,t){return t()}var _k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ek:Sk;G0.useSyncExternalStore=yi.useSyncExternalStore!==void 0?yi.useSyncExternalStore:_k;q0.exports=G0;var kk=q0.exports;/**
48
+ */var yi=D;function gk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yk=typeof Object.is=="function"?Object.is:gk,vk=yi.useState,xk=yi.useEffect,wk=yi.useLayoutEffect,Sk=yi.useDebugValue;function Ek(e,t){var n=t(),r=vk({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return wk(function(){i.value=n,i.getSnapshot=t,bu(i)&&o({inst:i})},[e,n,t]),xk(function(){return bu(i)&&o({inst:i}),e(function(){bu(i)&&o({inst:i})})},[e]),Sk(n),n}function bu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yk(e,n)}catch{return!0}}function _k(e,t){return t()}var kk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_k:Ek;Z0.useSyncExternalStore=yi.useSyncExternalStore!==void 0?yi.useSyncExternalStore:kk;G0.exports=Z0;var Ck=G0.exports;/**
49
49
  * @license React
50
50
  * use-sync-external-store-shim/with-selector.production.js
51
51
  *
@@ -53,10 +53,10 @@ Error generating stack: `+o.message+`
53
53
  *
54
54
  * This source code is licensed under the MIT license found in the
55
55
  * LICENSE file in the root directory of this source tree.
56
- */var Xl=D,Ck=kk;function Nk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mk=typeof Object.is=="function"?Object.is:Nk,Pk=Ck.useSyncExternalStore,Tk=Xl.useRef,zk=Xl.useEffect,Ik=Xl.useMemo,jk=Xl.useDebugValue;K0.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Tk(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Ik(function(){function u(h){if(!a){if(a=!0,d=h,h=r(h),i!==void 0&&s.hasValue){var y=s.value;if(i(y,h))return c=y}return c=h}if(y=c,Mk(d,h))return y;var v=r(h);return i!==void 0&&i(y,v)?(d=h,y):(d=h,c=v)}var a=!1,d,c,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,i]);var l=Pk(e,o[0],o[1]);return zk(function(){s.hasValue=!0,s.value=l},[l]),jk(l),l};Y0.exports=K0;var Rk=Y0.exports;const $k=dp(Rk),Dk={},jh=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,h))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Dk?"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()}},a=t=e(r,i,u);return u},Lk=e=>e?jh(e):jh,{useDebugValue:Ak}=Yv,{useSyncExternalStoreWithSelector:Ok}=$k,bk=e=>e;function Z0(e,t=bk,n){const r=Ok(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ak(r),r}const Rh=(e,t)=>{const n=Lk(e),r=(i,o=t)=>Z0(n,i,o);return Object.assign(r,n),r},Fk=(e,t)=>e?Rh(e,t):Rh;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 Yl=D.createContext(null),Hk=Yl.Provider,J0=ln.error001();function le(e,t){const n=D.useContext(Yl);if(n===null)throw new Error(J0);return Z0(n,e,t)}function ge(){const e=D.useContext(Yl);if(e===null)throw new Error(J0);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const $h={display:"none"},Vk={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ey="react-flow__node-desc",ty="react-flow__edge-desc",Bk="react-flow__aria-live",Uk=e=>e.ariaLiveMessage;function Qk({rfId:e}){const t=le(Uk);return w.jsx("div",{id:`${Bk}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Vk,children:t})}function Wk({rfId:e,disableKeyboardA11y:t}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{id:`${ey}-${e}`,style:$h,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."," "]}),w.jsx("div",{id:`${ty}-${e}`,style:$h,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&w.jsx(Qk,{rfId:e})]})}const Xk=e=>e.userSelectionActive?"none":"all",Cf=D.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=le(Xk),l=`${e}`.split("-");return w.jsx("div",{className:Ce(["react-flow__panel",n,...l]),style:{...r,pointerEvents:s},ref:o,...i,children:t})});function Yk({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:w.jsx(Cf,{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:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Kk=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}},vs=e=>e.id;function qk(e,t){return Ee(e.selectedNodes.map(vs),t.selectedNodes.map(vs))&&Ee(e.selectedEdges.map(vs),t.selectedEdges.map(vs))}function Gk({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le(Kk,qk);return D.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const Zk=e=>!!e.onSelectionChangeHandlers;function Jk({onSelectionChange:e}){const t=le(Zk);return e||t?w.jsx(Gk,{onSelectionChange:e}):null}const ny=[0,0],eC={x:0,y:0,zoom:1},tC=["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"],Dh=[...tC,"rfId"],nC=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}),Lh={translateExtent:Co,nodeOrigin:ny,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function rC(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:u,setPaneClickDistance:a}=le(nC,Ee),d=ge();D.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{c.current=Lh,l()}),[]);const c=D.useRef(Lh);return D.useEffect(()=>{for(const f of Dh){const h=e[f],y=c.current[f];h!==y&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?o(h):f==="nodeExtent"?s(h):f==="paneClickDistance"?a(h):f==="fitView"?d.setState({fitViewOnInit:h}):f==="fitViewOptions"?d.setState({fitViewOnInitOptions:h}):d.setState({[f]:h})))}c.current=e},Dh.map(f=>e[f])),null}function Ah(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function iC(e){var r;const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const i=Ah(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=Ah())!=null&&r.matches?"dark":"light"}const Oh=typeof document<"u"?document:null;function To(e=null,t={target:Oh,actInsideInputWithModifier:!0}){const[n,r]=D.useState(!1),i=D.useRef(!1),o=D.useRef(new Set([])),[s,l]=D.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
56
+ */var Xl=D,Nk=Ck;function Mk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pk=typeof Object.is=="function"?Object.is:Mk,Tk=Nk.useSyncExternalStore,zk=Xl.useRef,Ik=Xl.useEffect,jk=Xl.useMemo,Rk=Xl.useDebugValue;q0.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=zk(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=jk(function(){function u(h){if(!a){if(a=!0,d=h,h=r(h),i!==void 0&&s.hasValue){var y=s.value;if(i(y,h))return c=y}return c=h}if(y=c,Pk(d,h))return y;var v=r(h);return i!==void 0&&i(y,v)?(d=h,y):(d=h,c=v)}var a=!1,d,c,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,i]);var l=Tk(e,o[0],o[1]);return Ik(function(){s.hasValue=!0,s.value=l},[l]),Rk(l),l};K0.exports=q0;var $k=K0.exports;const Dk=dp($k),Ak={},jh=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,h))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Ak?"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()}},a=t=e(r,i,u);return u},Lk=e=>e?jh(e):jh,{useDebugValue:Ok}=Kv,{useSyncExternalStoreWithSelector:bk}=Dk,Fk=e=>e;function J0(e,t=Fk,n){const r=bk(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ok(r),r}const Rh=(e,t)=>{const n=Lk(e),r=(i,o=t)=>J0(n,i,o);return Object.assign(r,n),r},Hk=(e,t)=>e?Rh(e,t):Rh;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 Yl=D.createContext(null),Vk=Yl.Provider,ey=ln.error001();function le(e,t){const n=D.useContext(Yl);if(n===null)throw new Error(ey);return J0(n,e,t)}function ge(){const e=D.useContext(Yl);if(e===null)throw new Error(ey);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const $h={display:"none"},Bk={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ty="react-flow__node-desc",ny="react-flow__edge-desc",Uk="react-flow__aria-live",Qk=e=>e.ariaLiveMessage;function Wk({rfId:e}){const t=le(Qk);return w.jsx("div",{id:`${Uk}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Bk,children:t})}function Xk({rfId:e,disableKeyboardA11y:t}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{id:`${ty}-${e}`,style:$h,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."," "]}),w.jsx("div",{id:`${ny}-${e}`,style:$h,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&w.jsx(Wk,{rfId:e})]})}const Yk=e=>e.userSelectionActive?"none":"all",Cf=D.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=le(Yk),l=`${e}`.split("-");return w.jsx("div",{className:Ce(["react-flow__panel",n,...l]),style:{...r,pointerEvents:s},ref:o,...i,children:t})});function Kk({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:w.jsx(Cf,{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:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qk=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}},vs=e=>e.id;function Gk(e,t){return Ee(e.selectedNodes.map(vs),t.selectedNodes.map(vs))&&Ee(e.selectedEdges.map(vs),t.selectedEdges.map(vs))}function Zk({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le(qk,Gk);return D.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const Jk=e=>!!e.onSelectionChangeHandlers;function eC({onSelectionChange:e}){const t=le(Jk);return e||t?w.jsx(Zk,{onSelectionChange:e}):null}const ry=[0,0],tC={x:0,y:0,zoom:1},nC=["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"],Dh=[...nC,"rfId"],rC=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}),Ah={translateExtent:Co,nodeOrigin:ry,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function iC(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:u,setPaneClickDistance:a}=le(rC,Ee),d=ge();D.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{c.current=Ah,l()}),[]);const c=D.useRef(Ah);return D.useEffect(()=>{for(const f of Dh){const h=e[f],y=c.current[f];h!==y&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?o(h):f==="nodeExtent"?s(h):f==="paneClickDistance"?a(h):f==="fitView"?d.setState({fitViewOnInit:h}):f==="fitViewOptions"?d.setState({fitViewOnInitOptions:h}):d.setState({[f]:h})))}c.current=e},Dh.map(f=>e[f])),null}function Lh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function oC(e){var r;const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const i=Lh(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=Lh())!=null&&r.matches?"dark":"light"}const Oh=typeof document<"u"?document:null;function To(e=null,t={target:Oh,actInsideInputWithModifier:!0}){const[n,r]=D.useState(!1),i=D.useRef(!1),o=D.useRef(new Set([])),[s,l]=D.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
57
57
  `).replace(`
58
58
 
59
59
  `,`
60
60
  +`).split(`
61
- `)),d=a.reduce((c,f)=>c.concat(...f),[]);return[a,d]}return[[],[]]},[e]);return D.useEffect(()=>{const u=(t==null?void 0:t.target)||Oh;if(e!==null){const a=f=>{if(i.current=f.ctrlKey||f.metaKey||f.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&sc(f))return!1;const y=Fh(f.code,l);o.current.add(f[y]),bh(s,o.current,!1)&&(f.preventDefault(),r(!0))},d=f=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&sc(f))return!1;const y=Fh(f.code,l);bh(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[y]),f.key==="Meta"&&o.current.clear(),i.current=!1},c=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",a),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{u==null||u.removeEventListener("keydown",a),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[e,r]),n}function bh(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Fh(e,t){return t.includes(e)?"code":"key"}const oC=()=>{const e=ge();return D.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,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:o,domNode:s}=e.getState();if(!o||!s)return Promise.resolve(!1);const l=rc(n,t),{width:u,height:a}=Ql(s);return ic({nodes:l,width:u,height:a,minZoom:r,maxZoom:i,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:i,height:o,maxZoom:s,panZoom:l}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:s,a=i/2-t*u,d=o/2-n*u;return l?(await l.setViewport({x:a,y:d,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:l}=e.getState(),u=wf(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:s,y:l}=o.getBoundingClientRect(),u={x:t.x-s,y:t.y-l};return Bo(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=T0(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function ry(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...o};for(const u of s)sC(u,l);n.push(l)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function sC(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 lC(e,t){return ry(e,t)}function uC(e,t){return ry(e,t)}function Yn(e,t){return{id:e,type:"select",selected:t}}function Dr(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(Yn(o.id,s)))}return r}function Hh({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const l=t.get(s.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Vh(e){return{id:e.id,type:"remove"}}const Bh=e=>k2(e),aC=e=>_0(e);function iy(e){return D.forwardRef(e)}const cC=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Uh(e){const[t,n]=D.useState(BigInt(0)),[r]=D.useState(()=>fC(()=>n(i=>i+BigInt(1))));return cC(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function fC(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const oy=D.createContext(null);function dC({children:e}){const t=ge(),n=D.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f}=t.getState();let h=u;for(const y of l)h=typeof y=="function"?y(h):y;d?a(h):c&&c(Hh({items:h,lookup:f}))},[]),r=Uh(n),i=D.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let h=u;for(const y of l)h=typeof y=="function"?y(h):y;d?a(h):c&&c(Hh({items:h,lookup:f}))},[]),o=Uh(i),s=D.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return w.jsx(oy.Provider,{value:s,children:e})}function hC(){const e=D.useContext(oy);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pC=e=>!!e.panZoom;function Nf(){const e=oC(),t=ge(),n=hC(),r=le(pC),i=D.useMemo(()=>{const o=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},u=c=>{var p,g;const{nodeLookup:f,nodeOrigin:h}=t.getState(),y=Bh(c)?c:f.get(c.id),v=y.parentId?I0(y.position,y.measured,y.parentId,f,h):y.position,S={...y,position:v,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((g=y.measured)==null?void 0:g.height)??y.height};return mi(S)},a=(c,f,h={replace:!1})=>{s(y=>y.map(v=>{if(v.id===c){const S=typeof f=="function"?f(v):f;return h.replace&&Bh(S)?S:{...v,...S}}return v}))},d=(c,f,h={replace:!1})=>{l(y=>y.map(v=>{if(v.id===c){const S=typeof f=="function"?f(v):f;return h.replace&&aC(S)?S:{...v,...S}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=o(c))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:l,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:h}=t.getState(),[y,v,S]=h;return{nodes:c.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:y,y:v,zoom:S}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:h,edges:y,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:g,onDelete:m,onBeforeDelete:x}=t.getState(),{nodes:k,edges:z}=await M2({nodesToRemove:c,edgesToRemove:f,nodes:h,edges:y,onBeforeDelete:x}),C=z.length>0,M=k.length>0;if(C){const I=z.map(Vh);S==null||S(z),g(I)}if(M){const I=k.map(Vh);v==null||v(k),p(I)}return(M||C)&&(m==null||m({nodes:k,edges:z})),{deletedNodes:k,deletedEdges:z}},getIntersectingNodes:(c,f=!0,h)=>{const y=Eh(c),v=y?c:u(c),S=h!==void 0;return v?(h||t.getState().nodes).filter(p=>{const g=t.getState().nodeLookup.get(p.id);if(g&&!y&&(p.id===c.id||!g.internals.positionAbsolute))return!1;const m=mi(S?p:g),x=Mo(m,v);return f&&x>0||x>=v.width*v.height}):[]},isNodeIntersecting:(c,f,h=!0)=>{const v=Eh(c)?c:u(c);if(!v)return!1;const S=Mo(v,f);return h&&S>0||S>=v.width*v.height},updateNode:a,updateNodeData:(c,f,h={replace:!1})=>{a(c,y=>{const v=typeof f=="function"?f(y):f;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},updateEdge:d,updateEdgeData:(c,f,h={replace:!1})=>{d(c,y=>{const v=typeof f=="function"?f(y):f;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return C2(c,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:c,id:f,nodeId:h})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${h}-${c}-${f??null}`))==null?void 0:y.values())??[])}}},[]);return D.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const Qh=e=>e.selected,mC={actInsideInputWithModifier:!1},gC=typeof window<"u"?window:void 0;function yC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=Nf(),i=To(e,mC),o=To(t,{target:gC});D.useEffect(()=>{if(i){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Qh),edges:s.filter(Qh)}),n.setState({nodesSelectionActive:!1})}},[i]),D.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function vC(e){const t=ge();D.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=Ql(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",ln.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 Kl={position:"absolute",width:"100%",height:"100%",top:0,left:0},xC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function wC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=ar.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:h=!0,children:y,noWheelClassName:v,noPanClassName:S,onViewportChange:p,isControlledViewport:g,paneClickDistance:m}){const x=ge(),k=D.useRef(null),{userSelectionActive:z,lib:C}=le(xC,Ee),M=To(f),I=D.useRef();vC(k);const j=D.useCallback(A=>{p==null||p({x:A[0],y:A[1],zoom:A[2]}),g||x.setState({transform:A})},[p,g]);return D.useEffect(()=>{if(k.current){I.current=lk({domNode:k.current,minZoom:d,maxZoom:c,translateExtent:a,viewport:u,paneClickDistance:m,onDraggingChange:E=>x.setState({paneDragging:E}),onPanZoomStart:(E,$)=>{const{onViewportChangeStart:T,onMoveStart:L}=x.getState();L==null||L(E,$),T==null||T($)},onPanZoom:(E,$)=>{const{onViewportChange:T,onMove:L}=x.getState();L==null||L(E,$),T==null||T($)},onPanZoomEnd:(E,$)=>{const{onViewportChangeEnd:T,onMoveEnd:L}=x.getState();L==null||L(E,$),T==null||T($)}});const{x:A,y:F,zoom:b}=I.current.getViewport();return x.setState({panZoom:I.current,transform:[A,F,b],domNode:k.current.closest(".react-flow")}),()=>{var E;(E=I.current)==null||E.destroy()}}},[]),D.useEffect(()=>{var A;(A=I.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:M,preventScrolling:h,noPanClassName:S,userSelectionActive:z,noWheelClassName:v,lib:C,onTransformChange:j})},[e,t,n,r,i,o,s,l,M,h,S,z,v,C,j]),w.jsx("div",{className:"react-flow__renderer",ref:k,style:Kl,children:y})}const SC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function EC(){const{userSelectionActive:e,userSelectionRect:t}=le(SC,Ee);return e&&t?w.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 Fu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},_C=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function kC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=No.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:a,onPaneMouseEnter:d,onPaneMouseMove:c,onPaneMouseLeave:f,children:h}){const y=D.useRef(null),v=ge(),S=D.useRef(0),p=D.useRef(0),g=D.useRef(),m=D.useRef(new Map),{userSelectionActive:x,elementsSelectable:k,dragging:z}=le(_C,Ee),C=k&&(e||x),M=D.useRef(!1),I=D.useRef(!1),j=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,p.current=0},A=_=>{if(M.current){M.current=!1;return}l==null||l(_),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},F=_=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){_.preventDefault();return}u==null||u(_)},b=a?_=>a(_):void 0,E=_=>{var U,Y,X,G;const{resetSelectedElements:P,domNode:R,edgeLookup:O}=v.getState();if(g.current=R==null?void 0:R.getBoundingClientRect(),!k||!e||_.button!==0||_.target!==y.current||!g.current)return;(Y=(U=_.target)==null?void 0:U.setPointerCapture)==null||Y.call(U,_.pointerId),I.current=!0,M.current=!1,m.current=new Map;for(const[B,ee]of O)m.current.set(ee.source,((X=m.current.get(ee.source))==null?void 0:X.add(B))||new Set([B])),m.current.set(ee.target,((G=m.current.get(ee.target))==null?void 0:G.add(B))||new Set([B]));const{x:H,y:K}=qt(_.nativeEvent,g.current);P(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:K,x:H,y:K}}),o==null||o(_)},$=_=>{const{userSelectionRect:P,edgeLookup:R,transform:O,nodeLookup:H,triggerNodeChanges:K,triggerEdgeChanges:U}=v.getState();if(!g.current||!P)return;M.current=!0;const{x:Y,y:X}=qt(_.nativeEvent,g.current),{startX:G,startY:B}=P,ee={startX:G,startY:B,x:Y<G?Y:G,y:X<B?X:B,width:Math.abs(Y-G),height:Math.abs(X-B)},oe=k0(H,ee,O,n===No.Partial,!0),ne=new Set,Z=new Set;for(const ue of oe){Z.add(ue.id);const de=m.current.get(ue.id);if(de)for(const $e of de)ne.add($e)}if(S.current!==Z.size){S.current=Z.size;const ue=Dr(H,Z,!0);K(ue)}if(p.current!==ne.size){p.current=ne.size;const ue=Dr(R,ne);U(ue)}v.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},T=_=>{var R,O;if(_.button!==0||!I.current)return;(O=(R=_.target)==null?void 0:R.releasePointerCapture)==null||O.call(R,_.pointerId);const{userSelectionRect:P}=v.getState();!x&&P&&_.target===y.current&&(A==null||A(_)),S.current>0&&v.setState({nodesSelectionActive:!0}),j(),s==null||s(_),(t||i)&&(M.current=!1),I.current=!1},L=r===!0||Array.isArray(r)&&r.includes(0);return w.jsxs("div",{className:Ce(["react-flow__pane",{draggable:L,dragging:z,selection:e}]),onClick:C?void 0:Fu(A,y),onContextMenu:Fu(F,y),onWheel:Fu(b,y),onPointerEnter:C?void 0:d,onPointerDown:C?E:c,onPointerMove:C?$:c,onPointerUp:C?T:void 0,onPointerLeave:f,ref:y,style:Kl,children:[h,w.jsx(EC,{})]})}function fc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",ln.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(o({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function sy({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const l=ge(),[u,a]=D.useState(!1),d=D.useRef();return D.useEffect(()=>{d.current=X2({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{fc({id:c,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),D.useEffect(()=>{var c,f;if(t)(c=d.current)==null||c.destroy();else if(e.current)return(f=d.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var h;(h=d.current)==null||h.destroy()}},[n,r,t,o,e,i]),u}const CC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ly(){const e=ge();return D.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:d}=e.getState(),c=new Map,f=CC(s),h=i?o[0]:5,y=i?o[1]:5,v=n.direction.x*h*n.factor,S=n.direction.y*y*n.factor;for(const[,p]of a){if(!f(p))continue;let g={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+S};i&&(g=Ul(g,o));const{position:m,positionAbsolute:x}=C0({nodeId:p.id,nextPosition:g,nodeLookup:a,nodeExtent:r,nodeOrigin:d,onError:l});p.position=m,p.internals.positionAbsolute=x,c.set(p.id,p)}u(c)},[])}const Mf=D.createContext(null),NC=Mf.Provider;Mf.Consumer;const uy=()=>D.useContext(Mf),MC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PC=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:l,toHandle:u,isValid:a}=s,d=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.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:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===hi.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:d&&a}};function TC({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:l,children:u,className:a,onMouseDown:d,onTouchStart:c,...f},h){var E,$;const y=s||null,v=e==="target",S=ge(),p=uy(),{connectOnClick:g,noPanClassName:m,rfId:x}=le(MC,Ee),{connectingFrom:k,connectingTo:z,clickConnecting:C,isPossibleEndHandle:M,connectionInProcess:I,valid:j}=le(PC(p,y,e),Ee);p||($=(E=S.getState()).onError)==null||$.call(E,"010",ln.error010());const A=T=>{const{defaultEdgeOptions:L,onConnect:_,hasDefaultEdges:P}=S.getState(),R={...L,...T};if(P){const{edges:O,setEdges:H}=S.getState();H($2(R,O))}_==null||_(R),l==null||l(R)},F=T=>{if(!p)return;const L=R0(T.nativeEvent);if(i&&(L&&T.button===0||!L)){const _=S.getState();cc.onPointerDown(T.nativeEvent,{autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:y,nodeId:p,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:A,isValidConnection:n||_.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed})}L?d==null||d(T):c==null||c(T)},b=T=>{const{onClickConnectStart:L,onClickConnectEnd:_,connectionClickStartHandle:P,connectionMode:R,isValidConnection:O,lib:H,rfId:K,nodeLookup:U,connection:Y}=S.getState();if(!p||!P&&!i)return;if(!P){L==null||L(T.nativeEvent,{nodeId:p,handleId:y,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const X=j0(T.target),G=n||O,{connection:B,isValid:ee}=cc.isValid(T.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:R,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:G,flowId:K,doc:X,lib:H,nodeLookup:U});ee&&B&&A(B);const oe=structuredClone(Y);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,_==null||_(T,oe),S.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${x}-${p}-${y}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,a,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:o,clickconnecting:C,connectingfrom:k,connectingto:z,valid:j,connectionindicator:r&&(!I||M)&&(I?o:i)}]),onMouseDown:F,onTouchStart:F,onClick:g?b:void 0,ref:h,...f,children:u})}const Hn=D.memo(iy(TC));function zC({data:e,isConnectable:t,sourcePosition:n=q.Bottom}){return w.jsxs(w.Fragment,{children:[e==null?void 0:e.label,w.jsx(Hn,{type:"source",position:n,isConnectable:t})]})}function IC({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:r=q.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Hn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,w.jsx(Hn,{type:"source",position:r,isConnectable:t})]})}function jC(){return null}function RC({data:e,isConnectable:t,targetPosition:n=q.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Hn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const xl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wh={input:zC,default:IC,output:RC,group:jC};function $C(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 DC=e=>{const{width:t,height:n,x:r,y:i}=Vo(e.nodeLookup,{filter:o=>!!o.selected});return{width:Ct(t)?t:null,height:Ct(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 LC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:o,transformString:s,userSelectionActive:l}=le(DC,Ee),u=ly(),a=D.useRef(null);if(D.useEffect(()=>{var f;n||(f=a.current)==null||f.focus({preventScroll:!0})},[n]),sy({nodeRef:a}),l||!i||!o)return null;const d=e?f=>{const h=r.getState().nodes.filter(y=>y.selected);e(f,h)}:void 0,c=f=>{Object.prototype.hasOwnProperty.call(xl,f.key)&&(f.preventDefault(),u({direction:xl[f.key],factor:f.shiftKey?4:1}))};return w.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:w.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:c,style:{width:i,height:o}})})}const Xh=typeof window<"u"?window:void 0,AC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ay({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:x,panOnScrollSpeed:k,panOnScrollMode:z,zoomOnDoubleClick:C,panOnDrag:M,defaultViewport:I,translateExtent:j,minZoom:A,maxZoom:F,preventScrolling:b,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:T,disableKeyboardA11y:L,onViewportChange:_,isControlledViewport:P}){const{nodesSelectionActive:R,userSelectionActive:O}=le(AC),H=To(a,{target:Xh}),K=To(v,{target:Xh}),U=K||M,Y=K||x,X=d&&U!==!0,G=H||O||X;return yC({deleteKeyCode:u,multiSelectionKeyCode:y}),w.jsx(wC,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:k,panOnScrollMode:z,zoomOnDoubleClick:C,panOnDrag:!H&&U,defaultViewport:I,translateExtent:j,minZoom:A,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:b,noWheelClassName:$,noPanClassName:T,onViewportChange:_,isControlledViewport:P,paneClickDistance:l,children:w.jsxs(kC,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:U,isSelecting:!!G,selectionMode:c,selectionKeyPressed:H,selectionOnDrag:X,children:[e,R&&w.jsx(LC,{onSelectionContextMenu:E,noPanClassName:T,disableKeyboardA11y:L})]})})}ay.displayName="FlowRenderer";const OC=D.memo(ay),bC=e=>t=>e?k0(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 FC(e){return le(D.useCallback(bC(e),[e]),Ee)}const HC=e=>e.updateNodeInternals;function VC(){const e=le(HC),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return D.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function BC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ge(),o=D.useRef(null),s=D.useRef(null),l=D.useRef(e.sourcePosition),u=D.useRef(e.targetPosition),a=D.useRef(t),d=n&&!!e.internals.handleBounds;return D.useEffect(()=>{o.current&&!e.hidden&&(!d||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[d,e.hidden]),D.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(o.current){const c=a.current!==t,f=l.current!==e.sourcePosition,h=u.current!==e.targetPosition;(c||f||h)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function UC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:y,rfId:v,nodeTypes:S,nodeExtent:p,nodeClickDistance:g,onError:m}){const{node:x,internals:k,isParent:z}=le(B=>{const ee=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:oe}},Ee);let C=x.type||"default",M=(S==null?void 0:S[C])||Wh[C];M===void 0&&(m==null||m("003",ln.error003(C)),C="default",M=Wh.default);const I=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||u&&typeof x.selectable>"u"),A=!!(x.connectable||a&&typeof x.connectable>"u"),F=!!(x.focusable||d&&typeof x.focusable>"u"),b=ge(),E=z0(x),$=BC({node:x,nodeType:C,hasDimensions:E,resizeObserver:c}),T=sy({nodeRef:$,disabled:x.hidden||!I,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:g}),L=ly();if(x.hidden)return null;const _=un(x),P=$C(x),R=j||I||t||n||r||i,O=n?B=>n(B,{...k.userNode}):void 0,H=r?B=>r(B,{...k.userNode}):void 0,K=i?B=>i(B,{...k.userNode}):void 0,U=o?B=>o(B,{...k.userNode}):void 0,Y=s?B=>s(B,{...k.userNode}):void 0,X=B=>{const{selectNodesOnDrag:ee,nodeDragThreshold:oe}=b.getState();j&&(!ee||!I||oe>0)&&fc({id:e,store:b,nodeRef:$}),t&&t(B,{...k.userNode})},G=B=>{if(!(sc(B.nativeEvent)||y))if(w0.includes(B.key)&&j){const ee=B.key==="Escape";fc({id:e,store:b,unselect:ee,nodeRef:$})}else I&&x.selected&&Object.prototype.hasOwnProperty.call(xl,B.key)&&(B.preventDefault(),b.setState({ariaLiveMessage:`Moved selected node ${B.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.positionAbsolute.x}, y: ${~~k.positionAbsolute.y}`}),L({direction:xl[B.key],factor:B.shiftKey?4:1}))};return w.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${C}`,{[h]:I},x.className,{selected:x.selected,selectable:j,parent:z,draggable:I,dragging:T}]),ref:$,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:E?"visible":"hidden",...x.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:K,onContextMenu:U,onClick:X,onDoubleClick:Y,onKeyDown:F?G:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":y?void 0:`${ey}-${v}`,"aria-label":x.ariaLabel,children:w.jsx(NC,{value:e,children:w.jsx(M,{id:e,data:x.data,type:C,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:x.selected,selectable:j,draggable:I,deletable:x.deletable??!0,isConnectable:A,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:T,dragHandle:x.dragHandle,zIndex:k.z,parentId:x.parentId,..._})})})}const QC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function cy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=le(QC,Ee),s=FC(e.onlyRenderVisibleElements),l=VC();return w.jsx("div",{className:"react-flow__nodes",style:Kl,children:s.map(u=>w.jsx(UC,{id:u,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:o},u))})}cy.displayName="NodeRenderer";const WC=D.memo(cy);function XC(e){return le(D.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 o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&I2({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const YC=({color:e="none",strokeWidth:t=1})=>w.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),KC=({color:e="none",strokeWidth:t=1})=>w.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Yh={[gl.Arrow]:YC,[gl.ArrowClosed]:KC};function qC(e){const t=ge();return D.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Yh,e)?Yh[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ln.error009(e)),null)},[e])}const GC=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const u=qC(t);return u?w.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:w.jsx(u,{color:n,strokeWidth:s})}):null},fy=({defaultColor:e,rfId:t})=>{const n=le(o=>o.edges),r=le(o=>o.defaultEdgeOptions),i=D.useMemo(()=>b2(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?w.jsx("svg",{className:"react-flow__marker",children:w.jsx("defs",{children:i.map(o=>w.jsx(GC,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};fy.displayName="MarkerDefinitions";var ZC=D.memo(fy);function dy({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...d}){const[c,f]=D.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",a]),y=D.useRef(null);return D.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:w.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...d,children:[i&&w.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),w.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]})}dy.displayName="EdgeText";const JC=D.memo(dy);function ql({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:a=20,...d}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...d,d:e,fill:"none",className:Ce(["react-flow__edge-path",d.className])}),a&&w.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}),r&&Ct(t)&&Ct(n)?w.jsx(JC,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Kh({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===q.Left||e===q.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function hy({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top}){const[s,l]=Kh({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,a]=Kh({pos:o,x1:r,y1:i,x2:e,y2:t}),[d,c,f,h]=$0({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${s},${l} ${u},${a} ${r},${i}`,d,c,f,h]}function py(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=q.Bottom,targetPosition:l=q.Top,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:p})=>{const[g,m,x]=hy({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l}),k=e.isInternal?void 0:t;return w.jsx(ql,{id:k,path:g,labelX:m,labelY:x,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:p})})}const eN=py({isInternal:!1}),my=py({isInternal:!0});eN.displayName="SimpleBezierEdge";my.displayName="SimpleBezierEdgeInternal";function gy(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:h=q.Bottom,targetPosition:y=q.Top,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,x,k]=lc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset}),z=e.isInternal?void 0:t;return w.jsx(ql,{id:z,path:m,labelX:x,labelY:k,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:v,markerStart:S,interactionWidth:g})})}const yy=gy({isInternal:!1}),vy=gy({isInternal:!0});yy.displayName="SmoothStepEdge";vy.displayName="SmoothStepEdgeInternal";function xy(e){return D.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return w.jsx(yy,{...n,id:r,pathOptions:D.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const tN=xy({isInternal:!1}),wy=xy({isInternal:!0});tN.displayName="StepEdge";wy.displayName="StepEdgeInternal";function Sy(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:y,interactionWidth:v})=>{const[S,p,g]=A0({sourceX:n,sourceY:r,targetX:i,targetY:o}),m=e.isInternal?void 0:t;return w.jsx(ql,{id:m,path:S,labelX:p,labelY:g,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:y,interactionWidth:v})})}const nN=Sy({isInternal:!1}),Ey=Sy({isInternal:!0});nN.displayName="StraightEdge";Ey.displayName="StraightEdgeInternal";function _y(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=q.Bottom,targetPosition:l=q.Top,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,x,k]=D0({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),z=e.isInternal?void 0:t;return w.jsx(ql,{id:z,path:m,labelX:x,labelY:k,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:g})})}const rN=_y({isInternal:!1}),ky=_y({isInternal:!0});rN.displayName="BezierEdge";ky.displayName="BezierEdgeInternal";const qh={default:ky,straight:Ey,step:wy,smoothstep:vy,simplebezier:my},Gh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},iN=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,oN=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,Zh="react-flow__edgeupdater";function Jh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:l}){return w.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Ce([Zh,`${Zh}-${l}`]),cx:iN(t,r,e),cy:oN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function sN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:h}){const y=ge(),v=(x,k)=>{if(x.button!==0)return;const{autoPanOnConnect:z,domNode:C,isValidConnection:M,connectionMode:I,connectionRadius:j,lib:A,onConnectStart:F,onConnectEnd:b,cancelConnection:E,nodeLookup:$,rfId:T,panBy:L,updateConnection:_}=y.getState(),P=k.type==="target";f(!0),d==null||d(x,n,k.type);const R=(H,K)=>{f(!1),c==null||c(H,n,k.type,K)},O=H=>a==null?void 0:a(n,H);cc.onPointerDown(x.nativeEvent,{autoPanOnConnect:z,connectionMode:I,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:$,isTarget:P,edgeUpdaterType:k.type,lib:A,flowId:T,cancelConnection:E,panBy:L,isValidConnection:M,onConnect:O,onConnectStart:F,onConnectEnd:b,onReconnectEnd:R,updateConnection:_,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},S=x=>v(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=x=>v(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>h(!0),m=()=>h(!1);return w.jsxs(w.Fragment,{children:[(e===!0||e==="source")&&w.jsx(Jh,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:g,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&w.jsx(Jh,{position:u,centerX:o,centerY:s,radius:t,onMouseDown:p,onMouseEnter:g,onMouseOut:m,type:"target"})]})}function lN({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,rfId:y,edgeTypes:v,noPanClassName:S,onError:p,disableKeyboardA11y:g}){let m=le(Z=>Z.edgeLookup.get(e));const x=le(Z=>Z.defaultEdgeOptions);m=x?{...x,...m}:m;let k=m.type||"default",z=(v==null?void 0:v[k])||qh[k];z===void 0&&(p==null||p("011",ln.error011(k)),k="default",z=qh.default);const C=!!(m.focusable||t&&typeof m.focusable>"u"),M=typeof c<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),I=!!(m.selectable||r&&typeof m.selectable>"u"),j=D.useRef(null),[A,F]=D.useState(!1),[b,E]=D.useState(!1),$=ge(),{zIndex:T,sourceX:L,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H}=le(D.useCallback(Z=>{const ue=Z.nodeLookup.get(m.source),de=Z.nodeLookup.get(m.target);if(!ue||!de)return{zIndex:m.zIndex,...Gh};const $e=O2({id:e,sourceNode:ue,targetNode:de,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:p});return{zIndex:z2({selected:m.selected,zIndex:m.zIndex,sourceNode:ue,targetNode:de,elevateOnSelect:Z.elevateEdgesOnSelect}),...$e||Gh}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),Ee),K=D.useMemo(()=>m.markerStart?`url('#${uc(m.markerStart,y)}')`:void 0,[m.markerStart,y]),U=D.useMemo(()=>m.markerEnd?`url('#${uc(m.markerEnd,y)}')`:void 0,[m.markerEnd,y]);if(m.hidden||L===null||_===null||P===null||R===null)return null;const Y=Z=>{var an;const{addSelectedEdges:ue,unselectNodesAndEdges:de,multiSelectionActive:$e}=$.getState();I&&($.setState({nodesSelectionActive:!1}),m.selected&&$e?(de({nodes:[],edges:[m]}),(an=j.current)==null||an.blur()):ue([e])),i&&i(Z,m)},X=o?Z=>{o(Z,{...m})}:void 0,G=s?Z=>{s(Z,{...m})}:void 0,B=l?Z=>{l(Z,{...m})}:void 0,ee=u?Z=>{u(Z,{...m})}:void 0,oe=a?Z=>{a(Z,{...m})}:void 0,ne=Z=>{var ue;if(!g&&w0.includes(Z.key)&&I){const{unselectNodesAndEdges:de,addSelectedEdges:$e}=$.getState();Z.key==="Escape"?((ue=j.current)==null||ue.blur(),de({edges:[m]})):$e([e])}};return w.jsx("svg",{style:{zIndex:T},children:w.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${k}`,m.className,S,{selected:m.selected,animated:m.animated,inactive:!I&&!i,updating:A,selectable:I}]),onClick:Y,onDoubleClick:X,onContextMenu:G,onMouseEnter:B,onMouseMove:ee,onMouseLeave:oe,onKeyDown:C?ne:void 0,tabIndex:C?0:void 0,role:C?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":C?`${ty}-${y}`:void 0,ref:j,children:[!b&&w.jsx(z,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:I,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:L,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:K,markerEnd:U,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),M&&w.jsx(sN,{edge:m,isReconnectable:M,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,sourceX:L,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H,setUpdateHover:F,setReconnecting:E})]})})}const uN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Cy({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,onError:m}=le(uN,Ee),x=XC(t);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(ZC,{defaultColor:e,rfId:n}),x.map(k=>w.jsx(lN,{id:k,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:y,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:v},k))]})}Cy.displayName="EdgeRenderer";const aN=D.memo(Cy),cN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fN({children:e}){const t=le(cN);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function dN(e){const t=Nf(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const hN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function pN(e){const t=le(hN),n=ge();return D.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function mN(e){return e.connection.inProgress?{...e.connection,to:Bo(e.connection.to,e.transform)}:{...e.connection}}function gN(e){return mN}function yN(e){const t=gN();return le(t,Ee)}const vN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xN({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:l,inProgress:u}=le(vN,Ee);return!(o&&i&&u)?null:w.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:Ce(["react-flow__connection",E0(l)]),children:w.jsx(Ny,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Ny=({style:e,type:t=xn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:l,fromPosition:u,to:a,toNode:d,toHandle:c,toPosition:f}=yN();if(!i)return;if(n)return w.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:o.x,fromY:o.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:f,connectionStatus:E0(r),toNode:d,toHandle:c});let h="";const y={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:f};switch(t){case xn.Bezier:[h]=D0(y);break;case xn.SimpleBezier:[h]=hy(y);break;case xn.Step:[h]=lc({...y,borderRadius:0});break;case xn.SmoothStep:[h]=lc(y);break;default:[h]=A0(y)}return w.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Ny.displayName="ConnectionLine";const wN={};function ep(e=wN){D.useRef(e),ge(),D.useEffect(()=>{},[e])}function SN(){ge(),D.useRef(!1),D.useEffect(()=>{},[])}function My({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:h,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:g,selectionOnDrag:m,selectionMode:x,multiSelectionKeyCode:k,panActivationKeyCode:z,zoomActivationKeyCode:C,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:j,defaultViewport:A,translateExtent:F,minZoom:b,maxZoom:E,preventScrolling:$,defaultMarkerColor:T,zoomOnScroll:L,zoomOnPinch:_,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:O,zoomOnDoubleClick:H,panOnDrag:K,onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneScroll:B,onPaneContextMenu:ee,paneClickDistance:oe,nodeClickDistance:ne,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:$e,reconnectRadius:an,onReconnect:Gl,onReconnectStart:Zl,onReconnectEnd:Jl,noDragClassName:Ei,noWheelClassName:eu,noPanClassName:_i,disableKeyboardA11y:ki,nodeExtent:tu,rfId:Ci,viewport:Ni,onViewportChange:Uo}){return ep(e),ep(t),SN(),dN(n),pN(Ni),w.jsx(OC,{onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneContextMenu:ee,onPaneScroll:B,paneClickDistance:oe,deleteKeyCode:M,selectionKeyCode:g,selectionOnDrag:m,selectionMode:x,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:k,panActivationKeyCode:z,zoomActivationKeyCode:C,elementsSelectable:j,zoomOnScroll:L,zoomOnPinch:_,zoomOnDoubleClick:H,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:O,panOnDrag:K,defaultViewport:A,translateExtent:F,minZoom:b,maxZoom:E,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:Ei,noWheelClassName:eu,noPanClassName:_i,disableKeyboardA11y:ki,onViewportChange:Uo,isControlledViewport:!!Ni,children:w.jsxs(fN,{children:[w.jsx(aN,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:Gl,onReconnectStart:Zl,onReconnectEnd:Jl,onlyRenderVisibleElements:I,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:$e,reconnectRadius:an,defaultMarkerColor:T,noPanClassName:_i,disableKeyboardA11y:ki,rfId:Ci}),w.jsx(xN,{style:v,type:y,component:S,containerStyle:p}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(WC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,nodeClickDistance:ne,onlyRenderVisibleElements:I,noPanClassName:_i,noDragClassName:Ei,disableKeyboardA11y:ki,nodeExtent:tu,rfId:Ci}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}My.displayName="GraphView";const EN=D.memo(My),tp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}={})=>{const a=new Map,d=new Map,c=new Map,f=new Map,h=r??t??[],y=n??e??[],v=l??[0,0],S=u??Co;b0(c,f,h),ac(y,a,d,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:!1});let p=[0,0,1];if(s&&i&&o){const g=Vo(a,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:m,y:x,zoom:k}=wf(g,i,o,.5,2,.1);p=[m,x,k]}return{rfId:"1",width:0,height:0,transform:p,nodes:y,nodeLookup:a,parentLookup:d,edges:h,edgeLookup:f,connectionLookup:c,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Co,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hi.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:{...S0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:P2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},_N=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u})=>Fk((a,d)=>({...tp({nodes:e,edges:t,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:c=>{const{nodeLookup:f,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:v}=d();ac(c,f,h,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:v,checkEquality:!0}),a({nodes:c})},setEdges:c=>{const{connectionLookup:f,edgeLookup:h}=d();b0(f,h,c),a({edges:c})},setDefaultNodesAndEdges:(c,f)=>{if(c){const{setNodes:h}=d();h(c),a({hasDefaultNodes:!0})}if(f){const{setEdges:h}=d();h(f),a({hasDefaultEdges:!0})}},updateNodeInternals:(c,f={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:y,parentLookup:v,fitViewOnInit:S,fitViewDone:p,fitViewOnInitOptions:g,domNode:m,nodeOrigin:x,nodeExtent:k,debug:z,fitViewSync:C}=d(),{changes:M,updatedInternals:I}=U2(c,y,v,m,x,k);if(I){if(H2(y,v,{nodeOrigin:x,nodeExtent:k}),f.triggerFitView){let j=p;!p&&S&&(j=C({...g,nodes:g==null?void 0:g.nodes})),a({fitViewDone:j})}else a({});(M==null?void 0:M.length)>0&&(z&&console.log("React Flow: trigger node changes",M),h==null||h(M))}},updateNodePositions:(c,f=!1)=>{const h=[],y=[];for(const[v,S]of c){const p=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(S!=null&&S.position)),g={id:v,type:"position",position:p?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:f};p&&h.push({id:v,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),y.push(g)}if(h.length>0){const{nodeLookup:v,parentLookup:S,nodeOrigin:p}=d(),g=kf(h,v,S,p);y.push(...g)}d().triggerNodeChanges(y)},triggerNodeChanges:c=>{const{onNodesChange:f,setNodes:h,nodes:y,hasDefaultNodes:v,debug:S}=d();if(c!=null&&c.length){if(v){const p=lC(c,y);h(p)}S&&console.log("React Flow: trigger node changes",c),f==null||f(c)}},triggerEdgeChanges:c=>{const{onEdgesChange:f,setEdges:h,edges:y,hasDefaultEdges:v,debug:S}=d();if(c!=null&&c.length){if(v){const p=uC(c,y);h(p)}S&&console.log("React Flow: trigger edge changes",c),f==null||f(c)}},addSelectedNodes:c=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=d();if(f){const p=c.map(g=>Yn(g,!0));v(p);return}v(Dr(y,new Set([...c]),!0)),S(Dr(h))},addSelectedEdges:c=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=d();if(f){const p=c.map(g=>Yn(g,!0));S(p);return}S(Dr(h,new Set([...c]))),v(Dr(y,new Set,!0))},unselectNodesAndEdges:({nodes:c,edges:f}={})=>{const{edges:h,nodes:y,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:p}=d(),g=c||y,m=f||h,x=g.map(z=>{const C=v.get(z.id);return C&&(C.selected=!1),Yn(z.id,!1)}),k=m.map(z=>Yn(z.id,!1));S(x),p(k)},setMinZoom:c=>{const{panZoom:f,maxZoom:h}=d();f==null||f.setScaleExtent([c,h]),a({minZoom:c})},setMaxZoom:c=>{const{panZoom:f,minZoom:h}=d();f==null||f.setScaleExtent([h,c]),a({maxZoom:c})},setTranslateExtent:c=>{var f;(f=d().panZoom)==null||f.setTranslateExtent(c),a({translateExtent:c})},setPaneClickDistance:c=>{var f;(f=d().panZoom)==null||f.setClickDistance(c)},resetSelectedElements:()=>{const{edges:c,nodes:f,triggerNodeChanges:h,triggerEdgeChanges:y}=d(),v=f.reduce((p,g)=>g.selected?[...p,Yn(g.id,!1)]:p,[]),S=c.reduce((p,g)=>g.selected?[...p,Yn(g.id,!1)]:p,[]);h(v),y(S)},setNodeExtent:c=>{const{nodes:f,nodeLookup:h,parentLookup:y,nodeOrigin:v,elevateNodesOnSelect:S,nodeExtent:p}=d();c[0][0]===p[0][0]&&c[0][1]===p[0][1]&&c[1][0]===p[1][0]&&c[1][1]===p[1][1]||(ac(f,h,y,{nodeOrigin:v,nodeExtent:c,elevateNodesOnSelect:S,checkEquality:!1}),a({nodeExtent:c}))},panBy:c=>{const{transform:f,width:h,height:y,panZoom:v,translateExtent:S}=d();return Q2({delta:c,panZoom:v,transform:f,translateExtent:S,width:h,height:y})},fitView:c=>{const{panZoom:f,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:p}=d();if(!f)return Promise.resolve(!1);const g=rc(p,c);return ic({nodes:g,width:h,height:y,panZoom:f,minZoom:v,maxZoom:S},c)},fitViewSync:c=>{const{panZoom:f,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:p}=d();if(!f)return!1;const g=rc(p,c);return ic({nodes:g,width:h,height:y,panZoom:f,minZoom:v,maxZoom:S},c),g.size>0},cancelConnection:()=>{a({connection:{...S0}})},updateConnection:c=>{a({connection:c})},reset:()=>a({...tp()})}),Object.is);function kN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:s,nodeOrigin:l,nodeExtent:u,children:a}){const[d]=D.useState(()=>_N({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}));return w.jsx(Hk,{value:d,children:w.jsx(dC,{children:a})})}function CN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:l,nodeOrigin:u,nodeExtent:a}){return D.useContext(Yl)?w.jsx(w.Fragment,{children:e}):w.jsx(kN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:l,nodeOrigin:u,nodeExtent:a,children:e})}const NN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function MN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:z,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:j,onEdgesDelete:A,onDelete:F,onSelectionChange:b,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:T,onSelectionContextMenu:L,onSelectionStart:_,onSelectionEnd:P,onBeforeDelete:R,connectionMode:O,connectionLineType:H=xn.Bezier,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:Y,deleteKeyCode:X="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:B=!1,selectionMode:ee=No.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ne=vl()?"Meta":"Control",zoomActivationKeyCode:Z=vl()?"Meta":"Control",snapToGrid:ue,snapGrid:de,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:an,nodesDraggable:Gl,nodesConnectable:Zl,nodesFocusable:Jl,nodeOrigin:Ei=ny,edgesFocusable:eu,edgesReconnectable:_i,elementsSelectable:ki=!0,defaultViewport:tu=eC,minZoom:Ci=.5,maxZoom:Ni=2,translateExtent:Uo=Co,preventScrolling:Ry=!0,nodeExtent:nu,defaultMarkerColor:$y="#b1b1b7",zoomOnScroll:Dy=!0,zoomOnPinch:Ly=!0,panOnScroll:Ay=!1,panOnScrollSpeed:Oy=.5,panOnScrollMode:by=ar.Free,zoomOnDoubleClick:Fy=!0,panOnDrag:Hy=!0,onPaneClick:Vy,onPaneMouseEnter:By,onPaneMouseMove:Uy,onPaneMouseLeave:Qy,onPaneScroll:Wy,onPaneContextMenu:Xy,paneClickDistance:Pf=0,nodeClickDistance:Yy=0,children:Ky,onReconnect:qy,onReconnectStart:Gy,onReconnectEnd:Zy,onEdgeContextMenu:Jy,onEdgeDoubleClick:ev,onEdgeMouseEnter:tv,onEdgeMouseMove:nv,onEdgeMouseLeave:rv,reconnectRadius:iv=10,onNodesChange:ov,onEdgesChange:sv,noDragClassName:lv="nodrag",noWheelClassName:uv="nowheel",noPanClassName:Tf="nopan",fitView:zf,fitViewOptions:av,connectOnClick:cv,attributionPosition:fv,proOptions:dv,defaultEdgeOptions:hv,elevateNodesOnSelect:pv,elevateEdgesOnSelect:mv,disableKeyboardA11y:If=!1,autoPanOnConnect:gv,autoPanOnNodeDrag:yv,autoPanSpeed:vv,connectionRadius:xv,isValidConnection:wv,onError:Sv,style:Ev,id:jf,nodeDragThreshold:_v,viewport:kv,onViewportChange:Cv,width:Nv,height:Mv,colorMode:Pv="light",debug:Tv,...zv},Iv){const ru=jf||"1",jv=iC(Pv);return w.jsx("div",{"data-testid":"rf__wrapper",...zv,style:{...Ev,...NN},ref:Iv,className:Ce(["react-flow",i,jv]),id:jf,children:w.jsxs(CN,{nodes:e,edges:t,width:Nv,height:Mv,fitView:zf,nodeOrigin:Ei,nodeExtent:nu,children:[w.jsx(EN,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:z,nodeTypes:o,edgeTypes:s,connectionLineType:H,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:Y,selectionKeyCode:G,selectionOnDrag:B,selectionMode:ee,deleteKeyCode:X,multiSelectionKeyCode:ne,panActivationKeyCode:oe,zoomActivationKeyCode:Z,onlyRenderVisibleElements:$e,defaultViewport:tu,translateExtent:Uo,minZoom:Ci,maxZoom:Ni,preventScrolling:Ry,zoomOnScroll:Dy,zoomOnPinch:Ly,zoomOnDoubleClick:Fy,panOnScroll:Ay,panOnScrollSpeed:Oy,panOnScrollMode:by,panOnDrag:Hy,onPaneClick:Vy,onPaneMouseEnter:By,onPaneMouseMove:Uy,onPaneMouseLeave:Qy,onPaneScroll:Wy,onPaneContextMenu:Xy,paneClickDistance:Pf,nodeClickDistance:Yy,onSelectionContextMenu:L,onSelectionStart:_,onSelectionEnd:P,onReconnect:qy,onReconnectStart:Gy,onReconnectEnd:Zy,onEdgeContextMenu:Jy,onEdgeDoubleClick:ev,onEdgeMouseEnter:tv,onEdgeMouseMove:nv,onEdgeMouseLeave:rv,reconnectRadius:iv,defaultMarkerColor:$y,noDragClassName:lv,noWheelClassName:uv,noPanClassName:Tf,rfId:ru,disableKeyboardA11y:If,nodeExtent:nu,viewport:kv,onViewportChange:Cv}),w.jsx(rC,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:Gl,nodesConnectable:Zl,nodesFocusable:Jl,edgesFocusable:eu,edgesReconnectable:_i,elementsSelectable:ki,elevateNodesOnSelect:pv,elevateEdgesOnSelect:mv,minZoom:Ci,maxZoom:Ni,nodeExtent:nu,onNodesChange:ov,onEdgesChange:sv,snapToGrid:ue,snapGrid:de,connectionMode:O,translateExtent:Uo,connectOnClick:cv,defaultEdgeOptions:hv,fitView:zf,fitViewOptions:av,onNodesDelete:j,onEdgesDelete:A,onDelete:F,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:T,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:Tf,nodeOrigin:Ei,rfId:ru,autoPanOnConnect:gv,autoPanOnNodeDrag:yv,autoPanSpeed:vv,onError:Sv,connectionRadius:xv,isValidConnection:wv,selectNodesOnDrag:an,nodeDragThreshold:_v,onBeforeDelete:R,paneClickDistance:Pf,debug:Tv}),w.jsx(Jk,{onSelectionChange:b}),Ky,w.jsx(Yk,{proOptions:dv,position:fv}),w.jsx(Wk,{rfId:ru,disableKeyboardA11y:If})]})})}var PN=iy(MN);function TN({dimensions:e,lineWidth:t,variant:n,className:r}){return w.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 zN({radius:e,className:t}){return w.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var Gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Gt||(Gt={}));const IN={[Gt.Dots]:1,[Gt.Lines]:1,[Gt.Cross]:6},jN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Py({id:e,variant:t=Gt.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:l,style:u,className:a,patternClassName:d}){const c=D.useRef(null),{transform:f,patternId:h}=le(jN,Ee),y=r||IN[t],v=t===Gt.Dots,S=t===Gt.Cross,p=Array.isArray(n)?n:[n,n],g=[p[0]*f[2]||1,p[1]*f[2]||1],m=y*f[2],x=Array.isArray(o)?o:[o,o],k=S?[m,m]:g,z=[x[0]*f[2]||1+k[0]/2,x[1]*f[2]||1+k[1]/2],C=`${h}${e||""}`;return w.jsxs("svg",{className:Ce(["react-flow__background",a]),style:{...u,...Kl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[w.jsx("pattern",{id:C,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:v?w.jsx(zN,{radius:m/2,className:d}):w.jsx(TN,{dimensions:k,lineWidth:i,variant:t,className:d})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}Py.displayName="Background";const RN=D.memo(Py);function $N(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function DN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function LN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 AN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 ON(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 xs({children:e,className:t,...n}){return w.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const bN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Ty({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:l,onInteractiveChange:u,className:a,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":h="React Flow controls"}){const y=ge(),{isInteractive:v,minZoomReached:S,maxZoomReached:p}=le(bN,Ee),{zoomIn:g,zoomOut:m,fitView:x}=Nf(),k=()=>{g(),o==null||o()},z=()=>{m(),s==null||s()},C=()=>{x(i),l==null||l()},M=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},I=f==="horizontal"?"horizontal":"vertical";return w.jsxs(Cf,{className:Ce(["react-flow__controls",I,a]),position:c,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&w.jsxs(w.Fragment,{children:[w.jsx(xs,{onClick:k,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p,children:w.jsx($N,{})}),w.jsx(xs,{onClick:z,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:w.jsx(DN,{})})]}),n&&w.jsx(xs,{className:"react-flow__controls-fitview",onClick:C,title:"fit view","aria-label":"fit view",children:w.jsx(LN,{})}),r&&w.jsx(xs,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?w.jsx(ON,{}):w.jsx(AN,{})}),d]})}Ty.displayName="Controls";const FN=D.memo(Ty);function HN({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:l,strokeWidth:u,className:a,borderRadius:d,shapeRendering:c,selected:f,onClick:h}){const{background:y,backgroundColor:v}=o||{},S=s||y||v;return w.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},a]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:c,onClick:h?p=>h(p,e):void 0})}const VN=D.memo(HN),BN=e=>e.nodes.map(t=>t.id),Hu=e=>e instanceof Function?e:()=>e;function UN({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=VN,onClick:s}){const l=le(BN,Ee),u=Hu(t),a=Hu(e),d=Hu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:l.map(f=>w.jsx(WN,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:c},f))})}function QN({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:l,onClick:u}){const{node:a,x:d,y:c,width:f,height:h}=le(y=>{const v=y.nodeLookup.get(e),{x:S,y:p}=v.internals.positionAbsolute,{width:g,height:m}=un(v);return{node:v,x:S,y:p,width:g,height:m}},Ee);return!a||a.hidden||!z0(a)?null:w.jsx(l,{x:d,y:c,width:f,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:o,shapeRendering:s,onClick:u,id:a.id})}const WN=D.memo(QN);var XN=D.memo(UN);const YN=200,KN=150,qN=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?P0(Vo(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},GN="react-flow__minimap-desc";function zy({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:h,onNodeClick:y,pannable:v=!1,zoomable:S=!1,ariaLabel:p="React Flow mini map",inversePan:g,zoomStep:m=10,offsetScale:x=5}){const k=ge(),z=D.useRef(null),{boundingRect:C,viewBB:M,rfId:I,panZoom:j,translateExtent:A,flowWidth:F,flowHeight:b}=le(qN,Ee),E=(e==null?void 0:e.width)??YN,$=(e==null?void 0:e.height)??KN,T=C.width/E,L=C.height/$,_=Math.max(T,L),P=_*E,R=_*$,O=x*_,H=C.x-(P-C.width)/2-O,K=C.y-(R-C.height)/2-O,U=P+O*2,Y=R+O*2,X=`${GN}-${I}`,G=D.useRef(0),B=D.useRef();G.current=_,D.useEffect(()=>{if(z.current&&j)return B.current=J2({domNode:z.current,panZoom:j,getTransform:()=>k.getState().transform,getViewScale:()=>G.current}),()=>{var ne;(ne=B.current)==null||ne.destroy()}},[j]),D.useEffect(()=>{var ne;(ne=B.current)==null||ne.update({translateExtent:A,width:F,height:b,inversePan:g,pannable:v,zoomStep:m,zoomable:S})},[v,S,g,m,A,F,b]);const ee=h?ne=>{var de;const[Z,ue]=((de=B.current)==null?void 0:de.pointer(ne))||[0,0];h(ne,{x:Z,y:ue})}:void 0,oe=y?D.useCallback((ne,Z)=>{const ue=k.getState().nodeLookup.get(Z);y(ne,ue)},[]):void 0;return w.jsx(Cf,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*_: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 s=="string"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:E,height:$,viewBox:`${H} ${K} ${U} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:z,onClick:ee,children:[p&&w.jsx("title",{id:X,children:p}),w.jsx(XN,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-O},${K-O}h${U+O*2}v${Y+O*2}h${-U-O*2}z
62
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zy.displayName="MiniMap";D.memo(zy);function ZN({nodeId:e,position:t,variant:n=eo.Handle,className:r,style:i={},children:o,color:s,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,shouldResize:f,onResizeStart:h,onResize:y,onResizeEnd:v}){const S=uy(),p=typeof e=="string"?e:S,g=ge(),m=D.useRef(null),x=n===eo.Line?"right":"bottom-right",k=t??x,z=D.useRef(null);D.useEffect(()=>{if(!(!m.current||!p))return z.current||(z.current=pk({domNode:m.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:b,nodeOrigin:E,domNode:$}=g.getState();return{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:b,nodeOrigin:E,paneDomNode:$}},onChange:(j,A)=>{const{triggerNodeChanges:F,nodeLookup:b,parentLookup:E,nodeOrigin:$}=g.getState(),T=[],L={x:j.x,y:j.y},_=b.get(p);if(_&&_.expandParent&&_.parentId){const P=_.origin??$,R=j.width??_.measured.width,O=j.height??_.measured.height,H={id:_.id,parentId:_.parentId,rect:{width:R,height:O,...I0({x:j.x??_.position.x,y:j.y??_.position.y},{width:R,height:O},_.parentId,b,P)}},K=kf([H],b,E,$);T.push(...K),L.x=j.x?Math.max(P[0]*R,j.x):void 0,L.y=j.y?Math.max(P[1]*O,j.y):void 0}if(L.x!==void 0&&L.y!==void 0){const P={id:p,type:"position",position:{...L}};T.push(P)}if(j.width!==void 0&&j.height!==void 0){const P={id:p,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:j.width,height:j.height}};T.push(P)}for(const P of A){const R={...P,type:"position"};T.push(R)}F(T)},onEnd:()=>{const j={id:p,type:"dimensions",resizing:!1};g.getState().triggerNodeChanges([j])}})),z.current.update({controlPosition:k,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:d},keepAspectRatio:c,onResizeStart:h,onResize:y,onResizeEnd:v,shouldResize:f}),()=>{var j;(j=z.current)==null||j.destroy()}},[k,l,u,a,d,c,h,y,v,f]);const C=k.split("-"),M=n===eo.Line?"borderColor":"backgroundColor",I=s?{...i,[M]:s}:i;return w.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...C,n,r]),ref:m,style:I,children:o})}D.memo(ZN);function JN({data:e}){const t=e.status==="failed",n=df(e.kind);return w.jsxs("div",{title:Bg[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":"border-[var(--line)] hover:border-zinc-600"}`,children:[w.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${t?"bg-red-400":"bg-emerald-400"}`}),w.jsx(Hn,{type:"target",position:q.Left,className:"!border-0 !bg-zinc-600"}),w.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${t?"bg-red-500/15 text-red-300":"bg-emerald-500/15 text-emerald-300"}`,children:w.jsx(n,{width:12,height:12})}),w.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),w.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${t?"bg-red-500/20 text-red-300":"bg-emerald-500/20 text-emerald-300"}`,children:t?w.jsx(Ll,{width:9,height:9}):w.jsx(Hg,{width:9,height:9})})]}),w.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[w.jsx("span",{className:"rounded border border-[var(--line)] px-1 text-zinc-400",children:e.kind}),e.attempts>1&&w.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[w.jsx(Vg,{width:9,height:9}),e.attempts]}),e.workerGroup&&w.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),w.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&w.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]})]}),w.jsx(Hn,{type:"source",position:q.Right,className:"!border-0 !bg-zinc-600"})]})}function e3({data:e}){const t=e.status==="running"||e.status==="suspended";return w.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:[w.jsx(Hn,{type:"target",position:q.Left,className:"!border-0 !bg-zinc-600"}),w.jsx("span",{className:`dot ${t?"pulse":""}`}),w.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),w.jsx(Hn,{type:"source",position:q.Right,className:"!border-0 !bg-zinc-600"})]})}const t3={step:JN,terminal:e3};function n3({run:e,timeline:t,selected:n,onSelect:r,fmtDuration:i}){const{nodes:o,edges:s}=D.useMemo(()=>{const d={id:"start",type:"terminal",position:{x:0,y:0},data:{status:"running",label:e.workflow},draggable:!1},c=t.map((S,p)=>({id:`s${S.seq}`,type:"step",position:{x:(p+1)*248,y:0},draggable:!1,data:{seq:S.seq,name:S.name,kind:S.kind,status:S.status,workerGroup:S.workerGroup,attempts:S.attempts,duration:i(S.startedAt,S.finishedAt),selected:n===S.seq}})),f={id:"end",type:"terminal",position:{x:(t.length+1)*248,y:0},draggable:!1,data:{status:e.status,label:e.status}},h=[d,...c,f],y=e.status==="running"||e.status==="suspended",v=[];for(let S=1;S<h.length;S+=1){const p=h[S-1],g=h[S];if(!p||!g)continue;const m=g.type==="step"&&g.data.status==="failed",x=y&&S===h.length-1;v.push({id:`e${S}`,source:p.id,target:g.id,animated:x,style:{stroke:m?"#f87171":x?"var(--accent)":"var(--line)",strokeWidth:x?2:1.5}})}return{nodes:h,edges:v}},[e,t,i,n]),l=D.useCallback((u,a)=>{a.type==="step"&&r(a.data.seq)},[r]);return w.jsxs(PN,{nodes:o,edges:s,nodeTypes:t3,onNodeClick:l,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[w.jsx(RN,{variant:Gt.Dots,gap:22,size:1,color:"#1c1c22"}),w.jsx(FN,{showInteractive:!1,position:"bottom-right"})]})}const r3=["running","suspended","completed","failed","cancelled"];function i3(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 o3(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 Iy({status:e}){const t=e==="running";return w.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function jy({status:e}){return w.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[w.jsx(Iy,{status:e}),e]})}function s3({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((o,s)=>o+s,0),i=(o,s,l)=>w.jsxs("button",{type:"button",onClick:()=>n(o),className:`group flex items-center gap-2 rounded-md border px-2.5 py-1 text-xs transition-colors ${t===o?"border-zinc-600 bg-zinc-900 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[o!=="all"&&w.jsx(Iy,{status:o}),w.jsx("span",{className:"uppercase tracking-wide",children:s}),w.jsx("span",{className:"mono tnum text-zinc-600",children:l})]},o);return w.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-[var(--line)] px-5 py-3",children:[w.jsxs("div",{className:"flex items-center gap-2.5",children:[w.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-emerald-500/30 bg-emerald-500/10",children:w.jsx("span",{className:"text-emerald-400","aria-hidden":!0,children:"◆"})}),w.jsxs("div",{className:"leading-none",children:[w.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),w.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-600",children:"control plane"})]})]}),w.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[i("all","all",r),r3.map(o=>i(o,o,e[o]??0))]}),w.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs text-zinc-500",children:[w.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function l3({runs:e,selected:t,onSelect:n}){return e.length===0?w.jsx("div",{className:"p-6 text-sm text-zinc-600",children:"No runs yet."}):w.jsx("ul",{className:"divide-y divide-[var(--line-soft)]",children:e.map(r=>w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>n(r.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${t===r.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:r.workflow}),w.jsx(jy,{status:r.status})]}),w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:r.id}),w.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:i3(r.updatedAt)})]})]})},r.id))})}function u3({id:e}){const t=wc(),{data:n}=Ap({queryKey:["run",e],queryFn:()=>Rs.run(e),refetchInterval:v=>{var p;const S=(p=v.state.data)==null?void 0:p.run.status;return S==="running"||S==="suspended"?1500:!1}}),r=()=>{t.invalidateQueries({queryKey:["run",e]}),t.invalidateQueries({queryKey:["runs"]})},i=Wf({mutationFn:()=>Rs.retry(e),onSuccess:r}),o=Wf({mutationFn:()=>Rs.cancel(e),onSuccess:r}),[s,l]=D.useState(),[u,a]=D.useState(!1);if(!n)return w.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:d,timeline:c}=n,f=d.status==="failed"||d.status==="suspended",h=d.status==="running"||d.status==="suspended",y=c.find(v=>v.seq===s);return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--line)] px-7 py-5",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:d.workflow}),w.jsx(jy,{status:d.status}),w.jsxs("span",{className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] text-zinc-500",children:["v",d.workflowVersion]}),w.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[c.length," ",c.length===1?"step":"steps"]})]}),w.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:d.id})]}),w.jsxs("div",{className:"flex shrink-0 gap-2",children:[w.jsx("button",{type:"button",onClick:()=>a(!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:"{ }"}),w.jsxs("button",{type:"button",disabled:!f||i.isPending,onClick:()=>i.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:[w.jsx(V1,{width:12,height:12}),"Retry"]}),w.jsxs("button",{type:"button",disabled:!h||o.isPending,onClick:()=>o.mutate(),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:[w.jsx(Ll,{width:12,height:12}),"Cancel"]})]})]}),w.jsxs("div",{className:"relative grid min-h-0 flex-1 grid-rows-[1fr_auto]",children:[w.jsxs("div",{className:"relative min-h-0",children:[c.length===0?w.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):w.jsx(n3,{run:d,timeline:c,selected:s,onSelect:l,fmtDuration:o3}),(d.status==="failed"||d.status==="cancelled")&&d.error&&w.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:d.error.message})]}),c.length>0&&w.jsx("div",{className:"h-[clamp(120px,34%,260px)] border-t border-[var(--line)] bg-black/20",children:w.jsx(X1,{run:d,timeline:c,selected:s,onSelect:l})}),y&&w.jsx(Q1,{step:y,run:d,onClose:()=>l(void 0)}),u&&w.jsx(W1,{run:d,onClose:()=>a(!1)})]})]})}function a3(){const[e,t]=D.useState("all"),[n,r]=D.useState(),{data:i=[]}=Ap({queryKey:["runs"],queryFn:()=>Rs.runs(),refetchInterval:3e3}),o=i.reduce((l,u)=>(l[u.status]=(l[u.status]??0)+1,l),{}),s=e==="all"?i:i.filter(l=>l.status===e);return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"app-bg"}),w.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[w.jsx(s3,{counts:o,filter:e,onFilter:t}),w.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[w.jsx("aside",{className:"min-h-0 overflow-auto border-r border-[var(--line)]",children:w.jsx(l3,{runs:s,selected:n,onSelect:r})}),w.jsx("main",{className:"min-h-0",children:n?w.jsx(u3,{id:n},n):w.jsx("div",{className:"grid h-full place-items-center text-center",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-4xl text-zinc-800","aria-hidden":!0,children:"◆"}),w.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const c3=new mx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});bg(document.getElementById("root")).render(w.jsx(D.StrictMode,{children:w.jsx(wx,{client:c3,children:w.jsx(a3,{})})}));
61
+ `)),d=a.reduce((c,f)=>c.concat(...f),[]);return[a,d]}return[[],[]]},[e]);return D.useEffect(()=>{const u=(t==null?void 0:t.target)||Oh;if(e!==null){const a=f=>{if(i.current=f.ctrlKey||f.metaKey||f.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&sc(f))return!1;const y=Fh(f.code,l);o.current.add(f[y]),bh(s,o.current,!1)&&(f.preventDefault(),r(!0))},d=f=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&sc(f))return!1;const y=Fh(f.code,l);bh(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[y]),f.key==="Meta"&&o.current.clear(),i.current=!1},c=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",a),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{u==null||u.removeEventListener("keydown",a),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[e,r]),n}function bh(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Fh(e,t){return t.includes(e)?"code":"key"}const sC=()=>{const e=ge();return D.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,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:o,domNode:s}=e.getState();if(!o||!s)return Promise.resolve(!1);const l=rc(n,t),{width:u,height:a}=Ql(s);return ic({nodes:l,width:u,height:a,minZoom:r,maxZoom:i,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:i,height:o,maxZoom:s,panZoom:l}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:s,a=i/2-t*u,d=o/2-n*u;return l?(await l.setViewport({x:a,y:d,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:l}=e.getState(),u=wf(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:s,y:l}=o.getBoundingClientRect(),u={x:t.x-s,y:t.y-l};return Bo(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=z0(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function iy(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...o};for(const u of s)lC(u,l);n.push(l)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function lC(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 uC(e,t){return iy(e,t)}function aC(e,t){return iy(e,t)}function Yn(e,t){return{id:e,type:"select",selected:t}}function Dr(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(Yn(o.id,s)))}return r}function Hh({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const l=t.get(s.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Vh(e){return{id:e.id,type:"remove"}}const Bh=e=>C2(e),cC=e=>k0(e);function oy(e){return D.forwardRef(e)}const fC=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Uh(e){const[t,n]=D.useState(BigInt(0)),[r]=D.useState(()=>dC(()=>n(i=>i+BigInt(1))));return fC(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function dC(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const sy=D.createContext(null);function hC({children:e}){const t=ge(),n=D.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f}=t.getState();let h=u;for(const y of l)h=typeof y=="function"?y(h):y;d?a(h):c&&c(Hh({items:h,lookup:f}))},[]),r=Uh(n),i=D.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let h=u;for(const y of l)h=typeof y=="function"?y(h):y;d?a(h):c&&c(Hh({items:h,lookup:f}))},[]),o=Uh(i),s=D.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return w.jsx(sy.Provider,{value:s,children:e})}function pC(){const e=D.useContext(sy);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mC=e=>!!e.panZoom;function Nf(){const e=sC(),t=ge(),n=pC(),r=le(mC),i=D.useMemo(()=>{const o=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},u=c=>{var p,g;const{nodeLookup:f,nodeOrigin:h}=t.getState(),y=Bh(c)?c:f.get(c.id),v=y.parentId?j0(y.position,y.measured,y.parentId,f,h):y.position,S={...y,position:v,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((g=y.measured)==null?void 0:g.height)??y.height};return mi(S)},a=(c,f,h={replace:!1})=>{s(y=>y.map(v=>{if(v.id===c){const S=typeof f=="function"?f(v):f;return h.replace&&Bh(S)?S:{...v,...S}}return v}))},d=(c,f,h={replace:!1})=>{l(y=>y.map(v=>{if(v.id===c){const S=typeof f=="function"?f(v):f;return h.replace&&cC(S)?S:{...v,...S}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=o(c))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:l,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:h}=t.getState(),[y,v,S]=h;return{nodes:c.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:y,y:v,zoom:S}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:h,edges:y,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:g,onDelete:m,onBeforeDelete:x}=t.getState(),{nodes:k,edges:z}=await P2({nodesToRemove:c,edgesToRemove:f,nodes:h,edges:y,onBeforeDelete:x}),C=z.length>0,M=k.length>0;if(C){const I=z.map(Vh);S==null||S(z),g(I)}if(M){const I=k.map(Vh);v==null||v(k),p(I)}return(M||C)&&(m==null||m({nodes:k,edges:z})),{deletedNodes:k,deletedEdges:z}},getIntersectingNodes:(c,f=!0,h)=>{const y=Eh(c),v=y?c:u(c),S=h!==void 0;return v?(h||t.getState().nodes).filter(p=>{const g=t.getState().nodeLookup.get(p.id);if(g&&!y&&(p.id===c.id||!g.internals.positionAbsolute))return!1;const m=mi(S?p:g),x=Mo(m,v);return f&&x>0||x>=v.width*v.height}):[]},isNodeIntersecting:(c,f,h=!0)=>{const v=Eh(c)?c:u(c);if(!v)return!1;const S=Mo(v,f);return h&&S>0||S>=v.width*v.height},updateNode:a,updateNodeData:(c,f,h={replace:!1})=>{a(c,y=>{const v=typeof f=="function"?f(y):f;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},updateEdge:d,updateEdgeData:(c,f,h={replace:!1})=>{d(c,y=>{const v=typeof f=="function"?f(y):f;return h.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},h)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return N2(c,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:c,id:f,nodeId:h})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${h}-${c}-${f??null}`))==null?void 0:y.values())??[])}}},[]);return D.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const Qh=e=>e.selected,gC={actInsideInputWithModifier:!1},yC=typeof window<"u"?window:void 0;function vC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=Nf(),i=To(e,gC),o=To(t,{target:yC});D.useEffect(()=>{if(i){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Qh),edges:s.filter(Qh)}),n.setState({nodesSelectionActive:!1})}},[i]),D.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function xC(e){const t=ge();D.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=Ql(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",ln.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 Kl={position:"absolute",width:"100%",height:"100%",top:0,left:0},wC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function SC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=ar.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:h=!0,children:y,noWheelClassName:v,noPanClassName:S,onViewportChange:p,isControlledViewport:g,paneClickDistance:m}){const x=ge(),k=D.useRef(null),{userSelectionActive:z,lib:C}=le(wC,Ee),M=To(f),I=D.useRef();xC(k);const j=D.useCallback(L=>{p==null||p({x:L[0],y:L[1],zoom:L[2]}),g||x.setState({transform:L})},[p,g]);return D.useEffect(()=>{if(k.current){I.current=uk({domNode:k.current,minZoom:d,maxZoom:c,translateExtent:a,viewport:u,paneClickDistance:m,onDraggingChange:E=>x.setState({paneDragging:E}),onPanZoomStart:(E,$)=>{const{onViewportChangeStart:T,onMoveStart:A}=x.getState();A==null||A(E,$),T==null||T($)},onPanZoom:(E,$)=>{const{onViewportChange:T,onMove:A}=x.getState();A==null||A(E,$),T==null||T($)},onPanZoomEnd:(E,$)=>{const{onViewportChangeEnd:T,onMoveEnd:A}=x.getState();A==null||A(E,$),T==null||T($)}});const{x:L,y:F,zoom:b}=I.current.getViewport();return x.setState({panZoom:I.current,transform:[L,F,b],domNode:k.current.closest(".react-flow")}),()=>{var E;(E=I.current)==null||E.destroy()}}},[]),D.useEffect(()=>{var L;(L=I.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:M,preventScrolling:h,noPanClassName:S,userSelectionActive:z,noWheelClassName:v,lib:C,onTransformChange:j})},[e,t,n,r,i,o,s,l,M,h,S,z,v,C,j]),w.jsx("div",{className:"react-flow__renderer",ref:k,style:Kl,children:y})}const EC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function _C(){const{userSelectionActive:e,userSelectionRect:t}=le(EC,Ee);return e&&t?w.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 Fu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},kC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function CC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=No.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:a,onPaneMouseEnter:d,onPaneMouseMove:c,onPaneMouseLeave:f,children:h}){const y=D.useRef(null),v=ge(),S=D.useRef(0),p=D.useRef(0),g=D.useRef(),m=D.useRef(new Map),{userSelectionActive:x,elementsSelectable:k,dragging:z}=le(kC,Ee),C=k&&(e||x),M=D.useRef(!1),I=D.useRef(!1),j=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,p.current=0},L=_=>{if(M.current){M.current=!1;return}l==null||l(_),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},F=_=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){_.preventDefault();return}u==null||u(_)},b=a?_=>a(_):void 0,E=_=>{var U,Y,X,G;const{resetSelectedElements:P,domNode:R,edgeLookup:O}=v.getState();if(g.current=R==null?void 0:R.getBoundingClientRect(),!k||!e||_.button!==0||_.target!==y.current||!g.current)return;(Y=(U=_.target)==null?void 0:U.setPointerCapture)==null||Y.call(U,_.pointerId),I.current=!0,M.current=!1,m.current=new Map;for(const[B,ee]of O)m.current.set(ee.source,((X=m.current.get(ee.source))==null?void 0:X.add(B))||new Set([B])),m.current.set(ee.target,((G=m.current.get(ee.target))==null?void 0:G.add(B))||new Set([B]));const{x:H,y:K}=qt(_.nativeEvent,g.current);P(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:K,x:H,y:K}}),o==null||o(_)},$=_=>{const{userSelectionRect:P,edgeLookup:R,transform:O,nodeLookup:H,triggerNodeChanges:K,triggerEdgeChanges:U}=v.getState();if(!g.current||!P)return;M.current=!0;const{x:Y,y:X}=qt(_.nativeEvent,g.current),{startX:G,startY:B}=P,ee={startX:G,startY:B,x:Y<G?Y:G,y:X<B?X:B,width:Math.abs(Y-G),height:Math.abs(X-B)},oe=C0(H,ee,O,n===No.Partial,!0),ne=new Set,Z=new Set;for(const ue of oe){Z.add(ue.id);const de=m.current.get(ue.id);if(de)for(const $e of de)ne.add($e)}if(S.current!==Z.size){S.current=Z.size;const ue=Dr(H,Z,!0);K(ue)}if(p.current!==ne.size){p.current=ne.size;const ue=Dr(R,ne);U(ue)}v.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},T=_=>{var R,O;if(_.button!==0||!I.current)return;(O=(R=_.target)==null?void 0:R.releasePointerCapture)==null||O.call(R,_.pointerId);const{userSelectionRect:P}=v.getState();!x&&P&&_.target===y.current&&(L==null||L(_)),S.current>0&&v.setState({nodesSelectionActive:!0}),j(),s==null||s(_),(t||i)&&(M.current=!1),I.current=!1},A=r===!0||Array.isArray(r)&&r.includes(0);return w.jsxs("div",{className:Ce(["react-flow__pane",{draggable:A,dragging:z,selection:e}]),onClick:C?void 0:Fu(L,y),onContextMenu:Fu(F,y),onWheel:Fu(b,y),onPointerEnter:C?void 0:d,onPointerDown:C?E:c,onPointerMove:C?$:c,onPointerUp:C?T:void 0,onPointerLeave:f,ref:y,style:Kl,children:[h,w.jsx(_C,{})]})}function fc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",ln.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(o({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function ly({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const l=ge(),[u,a]=D.useState(!1),d=D.useRef();return D.useEffect(()=>{d.current=Y2({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{fc({id:c,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),D.useEffect(()=>{var c,f;if(t)(c=d.current)==null||c.destroy();else if(e.current)return(f=d.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var h;(h=d.current)==null||h.destroy()}},[n,r,t,o,e,i]),u}const NC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function uy(){const e=ge();return D.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:d}=e.getState(),c=new Map,f=NC(s),h=i?o[0]:5,y=i?o[1]:5,v=n.direction.x*h*n.factor,S=n.direction.y*y*n.factor;for(const[,p]of a){if(!f(p))continue;let g={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+S};i&&(g=Ul(g,o));const{position:m,positionAbsolute:x}=N0({nodeId:p.id,nextPosition:g,nodeLookup:a,nodeExtent:r,nodeOrigin:d,onError:l});p.position=m,p.internals.positionAbsolute=x,c.set(p.id,p)}u(c)},[])}const Mf=D.createContext(null),MC=Mf.Provider;Mf.Consumer;const ay=()=>D.useContext(Mf),PC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),TC=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:l,toHandle:u,isValid:a}=s,d=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.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:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===hi.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:d&&a}};function zC({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:l,children:u,className:a,onMouseDown:d,onTouchStart:c,...f},h){var E,$;const y=s||null,v=e==="target",S=ge(),p=ay(),{connectOnClick:g,noPanClassName:m,rfId:x}=le(PC,Ee),{connectingFrom:k,connectingTo:z,clickConnecting:C,isPossibleEndHandle:M,connectionInProcess:I,valid:j}=le(TC(p,y,e),Ee);p||($=(E=S.getState()).onError)==null||$.call(E,"010",ln.error010());const L=T=>{const{defaultEdgeOptions:A,onConnect:_,hasDefaultEdges:P}=S.getState(),R={...A,...T};if(P){const{edges:O,setEdges:H}=S.getState();H(D2(R,O))}_==null||_(R),l==null||l(R)},F=T=>{if(!p)return;const A=$0(T.nativeEvent);if(i&&(A&&T.button===0||!A)){const _=S.getState();cc.onPointerDown(T.nativeEvent,{autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:y,nodeId:p,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:L,isValidConnection:n||_.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed})}A?d==null||d(T):c==null||c(T)},b=T=>{const{onClickConnectStart:A,onClickConnectEnd:_,connectionClickStartHandle:P,connectionMode:R,isValidConnection:O,lib:H,rfId:K,nodeLookup:U,connection:Y}=S.getState();if(!p||!P&&!i)return;if(!P){A==null||A(T.nativeEvent,{nodeId:p,handleId:y,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const X=R0(T.target),G=n||O,{connection:B,isValid:ee}=cc.isValid(T.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:R,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:G,flowId:K,doc:X,lib:H,nodeLookup:U});ee&&B&&L(B);const oe=structuredClone(Y);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,_==null||_(T,oe),S.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${x}-${p}-${y}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,a,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:o,clickconnecting:C,connectingfrom:k,connectingto:z,valid:j,connectionindicator:r&&(!I||M)&&(I?o:i)}]),onMouseDown:F,onTouchStart:F,onClick:g?b:void 0,ref:h,...f,children:u})}const Vn=D.memo(oy(zC));function IC({data:e,isConnectable:t,sourcePosition:n=q.Bottom}){return w.jsxs(w.Fragment,{children:[e==null?void 0:e.label,w.jsx(Vn,{type:"source",position:n,isConnectable:t})]})}function jC({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:r=q.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Vn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,w.jsx(Vn,{type:"source",position:r,isConnectable:t})]})}function RC(){return null}function $C({data:e,isConnectable:t,targetPosition:n=q.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Vn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const xl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wh={input:IC,default:jC,output:$C,group:RC};function DC(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 AC=e=>{const{width:t,height:n,x:r,y:i}=Vo(e.nodeLookup,{filter:o=>!!o.selected});return{width:Ct(t)?t:null,height:Ct(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 LC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:o,transformString:s,userSelectionActive:l}=le(AC,Ee),u=uy(),a=D.useRef(null);if(D.useEffect(()=>{var f;n||(f=a.current)==null||f.focus({preventScroll:!0})},[n]),ly({nodeRef:a}),l||!i||!o)return null;const d=e?f=>{const h=r.getState().nodes.filter(y=>y.selected);e(f,h)}:void 0,c=f=>{Object.prototype.hasOwnProperty.call(xl,f.key)&&(f.preventDefault(),u({direction:xl[f.key],factor:f.shiftKey?4:1}))};return w.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:w.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:c,style:{width:i,height:o}})})}const Xh=typeof window<"u"?window:void 0,OC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function cy({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:x,panOnScrollSpeed:k,panOnScrollMode:z,zoomOnDoubleClick:C,panOnDrag:M,defaultViewport:I,translateExtent:j,minZoom:L,maxZoom:F,preventScrolling:b,onSelectionContextMenu:E,noWheelClassName:$,noPanClassName:T,disableKeyboardA11y:A,onViewportChange:_,isControlledViewport:P}){const{nodesSelectionActive:R,userSelectionActive:O}=le(OC),H=To(a,{target:Xh}),K=To(v,{target:Xh}),U=K||M,Y=K||x,X=d&&U!==!0,G=H||O||X;return vC({deleteKeyCode:u,multiSelectionKeyCode:y}),w.jsx(SC,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:g,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:k,panOnScrollMode:z,zoomOnDoubleClick:C,panOnDrag:!H&&U,defaultViewport:I,translateExtent:j,minZoom:L,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:b,noWheelClassName:$,noPanClassName:T,onViewportChange:_,isControlledViewport:P,paneClickDistance:l,children:w.jsxs(CC,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:U,isSelecting:!!G,selectionMode:c,selectionKeyPressed:H,selectionOnDrag:X,children:[e,R&&w.jsx(LC,{onSelectionContextMenu:E,noPanClassName:T,disableKeyboardA11y:A})]})})}cy.displayName="FlowRenderer";const bC=D.memo(cy),FC=e=>t=>e?C0(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 HC(e){return le(D.useCallback(FC(e),[e]),Ee)}const VC=e=>e.updateNodeInternals;function BC(){const e=le(VC),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return D.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function UC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ge(),o=D.useRef(null),s=D.useRef(null),l=D.useRef(e.sourcePosition),u=D.useRef(e.targetPosition),a=D.useRef(t),d=n&&!!e.internals.handleBounds;return D.useEffect(()=>{o.current&&!e.hidden&&(!d||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[d,e.hidden]),D.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(o.current){const c=a.current!==t,f=l.current!==e.sourcePosition,h=u.current!==e.targetPosition;(c||f||h)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function QC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:y,rfId:v,nodeTypes:S,nodeExtent:p,nodeClickDistance:g,onError:m}){const{node:x,internals:k,isParent:z}=le(B=>{const ee=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:oe}},Ee);let C=x.type||"default",M=(S==null?void 0:S[C])||Wh[C];M===void 0&&(m==null||m("003",ln.error003(C)),C="default",M=Wh.default);const I=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||u&&typeof x.selectable>"u"),L=!!(x.connectable||a&&typeof x.connectable>"u"),F=!!(x.focusable||d&&typeof x.focusable>"u"),b=ge(),E=I0(x),$=UC({node:x,nodeType:C,hasDimensions:E,resizeObserver:c}),T=ly({nodeRef:$,disabled:x.hidden||!I,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:g}),A=uy();if(x.hidden)return null;const _=un(x),P=DC(x),R=j||I||t||n||r||i,O=n?B=>n(B,{...k.userNode}):void 0,H=r?B=>r(B,{...k.userNode}):void 0,K=i?B=>i(B,{...k.userNode}):void 0,U=o?B=>o(B,{...k.userNode}):void 0,Y=s?B=>s(B,{...k.userNode}):void 0,X=B=>{const{selectNodesOnDrag:ee,nodeDragThreshold:oe}=b.getState();j&&(!ee||!I||oe>0)&&fc({id:e,store:b,nodeRef:$}),t&&t(B,{...k.userNode})},G=B=>{if(!(sc(B.nativeEvent)||y))if(S0.includes(B.key)&&j){const ee=B.key==="Escape";fc({id:e,store:b,unselect:ee,nodeRef:$})}else I&&x.selected&&Object.prototype.hasOwnProperty.call(xl,B.key)&&(B.preventDefault(),b.setState({ariaLiveMessage:`Moved selected node ${B.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.positionAbsolute.x}, y: ${~~k.positionAbsolute.y}`}),A({direction:xl[B.key],factor:B.shiftKey?4:1}))};return w.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${C}`,{[h]:I},x.className,{selected:x.selected,selectable:j,parent:z,draggable:I,dragging:T}]),ref:$,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:E?"visible":"hidden",...x.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:K,onContextMenu:U,onClick:X,onDoubleClick:Y,onKeyDown:F?G:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":y?void 0:`${ty}-${v}`,"aria-label":x.ariaLabel,children:w.jsx(MC,{value:e,children:w.jsx(M,{id:e,data:x.data,type:C,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:x.selected,selectable:j,draggable:I,deletable:x.deletable??!0,isConnectable:L,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:T,dragHandle:x.dragHandle,zIndex:k.z,parentId:x.parentId,..._})})})}const WC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function fy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=le(WC,Ee),s=HC(e.onlyRenderVisibleElements),l=BC();return w.jsx("div",{className:"react-flow__nodes",style:Kl,children:s.map(u=>w.jsx(QC,{id:u,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:o},u))})}fy.displayName="NodeRenderer";const XC=D.memo(fy);function YC(e){return le(D.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 o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&j2({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ee)}const KC=({color:e="none",strokeWidth:t=1})=>w.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),qC=({color:e="none",strokeWidth:t=1})=>w.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Yh={[gl.Arrow]:KC,[gl.ArrowClosed]:qC};function GC(e){const t=ge();return D.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Yh,e)?Yh[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ln.error009(e)),null)},[e])}const ZC=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const u=GC(t);return u?w.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:w.jsx(u,{color:n,strokeWidth:s})}):null},dy=({defaultColor:e,rfId:t})=>{const n=le(o=>o.edges),r=le(o=>o.defaultEdgeOptions),i=D.useMemo(()=>F2(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?w.jsx("svg",{className:"react-flow__marker",children:w.jsx("defs",{children:i.map(o=>w.jsx(ZC,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};dy.displayName="MarkerDefinitions";var JC=D.memo(dy);function hy({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...d}){const[c,f]=D.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",a]),y=D.useRef(null);return D.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:w.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...d,children:[i&&w.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),w.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]})}hy.displayName="EdgeText";const eN=D.memo(hy);function ql({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:a=20,...d}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...d,d:e,fill:"none",className:Ce(["react-flow__edge-path",d.className])}),a&&w.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}),r&&Ct(t)&&Ct(n)?w.jsx(eN,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Kh({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===q.Left||e===q.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function py({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:i,targetPosition:o=q.Top}){const[s,l]=Kh({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,a]=Kh({pos:o,x1:r,y1:i,x2:e,y2:t}),[d,c,f,h]=D0({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${s},${l} ${u},${a} ${r},${i}`,d,c,f,h]}function my(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=q.Bottom,targetPosition:l=q.Top,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:p})=>{const[g,m,x]=py({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l}),k=e.isInternal?void 0:t;return w.jsx(ql,{id:k,path:g,labelX:m,labelY:x,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:p})})}const tN=my({isInternal:!1}),gy=my({isInternal:!0});tN.displayName="SimpleBezierEdge";gy.displayName="SimpleBezierEdgeInternal";function yy(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:h=q.Bottom,targetPosition:y=q.Top,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,x,k]=lc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset}),z=e.isInternal?void 0:t;return w.jsx(ql,{id:z,path:m,labelX:x,labelY:k,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:v,markerStart:S,interactionWidth:g})})}const vy=yy({isInternal:!1}),xy=yy({isInternal:!0});vy.displayName="SmoothStepEdge";xy.displayName="SmoothStepEdgeInternal";function wy(e){return D.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return w.jsx(vy,{...n,id:r,pathOptions:D.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const nN=wy({isInternal:!1}),Sy=wy({isInternal:!0});nN.displayName="StepEdge";Sy.displayName="StepEdgeInternal";function Ey(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:y,interactionWidth:v})=>{const[S,p,g]=O0({sourceX:n,sourceY:r,targetX:i,targetY:o}),m=e.isInternal?void 0:t;return w.jsx(ql,{id:m,path:S,labelX:p,labelY:g,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:y,interactionWidth:v})})}const rN=Ey({isInternal:!1}),_y=Ey({isInternal:!0});rN.displayName="StraightEdge";_y.displayName="StraightEdgeInternal";function ky(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=q.Bottom,targetPosition:l=q.Top,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:g})=>{const[m,x,k]=A0({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),z=e.isInternal?void 0:t;return w.jsx(ql,{id:z,path:m,labelX:x,labelY:k,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:y,markerEnd:v,markerStart:S,interactionWidth:g})})}const iN=ky({isInternal:!1}),Cy=ky({isInternal:!0});iN.displayName="BezierEdge";Cy.displayName="BezierEdgeInternal";const qh={default:Cy,straight:_y,step:Sy,smoothstep:xy,simplebezier:gy},Gh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},oN=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,sN=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,Zh="react-flow__edgeupdater";function Jh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:l}){return w.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Ce([Zh,`${Zh}-${l}`]),cx:oN(t,r,e),cy:sN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function lN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:h}){const y=ge(),v=(x,k)=>{if(x.button!==0)return;const{autoPanOnConnect:z,domNode:C,isValidConnection:M,connectionMode:I,connectionRadius:j,lib:L,onConnectStart:F,onConnectEnd:b,cancelConnection:E,nodeLookup:$,rfId:T,panBy:A,updateConnection:_}=y.getState(),P=k.type==="target";f(!0),d==null||d(x,n,k.type);const R=(H,K)=>{f(!1),c==null||c(H,n,k.type,K)},O=H=>a==null?void 0:a(n,H);cc.onPointerDown(x.nativeEvent,{autoPanOnConnect:z,connectionMode:I,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:$,isTarget:P,edgeUpdaterType:k.type,lib:L,flowId:T,cancelConnection:E,panBy:A,isValidConnection:M,onConnect:O,onConnectStart:F,onConnectEnd:b,onReconnectEnd:R,updateConnection:_,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},S=x=>v(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=x=>v(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>h(!0),m=()=>h(!1);return w.jsxs(w.Fragment,{children:[(e===!0||e==="source")&&w.jsx(Jh,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:g,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&w.jsx(Jh,{position:u,centerX:o,centerY:s,radius:t,onMouseDown:p,onMouseEnter:g,onMouseOut:m,type:"target"})]})}function uN({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,rfId:y,edgeTypes:v,noPanClassName:S,onError:p,disableKeyboardA11y:g}){let m=le(Z=>Z.edgeLookup.get(e));const x=le(Z=>Z.defaultEdgeOptions);m=x?{...x,...m}:m;let k=m.type||"default",z=(v==null?void 0:v[k])||qh[k];z===void 0&&(p==null||p("011",ln.error011(k)),k="default",z=qh.default);const C=!!(m.focusable||t&&typeof m.focusable>"u"),M=typeof c<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),I=!!(m.selectable||r&&typeof m.selectable>"u"),j=D.useRef(null),[L,F]=D.useState(!1),[b,E]=D.useState(!1),$=ge(),{zIndex:T,sourceX:A,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H}=le(D.useCallback(Z=>{const ue=Z.nodeLookup.get(m.source),de=Z.nodeLookup.get(m.target);if(!ue||!de)return{zIndex:m.zIndex,...Gh};const $e=b2({id:e,sourceNode:ue,targetNode:de,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:p});return{zIndex:I2({selected:m.selected,zIndex:m.zIndex,sourceNode:ue,targetNode:de,elevateOnSelect:Z.elevateEdgesOnSelect}),...$e||Gh}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),Ee),K=D.useMemo(()=>m.markerStart?`url('#${uc(m.markerStart,y)}')`:void 0,[m.markerStart,y]),U=D.useMemo(()=>m.markerEnd?`url('#${uc(m.markerEnd,y)}')`:void 0,[m.markerEnd,y]);if(m.hidden||A===null||_===null||P===null||R===null)return null;const Y=Z=>{var an;const{addSelectedEdges:ue,unselectNodesAndEdges:de,multiSelectionActive:$e}=$.getState();I&&($.setState({nodesSelectionActive:!1}),m.selected&&$e?(de({nodes:[],edges:[m]}),(an=j.current)==null||an.blur()):ue([e])),i&&i(Z,m)},X=o?Z=>{o(Z,{...m})}:void 0,G=s?Z=>{s(Z,{...m})}:void 0,B=l?Z=>{l(Z,{...m})}:void 0,ee=u?Z=>{u(Z,{...m})}:void 0,oe=a?Z=>{a(Z,{...m})}:void 0,ne=Z=>{var ue;if(!g&&S0.includes(Z.key)&&I){const{unselectNodesAndEdges:de,addSelectedEdges:$e}=$.getState();Z.key==="Escape"?((ue=j.current)==null||ue.blur(),de({edges:[m]})):$e([e])}};return w.jsx("svg",{style:{zIndex:T},children:w.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${k}`,m.className,S,{selected:m.selected,animated:m.animated,inactive:!I&&!i,updating:L,selectable:I}]),onClick:Y,onDoubleClick:X,onContextMenu:G,onMouseEnter:B,onMouseMove:ee,onMouseLeave:oe,onKeyDown:C?ne:void 0,tabIndex:C?0:void 0,role:C?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":C?`${ny}-${y}`:void 0,ref:j,children:[!b&&w.jsx(z,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:I,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:A,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:K,markerEnd:U,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),M&&w.jsx(lN,{edge:m,isReconnectable:M,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,sourceX:A,sourceY:_,targetX:P,targetY:R,sourcePosition:O,targetPosition:H,setUpdateHover:F,setReconnecting:E})]})})}const aN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ny({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,onError:m}=le(aN,Ee),x=YC(t);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(JC,{defaultColor:e,rfId:n}),x.map(k=>w.jsx(uN,{id:k,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:g,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:y,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:v},k))]})}Ny.displayName="EdgeRenderer";const cN=D.memo(Ny),fN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function dN({children:e}){const t=le(fN);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function hN(e){const t=Nf(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const pN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function mN(e){const t=le(pN),n=ge();return D.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function gN(e){return e.connection.inProgress?{...e.connection,to:Bo(e.connection.to,e.transform)}:{...e.connection}}function yN(e){return gN}function vN(e){const t=yN();return le(t,Ee)}const xN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wN({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:l,inProgress:u}=le(xN,Ee);return!(o&&i&&u)?null:w.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:Ce(["react-flow__connection",_0(l)]),children:w.jsx(My,{style:t,type:n,CustomComponent:r,isValid:l})})})}const My=({style:e,type:t=wn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:l,fromPosition:u,to:a,toNode:d,toHandle:c,toPosition:f}=vN();if(!i)return;if(n)return w.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:o.x,fromY:o.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:f,connectionStatus:_0(r),toNode:d,toHandle:c});let h="";const y={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:f};switch(t){case wn.Bezier:[h]=A0(y);break;case wn.SimpleBezier:[h]=py(y);break;case wn.Step:[h]=lc({...y,borderRadius:0});break;case wn.SmoothStep:[h]=lc(y);break;default:[h]=O0(y)}return w.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};My.displayName="ConnectionLine";const SN={};function ep(e=SN){D.useRef(e),ge(),D.useEffect(()=>{},[e])}function EN(){ge(),D.useRef(!1),D.useEffect(()=>{},[])}function Py({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:h,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:g,selectionOnDrag:m,selectionMode:x,multiSelectionKeyCode:k,panActivationKeyCode:z,zoomActivationKeyCode:C,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:j,defaultViewport:L,translateExtent:F,minZoom:b,maxZoom:E,preventScrolling:$,defaultMarkerColor:T,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:O,zoomOnDoubleClick:H,panOnDrag:K,onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneScroll:B,onPaneContextMenu:ee,paneClickDistance:oe,nodeClickDistance:ne,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:$e,reconnectRadius:an,onReconnect:Gl,onReconnectStart:Zl,onReconnectEnd:Jl,noDragClassName:Ei,noWheelClassName:eu,noPanClassName:_i,disableKeyboardA11y:ki,nodeExtent:tu,rfId:Ci,viewport:Ni,onViewportChange:Uo}){return ep(e),ep(t),EN(),hN(n),mN(Ni),w.jsx(bC,{onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneContextMenu:ee,onPaneScroll:B,paneClickDistance:oe,deleteKeyCode:M,selectionKeyCode:g,selectionOnDrag:m,selectionMode:x,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:k,panActivationKeyCode:z,zoomActivationKeyCode:C,elementsSelectable:j,zoomOnScroll:A,zoomOnPinch:_,zoomOnDoubleClick:H,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:O,panOnDrag:K,defaultViewport:L,translateExtent:F,minZoom:b,maxZoom:E,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:Ei,noWheelClassName:eu,noPanClassName:_i,disableKeyboardA11y:ki,onViewportChange:Uo,isControlledViewport:!!Ni,children:w.jsxs(dN,{children:[w.jsx(cN,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:Gl,onReconnectStart:Zl,onReconnectEnd:Jl,onlyRenderVisibleElements:I,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:$e,reconnectRadius:an,defaultMarkerColor:T,noPanClassName:_i,disableKeyboardA11y:ki,rfId:Ci}),w.jsx(wN,{style:v,type:y,component:S,containerStyle:p}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(XC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,nodeClickDistance:ne,onlyRenderVisibleElements:I,noPanClassName:_i,noDragClassName:Ei,disableKeyboardA11y:ki,nodeExtent:tu,rfId:Ci}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}Py.displayName="GraphView";const _N=D.memo(Py),tp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}={})=>{const a=new Map,d=new Map,c=new Map,f=new Map,h=r??t??[],y=n??e??[],v=l??[0,0],S=u??Co;F0(c,f,h),ac(y,a,d,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:!1});let p=[0,0,1];if(s&&i&&o){const g=Vo(a,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:m,y:x,zoom:k}=wf(g,i,o,.5,2,.1);p=[m,x,k]}return{rfId:"1",width:0,height:0,transform:p,nodes:y,nodeLookup:a,parentLookup:d,edges:h,edgeLookup:f,connectionLookup:c,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Co,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hi.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:{...E0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:T2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},kN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u})=>Hk((a,d)=>({...tp({nodes:e,edges:t,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:c=>{const{nodeLookup:f,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:v}=d();ac(c,f,h,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:v,checkEquality:!0}),a({nodes:c})},setEdges:c=>{const{connectionLookup:f,edgeLookup:h}=d();F0(f,h,c),a({edges:c})},setDefaultNodesAndEdges:(c,f)=>{if(c){const{setNodes:h}=d();h(c),a({hasDefaultNodes:!0})}if(f){const{setEdges:h}=d();h(f),a({hasDefaultEdges:!0})}},updateNodeInternals:(c,f={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:y,parentLookup:v,fitViewOnInit:S,fitViewDone:p,fitViewOnInitOptions:g,domNode:m,nodeOrigin:x,nodeExtent:k,debug:z,fitViewSync:C}=d(),{changes:M,updatedInternals:I}=Q2(c,y,v,m,x,k);if(I){if(V2(y,v,{nodeOrigin:x,nodeExtent:k}),f.triggerFitView){let j=p;!p&&S&&(j=C({...g,nodes:g==null?void 0:g.nodes})),a({fitViewDone:j})}else a({});(M==null?void 0:M.length)>0&&(z&&console.log("React Flow: trigger node changes",M),h==null||h(M))}},updateNodePositions:(c,f=!1)=>{const h=[],y=[];for(const[v,S]of c){const p=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(S!=null&&S.position)),g={id:v,type:"position",position:p?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:f};p&&h.push({id:v,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),y.push(g)}if(h.length>0){const{nodeLookup:v,parentLookup:S,nodeOrigin:p}=d(),g=kf(h,v,S,p);y.push(...g)}d().triggerNodeChanges(y)},triggerNodeChanges:c=>{const{onNodesChange:f,setNodes:h,nodes:y,hasDefaultNodes:v,debug:S}=d();if(c!=null&&c.length){if(v){const p=uC(c,y);h(p)}S&&console.log("React Flow: trigger node changes",c),f==null||f(c)}},triggerEdgeChanges:c=>{const{onEdgesChange:f,setEdges:h,edges:y,hasDefaultEdges:v,debug:S}=d();if(c!=null&&c.length){if(v){const p=aC(c,y);h(p)}S&&console.log("React Flow: trigger edge changes",c),f==null||f(c)}},addSelectedNodes:c=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=d();if(f){const p=c.map(g=>Yn(g,!0));v(p);return}v(Dr(y,new Set([...c]),!0)),S(Dr(h))},addSelectedEdges:c=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=d();if(f){const p=c.map(g=>Yn(g,!0));S(p);return}S(Dr(h,new Set([...c]))),v(Dr(y,new Set,!0))},unselectNodesAndEdges:({nodes:c,edges:f}={})=>{const{edges:h,nodes:y,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:p}=d(),g=c||y,m=f||h,x=g.map(z=>{const C=v.get(z.id);return C&&(C.selected=!1),Yn(z.id,!1)}),k=m.map(z=>Yn(z.id,!1));S(x),p(k)},setMinZoom:c=>{const{panZoom:f,maxZoom:h}=d();f==null||f.setScaleExtent([c,h]),a({minZoom:c})},setMaxZoom:c=>{const{panZoom:f,minZoom:h}=d();f==null||f.setScaleExtent([h,c]),a({maxZoom:c})},setTranslateExtent:c=>{var f;(f=d().panZoom)==null||f.setTranslateExtent(c),a({translateExtent:c})},setPaneClickDistance:c=>{var f;(f=d().panZoom)==null||f.setClickDistance(c)},resetSelectedElements:()=>{const{edges:c,nodes:f,triggerNodeChanges:h,triggerEdgeChanges:y}=d(),v=f.reduce((p,g)=>g.selected?[...p,Yn(g.id,!1)]:p,[]),S=c.reduce((p,g)=>g.selected?[...p,Yn(g.id,!1)]:p,[]);h(v),y(S)},setNodeExtent:c=>{const{nodes:f,nodeLookup:h,parentLookup:y,nodeOrigin:v,elevateNodesOnSelect:S,nodeExtent:p}=d();c[0][0]===p[0][0]&&c[0][1]===p[0][1]&&c[1][0]===p[1][0]&&c[1][1]===p[1][1]||(ac(f,h,y,{nodeOrigin:v,nodeExtent:c,elevateNodesOnSelect:S,checkEquality:!1}),a({nodeExtent:c}))},panBy:c=>{const{transform:f,width:h,height:y,panZoom:v,translateExtent:S}=d();return W2({delta:c,panZoom:v,transform:f,translateExtent:S,width:h,height:y})},fitView:c=>{const{panZoom:f,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:p}=d();if(!f)return Promise.resolve(!1);const g=rc(p,c);return ic({nodes:g,width:h,height:y,panZoom:f,minZoom:v,maxZoom:S},c)},fitViewSync:c=>{const{panZoom:f,width:h,height:y,minZoom:v,maxZoom:S,nodeLookup:p}=d();if(!f)return!1;const g=rc(p,c);return ic({nodes:g,width:h,height:y,panZoom:f,minZoom:v,maxZoom:S},c),g.size>0},cancelConnection:()=>{a({connection:{...E0}})},updateConnection:c=>{a({connection:c})},reset:()=>a({...tp()})}),Object.is);function CN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:s,nodeOrigin:l,nodeExtent:u,children:a}){const[d]=D.useState(()=>kN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}));return w.jsx(Vk,{value:d,children:w.jsx(hC,{children:a})})}function NN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:l,nodeOrigin:u,nodeExtent:a}){return D.useContext(Yl)?w.jsx(w.Fragment,{children:e}):w.jsx(CN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:l,nodeOrigin:u,nodeExtent:a,children:e})}const MN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function PN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:z,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:j,onEdgesDelete:L,onDelete:F,onSelectionChange:b,onSelectionDragStart:E,onSelectionDrag:$,onSelectionDragStop:T,onSelectionContextMenu:A,onSelectionStart:_,onSelectionEnd:P,onBeforeDelete:R,connectionMode:O,connectionLineType:H=wn.Bezier,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:Y,deleteKeyCode:X="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:B=!1,selectionMode:ee=No.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ne=vl()?"Meta":"Control",zoomActivationKeyCode:Z=vl()?"Meta":"Control",snapToGrid:ue,snapGrid:de,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:an,nodesDraggable:Gl,nodesConnectable:Zl,nodesFocusable:Jl,nodeOrigin:Ei=ry,edgesFocusable:eu,edgesReconnectable:_i,elementsSelectable:ki=!0,defaultViewport:tu=tC,minZoom:Ci=.5,maxZoom:Ni=2,translateExtent:Uo=Co,preventScrolling:$y=!0,nodeExtent:nu,defaultMarkerColor:Dy="#b1b1b7",zoomOnScroll:Ay=!0,zoomOnPinch:Ly=!0,panOnScroll:Oy=!1,panOnScrollSpeed:by=.5,panOnScrollMode:Fy=ar.Free,zoomOnDoubleClick:Hy=!0,panOnDrag:Vy=!0,onPaneClick:By,onPaneMouseEnter:Uy,onPaneMouseMove:Qy,onPaneMouseLeave:Wy,onPaneScroll:Xy,onPaneContextMenu:Yy,paneClickDistance:Pf=0,nodeClickDistance:Ky=0,children:qy,onReconnect:Gy,onReconnectStart:Zy,onReconnectEnd:Jy,onEdgeContextMenu:ev,onEdgeDoubleClick:tv,onEdgeMouseEnter:nv,onEdgeMouseMove:rv,onEdgeMouseLeave:iv,reconnectRadius:ov=10,onNodesChange:sv,onEdgesChange:lv,noDragClassName:uv="nodrag",noWheelClassName:av="nowheel",noPanClassName:Tf="nopan",fitView:zf,fitViewOptions:cv,connectOnClick:fv,attributionPosition:dv,proOptions:hv,defaultEdgeOptions:pv,elevateNodesOnSelect:mv,elevateEdgesOnSelect:gv,disableKeyboardA11y:If=!1,autoPanOnConnect:yv,autoPanOnNodeDrag:vv,autoPanSpeed:xv,connectionRadius:wv,isValidConnection:Sv,onError:Ev,style:_v,id:jf,nodeDragThreshold:kv,viewport:Cv,onViewportChange:Nv,width:Mv,height:Pv,colorMode:Tv="light",debug:zv,...Iv},jv){const ru=jf||"1",Rv=oC(Tv);return w.jsx("div",{"data-testid":"rf__wrapper",...Iv,style:{..._v,...MN},ref:jv,className:Ce(["react-flow",i,Rv]),id:jf,children:w.jsxs(NN,{nodes:e,edges:t,width:Mv,height:Pv,fitView:zf,nodeOrigin:Ei,nodeExtent:nu,children:[w.jsx(_N,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:z,nodeTypes:o,edgeTypes:s,connectionLineType:H,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:Y,selectionKeyCode:G,selectionOnDrag:B,selectionMode:ee,deleteKeyCode:X,multiSelectionKeyCode:ne,panActivationKeyCode:oe,zoomActivationKeyCode:Z,onlyRenderVisibleElements:$e,defaultViewport:tu,translateExtent:Uo,minZoom:Ci,maxZoom:Ni,preventScrolling:$y,zoomOnScroll:Ay,zoomOnPinch:Ly,zoomOnDoubleClick:Hy,panOnScroll:Oy,panOnScrollSpeed:by,panOnScrollMode:Fy,panOnDrag:Vy,onPaneClick:By,onPaneMouseEnter:Uy,onPaneMouseMove:Qy,onPaneMouseLeave:Wy,onPaneScroll:Xy,onPaneContextMenu:Yy,paneClickDistance:Pf,nodeClickDistance:Ky,onSelectionContextMenu:A,onSelectionStart:_,onSelectionEnd:P,onReconnect:Gy,onReconnectStart:Zy,onReconnectEnd:Jy,onEdgeContextMenu:ev,onEdgeDoubleClick:tv,onEdgeMouseEnter:nv,onEdgeMouseMove:rv,onEdgeMouseLeave:iv,reconnectRadius:ov,defaultMarkerColor:Dy,noDragClassName:uv,noWheelClassName:av,noPanClassName:Tf,rfId:ru,disableKeyboardA11y:If,nodeExtent:nu,viewport:Cv,onViewportChange:Nv}),w.jsx(iC,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:Gl,nodesConnectable:Zl,nodesFocusable:Jl,edgesFocusable:eu,edgesReconnectable:_i,elementsSelectable:ki,elevateNodesOnSelect:mv,elevateEdgesOnSelect:gv,minZoom:Ci,maxZoom:Ni,nodeExtent:nu,onNodesChange:sv,onEdgesChange:lv,snapToGrid:ue,snapGrid:de,connectionMode:O,translateExtent:Uo,connectOnClick:fv,defaultEdgeOptions:pv,fitView:zf,fitViewOptions:cv,onNodesDelete:j,onEdgesDelete:L,onDelete:F,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:$,onSelectionDragStart:E,onSelectionDragStop:T,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:Tf,nodeOrigin:Ei,rfId:ru,autoPanOnConnect:yv,autoPanOnNodeDrag:vv,autoPanSpeed:xv,onError:Ev,connectionRadius:wv,isValidConnection:Sv,selectNodesOnDrag:an,nodeDragThreshold:kv,onBeforeDelete:R,paneClickDistance:Pf,debug:zv}),w.jsx(eC,{onSelectionChange:b}),qy,w.jsx(Kk,{proOptions:hv,position:dv}),w.jsx(Xk,{rfId:ru,disableKeyboardA11y:If})]})})}var TN=oy(PN);function zN({dimensions:e,lineWidth:t,variant:n,className:r}){return w.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 IN({radius:e,className:t}){return w.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var Gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Gt||(Gt={}));const jN={[Gt.Dots]:1,[Gt.Lines]:1,[Gt.Cross]:6},RN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ty({id:e,variant:t=Gt.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:l,style:u,className:a,patternClassName:d}){const c=D.useRef(null),{transform:f,patternId:h}=le(RN,Ee),y=r||jN[t],v=t===Gt.Dots,S=t===Gt.Cross,p=Array.isArray(n)?n:[n,n],g=[p[0]*f[2]||1,p[1]*f[2]||1],m=y*f[2],x=Array.isArray(o)?o:[o,o],k=S?[m,m]:g,z=[x[0]*f[2]||1+k[0]/2,x[1]*f[2]||1+k[1]/2],C=`${h}${e||""}`;return w.jsxs("svg",{className:Ce(["react-flow__background",a]),style:{...u,...Kl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[w.jsx("pattern",{id:C,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:v?w.jsx(IN,{radius:m/2,className:d}):w.jsx(zN,{dimensions:k,lineWidth:i,variant:t,className:d})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}Ty.displayName="Background";const $N=D.memo(Ty);function DN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function AN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function LN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 ON(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 bN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 xs({children:e,className:t,...n}){return w.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const FN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function zy({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:l,onInteractiveChange:u,className:a,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":h="React Flow controls"}){const y=ge(),{isInteractive:v,minZoomReached:S,maxZoomReached:p}=le(FN,Ee),{zoomIn:g,zoomOut:m,fitView:x}=Nf(),k=()=>{g(),o==null||o()},z=()=>{m(),s==null||s()},C=()=>{x(i),l==null||l()},M=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},I=f==="horizontal"?"horizontal":"vertical";return w.jsxs(Cf,{className:Ce(["react-flow__controls",I,a]),position:c,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&w.jsxs(w.Fragment,{children:[w.jsx(xs,{onClick:k,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p,children:w.jsx(DN,{})}),w.jsx(xs,{onClick:z,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:w.jsx(AN,{})})]}),n&&w.jsx(xs,{className:"react-flow__controls-fitview",onClick:C,title:"fit view","aria-label":"fit view",children:w.jsx(LN,{})}),r&&w.jsx(xs,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?w.jsx(bN,{}):w.jsx(ON,{})}),d]})}zy.displayName="Controls";const HN=D.memo(zy);function VN({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:l,strokeWidth:u,className:a,borderRadius:d,shapeRendering:c,selected:f,onClick:h}){const{background:y,backgroundColor:v}=o||{},S=s||y||v;return w.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},a]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:c,onClick:h?p=>h(p,e):void 0})}const BN=D.memo(VN),UN=e=>e.nodes.map(t=>t.id),Hu=e=>e instanceof Function?e:()=>e;function QN({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=BN,onClick:s}){const l=le(UN,Ee),u=Hu(t),a=Hu(e),d=Hu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:l.map(f=>w.jsx(XN,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:c},f))})}function WN({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:l,onClick:u}){const{node:a,x:d,y:c,width:f,height:h}=le(y=>{const v=y.nodeLookup.get(e),{x:S,y:p}=v.internals.positionAbsolute,{width:g,height:m}=un(v);return{node:v,x:S,y:p,width:g,height:m}},Ee);return!a||a.hidden||!I0(a)?null:w.jsx(l,{x:d,y:c,width:f,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:o,shapeRendering:s,onClick:u,id:a.id})}const XN=D.memo(WN);var YN=D.memo(QN);const KN=200,qN=150,GN=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?T0(Vo(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},ZN="react-flow__minimap-desc";function Iy({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:h,onNodeClick:y,pannable:v=!1,zoomable:S=!1,ariaLabel:p="React Flow mini map",inversePan:g,zoomStep:m=10,offsetScale:x=5}){const k=ge(),z=D.useRef(null),{boundingRect:C,viewBB:M,rfId:I,panZoom:j,translateExtent:L,flowWidth:F,flowHeight:b}=le(GN,Ee),E=(e==null?void 0:e.width)??KN,$=(e==null?void 0:e.height)??qN,T=C.width/E,A=C.height/$,_=Math.max(T,A),P=_*E,R=_*$,O=x*_,H=C.x-(P-C.width)/2-O,K=C.y-(R-C.height)/2-O,U=P+O*2,Y=R+O*2,X=`${ZN}-${I}`,G=D.useRef(0),B=D.useRef();G.current=_,D.useEffect(()=>{if(z.current&&j)return B.current=ek({domNode:z.current,panZoom:j,getTransform:()=>k.getState().transform,getViewScale:()=>G.current}),()=>{var ne;(ne=B.current)==null||ne.destroy()}},[j]),D.useEffect(()=>{var ne;(ne=B.current)==null||ne.update({translateExtent:L,width:F,height:b,inversePan:g,pannable:v,zoomStep:m,zoomable:S})},[v,S,g,m,L,F,b]);const ee=h?ne=>{var de;const[Z,ue]=((de=B.current)==null?void 0:de.pointer(ne))||[0,0];h(ne,{x:Z,y:ue})}:void 0,oe=y?D.useCallback((ne,Z)=>{const ue=k.getState().nodeLookup.get(Z);y(ne,ue)},[]):void 0;return w.jsx(Cf,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*_: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 s=="string"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:E,height:$,viewBox:`${H} ${K} ${U} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:z,onClick:ee,children:[p&&w.jsx("title",{id:X,children:p}),w.jsx(YN,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-O},${K-O}h${U+O*2}v${Y+O*2}h${-U-O*2}z
62
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Iy.displayName="MiniMap";D.memo(Iy);function JN({nodeId:e,position:t,variant:n=eo.Handle,className:r,style:i={},children:o,color:s,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,shouldResize:f,onResizeStart:h,onResize:y,onResizeEnd:v}){const S=ay(),p=typeof e=="string"?e:S,g=ge(),m=D.useRef(null),x=n===eo.Line?"right":"bottom-right",k=t??x,z=D.useRef(null);D.useEffect(()=>{if(!(!m.current||!p))return z.current||(z.current=mk({domNode:m.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:j,transform:L,snapGrid:F,snapToGrid:b,nodeOrigin:E,domNode:$}=g.getState();return{nodeLookup:j,transform:L,snapGrid:F,snapToGrid:b,nodeOrigin:E,paneDomNode:$}},onChange:(j,L)=>{const{triggerNodeChanges:F,nodeLookup:b,parentLookup:E,nodeOrigin:$}=g.getState(),T=[],A={x:j.x,y:j.y},_=b.get(p);if(_&&_.expandParent&&_.parentId){const P=_.origin??$,R=j.width??_.measured.width,O=j.height??_.measured.height,H={id:_.id,parentId:_.parentId,rect:{width:R,height:O,...j0({x:j.x??_.position.x,y:j.y??_.position.y},{width:R,height:O},_.parentId,b,P)}},K=kf([H],b,E,$);T.push(...K),A.x=j.x?Math.max(P[0]*R,j.x):void 0,A.y=j.y?Math.max(P[1]*O,j.y):void 0}if(A.x!==void 0&&A.y!==void 0){const P={id:p,type:"position",position:{...A}};T.push(P)}if(j.width!==void 0&&j.height!==void 0){const P={id:p,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:j.width,height:j.height}};T.push(P)}for(const P of L){const R={...P,type:"position"};T.push(R)}F(T)},onEnd:()=>{const j={id:p,type:"dimensions",resizing:!1};g.getState().triggerNodeChanges([j])}})),z.current.update({controlPosition:k,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:d},keepAspectRatio:c,onResizeStart:h,onResize:y,onResizeEnd:v,shouldResize:f}),()=>{var j;(j=z.current)==null||j.destroy()}},[k,l,u,a,d,c,h,y,v,f]);const C=k.split("-"),M=n===eo.Line?"borderColor":"backgroundColor",I=s?{...i,[M]:s}:i;return w.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...C,n,r]),ref:m,style:I,children:o})}D.memo(JN);function e3({data:e}){const t=e.status==="failed",n=df(e.kind);return w.jsxs("div",{title:Bg[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":"border-[var(--line)] hover:border-zinc-600"}`,children:[w.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${t?"bg-red-400":"bg-emerald-400"}`}),w.jsx(Vn,{type:"target",position:q.Left,className:"!border-0 !bg-zinc-600"}),w.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${t?"bg-red-500/15 text-red-300":"bg-emerald-500/15 text-emerald-300"}`,children:w.jsx(n,{width:12,height:12})}),w.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),w.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${t?"bg-red-500/20 text-red-300":"bg-emerald-500/20 text-emerald-300"}`,children:t?w.jsx(Al,{width:9,height:9}):w.jsx(Hg,{width:9,height:9})})]}),w.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[w.jsx("span",{className:"rounded border border-[var(--line)] px-1 text-zinc-400",children:e.kind}),e.attempts>1&&w.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[w.jsx(Vg,{width:9,height:9}),e.attempts]}),e.workerGroup&&w.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),w.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&w.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]})]}),w.jsx(Vn,{type:"source",position:q.Right,className:"!border-0 !bg-zinc-600"})]})}function t3({data:e}){const t=e.status==="running"||e.status==="suspended";return w.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:[w.jsx(Vn,{type:"target",position:q.Left,className:"!border-0 !bg-zinc-600"}),w.jsx("span",{className:`dot ${t?"pulse":""}`}),w.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),w.jsx(Vn,{type:"source",position:q.Right,className:"!border-0 !bg-zinc-600"})]})}const n3={step:e3,terminal:t3};function r3({run:e,timeline:t,selected:n,onSelect:r,fmtDuration:i}){const{nodes:o,edges:s}=D.useMemo(()=>{const d={id:"start",type:"terminal",position:{x:0,y:0},data:{status:"running",label:e.workflow},draggable:!1},c=t.map((S,p)=>({id:`s${S.seq}`,type:"step",position:{x:(p+1)*248,y:0},draggable:!1,data:{seq:S.seq,name:S.name,kind:S.kind,status:S.status,workerGroup:S.workerGroup,attempts:S.attempts,duration:i(S.startedAt,S.finishedAt),selected:n===S.seq}})),f={id:"end",type:"terminal",position:{x:(t.length+1)*248,y:0},draggable:!1,data:{status:e.status,label:e.status}},h=[d,...c,f],y=e.status==="running"||e.status==="suspended",v=[];for(let S=1;S<h.length;S+=1){const p=h[S-1],g=h[S];if(!p||!g)continue;const m=g.type==="step"&&g.data.status==="failed",x=y&&S===h.length-1;v.push({id:`e${S}`,source:p.id,target:g.id,animated:x,style:{stroke:m?"#f87171":x?"var(--accent)":"var(--line)",strokeWidth:x?2:1.5}})}return{nodes:h,edges:v}},[e,t,i,n]),l=D.useCallback((u,a)=>{a.type==="step"&&r(a.data.seq)},[r]);return w.jsxs(TN,{nodes:o,edges:s,nodeTypes:n3,onNodeClick:l,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[w.jsx($N,{variant:Gt.Dots,gap:22,size:1,color:"#1c1c22"}),w.jsx(HN,{showInteractive:!1,position:"bottom-right"})]})}const i3=["running","suspended","completed","failed","cancelled"];function o3(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 s3(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 jy({status:e}){const t=e==="running";return w.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function Ry({status:e}){return w.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[w.jsx(jy,{status:e}),e]})}function l3({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((o,s)=>o+s,0),i=(o,s,l)=>w.jsxs("button",{type:"button",onClick:()=>n(o),className:`group flex items-center gap-2 rounded-md border px-2.5 py-1 text-xs transition-colors ${t===o?"border-zinc-600 bg-zinc-900 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[o!=="all"&&w.jsx(jy,{status:o}),w.jsx("span",{className:"uppercase tracking-wide",children:s}),w.jsx("span",{className:"mono tnum text-zinc-600",children:l})]},o);return w.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-[var(--line)] px-5 py-3",children:[w.jsxs("div",{className:"flex items-center gap-2.5",children:[w.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-emerald-500/30 bg-emerald-500/10",children:w.jsx("span",{className:"text-emerald-400","aria-hidden":!0,children:"◆"})}),w.jsxs("div",{className:"leading-none",children:[w.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),w.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-600",children:"control plane"})]})]}),w.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[i("all","all",r),i3.map(o=>i(o,o,e[o]??0))]}),w.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs text-zinc-500",children:[w.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function u3({runs:e,selected:t,onSelect:n}){return e.length===0?w.jsx("div",{className:"p-6 text-sm text-zinc-600",children:"No runs yet."}):w.jsx("ul",{className:"divide-y divide-[var(--line-soft)]",children:e.map(r=>w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>n(r.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${t===r.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:r.workflow}),w.jsx(Ry,{status:r.status})]}),w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:r.id}),w.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:o3(r.updatedAt)})]})]})},r.id))})}function a3({id:e}){const t=wc(),{data:n}=Lp({queryKey:["run",e],queryFn:()=>Rs.run(e),refetchInterval:v=>{var p;const S=(p=v.state.data)==null?void 0:p.run.status;return S==="running"||S==="suspended"?1500:!1}}),r=()=>{t.invalidateQueries({queryKey:["run",e]}),t.invalidateQueries({queryKey:["runs"]})},i=Wf({mutationFn:()=>Rs.retry(e),onSuccess:r}),o=Wf({mutationFn:()=>Rs.cancel(e),onSuccess:r}),[s,l]=D.useState(),[u,a]=D.useState(!1);if(!n)return w.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:d,timeline:c}=n,f=d.status==="failed"||d.status==="suspended",h=d.status==="running"||d.status==="suspended",y=c.find(v=>v.seq===s);return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--line)] px-7 py-5",children:[w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:d.workflow}),w.jsx(Ry,{status:d.status}),w.jsxs("span",{className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] text-zinc-500",children:["v",d.workflowVersion]}),w.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[c.length," ",c.length===1?"step":"steps"]})]}),w.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:d.id})]}),w.jsxs("div",{className:"flex shrink-0 gap-2",children:[w.jsx("button",{type:"button",onClick:()=>a(!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:"{ }"}),w.jsxs("button",{type:"button",disabled:!f||i.isPending,onClick:()=>i.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:[w.jsx(B1,{width:12,height:12}),"Retry"]}),w.jsxs("button",{type:"button",disabled:!h||o.isPending,onClick:()=>o.mutate(),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:[w.jsx(Al,{width:12,height:12}),"Cancel"]})]})]}),w.jsxs("div",{className:"relative grid min-h-0 flex-1 grid-rows-[1fr_auto]",children:[w.jsxs("div",{className:"relative min-h-0",children:[c.length===0?w.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):w.jsx(r3,{run:d,timeline:c,selected:s,onSelect:l,fmtDuration:s3}),(d.status==="failed"||d.status==="cancelled")&&d.error&&w.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:d.error.message})]}),c.length>0&&w.jsx("div",{className:"h-[clamp(120px,34%,260px)] border-t border-[var(--line)] bg-black/20",children:w.jsx(Y1,{run:d,timeline:c,selected:s,onSelect:l})}),y&&w.jsx(W1,{step:y,run:d,onClose:()=>l(void 0)}),u&&w.jsx(X1,{run:d,onClose:()=>a(!1)})]})]})}function c3(){const[e,t]=D.useState("all"),[n,r]=D.useState(),{data:i=[]}=Lp({queryKey:["runs"],queryFn:()=>Rs.runs(),refetchInterval:3e3}),o=i.reduce((l,u)=>(l[u.status]=(l[u.status]??0)+1,l),{}),s=e==="all"?i:i.filter(l=>l.status===e);return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"app-bg"}),w.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[w.jsx(l3,{counts:o,filter:e,onFilter:t}),w.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[w.jsx("aside",{className:"min-h-0 overflow-auto border-r border-[var(--line)]",children:w.jsx(u3,{runs:s,selected:n,onSelect:r})}),w.jsx("main",{className:"min-h-0",children:n?w.jsx(a3,{id:n},n):w.jsx("div",{className:"grid h-full place-items-center text-center",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-4xl text-zinc-800","aria-hidden":!0,children:"◆"}),w.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const f3=new gx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});bg(document.getElementById("root")).render(w.jsx(D.StrictMode,{children:w.jsx(Sx,{client:f3,children:w.jsx(c3,{})})}));