@johnz4021/illuminate 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.mjs +5 -4
- package/package.json +1 -1
- package/viewer/assets/{elk.bundled-Ce9K9DrB.js → elk.bundled-Uq41P_C7.js} +2 -2
- package/viewer/assets/{elk.bundled-Ce9K9DrB.js.map → elk.bundled-Uq41P_C7.js.map} +1 -1
- package/viewer/assets/index-C_x6TUup.js +71 -0
- package/viewer/assets/index-C_x6TUup.js.map +1 -0
- package/viewer/assets/index-DzcavrZw.css +1 -0
- package/viewer/index.html +3 -3
- package/viewer/assets/index-LvIXfc7e.css +0 -1
- package/viewer/assets/index-hKIGtEeA.js +0 -71
- package/viewer/assets/index-hKIGtEeA.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Ij=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ch={exports:{}},Qs={},jh={exports:{}},se={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ri=Symbol.for("react.element"),Jy=Symbol.for("react.portal"),ev=Symbol.for("react.fragment"),tv=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),rv=Symbol.for("react.provider"),ov=Symbol.for("react.context"),iv=Symbol.for("react.forward_ref"),sv=Symbol.for("react.suspense"),lv=Symbol.for("react.memo"),av=Symbol.for("react.lazy"),Qc=Symbol.iterator;function uv(e){return e===null||typeof e!="object"?null:(e=Qc&&e[Qc]||e["@@iterator"],typeof e=="function"?e:null)}var Mh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$h=Object.assign,bh={};function Kr(e,t,n){this.props=e,this.context=t,this.refs=bh,this.updater=n||Mh}Kr.prototype.isReactComponent={};Kr.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")};Kr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ph(){}Ph.prototype=Kr.prototype;function ju(e,t,n){this.props=e,this.context=t,this.refs=bh,this.updater=n||Mh}var Mu=ju.prototype=new Ph;Mu.constructor=ju;$h(Mu,Kr.prototype);Mu.isPureReactComponent=!0;var qc=Array.isArray,Ih=Object.prototype.hasOwnProperty,$u={current:null},Th={key:!0,ref:!0,__self:!0,__source:!0};function zh(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Ih.call(t,r)&&!Th.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:ri,type:e,key:i,ref:s,props:o,_owner:$u.current}}function cv(e,t){return{$$typeof:ri,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function bu(e){return typeof e=="object"&&e!==null&&e.$$typeof===ri}function dv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Zc=/\/+/g;function Il(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dv(""+e.key):t.toString(36)}function Xi(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ri:case Jy:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Il(s,0):r,qc(o)?(n="",e!=null&&(n=e.replace(Zc,"$&/")+"/"),Xi(o,t,n,"",function(u){return u})):o!=null&&(bu(o)&&(o=cv(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Zc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",qc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Il(i,l);s+=Xi(i,t,n,a,o)}else if(a=uv(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Il(i,l++),s+=Xi(i,t,n,a,o);else if(i==="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 xi(e,t,n){if(e==null)return e;var r=[],o=0;return Xi(e,r,"","",function(i){return t.call(n,i,o++)}),r}function fv(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},Ki={transition:null},hv={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Ki,ReactCurrentOwner:$u};function Lh(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:xi,forEach:function(e,t,n){xi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xi(e,function(){t++}),t},toArray:function(e){return xi(e,function(t){return t})||[]},only:function(e){if(!bu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=Kr;se.Fragment=ev;se.Profiler=nv;se.PureComponent=ju;se.StrictMode=tv;se.Suspense=sv;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hv;se.act=Lh;se.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=$h({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=$u.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Ih.call(t,a)&&!Th.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:ri,type:e.type,key:o,ref:i,props:r,_owner:s}};se.createContext=function(e){return e={$$typeof:ov,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rv,_context:e},e.Consumer=e};se.createElement=zh;se.createFactory=function(e){var t=zh.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:iv,render:e}};se.isValidElement=bu;se.lazy=function(e){return{$$typeof:av,_payload:{_status:-1,_result:e},_init:fv}};se.memo=function(e,t){return{$$typeof:lv,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Ki.transition;Ki.transition={};try{e()}finally{Ki.transition=t}};se.unstable_act=Lh;se.useCallback=function(e,t){return Ue.current.useCallback(e,t)};se.useContext=function(e){return Ue.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};se.useEffect=function(e,t){return Ue.current.useEffect(e,t)};se.useId=function(){return Ue.current.useId()};se.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Ue.current.useMemo(e,t)};se.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};se.useRef=function(e){return Ue.current.useRef(e)};se.useState=function(e){return Ue.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return Ue.current.useTransition()};se.version="18.3.1";jh.exports=se;var P=jh.exports;const pv=_h(P);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var mv=P,gv=Symbol.for("react.element"),yv=Symbol.for("react.fragment"),vv=Object.prototype.hasOwnProperty,xv=mv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,wv={key:!0,ref:!0,__self:!0,__source:!0};function Ah(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)vv.call(t,r)&&!wv.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:gv,type:e,key:i,ref:s,props:o,_owner:xv.current}}Qs.Fragment=yv;Qs.jsx=Ah;Qs.jsxs=Ah;Ch.exports=Qs;var h=Ch.exports,Rh={exports:{}},at={},Dh={exports:{}},Oh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t($,M){var A=$.length;$.push(M);e:for(;0<A;){var I=A-1>>>1,H=$[I];if(0<o(H,M))$[I]=M,$[A]=H,A=I;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var M=$[0],A=$.pop();if(A!==M){$[0]=A;e:for(var I=0,H=$.length,ee=H>>>1;I<ee;){var K=2*(I+1)-1,Y=$[K],V=K+1,X=$[V];if(0>o(Y,A))V<H&&0>o(X,Y)?($[I]=X,$[V]=A,I=V):($[I]=Y,$[K]=A,I=K);else if(V<H&&0>o(X,A))$[I]=X,$[V]=A,I=V;else break e}}return M}function o($,M){var A=$.sortIndex-M.sortIndex;return A!==0?A:$.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,p=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g($){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=$)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function k($){if(x=!1,g($),!y)if(n(a)!==null)y=!0,z(C);else{var M=n(u);M!==null&&O(k,M.startTime-$)}}function C($,M){y=!1,x&&(x=!1,m(j),j=-1),p=!0;var A=f;try{for(g(M),d=n(a);d!==null&&(!(d.expirationTime>M)||$&&!L());){var I=d.callback;if(typeof I=="function"){d.callback=null,f=d.priorityLevel;var H=I(d.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),g(M)}else r(a);d=n(a)}if(d!==null)var ee=!0;else{var K=n(u);K!==null&&O(k,K.startTime-M),ee=!1}return ee}finally{d=null,f=A,p=!1}}var S=!1,_=null,j=-1,b=5,F=-1;function L(){return!(e.unstable_now()-F<b)}function U(){if(_!==null){var $=e.unstable_now();F=$;var M=!0;try{M=_(!0,$)}finally{M?B():(S=!1,_=null)}}else S=!1}var B;if(typeof v=="function")B=function(){v(U)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,T=N.port2;N.port1.onmessage=U,B=function(){T.postMessage(null)}}else B=function(){w(U,0)};function z($){_=$,S||(S=!0,B())}function O($,M){j=w(function(){$(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,z(C))},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"):b=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function($){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var A=f;f=M;try{return $()}finally{f=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,M){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var A=f;f=$;try{return M()}finally{f=A}},e.unstable_scheduleCallback=function($,M,A){var I=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?I+A:I):A=I,$){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=A+H,$={id:c++,callback:M,priorityLevel:$,startTime:A,expirationTime:H,sortIndex:-1},A>I?($.sortIndex=A,t(u,$),n(a)===null&&$===n(u)&&(x?(m(j),j=-1):x=!0,O(k,A-I))):($.sortIndex=H,t(a,$),y||p||(y=!0,z(C))),$},e.unstable_shouldYield=L,e.unstable_wrapCallback=function($){var M=f;return function(){var A=f;f=M;try{return $.apply(this,arguments)}finally{f=A}}}})(Oh);Dh.exports=Oh;var kv=Dh.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Sv=P,st=kv;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Fh=new Set,Mo={};function nr(e,t){Pr(e,t),Pr(e+"Capture",t)}function Pr(e,t){for(Mo[e]=t,e=0;e<t.length;e++)Fh.add(t[e])}var qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ga=Object.prototype.hasOwnProperty,Nv=/^[: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]*$/,Jc={},ed={};function Ev(e){return ga.call(ed,e)?!0:ga.call(Jc,e)?!1:Nv.test(e)?ed[e]=!0:(Jc[e]=!0,!1)}function _v(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 Cv(e,t,n,r){if(t===null||typeof t>"u"||_v(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 Ye(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Ye(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){Le[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pu=/[\-:]([a-z])/g;function Iu(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(Pu,Iu);Le[t]=new Ye(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(Pu,Iu);Le[t]=new Ye(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(Pu,Iu);Le[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tu(e,t,n,r){var o=Le.hasOwnProperty(t)?Le[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Cv(t,n,o,r)&&(n=null),r||o===null?Ev(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var rn=Sv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wi=Symbol.for("react.element"),cr=Symbol.for("react.portal"),dr=Symbol.for("react.fragment"),zu=Symbol.for("react.strict_mode"),ya=Symbol.for("react.profiler"),Hh=Symbol.for("react.provider"),Bh=Symbol.for("react.context"),Lu=Symbol.for("react.forward_ref"),va=Symbol.for("react.suspense"),xa=Symbol.for("react.suspense_list"),Au=Symbol.for("react.memo"),an=Symbol.for("react.lazy"),Vh=Symbol.for("react.offscreen"),td=Symbol.iterator;function Zr(e){return e===null||typeof e!="object"?null:(e=td&&e[td]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,Tl;function ao(e){if(Tl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Tl=t&&t[1]||""}return`
|
|
34
|
-
`+Tl+e}var zl=!1;function Ll(e,t){if(!e||zl)return"";zl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
-
`),i=r.stack.split(`
|
|
36
|
-
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
|
|
37
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ao(e):""}function jv(e){switch(e.tag){case 5:return ao(e.type);case 16:return ao("Lazy");case 13:return ao("Suspense");case 19:return ao("SuspenseList");case 0:case 2:case 15:return e=Ll(e.type,!1),e;case 11:return e=Ll(e.type.render,!1),e;case 1:return e=Ll(e.type,!0),e;default:return""}}function wa(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 dr:return"Fragment";case cr:return"Portal";case ya:return"Profiler";case zu:return"StrictMode";case va:return"Suspense";case xa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bh:return(e.displayName||"Context")+".Consumer";case Hh:return(e._context.displayName||"Context")+".Provider";case Lu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Au:return t=e.displayName||null,t!==null?t:wa(e.type)||"Memo";case an:t=e._payload,e=e._init;try{return wa(e(t))}catch{}}return null}function Mv(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 wa(t);case 8:return t===zu?"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 _n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $v(e){var t=Wh(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.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 ki(e){e._valueTracker||(e._valueTracker=$v(e))}function Uh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ds(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 ka(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_n(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 Yh(e,t){t=t.checked,t!=null&&Tu(e,"checked",t,!1)}function Sa(e,t){Yh(e,t);var n=_n(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")?Na(e,t.type,n):t.hasOwnProperty("defaultValue")&&Na(e,t.type,_n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rd(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 Na(e,t,n){(t!=="number"||ds(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var uo=Array.isArray;function Nr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+_n(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ea(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function od(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(uo(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:_n(n)}}function Xh(e,t){var n=_n(t.value),r=_n(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 id(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kh(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 _a(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Si,Gh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Si=Si||document.createElement("div"),Si.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Si.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $o(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var go={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},bv=["Webkit","ms","Moz","O"];Object.keys(go).forEach(function(e){bv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),go[t]=go[e]})});function Qh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||go.hasOwnProperty(e)&&go[e]?(""+t).trim():t+"px"}function qh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Qh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Pv=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 Ca(e,t){if(t){if(Pv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function ja(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 Ma=null;function Ru(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $a=null,Er=null,_r=null;function sd(e){if(e=si(e)){if(typeof $a!="function")throw Error(J(280));var t=e.stateNode;t&&(t=tl(t),$a(e.stateNode,e.type,t))}}function Zh(e){Er?_r?_r.push(e):_r=[e]:Er=e}function Jh(){if(Er){var e=Er,t=_r;if(_r=Er=null,sd(e),t)for(e=0;e<t.length;e++)sd(t[e])}}function ep(e,t){return e(t)}function tp(){}var Al=!1;function np(e,t,n){if(Al)return e(t,n);Al=!0;try{return ep(e,t,n)}finally{Al=!1,(Er!==null||_r!==null)&&(tp(),Jh())}}function bo(e,t){var n=e.stateNode;if(n===null)return null;var r=tl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var ba=!1;if(qt)try{var Jr={};Object.defineProperty(Jr,"passive",{get:function(){ba=!0}}),window.addEventListener("test",Jr,Jr),window.removeEventListener("test",Jr,Jr)}catch{ba=!1}function Iv(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var yo=!1,fs=null,hs=!1,Pa=null,Tv={onError:function(e){yo=!0,fs=e}};function zv(e,t,n,r,o,i,s,l,a){yo=!1,fs=null,Iv.apply(Tv,arguments)}function Lv(e,t,n,r,o,i,s,l,a){if(zv.apply(this,arguments),yo){if(yo){var u=fs;yo=!1,fs=null}else throw Error(J(198));hs||(hs=!0,Pa=u)}}function rr(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 rp(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 ld(e){if(rr(e)!==e)throw Error(J(188))}function Av(e){var t=e.alternate;if(!t){if(t=rr(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return ld(o),e;if(i===r)return ld(o),t;i=i.sibling}throw Error(J(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,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){for(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)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function op(e){return e=Av(e),e!==null?ip(e):null}function ip(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ip(e);if(t!==null)return t;e=e.sibling}return null}var sp=st.unstable_scheduleCallback,ad=st.unstable_cancelCallback,Rv=st.unstable_shouldYield,Dv=st.unstable_requestPaint,Ne=st.unstable_now,Ov=st.unstable_getCurrentPriorityLevel,Du=st.unstable_ImmediatePriority,lp=st.unstable_UserBlockingPriority,ps=st.unstable_NormalPriority,Fv=st.unstable_LowPriority,ap=st.unstable_IdlePriority,qs=null,Ot=null;function Hv(e){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(qs,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:Wv,Bv=Math.log,Vv=Math.LN2;function Wv(e){return e>>>=0,e===0?32:31-(Bv(e)/Vv|0)|0}var Ni=64,Ei=4194304;function co(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 ms(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=co(l):(i&=s,i!==0&&(r=co(i)))}else s=n&~o,s!==0?r=co(s):i!==0&&(r=co(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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-Mt(t),o=1<<n,r|=e[n],t&=~o;return r}function Uv(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 Yv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Mt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=Uv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function Ia(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function up(){var e=Ni;return Ni<<=1,!(Ni&4194240)&&(Ni=64),e}function Rl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function Xv(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 o=31-Mt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Ou(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ue=0;function cp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dp,Fu,fp,hp,pp,Ta=!1,_i=[],yn=null,vn=null,xn=null,Po=new Map,Io=new Map,fn=[],Kv="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 ud(e,t){switch(e){case"focusin":case"focusout":yn=null;break;case"dragenter":case"dragleave":vn=null;break;case"mouseover":case"mouseout":xn=null;break;case"pointerover":case"pointerout":Po.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(t.pointerId)}}function eo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=si(t),t!==null&&Fu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Gv(e,t,n,r,o){switch(t){case"focusin":return yn=eo(yn,e,t,n,r,o),!0;case"dragenter":return vn=eo(vn,e,t,n,r,o),!0;case"mouseover":return xn=eo(xn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Po.set(i,eo(Po.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Io.set(i,eo(Io.get(i)||null,e,t,n,r,o)),!0}return!1}function mp(e){var t=Tn(e.target);if(t!==null){var n=rr(t);if(n!==null){if(t=n.tag,t===13){if(t=rp(n),t!==null){e.blockedOn=t,pp(e.priority,function(){fp(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 Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=za(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ma=r,n.target.dispatchEvent(r),Ma=null}else return t=si(n),t!==null&&Fu(t),e.blockedOn=n,!1;t.shift()}return!0}function cd(e,t,n){Gi(e)&&n.delete(t)}function Qv(){Ta=!1,yn!==null&&Gi(yn)&&(yn=null),vn!==null&&Gi(vn)&&(vn=null),xn!==null&&Gi(xn)&&(xn=null),Po.forEach(cd),Io.forEach(cd)}function to(e,t){e.blockedOn===t&&(e.blockedOn=null,Ta||(Ta=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,Qv)))}function To(e){function t(o){return to(o,e)}if(0<_i.length){to(_i[0],e);for(var n=1;n<_i.length;n++){var r=_i[n];r.blockedOn===e&&(r.blockedOn=null)}}for(yn!==null&&to(yn,e),vn!==null&&to(vn,e),xn!==null&&to(xn,e),Po.forEach(t),Io.forEach(t),n=0;n<fn.length;n++)r=fn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<fn.length&&(n=fn[0],n.blockedOn===null);)mp(n),n.blockedOn===null&&fn.shift()}var Cr=rn.ReactCurrentBatchConfig,gs=!0;function qv(e,t,n,r){var o=ue,i=Cr.transition;Cr.transition=null;try{ue=1,Hu(e,t,n,r)}finally{ue=o,Cr.transition=i}}function Zv(e,t,n,r){var o=ue,i=Cr.transition;Cr.transition=null;try{ue=4,Hu(e,t,n,r)}finally{ue=o,Cr.transition=i}}function Hu(e,t,n,r){if(gs){var o=za(e,t,n,r);if(o===null)Xl(e,t,r,ys,n),ud(e,r);else if(Gv(o,e,t,n,r))r.stopPropagation();else if(ud(e,r),t&4&&-1<Kv.indexOf(e)){for(;o!==null;){var i=si(o);if(i!==null&&dp(i),i=za(e,t,n,r),i===null&&Xl(e,t,r,ys,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var ys=null;function za(e,t,n,r){if(ys=null,e=Ru(r),e=Tn(e),e!==null)if(t=rr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rp(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 ys=e,null}function gp(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(Ov()){case Du:return 1;case lp:return 4;case ps:case Fv:return 16;case ap:return 536870912;default:return 16}default:return 16}}var mn=null,Bu=null,Qi=null;function yp(){if(Qi)return Qi;var e,t=Bu,n=t.length,r,o="value"in mn?mn.value:mn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Qi=o.slice(e,1<r?1-r:void 0)}function qi(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 Ci(){return!0}function dd(){return!1}function ut(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ci:dd,this.isPropagationStopped=dd,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=Ci)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ci)},persist:function(){},isPersistent:Ci}),t}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vu=ut(Gr),ii=xe({},Gr,{view:0,detail:0}),Jv=ut(ii),Dl,Ol,no,Zs=xe({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wu,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!==no&&(no&&e.type==="mousemove"?(Dl=e.screenX-no.screenX,Ol=e.screenY-no.screenY):Ol=Dl=0,no=e),Dl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),fd=ut(Zs),ex=xe({},Zs,{dataTransfer:0}),tx=ut(ex),nx=xe({},ii,{relatedTarget:0}),Fl=ut(nx),rx=xe({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),ox=ut(rx),ix=xe({},Gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sx=ut(ix),lx=xe({},Gr,{data:0}),hd=ut(lx),ax={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ux={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"},cx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cx[e])?!!t[e]:!1}function Wu(){return dx}var fx=xe({},ii,{key:function(e){if(e.key){var t=ax[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ux[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wu,charCode:function(e){return e.type==="keypress"?qi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hx=ut(fx),px=xe({},Zs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pd=ut(px),mx=xe({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wu}),gx=ut(mx),yx=xe({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),vx=ut(yx),xx=xe({},Zs,{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}),wx=ut(xx),kx=[9,13,27,32],Uu=qt&&"CompositionEvent"in window,vo=null;qt&&"documentMode"in document&&(vo=document.documentMode);var Sx=qt&&"TextEvent"in window&&!vo,vp=qt&&(!Uu||vo&&8<vo&&11>=vo),md=" ",gd=!1;function xp(e,t){switch(e){case"keyup":return kx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function Nx(e,t){switch(e){case"compositionend":return wp(t);case"keypress":return t.which!==32?null:(gd=!0,md);case"textInput":return e=t.data,e===md&&gd?null:e;default:return null}}function Ex(e,t){if(fr)return e==="compositionend"||!Uu&&xp(e,t)?(e=yp(),Qi=Bu=mn=null,fr=!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 vp&&t.locale!=="ko"?null:t.data;default:return null}}var _x={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 yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_x[e.type]:t==="textarea"}function kp(e,t,n,r){Zh(r),t=vs(t,"onChange"),0<t.length&&(n=new Vu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xo=null,zo=null;function Cx(e){Ip(e,0)}function Js(e){var t=mr(e);if(Uh(t))return e}function jx(e,t){if(e==="change")return t}var Sp=!1;if(qt){var Hl;if(qt){var Bl="oninput"in document;if(!Bl){var vd=document.createElement("div");vd.setAttribute("oninput","return;"),Bl=typeof vd.oninput=="function"}Hl=Bl}else Hl=!1;Sp=Hl&&(!document.documentMode||9<document.documentMode)}function xd(){xo&&(xo.detachEvent("onpropertychange",Np),zo=xo=null)}function Np(e){if(e.propertyName==="value"&&Js(zo)){var t=[];kp(t,zo,e,Ru(e)),np(Cx,t)}}function Mx(e,t,n){e==="focusin"?(xd(),xo=t,zo=n,xo.attachEvent("onpropertychange",Np)):e==="focusout"&&xd()}function $x(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Js(zo)}function bx(e,t){if(e==="click")return Js(t)}function Px(e,t){if(e==="input"||e==="change")return Js(t)}function Ix(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Ix;function Lo(e,t){if(bt(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 o=n[r];if(!ga.call(t,o)||!bt(e[o],t[o]))return!1}return!0}function wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kd(e,t){var n=wd(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=wd(n)}}function Ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _p(){for(var e=window,t=ds();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ds(e.document)}return t}function Yu(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 Tx(e){var t=_p(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ep(n.ownerDocument.documentElement,n)){if(r!==null&&Yu(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=kd(n,i);var s=kd(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>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 zx=qt&&"documentMode"in document&&11>=document.documentMode,hr=null,La=null,wo=null,Aa=!1;function Sd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Aa||hr==null||hr!==ds(r)||(r=hr,"selectionStart"in r&&Yu(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}),wo&&Lo(wo,r)||(wo=r,r=vs(La,"onSelect"),0<r.length&&(t=new Vu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function ji(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pr={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionend:ji("Transition","TransitionEnd")},Vl={},Cp={};qt&&(Cp=document.createElement("div").style,"AnimationEvent"in window||(delete pr.animationend.animation,delete pr.animationiteration.animation,delete pr.animationstart.animation),"TransitionEvent"in window||delete pr.transitionend.transition);function el(e){if(Vl[e])return Vl[e];if(!pr[e])return e;var t=pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cp)return Vl[e]=t[n];return e}var jp=el("animationend"),Mp=el("animationiteration"),$p=el("animationstart"),bp=el("transitionend"),Pp=new Map,Nd="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 jn(e,t){Pp.set(e,t),nr(t,[e])}for(var Wl=0;Wl<Nd.length;Wl++){var Ul=Nd[Wl],Lx=Ul.toLowerCase(),Ax=Ul[0].toUpperCase()+Ul.slice(1);jn(Lx,"on"+Ax)}jn(jp,"onAnimationEnd");jn(Mp,"onAnimationIteration");jn($p,"onAnimationStart");jn("dblclick","onDoubleClick");jn("focusin","onFocus");jn("focusout","onBlur");jn(bp,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nr("onBeforeInput",["compositionend","keypress","textInput","paste"]);nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="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(" "),Rx=new Set("cancel close invalid load scroll toggle".split(" ").concat(fo));function Ed(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Lv(r,t,void 0,e),e.currentTarget=null}function Ip(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;Ed(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;Ed(o,l,u),i=a}}}if(hs)throw e=Pa,hs=!1,Pa=null,e}function fe(e,t){var n=t[Ha];n===void 0&&(n=t[Ha]=new Set);var r=e+"__bubble";n.has(r)||(Tp(t,e,2,!1),n.add(r))}function Yl(e,t,n){var r=0;t&&(r|=4),Tp(n,e,r,t)}var Mi="_reactListening"+Math.random().toString(36).slice(2);function Ao(e){if(!e[Mi]){e[Mi]=!0,Fh.forEach(function(n){n!=="selectionchange"&&(Rx.has(n)||Yl(n,!1,e),Yl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mi]||(t[Mi]=!0,Yl("selectionchange",!1,t))}}function Tp(e,t,n,r){switch(gp(t)){case 1:var o=qv;break;case 4:o=Zv;break;default:o=Hu}n=o.bind(null,t,n,e),o=void 0,!ba||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Xl(e,t,n,r,o){var i=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===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Tn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}np(function(){var u=i,c=Ru(n),d=[];e:{var f=Pp.get(e);if(f!==void 0){var p=Vu,y=e;switch(e){case"keypress":if(qi(n)===0)break e;case"keydown":case"keyup":p=hx;break;case"focusin":y="focus",p=Fl;break;case"focusout":y="blur",p=Fl;break;case"beforeblur":case"afterblur":p=Fl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=fd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=gx;break;case jp:case Mp:case $p:p=ox;break;case bp:p=vx;break;case"scroll":p=Jv;break;case"wheel":p=wx;break;case"copy":case"cut":case"paste":p=sx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pd}var x=(t&4)!==0,w=!x&&e==="scroll",m=x?f!==null?f+"Capture":null:f;x=[];for(var v=u,g;v!==null;){g=v;var k=g.stateNode;if(g.tag===5&&k!==null&&(g=k,m!==null&&(k=bo(v,m),k!=null&&x.push(Ro(v,k,g)))),w)break;v=v.return}0<x.length&&(f=new p(f,y,null,n,c),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ma&&(y=n.relatedTarget||n.fromElement)&&(Tn(y)||y[Zt]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Tn(y):null,y!==null&&(w=rr(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(x=fd,k="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=pd,k="onPointerLeave",m="onPointerEnter",v="pointer"),w=p==null?f:mr(p),g=y==null?f:mr(y),f=new x(k,v+"leave",p,n,c),f.target=w,f.relatedTarget=g,k=null,Tn(c)===u&&(x=new x(m,v+"enter",y,n,c),x.target=g,x.relatedTarget=w,k=x),w=k,p&&y)t:{for(x=p,m=y,v=0,g=x;g;g=or(g))v++;for(g=0,k=m;k;k=or(k))g++;for(;0<v-g;)x=or(x),v--;for(;0<g-v;)m=or(m),g--;for(;v--;){if(x===m||m!==null&&x===m.alternate)break t;x=or(x),m=or(m)}x=null}else x=null;p!==null&&_d(d,f,p,x,!1),y!==null&&w!==null&&_d(d,w,y,x,!0)}}e:{if(f=u?mr(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=jx;else if(yd(f))if(Sp)C=Px;else{C=$x;var S=Mx}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=bx);if(C&&(C=C(e,u))){kp(d,C,n,c);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Na(f,"number",f.value)}switch(S=u?mr(u):window,e){case"focusin":(yd(S)||S.contentEditable==="true")&&(hr=S,La=u,wo=null);break;case"focusout":wo=La=hr=null;break;case"mousedown":Aa=!0;break;case"contextmenu":case"mouseup":case"dragend":Aa=!1,Sd(d,n,c);break;case"selectionchange":if(zx)break;case"keydown":case"keyup":Sd(d,n,c)}var _;if(Uu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else fr?xp(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(vp&&n.locale!=="ko"&&(fr||j!=="onCompositionStart"?j==="onCompositionEnd"&&fr&&(_=yp()):(mn=c,Bu="value"in mn?mn.value:mn.textContent,fr=!0)),S=vs(u,j),0<S.length&&(j=new hd(j,e,null,n,c),d.push({event:j,listeners:S}),_?j.data=_:(_=wp(n),_!==null&&(j.data=_)))),(_=Sx?Nx(e,n):Ex(e,n))&&(u=vs(u,"onBeforeInput"),0<u.length&&(c=new hd("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=_))}Ip(d,t)})}function Ro(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=bo(e,n),i!=null&&r.unshift(Ro(e,i,o)),i=bo(e,t),i!=null&&r.push(Ro(e,i,o))),e=e.return}return r}function or(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _d(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=bo(n,i),a!=null&&s.unshift(Ro(n,a,l))):o||(a=bo(n,i),a!=null&&s.push(Ro(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Dx=/\r\n?/g,Ox=/\u0000|\uFFFD/g;function Cd(e){return(typeof e=="string"?e:""+e).replace(Dx,`
|
|
38
|
-
`).replace(Ox,"")}function $i(e,t,n){if(t=Cd(t),Cd(e)!==t&&n)throw Error(J(425))}function xs(){}var Ra=null,Da=null;function Oa(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 Fa=typeof setTimeout=="function"?setTimeout:void 0,Fx=typeof clearTimeout=="function"?clearTimeout:void 0,jd=typeof Promise=="function"?Promise:void 0,Hx=typeof queueMicrotask=="function"?queueMicrotask:typeof jd<"u"?function(e){return jd.resolve(null).then(e).catch(Bx)}:Fa;function Bx(e){setTimeout(function(){throw e})}function Kl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),To(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);To(t)}function wn(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 Md(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 Qr=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Qr,Do="__reactProps$"+Qr,Zt="__reactContainer$"+Qr,Ha="__reactEvents$"+Qr,Vx="__reactListeners$"+Qr,Wx="__reactHandles$"+Qr;function Tn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zt]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Md(e);e!==null;){if(n=e[Rt])return n;e=Md(e)}return t}e=n,n=e.parentNode}return null}function si(e){return e=e[Rt]||e[Zt],!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(J(33))}function tl(e){return e[Do]||null}var Ba=[],gr=-1;function Mn(e){return{current:e}}function he(e){0>gr||(e.current=Ba[gr],Ba[gr]=null,gr--)}function ce(e,t){gr++,Ba[gr]=e.current,e.current=t}var Cn={},Fe=Mn(Cn),qe=Mn(!1),Yn=Cn;function Ir(e,t){var n=e.type.contextTypes;if(!n)return Cn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ze(e){return e=e.childContextTypes,e!=null}function ws(){he(qe),he(Fe)}function $d(e,t,n){if(Fe.current!==Cn)throw Error(J(168));ce(Fe,t),ce(qe,n)}function zp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(J(108,Mv(e)||"Unknown",o));return xe({},n,r)}function ks(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cn,Yn=Fe.current,ce(Fe,e),ce(qe,qe.current),!0}function bd(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=zp(e,t,Yn),r.__reactInternalMemoizedMergedChildContext=e,he(qe),he(Fe),ce(Fe,e)):he(qe),ce(qe,n)}var Ut=null,nl=!1,Gl=!1;function Lp(e){Ut===null?Ut=[e]:Ut.push(e)}function Ux(e){nl=!0,Lp(e)}function $n(){if(!Gl&&Ut!==null){Gl=!0;var e=0,t=ue;try{var n=Ut;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ut=null,nl=!1}catch(o){throw Ut!==null&&(Ut=Ut.slice(e+1)),sp(Du,$n),o}finally{ue=t,Gl=!1}}return null}var yr=[],vr=0,Ss=null,Ns=0,ft=[],ht=0,Xn=null,Yt=1,Xt="";function bn(e,t){yr[vr++]=Ns,yr[vr++]=Ss,Ss=e,Ns=t}function Ap(e,t,n){ft[ht++]=Yt,ft[ht++]=Xt,ft[ht++]=Xn,Xn=e;var r=Yt;e=Xt;var o=32-Mt(r)-1;r&=~(1<<o),n+=1;var i=32-Mt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Yt=1<<32-Mt(t)+o|n<<o|r,Xt=i+e}else Yt=1<<i|n<<o|r,Xt=e}function Xu(e){e.return!==null&&(bn(e,1),Ap(e,1,0))}function Ku(e){for(;e===Ss;)Ss=yr[--vr],yr[vr]=null,Ns=yr[--vr],yr[vr]=null;for(;e===Xn;)Xn=ft[--ht],ft[ht]=null,Xt=ft[--ht],ft[ht]=null,Yt=ft[--ht],ft[ht]=null}var it=null,ot=null,ge=!1,Nt=null;function Rp(e,t){var n=pt(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 Pd(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,ot=wn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,it=e,ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xn!==null?{id:Yt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,it=e,ot=null,!0):!1;default:return!1}}function Va(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wa(e){if(ge){var t=ot;if(t){var n=t;if(!Pd(e,t)){if(Va(e))throw Error(J(418));t=wn(n.nextSibling);var r=it;t&&Pd(e,t)?Rp(r,n):(e.flags=e.flags&-4097|2,ge=!1,it=e)}}else{if(Va(e))throw Error(J(418));e.flags=e.flags&-4097|2,ge=!1,it=e}}}function Id(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;it=e}function bi(e){if(e!==it)return!1;if(!ge)return Id(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oa(e.type,e.memoizedProps)),t&&(t=ot)){if(Va(e))throw Dp(),Error(J(418));for(;t;)Rp(e,t),t=wn(t.nextSibling)}if(Id(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ot=wn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ot=null}}else ot=it?wn(e.stateNode.nextSibling):null;return!0}function Dp(){for(var e=ot;e;)e=wn(e.nextSibling)}function Tr(){ot=it=null,ge=!1}function Gu(e){Nt===null?Nt=[e]:Nt.push(e)}var Yx=rn.ReactCurrentBatchConfig;function ro(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Pi(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Td(e){var t=e._init;return t(e._payload)}function Op(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function o(m,v){return m=En(m,v),m.index=0,m.sibling=null,m}function i(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,v,g,k){return v===null||v.tag!==6?(v=na(g,m.mode,k),v.return=m,v):(v=o(v,g),v.return=m,v)}function a(m,v,g,k){var C=g.type;return C===dr?c(m,v,g.props.children,k,g.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===an&&Td(C)===v.type)?(k=o(v,g.props),k.ref=ro(m,v,g),k.return=m,k):(k=os(g.type,g.key,g.props,null,m.mode,k),k.ref=ro(m,v,g),k.return=m,k)}function u(m,v,g,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ra(g,m.mode,k),v.return=m,v):(v=o(v,g.children||[]),v.return=m,v)}function c(m,v,g,k,C){return v===null||v.tag!==7?(v=Fn(g,m.mode,k,C),v.return=m,v):(v=o(v,g),v.return=m,v)}function d(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=na(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wi:return g=os(v.type,v.key,v.props,null,m.mode,g),g.ref=ro(m,null,v),g.return=m,g;case cr:return v=ra(v,m.mode,g),v.return=m,v;case an:var k=v._init;return d(m,k(v._payload),g)}if(uo(v)||Zr(v))return v=Fn(v,m.mode,g,null),v.return=m,v;Pi(m,v)}return null}function f(m,v,g,k){var C=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return C!==null?null:l(m,v,""+g,k);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case wi:return g.key===C?a(m,v,g,k):null;case cr:return g.key===C?u(m,v,g,k):null;case an:return C=g._init,f(m,v,C(g._payload),k)}if(uo(g)||Zr(g))return C!==null?null:c(m,v,g,k,null);Pi(m,g)}return null}function p(m,v,g,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return m=m.get(g)||null,l(v,m,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case wi:return m=m.get(k.key===null?g:k.key)||null,a(v,m,k,C);case cr:return m=m.get(k.key===null?g:k.key)||null,u(v,m,k,C);case an:var S=k._init;return p(m,v,g,S(k._payload),C)}if(uo(k)||Zr(k))return m=m.get(g)||null,c(v,m,k,C,null);Pi(v,k)}return null}function y(m,v,g,k){for(var C=null,S=null,_=v,j=v=0,b=null;_!==null&&j<g.length;j++){_.index>j?(b=_,_=null):b=_.sibling;var F=f(m,_,g[j],k);if(F===null){_===null&&(_=b);break}e&&_&&F.alternate===null&&t(m,_),v=i(F,v,j),S===null?C=F:S.sibling=F,S=F,_=b}if(j===g.length)return n(m,_),ge&&bn(m,j),C;if(_===null){for(;j<g.length;j++)_=d(m,g[j],k),_!==null&&(v=i(_,v,j),S===null?C=_:S.sibling=_,S=_);return ge&&bn(m,j),C}for(_=r(m,_);j<g.length;j++)b=p(_,m,j,g[j],k),b!==null&&(e&&b.alternate!==null&&_.delete(b.key===null?j:b.key),v=i(b,v,j),S===null?C=b:S.sibling=b,S=b);return e&&_.forEach(function(L){return t(m,L)}),ge&&bn(m,j),C}function x(m,v,g,k){var C=Zr(g);if(typeof C!="function")throw Error(J(150));if(g=C.call(g),g==null)throw Error(J(151));for(var S=C=null,_=v,j=v=0,b=null,F=g.next();_!==null&&!F.done;j++,F=g.next()){_.index>j?(b=_,_=null):b=_.sibling;var L=f(m,_,F.value,k);if(L===null){_===null&&(_=b);break}e&&_&&L.alternate===null&&t(m,_),v=i(L,v,j),S===null?C=L:S.sibling=L,S=L,_=b}if(F.done)return n(m,_),ge&&bn(m,j),C;if(_===null){for(;!F.done;j++,F=g.next())F=d(m,F.value,k),F!==null&&(v=i(F,v,j),S===null?C=F:S.sibling=F,S=F);return ge&&bn(m,j),C}for(_=r(m,_);!F.done;j++,F=g.next())F=p(_,m,j,F.value,k),F!==null&&(e&&F.alternate!==null&&_.delete(F.key===null?j:F.key),v=i(F,v,j),S===null?C=F:S.sibling=F,S=F);return e&&_.forEach(function(U){return t(m,U)}),ge&&bn(m,j),C}function w(m,v,g,k){if(typeof g=="object"&&g!==null&&g.type===dr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case wi:e:{for(var C=g.key,S=v;S!==null;){if(S.key===C){if(C=g.type,C===dr){if(S.tag===7){n(m,S.sibling),v=o(S,g.props.children),v.return=m,m=v;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===an&&Td(C)===S.type){n(m,S.sibling),v=o(S,g.props),v.ref=ro(m,S,g),v.return=m,m=v;break e}n(m,S);break}else t(m,S);S=S.sibling}g.type===dr?(v=Fn(g.props.children,m.mode,k,g.key),v.return=m,m=v):(k=os(g.type,g.key,g.props,null,m.mode,k),k.ref=ro(m,v,g),k.return=m,m=k)}return s(m);case cr:e:{for(S=g.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=o(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=ra(g,m.mode,k),v.return=m,m=v}return s(m);case an:return S=g._init,w(m,v,S(g._payload),k)}if(uo(g))return y(m,v,g,k);if(Zr(g))return x(m,v,g,k);Pi(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,g),v.return=m,m=v):(n(m,v),v=na(g,m.mode,k),v.return=m,m=v),s(m)):n(m,v)}return w}var zr=Op(!0),Fp=Op(!1),Es=Mn(null),_s=null,xr=null,Qu=null;function qu(){Qu=xr=_s=null}function Zu(e){var t=Es.current;he(Es),e._currentValue=t}function Ua(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 jr(e,t){_s=e,Qu=xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Qu!==e)if(e={context:e,memoizedValue:t,next:null},xr===null){if(_s===null)throw Error(J(308));xr=e,_s.dependencies={lanes:0,firstContext:e}}else xr=xr.next=e;return t}var zn=null;function Ju(e){zn===null?zn=[e]:zn.push(e)}function Hp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ju(t)):(n.next=o.next,o.next=n),t.interleaved=n,Jt(e,r)}function Jt(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 un=!1;function ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bp(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 Gt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function kn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Jt(e,n)}return o=r.interleaved,o===null?(t.next=t,Ju(r)):(t.next=o.next,o.next=t),r.interleaved=t,Jt(e,n)}function Zi(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,Ou(e,n)}}function zd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=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};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 Cs(e,t,n,r){var o=e.updateQueue;un=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(f=t,p=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=xe({},d,f);break e;case 2:un=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=d):c=c.next=p,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Gn|=s,e.lanes=s,e.memoizedState=d}}function Ld(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(J(191,o));o.call(r)}}}var li={},Ft=Mn(li),Oo=Mn(li),Fo=Mn(li);function Ln(e){if(e===li)throw Error(J(174));return e}function tc(e,t){switch(ce(Fo,t),ce(Oo,e),ce(Ft,li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_a(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_a(t,e)}he(Ft),ce(Ft,t)}function Lr(){he(Ft),he(Oo),he(Fo)}function Vp(e){Ln(Fo.current);var t=Ln(Ft.current),n=_a(t,e.type);t!==n&&(ce(Oo,e),ce(Ft,n))}function nc(e){Oo.current===e&&(he(Ft),he(Oo))}var ye=Mn(0);function js(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 Ql=[];function rc(){for(var e=0;e<Ql.length;e++)Ql[e]._workInProgressVersionPrimary=null;Ql.length=0}var Ji=rn.ReactCurrentDispatcher,ql=rn.ReactCurrentBatchConfig,Kn=0,ve=null,Ce=null,$e=null,Ms=!1,ko=!1,Ho=0,Xx=0;function Re(){throw Error(J(321))}function oc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function ic(e,t,n,r,o,i){if(Kn=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ji.current=e===null||e.memoizedState===null?qx:Zx,e=n(r,o),ko){i=0;do{if(ko=!1,Ho=0,25<=i)throw Error(J(301));i+=1,$e=Ce=null,t.updateQueue=null,Ji.current=Jx,e=n(r,o)}while(ko)}if(Ji.current=$s,t=Ce!==null&&Ce.next!==null,Kn=0,$e=Ce=ve=null,Ms=!1,t)throw Error(J(300));return e}function sc(){var e=Ho!==0;return Ho=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?ve.memoizedState=$e=e:$e=$e.next=e,$e}function yt(){if(Ce===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=$e===null?ve.memoizedState:$e.next;if(t!==null)$e=t,Ce=e;else{if(e===null)throw Error(J(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},$e===null?ve.memoizedState=$e=e:$e=$e.next=e}return $e}function Bo(e,t){return typeof t=="function"?t(e):t}function Zl(e){var t=yt(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=Ce,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((Kn&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,ve.lanes|=c,Gn|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,bt(r,t.memoizedState)||(Ge=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ve.lanes|=i,Gn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jl(e){var t=yt(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);bt(i,t.memoizedState)||(Ge=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Wp(){}function Up(e,t){var n=ve,r=yt(),o=t(),i=!bt(r.memoizedState,o);if(i&&(r.memoizedState=o,Ge=!0),r=r.queue,lc(Kp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||$e!==null&&$e.memoizedState.tag&1){if(n.flags|=2048,Vo(9,Xp.bind(null,n,r,o,t),void 0,null),be===null)throw Error(J(349));Kn&30||Yp(n,t,o)}return o}function Yp(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 Xp(e,t,n,r){t.value=n,t.getSnapshot=r,Gp(t)&&Qp(e)}function Kp(e,t,n){return n(function(){Gp(t)&&Qp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function Qp(e){var t=Jt(e,1);t!==null&&$t(t,e,1,-1)}function Ad(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t.queue=e,e=e.dispatch=Qx.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 qp(){return yt().memoizedState}function es(e,t,n,r){var o=Lt();ve.flags|=e,o.memoizedState=Vo(1|t,n,void 0,r===void 0?null:r)}function rl(e,t,n,r){var o=yt();r=r===void 0?null:r;var i=void 0;if(Ce!==null){var s=Ce.memoizedState;if(i=s.destroy,r!==null&&oc(r,s.deps)){o.memoizedState=Vo(t,n,i,r);return}}ve.flags|=e,o.memoizedState=Vo(1|t,n,i,r)}function Rd(e,t){return es(8390656,8,e,t)}function lc(e,t){return rl(2048,8,e,t)}function Zp(e,t){return rl(4,2,e,t)}function Jp(e,t){return rl(4,4,e,t)}function em(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 tm(e,t,n){return n=n!=null?n.concat([e]):null,rl(4,4,em.bind(null,t,e),n)}function ac(){}function nm(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&oc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rm(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&oc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function om(e,t,n){return Kn&21?(bt(n,t)||(n=up(),ve.lanes|=n,Gn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=n)}function Kx(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=ql.transition;ql.transition={};try{e(!1),t()}finally{ue=n,ql.transition=r}}function im(){return yt().memoizedState}function Gx(e,t,n){var r=Nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},sm(e))lm(t,n);else if(n=Hp(e,t,n,r),n!==null){var o=We();$t(n,e,r,o),am(n,t,r)}}function Qx(e,t,n){var r=Nn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(sm(e))lm(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,bt(l,s)){var a=t.interleaved;a===null?(o.next=o,Ju(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Hp(e,t,o,r),n!==null&&(o=We(),$t(n,e,r,o),am(n,t,r))}}function sm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function lm(e,t){ko=Ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function am(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ou(e,n)}}var $s={readContext:gt,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},qx={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Rd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,es(4194308,4,em.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=Gx.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Ad,useDebugValue:ac,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Ad(!1),t=e[0];return e=Kx.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,o=Lt();if(ge){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),be===null)throw Error(J(349));Kn&30||Yp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Rd(Kp.bind(null,r,i,e),[e]),r.flags|=2048,Vo(9,Xp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Lt(),t=be.identifierPrefix;if(ge){var n=Xt,r=Yt;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ho++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Xx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zx={readContext:gt,useCallback:nm,useContext:gt,useEffect:lc,useImperativeHandle:tm,useInsertionEffect:Zp,useLayoutEffect:Jp,useMemo:rm,useReducer:Zl,useRef:qp,useState:function(){return Zl(Bo)},useDebugValue:ac,useDeferredValue:function(e){var t=yt();return om(t,Ce.memoizedState,e)},useTransition:function(){var e=Zl(Bo)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Wp,useSyncExternalStore:Up,useId:im,unstable_isNewReconciler:!1},Jx={readContext:gt,useCallback:nm,useContext:gt,useEffect:lc,useImperativeHandle:tm,useInsertionEffect:Zp,useLayoutEffect:Jp,useMemo:rm,useReducer:Jl,useRef:qp,useState:function(){return Jl(Bo)},useDebugValue:ac,useDeferredValue:function(e){var t=yt();return Ce===null?t.memoizedState=e:om(t,Ce.memoizedState,e)},useTransition:function(){var e=Jl(Bo)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Wp,useSyncExternalStore:Up,useId:im,unstable_isNewReconciler:!1};function xt(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 Ya(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 ol={isMounted:function(e){return(e=e._reactInternals)?rr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=We(),o=Nn(e),i=Gt(r,o);i.payload=t,n!=null&&(i.callback=n),t=kn(e,i,o),t!==null&&($t(t,e,o,r),Zi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=We(),o=Nn(e),i=Gt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=kn(e,i,o),t!==null&&($t(t,e,o,r),Zi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=We(),r=Nn(e),o=Gt(n,r);o.tag=2,t!=null&&(o.callback=t),t=kn(e,o,r),t!==null&&($t(t,e,r,n),Zi(t,e,r))}};function Dd(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Lo(n,r)||!Lo(o,i):!0}function um(e,t,n){var r=!1,o=Cn,i=t.contextType;return typeof i=="object"&&i!==null?i=gt(i):(o=Ze(t)?Yn:Fe.current,r=t.contextTypes,i=(r=r!=null)?Ir(e,o):Cn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ol,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Od(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&&ol.enqueueReplaceState(t,t.state,null)}function Xa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},ec(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=gt(i):(i=Ze(t)?Yn:Fe.current,o.context=Ir(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ya(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ol.enqueueReplaceState(o,o.state,null),Cs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ar(e,t){try{var n="",r=t;do n+=jv(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
-
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function ea(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ka(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ew=typeof WeakMap=="function"?WeakMap:Map;function cm(e,t,n){n=Gt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ps||(Ps=!0,ou=r),Ka(e,t)},n}function dm(e,t,n){n=Gt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ka(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ka(e,t),typeof r!="function"&&(Sn===null?Sn=new Set([this]):Sn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Fd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ew;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=pw.bind(null,e,t,n),t.then(e,e))}function Hd(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 Bd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=Gt(-1,1),t.tag=2,kn(n,t,1))),n.lanes|=1),e)}var tw=rn.ReactCurrentOwner,Ge=!1;function Ve(e,t,n,r){t.child=e===null?Fp(t,null,n,r):zr(t,e.child,n,r)}function Vd(e,t,n,r,o){n=n.render;var i=t.ref;return jr(t,o),r=ic(e,t,n,r,i,o),n=sc(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,en(e,t,o)):(ge&&n&&Xu(t),t.flags|=1,Ve(e,t,r,o),t.child)}function Wd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!gc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,fm(e,t,i,r,o)):(e=os(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Lo,n(s,r)&&e.ref===t.ref)return en(e,t,o)}return t.flags|=1,e=En(i,r),e.ref=t.ref,e.return=t,t.child=e}function fm(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Lo(i,r)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,en(e,t,o)}return Ga(e,t,n,r,o)}function hm(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(kr,nt),nt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ce(kr,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(kr,nt),nt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(kr,nt),nt|=r;return Ve(e,t,o,n),t.child}function pm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ga(e,t,n,r,o){var i=Ze(n)?Yn:Fe.current;return i=Ir(t,i),jr(t,o),n=ic(e,t,n,r,i,o),r=sc(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,en(e,t,o)):(ge&&r&&Xu(t),t.flags|=1,Ve(e,t,n,o),t.child)}function Ud(e,t,n,r,o){if(Ze(n)){var i=!0;ks(t)}else i=!1;if(jr(t,o),t.stateNode===null)ts(e,t),um(t,n,r),Xa(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=gt(u):(u=Ze(n)?Yn:Fe.current,u=Ir(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Od(t,s,r,u),un=!1;var f=t.memoizedState;s.state=f,Cs(t,r,s,o),a=t.memoizedState,l!==r||f!==a||qe.current||un?(typeof c=="function"&&(Ya(t,n,c,r),a=t.memoizedState),(l=un||Dd(t,n,l,r,f,a,u))?(d||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=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Bp(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:xt(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=gt(a):(a=Ze(n)?Yn:Fe.current,a=Ir(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Od(t,s,r,a),un=!1,f=t.memoizedState,s.state=f,Cs(t,r,s,o);var y=t.memoizedState;l!==d||f!==y||qe.current||un?(typeof p=="function"&&(Ya(t,n,p,r),y=t.memoizedState),(u=un||Dd(t,n,u,r,f,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),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=a,r=u):(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 Qa(e,t,n,r,i,o)}function Qa(e,t,n,r,o,i){pm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&bd(t,n,!1),en(e,t,i);r=t.stateNode,tw.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=zr(t,e.child,null,i),t.child=zr(t,null,l,i)):Ve(e,t,l,i),t.memoizedState=r.state,o&&bd(t,n,!0),t.child}function mm(e){var t=e.stateNode;t.pendingContext?$d(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$d(e,t.context,!1),tc(e,t.containerInfo)}function Yd(e,t,n,r,o){return Tr(),Gu(o),t.flags|=256,Ve(e,t,n,r),t.child}var qa={dehydrated:null,treeContext:null,retryLane:0};function Za(e){return{baseLanes:e,cachePool:null,transitions:null}}function gm(e,t,n){var r=t.pendingProps,o=ye.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ce(ye,o&1),e===null)return Wa(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,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=ll(s,r,0,null),e=Fn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Za(n),t.memoizedState=qa,e):uc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return nw(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=En(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=En(l,i):(i=Fn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Za(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=qa,r}return i=e.child,e=i.sibling,r=En(i,{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 uc(e,t){return t=ll({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ii(e,t,n,r){return r!==null&&Gu(r),zr(t,e.child,null,n),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nw(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ea(Error(J(422))),Ii(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=ll({mode:"visible",children:r.children},o,0,null),i=Fn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&zr(t,e.child,null,s),t.child.memoizedState=Za(s),t.memoizedState=qa,i);if(!(t.mode&1))return Ii(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=ea(i,r,void 0),Ii(e,t,s,r)}if(l=(s&e.childLanes)!==0,Ge||l){if(r=be,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Jt(e,o),$t(r,e,o,-1))}return mc(),r=ea(Error(J(421))),Ii(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=mw.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ot=wn(o.nextSibling),it=t,ge=!0,Nt=null,e!==null&&(ft[ht++]=Yt,ft[ht++]=Xt,ft[ht++]=Xn,Yt=e.id,Xt=e.overflow,Xn=t),t=uc(t,r.children),t.flags|=4096,t)}function Xd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ua(e.return,t,n)}function ta(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ym(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=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&&Xd(e,n,t);else if(e.tag===19)Xd(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(ce(ye,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&js(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ta(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&js(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ta(t,!0,n,null,i);break;case"together":ta(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 en(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=En(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=En(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rw(e,t,n){switch(t.tag){case 3:mm(t),Tr();break;case 5:Vp(t);break;case 1:Ze(t.type)&&ks(t);break;case 4:tc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(Es,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?gm(e,t,n):(ce(ye,ye.current&1),e=en(e,t,n),e!==null?e.sibling:null);ce(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ym(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,hm(e,t,n)}return en(e,t,n)}var vm,Ja,xm,wm;vm=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}};Ja=function(){};xm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ln(Ft.current);var i=null;switch(n){case"input":o=ka(e,o),r=ka(e,r),i=[];break;case"select":o=xe({},o,{value:void 0}),r=xe({},r,{value:void 0}),i=[];break;case"textarea":o=Ea(e,o),r=Ea(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=xs)}Ca(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Mo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Mo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&fe("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};wm=function(e,t,n,r){n!==r&&(t.flags|=4)};function oo(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ow(e,t,n){var r=t.pendingProps;switch(Ku(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return Ze(t.type)&&ws(),De(t),null;case 3:return r=t.stateNode,Lr(),he(qe),he(Fe),rc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(bi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Nt!==null&&(lu(Nt),Nt=null))),Ja(e,t),De(t),null;case 5:nc(t);var o=Ln(Fo.current);if(n=t.type,e!==null&&t.stateNode!=null)xm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return De(t),null}if(e=Ln(Ft.current),bi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rt]=t,r[Do]=i,e=(t.mode&1)!==0,n){case"dialog":fe("cancel",r),fe("close",r);break;case"iframe":case"object":case"embed":fe("load",r);break;case"video":case"audio":for(o=0;o<fo.length;o++)fe(fo[o],r);break;case"source":fe("error",r);break;case"img":case"image":case"link":fe("error",r),fe("load",r);break;case"details":fe("toggle",r);break;case"input":nd(r,i),fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fe("invalid",r);break;case"textarea":od(r,i),fe("invalid",r)}Ca(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&$i(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&$i(r.textContent,l,e),o=["children",""+l]):Mo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&fe("scroll",r)}switch(n){case"input":ki(r),rd(r,i,!0);break;case"textarea":ki(r),id(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=xs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kh(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[Rt]=t,e[Do]=r,vm(e,t,!1,!1),t.stateNode=e;e:{switch(s=ja(n,r),n){case"dialog":fe("cancel",e),fe("close",e),o=r;break;case"iframe":case"object":case"embed":fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<fo.length;o++)fe(fo[o],e);o=r;break;case"source":fe("error",e),o=r;break;case"img":case"image":case"link":fe("error",e),fe("load",e),o=r;break;case"details":fe("toggle",e),o=r;break;case"input":nd(e,r),o=ka(e,r),fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=xe({},r,{value:void 0}),fe("invalid",e);break;case"textarea":od(e,r),o=Ea(e,r),fe("invalid",e);break;default:o=r}Ca(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?qh(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Gh(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&$o(e,a):typeof a=="number"&&$o(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Mo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&fe("scroll",e):a!=null&&Tu(e,i,a,s))}switch(n){case"input":ki(e),rd(e,r,!1);break;case"textarea":ki(e),id(e);break;case"option":r.value!=null&&e.setAttribute("value",""+_n(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Nr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Nr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=xs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return De(t),null;case 6:if(e&&t.stateNode!=null)wm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Ln(Fo.current),Ln(Ft.current),bi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rt]=t,(i=r.nodeValue!==n)&&(e=it,e!==null))switch(e.tag){case 3:$i(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$i(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rt]=t,t.stateNode=r}return De(t),null;case 13:if(he(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&ot!==null&&t.mode&1&&!(t.flags&128))Dp(),Tr(),t.flags|=98560,i=!1;else if(i=bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[Rt]=t}else Tr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else Nt!==null&&(lu(Nt),Nt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?je===0&&(je=3):mc())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return Lr(),Ja(e,t),e===null&&Ao(t.stateNode.containerInfo),De(t),null;case 10:return Zu(t.type._context),De(t),null;case 17:return Ze(t.type)&&ws(),De(t),null;case 19:if(he(ye),i=t.memoizedState,i===null)return De(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)oo(i,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=js(e),s!==null){for(t.flags|=128,oo(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ce(ye,ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ne()>Rr&&(t.flags|=128,r=!0,oo(i,!1),t.lanes=4194304)}else{if(!r)if(e=js(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ge)return De(t),null}else 2*Ne()-i.renderingStartTime>Rr&&n!==1073741824&&(t.flags|=128,r=!0,oo(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ne(),t.sibling=null,n=ye.current,ce(ye,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return pc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nt&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function iw(e,t){switch(Ku(t),t.tag){case 1:return Ze(t.type)&&ws(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lr(),he(qe),he(Fe),rc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return nc(t),null;case 13:if(he(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(ye),null;case 4:return Lr(),null;case 10:return Zu(t.type._context),null;case 22:case 23:return pc(),null;case 24:return null;default:return null}}var Ti=!1,Oe=!1,sw=typeof WeakSet=="function"?WeakSet:Set,ne=null;function wr(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 eu(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Kd=!1;function lw(e,t){if(Ra=gs,e=_p(),Yu(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Da={focusedElem:e,selectionRange:n},gs=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,w=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:xt(t.type,x),w);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(k){Se(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return y=Kd,Kd=!1,y}function So(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&eu(t,n,i)}o=o.next}while(o!==r)}}function il(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 tu(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 km(e){var t=e.alternate;t!==null&&(e.alternate=null,km(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Do],delete t[Ha],delete t[Vx],delete t[Wx])),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 Sm(e){return e.tag===5||e.tag===3||e.tag===4}function Gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sm(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 nu(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=xs));else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function ru(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(ru(e,t,n),e=e.sibling;e!==null;)ru(e,t,n),e=e.sibling}var Te=null,wt=!1;function on(e,t,n){for(n=n.child;n!==null;)Nm(e,t,n),n=n.sibling}function Nm(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(qs,n)}catch{}switch(n.tag){case 5:Oe||wr(n,t);case 6:var r=Te,o=wt;Te=null,on(e,t,n),Te=r,wt=o,Te!==null&&(wt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(wt?(e=Te,n=n.stateNode,e.nodeType===8?Kl(e.parentNode,n):e.nodeType===1&&Kl(e,n),To(e)):Kl(Te,n.stateNode));break;case 4:r=Te,o=wt,Te=n.stateNode.containerInfo,wt=!0,on(e,t,n),Te=r,wt=o;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&eu(n,t,s),o=o.next}while(o!==r)}on(e,t,n);break;case 1:if(!Oe&&(wr(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)}on(e,t,n);break;case 21:on(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,on(e,t,n),Oe=r):on(e,t,n);break;default:on(e,t,n)}}function Qd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sw),t.forEach(function(r){var o=gw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Te=l.stateNode,wt=!1;break e;case 3:Te=l.stateNode.containerInfo,wt=!0;break e;case 4:Te=l.stateNode.containerInfo,wt=!0;break e}l=l.return}if(Te===null)throw Error(J(160));Nm(i,s,o),Te=null,wt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Se(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Em(t,e),t=t.sibling}function Em(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vt(t,e),zt(e),r&4){try{So(3,e,e.return),il(3,e)}catch(x){Se(e,e.return,x)}try{So(5,e,e.return)}catch(x){Se(e,e.return,x)}}break;case 1:vt(t,e),zt(e),r&512&&n!==null&&wr(n,n.return);break;case 5:if(vt(t,e),zt(e),r&512&&n!==null&&wr(n,n.return),e.flags&32){var o=e.stateNode;try{$o(o,"")}catch(x){Se(e,e.return,x)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Yh(o,i),ja(l,s);var u=ja(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?qh(o,d):c==="dangerouslySetInnerHTML"?Gh(o,d):c==="children"?$o(o,d):Tu(o,c,d,u)}switch(l){case"input":Sa(o,i);break;case"textarea":Xh(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Nr(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?Nr(o,!!i.multiple,i.defaultValue,!0):Nr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Do]=i}catch(x){Se(e,e.return,x)}}break;case 6:if(vt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){Se(e,e.return,x)}}break;case 3:if(vt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{To(t.containerInfo)}catch(x){Se(e,e.return,x)}break;case 4:vt(t,e),zt(e);break;case 13:vt(t,e),zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(fc=Ne())),r&4&&Qd(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(u=Oe)||c,vt(t,e),Oe=u):vt(t,e),zt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(ne=e,c=e.child;c!==null;){for(d=ne=c;ne!==null;){switch(f=ne,p=f.child,f.tag){case 0:case 11:case 14:case 15:So(4,f,f.return);break;case 1:wr(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(x){Se(r,n,x)}}break;case 5:wr(f,f.return);break;case 22:if(f.memoizedState!==null){Zd(d);continue}}p!==null?(p.return=f,ne=p):Zd(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Qh("display",s))}catch(x){Se(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Se(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:vt(t,e),zt(e),r&4&&Qd(e);break;case 21:break;default:vt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Sm(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&($o(o,""),r.flags&=-33);var i=Gd(e);ru(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Gd(e);nu(e,l,s);break;default:throw Error(J(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function aw(e,t,n){ne=e,_m(e)}function _m(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var o=ne,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ti;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Oe;l=Ti;var u=Oe;if(Ti=s,(Oe=a)&&!u)for(ne=o;ne!==null;)s=ne,a=s.child,s.tag===22&&s.memoizedState!==null?Jd(o):a!==null?(a.return=s,ne=a):Jd(o);for(;i!==null;)ne=i,_m(i),i=i.sibling;ne=o,Ti=l,Oe=u}qd(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ne=i):qd(e)}}function qd(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||il(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:xt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ld(t,i,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}Ld(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&To(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Oe||t.flags&512&&tu(t)}catch(f){Se(t,t.return,f)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Zd(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Jd(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{il(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Se(t,o,a)}}var i=t.return;try{tu(t)}catch(a){Se(t,i,a)}break;case 5:var s=t.return;try{tu(t)}catch(a){Se(t,s,a)}}}catch(a){Se(t,t.return,a)}if(t===e){ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ne=l;break}ne=t.return}}var uw=Math.ceil,bs=rn.ReactCurrentDispatcher,cc=rn.ReactCurrentOwner,mt=rn.ReactCurrentBatchConfig,ae=0,be=null,Ee=null,ze=0,nt=0,kr=Mn(0),je=0,Wo=null,Gn=0,sl=0,dc=0,No=null,Xe=null,fc=0,Rr=1/0,Wt=null,Ps=!1,ou=null,Sn=null,zi=!1,gn=null,Is=0,Eo=0,iu=null,ns=-1,rs=0;function We(){return ae&6?Ne():ns!==-1?ns:ns=Ne()}function Nn(e){return e.mode&1?ae&2&&ze!==0?ze&-ze:Yx.transition!==null?(rs===0&&(rs=up()),rs):(e=ue,e!==0||(e=window.event,e=e===void 0?16:gp(e.type)),e):1}function $t(e,t,n,r){if(50<Eo)throw Eo=0,iu=null,Error(J(185));oi(e,n,r),(!(ae&2)||e!==be)&&(e===be&&(!(ae&2)&&(sl|=n),je===4&&hn(e,ze)),Je(e,r),n===1&&ae===0&&!(t.mode&1)&&(Rr=Ne()+500,nl&&$n()))}function Je(e,t){var n=e.callbackNode;Yv(e,t);var r=ms(e,e===be?ze:0);if(r===0)n!==null&&ad(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ad(n),t===1)e.tag===0?Ux(ef.bind(null,e)):Lp(ef.bind(null,e)),Hx(function(){!(ae&6)&&$n()}),n=null;else{switch(cp(r)){case 1:n=Du;break;case 4:n=lp;break;case 16:n=ps;break;case 536870912:n=ap;break;default:n=ps}n=Tm(n,Cm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Cm(e,t){if(ns=-1,rs=0,ae&6)throw Error(J(327));var n=e.callbackNode;if(Mr()&&e.callbackNode!==n)return null;var r=ms(e,e===be?ze:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ts(e,r);else{t=r;var o=ae;ae|=2;var i=Mm();(be!==e||ze!==t)&&(Wt=null,Rr=Ne()+500,On(e,t));do try{fw();break}catch(l){jm(e,l)}while(!0);qu(),bs.current=i,ae=o,Ee!==null?t=0:(be=null,ze=0,t=je)}if(t!==0){if(t===2&&(o=Ia(e),o!==0&&(r=o,t=su(e,o))),t===1)throw n=Wo,On(e,0),hn(e,r),Je(e,Ne()),n;if(t===6)hn(e,r);else{if(o=e.current.alternate,!(r&30)&&!cw(o)&&(t=Ts(e,r),t===2&&(i=Ia(e),i!==0&&(r=i,t=su(e,i))),t===1))throw n=Wo,On(e,0),hn(e,r),Je(e,Ne()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Pn(e,Xe,Wt);break;case 3:if(hn(e,r),(r&130023424)===r&&(t=fc+500-Ne(),10<t)){if(ms(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){We(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Fa(Pn.bind(null,e,Xe,Wt),t);break}Pn(e,Xe,Wt);break;case 4:if(hn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Mt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uw(r/1960))-r,10<r){e.timeoutHandle=Fa(Pn.bind(null,e,Xe,Wt),r);break}Pn(e,Xe,Wt);break;case 5:Pn(e,Xe,Wt);break;default:throw Error(J(329))}}}return Je(e,Ne()),e.callbackNode===n?Cm.bind(null,e):null}function su(e,t){var n=No;return e.current.memoizedState.isDehydrated&&(On(e,t).flags|=256),e=Ts(e,t),e!==2&&(t=Xe,Xe=n,t!==null&&lu(t)),e}function lu(e){Xe===null?Xe=e:Xe.push.apply(Xe,e)}function cw(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 o=n[r],i=o.getSnapshot;o=o.value;try{if(!bt(i(),o))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 hn(e,t){for(t&=~dc,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mt(t),r=1<<n;e[n]=-1,t&=~r}}function ef(e){if(ae&6)throw Error(J(327));Mr();var t=ms(e,0);if(!(t&1))return Je(e,Ne()),null;var n=Ts(e,t);if(e.tag!==0&&n===2){var r=Ia(e);r!==0&&(t=r,n=su(e,r))}if(n===1)throw n=Wo,On(e,0),hn(e,t),Je(e,Ne()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pn(e,Xe,Wt),Je(e,Ne()),null}function hc(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Rr=Ne()+500,nl&&$n())}}function Qn(e){gn!==null&&gn.tag===0&&!(ae&6)&&Mr();var t=ae;ae|=1;var n=mt.transition,r=ue;try{if(mt.transition=null,ue=1,e)return e()}finally{ue=r,mt.transition=n,ae=t,!(ae&6)&&$n()}}function pc(){nt=kr.current,he(kr)}function On(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Fx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(Ku(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ws();break;case 3:Lr(),he(qe),he(Fe),rc();break;case 5:nc(r);break;case 4:Lr();break;case 13:he(ye);break;case 19:he(ye);break;case 10:Zu(r.type._context);break;case 22:case 23:pc()}n=n.return}if(be=e,Ee=e=En(e.current,null),ze=nt=t,je=0,Wo=null,dc=sl=Gn=0,Xe=No=null,zn!==null){for(t=0;t<zn.length;t++)if(n=zn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}zn=null}return e}function jm(e,t){do{var n=Ee;try{if(qu(),Ji.current=$s,Ms){for(var r=ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ms=!1}if(Kn=0,$e=Ce=ve=null,ko=!1,Ho=0,cc.current=null,n===null||n.return===null){je=1,Wo=t,Ee=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=ze,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Hd(s);if(p!==null){p.flags&=-257,Bd(p,s,l,i,t),p.mode&1&&Fd(i,u,t),t=p,a=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(a),t.updateQueue=x}else y.add(a);break e}else{if(!(t&1)){Fd(i,u,t),mc();break e}a=Error(J(426))}}else if(ge&&l.mode&1){var w=Hd(s);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Bd(w,s,l,i,t),Gu(Ar(a,l));break e}}i=a=Ar(a,l),je!==4&&(je=2),No===null?No=[i]:No.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=cm(i,a,t);zd(i,m);break e;case 1:l=a;var v=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Sn===null||!Sn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=dm(i,l,t);zd(i,k);break e}}i=i.return}while(i!==null)}bm(n)}catch(C){t=C,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function Mm(){var e=bs.current;return bs.current=$s,e===null?$s:e}function mc(){(je===0||je===3||je===2)&&(je=4),be===null||!(Gn&268435455)&&!(sl&268435455)||hn(be,ze)}function Ts(e,t){var n=ae;ae|=2;var r=Mm();(be!==e||ze!==t)&&(Wt=null,On(e,t));do try{dw();break}catch(o){jm(e,o)}while(!0);if(qu(),ae=n,bs.current=r,Ee!==null)throw Error(J(261));return be=null,ze=0,je}function dw(){for(;Ee!==null;)$m(Ee)}function fw(){for(;Ee!==null&&!Rv();)$m(Ee)}function $m(e){var t=Im(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?bm(e):Ee=t,cc.current=null}function bm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=iw(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Ee=null;return}}else if(n=ow(n,t,nt),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);je===0&&(je=5)}function Pn(e,t,n){var r=ue,o=mt.transition;try{mt.transition=null,ue=1,hw(e,t,n,r)}finally{mt.transition=o,ue=r}return null}function hw(e,t,n,r){do Mr();while(gn!==null);if(ae&6)throw Error(J(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Xv(e,i),e===be&&(Ee=be=null,ze=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zi||(zi=!0,Tm(ps,function(){return Mr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=mt.transition,mt.transition=null;var s=ue;ue=1;var l=ae;ae|=4,cc.current=null,lw(e,n),Em(n,e),Tx(Da),gs=!!Ra,Da=Ra=null,e.current=n,aw(n),Dv(),ae=l,ue=s,mt.transition=i}else e.current=n;if(zi&&(zi=!1,gn=e,Is=o),i=e.pendingLanes,i===0&&(Sn=null),Hv(n.stateNode),Je(e,Ne()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ps)throw Ps=!1,e=ou,ou=null,e;return Is&1&&e.tag!==0&&Mr(),i=e.pendingLanes,i&1?e===iu?Eo++:(Eo=0,iu=e):Eo=0,$n(),null}function Mr(){if(gn!==null){var e=cp(Is),t=mt.transition,n=ue;try{if(mt.transition=null,ue=16>e?16:e,gn===null)var r=!1;else{if(e=gn,gn=null,Is=0,ae&6)throw Error(J(331));var o=ae;for(ae|=4,ne=e.current;ne!==null;){var i=ne,s=i.child;if(ne.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(ne=u;ne!==null;){var c=ne;switch(c.tag){case 0:case 11:case 15:So(8,c,i)}var d=c.child;if(d!==null)d.return=c,ne=d;else for(;ne!==null;){c=ne;var f=c.sibling,p=c.return;if(km(c),c===u){ne=null;break}if(f!==null){f.return=p,ne=f;break}ne=p}}}var y=i.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}ne=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ne=s;else e:for(;ne!==null;){if(i=ne,i.flags&2048)switch(i.tag){case 0:case 11:case 15:So(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,ne=m;break e}ne=i.return}}var v=e.current;for(ne=v;ne!==null;){s=ne;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,ne=g;else e:for(s=v;ne!==null;){if(l=ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:il(9,l)}}catch(C){Se(l,l.return,C)}if(l===s){ne=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,ne=k;break e}ne=l.return}}if(ae=o,$n(),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(qs,e)}catch{}r=!0}return r}finally{ue=n,mt.transition=t}}return!1}function tf(e,t,n){t=Ar(n,t),t=cm(e,t,1),e=kn(e,t,1),t=We(),e!==null&&(oi(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)tf(e,e,n);else for(;t!==null;){if(t.tag===3){tf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sn===null||!Sn.has(r))){e=Ar(n,e),e=dm(t,e,1),t=kn(t,e,1),e=We(),t!==null&&(oi(t,1,e),Je(t,e));break}}t=t.return}}function pw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=We(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(ze&n)===n&&(je===4||je===3&&(ze&130023424)===ze&&500>Ne()-fc?On(e,0):dc|=n),Je(e,t)}function Pm(e,t){t===0&&(e.mode&1?(t=Ei,Ei<<=1,!(Ei&130023424)&&(Ei=4194304)):t=1);var n=We();e=Jt(e,t),e!==null&&(oi(e,t,n),Je(e,n))}function mw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pm(e,n)}function gw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),Pm(e,n)}var Im;Im=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qe.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,rw(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,ge&&t.flags&1048576&&Ap(t,Ns,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ts(e,t),e=t.pendingProps;var o=Ir(t,Fe.current);jr(t,n),o=ic(null,t,r,e,o,n);var i=sc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(r)?(i=!0,ks(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ec(t),o.updater=ol,t.stateNode=o,o._reactInternals=t,Xa(t,r,e,n),t=Qa(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&Xu(t),Ve(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ts(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=vw(r),e=xt(r,e),o){case 0:t=Ga(null,t,r,e,n);break e;case 1:t=Ud(null,t,r,e,n);break e;case 11:t=Vd(null,t,r,e,n);break e;case 14:t=Wd(null,t,r,xt(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Ga(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Ud(e,t,r,o,n);case 3:e:{if(mm(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Bp(e,t),Cs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ar(Error(J(423)),t),t=Yd(e,t,r,n,o);break e}else if(r!==o){o=Ar(Error(J(424)),t),t=Yd(e,t,r,n,o);break e}else for(ot=wn(t.stateNode.containerInfo.firstChild),it=t,ge=!0,Nt=null,n=Fp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===o){t=en(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return Vp(t),e===null&&Wa(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Oa(r,o)?s=null:i!==null&&Oa(r,i)&&(t.flags|=32),pm(e,t),Ve(e,t,s,n),t.child;case 6:return e===null&&Wa(t),null;case 13:return gm(e,t,n);case 4:return tc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zr(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Vd(e,t,r,o,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,o=t.pendingProps,i=t.memoizedProps,s=o.value,ce(Es,r._currentValue),r._currentValue=s,i!==null)if(bt(i.value,s)){if(i.children===o.children&&!qe.current){t=en(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Gt(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Ua(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(J(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ua(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ve(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,jr(t,n),o=gt(o),r=r(o),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,o=xt(r,t.pendingProps),o=xt(r.type,o),Wd(e,t,r,o,n);case 15:return fm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),ts(e,t),t.tag=1,Ze(r)?(e=!0,ks(t)):e=!1,jr(t,n),um(t,r,o),Xa(t,r,o,n),Qa(null,t,r,!0,e,n);case 19:return ym(e,t,n);case 22:return hm(e,t,n)}throw Error(J(156,t.tag))};function Tm(e,t){return sp(e,t)}function yw(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 pt(e,t,n,r){return new yw(e,t,n,r)}function gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vw(e){if(typeof e=="function")return gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Lu)return 11;if(e===Au)return 14}return 2}function En(e,t){var n=e.alternate;return n===null?(n=pt(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 os(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")gc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case dr:return Fn(n.children,o,i,t);case zu:s=8,o|=8;break;case ya:return e=pt(12,n,t,o|2),e.elementType=ya,e.lanes=i,e;case va:return e=pt(13,n,t,o),e.elementType=va,e.lanes=i,e;case xa:return e=pt(19,n,t,o),e.elementType=xa,e.lanes=i,e;case Vh:return ll(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hh:s=10;break e;case Bh:s=9;break e;case Lu:s=11;break e;case Au:s=14;break e;case an:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=pt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fn(e,t,n,r){return e=pt(7,e,r,t),e.lanes=n,e}function ll(e,t,n,r){return e=pt(22,e,r,t),e.elementType=Vh,e.lanes=n,e.stateNode={isHidden:!1},e}function na(e,t,n){return e=pt(6,e,null,t),e.lanes=n,e}function ra(e,t,n){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xw(e,t,n,r,o){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=Rl(0),this.expirationTimes=Rl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yc(e,t,n,r,o,i,s,l,a){return e=new xw(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=pt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ec(i),e}function ww(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:cr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function zm(e){if(!e)return Cn;e=e._reactInternals;e:{if(rr(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Ze(n))return zp(e,n,t)}return t}function Lm(e,t,n,r,o,i,s,l,a){return e=yc(n,r,!0,e,o,i,s,l,a),e.context=zm(null),n=e.current,r=We(),o=Nn(n),i=Gt(r,o),i.callback=t??null,kn(n,i,o),e.current.lanes=o,oi(e,o,r),Je(e,r),e}function al(e,t,n,r){var o=t.current,i=We(),s=Nn(o);return n=zm(n),t.context===null?t.context=n:t.pendingContext=n,t=Gt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=kn(o,t,s),e!==null&&($t(e,o,s,i),Zi(e,o,s)),s}function zs(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 nf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vc(e,t){nf(e,t),(e=e.alternate)&&nf(e,t)}function kw(){return null}var Am=typeof reportError=="function"?reportError:function(e){console.error(e)};function xc(e){this._internalRoot=e}ul.prototype.render=xc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));al(e,t,null,null)};ul.prototype.unmount=xc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qn(function(){al(null,e,null,null)}),t[Zt]=null}};function ul(e){this._internalRoot=e}ul.prototype.unstable_scheduleHydration=function(e){if(e){var t=hp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fn.length&&t!==0&&t<fn[n].priority;n++);fn.splice(n,0,e),n===0&&mp(e)}};function wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function rf(){}function Sw(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=zs(s);i.call(u)}}var s=Lm(t,r,e,0,null,!1,!1,"",rf);return e._reactRootContainer=s,e[Zt]=s.current,Ao(e.nodeType===8?e.parentNode:e),Qn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=zs(a);l.call(u)}}var a=yc(e,0,!1,null,null,!1,!1,"",rf);return e._reactRootContainer=a,e[Zt]=a.current,Ao(e.nodeType===8?e.parentNode:e),Qn(function(){al(t,a,n,r)}),a}function dl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=zs(s);l.call(a)}}al(t,s,e,o)}else s=Sw(n,t,e,o,r);return zs(s)}dp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=co(t.pendingLanes);n!==0&&(Ou(t,n|1),Je(t,Ne()),!(ae&6)&&(Rr=Ne()+500,$n()))}break;case 13:Qn(function(){var r=Jt(e,1);if(r!==null){var o=We();$t(r,e,1,o)}}),vc(e,1)}};Fu=function(e){if(e.tag===13){var t=Jt(e,134217728);if(t!==null){var n=We();$t(t,e,134217728,n)}vc(e,134217728)}};fp=function(e){if(e.tag===13){var t=Nn(e),n=Jt(e,t);if(n!==null){var r=We();$t(n,e,t,r)}vc(e,t)}};hp=function(){return ue};pp=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};$a=function(e,t,n){switch(t){case"input":if(Sa(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 o=tl(r);if(!o)throw Error(J(90));Uh(r),Sa(r,o)}}}break;case"textarea":Xh(e,n);break;case"select":t=n.value,t!=null&&Nr(e,!!n.multiple,t,!1)}};ep=hc;tp=Qn;var Nw={usingClientEntryPoint:!1,Events:[si,mr,tl,Zh,Jh,hc]},io={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ew={bundleType:io.bundleType,version:io.version,rendererPackageName:io.rendererPackageName,rendererConfig:io.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=op(e),e===null?null:e.stateNode},findFiberByHostInstance:io.findFiberByHostInstance||kw,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 Li=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Li.isDisabled&&Li.supportsFiber)try{qs=Li.inject(Ew),Ot=Li}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nw;at.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wc(t))throw Error(J(200));return ww(e,t,null,n)};at.createRoot=function(e,t){if(!wc(e))throw Error(J(299));var n=!1,r="",o=Am;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=yc(e,1,!1,null,null,n,!1,r,o),e[Zt]=t.current,Ao(e.nodeType===8?e.parentNode:e),new xc(t)};at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=op(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return Qn(e)};at.hydrate=function(e,t,n){if(!cl(t))throw Error(J(200));return dl(null,e,t,!0,n)};at.hydrateRoot=function(e,t,n){if(!wc(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Am;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Lm(t,null,e,1,n??null,o,!1,i,s),e[Zt]=t.current,Ao(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ul(t)};at.render=function(e,t,n){if(!cl(t))throw Error(J(200));return dl(null,e,t,!1,n)};at.unmountComponentAtNode=function(e){if(!cl(e))throw Error(J(40));return e._reactRootContainer?(Qn(function(){dl(null,null,e,!1,function(){e._reactRootContainer=null,e[Zt]=null})}),!0):!1};at.unstable_batchedUpdates=hc;at.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cl(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return dl(e,t,n,!1,r)};at.version="18.3.1-next-f1338f8080-20240426";function Rm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rm)}catch(e){console.error(e)}}Rm(),Rh.exports=at;var Dm=Rh.exports,Om,of=Dm;Om=of.createRoot,of.hydrateRoot;function _e(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=_e(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var _w={value:()=>{}};function fl(){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 is(n)}function is(e){this._=e}function Cw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}is.prototype=fl.prototype={constructor:is,on:function(e,t){var n=this._,r=Cw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=jw(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=sf(n[o],e.name,t);else if(t==null)for(o in n)n[o]=sf(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new is(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[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],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function jw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function sf(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=_w,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var au="http://www.w3.org/1999/xhtml";const lf={svg:"http://www.w3.org/2000/svg",xhtml:au,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lf.hasOwnProperty(t)?{space:lf[t],local:e}:e}function Mw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===au&&t.documentElement.namespaceURI===au?t.createElement(e):t.createElementNS(n,e)}}function $w(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fm(e){var t=hl(e);return(t.local?$w:Mw)(t)}function bw(){}function kc(e){return e==null?bw:function(){return this.querySelector(e)}}function Pw(e){typeof e!="function"&&(e=kc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new lt(r,this._parents)}function Iw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tw(){return[]}function Hm(e){return e==null?Tw:function(){return this.querySelectorAll(e)}}function zw(e){return function(){return Iw(e.apply(this,arguments))}}function Lw(e){typeof e=="function"?e=zw(e):e=Hm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new lt(r,o)}function Bm(e){return function(){return this.matches(e)}}function Vm(e){return function(t){return t.matches(e)}}var Aw=Array.prototype.find;function Rw(e){return function(){return Aw.call(this.children,e)}}function Dw(){return this.firstElementChild}function Ow(e){return this.select(e==null?Dw:Rw(typeof e=="function"?e:Vm(e)))}var Fw=Array.prototype.filter;function Hw(){return Array.from(this.children)}function Bw(e){return function(){return Fw.call(this.children,e)}}function Vw(e){return this.selectAll(e==null?Hw:Bw(typeof e=="function"?e:Vm(e)))}function Ww(e){typeof e!="function"&&(e=Bm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new lt(r,this._parents)}function Wm(e){return new Array(e.length)}function Uw(){return new lt(this._enter||this._groups.map(Wm),this._parents)}function Ls(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ls.prototype={constructor:Ls,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 Yw(e){return function(){return e}}function Xw(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Ls(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Kw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(f[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<d;++l)p=s.call(e,i[l],l,i)+"",(a=u.get(p))?(r[l]=a,a.__data__=i[l],u.delete(p)):n[l]=new Ls(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function Gw(e){return e.__data__}function Qw(e,t){if(!arguments.length)return Array.from(this,Gw);var n=t?Kw:Xw,r=this._parents,o=this._groups;typeof e!="function"&&(e=Yw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,p=qw(e.call(c,c&&c.__data__,u,r)),y=p.length,x=l[u]=new Array(y),w=s[u]=new Array(y),m=a[u]=new Array(f);n(c,d,x,w,m,p,t);for(var v=0,g=0,k,C;v<y;++v)if(k=x[v]){for(v>=g&&(g=v+1);!(C=w[g])&&++g<y;);k._next=C||null}}return s=new lt(s,r),s._enter=l,s._exit=a,s}function qw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zw(){return new lt(this._exit||this._groups.map(Wm),this._parents)}function Jw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function e1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),p,y=0;y<d;++y)(p=u[y]||c[y])&&(f[y]=p);for(;a<o;++a)l[a]=n[a];return new lt(l,this._parents)}function t1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function n1(e){e||(e=r1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new lt(o,this._parents).order()}function r1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function o1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function i1(){return Array.from(this)}function s1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function l1(){let e=0;for(const t of this)++e;return e}function a1(){return!this.node()}function u1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function c1(e){return function(){this.removeAttribute(e)}}function d1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function f1(e,t){return function(){this.setAttribute(e,t)}}function h1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function p1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function m1(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 g1(e,t){var n=hl(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?d1:c1:typeof t=="function"?n.local?m1:p1:n.local?h1:f1)(n,t))}function Um(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function y1(e){return function(){this.style.removeProperty(e)}}function v1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function x1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function w1(e,t,n){return arguments.length>1?this.each((t==null?y1:typeof t=="function"?x1:v1)(e,t,n??"")):Dr(this.node(),e)}function Dr(e,t){return e.style.getPropertyValue(t)||Um(e).getComputedStyle(e,null).getPropertyValue(t)}function k1(e){return function(){delete this[e]}}function S1(e,t){return function(){this[e]=t}}function N1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function E1(e,t){return arguments.length>1?this.each((t==null?k1:typeof t=="function"?N1:S1)(e,t)):this.node()[e]}function Ym(e){return e.trim().split(/^|\s+/)}function Sc(e){return e.classList||new Xm(e)}function Xm(e){this._node=e,this._names=Ym(e.getAttribute("class")||"")}Xm.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 Km(e,t){for(var n=Sc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Gm(e,t){for(var n=Sc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function _1(e){return function(){Km(this,e)}}function C1(e){return function(){Gm(this,e)}}function j1(e,t){return function(){(t.apply(this,arguments)?Km:Gm)(this,e)}}function M1(e,t){var n=Ym(e+"");if(arguments.length<2){for(var r=Sc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?j1:t?_1:C1)(n,t))}function $1(){this.textContent=""}function b1(e){return function(){this.textContent=e}}function P1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function I1(e){return arguments.length?this.each(e==null?$1:(typeof e=="function"?P1:b1)(e)):this.node().textContent}function T1(){this.innerHTML=""}function z1(e){return function(){this.innerHTML=e}}function L1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function A1(e){return arguments.length?this.each(e==null?T1:(typeof e=="function"?L1:z1)(e)):this.node().innerHTML}function R1(){this.nextSibling&&this.parentNode.appendChild(this)}function D1(){return this.each(R1)}function O1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F1(){return this.each(O1)}function H1(e){var t=typeof e=="function"?e:Fm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function B1(){return null}function V1(e,t){var n=typeof e=="function"?e:Fm(e),r=t==null?B1:typeof t=="function"?t:kc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function W1(){var e=this.parentNode;e&&e.removeChild(this)}function U1(){return this.each(W1)}function Y1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K1(e){return this.select(e?X1:Y1)}function G1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Q1(e){return function(t){e.call(this,t,this.__data__)}}function q1(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 Z1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function J1(e,t,n){return function(){var r=this.__on,o,i=Q1(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function ek(e,t,n){var r=q1(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?J1:Z1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Qm(e,t,n){var r=Um(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function tk(e,t){return function(){return Qm(this,e,t)}}function nk(e,t){return function(){return Qm(this,e,t.apply(this,arguments))}}function rk(e,t){return this.each((typeof t=="function"?nk:tk)(e,t))}function*ok(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var qm=[null];function lt(e,t){this._groups=e,this._parents=t}function ai(){return new lt([[document.documentElement]],qm)}function ik(){return this}lt.prototype=ai.prototype={constructor:lt,select:Pw,selectAll:Lw,selectChild:Ow,selectChildren:Vw,filter:Ww,data:Qw,enter:Uw,exit:Zw,join:Jw,merge:e1,selection:ik,order:t1,sort:n1,call:o1,nodes:i1,node:s1,size:l1,empty:a1,each:u1,attr:g1,style:w1,property:E1,classed:M1,text:I1,html:A1,raise:D1,lower:F1,append:H1,insert:V1,remove:U1,clone:K1,datum:G1,on:ek,dispatch:rk,[Symbol.iterator]:ok};function rt(e){return typeof e=="string"?new lt([[document.querySelector(e)]],[document.documentElement]):new lt([[e]],qm)}function sk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function kt(e,t){if(e=sk(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const lk={passive:!1},Uo={capture:!0,passive:!1};function oa(e){e.stopImmediatePropagation()}function $r(e){e.preventDefault(),e.stopImmediatePropagation()}function Zm(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",$r,Uo);"onselectstart"in t?n.on("selectstart.drag",$r,Uo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Jm(e,t){var n=e.document.documentElement,r=rt(e).on("dragstart.drag",null);t&&(r.on("click.drag",$r,Uo),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 Ai=e=>()=>e;function uu(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}uu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ak(e){return!e.ctrlKey&&!e.button}function uk(){return this.parentNode}function ck(e,t){return t??{x:e.x,y:e.y}}function dk(){return navigator.maxTouchPoints||"ontouchstart"in this}function eg(){var e=ak,t=uk,n=ck,r=dk,o={},i=fl("start","drag","end"),s=0,l,a,u,c,d=0;function f(k){k.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",m,lk).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(k,C){if(!(c||!e.call(this,k,C))){var S=g(this,t.call(this,k,C),k,C,"mouse");S&&(rt(k.view).on("mousemove.drag",y,Uo).on("mouseup.drag",x,Uo),Zm(k.view),oa(k),u=!1,l=k.clientX,a=k.clientY,S("start",k))}}function y(k){if($r(k),!u){var C=k.clientX-l,S=k.clientY-a;u=C*C+S*S>d}o.mouse("drag",k)}function x(k){rt(k.view).on("mousemove.drag mouseup.drag",null),Jm(k.view,u),$r(k),o.mouse("end",k)}function w(k,C){if(e.call(this,k,C)){var S=k.changedTouches,_=t.call(this,k,C),j=S.length,b,F;for(b=0;b<j;++b)(F=g(this,_,k,C,S[b].identifier,S[b]))&&(oa(k),F("start",k,S[b]))}}function m(k){var C=k.changedTouches,S=C.length,_,j;for(_=0;_<S;++_)(j=o[C[_].identifier])&&($r(k),j("drag",k,C[_]))}function v(k){var C=k.changedTouches,S=C.length,_,j;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),_=0;_<S;++_)(j=o[C[_].identifier])&&(oa(k),j("end",k,C[_]))}function g(k,C,S,_,j,b){var F=i.copy(),L=kt(b||S,C),U,B,N;if((N=n.call(k,new uu("beforestart",{sourceEvent:S,target:f,identifier:j,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:F}),_))!=null)return U=N.x-L[0]||0,B=N.y-L[1]||0,function T(z,O,$){var M=L,A;switch(z){case"start":o[j]=T,A=s++;break;case"end":delete o[j],--s;case"drag":L=kt($||O,C),A=s;break}F.call(z,k,new uu(z,{sourceEvent:O,subject:N,target:f,identifier:j,active:A,x:L[0]+U,y:L[1]+B,dx:L[0]-M[0],dy:L[1]-M[1],dispatch:F}),_)}}return f.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Ai(!!k),f):e},f.container=function(k){return arguments.length?(t=typeof k=="function"?k:Ai(k),f):t},f.subject=function(k){return arguments.length?(n=typeof k=="function"?k:Ai(k),f):n},f.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:Ai(!!k),f):r},f.on=function(){var k=i.on.apply(i,arguments);return k===i?f:k},f.clickDistance=function(k){return arguments.length?(d=(k=+k)*k,f):Math.sqrt(d)},f}function Nc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ui(){}var Yo=.7,As=1/Yo,br="\\s*([+-]?\\d+)\\s*",Xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fk=/^#([0-9a-f]{3,8})$/,hk=new RegExp(`^rgb\\(${br},${br},${br}\\)$`),pk=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),mk=new RegExp(`^rgba\\(${br},${br},${br},${Xo}\\)$`),gk=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${Xo}\\)$`),yk=new RegExp(`^hsl\\(${Xo},${Ht},${Ht}\\)$`),vk=new RegExp(`^hsla\\(${Xo},${Ht},${Ht},${Xo}\\)$`),af={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};Nc(ui,qn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:uf,formatHex:uf,formatHex8:xk,formatHsl:wk,formatRgb:cf,toString:cf});function uf(){return this.rgb().formatHex()}function xk(){return this.rgb().formatHex8()}function wk(){return ng(this).formatHsl()}function cf(){return this.rgb().formatRgb()}function qn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fk.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?df(t):n===3?new Qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ri(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ri(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=hk.exec(e))?new Qe(t[1],t[2],t[3],1):(t=pk.exec(e))?new Qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mk.exec(e))?Ri(t[1],t[2],t[3],t[4]):(t=gk.exec(e))?Ri(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yk.exec(e))?pf(t[1],t[2]/100,t[3]/100,1):(t=vk.exec(e))?pf(t[1],t[2]/100,t[3]/100,t[4]):af.hasOwnProperty(e)?df(af[e]):e==="transparent"?new Qe(NaN,NaN,NaN,0):null}function df(e){return new Qe(e>>16&255,e>>8&255,e&255,1)}function Ri(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qe(e,t,n,r)}function kk(e){return e instanceof ui||(e=qn(e)),e?(e=e.rgb(),new Qe(e.r,e.g,e.b,e.opacity)):new Qe}function cu(e,t,n,r){return arguments.length===1?kk(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}Nc(Qe,cu,tg(ui,{brighter(e){return e=e==null?As:Math.pow(As,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qe(Hn(this.r),Hn(this.g),Hn(this.b),Rs(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:ff,formatHex:ff,formatHex8:Sk,formatRgb:hf,toString:hf}));function ff(){return`#${An(this.r)}${An(this.g)}${An(this.b)}`}function Sk(){return`#${An(this.r)}${An(this.g)}${An(this.b)}${An((isNaN(this.opacity)?1:this.opacity)*255)}`}function hf(){const e=Rs(this.opacity);return`${e===1?"rgb(":"rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e===1?")":`, ${e})`}`}function Rs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function An(e){return e=Hn(e),(e<16?"0":"")+e.toString(16)}function pf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function ng(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof ui||(e=qn(e)),!e)return new Et;if(e instanceof Et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Et(s,l,a,e.opacity)}function Nk(e,t,n,r){return arguments.length===1?ng(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Nc(Et,Nk,tg(ui,{brighter(e){return e=e==null?As:Math.pow(As,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Et(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,o=2*n-r;return new Qe(ia(e>=240?e-240:e+120,o,r),ia(e,o,r),ia(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Et(mf(this.h),Di(this.s),Di(this.l),Rs(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=Rs(this.opacity);return`${e===1?"hsl(":"hsla("}${mf(this.h)}, ${Di(this.s)*100}%, ${Di(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mf(e){return e=(e||0)%360,e<0?e+360:e}function Di(e){return Math.max(0,Math.min(1,e||0))}function ia(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 Ec=e=>()=>e;function Ek(e,t){return function(n){return e+n*t}}function _k(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 Ck(e){return(e=+e)==1?rg:function(t,n){return n-t?_k(t,n,e):Ec(isNaN(t)?n:t)}}function rg(e,t){var n=t-e;return n?Ek(e,n):Ec(isNaN(e)?t:e)}const Ds=function e(t){var n=Ck(t);function r(o,i){var s=n((o=cu(o)).r,(i=cu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=rg(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function jk(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function Mk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $k(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=_o(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function bk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function At(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pk(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=_o(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var du=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sa=new RegExp(du.source,"g");function Ik(e){return function(){return e}}function Tk(e){return function(t){return e(t)+""}}function og(e,t){var n=du.lastIndex=sa.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=du.exec(e))&&(o=sa.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:At(r,o)})),n=sa.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?Tk(a[0].x):Ik(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function _o(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ec(t):(n==="number"?At:n==="string"?(r=qn(t))?(t=r,Ds):og:t instanceof qn?Ds:t instanceof Date?bk:Mk(t)?jk:Array.isArray(t)?$k:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Pk:At)(e,t)}var gf=180/Math.PI,fu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ig(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*gf,skewX:Math.atan(a)*gf,scaleX:s,scaleY:l}}var Oi;function zk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fu:ig(t.a,t.b,t.c,t.d,t.e,t.f)}function Lk(e){return e==null||(Oi||(Oi=document.createElementNS("http://www.w3.org/2000/svg","g")),Oi.setAttribute("transform",e),!(e=Oi.transform.baseVal.consolidate()))?fu:(e=e.matrix,ig(e.a,e.b,e.c,e.d,e.e,e.f))}function sg(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,p,y){if(u!==d||c!==f){var x=p.push("translate(",null,t,null,n);y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:At(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:At(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,p,y){if(u!==d||c!==f){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,f)})}else(d!==1||f!==1)&&p.push(o(p)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(p){for(var y=-1,x=f.length,w;++y<x;)d[(w=f[y]).i]=w.x(p);return d.join("")}}}var Ak=sg(zk,"px, ","px)","deg)"),Rk=sg(Lk,", ",")",")"),Dk=1e-12;function yf(e){return((e=Math.exp(e))+1/e)/2}function Ok(e){return((e=Math.exp(e))-1/e)/2}function Fk(e){return((e=Math.exp(2*e))-1)/(e+1)}const ss=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],p=c-l,y=d-a,x=p*p+y*y,w,m;if(x<Dk)m=Math.log(f/u)/t,w=function(_){return[l+_*p,a+_*y,u*Math.exp(t*_*m)]};else{var v=Math.sqrt(x),g=(f*f-u*u+r*x)/(2*u*n*v),k=(f*f-u*u-r*x)/(2*f*n*v),C=Math.log(Math.sqrt(g*g+1)-g),S=Math.log(Math.sqrt(k*k+1)-k);m=(S-C)/t,w=function(_){var j=_*m,b=yf(C),F=u/(n*v)*(b*Fk(t*j+C)-Ok(C));return[l+F*p,a+F*y,u*b/yf(t*j+C)]}}return w.duration=m*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Or=0,ho=0,so=0,lg=1e3,Os,po,Fs=0,Zn=0,pl=0,Ko=typeof performance=="object"&&performance.now?performance:Date,ag=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _c(){return Zn||(ag(Hk),Zn=Ko.now()+pl)}function Hk(){Zn=0}function Hs(){this._call=this._time=this._next=null}Hs.prototype=ug.prototype={constructor:Hs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_c():+n)+(t==null?0:+t),!this._next&&po!==this&&(po?po._next=this:Os=this,po=this),this._call=e,this._time=n,hu()},stop:function(){this._call&&(this._call=null,this._time=1/0,hu())}};function ug(e,t,n){var r=new Hs;return r.restart(e,t,n),r}function Bk(){_c(),++Or;for(var e=Os,t;e;)(t=Zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Or}function vf(){Zn=(Fs=Ko.now())+pl,Or=ho=0;try{Bk()}finally{Or=0,Wk(),Zn=0}}function Vk(){var e=Ko.now(),t=e-Fs;t>lg&&(pl-=t,Fs=e)}function Wk(){for(var e,t=Os,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:Os=n);po=e,hu(r)}function hu(e){if(!Or){ho&&(ho=clearTimeout(ho));var t=e-Zn;t>24?(e<1/0&&(ho=setTimeout(vf,e-Ko.now()-pl)),so&&(so=clearInterval(so))):(so||(Fs=Ko.now(),so=setInterval(Vk,lg)),Or=1,ag(vf))}}function xf(e,t,n){var r=new Hs;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Uk=fl("start","end","cancel","interrupt"),Yk=[],cg=0,wf=1,pu=2,ls=3,kf=4,mu=5,as=6;function ml(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Xk(e,n,{name:t,index:r,group:o,on:Uk,tween:Yk,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:cg})}function Cc(e,t){var n=It(e,t);if(n.state>cg)throw new Error("too late; already scheduled");return n}function Bt(e,t){var n=It(e,t);if(n.state>ls)throw new Error("too late; already running");return n}function It(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Xk(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=ug(i,0,n.time);function i(u){n.state=wf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,p;if(n.state!==wf)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ls)return xf(s);p.state===kf?(p.state=as,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=as,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(xf(function(){n.state===ls&&(n.state=kf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=pu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===pu){for(n.state=ls,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=p);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=mu,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===mu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=as,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function us(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>pu&&r.state<mu,r.state=as,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Kk(e){return this.each(function(){us(this,e)})}function Gk(e,t){var n,r;return function(){var o=Bt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Qk(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Bt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function qk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=It(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?Gk:Qk)(n,e,t))}function jc(e,t,n){var r=e._id;return e.each(function(){var o=Bt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return It(o,r).value[t]}}function dg(e,t){var n;return(typeof t=="number"?At:t instanceof qn?Ds:(n=qn(t))?(t=n,Ds):og)(e,t)}function Zk(e){return function(){this.removeAttribute(e)}}function Jk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function tS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function nS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function rS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function oS(e,t){var n=hl(e),r=n==="transform"?Rk:dg;return this.attrTween(e,typeof t=="function"?(n.local?rS:nS)(n,r,jc(this,"attr."+e,t)):t==null?(n.local?Jk:Zk)(n):(n.local?tS:eS)(n,r,t))}function iS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sS(e,i)),n}return o._value=t,o}function aS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&iS(e,i)),n}return o._value=t,o}function uS(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=hl(e);return this.tween(n,(r.local?lS:aS)(r,t))}function cS(e,t){return function(){Cc(this,e).delay=+t.apply(this,arguments)}}function dS(e,t){return t=+t,function(){Cc(this,e).delay=t}}function fS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cS:dS)(t,e)):It(this.node(),t).delay}function hS(e,t){return function(){Bt(this,e).duration=+t.apply(this,arguments)}}function pS(e,t){return t=+t,function(){Bt(this,e).duration=t}}function mS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hS:pS)(t,e)):It(this.node(),t).duration}function gS(e,t){if(typeof t!="function")throw new Error;return function(){Bt(this,e).ease=t}}function yS(e){var t=this._id;return arguments.length?this.each(gS(t,e)):It(this.node(),t).ease}function vS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Bt(this,e).ease=n}}function xS(e){if(typeof e!="function")throw new Error;return this.each(vS(this._id,e))}function wS(e){typeof e!="function"&&(e=Bm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new tn(r,this._parents,this._name,this._id)}function kS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,p=0;p<c;++p)(f=a[p]||u[p])&&(d[p]=f);for(;l<r;++l)s[l]=t[l];return new tn(s,this._parents,this._name,this._id)}function SS(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 NS(e,t,n){var r,o,i=SS(t)?Cc:Bt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function ES(e,t){var n=this._id;return arguments.length<2?It(this.node(),n).on.on(e):this.each(NS(n,e,t))}function _S(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CS(){return this.on("end.remove",_S(this._id))}function jS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,ml(u[f],t,n,f,u,It(c,n)));return new tn(i,this._parents,t,n)}function MS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),p,y=It(c,n),x=0,w=f.length;x<w;++x)(p=f[x])&&ml(p,t,n,x,f,y);i.push(f),s.push(c)}return new tn(i,s,t,n)}var $S=ai.prototype.constructor;function bS(){return new $S(this._groups,this._parents)}function PS(e,t){var n,r,o;return function(){var i=Dr(this,e),s=(this.style.removeProperty(e),Dr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function fg(e){return function(){this.style.removeProperty(e)}}function IS(e,t,n){var r,o=n+"",i;return function(){var s=Dr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function TS(e,t,n){var r,o,i;return function(){var s=Dr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Dr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function zS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Bt(this,e),u=a.on,c=a.value[i]==null?l||(l=fg(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function LS(e,t,n){var r=(e+="")=="transform"?Ak:dg;return t==null?this.styleTween(e,PS(e,r)).on("end.style."+e,fg(e)):typeof t=="function"?this.styleTween(e,TS(e,r,jc(this,"style."+e,t))).each(zS(this._id,e)):this.styleTween(e,IS(e,r,t),n).on("end.style."+e,null)}function AS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function RS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&AS(e,s,n)),r}return i._value=t,i}function DS(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,RS(e,t,n??""))}function OS(e){return function(){this.textContent=e}}function FS(e){return function(){var t=e(this);this.textContent=t??""}}function HS(e){return this.tween("text",typeof e=="function"?FS(jc(this,"text",e)):OS(e==null?"":e+""))}function BS(e){return function(t){this.textContent=e.call(this,t)}}function VS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&BS(o)),t}return r._value=e,r}function WS(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,VS(e))}function US(){for(var e=this._name,t=this._id,n=hg(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=It(a,t);ml(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tn(r,this._parents,e,n)}function YS(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Bt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var XS=0;function tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function hg(){return++XS}var Vt=ai.prototype;tn.prototype={constructor:tn,select:jS,selectAll:MS,selectChild:Vt.selectChild,selectChildren:Vt.selectChildren,filter:wS,merge:kS,selection:bS,transition:US,call:Vt.call,nodes:Vt.nodes,node:Vt.node,size:Vt.size,empty:Vt.empty,each:Vt.each,on:ES,attr:oS,attrTween:uS,style:LS,styleTween:DS,text:HS,textTween:WS,remove:CS,tween:qk,delay:fS,duration:mS,ease:yS,easeVarying:xS,end:YS,[Symbol.iterator]:Vt[Symbol.iterator]};function KS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var GS={time:null,delay:0,duration:250,ease:KS};function QS(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 qS(e){var t,n;e instanceof tn?(t=e._id,e=e._name):(t=hg(),(n=GS).time=_c(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&ml(a,e,t,u,s,n||QS(a,t));return new tn(r,this._parents,e,t)}ai.prototype.interrupt=Kk;ai.prototype.transition=qS;const Fi=e=>()=>e;function ZS(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function Kt(e,t,n){this.k=e,this.x=t,this.y=n}Kt.prototype={constructor:Kt,scale:function(e){return e===1?this:new Kt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kt(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 gl=new Kt(1,0,0);pg.prototype=Kt.prototype;function pg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gl;return e.__zoom}function la(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function JS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function eN(){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 Sf(){return this.__zoom||gl}function tN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nN(){return navigator.maxTouchPoints||"ontouchstart"in this}function rN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function mg(){var e=JS,t=eN,n=rN,r=tN,o=nN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=ss,u=fl("start","zoom","end"),c,d,f,p=500,y=150,x=0,w=10;function m(N){N.property("__zoom",Sf).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",b).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",L).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(N,T,z,O){var $=N.selection?N.selection():N;$.property("__zoom",Sf),N!==$?C(N,T,z,O):$.interrupt().each(function(){S(this,arguments).event(O).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},m.scaleBy=function(N,T,z,O){m.scaleTo(N,function(){var $=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return $*M},z,O)},m.scaleTo=function(N,T,z,O){m.transform(N,function(){var $=t.apply(this,arguments),M=this.__zoom,A=z==null?k($):typeof z=="function"?z.apply(this,arguments):z,I=M.invert(A),H=typeof T=="function"?T.apply(this,arguments):T;return n(g(v(M,H),A,I),$,s)},z,O)},m.translateBy=function(N,T,z,O){m.transform(N,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),s)},null,O)},m.translateTo=function(N,T,z,O,$){m.transform(N,function(){var M=t.apply(this,arguments),A=this.__zoom,I=O==null?k(M):typeof O=="function"?O.apply(this,arguments):O;return n(gl.translate(I[0],I[1]).scale(A.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof z=="function"?-z.apply(this,arguments):-z),M,s)},O,$)};function v(N,T){return T=Math.max(i[0],Math.min(i[1],T)),T===N.k?N:new Kt(T,N.x,N.y)}function g(N,T,z){var O=T[0]-z[0]*N.k,$=T[1]-z[1]*N.k;return O===N.x&&$===N.y?N:new Kt(N.k,O,$)}function k(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function C(N,T,z,O){N.on("start.zoom",function(){S(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(O).end()}).tween("zoom",function(){var $=this,M=arguments,A=S($,M).event(O),I=t.apply($,M),H=z==null?k(I):typeof z=="function"?z.apply($,M):z,ee=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),K=$.__zoom,Y=typeof T=="function"?T.apply($,M):T,V=a(K.invert(H).concat(ee/K.k),Y.invert(H).concat(ee/Y.k));return function(X){if(X===1)X=Y;else{var E=V(X),R=ee/E[2];X=new Kt(R,H[0]-E[0]*R,H[1]-E[1]*R)}A.zoom(null,X)}})}function S(N,T,z){return!z&&N.__zooming||new _(N,T)}function _(N,T){this.that=N,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,T),this.taps=0}_.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,T){return this.mouse&&N!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var T=rt(this.that).datum();u.call(N,this.that,new ZS(N,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),T)}};function j(N,...T){if(!e.apply(this,arguments))return;var z=S(this,T).event(N),O=this.__zoom,$=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,r.apply(this,arguments)))),M=kt(N);if(z.wheel)(z.mouse[0][0]!==M[0]||z.mouse[0][1]!==M[1])&&(z.mouse[1]=O.invert(z.mouse[0]=M)),clearTimeout(z.wheel);else{if(O.k===$)return;z.mouse=[M,O.invert(M)],us(this),z.start()}lo(N),z.wheel=setTimeout(A,y),z.zoom("mouse",n(g(v(O,$),z.mouse[0],z.mouse[1]),z.extent,s));function A(){z.wheel=null,z.end()}}function b(N,...T){if(f||!e.apply(this,arguments))return;var z=N.currentTarget,O=S(this,T,!0).event(N),$=rt(N.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",ee,!0),M=kt(N,z),A=N.clientX,I=N.clientY;Zm(N.view),la(N),O.mouse=[M,this.__zoom.invert(M)],us(this),O.start();function H(K){if(lo(K),!O.moved){var Y=K.clientX-A,V=K.clientY-I;O.moved=Y*Y+V*V>x}O.event(K).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=kt(K,z),O.mouse[1]),O.extent,s))}function ee(K){$.on("mousemove.zoom mouseup.zoom",null),Jm(K.view,O.moved),lo(K),O.event(K).end()}}function F(N,...T){if(e.apply(this,arguments)){var z=this.__zoom,O=kt(N.changedTouches?N.changedTouches[0]:N,this),$=z.invert(O),M=z.k*(N.shiftKey?.5:2),A=n(g(v(z,M),O,$),t.apply(this,T),s);lo(N),l>0?rt(this).transition().duration(l).call(C,A,O,N):rt(this).call(m.transform,A,O,N)}}function L(N,...T){if(e.apply(this,arguments)){var z=N.touches,O=z.length,$=S(this,T,N.changedTouches.length===O).event(N),M,A,I,H;for(la(N),A=0;A<O;++A)I=z[A],H=kt(I,this),H=[H,this.__zoom.invert(H),I.identifier],$.touch0?!$.touch1&&$.touch0[2]!==H[2]&&($.touch1=H,$.taps=0):($.touch0=H,M=!0,$.taps=1+!!c);c&&(c=clearTimeout(c)),M&&($.taps<2&&(d=H[0],c=setTimeout(function(){c=null},p)),us(this),$.start())}}function U(N,...T){if(this.__zooming){var z=S(this,T).event(N),O=N.changedTouches,$=O.length,M,A,I,H;for(lo(N),M=0;M<$;++M)A=O[M],I=kt(A,this),z.touch0&&z.touch0[2]===A.identifier?z.touch0[0]=I:z.touch1&&z.touch1[2]===A.identifier&&(z.touch1[0]=I);if(A=z.that.__zoom,z.touch1){var ee=z.touch0[0],K=z.touch0[1],Y=z.touch1[0],V=z.touch1[1],X=(X=Y[0]-ee[0])*X+(X=Y[1]-ee[1])*X,E=(E=V[0]-K[0])*E+(E=V[1]-K[1])*E;A=v(A,Math.sqrt(X/E)),I=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],H=[(K[0]+V[0])/2,(K[1]+V[1])/2]}else if(z.touch0)I=z.touch0[0],H=z.touch0[1];else return;z.zoom("touch",n(g(A,I,H),z.extent,s))}}function B(N,...T){if(this.__zooming){var z=S(this,T).event(N),O=N.changedTouches,$=O.length,M,A;for(la(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),M=0;M<$;++M)A=O[M],z.touch0&&z.touch0[2]===A.identifier?delete z.touch0:z.touch1&&z.touch1[2]===A.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(A=kt(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<w)){var I=rt(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return m.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Fi(+N),m):r},m.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Fi(!!N),m):e},m.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Fi(!!N),m):o},m.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Fi([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),m):t},m.scaleExtent=function(N){return arguments.length?(i[0]=+N[0],i[1]=+N[1],m):[i[0],i[1]]},m.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(N){return arguments.length?(n=N,m):n},m.duration=function(N){return arguments.length?(l=+N,m):l},m.interpolate=function(N){return arguments.length?(a=N,m):a},m.on=function(){var N=u.on.apply(u,arguments);return N===u?m:N},m.clickDistance=function(N){return arguments.length?(x=(N=+N)*N,m):Math.sqrt(x)},m.tapDistance=function(N){return arguments.length?(w=+N,m):w},m}const Pt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.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 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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Go=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],gg=["Enter"," ","Escape"],yg={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Fr;(function(e){e.Strict="strict",e.Loose="loose"})(Fr||(Fr={}));var Bn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Bn||(Bn={}));var Qo;(function(e){e.Partial="partial",e.Full="full"})(Qo||(Qo={}));const vg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pn||(pn={}));var qo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qo||(qo={}));var re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(re||(re={}));const Nf={[re.Left]:re.Right,[re.Right]:re.Left,[re.Top]:re.Bottom,[re.Bottom]:re.Top},xg=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,oN=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mc=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ci=(e,t=[0,0])=>{const{width:n,height:r}=Tt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},iN=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((o,i)=>{const s=typeof i=="string";let l=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(l=s?t.nodeLookup.get(i):Mc(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,yl(o,Bs(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?vl(r):{x:0,y:0,width:0,height:0}},di=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=yl(n,Bs(o)),r=!0)}),r?vl(n):{x:0,y:0,width:0,height:0}},$c=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const f of e.values()){const{measured:p,selectable:y=!0,hidden:x=!1}=f;if(s&&!y||x)continue;const w=p.width??f.width??f.initialWidth??0,m=p.height??f.height??f.initialHeight??0,{x:v,y:g}=f.internals.positionAbsolute,k=Ng(l,a,u,c,v,g,w,m),C=w*m,S=i&&k>0;(!f.internals.handleBounds||S||k>=C||f.dragging)&&d.push(f)}return d},sN=(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 lN(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=Tt(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function aN({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=lN(e,s),a=di(l),u=Pc(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function wg({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Pt.error005());else{const{width:p,height:y}=Tt(l);p&&y&&(d=[[a,u],[a+p,u+y]])}else l&&er(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=er(d)?Jn(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Pt.error015())),{position:{x:f.x-a+(s.measured.width??0)*c[0],y:f.y-u+(s.measured.height??0)*c[1]},positionAbsolute:f}}async function uN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),y=!p&&f.parentId&&s.find(x=>x.id===f.parentId);(p||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),c=sN(s,a);for(const f of a)l.has(f.id)&&!c.find(y=>y.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const Hr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Jn=(e={x:0,y:0},t,n)=>({x:Hr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function kg(e,t,n){const{width:r,height:o}=Tt(n),{x:i,y:s}=n.internals.positionAbsolute;return Jn(e,[[i,s],[i+r,s+o]],t)}const Ef=(e,t,n)=>e<t?Hr(Math.abs(e-t),1,t)/t:e>n?-Hr(Math.abs(e-n),1,t)/t:0,bc=(e,t,n=15,r=40)=>{const o=Ef(e.x,r,t.width-r)*n,i=Ef(e.y,r,t.height-r)*n;return[o,i]},yl=(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)}),gu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),vl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Zo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Mc(e)?e.internals.positionAbsolute:ci(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Bs=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Mc(e)?e.internals.positionAbsolute:ci(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Sg=(e,t)=>vl(yl(gu(e),gu(t))),Ng=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},Vs=(e,t)=>Ng(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_f=e=>Ct(e.width)&&Ct(e.height)&&Ct(e.x)&&Ct(e.y),Ct=e=>!isNaN(e)&&isFinite(e),Eg=(e,t)=>(n,r)=>{},fi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),hi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?fi(l,s):l},Br=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function ir(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ir(e,n),o=ir(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=ir(e.top??e.y??0,n),o=ir(e.bottom??e.y??0,n),i=ir(e.left??e.x??0,t),s=ir(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dN(e,t,n,r,o,i){const{x:s,y:l}=Br(e,[t,n,r]),{x:a,y:u}=Br({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const Pc=(e,t,n,r,o,i)=>{const s=cN(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Hr(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,y=n/2-f*c,x=dN(e,p,y,c,t,n),w={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:p-w.left+w.right,y:y-w.top+w.bottom,zoom:c}},Jo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function er(e){return e!=null&&e!=="parent"}function Tt(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 _g(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 Cg(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Cf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function fN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function hN(e){return{...yg,...e||{}}}function jg(e){return e===null?null:e?"valid":"invalid"}function Co(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=jt(e),l=hi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?fi(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const Ic=e=>({width:e.offsetWidth,height:e.offsetHeight}),Mg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pN=["INPUT","SELECT","TEXTAREA"];function $g(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:pN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const bg=e=>"clientX"in e,jt=(e,t)=>{var i,s;const n=bg(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},jf=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Ic(s)}})};function Pg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function Hi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Mf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case re.Left:return[t-Hi(t-r,i),n];case re.Right:return[t+Hi(r-t,i),n];case re.Top:return[t,n-Hi(n-o,i)];case re.Bottom:return[t,n+Hi(o-n,i)]}}function Tc({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top,curvature:s=.25}){const[l,a]=Mf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Mf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,p,y]=Pg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,p,y]}function Ig({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function mN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function gN({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=yl(Bs(e),Bs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Vs(s,vl(i))>0}const yN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,vN=(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)),xN=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Pt.error006()),t;const r=n.getEdgeId||yN;let o;return xg(e)?o={...e}:o={...e,id:r(e)},vN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Tg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Ig({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const $f={[re.Left]:{x:-1,y:0},[re.Right]:{x:1,y:0},[re.Top]:{x:0,y:-1},[re.Bottom]:{x:0,y:1}},wN=({source:e,sourcePosition:t=re.Bottom,target:n})=>t===re.Left||t===re.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},bf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kN({source:e,sourcePosition:t=re.Bottom,target:n,targetPosition:r=re.Top,center:o,offset:i,stepPosition:s}){const l=$f[t],a=$f[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=wN({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let y=[],x,w;const m={x:0,y:0},v={x:0,y:0},[,,g,k]=Ig({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(x=o.x??u.x+(c.x-u.x)*s,w=o.y??(u.y+c.y)/2):(x=o.x??(u.x+c.x)/2,w=o.y??u.y+(c.y-u.y)*s);const j=[{x,y:u.y},{x,y:c.y}],b=[{x:u.x,y:w},{x:c.x,y:w}];l[f]===p?y=f==="x"?j:b:y=f==="x"?b:j}else{const j=[{x:u.x,y:c.y}],b=[{x:c.x,y:u.y}];if(f==="x"?y=l.x===p?b:j:y=l.y===p?j:b,t===r){const N=Math.abs(e[f]-n[f]);if(N<=i){const T=Math.min(i-1,i-N);l[f]===p?m[f]=(u[f]>e[f]?-1:1)*T:v[f]=(c[f]>n[f]?-1:1)*T}}if(t!==r){const N=f==="x"?"y":"x",T=l[f]===a[N],z=u[N]>c[N],O=u[N]<c[N];(l[f]===1&&(!T&&z||T&&O)||l[f]!==1&&(!T&&O||T&&z))&&(y=f==="x"?j:b)}const F={x:u.x+m.x,y:u.y+m.y},L={x:c.x+v.x,y:c.y+v.y},U=Math.max(Math.abs(F.x-y[0].x),Math.abs(L.x-y[0].x)),B=Math.max(Math.abs(F.y-y[0].y),Math.abs(L.y-y[0].y));U>=B?(x=(F.x+L.x)/2,w=y[0].y):(x=y[0].x,w=(F.y+L.y)/2)}const C={x:u.x+m.x,y:u.y+m.y},S={x:c.x+v.x,y:c.y+v.y};return[[e,...C.x!==y[0].x||C.y!==y[0].y?[C]:[],...y,...S.x!==y[y.length-1].x||S.y!==y[y.length-1].y?[S]:[],n],x,w,g,k]}function SN(e,t,n,r){const o=Math.min(bf(e,t)/2,bf(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Ws({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,f,p,y,x]=kN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let w=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)w+=SN(d[m-1],d[m],d[m+1],s);return w+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[w,f,p,y,x]}function Pf(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function NN(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Pf(t)||!Pf(n))return null;const r=t.internals.handleBounds||If(t.handles),o=n.internals.handleBounds||If(n.handles),i=Tf((r==null?void 0:r.source)??[],e.sourceHandle),s=Tf(e.connectionMode===Fr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Pt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||re.Bottom,a=(s==null?void 0:s.position)||re.Top,u=tr(t,i,l),c=tr(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function If(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 tr(e,t,n=re.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Tt(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case re.Top:return{x:o+s/2,y:i};case re.Right:return{x:o+s,y:i+l/2};case re.Bottom:return{x:o+s/2,y:i+l};case re.Left:return{x:o,y:i+l/2}}}function Tf(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function yu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function EN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=yu(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const zg=1e3,_N=10,zc={nodeOrigin:[0,0],nodeExtent:Go,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},CN={...zc,checkEquality:!0};function Lc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function jN(e,t,n){const r=Lc(zc,n);for(const o of e.values())if(o.parentId)Rc(o,e,t,r);else{const i=ci(o,r.nodeOrigin),s=er(o.extent)?o.extent:r.nodeExtent,l=Jn(i,s,Tt(o));o.internals.positionAbsolute=l}}function MN(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Ac(e){return e==="manual"}function vu(e,t,n,r={}){var c,d;const o=Lc(CN,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!Ac(o.zIndexMode)?zg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let p=s.get(f.id);if(o.checkEquality&&f===(p==null?void 0:p.internals.userNode))t.set(f.id,p);else{const y=ci(f,o.nodeOrigin),x=er(f.extent)?f.extent:o.nodeExtent,w=Jn(y,x,Tt(f));p={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:MN(f,p),z:Lg(f,l,o.zIndexMode),userNode:f}},t.set(f.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),f.parentId&&Rc(p,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function $N(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 Rc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=Lc(zc,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}$N(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*_N),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!Ac(a)?zg:0,{x:f,y:p,z:y}=bN(e,c,s,l,d,a),{positionAbsolute:x}=e.internals,w=f!==x.x||p!==x.y;(w||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:p}:x,z:y}})}function Lg(e,t,n){const r=Ct(e.zIndex)?e.zIndex:0;return Ac(n)?r:r+(e.selected?t:0)}function bN(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Tt(e),u=ci(e,n),c=er(e.extent)?Jn(u,e.extent,a):u;let d=Jn({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=kg(d,a,t));const f=Lg(e,o,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Dc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??Zo(a),c=Sg(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var g;const c=a.internals.positionAbsolute,d=Tt(a),f=a.origin??r,p=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,x=Math.max(d.width,Math.round(l.width)),w=Math.max(d.height,Math.round(l.height)),m=(x-d.width)*f[0],v=(w-d.height)*f[1];(p>0||y>0||m||v)&&(o.push({id:u,type:"position",position:{x:a.position.x-p+m,y:a.position.y-y+v}}),(g=n.get(u))==null||g.forEach(k=>{e.some(C=>C.id===k.id)||o.push({id:k.id,type:"position",position:{x:k.position.x+p,y:k.position.y+y}})})),(d.width<l.width||d.height<l.height||p||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?f[0]*p-m:0),height:w+(y?f[1]*y-v:0)}})}),o}function PN(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const p of e.values()){const y=t.get(p.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const x=Ic(p.nodeElement),w=y.measured.width!==x.width||y.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!y.internals.handleBounds||p.force))){const v=p.nodeElement.getBoundingClientRect(),g=er(y.extent)?y.extent:i;let{positionAbsolute:k}=y.internals;if(y.parentId&&y.extent==="parent"){const S=t.get(y.parentId);S&&(k=kg(k,x,S))}else g&&(k=Jn(k,g,x));const C={...y,measured:x,internals:{...y.internals,positionAbsolute:k,handleBounds:{source:jf("source",p.nodeElement,v,d,y.id),target:jf("target",p.nodeElement,v,d,y.id)}}};t.set(y.id,C),y.parentId&&Rc(C,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,w&&(u.push({id:y.id,type:"dimensions",dimensions:x}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:Zo(C,o)}))}}if(f.length>0){const p=Dc(f,t,n,o);u.push(...p)}return{changes:u,updatedInternals:a}}async function IN({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function zf(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function Ag(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;zf("source",a,c,e,o,s),zf("target",a,u,e,i,l),t.set(r.id,r)}}function Rg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Rg(n,t):!1}function Lf(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function TN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Rg(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,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 o}function aa({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function zN({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=fi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function LN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,f=null,p=!1,y=!1,x=null;function w({noDragClassName:v,handleSelector:g,domNode:k,isSelectable:C,nodeId:S,nodeClickDistance:_=0}){f=rt(k);function j({x:U,y:B}){const{nodeLookup:N,nodeExtent:T,snapGrid:z,snapToGrid:O,nodeOrigin:$,onNodeDrag:M,onSelectionDrag:A,onError:I,updateNodePositions:H}=t();i={x:U,y:B};let ee=!1;const K=l.size>1,Y=K&&T?gu(di(l)):null,V=K&&O?zN({dragItems:l,snapGrid:z,x:U,y:B}):null;for(const[X,E]of l){if(!N.has(X))continue;let R={x:U-E.distance.x,y:B-E.distance.y};O&&(R=V?{x:Math.round(R.x+V.x),y:Math.round(R.y+V.y)}:fi(R,z));let Q=null;if(K&&T&&!E.extent&&Y){const{positionAbsolute:D}=E.internals,W=D.x-Y.x+T[0][0],Z=D.x+E.measured.width-Y.x2+T[1][0],te=D.y-Y.y+T[0][1],oe=D.y+E.measured.height-Y.y2+T[1][1];Q=[[W,te],[Z,oe]]}const{position:G,positionAbsolute:q}=wg({nodeId:X,nextPosition:R,nodeLookup:N,nodeExtent:Q||T,nodeOrigin:$,onError:I});ee=ee||E.position.x!==G.x||E.position.y!==G.y,E.position=G,E.internals.positionAbsolute=q}if(y=y||ee,!!ee&&(H(l,!0),x&&(r||M||!S&&A))){const[X,E]=aa({nodeId:S,dragItems:l,nodeLookup:N});r==null||r(x,l,X,E),M==null||M(x,X,E),S||A==null||A(x,E)}}async function b(){if(!c)return;const{transform:U,panBy:B,autoPanSpeed:N,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[z,O]=bc(u,c,N);(z!==0||O!==0)&&(i.x=(i.x??0)-z/U[2],i.y=(i.y??0)-O/U[2],await B({x:z,y:O})&&j(i)),s=requestAnimationFrame(b)}function F(U){var K;const{nodeLookup:B,multiSelectionActive:N,nodesDraggable:T,transform:z,snapGrid:O,snapToGrid:$,selectNodesOnDrag:M,onNodeDragStart:A,onSelectionDragStart:I,unselectNodesAndEdges:H}=t();d=!0,(!M||!C)&&!N&&S&&((K=B.get(S))!=null&&K.selected||H()),C&&M&&S&&(e==null||e(S));const ee=Co(U.sourceEvent,{transform:z,snapGrid:O,snapToGrid:$,containerBounds:c});if(i=ee,l=TN(B,T,ee,S),l.size>0&&(n||A||!S&&I)){const[Y,V]=aa({nodeId:S,dragItems:l,nodeLookup:B});n==null||n(U.sourceEvent,l,Y,V),A==null||A(U.sourceEvent,Y,V),S||I==null||I(U.sourceEvent,V)}}const L=eg().clickDistance(_).on("start",U=>{const{domNode:B,nodeDragThreshold:N,transform:T,snapGrid:z,snapToGrid:O}=t();c=(B==null?void 0:B.getBoundingClientRect())||null,p=!1,y=!1,x=U.sourceEvent,N===0&&F(U),i=Co(U.sourceEvent,{transform:T,snapGrid:z,snapToGrid:O,containerBounds:c}),u=jt(U.sourceEvent,c)}).on("drag",U=>{const{autoPanOnNodeDrag:B,transform:N,snapGrid:T,snapToGrid:z,nodeDragThreshold:O,nodeLookup:$}=t(),M=Co(U.sourceEvent,{transform:N,snapGrid:T,snapToGrid:z,containerBounds:c});if(x=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||S&&!$.has(S))&&(p=!0),!p){if(!a&&B&&d&&(a=!0,b()),!d){const A=jt(U.sourceEvent,c),I=A.x-u.x,H=A.y-u.y;Math.sqrt(I*I+H*H)>O&&F(U)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(u=jt(U.sourceEvent,c),j(M))}}).on("end",U=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:B,updateNodePositions:N,onNodeDragStop:T,onSelectionDragStop:z}=t();if(y&&(N(l,!1),y=!1),o||T||!S&&z){const[O,$]=aa({nodeId:S,dragItems:l,nodeLookup:B,dragging:!1});o==null||o(U.sourceEvent,l,O,$),T==null||T(U.sourceEvent,O,$),S||z==null||z(U.sourceEvent,$)}}}).filter(U=>{const B=U.target;return!U.button&&(!v||!Lf(B,`.${v}`,k))&&(!g||Lf(B,g,k))});f.call(L)}function m(){f==null||f.on(".drag",null)}return{update:w,destroy:m}}function AN(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Vs(o,Zo(i))>0&&r.push(i);return r}const RN=250;function DN(e,t,n,r){var l,a;let o=[],i=1/0;const s=AN(e,n,t+RN);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=tr(u,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));y>t||(y<i?(o=[{...d,x:f,y:p}],i=y):y===i&&o.push({...d,x:f,y:p}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function Dg(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...tr(s,a,a.position,!0)}:a}function Og(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ON(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Fg=()=>!0;function FN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:p,onConnectStart:y,onConnect:x,onConnectEnd:w,isValidConnection:m=Fg,onReconnectEnd:v,updateConnection:g,getTransform:k,getFromHandle:C,autoPanSpeed:S,dragThreshold:_=1,handleDomNode:j}){const b=Mg(e.target);let F=0,L;const{x:U,y:B}=jt(e),N=Og(i,j),T=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!T||!N)return;const O=Dg(o,N,r,a,t);if(!O)return;let $=jt(e,T),M=!1,A=null,I=!1,H=null;function ee(){if(!c||!T)return;const[G,q]=bc($,T,S);f({x:G,y:q}),F=requestAnimationFrame(ee)}const K={...O,nodeId:o,type:N,position:O.position},Y=a.get(o);let X={inProgress:!0,isValid:null,from:tr(Y,K,re.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:Y,to:$,toHandle:null,toPosition:Nf[K.position],toNode:null,pointer:$};function E(){z=!0,g(X),y==null||y(e,{nodeId:o,handleId:r,handleType:N})}_===0&&E();function R(G){if(!z){const{x:oe,y:de}=jt(G),me=oe-U,ke=de-B;if(!(me*me+ke*ke>_*_))return;E()}if(!C()||!K){Q(G);return}const q=k();$=jt(G,T),L=DN(hi($,q,!1,[1,1]),n,a,K),M||(ee(),M=!0);const D=Hg(G,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:b,lib:u,flowId:d,nodeLookup:a});H=D.handleDomNode,A=D.connection,I=ON(!!L,D.isValid);const W=a.get(o),Z=W?tr(W,K,re.Left,!0):X.from,te={...X,from:Z,isValid:I,to:D.toHandle&&I?Br({x:D.toHandle.x,y:D.toHandle.y},q):$,toHandle:D.toHandle,toPosition:I&&D.toHandle?D.toHandle.position:Nf[K.position],toNode:D.toHandle?a.get(D.toHandle.nodeId):null,pointer:$};g(te),X=te}function Q(G){if(!("touches"in G&&G.touches.length>0)){if(z){(L||H)&&A&&I&&(x==null||x(A));const{inProgress:q,...D}=X,W={...D,toPosition:X.toHandle?X.toPosition:null};w==null||w(G,W),i&&(v==null||v(G,W))}p(),cancelAnimationFrame(F),M=!1,I=!1,A=null,H=null,b.removeEventListener("mousemove",R),b.removeEventListener("mouseup",Q),b.removeEventListener("touchmove",R),b.removeEventListener("touchend",Q)}}b.addEventListener("mousemove",R),b.addEventListener("mouseup",Q),b.addEventListener("touchmove",R),b.addEventListener("touchend",Q)}function Hg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=Fg,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y}=jt(e),x=s.elementFromPoint(p,y),w=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:f,m={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const v=Og(void 0,w),g=w.getAttribute("data-nodeid"),k=w.getAttribute("data-handleid"),C=w.classList.contains("connectable"),S=w.classList.contains("connectableend");if(!g||!v)return m;const _={source:d?g:r,sourceHandle:d?k:o,target:d?r:g,targetHandle:d?o:k};m.connection=_;const b=C&&S&&(n===Fr.Strict?d&&v==="source"||!d&&v==="target":g!==r||k!==o);m.isValid=b&&u(_),m.toHandle=Dg(g,v,k,c,n,!0)}return m}const xu={onPointerDown:FN,isValid:Hg};function HN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=rt(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const k=n(),C=g.sourceEvent.ctrlKey&&Jo()?10:1,S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*c,_=k[2]*Math.pow(2,S*C);t.scaleTo(_)};let x=[0,0];const w=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const k=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const C=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],S=[C[0]-x[0],C[1]-x[1]];x=C;const _=r()*Math.max(k[2],Math.log(k[2]))*(p?-1:1),j={x:k[0]-S[0]*_,y:k[1]-S[1]*_},b=[[0,0],[a,u]];t.setViewportConstrained({x:j.x,y:j.y,zoom:k[2]},b,l)},v=mg().on("start",w).on("zoom",d?m:null).on("zoom.wheel",f?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:kt}}const xl=e=>({x:e.x,y:e.y,zoom:e.k}),ua=({x:e,y:t,zoom:n})=>gl.translate(e,t).scale(n),cn=(e,t)=>e.target.closest(`.${t}`),Bg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),BN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ca=(e,t=0,n=BN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Vg=e=>{const t=e.ctrlKey&&Jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function VN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(cn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const w=kt(c),m=Vg(c),v=d*Math.pow(2,m);r.scaleTo(n,v,w,c);return}const f=c.deltaMode===1?20:1;let p=o===Bn.Vertical?0:c.deltaX*f,y=o===Bn.Horizontal?0:c.deltaY*f;!Jo()&&c.shiftKey&&o!==Bn.Vertical&&(p=c.deltaY*f,y=0),r.translateBy(n,-(p/d)*i,-(y/d)*i,{internal:!0});const x=xl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,x):(e.isPanScrolling=!0,l==null||l(c,x)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,x),e.isPanScrolling=!1},150)}}function WN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=cn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function UN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=xl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function YN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&Bg(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,xl(i.transform)))}}function XN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&Bg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=xl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function KN({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:d}){return f=>{var m;const p=t||n,y=r&&f.ctrlKey,x=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(cn(f,`${c}-flow__node`)||cn(f,`${c}-flow__edge`)||cn(f,`${c}-flow__selection`)||cn(f,`${c}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!s&&!r||l||d&&!x||cn(f,a)&&x||cn(f,u)&&(!x||i&&x&&!t)||!r&&f.ctrlKey&&x)return!1;if(!r&&f.type==="touchstart"&&((m=f.touches)==null?void 0:m.length)>1)return f.preventDefault(),!1;if(!p&&!i&&!y&&x||!o&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(o)&&!o.includes(f.button)&&f.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||x||e)&&w}}function GN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(B=>{const N=B[0];N&&(d=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null;f==null||f.observe(e);const p=mg().extent(()=>d).scaleExtent([t,n]).translateExtent(r),y=rt(e).call(p);k({x:o.x,y:o.y,zoom:Hr(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=y.on("wheel.zoom"),w=y.on("dblclick.zoom");p.wheelDelta(Vg);async function m(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).transform(ca(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:N,onPaneContextMenu:T,userSelectionActive:z,panOnScroll:O,panOnDrag:$,panOnScrollMode:M,panOnScrollSpeed:A,preventScrolling:I,zoomOnPinch:H,zoomOnScroll:ee,zoomOnDoubleClick:K,panActivationKeyPressed:Y=!1,zoomActivationKeyPressed:V,lib:X,onTransformChange:E,connectionInProgress:R,paneClickDistance:Q,selectionOnDrag:G}){z&&!u.isZoomingOrPanning&&g();const q=O&&!V&&!z;p.clickDistance(G?1/0:!Ct(Q)||Q<0?0:Q);const D=q?VN({zoomPanValues:u,noWheelClassName:B,d3Selection:y,d3Zoom:p,panOnScrollMode:M,panOnScrollSpeed:A,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):WN({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:x});y.on("wheel.zoom",D,{passive:!1});const W=UN({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});p.on("start",W);const Z=YN({zoomPanValues:u,panOnDrag:$,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:E});p.on("zoom",Z);const te=XN({zoomPanValues:u,panOnDrag:$,panOnScroll:O,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});p.on("end",te);const oe=KN({panActivationKeyPressed:Y,zoomActivationKeyPressed:V,panOnDrag:$,zoomOnScroll:ee,panOnScroll:O,zoomOnDoubleClick:K,zoomOnPinch:H,userSelectionActive:z,noPanClassName:N,noWheelClassName:B,lib:X,connectionInProgress:R});p.filter(oe),K?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function g(){p.on("zoom",null)}async function k(B,N,T){const z=ua(B),O=p==null?void 0:p.constrain()(z,N,T);return O&&await m(O),O}async function C(B,N){const T=ua(B);return await m(T,N),T}function S(B){if(y){const N=ua(B),T=y.property("__zoom");(T.k!==B.zoom||T.x!==B.x||T.y!==B.y)&&(p==null||p.transform(y,N,null,{sync:!0}))}}function _(){const B=y?pg(y.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function j(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).scaleTo(ca(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}async function b(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).scaleBy(ca(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}function F(B){p==null||p.scaleExtent(B)}function L(B){p==null||p.translateExtent(B)}function U(B){const N=!Ct(B)||B<0?0:B;p==null||p.clickDistance(N)}return{update:v,destroy:g,setViewport:C,setViewportConstrained:k,getViewport:_,scaleTo:j,scaleBy:b,setScaleExtent:F,setTranslateExtent:L,syncViewport:S,setClickDistance:U}}var Vr;(function(e){e.Line="line",e.Handle="handle"})(Vr||(Vr={}));function QN({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function Af(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function sn(e,t){return Math.max(0,t-e)}function ln(e,t){return Math.max(0,e-t)}function Bi(e,t,n){return Math.max(0,t-e,e-n)}function Rf(e,t){return e?!t:t}function qN(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:p,ySnapped:y}=n,{minWidth:x,maxWidth:w,minHeight:m,maxHeight:v}=r,{x:g,y:k,width:C,height:S,aspectRatio:_}=e;let j=Math.floor(c?p-e.pointerX:0),b=Math.floor(d?y-e.pointerY:0);const F=C+(a?-j:j),L=S+(u?-b:b),U=-i[0]*C,B=-i[1]*S;let N=Bi(F,x,w),T=Bi(L,m,v);if(s){let $=0,M=0;a&&j<0?$=sn(g+j+U,s[0][0]):!a&&j>0&&($=ln(g+F+U,s[1][0])),u&&b<0?M=sn(k+b+B,s[0][1]):!u&&b>0&&(M=ln(k+L+B,s[1][1])),N=Math.max(N,$),T=Math.max(T,M)}if(l){let $=0,M=0;a&&j>0?$=ln(g+j,l[0][0]):!a&&j<0&&($=sn(g+F,l[1][0])),u&&b>0?M=ln(k+b,l[0][1]):!u&&b<0&&(M=sn(k+L,l[1][1])),N=Math.max(N,$),T=Math.max(T,M)}if(o){if(c){const $=Bi(F/_,m,v)*_;if(N=Math.max(N,$),s){let M=0;!a&&!u||a&&!u&&f?M=ln(k+B+F/_,s[1][1])*_:M=sn(k+B+(a?j:-j)/_,s[0][1])*_,N=Math.max(N,M)}if(l){let M=0;!a&&!u||a&&!u&&f?M=sn(k+F/_,l[1][1])*_:M=ln(k+(a?j:-j)/_,l[0][1])*_,N=Math.max(N,M)}}if(d){const $=Bi(L*_,x,w)/_;if(T=Math.max(T,$),s){let M=0;!a&&!u||u&&!a&&f?M=ln(g+L*_+U,s[1][0])/_:M=sn(g+(u?b:-b)*_+U,s[0][0])/_,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&f?M=sn(g+L*_,l[1][0])/_:M=ln(g+(u?b:-b)*_,l[0][0])/_,T=Math.max(T,M)}}}b=b+(b<0?T:-T),j=j+(j<0?N:-N),o&&(f?F>L*_?b=(Rf(a,u)?-j:j)/_:j=(Rf(a,u)?-b:b)*_:c?(b=j/_,u=a):(j=b*_,a=u));const z=a?g+j:g,O=u?k+b:k;return{width:C+(a?-j:j),height:S+(u?-b:b),x:i[0]*j*(a?-1:1)+z,y:i[1]*b*(u?-1:1)+O}}const Wg={width:0,height:0,x:0,y:0},ZN={...Wg,pointerX:0,pointerY:0,aspectRatio:1};function JN(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function eE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=rt(e);let s={controlDirection:Af("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:y,onResizeEnd:x,shouldResize:w}){let m={...Wg},v={...ZN};s={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:Af(u)};let g,k=null,C=[],S,_,j;const b=eg().on("start",F=>{const{nodeLookup:L,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,paneDomNode:z}=n();if(g=L.get(t),!g)return;k=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:$}=Co(F.sourceEvent,{transform:U,snapGrid:B,snapToGrid:N,containerBounds:k});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:O,pointerY:$,aspectRatio:m.width/m.height},S=void 0,_=er(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(S=L.get(g.parentId)),S&&g.extent==="parent"&&(_=[[0,0],[S.measured.width,S.measured.height]]),C=[],j=void 0;for(const[M,A]of L)if(A.parentId===t&&(C.push({id:M,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const I=JN(A,g,A.origin??T);j?j=[[Math.min(I[0][0],j[0][0]),Math.min(I[0][1],j[0][1])],[Math.max(I[1][0],j[1][0]),Math.max(I[1][1],j[1][1])]]:j=I}p==null||p(F,{...m})}).on("drag",F=>{const{transform:L,snapGrid:U,snapToGrid:B,nodeOrigin:N}=n(),T=Co(F.sourceEvent,{transform:L,snapGrid:U,snapToGrid:B,containerBounds:k}),z=[];if(!g)return;const{x:O,y:$,width:M,height:A}=m,I={},H=g.origin??N,{width:ee,height:K,x:Y,y:V}=qN(v,s.controlDirection,T,s.boundaries,s.keepAspectRatio,H,_,j),X=ee!==M,E=K!==A,R=Y!==O&&X,Q=V!==$&&E;if(!R&&!Q&&!X&&!E)return;const G={prevValues:{...m},startX:v.x,startY:v.y,childNodes:C.map(Z=>({...Z,position:{...Z.position}}))};if((R||Q||H[0]===1||H[1]===1)&&(I.x=R?Y:m.x,I.y=Q?V:m.y,m.x=I.x,m.y=I.y,C.length>0)){const Z=Y-O,te=V-$;for(const oe of C)oe.position={x:oe.position.x-Z+H[0]*(ee-M),y:oe.position.y-te+H[1]*(K-A)},z.push(oe)}if((X||E)&&(I.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?ee:m.width,I.height=E&&(!s.resizeDirection||s.resizeDirection==="vertical")?K:m.height,m.width=I.width,m.height=I.height),S&&g.expandParent){const Z=H[0]*(I.width??0);I.x&&I.x<Z&&(m.x=Z,v.x=v.x-(I.x-Z));const te=H[1]*(I.height??0);I.y&&I.y<te&&(m.y=te,v.y=v.y-(I.y-te))}const q=QN({width:m.width,prevWidth:M,height:m.height,prevHeight:A,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),D={...m,direction:q};if((w==null?void 0:w(F,D))===!1){m=G.prevValues,v.x=G.startX,v.y=G.startY,C.forEach((Z,te)=>{Z.position=G.childNodes[te].position});return}y==null||y(F,D),r(I,z)}).on("end",F=>{x==null||x(F,{...m}),o==null||o({...m})});i.call(b)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Ug={exports:{}},Yg={},Xg={exports:{}},Kg={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var Wr=P;function tE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nE=typeof Object.is=="function"?Object.is:tE,rE=Wr.useState,oE=Wr.useEffect,iE=Wr.useLayoutEffect,sE=Wr.useDebugValue;function lE(e,t){var n=t(),r=rE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return iE(function(){o.value=n,o.getSnapshot=t,da(o)&&i({inst:o})},[e,n,t]),oE(function(){return da(o)&&i({inst:o}),e(function(){da(o)&&i({inst:o})})},[e]),sE(n),n}function da(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nE(e,n)}catch{return!0}}function aE(e,t){return t()}var uE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aE:lE;Kg.useSyncExternalStore=Wr.useSyncExternalStore!==void 0?Wr.useSyncExternalStore:uE;Xg.exports=Kg;var cE=Xg.exports;/**
|
|
49
|
-
* @license React
|
|
50
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var wl=P,dE=cE;function fE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hE=typeof Object.is=="function"?Object.is:fE,pE=dE.useSyncExternalStore,mE=wl.useRef,gE=wl.useEffect,yE=wl.useMemo,vE=wl.useDebugValue;Yg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=mE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=yE(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&s.hasValue){var y=s.value;if(o(y,p))return d=y}return d=p}if(y=d,hE(c,p))return y;var x=r(p);return o!==void 0&&o(y,x)?(c=p,y):(c=p,d=x)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=pE(e,i[0],i[1]);return gE(function(){s.hasValue=!0,s.value=l},[l]),vE(l),l};Ug.exports=Yg;var xE=Ug.exports;const wE=_h(xE),kE={},Df=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(kE?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},SE=e=>e?Df(e):Df,{useDebugValue:NE}=pv,{useSyncExternalStoreWithSelector:EE}=wE,_E=e=>e;function Gg(e,t=_E,n){const r=EE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return NE(r),r}const Of=(e,t)=>{const n=SE(e),r=(o,i=t)=>Gg(n,o,i);return Object.assign(r,n),r},CE=(e,t)=>e?Of(e,t):Of;function we(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,o]of e)if(!Object.is(o,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 kl=P.createContext(null),jE=kl.Provider,Qg=Pt.error001("react");function le(e,t){const n=P.useContext(kl);if(n===null)throw new Error(Qg);return Gg(n,e,t)}function pe(){const e=P.useContext(kl);if(e===null)throw new Error(Qg);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ff={display:"none"},ME={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},qg="react-flow__node-desc",Zg="react-flow__edge-desc",$E="react-flow__aria-live",bE=e=>e.ariaLiveMessage,PE=e=>e.ariaLabelConfig;function IE({rfId:e}){const t=le(bE);return h.jsx("div",{id:`${$E}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ME,children:t})}function TE({rfId:e,disableKeyboardA11y:t}){const n=le(PE);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${qg}-${e}`,style:Ff,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${Zg}-${e}`,style:Ff,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(IE,{rfId:e})]})}const pi=P.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return h.jsx("div",{className:_e(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});pi.displayName="Panel";const Hf="https://reactflow.dev?utm_source=attribution";function zE({proOptions:e,position:t="bottom-right"}){return P.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:h.jsx(pi,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Hf}`,children:h.jsx("a",{href:Hf,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const LE=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}},Vi=e=>e.id;function AE(e,t){return we(e.selectedNodes.map(Vi),t.selectedNodes.map(Vi))&&we(e.selectedEdges.map(Vi),t.selectedEdges.map(Vi))}function RE({onSelectionChange:e}){const t=pe(),{selectedNodes:n,selectedEdges:r}=le(LE,AE);return P.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const DE=e=>!!e.onSelectionChangeHandlers;function OE({onSelectionChange:e}){const t=le(DE);return e||t?h.jsx(RE,{onSelectionChange:e}):null}const Jg=[0,0],FE={x:0,y:0,zoom:1},HE=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Bf=[...HE,"rfId"],BE=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}),Vf={translateExtent:Go,nodeOrigin:Jg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function VE(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=le(BE,we),u=pe();P.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Vf,l()}),[]);const c=P.useRef(Vf);return P.useEffect(()=>{for(const d of Bf){const f=e[d],p=c.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?o(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:hN(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},Bf.map(d=>e[d])),null}function Wf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function WE(e){var r;const[t,n]=P.useState(e==="system"?null:e);return P.useEffect(()=>{if(e!=="system"){n(e);return}const o=Wf(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Wf())!=null&&r.matches?"dark":"light"}const Uf=typeof document<"u"?document:null;function ei(e=null,t={target:Uf,actInsideInputWithModifier:!0}){const[n,r]=P.useState(!1),o=P.useRef(!1),i=P.useRef(new Set([])),[s,l]=P.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace(/\+/g,`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return P.useEffect(()=>{const a=(t==null?void 0:t.target)??Uf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var w,m;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&$g(p))return!1;const x=Xf(p.code,l);if(i.current.add(p[x]),Yf(s,i.current,!1)){const v=((m=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:m[0])||p.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!g)&&p.preventDefault(),r(!0)}},d=p=>{const y=Xf(p.code,l);Yf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[y]),p.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Yf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Xf(e,t){return t.includes(e)?"code":"key"}const UE=()=>{const e=pe();return P.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=Pc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return hi(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Br(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function e0(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)YE(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function YE(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={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function XE(e,t){return e0(e,t)}function KE(e,t){return e0(e,t)}function In(e,t){return{id:e,type:"select",selected:t}}function Sr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(In(i.id,s)))}return r}function Kf({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Gf(e){return{id:e.id,type:"remove"}}const GE=Eg();function QE(e,t,n={}){return xN(e,t,{...n,onError:n.onError??GE})}const Qf=e=>oN(e),qE=e=>xg(e);function t0(e){return P.forwardRef(e)}const n0=typeof window<"u"?P.useLayoutEffect:P.useEffect;function qf(e){const[t,n]=P.useState(BigInt(0)),[r]=P.useState(()=>ZE(()=>n(o=>o+BigInt(1))));return n0(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function ZE(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const r0=P.createContext(null);function JE({children:e}){const t=pe(),n=P.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:y}=t.getState();let x=a;for(const m of l)x=typeof m=="function"?m(x):m;let w=Kf({items:x,lookup:f});for(const m of y.values())w=m(w);c&&u(x),w.length>0?d==null||d(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=qf(n),o=P.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;c?u(p):d&&d(Kf({items:p,lookup:f}))},[]),i=qf(o),s=P.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(r0.Provider,{value:s,children:e})}function e_(){const e=P.useContext(r0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const t_=e=>!!e.panZoom;function mi(){const e=UE(),t=pe(),n=e_(),r=le(t_),o=P.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var m,v;const{nodeLookup:f,nodeOrigin:p}=t.getState(),y=Qf(d)?d:f.get(d.id),x=y.parentId?Cg(y.position,y.measured,y.parentId,f,p):y.position,w={...y,position:x,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return Zo(w)},u=(d,f,p={replace:!1})=>{s(y=>y.map(x=>{if(x.id===d){const w=typeof f=="function"?f(x):f;return p.replace&&Qf(w)?w:{...x,...w}}return x}))},c=(d,f,p={replace:!1})=>{l(y=>y.map(x=>{if(x.id===d){const w=typeof f=="function"?f(x):f;return p.replace&&qE(w)?w:{...x,...w}}return x}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[y,x,w]=p;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:y,y:x,zoom:w}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:y,onNodesDelete:x,onEdgesDelete:w,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:k}=t.getState(),{nodes:C,edges:S}=await uN({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:y,onBeforeDelete:k}),_=S.length>0,j=C.length>0;if(_){const b=S.map(Gf);w==null||w(S),v(b)}if(j){const b=C.map(Gf);x==null||x(C),m(b)}return(j||_)&&(g==null||g({nodes:C,edges:S})),{deletedNodes:C,deletedEdges:S}},getIntersectingNodes:(d,f=!0,p)=>{const y=_f(d),x=y?d:a(d),w=p!==void 0;return x?(p||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===d.id||!v.internals.positionAbsolute))return!1;const g=Zo(w?m:v),k=Vs(g,x);return f&&k>0||k>=g.width*g.height||k>=x.width*x.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const x=_f(d)?d:a(d);if(!x)return!1;const w=Vs(x,f);return p&&w>0||w>=f.width*f.height||w>=x.width*x.height},updateNode:u,updateNodeData:(d,f,p={replace:!1})=>{u(d,y=>{const x=typeof f=="function"?f(y):f;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},updateEdge:c,updateEdgeData:(d,f,p={replace:!1})=>{c(d,y=>{const x=typeof f=="function"?f(y):f;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return iN(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??fN();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return P.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Zf=e=>e.selected,n_=typeof window<"u"?window:void 0;function r_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=pe(),{deleteElements:r}=mi(),o=ei(e,{actInsideInputWithModifier:!1}),i=ei(t,{target:n_});P.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Zf),edges:s.filter(Zf)}),n.setState({nodesSelectionActive:!1})}},[o]),P.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function o_(e){const t=pe();P.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=Ic(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Pt.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 Sl={position:"absolute",width:"100%",height:"100%",top:0,left:0},i_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function s_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=Bn.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:y=!0,children:x,noWheelClassName:w,noPanClassName:m,onViewportChange:v,isControlledViewport:g,paneClickDistance:k,selectionOnDrag:C}){const S=pe(),_=P.useRef(null),{userSelectionActive:j,lib:b,connectionInProgress:F}=le(i_,we),L=ei(p),U=P.useRef();o_(_);const B=P.useCallback(N=>{v==null||v({x:N[0],y:N[1],zoom:N[2]}),g||S.setState({transform:N})},[v,g]);return P.useEffect(()=>{if(_.current){U.current=GN({domNode:_.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:u,onDraggingChange:O=>S.setState($=>$.paneDragging===O?$:{paneDragging:O}),onPanZoomStart:(O,$)=>{const{onViewportChangeStart:M,onMoveStart:A}=S.getState();A==null||A(O,$),M==null||M($)},onPanZoom:(O,$)=>{const{onViewportChange:M,onMove:A}=S.getState();A==null||A(O,$),M==null||M($)},onPanZoomEnd:(O,$)=>{const{onViewportChangeEnd:M,onMoveEnd:A}=S.getState();A==null||A(O,$),M==null||M($)}});const{x:N,y:T,zoom:z}=U.current.getViewport();return S.setState({panZoom:U.current,transform:[N,T,z],domNode:_.current.closest(".react-flow")}),()=>{var O;(O=U.current)==null||O.destroy()}}},[]),P.useEffect(()=>{var N;(N=U.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:L,preventScrolling:y,noPanClassName:m,userSelectionActive:j,noWheelClassName:w,lib:b,onTransformChange:B,connectionInProgress:F,selectionOnDrag:C,paneClickDistance:k})},[e,t,n,r,o,i,s,l,a,L,y,m,j,w,b,B,F,C,k]),h.jsx("div",{className:"react-flow__renderer",ref:_,style:Sl,children:x})}const l_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function a_(){const{userSelectionActive:e,userSelectionRect:t}=le(l_,we);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const fa=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},u_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function c_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Qo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:y,children:x}){const w=P.useRef(0),m=pe(),{userSelectionActive:v,elementsSelectable:g,dragging:k,panBy:C,autoPanSpeed:S}=le(u_,we),_=g&&(e||v),j=P.useRef(null),b=P.useRef(),F=P.useRef(new Set),L=P.useRef(new Set),U=P.useRef(!1),B=P.useRef(!1),N=P.useRef({x:0,y:0}),T=P.useRef(!1),z=E=>{if(B.current||U.current||m.getState().connection.inProgress){B.current=!1,U.current=!1;return}u==null||u(E),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},O=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},$=d?E=>d(E):void 0,M=E=>{B.current&&(E.stopPropagation(),B.current=!1)},A=E=>{var oe,de;if(E.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:R,transform:Q}=m.getState();if(b.current=R==null?void 0:R.getBoundingClientRect(),!b.current)return;const G=E.target===j.current;if(!G&&!!E.target.closest(".nokey")||!e||!(s&&G||t)||E.button!==0||!E.isPrimary)return;(de=(oe=E.target)==null?void 0:oe.setPointerCapture)==null||de.call(oe,E.pointerId),B.current=!1;const{x:W,y:Z}=jt(E.nativeEvent,b.current),te=hi({x:W,y:Z},Q);m.setState({userSelectionRect:{width:0,height:0,startX:te.x,startY:te.y,x:W,y:Z}}),G||(E.stopPropagation(),E.preventDefault())};function I(E,R){const{userSelectionRect:Q}=m.getState();if(!Q)return;const{transform:G,nodeLookup:q,edgeLookup:D,connectionLookup:W,triggerNodeChanges:Z,triggerEdgeChanges:te,defaultEdgeOptions:oe}=m.getState(),de={x:Q.startX,y:Q.startY},{x:me,y:ke}=Br(de,G),Me={startX:de.x,startY:de.y,x:E<me?E:me,y:R<ke?R:ke,width:Math.abs(E-me),height:Math.abs(R-ke)},ie=F.current,Ae=L.current;F.current=new Set($c(q,Me,G,n===Qo.Partial,!0).map(Pe=>Pe.id)),L.current=new Set;const tt=(oe==null?void 0:oe.selectable)??!0;for(const Pe of F.current){const He=W.get(Pe);if(He)for(const{edgeId:Be}of He.values()){const ct=D.get(Be);ct&&(ct.selectable??tt)&&L.current.add(Be)}}if(!Cf(ie,F.current)){const Pe=Sr(q,F.current,!0);Z(Pe)}if(!Cf(Ae,L.current)){const Pe=Sr(D,L.current);te(Pe)}m.setState({userSelectionRect:Me,userSelectionActive:!0,nodesSelectionActive:!1})}function H(){if(!o||!b.current)return;const[E,R]=bc(N.current,b.current,S);C({x:E,y:R}).then(Q=>{if(!B.current||!Q){w.current=requestAnimationFrame(H);return}const{x:G,y:q}=N.current;I(G,q),w.current=requestAnimationFrame(H)})}const ee=()=>{cancelAnimationFrame(w.current),w.current=0,T.current=!1};P.useEffect(()=>()=>ee(),[]);const K=E=>{const{userSelectionRect:R,transform:Q,resetSelectedElements:G}=m.getState();if(!b.current||!R)return;const{x:q,y:D}=jt(E.nativeEvent,b.current);N.current={x:q,y:D};const W=Br({x:R.startX,y:R.startY},Q);if(!B.current){const Z=t?0:i;if(Math.hypot(q-W.x,D-W.y)<=Z)return;G(),l==null||l(E)}B.current=!0,T.current||(H(),T.current=!0),I(q,D)},Y=E=>{var R,Q;if(!_){E.target===j.current&&m.getState().connection.inProgress&&(U.current=!0);return}E.button===0&&((Q=(R=E.target)==null?void 0:R.releasePointerCapture)==null||Q.call(R,E.pointerId),!v&&E.target===j.current&&m.getState().userSelectionRect&&(z==null||z(E)),m.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(a==null||a(E),m.setState({nodesSelectionActive:F.current.size>0})),ee())},V=E=>{var R,Q;(Q=(R=E.target)==null?void 0:R.releasePointerCapture)==null||Q.call(R,E.pointerId),ee()},X=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:_e(["react-flow__pane",{draggable:X,dragging:k,selection:e}]),onClick:_?void 0:fa(z,j),onContextMenu:fa(O,j),onWheel:fa($,j),onPointerEnter:_?void 0:f,onPointerMove:_?K:p,onPointerUp:Y,onPointerCancel:_?V:void 0,onPointerDownCapture:_?A:void 0,onClickCapture:_?M:void 0,onPointerLeave:y,ref:j,style:Sl,children:[x,h.jsx(a_,{})]})}function wu({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",Pt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function o0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=pe(),[a,u]=P.useState(!1),c=P.useRef();return P.useEffect(()=>{if(!t)return c.current=LN({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{wu({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),P.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const d_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function i0(){const e=pe();return P.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=d_(s),p=o?i[0]:5,y=o?i[1]:5,x=n.direction.x*p*n.factor,w=n.direction.y*y*n.factor;for(const[,m]of u){if(!f(m))continue;let v={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+w};o&&(v=fi(v,i));const{position:g,positionAbsolute:k}=wg({nodeId:m.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});m.position=g,m.internals.positionAbsolute=k,d.set(m.id,m)}a(d)},[])}const Oc=P.createContext(null),f_=Oc.Provider;Oc.Consumer;const s0=()=>P.useContext(Oc),h_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),l0=P.createContext(null);function p_({children:e}){const t=le(h_,we);return h.jsx(l0.Provider,{value:t,children:e})}function m_(){const e=P.useContext(l0);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const g_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},y_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return g_;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===Fr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:c&&u}};function v_({type:e="source",position:t=re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},p){var T,z;const y=s||null,x=e==="target",w=pe(),m=s0(),{connectOnClick:v,noPanClassName:g,rfId:k}=m_(),{connectingFrom:C,connectingTo:S,clickConnecting:_,isPossibleEndHandle:j,connectionInProcess:b,clickConnectionInProcess:F,valid:L}=le(y_(m,y,e),we);m||(z=(T=w.getState()).onError)==null||z.call(T,"010",Pt.error010());const U=O=>{const{defaultEdgeOptions:$,onConnect:M,hasDefaultEdges:A}=w.getState(),I={...$,...O};if(A){const{edges:H,setEdges:ee,onError:K}=w.getState();ee(QE(I,H,{onError:K}))}M==null||M(I),l==null||l(I)},B=O=>{if(!m)return;const $=bg(O.nativeEvent);if(o&&($&&O.button===0||!$)){const M=w.getState();xu.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:x,handleId:y,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...A)=>{var I,H;return(H=(I=w.getState()).onConnectEnd)==null?void 0:H.call(I,...A)},updateConnection:M.updateConnection,onConnect:U,isValidConnection:n||((...A)=>{var I,H;return((H=(I=w.getState()).isValidConnection)==null?void 0:H.call(I,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}$?c==null||c(O):d==null||d(O)},N=O=>{const{onClickConnectStart:$,onClickConnectEnd:M,connectionClickStartHandle:A,connectionMode:I,isValidConnection:H,lib:ee,rfId:K,nodeLookup:Y,connection:V}=w.getState();if(!m||!A&&!o)return;if(!A){$==null||$(O.nativeEvent,{nodeId:m,handleId:y,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const X=Mg(O.target),E=n||H,{connection:R,isValid:Q}=xu.isValid(O.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:I,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:E,flowId:K,doc:X,lib:ee,nodeLookup:Y});Q&&R&&U(R);const G=structuredClone(V);delete G.inProgress,G.toPosition=G.toHandle?G.toHandle.position:null,M==null||M(O,G),w.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${k}-${m}-${y}-${e}`,className:_e(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:_,connectingfrom:C,connectingto:S,valid:L,connectionindicator:r&&(!b||j)&&(b||F?i:o)}]),onMouseDown:B,onTouchStart:B,onClick:v?N:void 0,ref:p,...f,children:a})}const Ur=P.memo(t0(v_));function x_({data:e,isConnectable:t,sourcePosition:n=re.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Ur,{type:"source",position:n,isConnectable:t})]})}function w_({data:e,isConnectable:t,targetPosition:n=re.Top,sourcePosition:r=re.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Ur,{type:"source",position:r,isConnectable:t})]})}function k_(){return null}function S_({data:e,isConnectable:t,targetPosition:n=re.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Us={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Jf={input:x_,default:w_,output:S_,group:k_};function N_(e){var t,n,r,o;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??((o=e.style)==null?void 0:o.height)}}const E_=e=>{const{width:t,height:n,x:r,y:o}=di(e.nodeLookup,{filter:i=>!!i.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,${o}px)`}};function __({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=pe(),{width:o,height:i,transformString:s,userSelectionActive:l}=le(E_,we),a=i0(),u=P.useRef(null);P.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(o0({nodeRef:u,disabled:!c}),!c)return null;const d=e?p=>{const y=r.getState().nodes.filter(x=>x.selected);e(p,y)}:void 0,f=p=>{Object.prototype.hasOwnProperty.call(Us,p.key)&&(p.preventDefault(),a({direction:Us[p.key],factor:p.shiftKey?4:1}))};return h.jsx("div",{className:_e(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const eh=typeof window<"u"?window:void 0,C_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function a0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:k,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:j,autoPanOnSelection:b,defaultViewport:F,translateExtent:L,minZoom:U,maxZoom:B,preventScrolling:N,onSelectionContextMenu:T,noWheelClassName:z,noPanClassName:O,disableKeyboardA11y:$,onViewportChange:M,isControlledViewport:A}){const{nodesSelectionActive:I,userSelectionActive:H}=le(C_,we),ee=ei(u,{target:eh}),K=ei(x,{target:eh}),Y=K||j,V=K||k,X=c&&Y!==!0,E=ee||H||X;return r_({deleteKeyCode:a,multiSelectionKeyCode:y}),h.jsx(s_,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:V,panActivationKeyPressed:K,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:!ee&&Y,defaultViewport:F,translateExtent:L,minZoom:U,maxZoom:B,zoomActivationKeyCode:w,preventScrolling:N,noWheelClassName:z,noPanClassName:O,onViewportChange:M,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:X,children:h.jsxs(c_,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Y,autoPanOnSelection:b,isSelecting:!!E,selectionMode:d,selectionKeyPressed:ee,paneClickDistance:l,selectionOnDrag:X,children:[e,I&&h.jsx(__,{onSelectionContextMenu:T,noPanClassName:O,disableKeyboardA11y:$})]})})}a0.displayName="FlowRenderer";const j_=P.memo(a0),M_=e=>t=>e?$c(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 $_(e){return le(P.useCallback(M_(e),[e]),we)}const b_=e=>e.updateNodeInternals;function P_(){const e=le(b_),[t]=P.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return P.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function I_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=pe(),i=P.useRef(null),s=P.useRef(null),l=P.useRef(e.sourcePosition),a=P.useRef(e.targetPosition),u=P.useRef(t),c=n&&!!e.internals.handleBounds;return P.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),P.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),P.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||f||p)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function T_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:y,rfId:x,nodeTypes:w,nodeClickDistance:m,onError:v}){const{node:g,internals:k,isParent:C}=le(E=>{const R=E.nodeLookup.get(e),Q=E.parentLookup.has(e);return{node:R,internals:R.internals,isParent:Q}},we);let S=g.type||"default",_=(w==null?void 0:w[S])||Jf[S];_===void 0&&(v==null||v("003",Pt.error003(S)),S="default",_=(w==null?void 0:w.default)||Jf.default);const j=!!(g.draggable||l&&typeof g.draggable>"u"),b=!!(g.selectable||a&&typeof g.selectable>"u"),F=!!(g.connectable||u&&typeof g.connectable>"u"),L=!!(g.focusable||c&&typeof g.focusable>"u"),U=pe(),B=_g(g),N=I_({node:g,nodeType:S,hasDimensions:B,resizeObserver:d}),T=o0({nodeRef:N,disabled:g.hidden||!j,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:b,nodeClickDistance:m}),z=i0();if(g.hidden)return null;const O=Tt(g),$=N_(g),M=b||j||t||n||r||o,A=n?E=>n(E,{...k.userNode}):void 0,I=r?E=>r(E,{...k.userNode}):void 0,H=o?E=>o(E,{...k.userNode}):void 0,ee=i?E=>i(E,{...k.userNode}):void 0,K=s?E=>s(E,{...k.userNode}):void 0,Y=E=>{const{selectNodesOnDrag:R,nodeDragThreshold:Q}=U.getState();b&&(!R||!j||Q>0)&&wu({id:e,store:U,nodeRef:N}),t&&t(E,{...k.userNode})},V=E=>{if(!($g(E.nativeEvent)||y)){if(gg.includes(E.key)&&b){const R=E.key==="Escape";wu({id:e,store:U,unselect:R,nodeRef:N})}else if(j&&g.selected&&Object.prototype.hasOwnProperty.call(Us,E.key)){E.preventDefault();const{ariaLabelConfig:R}=U.getState();U.setState({ariaLiveMessage:R["node.a11yDescription.ariaLiveMessage"]({direction:E.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),z({direction:Us[E.key],factor:E.shiftKey?4:1})}}},X=()=>{var W;if(y||!((W=N.current)!=null&&W.matches(":focus-visible")))return;const{transform:E,width:R,height:Q,autoPanOnNodeFocus:G,setCenter:q}=U.getState();if(!G)return;$c(new Map([[e,g]]),{x:0,y:0,width:R,height:Q},E,!0).length>0||q(g.position.x+O.width/2,g.position.y+O.height/2,{zoom:E[2]})};return h.jsx("div",{className:_e(["react-flow__node",`react-flow__node-${S}`,{[p]:j},g.className,{selected:g.selected,selectable:b,parent:C,draggable:j,dragging:T}]),ref:N,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:B?"visible":"hidden",...g.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:I,onMouseLeave:H,onContextMenu:ee,onClick:Y,onDoubleClick:K,onKeyDown:L?V:void 0,tabIndex:L?0:void 0,onFocus:L?X:void 0,role:g.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${qg}-${x}`,"aria-label":g.ariaLabel,...g.domAttributes,children:h.jsx(f_,{value:e,children:h.jsx(_,{id:e,data:g.data,type:S,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:g.selected??!1,selectable:b,draggable:j,deletable:g.deletable??!0,isConnectable:F,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:T,dragHandle:g.dragHandle,zIndex:k.z,parentId:g.parentId,...O})})})}var z_=P.memo(T_);const L_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function u0(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=le(L_,we),i=$_(e.onlyRenderVisibleElements),s=P_();return h.jsx("div",{className:"react-flow__nodes",style:Sl,children:i.map(l=>h.jsx(z_,{id:l,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:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}u0.displayName="NodeRenderer";const A_=P.memo(u0);function R_(e){return le(P.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&gN({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),we)}const D_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},O_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},th={[qo.Arrow]:D_,[qo.ArrowClosed]:O_};function F_(e){const t=pe();return P.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(th,e)?th[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Pt.error009(e)),null)},[e])}const H_=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=F_(t);return a?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:h.jsx(a,{color:n,strokeWidth:s})}):null},c0=({defaultColor:e,rfId:t})=>{const n=le(i=>i.edges),r=le(i=>i.defaultEdgeOptions),o=P.useMemo(()=>EN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:o.map(i=>h.jsx(H_,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};c0.displayName="MarkerDefinitions";var B_=P.memo(c0);function d0({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,f]=P.useState({x:1,y:0,width:0,height:0}),p=_e(["react-flow__edge-textwrapper",u]),y=P.useRef(null);return P.useEffect(()=>{if(y.current){const x=y.current.getBBox();f({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...c,children:[o&&h.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}d0.displayName="EdgeText";const V_=P.memo(d0);function gi({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...c,d:e,fill:"none",className:_e(["react-flow__edge-path",c.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Ct(t)&&Ct(n)?h.jsx(V_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function nh({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===re.Left||e===re.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function f0({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top}){const[s,l]=nh({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=nh({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,p]=Pg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,p]}function h0(e){return P.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:w,interactionWidth:m})=>{const[v,g,k]=f0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),C=e.isInternal?void 0:t;return h.jsx(gi,{id:C,path:v,labelX:g,labelY:k,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:w,interactionWidth:m})})}const W_=h0({isInternal:!1}),p0=h0({isInternal:!0});W_.displayName="SimpleBezierEdge";p0.displayName="SimpleBezierEdgeInternal";function m0(e){return P.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:p=re.Bottom,targetPosition:y=re.Top,markerEnd:x,markerStart:w,pathOptions:m,interactionWidth:v})=>{const[g,k,C]=Ws({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),S=e.isInternal?void 0:t;return h.jsx(gi,{id:S,path:g,labelX:k,labelY:C,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:w,interactionWidth:v})})}const g0=m0({isInternal:!1}),y0=m0({isInternal:!0});g0.displayName="SmoothStepEdge";y0.displayName="SmoothStepEdgeInternal";function v0(e){return P.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return h.jsx(g0,{...n,id:r,pathOptions:P.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const U_=v0({isInternal:!1}),x0=v0({isInternal:!0});U_.displayName="StepEdge";x0.displayName="StepEdgeInternal";function w0(e){return P.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:x})=>{const[w,m,v]=Tg({sourceX:n,sourceY:r,targetX:o,targetY:i}),g=e.isInternal?void 0:t;return h.jsx(gi,{id:g,path:w,labelX:m,labelY:v,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:x})})}const Y_=w0({isInternal:!1}),k0=w0({isInternal:!0});Y_.displayName="StraightEdge";k0.displayName="StraightEdgeInternal";function S0(e){return P.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=re.Bottom,targetPosition:l=re.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:w,pathOptions:m,interactionWidth:v})=>{const[g,k,C]=Tc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:m==null?void 0:m.curvature}),S=e.isInternal?void 0:t;return h.jsx(gi,{id:S,path:g,labelX:k,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:w,interactionWidth:v})})}const X_=S0({isInternal:!1}),N0=S0({isInternal:!0});X_.displayName="BezierEdge";N0.displayName="BezierEdgeInternal";const rh={default:N0,straight:k0,step:x0,smoothstep:y0,simplebezier:p0},oh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},K_=(e,t,n)=>n===re.Left?e-t:n===re.Right?e+t:e,G_=(e,t,n)=>n===re.Top?e-t:n===re.Bottom?e+t:e,ih="react-flow__edgeupdater";function sh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return h.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:_e([ih,`${ih}-${l}`]),cx:K_(t,r,e),cy:G_(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Q_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const y=pe(),x=(k,C)=>{if(k.button!==0)return;const{autoPanOnConnect:S,domNode:_,connectionMode:j,connectionRadius:b,lib:F,onConnectStart:L,cancelConnection:U,nodeLookup:B,rfId:N,panBy:T,updateConnection:z}=y.getState(),O=C.type==="target",$=(I,H)=>{f(!1),d==null||d(I,n,C.type,H)},M=I=>u==null?void 0:u(n,I),A=(I,H)=>{f(!0),c==null||c(k,n,C.type),L==null||L(I,H)};xu.onPointerDown(k.nativeEvent,{autoPanOnConnect:S,connectionMode:j,connectionRadius:b,domNode:_,handleId:C.id,nodeId:C.nodeId,nodeLookup:B,isTarget:O,edgeUpdaterType:C.type,lib:F,flowId:N,cancelConnection:U,panBy:T,isValidConnection:(...I)=>{var H,ee;return((ee=(H=y.getState()).isValidConnection)==null?void 0:ee.call(H,...I))??!0},onConnect:M,onConnectStart:A,onConnectEnd:(...I)=>{var H,ee;return(ee=(H=y.getState()).onConnectEnd)==null?void 0:ee.call(H,...I)},onReconnectEnd:$,updateConnection:z,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},w=k=>x(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=k=>x(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>p(!0),g=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(sh,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:w,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&h.jsx(sh,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function q_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:y,edgeTypes:x,noPanClassName:w,onError:m,disableKeyboardA11y:v}){let g=le(q=>q.edgeLookup.get(e));const k=le(q=>q.defaultEdgeOptions);g=k?{...k,...g}:g;let C=g.type||"default",S=(x==null?void 0:x[C])||rh[C];S===void 0&&(m==null||m("011",Pt.error011(C)),C="default",S=(x==null?void 0:x.default)||rh.default);const _=!!(g.focusable||t&&typeof g.focusable>"u"),j=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),b=!!(g.selectable||r&&typeof g.selectable>"u"),F=P.useRef(null),[L,U]=P.useState(!1),[B,N]=P.useState(!1),T=pe(),{zIndex:z=g.zIndex,sourceX:O,sourceY:$,targetX:M,targetY:A,sourcePosition:I,targetPosition:H}=le(P.useCallback(q=>{const D=q.nodeLookup.get(g.source),W=q.nodeLookup.get(g.target);if(!D||!W)return oh;const Z=NN({id:e,sourceNode:D,targetNode:W,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:q.connectionMode,onError:m}),te=mN({selected:g.selected,zIndex:g.zIndex,sourceNode:D,targetNode:W,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode});return{...Z||oh,zIndex:te}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex,m]),we),ee=P.useMemo(()=>g.markerStart?`url('#${yu(g.markerStart,y)}')`:void 0,[g.markerStart,y]),K=P.useMemo(()=>g.markerEnd?`url('#${yu(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||O===null||$===null||M===null||A===null)return null;const Y=q=>{var te;const{addSelectedEdges:D,unselectNodesAndEdges:W,multiSelectionActive:Z}=T.getState();b&&(T.setState({nodesSelectionActive:!1}),g.selected&&Z?(W({nodes:[],edges:[g]}),(te=F.current)==null||te.blur()):D([e])),o&&o(q,g)},V=i?q=>{i(q,{...g})}:void 0,X=s?q=>{s(q,{...g})}:void 0,E=l?q=>{l(q,{...g})}:void 0,R=a?q=>{a(q,{...g})}:void 0,Q=u?q=>{u(q,{...g})}:void 0,G=q=>{var D;if(!v&&gg.includes(q.key)&&b){const{unselectNodesAndEdges:W,addSelectedEdges:Z}=T.getState();q.key==="Escape"?((D=F.current)==null||D.blur(),W({edges:[g]})):Z([e])}};return h.jsx("svg",{style:{zIndex:z},children:h.jsxs("g",{className:_e(["react-flow__edge",`react-flow__edge-${C}`,g.className,w,{selected:g.selected,animated:g.animated,inactive:!b&&!o,updating:L,selectable:b}]),onClick:Y,onDoubleClick:V,onContextMenu:X,onMouseEnter:E,onMouseMove:R,onMouseLeave:Q,onKeyDown:_?G:void 0,tabIndex:_?0:void 0,role:g.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":_?`${Zg}-${y}`:void 0,ref:F,...g.domAttributes,children:[!B&&h.jsx(S,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:b,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:$,targetX:M,targetY:A,sourcePosition:I,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:ee,markerEnd:K,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),j&&h.jsx(Q_,{edge:g,isReconnectable:j,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:O,sourceY:$,targetX:M,targetY:A,sourcePosition:I,targetPosition:H,setUpdateHover:U,setReconnecting:N})]})})}var Z_=P.memo(q_);const J_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function E0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:m,elementsSelectable:v,onError:g}=le(J_,we),k=R_(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(B_,{defaultColor:e,rfId:n}),k.map(C=>h.jsx(Z_,{id:C,edgesFocusable:w,edgesReconnectable:m,elementsSelectable:v,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:x},C))]})}E0.displayName="EdgeRenderer";const e2=P.memo(E0),lh=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function t2({children:e}){const t=pe(),n=P.useRef(null),[r]=P.useState(()=>t.getState().transform);return n0(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=lh(s)))};return i(),t.subscribe(i)},[t]),h.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:lh(r)},children:e})}function n2(e){const t=mi(),n=P.useRef(!1);P.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const r2=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function o2(e){const t=le(r2),n=pe();return P.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function i2(e){return e.connection.inProgress?{...e.connection,to:hi(e.connection.to,e.transform)}:{...e.connection}}function s2(e){return i2}function l2(e){const t=s2();return le(t,we)}const a2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function u2({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=le(a2,we);return!(i&&o&&a)?null:h.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:_e(["react-flow__connection",jg(l)]),children:h.jsx(_0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const _0=({style:e,type:t=pn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:f,pointer:p}=l2();if(!o)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:jg(r),toNode:c,toHandle:d,pointer:p});let y="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case pn.Bezier:[y]=Tc(x);break;case pn.SimpleBezier:[y]=f0(x);break;case pn.Step:[y]=Ws({...x,borderRadius:0});break;case pn.SmoothStep:[y]=Ws(x);break;default:[y]=Tg(x)}return h.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};_0.displayName="ConnectionLine";const c2={};function ah(e=c2){P.useRef(e),pe(),P.useEffect(()=>{},[e])}function d2(){pe(),P.useRef(!1),P.useEffect(()=>{},[])}function C0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:k,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:_,deleteKeyCode:j,onlyRenderVisibleElements:b,elementsSelectable:F,defaultViewport:L,translateExtent:U,minZoom:B,maxZoom:N,preventScrolling:T,defaultMarkerColor:z,zoomOnScroll:O,zoomOnPinch:$,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:I,zoomOnDoubleClick:H,panOnDrag:ee,autoPanOnSelection:K,onPaneClick:Y,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:E,onPaneScroll:R,onPaneContextMenu:Q,paneClickDistance:G,nodeClickDistance:q,onEdgeContextMenu:D,onEdgeMouseEnter:W,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:oe,onReconnect:de,onReconnectStart:me,onReconnectEnd:ke,noDragClassName:Me,noWheelClassName:ie,noPanClassName:Ae,disableKeyboardA11y:tt,nodeExtent:Pe,rfId:He,viewport:Be,onViewportChange:ct,nodesDraggable:qr}){return ah(e),ah(t),d2(),n2(n),o2(Be),h.jsx(j_,{onPaneClick:Y,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:E,onPaneContextMenu:Q,onPaneScroll:R,paneClickDistance:G,deleteKeyCode:j,selectionKeyCode:v,selectionOnDrag:g,selectionMode:k,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:F,zoomOnScroll:O,zoomOnPinch:$,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:A,panOnScrollMode:I,panOnDrag:ee,autoPanOnSelection:K,defaultViewport:L,translateExtent:U,minZoom:B,maxZoom:N,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:Me,noWheelClassName:ie,noPanClassName:Ae,disableKeyboardA11y:tt,onViewportChange:ct,isControlledViewport:!!Be,children:h.jsxs(t2,{children:[h.jsx(e2,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:de,onReconnectStart:me,onReconnectEnd:ke,onlyRenderVisibleElements:b,onEdgeContextMenu:D,onEdgeMouseEnter:W,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:oe,defaultMarkerColor:z,noPanClassName:Ae,disableKeyboardA11y:tt,rfId:He}),h.jsx(u2,{style:x,type:y,component:w,containerStyle:m}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(A_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:q,onlyRenderVisibleElements:b,noPanClassName:Ae,noDragClassName:Me,disableKeyboardA11y:tt,nodeExtent:Pe,rfId:He,nodesDraggable:qr}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}C0.displayName="GraphView";const f2=P.memo(C0),h2=Eg(),uh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,y=new Map,x=new Map,w=new Map,m=r??t??[],v=n??e??[],g=c??[0,0],k=d??Go;Ag(x,w,m);const{nodesInitialized:C}=vu(v,p,y,{nodeOrigin:g,nodeExtent:k,zIndexMode:f});let S=[0,0,1];if(s&&o&&i){const _=di(p,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:j,y:b,zoom:F}=Pc(_,o,i,a,u,(l==null?void 0:l.padding)??.1);S=[j,b,F]}return{rfId:"1",width:o??0,height:i??0,transform:S,nodes:v,nodesInitialized:C,nodeLookup:p,parentLookup:y,edges:m,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Go,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Fr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...vg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:h2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:yg,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},p2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>CE((p,y)=>{async function x(){const{nodeLookup:w,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:k,height:C,minZoom:S,maxZoom:_}=y();m&&(await aN({nodes:w,width:k,height:C,panZoom:m,minZoom:S,maxZoom:_},v),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...uh({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:w=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,nodeExtent:k,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:j}=y(),{nodesInitialized:b,hasSelectedNodes:F}=vu(w,m,v,{nodeOrigin:g,nodeExtent:k,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:_}),L=j&&F;S&&b?(x(),p({nodes:w,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:L})):p({nodes:w,nodesInitialized:b,nodesSelectionActive:L})},setEdges:w=>{const{connectionLookup:m,edgeLookup:v}=y();Ag(m,v,w),p({edges:w})},setDefaultNodesAndEdges:(w,m)=>{if(w){const{setNodes:v}=y();v(w),p({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:k,nodeOrigin:C,nodeExtent:S,debug:_,fitViewQueued:j,zIndexMode:b}=y(),{changes:F,updatedInternals:L}=PN(w,v,g,k,C,S,b);L&&(jN(v,g,{nodeOrigin:C,nodeExtent:S,zIndexMode:b}),j?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(F==null?void 0:F.length)>0&&(_&&console.log("React Flow: trigger node changes",F),m==null||m(F)))},updateNodePositions:(w,m=!1)=>{const v=[];let g=[];const{nodeLookup:k,triggerNodeChanges:C,connection:S,updateConnection:_,onNodesChangeMiddlewareMap:j}=y();for(const[b,F]of w){const L=k.get(b),U=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(F!=null&&F.position)),B={id:b,type:"position",position:U?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:m};if(L&&S.inProgress&&S.fromNode.id===L.id){const N=tr(L,S.fromHandle,re.Left,!0);_({...S,from:N})}U&&L.parentId&&v.push({id:b,parentId:L.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),g.push(B)}if(v.length>0){const{parentLookup:b,nodeOrigin:F}=y(),L=Dc(v,k,b,F);g.push(...L)}for(const b of j.values())g=b(g);C(g)},triggerNodeChanges:w=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:k,debug:C}=y();if(w!=null&&w.length){if(k){const S=XE(w,g);v(S)}C&&console.log("React Flow: trigger node changes",w),m==null||m(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:k,debug:C}=y();if(w!=null&&w.length){if(k){const S=KE(w,g);v(S)}C&&console.log("React Flow: trigger edge changes",w),m==null||m(w)}},addSelectedNodes:w=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:k,triggerEdgeChanges:C}=y();if(m){const S=w.map(_=>In(_,!0));k(S);return}k(Sr(g,new Set([...w]),!0)),C(Sr(v))},addSelectedEdges:w=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:k,triggerEdgeChanges:C}=y();if(m){const S=w.map(_=>In(_,!0));C(S);return}C(Sr(v,new Set([...w]))),k(Sr(g,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:S}=y(),_=w||g,j=m||v,b=[];for(const L of _){if(!L.selected)continue;const U=k.get(L.id);U&&(U.selected=!1),b.push(In(L.id,!1))}const F=[];for(const L of j)L.selected&&F.push(In(L.id,!1));C(b),S(F)},setMinZoom:w=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([w,v]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,w]),p({maxZoom:w})},setTranslateExtent:w=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:k}=y();if(!k)return;const C=m.reduce((_,j)=>j.selected?[..._,In(j.id,!1)]:_,[]),S=w.reduce((_,j)=>j.selected?[..._,In(j.id,!1)]:_,[]);v(C),g(S)},setNodeExtent:w=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:k,elevateNodesOnSelect:C,nodeExtent:S,zIndexMode:_}=y();w[0][0]===S[0][0]&&w[0][1]===S[0][1]&&w[1][0]===S[1][0]&&w[1][1]===S[1][1]||(vu(m,v,g,{nodeOrigin:k,nodeExtent:w,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:_}),p({nodeExtent:w}))},panBy:w=>{const{transform:m,width:v,height:g,panZoom:k,translateExtent:C}=y();return IN({delta:w,panZoom:k,transform:m,translateExtent:C,width:v,height:g})},setCenter:async(w,m,v)=>{const{width:g,height:k,maxZoom:C,panZoom:S}=y();if(!S)return!1;const _=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:C;return await S.setViewport({x:g/2-w*_,y:k/2-m*_,zoom:_},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0},cancelConnection:()=>{p({connection:{...vg}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...uh()})}},Object.is);function j0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:p}){const[y]=P.useState(()=>p2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return h.jsx(jE,{value:y,children:h.jsx(JE,{children:h.jsx(p_,{children:p})})})}function m2({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return P.useContext(kl)?h.jsx(h.Fragment,{children:e}):h.jsx(j0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}const g2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function y2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:k,onNodeContextMenu:C,onNodeDoubleClick:S,onNodeDragStart:_,onNodeDrag:j,onNodeDragStop:b,onNodesDelete:F,onEdgesDelete:L,onDelete:U,onSelectionChange:B,onSelectionDragStart:N,onSelectionDrag:T,onSelectionDragStop:z,onSelectionContextMenu:O,onSelectionStart:$,onSelectionEnd:M,onBeforeDelete:A,connectionMode:I,connectionLineType:H=pn.Bezier,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Y,deleteKeyCode:V="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:E=!1,selectionMode:R=Qo.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:G=Jo()?"Meta":"Control",zoomActivationKeyCode:q=Jo()?"Meta":"Control",snapToGrid:D,snapGrid:W,onlyRenderVisibleElements:Z=!1,selectNodesOnDrag:te,nodesDraggable:oe,autoPanOnNodeFocus:de,nodesConnectable:me,nodesFocusable:ke,nodeOrigin:Me=Jg,edgesFocusable:ie,edgesReconnectable:Ae,elementsSelectable:tt=!0,defaultViewport:Pe=FE,minZoom:He=.5,maxZoom:Be=2,translateExtent:ct=Go,preventScrolling:qr=!0,nodeExtent:bl,defaultMarkerColor:Q0="#b1b1b7",zoomOnScroll:q0=!0,zoomOnPinch:Z0=!0,panOnScroll:J0=!1,panOnScrollSpeed:ey=.5,panOnScrollMode:ty=Bn.Free,zoomOnDoubleClick:ny=!0,panOnDrag:ry=!0,onPaneClick:oy,onPaneMouseEnter:iy,onPaneMouseMove:sy,onPaneMouseLeave:ly,onPaneScroll:ay,onPaneContextMenu:uy,paneClickDistance:cy=1,nodeClickDistance:dy=0,children:fy,onReconnect:hy,onReconnectStart:py,onReconnectEnd:my,onEdgeContextMenu:gy,onEdgeDoubleClick:yy,onEdgeMouseEnter:vy,onEdgeMouseMove:xy,onEdgeMouseLeave:wy,reconnectRadius:ky=10,onNodesChange:Sy,onEdgesChange:Ny,noDragClassName:Ey="nodrag",noWheelClassName:_y="nowheel",noPanClassName:Vc="nopan",fitView:Wc,fitViewOptions:Uc,connectOnClick:Cy,attributionPosition:jy,proOptions:My,defaultEdgeOptions:$y,elevateNodesOnSelect:by=!0,elevateEdgesOnSelect:Py=!1,disableKeyboardA11y:Yc=!1,autoPanOnConnect:Iy,autoPanOnNodeDrag:Ty,autoPanOnSelection:zy=!0,autoPanSpeed:Ly,connectionRadius:Ay,isValidConnection:Ry,onError:Dy,style:Oy,id:Xc,nodeDragThreshold:Fy,connectionDragThreshold:Hy,viewport:By,onViewportChange:Vy,width:Wy,height:Uy,colorMode:Yy="light",debug:Xy,onScroll:vi,ariaLabelConfig:Ky,zIndexMode:Kc="basic",...Gy},Qy){const Pl=Xc||"1",qy=WE(Yy),Zy=P.useCallback(Gc=>{Gc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vi==null||vi(Gc)},[vi]);return h.jsx("div",{"data-testid":"rf__wrapper",...Gy,onScroll:Zy,style:{...Oy,...g2},ref:Qy,className:_e(["react-flow",o,qy]),id:Xc,role:"application",children:h.jsxs(m2,{nodes:e,edges:t,width:Wy,height:Uy,fitView:Wc,fitViewOptions:Uc,minZoom:He,maxZoom:Be,nodeOrigin:Me,nodeExtent:bl,zIndexMode:Kc,children:[h.jsx(VE,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:m,nodesDraggable:oe,autoPanOnNodeFocus:de,nodesConnectable:me,nodesFocusable:ke,edgesFocusable:ie,edgesReconnectable:Ae,elementsSelectable:tt,elevateNodesOnSelect:by,elevateEdgesOnSelect:Py,minZoom:He,maxZoom:Be,nodeExtent:bl,onNodesChange:Sy,onEdgesChange:Ny,snapToGrid:D,snapGrid:W,connectionMode:I,translateExtent:ct,connectOnClick:Cy,defaultEdgeOptions:$y,fitView:Wc,fitViewOptions:Uc,onNodesDelete:F,onEdgesDelete:L,onDelete:U,onNodeDragStart:_,onNodeDrag:j,onNodeDragStop:b,onSelectionDrag:T,onSelectionDragStart:N,onSelectionDragStop:z,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Vc,nodeOrigin:Me,rfId:Pl,autoPanOnConnect:Iy,autoPanOnNodeDrag:Ty,autoPanSpeed:Ly,onError:Dy,connectionRadius:Ay,isValidConnection:Ry,selectNodesOnDrag:te,nodeDragThreshold:Fy,connectionDragThreshold:Hy,onBeforeDelete:A,debug:Xy,ariaLabelConfig:Ky,zIndexMode:Kc}),h.jsx(f2,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:k,onNodeContextMenu:C,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:H,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Y,selectionKeyCode:X,selectionOnDrag:E,selectionMode:R,deleteKeyCode:V,multiSelectionKeyCode:G,panActivationKeyCode:Q,zoomActivationKeyCode:q,onlyRenderVisibleElements:Z,defaultViewport:Pe,translateExtent:ct,minZoom:He,maxZoom:Be,preventScrolling:qr,zoomOnScroll:q0,zoomOnPinch:Z0,zoomOnDoubleClick:ny,panOnScroll:J0,panOnScrollSpeed:ey,panOnScrollMode:ty,panOnDrag:ry,autoPanOnSelection:zy,onPaneClick:oy,onPaneMouseEnter:iy,onPaneMouseMove:sy,onPaneMouseLeave:ly,onPaneScroll:ay,onPaneContextMenu:uy,paneClickDistance:cy,nodeClickDistance:dy,onSelectionContextMenu:O,onSelectionStart:$,onSelectionEnd:M,onReconnect:hy,onReconnectStart:py,onReconnectEnd:my,onEdgeContextMenu:gy,onEdgeDoubleClick:yy,onEdgeMouseEnter:vy,onEdgeMouseMove:xy,onEdgeMouseLeave:wy,reconnectRadius:ky,defaultMarkerColor:Q0,noDragClassName:Ey,noWheelClassName:_y,noPanClassName:Vc,rfId:Pl,disableKeyboardA11y:Yc,nodeExtent:bl,viewport:By,onViewportChange:Vy,nodesDraggable:oe}),h.jsx(OE,{onSelectionChange:B}),fy,h.jsx(zE,{proOptions:My,position:jy}),h.jsx(TE,{rfId:Pl,disableKeyboardA11y:Yc})]})})}var v2=t0(y2);const x2=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function w2({children:e}){const t=le(x2);return t?Dm.createPortal(e,t):null}function k2({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_e(["react-flow__background-pattern",n,r])})}function S2({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:_e(["react-flow__background-pattern","dots",t])})}var Qt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qt||(Qt={}));const N2={[Qt.Dots]:1,[Qt.Lines]:1,[Qt.Cross]:6},E2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function M0({id:e,variant:t=Qt.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=P.useRef(null),{transform:f,patternId:p}=le(E2,we),y=r||N2[t],x=t===Qt.Dots,w=t===Qt.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*f[2]||1,m[1]*f[2]||1],g=y*f[2],k=Array.isArray(i)?i:[i,i],C=w?[g,g]:v,S=[k[0]*f[2]+C[0]/2,k[1]*f[2]+C[1]/2],_=`${p}${e||""}`;return h.jsxs("svg",{className:_e(["react-flow__background",u]),style:{...a,...Sl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:_,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:x?h.jsx(S2,{radius:g/2,className:c}):h.jsx(k2,{dimensions:C,lineWidth:o,variant:t,className:c})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}M0.displayName="Background";const _2=P.memo(M0);function C2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function j2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function M2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function $2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function b2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Wi({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:_e(["react-flow__controls-button",t]),...n,children:e})}const P2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const y=pe(),{isInteractive:x,minZoomReached:w,maxZoomReached:m,ariaLabelConfig:v}=le(P2,we),{zoomIn:g,zoomOut:k,fitView:C}=mi(),S=()=>{g(),i==null||i()},_=()=>{k(),s==null||s()},j=()=>{C(o),l==null||l()},b=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},F=f==="horizontal"?"horizontal":"vertical";return h.jsxs(pi,{className:_e(["react-flow__controls",F,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??v["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Wi,{onClick:S,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:h.jsx(C2,{})}),h.jsx(Wi,{onClick:_,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:w,children:h.jsx(j2,{})})]}),n&&h.jsx(Wi,{className:"react-flow__controls-fitview",onClick:j,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:h.jsx(M2,{})}),r&&h.jsx(Wi,{className:"react-flow__controls-interactive",onClick:b,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:x?h.jsx(b2,{}):h.jsx($2,{})}),c]})}$0.displayName="Controls";P.memo($0);function I2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:p}){const{background:y,backgroundColor:x}=i||{},w=s||y||x;return h.jsx("rect",{className:_e(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:w,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?m=>p(m,e):void 0})}const T2=P.memo(I2),z2=e=>e.nodes.map(t=>t.id),ha=e=>e instanceof Function?e:()=>e;function L2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=T2,onClick:s}){const l=le(z2,we),a=ha(t),u=ha(e),c=ha(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx(R2,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function A2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:f,height:p}=le(y=>{const x=y.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const w=x.internals.userNode,{x:m,y:v}=x.internals.positionAbsolute,{width:g,height:k}=Tt(w);return{node:w,x:m,y:v,width:g,height:k}},we);return!u||u.hidden||!_g(u)?null:h.jsx(l,{x:c,y:d,width:f,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const R2=P.memo(A2);var D2=P.memo(L2);const O2=200,F2=150,H2=e=>!e.hidden,B2=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]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Sg(di(e.nodeLookup,{filter:H2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ch=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,V2=(e,t)=>ch(e.viewBB,t.viewBB)&&ch(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,W2="react-flow__minimap-desc";function b0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:y,pannable:x=!1,zoomable:w=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:k=5}){const C=pe(),S=P.useRef(null),{boundingRect:_,panZoom:j,viewBB:b,rfId:F,translateExtent:L,flowWidth:U,flowHeight:B,ariaLabelConfig:N}=le(B2,V2),T=(e==null?void 0:e.width)??O2,z=(e==null?void 0:e.height)??F2,O=_.width/T,$=_.height/z,M=Math.max(O,$),A=M*T,I=M*z,H=k*M,ee=_.x-(A-_.width)/2-H,K=_.y-(I-_.height)/2-H,Y=A+H*2,V=I+H*2,X=`${W2}-${F}`,E=P.useRef(0),R=P.useRef();E.current=M,P.useEffect(()=>{const W=C.getState().panZoom;if(S.current&&W)return R.current=HN({domNode:S.current,panZoom:W,getTransform:()=>C.getState().transform,getViewScale:()=>E.current}),()=>{var Z;(Z=R.current)==null||Z.destroy()}},[j]),P.useEffect(()=>{var W;(W=R.current)==null||W.update({translateExtent:L,width:U,height:B,inversePan:v,pannable:x,zoomStep:g,zoomable:w})},[x,w,v,g,L,U,B]);const Q=p?W=>{var oe;const[Z,te]=((oe=R.current)==null?void 0:oe.pointer(W))||[0,0];p(W,{x:Z,y:te})}:void 0,G=P.useCallback((W,Z)=>{const te=C.getState().nodeLookup.get(Z).internals.userNode;y==null||y(W,te)},[y]),q=y?G:void 0,D=m??N["minimap.ariaLabel"];return h.jsx(pi,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M: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=="number"?s:void 0},className:_e(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:T,height:z,viewBox:`${ee} ${K} ${Y} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:S,onClick:Q,children:[D&&h.jsx("title",{id:X,children:D}),h.jsx(D2,{onClick:q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-H},${K-H}h${Y+H*2}v${V+H*2}h${-Y-H*2}z
|
|
62
|
-
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}b0.displayName="MiniMap";P.memo(b0);const U2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Y2={[Vr.Line]:"right",[Vr.Handle]:"bottom-right"};function X2({nodeId:e,position:t,variant:n=Vr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:y,onResizeStart:x,onResize:w,onResizeEnd:m}){const v=s0(),g=typeof e=="string"?e:v,k=pe(),C=P.useRef(null),S=n===Vr.Handle,_=le(P.useCallback(U2(S&&p),[S,p]),we),j=P.useRef(null),b=t??Y2[n];P.useEffect(()=>{if(!(!C.current||!g))return j.current||(j.current=eE({domNode:C.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:L,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,domNode:z}=k.getState();return{nodeLookup:L,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,paneDomNode:z}},onChange:(L,U)=>{const{triggerNodeChanges:B,nodeLookup:N,parentLookup:T,nodeOrigin:z}=k.getState(),O=[],$={x:L.x,y:L.y},M=N.get(g);if(M&&M.expandParent&&M.parentId){const A=M.origin??z,I=L.width??M.measured.width??0,H=L.height??M.measured.height??0,ee={id:M.id,parentId:M.parentId,rect:{width:I,height:H,...Cg({x:L.x??M.position.x,y:L.y??M.position.y},{width:I,height:H},M.parentId,N,A)}},K=Dc([ee],N,T,z);O.push(...K),$.x=L.x?Math.max(A[0]*I,L.x):void 0,$.y=L.y?Math.max(A[1]*H,L.y):void 0}if($.x!==void 0&&$.y!==void 0){const A={id:g,type:"position",position:{...$}};O.push(A)}if(L.width!==void 0&&L.height!==void 0){const I={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};O.push(I)}for(const A of U){const I={...A,type:"position"};O.push(I)}B(O)},onEnd:({width:L,height:U})=>{const B={id:g,type:"dimensions",resizing:!1,dimensions:{width:L,height:U}};k.getState().triggerNodeChanges([B])}})),j.current.update({controlPosition:b,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:w,onResizeEnd:m,shouldResize:y}),()=>{var L;(L=j.current)==null||L.destroy()}},[b,l,a,u,c,d,x,w,m,y]);const F=b.split("-");return h.jsx("div",{className:_e(["react-flow__resize-control","nodrag",...F,n,r]),ref:C,style:{...o,scale:_,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}P.memo(X2);function K2(){const e=new URLSearchParams(location.search).get("t");try{return e&&sessionStorage.setItem("illuminate-token",e),e??sessionStorage.getItem("illuminate-token")??""}catch{return e??""}}const Yr=K2(),Dt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Yr)}`,Ys=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Yr)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Yr)}`;class P0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function dt(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Yr,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new P0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const _t={list:()=>dt("GET","/api/maps"),get:e=>dt("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>dt("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),selection:(e,t,n)=>dt("PUT",`/api/maps/${encodeURIComponent(e)}/selection`,{selection:t,step:n}),ask:(e,t,n)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),code:(e,t,n="now")=>dt("GET",`/api/maps/${encodeURIComponent(e)}/code?item=${encodeURIComponent(t)}${n==="before"?"&when=before":""}`),answerCode:(e,t)=>dt("GET",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/code`),stop:()=>dt("POST","/api/stop")},G2=4e3;function I0(e,t,n,r){let o=null,i=!1,s=null;const l=()=>{o=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?t=${encodeURIComponent(Yr)}${r?`&m=${encodeURIComponent(r)}`:""}`),o.onopen=()=>t(!0),o.onmessage=a=>{try{e(JSON.parse(String(a.data)))}catch{}},o.onclose=a=>{t(!1),a.code===G2?(i=!0,n()):i||(s=setTimeout(l,1e3))}};return l(),()=>{i=!0,s&&clearTimeout(s),o==null||o.close()}}const T0={name:"Claude",asks:"page"},Nl=e=>e.asks==="chat";function Q2(e,t,n){return{title:`Ask in the ${e.name} chat beside this page`,detail:t?`${e.name} will see what you selected here.`:n?`${e.name} will know you're on the step “${n}”.`:`${e.name} will see what you select here.`}}function q2(e,t,n){return Nl(e)?{selection:t,step:n}:null}function Z2(e,t){var r;if(((r=e.offer)==null?void 0:r.status)==="pending")return!0;const n=e.fix?t[e.fix.id]:void 0;return!!n&&(n.status==="proposed"||n.status==="applying"||n.status==="failed"||n.status==="applied"&&n.undoable)}function J2(e,t,n){return Nl(e)?t.filter(r=>Z2(r,n)):t}const Fc=[{id:"vscode",name:"VS Code"},{id:"cursor",name:"Cursor"},{id:"windsurf",name:"Windsurf"},{id:"zed",name:"Zed"}];function eC(e,t,n,r){const o=`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${n}`;return`${e}://file${o.startsWith("/")?"":"/"}${o.split("/").map(encodeURIComponent).join("/").replace(/%3A/g,":")}:${r}`}const ku=(...e)=>e.filter(Boolean).join(" "),ti=e=>{try{return localStorage.getItem(e)}catch{return null}},El=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};function tC(){const[e,t]=P.useState(()=>{var n;return((n=Fc.find(r=>r.id===ti("illuminate-editor")))==null?void 0:n.id)??"vscode"});return[e,n=>{El("illuminate-editor",n),t(n)}]}function z0(e,t){const[n,r]=P.useState(void 0);return P.useEffect(()=>{let o=!0;return e().then(i=>o&&r(i),()=>o&&r(null)),()=>{o=!1}},t),n}const nC=(e,t)=>`${e}:${t}`;function rC({block:e,root:t,editor:n,before:r}){const o=P.useRef(null);P.useEffect(()=>{const u=o.current,c=u==null?void 0:u.querySelector(".code-line.cited");u&&c&&c.offsetTop-u.offsetTop+c.offsetHeight>u.clientHeight&&(u.scrollTop=Math.max(0,c.offsetTop-u.offsetTop-48))},[e.file,e.start,e.cited.join(",")]);const i=new Set(e.cited),s=new Map(e.notes.map(u=>[u.line,u.note])),l=e.cited[0]??e.start,a=Fc.find(u=>u.id===n).name;return h.jsxs("figure",{className:"code-block",children:[h.jsxs("figcaption",{className:"code-cap",children:[h.jsxs("span",{className:"code-where",children:[e.name&&h.jsx("strong",{className:"code-name",children:e.name}),h.jsxs("span",{className:"code-file",children:[e.file,!e.whole&&`:${e.start}`]})]}),!r&&h.jsxs("a",{className:"code-open",href:eC(n,t,e.file,l),title:`Open ${e.file} at line ${l} in ${a}`,children:["Open in ",a]})]}),h.jsx("div",{className:"code-lines",ref:o,tabIndex:0,"aria-label":`Code from ${e.file}`,children:h.jsx("div",{className:"code-inner",children:e.lines.map((u,c)=>{const d=e.start+c;return h.jsxs("div",{"data-at":nC(e.file,d),className:ku("code-line",i.has(d)&&"cited",s.has(d)&&"noted"),children:[h.jsx("span",{className:"code-n",children:d}),h.jsx("span",{className:"code-t",children:u||" "}),s.has(d)&&h.jsx("span",{className:"code-note",children:s.get(d)})]},d)})})})]})}function L0({view:e,jump:t,before:n=!1,what:r}){const[o,i]=tC(),s=P.useRef(null);return P.useEffect(()=>{var u;if(!t)return;const l=[...((u=s.current)==null?void 0:u.querySelectorAll(".code-line"))??[]].find(c=>c.dataset.at===t.at);if(!l)return;l.scrollIntoView({block:"center",behavior:"smooth"}),l.classList.add("flash");const a=setTimeout(()=>l.classList.remove("flash"),1200);return()=>clearTimeout(a)},[t==null?void 0:t.at,t==null?void 0:t.n,e]),h.jsxs("div",{className:"code-view",ref:s,children:[e.blocks.map(l=>h.jsx(rC,{block:l,root:e.root,editor:o,before:n},`${l.file}:${l.start}`)),e.missing>0&&h.jsxs("p",{className:"warn small code-missing",children:[e.missing===1?`1 ${r} isn’t`:`${e.missing} ${r}s aren’t`," in ",n?"that version of the code":"the code any more",", so ",e.missing===1?"it isn’t":"they aren’t"," shown."]}),!n&&e.blocks.length>0&&h.jsxs("label",{className:"code-editor",children:["Links open in"," ",h.jsx("select",{value:o,onChange:l=>i(l.target.value),"aria-label":"Which editor code links open in",children:Fc.map(l=>h.jsx("option",{value:l.id,children:l.name},l.id))})]})]})}function oC({mapId:e,itemId:t,change:n,since:r,stamp:o,jump:i}){const[s,l]=P.useState(n==="removed"?"before":"now"),a=z0(()=>_t.code(e,t,s),[e,t,s,o]),u=n==="changed"&&h.jsxs("div",{className:"seg code-when",role:"group","aria-label":"Which version of the code to show",children:[h.jsxs("button",{className:ku("seg-btn",s==="before"&&"on"),"aria-pressed":s==="before",onClick:()=>l("before"),children:["As it was at ",r]}),h.jsx("button",{className:ku("seg-btn",s==="now"&&"on"),"aria-pressed":s==="now",onClick:()=>l("now"),children:"Now"})]});return a===void 0?u||null:!a||!a.blocks.length&&!a.missing?u?h.jsxs(h.Fragment,{children:[u,h.jsx("p",{className:"muted small",children:"No code to show for that version."})]}):null:h.jsxs(h.Fragment,{children:[u,h.jsx(L0,{view:a,jump:i,before:s==="before",what:"cited line"})]})}function iC({mapId:e,answerId:t,stamp:n}){const r=z0(()=>_t.answerCode(e,t),[e,t,n]);return!r||!r.blocks.length&&!r.missing?null:h.jsx(L0,{view:r,what:"note"})}const sC=()=>A0("illuminate-code"),lC=()=>A0("illuminate-diff");function A0(e){const[t,n]=P.useState(()=>ti(e)==="show");return[t,r=>{El(e,r?"show":"hide"),n(r)}]}const jo=(...e)=>e.filter(Boolean).join(" "),dn=e=>`${Math.max(0,Math.min(1,e))*100}%`;function Xs(e,t){var r;const n=(r=e==null?void 0:e.screens)==null?void 0:r[t];return(n==null?void 0:n.status)==="confirmed"?n.show:null}function R0({show:e,small:t=!1}){var a;const n=u=>e.page.regions.filter(c=>c.slot===u),r=(a=e.highlight)==null?void 0:a.trim().toLowerCase(),o=u=>{const c=u.id===e.region,d=p=>c&&p.text.trim().toLowerCase()===r,f=t?u.elements.filter(d):u.elements;return h.jsxs("div",{className:jo("wf-region",c&&"wf-on"),children:[h.jsx("span",{className:"wf-label",children:u.label}),h.jsx("span",{className:"wf-els",children:f.map((p,y)=>h.jsx("span",{className:jo("sk",`sk-${p.kind}`,d(p)&&"sk-mark"),title:p.text,children:p.kind==="image"?`▧ ${p.text}`:p.text},y))})]},u.id)},i=u=>n(u).length?h.jsx("div",{className:`wf-slot wf-${u}`,children:n(u).map(o)}):null,s=n("left").length+n("right").length,l=[n("left").length&&"minmax(0, 1fr)",(n("main").length||!s)&&"minmax(0, 2.6fr)",n("right").length&&"minmax(0, 1fr)"].filter(Boolean).join(" ");return h.jsxs("div",{className:jo("wf",t&&"wf-small"),children:[i("top"),(s>0||n("main").length>0)&&h.jsxs("div",{className:"wf-mid",style:{gridTemplateColumns:l},children:[i("left"),i("main"),i("right")]}),i("bottom")]})}function D0({show:e,name:t}){var i;const[n,r]=P.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${dn(s.x+s.w/2)} ${dn(s.y+s.h/2)}`:void 0;return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:h.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[h.jsx("img",{src:Ys(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&h.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:dn(s.x),top:dn(s.y),width:dn(s.w),height:dn(s.h)}})]})}),h.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&h.jsxs(h.Fragment,{children:[" · ",h.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="wireframe")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(R0,{show:e})}),h.jsxs("figcaption",{className:"muted small",children:["Wireframe of ",e.page.name,", from ",e.page.file,". Where things sit is approximate; it isn’t a screenshot."]})]});if(e.kind==="image")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-image",children:h.jsx("img",{src:Ys(e),alt:`Image used at “${t}”`,loading:"lazy"})}),h.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>h.jsxs("span",{className:jo("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),title:s.proposed?"Proposed: not on the screen yet":void 0,children:[s.kind==="image"?`▧ ${s.text}`:s.text,s.proposed&&h.jsx("i",{className:"sk-new",children:"proposed"})]},l))}),h.jsxs("figcaption",{className:"muted small",children:[e.elements.every(s=>s.proposed)?`Rough sketch of a proposed screen (${e.file})`:`Rough sketch from ${e.file}, not a screenshot`,e.elements.some(s=>s.proposed)&&!e.elements.every(s=>s.proposed)&&" · violet parts are proposed"]})]})}function aC({show:e,name:t}){var r;if(e.kind==="sketch"){const o=(r=e.highlight)==null?void 0:r.trim().toLowerCase(),i=e.elements.slice(0,4);return h.jsxs("div",{className:"thumb thumb-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:[i.map((s,l)=>h.jsx("span",{className:jo("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),children:s.kind==="image"?`▧ ${s.text}`:s.text},l)),e.elements.length>i.length&&h.jsxs("span",{className:"thumb-more",children:["+",e.elements.length-i.length," more"]})]})}if(e.kind==="wireframe")return h.jsx("div",{className:"thumb thumb-wire",role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(R0,{show:e,small:!0})});if(e.kind==="image")return h.jsx("div",{className:"thumb thumb-image",children:h.jsx("img",{src:Ys(e),alt:`Image used at “${t}”`,loading:"lazy"})});const n=e.box;return h.jsx("div",{className:"thumb thumb-shot",children:h.jsx("img",{src:Ys(e),alt:`The screen at “${t}”`,loading:"lazy",style:n?{transform:"scale(1.8)",transformOrigin:`${dn(n.x+n.w/2)} ${dn(n.y+n.h/2)}`}:void 0})})}const dh=/^\s*(```|~~~)/,uC=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,cC=/^\s*[-*+•]\s+(.*)$/,dC=/^\s*(\d{1,4})[.)]\s+(.*)$/;function fC(e){const t=e.replace(/\r\n?/g,`
|
|
63
|
-
`).split(`
|
|
64
|
-
`),n=[];let r=[];const o=()=>{r.length&&n.push({kind:"p",text:r.join(`
|
|
65
|
-
`)}),r=[]};for(let i=0;i<t.length;i++){const s=t[i];if(dh.test(s)){o();const d=[];for(i++;i<t.length&&!dh.test(t[i]);i++)d.push(t[i]);n.push({kind:"code",text:d.join(`
|
|
66
|
-
`)});continue}if(!s.trim()){o();continue}const l=uC.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=cC.exec(s),u=a?null:dC.exec(s);if(a||u){o();const d=a?"ul":"ol",f=n[n.length-1],p=a?a[1]:u[2];f&&f.kind===d?f.items.push(p):n.push(d==="ul"?{kind:d,items:[p]}:{kind:d,items:[p],start:Number(u[1])});continue}const c=n[n.length-1];if(!r.length&&c&&(c.kind==="ul"||c.kind==="ol")&&/^\s+\S/.test(s)){c.items[c.items.length-1]+=` ${s.trim()}`;continue}r.push(s)}return o(),n}const hC=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function Rn(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
|
|
67
|
-
`).forEach((l,a)=>{a>0&&n.push(h.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(hC)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(h.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(h.jsx("strong",{children:Rn(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(h.jsx("em",{children:Rn(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?h.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:Rn(s[7],l)},l):h.jsx("span",{children:Rn(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function ni({text:e,className:t}){const n=fC(e);return n.length?h.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return h.jsx("p",{children:Rn(r.text,i)},i);if(r.kind==="h")return h.jsx("p",{className:"md-h",children:Rn(r.text,i)},i);if(r.kind==="code")return h.jsx("pre",{children:h.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>h.jsx("li",{children:Rn(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?h.jsx("ul",{children:s},i):h.jsx("ol",{start:r.start,children:s},i)})}):null}const pC=/^About the walkthrough step “([^”]*)”: /,mC=(e,t)=>`About the walkthrough step “${e}”: ${t}`;function gC(e){const t=pC.exec(e);return t?{question:e.slice(t[0].length),step:t[1]}:{question:e,step:null}}const ar=()=>({nodes:[],edges:[],absences:[]}),mo=e=>e.nodes.length+e.edges.length+e.absences.length,yC=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:ar(),tour:null,peek:!1,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1,agent:T0}),vC=e=>e.views[e.viewIndex]??null;function yi(e){if(!e.map)return[];const t=new Set([...e.map.areas,...e.map.nodes,...e.map.edges,...e.map.absences].map(n=>n.id));return e.answers.flatMap(n=>{const r=n.added.filter(o=>t.has(o));return r.length?[{answerId:n.id,question:n.question,ids:r,visible:!e.hidden.includes(n.id)}]:[]})}const xC=e=>yi(e).flatMap(t=>t.ids);function O0(e){if(!e.map)return null;const t=new Set(yi(e).filter(o=>!o.visible).flatMap(o=>o.ids));if(!t.size)return e.map;const n=e.map.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e.map,areas:e.map.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.map.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.map.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}function wC(e,t){if(!t)return e;const n=(r,o)=>r.filter(i=>o.some(s=>s.id===i));return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges),absences:n(e.absences,t.absences)}}function kC(e,t){var s,l,a;const n=e.tour[t];if(!n)return null;const r=e.nodes.filter(u=>{var c;return(c=n.focus.areas)==null?void 0:c.includes(u.area)}).map(u=>u.id),o=[...n.focus.nodes??[],...n.focus.edges??[],...n.focus.absences??[],...r],i=(n.focus.edges??[]).length||(n.focus.absences??[]).length?[]:F0(e,new Set(o));return{focus:((s=n.focus.nodes)==null?void 0:s[0])??((l=n.focus.edges)==null?void 0:l[0])??((a=n.focus.absences)==null?void 0:a[0])??null,highlight:[...new Set([...o,...i])]}}function F0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function fh(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...F0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function sr(e,t){if(!t)return e;const n=[...e.views.slice(0,e.viewIndex+1),t].slice(-50);return{...e,views:n,viewIndex:n.length-1}}function hh(e,t,n){const r={...t};for(const o of e){if(!o.fix||r[o.fix.id]&&!n)continue;const i=n?n[o.fix.id]:{status:"proposed"};r[o.fix.id]={proposal:o.fix,answerId:o.id,status:(i==null?void 0:i.status)??"rejected",problems:[],edgeId:(i==null?void 0:i.edgeId)??null,closed:(i==null?void 0:i.closed)??[],undoable:(i==null?void 0:i.undoable)??!0}}return r}function SC(e,t){var n;switch(t.type){case"loaded":{const r=t.payload,o=r.map?"ready":r.job?"making":r.failure?"failed":"missing";return{...e,phase:o,meta:r.meta,map:r.map,report:r.report,job:r.job,error:((n=r.failure)==null?void 0:n.error)??null,answers:r.answers,shown:null,fixes:hh(r.answers,e.fixes,r.fixes??{}),agent:r.agent??e.agent}}case"missing":return{...e,phase:"missing"};case"connected":return{...e,connected:t.value};case"event":{const r=t.event;if(r.mapId!==e.mapId)return e;if(r.type==="job")return r.status==="started"?{...e,job:{kind:r.job,question:r.question,progress:[]},error:null,phase:r.job==="make"?"making":e.phase}:r.status==="failed"?{...e,job:null,error:r.error??"Something went wrong.",phase:r.job==="make"&&!e.map?"failed":e.phase}:{...e,job:null};if(r.type==="progress")return e.job?{...e,job:{...e.job,progress:[...e.job.progress,r.text].slice(-200)}}:e;if(r.type==="map"){const o=s=>s.filter(l=>r.map.nodes.some(a=>a.id===l)||r.map.edges.some(a=>a.id===l)||r.map.absences.some(a=>a.id===l)),i={nodes:o(e.selection.nodes),edges:o(e.selection.edges),absences:o(e.selection.absences)};return{...e,phase:"ready",meta:r.meta,map:r.map,report:r.report,selection:i}}if(r.type==="answer"){const o=[...e.answers,r.answer],i={...e,answers:o,shown:r.answer.id,tour:null,peek:!1,fresh:r.answer.added,fixes:hh([r.answer],e.fixes,void 0)};return sr(i,fh(e.map,r.answer))}if(r.type==="answerUpdate")return{...e,answers:e.answers.map(o=>o.id===r.answer.id?r.answer:o)};if(r.type==="fix"){const o=e.fixes[r.fixId];if(!o)return e;const i=r.status,s={...e.fixes,[r.fixId]:{...o,status:i,problems:r.problems??[],edgeId:r.edgeId??o.edgeId,closed:r.closed??o.closed,undoable:r.status==="applied"?!0:o.undoable}},l={...e,fixes:s};if(r.status==="applied"&&r.edgeId){const a=o.proposal.connects;return sr(l,{focus:r.edgeId,highlight:[r.edgeId,...a?[a.from,a.to]:[]]})}return l}return e}case"select":{const r=e.selection[t.kind],o=r.includes(t.id),i=t.additive?{...e.selection,[t.kind]:o?r.filter(s=>s!==t.id):[...r,t.id]}:{...ar(),[t.kind]:o&&mo(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:ar()};case"tour":{if(t.stop===null||!e.map)return{...e,tour:null,peek:!1};const r=Math.max(0,Math.min(t.stop,e.map.tour.length-1));return sr({...e,tour:r,selection:ar()},kC(e.map,r))}case"peek":{if(!t.open)return{...e,peek:!1};const r=e.answers[e.answers.length-1];return r?{...e,peek:!0,shown:e.shown??r.id}:e}case"focus":{if(!e.map)return e;const r=e.map.nodes.some(o=>o.id===t.id)?"nodes":e.map.edges.some(o=>o.id===t.id)?"edges":e.map.absences.some(o=>o.id===t.id)?"absences":null;return r?sr({...e,tour:null,peek:!1,selection:{...ar(),[r]:[t.id]}},{focus:t.id,highlight:[t.id]}):e}case"back":return e.viewIndex>0?{...e,viewIndex:e.viewIndex-1}:e.viewIndex===0?{...e,viewIndex:-1}:e;case"forward":return e.viewIndex<e.views.length-1?{...e,viewIndex:e.viewIndex+1}:e;case"show":{const r=e.answers.find(o=>o.id===t.answerId);return sr({...e,shown:t.answerId,tour:null,peek:!1},r?fh(e.map,r):null)}case"overview":return sr({...e,shown:null,tour:null,peek:!1,selection:ar(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:yi(e).map(s=>s.answerId),o=t.visible?e.hidden.filter(s=>!r.includes(s)):[...new Set([...e.hidden,...r])],i={...e,hidden:o};return{...i,selection:wC(e.selection,O0(i))}}case"fixStatus":{const r=e.fixes[t.fixId];return r?{...e,fixes:{...e.fixes,[t.fixId]:{...r,status:t.status,problems:t.problems??r.problems}}}:e}case"error":return{...e,error:t.message}}}const Xr=(...e)=>e.filter(Boolean).join(" ");function et(e,t){const n=e.nodes.find(s=>s.id===t);if(n)return n.name;const r=e.edges.find(s=>s.id===t);if(r)return`${et(e,r.from)} → ${et(e,r.to)}`;const o=e.absences.find(s=>s.id===t);if(o)return o.claim;const i=e.areas.find(s=>s.id===t);return(i==null?void 0:i.label)??t}const NC={add:{pending:"Proposed: this isn’t in the code yet.",done:"This was proposed, and the code now has it."},change:{pending:"Proposed: this code would change.",done:"This was proposed to change, and the code here has changed since."},remove:{pending:"Proposed: this code would be removed.",done:"This was proposed for removal, and it’s no longer in the code."}},EC={added:"New since",changed:"Changed since",removed:"Removed since"};function Su(e,t){return e?e.nodes[t]??e.edges[t]??(e.absences[t]?{status:e.absences[t].status,reasons:e.absences[t].reasons}:null):null}function Ke({eyebrow:e,title:t,children:n,tone:r,className:o}){return h.jsxs("section",{className:Xr("card",r&&`card-${r}`,o),children:[e&&h.jsx("div",{className:"eyebrow",children:e}),t&&h.jsx("h2",{className:"card-title",children:t}),n]})}function _C({map:e,ids:t,onPick:n}){return t.length?h.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>h.jsxs("button",{className:Xr("chip",o==="proposed"?"chip-proposed":o!=="confirmed"&&"chip-unconfirmed"),onClick:()=>n(r),title:o==="confirmed"?"Confirmed against the code":o==="proposed"?"Part of a proposal, not in the code":"Couldn't confirm against the code",children:[h.jsx("span",{className:o==="confirmed"?"tick":o==="proposed"?"pmark":"qmark",children:o==="confirmed"?"✓":o==="proposed"?"+":"?"}),et(e,r)]},r))}):null}function ph({lines:e,working:t}){const n=e.slice(-8);return h.jsxs("ul",{className:"progress",children:[n.map((r,o)=>h.jsxs("li",{className:Xr(t&&o===n.length-1&&"running"),children:[h.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&h.jsxs("li",{className:"running",children:[h.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function CC({fix:e,onApprove:t,onReject:n,onUndo:r,map:o}){const i=e.proposal,s=i.files.filter(l=>l.uncommitted);return e.status==="applied"?h.jsxs(Ke,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[h.jsxs("ul",{className:"progress",children:[h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",et(o,e.edgeId)]}),e.closed.length>0&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):h.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?h.jsxs(Ke,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[h.jsx(ni,{text:i.summary,className:"muted"}),e.status==="undone"&&h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):h.jsxs(Ke,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[h.jsx(ni,{text:i.summary}),i.connects&&h.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),h.jsx("pre",{className:"diff",children:i.diff.split(`
|
|
68
|
-
`).map((l,a)=>h.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
|
|
69
|
-
`]},a))}),s.length>0?h.jsxs("p",{className:"warn small",children:["⚠ ",s.map(l=>l.file).join(", ")," ",s.length===1?"has":"have"," uncommitted changes. They'll be kept; the fix applies on top."]}):null,e.problems.length>0&&h.jsx("ul",{className:"problems",children:e.problems.map(l=>h.jsx("li",{children:l},l))}),h.jsxs("div",{className:"btns",children:[h.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),h.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),h.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function jC({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=P.useRef(null);if(P.useEffect(()=>{const d=a.current;d&&(d.scrollTop=d.scrollHeight)},[e.answers.length,l==null?void 0:l.progress.length,!!l]),e.phase==="loading")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Ke,{children:h.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Ke,{title:"No map here",children:h.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return h.jsx("aside",{className:"panel",children:h.jsxs("div",{className:"panel-scroll",children:[l&&h.jsx(Ke,{eyebrow:"Making your map",title:l.question,tone:"ai",children:h.jsx(ph,{lines:l.progress,working:!0})}),e.phase==="failed"&&h.jsx(Ke,{title:"The map couldn't be made",tone:"dead",children:h.jsx("p",{children:e.error})})]})});[...e.selection.nodes,...e.selection.edges,...e.selection.absences];const u=yi(e),c=u.length>0&&u.every(d=>!d.visible);return h.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[h.jsxs("header",{className:"panel-head",children:[h.jsx("h2",{className:"panel-title",children:"Conversation"}),u.length>0&&h.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:c}),children:c?"Show everything":"Show the original map"}),h.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t(e.tour!==null?{type:"peek",open:!1}:{type:"overview"}),children:"×"})]}),h.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&h.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,h.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(d=>h.jsx(MC,{answer:d,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},d.id)),(l==null?void 0:l.kind)==="ask"&&h.jsxs("article",{className:"turn",children:[h.jsx(H0,{question:l.question}),h.jsx(Ke,{eyebrow:`${e.agent.name} is working`,tone:"ai",children:h.jsx(ph,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&h.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),h.jsx("footer",{className:"panel-foot",children:i})]})}function H0({question:e,about:t}){const{question:n,step:r}=gC(e),o=[r&&`the step “${r}”`,t].filter(Boolean);return h.jsxs("div",{className:"you",children:[h.jsx("p",{className:"you-q",children:n}),o.length>0&&h.jsxs("span",{className:"you-about",children:["About ",o.join(", ")]})]})}function MC({answer:e,state:t,dispatch:n,onFix:r,onFocus:o,onOffer:i}){const s=t.map,l=e.fix?t.fixes[e.fix.id]??null:null,a=e.id===t.shown&&t.tour===null,u=[...e.selection.nodes??[],...e.selection.edges??[],...e.selection.absences??[]].map(x=>et(s,x)).join(", "),c=yi(t).find(x=>x.answerId===e.id),d=e.problems.filter(x=>x.startsWith("The proposed fix")),f=e.problems.filter(x=>!x.startsWith("The proposed fix")),p=e.refs.filter(x=>{var w;return x.status!=="unknown"&&((w=Su(t.report,x.id))==null?void 0:w.status)==="unconfirmed"}).map(x=>x.id),y=e.moves.highlight.length>0||!!e.moves.focus||e.added.length>0||(e.screens??[]).length>0;return h.jsxs("article",{className:"turn",children:[h.jsx(H0,{question:e.question,about:u||void 0}),e.offer?h.jsx($C,{answer:e,busy:!!t.job,agentName:t.agent.name,onOffer:i}):h.jsxs("section",{className:Xr("card","reply",a&&"card-focus"),children:[h.jsxs("div",{className:"reply-meta",children:[h.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),y&&(a?h.jsx("span",{className:"reply-lit",children:"Lit on the map"}):h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),h.jsx(ni,{text:e.concept,className:"depth-text"}),(e.notes??[]).length>0&&h.jsx(iC,{mapId:t.mapId,answerId:e.id,stamp:t.report}),(e.screens??[]).map(x=>{const w=Xs(t.report,x);return w?h.jsx(D0,{show:w,name:et(s,x)},x):null}),p.length>0&&h.jsxs("p",{className:"warn small reply-warn",children:["Relies on ",p.length===1?"1 thing":`${p.length} things`," the checker couldn't confirm:"," ",p.map((x,w)=>h.jsxs("span",{children:[w>0&&", ",h.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(x),children:et(s,x)})]},x))]}),c&&h.jsxs("div",{className:"reply-added",children:[h.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),f.length>0&&h.jsxs("details",{className:"problems-box",children:[h.jsxs("summary",{children:[f.length," thing",f.length===1?"":"s"," Claude found but couldn't confirm or show"]}),h.jsx("ul",{className:"problems",children:f.map(x=>h.jsx("li",{children:x},x))})]})]}),l&&h.jsx(CC,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),d.length>0&&h.jsxs(Ke,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[h.jsx("ul",{className:"problems",children:d.map(x=>h.jsx("li",{children:x.replace("The proposed fix can't be applied: ","")},x))}),h.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function $C({answer:e,busy:t,agentName:n,onOffer:r}){const o=e.offer;return o.status==="mapped"?h.jsxs(Ke,{eyebrow:"A different part of the app",children:[h.jsx("p",{className:"muted",children:"You made a new map for this."}),o.mapId&&h.jsx("div",{className:"btns",children:h.jsx("a",{className:"btn primary",href:Dt(o.mapId),children:"Open it"})})]}):o.status==="answered"?h.jsx(Ke,{eyebrow:"A different part of the app",children:h.jsx("p",{className:"muted",children:"Answered in words, below."})}):h.jsxs(Ke,{eyebrow:"A different part of the app",tone:"ai",children:[h.jsx("p",{children:"This is about a different part of the app than this map shows."}),o.existing&&h.jsxs("p",{children:["There's already a map for it: “",o.existing.question,"”."]}),h.jsxs("div",{className:"btns",children:[o.existing&&h.jsx("a",{className:"btn primary",href:Dt(o.existing.id),children:"Open that map"}),h.jsx("button",{className:o.existing?"btn":"btn primary",onClick:()=>r(e.id,"map"),children:"Make a new map for this"}),h.jsx("button",{className:"btn",disabled:t,onClick:()=>r(e.id,"words"),title:t?`${n} is still working on this map`:void 0,children:"Just answer in words"})]})]})}function bC({mapId:e,map:t,report:n,ids:r,onClose:o}){var b,F,L,U,B;const[i,s]=sC(),[l,a]=lC(),[u,c]=P.useState(null),d=h.jsx("button",{className:"card-close","aria-label":"Close",title:"Close (Esc)",onClick:o,children:"×"});if(r.length>1)return h.jsxs(Ke,{eyebrow:`Asking about ${r.length} things`,className:"card-selected",children:[d,h.jsx(_C,{map:t,ids:r.map(N=>{var T;return{id:N,status:((T=Su(n,N))==null?void 0:T.status)??"unknown"}}),onPick:()=>{}})]});const f=r[0],p=t.nodes.find(N=>N.id===f),y=t.edges.find(N=>N.id===f),x=t.absences.find(N=>N.id===f),w=Su(n,f),m=(p==null?void 0:p.evidence)??(y==null?void 0:y.evidence)??[],v=w&&"evidence"in w&&w.evidence?w.evidence:[],g=p?"Step":y?"Connection":"Missing connection",k=(w==null?void 0:w.proposal)??null,C=(F=(b=p??y)==null?void 0:b.proposed)==null?void 0:F.note,S=w&&"change"in w?w.change??null:null,_=((U=(L=n==null?void 0:n.since)==null?void 0:L.commit)==null?void 0:U.slice(0,7))??"the commit this map is compared with",j=x?(n==null?void 0:n.absences[x.id])??null:null;return h.jsxs(Ke,{eyebrow:g,title:et(t,f),tone:x?"dead":void 0,className:"card-selected",children:[d,((B=p==null?void 0:p.explain)==null?void 0:B.concept)&&h.jsx(ni,{text:p.explain.concept,className:"depth-text"}),p&&Xs(n,p.id)&&h.jsx(D0,{show:Xs(n,p.id),name:p.name}),k&&h.jsxs("div",{className:Xr("proposal-note",`proposal-note-${k.state}`),children:[h.jsx("strong",{children:NC[k.kind][k.state]}),C&&h.jsxs(h.Fragment,{children:[" ",C]})]}),S&&h.jsxs("div",{className:Xr("change-note",`change-note-${S.kind}`),children:[h.jsxs("div",{className:"change-head",children:[h.jsxs("span",{children:[h.jsxs("strong",{children:[EC[S.kind]," ",_,"."]}),S.kind==="changed"&&!S.diff&&" A line it cites wasn’t there then.",S.kind==="removed"&&" It was in the code then and is gone now.",S.diff&&h.jsx(PC,{diff:S.diff})]}),S.diff&&h.jsx("button",{className:"link-btn small",onClick:()=>a(!l),children:l?"Hide what changed":"Show what changed"})]}),S.diff&&l&&h.jsx("pre",{className:"diff",children:S.diff.map((N,T)=>h.jsxs("span",{className:N.startsWith("+ ")?"add":N.startsWith("- ")?"del":"",children:[N,`
|
|
70
|
-
`]},T))})]}),x&&j&&h.jsxs("p",{children:[j.found>x.matches?"This may no longer be missing: the search below now finds something.":"Nothing in the code connects these, going by this search."," ","Searched ",j.searched??"?"," ",j.searched===1?"file":"files",x.search.paths?h.jsxs(h.Fragment,{children:[" in ",h.jsx("code",{children:x.search.paths.join(", ")})]}):" (the whole repo)"," for ",h.jsx("code",{children:x.search.pattern}),": ",j.found," ",j.found===1?"match":"matches","."]}),w&&w.status==="unconfirmed"&&h.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",w.reasons.join("; ")]}),m.length>0&&h.jsxs("div",{className:"basis",children:[h.jsxs("div",{className:"code-toggle",children:[h.jsx("div",{className:"eyebrow",children:(S==null?void 0:S.kind)==="removed"?`In the code as it was at ${_}`:"In the code"}),h.jsx("button",{className:"link-btn small",onClick:()=>s(!i),children:i?"Hide the code":"Show the code"})]}),h.jsx("div",{className:"chips",children:m.map((N,T)=>{var $,M;const z=(($=v[T])==null?void 0:$.ok)??!1,O=((M=v[T])==null?void 0:M.foundAt)??N.line;return z?h.jsxs("button",{className:"chip cite",title:"Show this line in the code",onClick:()=>{s(!0),c(A=>({at:`${N.file}:${O}`,n:((A==null?void 0:A.n)??0)+1}))},children:[h.jsx("span",{className:"tick",children:"✓"}),N.file,":",O]},T):h.jsxs("span",{className:"chip static chip-unconfirmed",children:[h.jsx("span",{className:"qmark",children:"?"}),N.file,":",O]},T)})}),i&&(p||y)&&h.jsx(oC,{mapId:e,itemId:f,change:(S==null?void 0:S.kind)??null,since:_,stamp:n,jump:u})]})]})}function PC({diff:e}){const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return h.jsxs("span",{className:"diff-size",children:[t>0&&h.jsxs("span",{className:"add",children:[" +",t]}),n>0&&h.jsxs("span",{className:"del",children:[" −",n]})]})}function IC({map:e,selection:t,draft:n,busy:r,agentName:o="Claude",autoFocus:i,onDraft:s,onRemove:l,step:a,onRemoveStep:u,onSend:c}){const d=P.useRef(null),f=["nodes","edges","absences"].flatMap(p=>t[p].map(y=>({kind:p,id:y})));return P.useEffect(()=>{const p=d.current;p&&(p.style.height="auto",p.style.height=`${Math.min(p.scrollHeight,140)}px`)},[n]),P.useEffect(()=>{var p;n&&((p=d.current)==null||p.focus())},[n===""]),P.useEffect(()=>{var p;i&&((p=d.current)==null||p.focus({preventScroll:!0}))},[]),h.jsxs("form",{className:"composer",onSubmit:p=>{p.preventDefault(),!r&&n.trim()&&c()},children:[a&&h.jsxs("span",{className:"sel-chip sel-step",children:[h.jsxs("span",{className:"sel-text",title:`Walkthrough step: ${a}`,children:["▸ ",a]}),h.jsx("button",{type:"button","aria-label":`Don't ask about the step “${a}”`,onClick:u,children:"×"})]}),f.map(p=>h.jsxs("span",{className:`sel-chip sel-${p.kind}`,children:[h.jsxs("span",{className:"sel-text",title:et(e,p.id),children:[p.kind==="absences"?"✕ ":"◉ ",et(e,p.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${et(e,p.id)}`,onClick:()=>l(p.kind,p.id),children:"×"})]},`${p.kind}:${p.id}`)),h.jsx("textarea",{ref:d,id:"ask",rows:1,value:n,placeholder:r?`${o} is working…`:f.length?"Ask about what you selected…":a?"Ask about this step…":"Ask about this map…",onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),!r&&n.trim()&&c())},"aria-label":"Ask a question about the map"}),h.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function TC({map:e,agent:t,selection:n,step:r,onRemove:o}){const i=["nodes","edges","absences"].flatMap(l=>n[l].map(a=>({kind:l,id:a}))),s=Q2(t,i.length,r);return h.jsxs("div",{className:"composer composer-chat",role:"note","aria-label":"Where to ask",children:[i.map(l=>h.jsxs("span",{className:`sel-chip sel-${l.kind}`,children:[h.jsxs("span",{className:"sel-text",title:et(e,l.id),children:[l.kind==="absences"?"✕ ":"◉ ",et(e,l.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${et(e,l.id)}`,onClick:()=>o(l.kind,l.id),children:"×"})]},`${l.kind}:${l.id}`)),h.jsxs("p",{className:"chat-hint",children:[h.jsx("strong",{children:s.title})," ",h.jsx("span",{className:"muted",children:s.detail})]})]})}const pa="illuminate-toured",zC=100;function mh(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function LC(e,t,n=zC){return[...e.filter(r=>r!==t),t].slice(-n)}function AC(e,t){const[n,r]=P.useState(()=>mh(ti(pa)).includes(e));return P.useEffect(()=>{!t||n||!e||(El(pa,JSON.stringify(LC(mh(ti(pa)),e))),r(!0))},[e,t,n]),n}function RC({map:e,mapId:t,tour:n,onTour:r,selected:o,children:i}){const s=AC(t,n!==null),l=e.tour.length,a=l>0&&n===null;return!a&&!i?null:h.jsxs("div",{className:"dock",children:[a&&h.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[h.jsx("h2",{className:"dock-title",children:"Walkthrough"}),h.jsxs("button",{className:s?"dock-start":"dock-start glow",onClick:()=>r(0),children:["Take the walkthrough ",h.jsxs("span",{className:"muted",children:[l," ",l===1?"stop":"stops"]})]})]}),i&&h.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[h.jsxs("div",{className:"dock-head",children:[h.jsx("h2",{className:"dock-title",children:"Ask about the map"}),h.jsx("span",{className:"dock-hint",children:o?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),i]})]})}function DC({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?h.jsx("div",{className:"history-corner",children:h.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t(e.tour!==null?{type:"peek",open:!0}:{type:"show",answerId:n.id}),title:"Open the conversation about this map",children:[h.jsx("span",{className:"history-arrow",children:"‹"})," Conversation ",h.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const lr=14,Ie=12;function OC(e,t){const n=l=>l[l.length-1],r=n(t.nodes),o=n(t.edges),i=n(t.absences),s=r!==void 0?`.react-flow__node[data-id="${CSS.escape(r)}"]`:o!==void 0?`.link-label[data-id="${CSS.escape(`e:${o}`)}"]`:i!==void 0?`.link-label[data-id="${CSS.escape(`a:${i}`)}"]`:null;return s?e.querySelector(s):null}const Nu="illuminate-bubble-size",B0=300,V0=180;function FC(){try{const e=JSON.parse(ti(Nu)??"null");if(e&&typeof e=="object"&&"w"in e&&"h"in e&&typeof e.w=="number"&&typeof e.h=="number")return{w:Math.max(B0,e.w),h:Math.max(V0,e.h)}}catch{}return null}function HC({mapId:e,map:t,report:n,selection:r,onClose:o}){var C;const i=[...r.nodes,...r.edges,...r.absences],s=i.join(" "),l=P.useRef(null),[a,u]=P.useState(null),c=P.useRef(null),d=mi(),f=le(S=>S.transform.join(",")),[p,y]=P.useState(""),[x,w]=P.useState(FC),m=S=>{const _=l.current,j=_==null?void 0:_.querySelector(".card-selected"),b=_==null?void 0:_.parentElement;if(!_||!j||!b||!a)return;S.preventDefault();const F=S.clientX,L=S.clientY,U=_.offsetWidth,B=j.offsetHeight,N=b.clientWidth-2*Ie,T=a.side==="right"?1:-1;let z={w:U,h:B};const O=M=>{z={w:Math.round(Math.max(B0,Math.min(N,U+T*(M.clientX-F)))),h:Math.round(Math.max(V0,B+M.clientY-L))},w(z)},$=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",$),document.body.classList.remove("resizing-bubble"),El(Nu,JSON.stringify(z))};window.addEventListener("pointermove",O),window.addEventListener("pointerup",$),document.body.classList.add("resizing-bubble")},v=()=>{try{localStorage.removeItem(Nu)}catch{}w(null)};if(P.useLayoutEffect(()=>{const S=l.current;if(!S)return;const _=new ResizeObserver(()=>y(`${S.offsetWidth}x${S.offsetHeight}`));return _.observe(S),()=>_.disconnect()},[s]),P.useLayoutEffect(()=>{const S=l.current,_=S==null?void 0:S.parentElement;if(!S||!_)return;const j=OC(_,r);if(!j){u(null);return}const b=_.getBoundingClientRect(),F=j.getBoundingClientRect(),L={left:F.left-b.left,right:F.right-b.left,top:F.top-b.top,bottom:F.bottom-b.top},U=_.querySelector(".dock"),B=U?U.getBoundingClientRect().top-b.top-Ie:b.height-Ie,N=Math.max(160,B-Ie),T=S.offsetWidth,z=Math.min(S.offsetHeight,N),O=b.width-Ie-L.right-lr,$=L.left-lr-Ie,M=O>=T||O>=$?"right":"left",A=M==="right"?L.right+lr:L.left-lr-T,I=Math.max(Ie,Math.min(A,b.width-Ie-T)),H=Math.max(Ie,Math.min(L.top,B-z)),ee=Math.max(16,Math.min((L.top+L.bottom)/2-H,z-16));if(u({left:I,top:H,side:M,pointer:ee,maxHeight:N}),c.current===s)return;c.current=s;const K=M==="right"?L.left:L.left-lr-T,Y=M==="right"?L.right+lr+T:L.right,V=Y-K<=b.width-2*Ie,X=V?K:L.left,E=V?Y:L.right,R=X<Ie?Ie-X:E>b.width-Ie?b.width-Ie-E:0,Q=L.top<Ie?Ie-L.top:L.bottom>B?Math.max(B-L.bottom,Ie-L.top):0;if(R||Q){const G=d.getViewport();d.setViewport({...G,x:G.x+R,y:G.y+Q},{duration:300})}},[s,f,p]),!i.length)return null;const g=i.length===1?i[0]:null,k=!!g&&((C=Xs(n,g))==null?void 0:C.kind)==="wireframe";return h.jsxs("div",{ref:l,className:`box-bubble box-bubble-${(a==null?void 0:a.side)??"right"}${k?" box-bubble-wide":""}`,style:{...a?{left:a.left,top:a.top,"--bubble-max":`${a.maxHeight}px`}:{visibility:"hidden",left:0,top:0},...x?{width:x.w,"--bubble-cap":`${x.h}px`}:{}},role:"dialog","aria-label":"What you selected",children:[a&&h.jsx("i",{className:"box-bubble-pointer",style:{top:a.pointer},"aria-hidden":"true"}),h.jsx(bC,{mapId:e,map:t,report:n,ids:i,onClose:o},s),h.jsx("span",{className:"box-bubble-grip",onPointerDown:m,onDoubleClick:v,title:"Drag to resize. Double-click for the usual size.","aria-hidden":"true"})]})}const BC="modulepreload",VC=function(e){return"/"+e},gh={},WC=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=VC(a),a in gh)return;gh[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":BC,u||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Vn=232,Dn=96,W0=e=>e.view==="journey"&&[...e.nodes,...e.edges].some(t=>!!t.branch);function Ks(e,t){var i;const n=((i=e.nodes[t])==null?void 0:i.y)??0,r=e.rowTops??[];let o=0;for(const[s,l]of r.entries())n>=l-1&&(o=s);return o}const UC=132;function Eu(e,t=!1){return e==="choice"?{w:196,h:132}:e==="action"?{w:196,h:60}:t?{w:232,h:64+UC}:{w:196,h:72}}let YC=null;const Hc=()=>YC??(YC=WC(()=>import("./elk.bundled-Ce9K9DrB.js").then(e=>e.e),[]).then(e=>new e.default)),Bc={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function _l(e,t){const n=new Set(e.nodes.map(r=>r.id));return[...e.edges.map(r=>({id:`e:${r.id}`,from:r.from,to:r.to})),...e.absences.flatMap(r=>r.between?[{id:`a:${r.id}`,from:r.between.from,to:r.between.to}]:[]),...t.map(r=>({id:`x:${r.id}`,from:r.from,to:r.to}))].filter(r=>n.has(r.from)&&n.has(r.to)&&r.from!==r.to)}const St={top:52,side:26,bottom:26},ur=64,cs=44,XC=56,KC=140;async function U0(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...Bc,"elk.direction":"DOWN","elk.padding":`[top=${St.top},left=${St.side},bottom=${St.bottom},right=${St.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(ur),"elk.spacing.nodeNode":String(cs)},children:n.map(s=>({id:s.id,width:Vn,height:Dn})),edges:r.map(s=>({id:s.id,sources:[s.from],targets:[s.to]}))}),i={};for(const s of o.children??[])i[s.id]={x:s.x??0,y:s.y??0,w:Vn,h:Dn};return{nodes:i,size:{w:o.width??Vn+2*St.side,h:o.height??Dn+St.top+St.bottom}}}function GC(e,t){const n=e.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e,areas:e.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}async function QC(e,t=[],n=new Set,r=new Set){var C;if(e.view==="journey")return W0(e)?JC(e,t,r):Y0(e,t,r);const o=e.nodes.filter(S=>n.has(S.id));if(!o.length)return wh(e,t);const i=GC(e,n),s=new Set(i.nodes.map(S=>S.id)),l=await wh(i,t.filter(S=>s.has(S.from)&&s.has(S.to))),a=await Hc(),u=Object.fromEntries(Object.entries(l.areas).map(([S,_])=>[S,{..._}])),c={...l.nodes},d={},f={};for(const S of o)(f[C=S.area]??(f[C]=[])).push(S);for(const[S,_]of Object.entries(f)){const j=u[S];if(!j)continue;const b=Math.max(1,Math.floor((j.w-2*St.side+cs)/(Vn+cs))),F=Math.max(St.top-ur,...i.nodes.filter(U=>U.area===S).map(U=>{var B;return(((B=c[U.id])==null?void 0:B.y)??0)+Dn}))+ur;_.forEach((U,B)=>{c[U.id]={x:St.side+B%b*(Vn+cs),y:F+Math.floor(B/b)*(Dn+ur),w:Vn,h:Dn}});const L=Math.max(j.h,F+Math.ceil(_.length/b)*(Dn+ur)-ur+St.bottom);d[S]=L-j.h,j.h=L}const p=Object.fromEntries(Object.entries(l.areas).map(([S,_])=>[S,_])),y=Object.keys(p).sort((S,_)=>p[S].y-p[_].y),x={};for(const S of y){const _=p[S];x[S]=Math.max(0,...y.filter(j=>j!==S&&x[j]!==void 0).filter(j=>{const b=p[j];return b.y+b.h<=_.y+1&&b.x<_.x+_.w&&_.x<b.x+b.w}).map(j=>x[j]+(d[j]??0))),u[S].y+=x[S]}const w=_l(e,t),m=new Map(e.nodes.map(S=>[S.id,S.area])),v=Math.max(0,...Object.values(u).map(S=>S.x+S.w))+KC;let g=0;for(const S of e.areas){if(u[S.id])continue;const _=e.nodes.filter(F=>F.area===S.id);if(!_.length)continue;const j=w.filter(F=>m.get(F.from)===S.id&&m.get(F.to)===S.id),b=await U0(a,S.id,_,j);Object.assign(c,b.nodes),u[S.id]={x:v,y:g,w:b.size.w,h:b.size.h},g+=b.size.h+XC}const k=Object.values(u);return{areas:u,nodes:c,width:Math.max(0,...k.map(S=>S.x+S.w)),height:Math.max(0,...k.map(S=>S.y+S.h))}}const yh=1900,_u=130;async function Y0(e,t,n){const o=await(await Hc()).layout({id:"root",layoutOptions:{...Bc,"elk.direction":"RIGHT","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.spacing.nodeNodeBetweenLayers":"176","elk.spacing.nodeNode":"56","elk.spacing.componentComponent":"72"},children:e.nodes.map(p=>({id:p.id,width:Eu(p.kind,n.has(p.id)).w,height:Eu(p.kind,n.has(p.id)).h})),edges:_l(e,t).map(p=>({id:p.id,sources:[p.from],targets:[p.to]}))}),i={};for(const p of o.children??[])i[p.id]={x:p.x??0,y:p.y??0,w:p.width??0,h:p.height??0};const s=o.width??0;if(s<=yh)return{areas:{},nodes:i,width:s,height:o.height??0,flat:!0};const l=[];for(const[p,y]of Object.entries(i).sort((x,w)=>x[1].x+x[1].w/2-(w[1].x+w[1].w/2))){const x=l[l.length-1];x&&y.x+y.w/2<x.right?(x.ids.push(p),x.left=Math.min(x.left,y.x),x.right=Math.max(x.right,y.x+y.w)):l.push({left:y.x,right:y.x+y.w,ids:[p]})}const a=Math.ceil(s/yh),u=Math.ceil(l.length/a);let c=0,d=0;const f=[];for(let p=0;p*u<l.length;p++){const y=l.slice(p*u,(p+1)*u),x=y.flatMap(v=>v.ids),w=y[0].left,m=Math.min(...x.map(v=>i[v].y));f.push(c);for(const v of x)i[v]={...i[v],x:i[v].x-w,y:i[v].y-m+c};c=Math.max(...x.map(v=>i[v].y+i[v].h))+_u,d=Math.max(d,y[y.length-1].right-w)}return{areas:{},nodes:i,width:d,height:c-_u,flat:!0,rowTops:f}}const Ui=176,vh=120,xh=34,qC=14;function ZC(e,t){const n=new Map(e.map(i=>[i,0]));for(const i of t)n.set(i.to,(n.get(i.to)??0)+1);const r=new Set(e),o=[];for(;r.size;){const i=e.find(s=>r.has(s)&&!n.get(s))??e.find(s=>r.has(s));r.delete(i),o.push(i);for(const s of t)s.from===i&&r.has(s.to)&&n.set(s.to,n.get(s.to)-1)}return o}async function JC(e,t,n){const r=_l(e,t),o=new Map(e.nodes.map(E=>[E.id,Eu(E.kind,n.has(E.id))])),i=new Map(e.nodes.map(E=>[E.id,E.branch??null])),s=ZC(e.nodes.map(E=>E.id),r),l=s.filter(E=>!i.get(E));if(!l.length)return Y0(e,t,n);const a=E=>o.get(E).w,u=E=>o.get(E).h,c=new Map,d=new Map;let f=0;for(const E of l)c.set(E,f),d.set(E,0),f+=a(E)+Ui;const p=E=>c.get(E)+a(E)/2,y=E=>c.get(E)+a(E),x=[...new Set([...e.nodes,...e.edges].flatMap(E=>E.branch?[E.branch]:[]))],w=new Map;for(const E of s){const R=i.get(E);R&&w.set(R,[...w.get(R)??[],E])}const m=[],v=new Map,g=new Set(w.keys()),k=(E,R)=>{const Q=w.get(E),G=new Set(Q),q=r.filter(ie=>G.has(ie.to)&&!G.has(ie.from));if(!R&&q.length&&!q.some(ie=>d.has(ie.from)))return null;const D=q.filter(ie=>d.has(ie.from)).map(ie=>ie.from).sort((ie,Ae)=>d.get(ie)-d.get(Ae)||p(ie)-p(Ae))[0]??null,W=D&&d.get(D)===0?l[l.indexOf(D)+1]:void 0,Z=Q[0],te=D?W?(p(D)+p(W))/2:p(D)+(a(D)/2+Ui+a(Z)/2)/2:a(Z)/2,oe=[];let de=te-a(Z)/2;for(const ie of Q)oe.push(de),de+=a(ie)+Ui;const me=r.filter(ie=>G.has(ie.from)&&!G.has(ie.to)&&d.has(ie.to)),ke=me.filter(ie=>p(ie.to)>=oe[0]).map(ie=>p(ie.to)),Me=me.filter(ie=>p(ie.to)<oe[0]).map(ie=>p(ie.to));return{name:E,ids:Q,anchor:D,xs:oe,kind:Me.length?2:ke.length?0:1,reach:Math.max(0,...ke),span:[Math.min(D?p(D):oe[0],...Me)-30,Math.max(de-Ui,...ke)+30],verticals:[...D?[{x:p(D),from:d.get(D)}]:[],...me.map(ie=>({x:p(ie.to),from:d.get(ie.to)}))],minLane:D?d.get(D)+1:1,root:D?d.get(D)===0?l.indexOf(D):v.get(i.get(D))??l.length:l.length}};for(;g.size;){const R=[...g].flatMap(D=>k(D,!1)??[]).sort((D,W)=>(D.anchor?p(D.anchor):1/0)-(W.anchor?p(W.anchor):1/0)||D.kind-W.kind||D.reach-W.reach||x.indexOf(D.name)-x.indexOf(W.name))[0]??k(x.find(D=>g.has(D))??[...g][0],!0);g.delete(R.name);const Q=D=>!m.some(W=>W.lane===D&&W.span[0]<R.span[1]&&R.span[0]<W.span[1]),G=D=>R.verticals.every(W=>m.every(Z=>!(Z.lane>W.from&&Z.lane<D)||Z.boxes.every(te=>W.x<c.get(te)-12||W.x>y(te)+12)))&&m.every(W=>W.lane<=D||W.verticals.every(Z=>Z.from>=D||R.xs.every((te,oe)=>Z.x<te-12||Z.x>te+a(R.ids[oe])+12)));let q=R.minLane;for(;q<R.minLane+12&&!(Q(q)&&G(q));)q++;if(q>=R.minLane+12)for(q=R.minLane;!Q(q);q++);R.ids.forEach((D,W)=>{c.set(D,R.xs[W]),d.set(D,q)}),m.push({name:R.name,lane:q,span:R.span,verticals:R.verticals,boxes:R.ids,root:R.root}),v.set(R.name,R.root)}const C=[...new Set([...d.values()])].sort((E,R)=>E-R),S=new Map,_=new Map;let j=0;for(const E of C){const R=Math.max(...[...d].filter(([,Q])=>Q===E).map(([Q])=>u(Q)));S.set(E,j),_.set(E,j+R),j+=R+vh}const b={};for(const E of e.nodes){const R=d.get(E.id);b[E.id]={x:c.get(E.id),y:S.get(R)+(_.get(R)-S.get(R)-u(E.id))/2,w:a(E.id),h:u(E.id)}}const F=new Map(e.nodes.map(E=>[E.id,E.kind])),L=(E,R,Q)=>{const G=b[E],q=F.get(E)==="choice"?Math.min(G.h/2,Math.abs(R-(G.x+G.w/2))*G.h/G.w):0;return Q==="top"?G.y+q:G.y+G.h-q},U=E=>b[E].y+b[E].h/2,B=E=>d.get(E),N=E=>[...d].filter(([,R])=>R===E).map(([R])=>R).sort((R,Q)=>c.get(R)-c.get(Q)),T=new Map,z=new Map,O=(E,R,Q,G)=>z.set(`${E}:${R}`,[...z.get(`${E}:${R}`)??[],{link:Q,key:G}]);for(const E of r){const R=B(E.from),Q=B(E.to);let G;if(R===Q){const q=N(R);G=q.indexOf(E.to)===q.indexOf(E.from)+1?"straight":R===0?"arc":"under"}else Q>R?G="down":G=p(E.to)>y(E.from)+24?"rejoin":p(E.to)<c.get(E.from)-24?"return":"up";T.set(E.id,G),G==="arc"&&(O(E.from,"t",E.id,[p(E.to)]),O(E.to,"t",E.id,[p(E.from)])),(G==="rejoin"||G==="up")&&O(E.to,"b",E.id,[0,R]),G==="return"&&O(E.to,"b",E.id,[1,-R]),G==="down"&&O(E.from,"b",E.id,[2,-Q])}const $=new Map;for(const[E,R]of z){const Q=E.slice(0,E.lastIndexOf(":"));R.sort((G,q)=>G.key.reduce((D,W,Z)=>D||W-(q.key[Z]??0),0)),R.forEach((G,q)=>$.set(`${G.link}:${E}`,p(Q)+(q-(R.length-1)/2)*qC))}const M=(E,R,Q)=>$.get(`${E}:${R}:${Q}`)??p(R),A=r.filter(E=>T.get(E.id)==="arc").sort((E,R)=>Math.abs(p(E.to)-p(E.from))-Math.abs(p(R.to)-p(R.from))),I=new Map(A.map((E,R)=>[E.id,R])),H=new Map,ee={};for(const E of r){const R=b[E.from],Q=b[E.to],G=B(E.from),q=T.get(E.id);let D;if(q==="straight")D={points:[[R.x+R.w,U(E.from)],[Q.x,U(E.to)]],label:0};else if(q==="arc"){const W=-58-18*I.get(E.id),Z=M(E.id,E.from,"t"),te=M(E.id,E.to,"t");D={points:[[Z,L(E.from,Z,"top")],[Z,W],[te,W],[te,L(E.to,te,"top")]],label:1}}else if(q==="under"||q==="return"){const W=H.get(G)??0;H.set(G,W+1);const Z=_.get(G)+xh+16*W,te=p(E.from)+(q==="under"?6:0),oe=q==="return"?M(E.id,E.to,"b"):p(E.to)-6;D={points:[[te,R.y+R.h],[te,Z],[oe,Z],[oe,L(E.to,oe,"bottom")]],label:1}}else if(q==="down"){const W=M(E.id,E.from,"b"),Z=p(E.to),te=S.get(B(E.to))-xh;D=Math.abs(Z-W)<4?{points:[[W,L(E.from,W,"bottom")],[W,Q.y]],label:0}:{points:[[W,L(E.from,W,"bottom")],[W,te],[Z,te],[Z,Q.y]],label:1}}else if(q==="rejoin"){const W=M(E.id,E.to,"b"),Z=N(G).some(oe=>oe!==E.from&&c.get(oe)<W&&y(oe)>R.x+R.w),te=S.get(G)-vh/2;D=Z?{points:[[p(E.from),R.y],[p(E.from),te],[W,te],[W,L(E.to,W,"bottom")]],label:1}:{points:[[R.x+R.w,U(E.from)],[W,U(E.from)],[W,L(E.to,W,"bottom")]],label:W-(R.x+R.w)>=150?0:1}}else{const W=Math.min(Math.max(M(E.id,E.to,"b"),R.x+12),R.x+R.w-12);D={points:[[W,R.y],[W,L(E.to,W,"bottom")]],label:0}}ee[E.id]=D}const Y=x.map(E=>{var q;const R=m.find(D=>D.name===E);if(R)return{name:E,root:R.root};const Q=(q=e.edges.find(D=>D.branch===E))==null?void 0:q.from,G=Q?i.get(Q):null;return{name:E,root:Q&&d.get(Q)===0?l.indexOf(Q):G?v.get(G)??l.length:l.length}}).sort((E,R)=>E.root-R.root||x.indexOf(E.name)-x.indexOf(R.name)).map(E=>E.name),V=Object.values(b),X=Object.values(ee).flatMap(E=>E.points);return{areas:{},nodes:b,width:Math.max(...V.map(E=>E.x+E.w),...X.map(E=>E[0])),height:Math.max(...V.map(E=>E.y+E.h),...X.map(E=>E[1])),flat:!0,routes:ee,branches:Y}}async function wh(e,t){const n=await Hc(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=_l(e,t),i={},s={};for(const c of e.areas){const d=e.nodes.filter(y=>y.area===c.id);if(!d.length)continue;const f=o.filter(y=>r.get(y.from)===c.id&&r.get(y.to)===c.id),p=await U0(n,c.id,d,f);Object.assign(i,p.nodes),s[c.id]=p.size}const l=new Map;for(const c of o){const d=r.get(c.from),f=r.get(c.to);d!==f&&s[d]&&s[f]&&l.set(`${d}>${f}`,{from:d,to:f})}const a=await n.layout({id:"root",layoutOptions:{...Bc,"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.nodeNode":"48","elk.spacing.componentComponent":"64"},children:e.areas.filter(c=>s[c.id]).map(c=>({id:c.id,width:s[c.id].w,height:s[c.id].h})),edges:[...l.values()].map((c,d)=>({id:`p${d}`,sources:[c.from],targets:[c.to]}))}),u={};for(const c of a.children??[])u[c.id]={x:c.x??0,y:c.y??0,w:c.width??0,h:c.height??0};return{areas:u,nodes:i,width:a.width??0,height:a.height??0}}function ej(e,t,n,r){if(t.flat){const c=y=>{const x=t.nodes[y];return x?{x:x.x+x.w/2,y:x.y+x.h/2}:{x:0,y:0}},d=c(r).x-c(n).x,f=c(r).y-c(n).y;if(Math.abs(d)<40)return f>=0?["b","t"]:["t","b"];const p=Ks(t,r)-Ks(t,n);return p?p>0?["b","t"]:["r","b"]:d>=0?["r","l"]:["l","r"]}const o=c=>{var d;return((d=e.nodes.find(f=>f.id===c))==null?void 0:d.area)??""},i=c=>{const d=t.areas[o(c)],f=t.nodes[c];return d&&f?{x:d.x+f.x+f.w/2,y:d.y+f.y+f.h/2}:{x:0,y:0}},s=i(n),l=i(r),a=l.x-s.x,u=l.y-s.y;return o(n)===o(r)||Math.abs(a)<Vn*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function tj(e,t=[],n=[],r=[]){return JSON.stringify([e.view==="journey"?[e.nodes.map(o=>o.kind),[...r].sort(),...W0(e)?[[...e.nodes,...e.edges].map(o=>o.branch??"")]:[]]:null,[...n].sort(),e.areas.map(o=>o.id),e.nodes.map(o=>`${o.id}@${o.area}`),e.edges.map(o=>`${o.from}>${o.to}`),e.absences.map(o=>o.between?`${o.between.from}~${o.between.to}`:""),t.map(o=>`${o.from}+${o.to}`)])}const nn=(...e)=>e.filter(Boolean).join(" "),Wn={add:{pending:"Proposed",done:"Now in the code",mark:"+",title:"Proposed: not in the code yet"},change:{pending:"Would change",done:"Changed",mark:"~",title:"Proposed: this code would change"},remove:{pending:"Would be removed",done:"Removed",mark:"−",title:"Proposed: this code would be removed"}},Cl=e=>e&&`proposal proposal-${e.kind} proposal-${e.state}`,Un={added:{label:"Added",mark:"+",title:"New since the commit this map is compared with"},changed:{label:"Changed",mark:"~",title:"Different from the commit this map is compared with"},removed:{label:"Removed",mark:"−",title:"Was in the code at the commit this map is compared with, and is gone now"}},jl=e=>e&&`change change-${e}`,Gs={later:{label:"Not there yet",title:"Added after this version of the code"},gone:{label:"Gone",title:"Removed: it was in the code before, and isn’t now"}};function nj(e){if(!(e!=null&&e.length))return null;const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return[t&&`+${t}`,n&&`−${n}`].filter(Boolean).join(" ")||null}const rj=[["before","Before","The code as it was at that commit; what was added since is a shadow"],["after","After","The code as it is now; what was removed is a shadow"],["both","Both","The code as it is now, with what was removed drawn in too"]];function oj({commit:e,when:t,onWhen:n}){return h.jsxs("div",{className:"change-key",children:[h.jsx("div",{className:"seg",role:"group","aria-label":"Which version of the code to show",children:rj.map(([r,o,i])=>h.jsx("button",{className:nn("seg-btn",t===r&&"on"),title:i,"aria-pressed":t===r,onClick:()=>n(r),children:o},r))}),h.jsx("span",{className:"change-key-title",children:t==="before"?`The code at ${e}`:t==="after"?"The code now":`Now, compared with ${e}`}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch"}),"Same as before"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-added"}),"Added"]}),h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:nn("key-swatch key-changed",t!=="both"&&"key-quiet")}),t==="before"?"Changes later":"Changed"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-removed"}),"Removed (only in the before)"]}),t!=="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-ghost"}),t==="before"?"Not there yet":"Gone"]})]})}const ij=5,Ml=e=>e&&`branch branch-${e.colour}`;function sj({branches:e}){return h.jsxs("div",{className:"change-key branch-key",children:[h.jsx("span",{className:"change-key-title",children:"Ways through"}),h.jsxs("span",{className:"key-item",title:"What most people do, start to finish",children:[h.jsx("i",{className:"key-swatch"}),"Main path"]}),e.map(t=>h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:nn("key-swatch",Ml(t))}),t.name]},t.name))]})}const Yi={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},kh=[["t",re.Top],["r",re.Right],["b",re.Bottom],["l",re.Left]];function X0(){return h.jsxs(h.Fragment,{children:[kh.map(([e,t])=>h.jsx(Ur,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),kh.map(([e,t])=>h.jsx(Ur,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function lj({data:e}){var t,n,r;return e.journey?h.jsx(aj,{data:e}):h.jsxs("div",{className:nn("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",Cl(e.proposal),jl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),onClick:o=>{o.stopPropagation(),e.onClick(o.shiftKey||o.metaKey)},children:[h.jsx(X0,{}),(Yi[e.kind]||e.fresh||e.screen||e.proposal||e.change||e.ghost)&&h.jsxs("div",{className:"step-head",children:[e.ghost&&h.jsx("span",{className:"badge-ghost",title:Gs[e.ghost].title,children:Gs[e.ghost].label}),e.proposal&&h.jsx("span",{className:"badge-proposal",children:Wn[e.proposal.kind][e.proposal.state]}),e.change&&h.jsxs("span",{className:"badge-change",title:Un[e.change].title,children:[e.quiet==="before"?"Changes later":Un[e.change].label,e.changeSize&&!e.quiet&&h.jsxs("span",{className:"change-size",children:[" ",e.changeSize]})]}),Yi[e.kind]&&!e.proposal&&!e.change&&!e.ghost&&h.jsxs(h.Fragment,{children:[h.jsx("i",{className:"step-mark","aria-hidden":"true",children:Yi[e.kind][1]}),Yi[e.kind][0]]}),e.screen&&h.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),h.jsx("div",{className:"step-name",title:e.name,children:e.name}),h.jsxs("div",{className:"step-code",title:((t=e.proposal)==null?void 0:t.state)==="pending"?Wn[e.proposal.kind].title:e.confirmed?"Confirmed against the code":"The checker couldn't confirm this against the code",children:[((n=e.proposal)==null?void 0:n.state)==="pending"&&e.proposal.kind==="add"?h.jsx("span",{className:"pmark",children:"+"}):((r=e.proposal)==null?void 0:r.state)==="done"&&e.proposal.kind!=="add"?h.jsx("span",{className:"pmark",children:Wn[e.proposal.kind].mark}):e.change&&e.confirmed?h.jsx("span",{className:"cmark",children:Un[e.change].mark}):h.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),h.jsx("span",{className:"step-sub",children:e.sub})]})]})}function aj({data:e}){const t=e.journey,n=e.proposal;return h.jsxs("div",{className:nn("step","jstep","nopan",`j-${t.shape}`,t.show&&"j-pictured",t.outside&&"j-outside",!e.confirmed&&"unconfirmed",Cl(n),jl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",Ml(t.branch),e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),style:{width:t.w,height:t.h},onClick:r=>{r.stopPropagation(),e.onClick(r.shiftKey||r.metaKey)},children:[h.jsx(X0,{}),t.stage&&h.jsx("div",{className:"j-stage",children:t.stage}),t.shape==="choice"&&h.jsx("svg",{className:"j-diamond",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:h.jsx("polygon",{points:"50,1 99,50 50,99 1,50",vectorEffect:"non-scaling-stroke"})}),h.jsxs("div",{className:"j-tags",children:[n&&h.jsx("span",{className:"badge-proposal",children:Wn[n.kind][n.state]}),e.ghost&&h.jsx("span",{className:"badge-ghost",title:Gs[e.ghost].title,children:Gs[e.ghost].label}),e.change&&h.jsx("span",{className:"badge-change",title:Un[e.change].title,children:e.quiet==="before"?"Changes later":Un[e.change].label}),!e.confirmed&&h.jsx("span",{className:"j-q",title:"The checker couldn't confirm this against the code",children:"?"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),t.show&&h.jsx(aC,{show:t.show,name:e.name}),h.jsx("div",{className:"j-name",title:e.name,children:e.name}),t.outside&&t.shape!=="choice"&&h.jsx("div",{className:"j-note",children:"Outside the app"})]})}function uj({data:e}){return h.jsx("div",{className:nn("area",e.dim&&"dim"),children:h.jsxs("div",{className:"area-label",children:[e.label,e.note&&h.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function cj(e,t,n,r,o){const i=Math.hypot(n-e,r-t)||1,s=-(r-t)/i,l=(n-e)/i,a=(e+n)/2+s*o*2,u=(t+r)/2+l*o*2;return[`M ${e} ${t} Q ${a} ${u} ${n} ${r}`,(e+n)/2+s*o,(t+r)/2+l*o]}function Sh(e,t=18,n){let r=`M ${e[0][0]} ${e[0][1]}`;for(let a=1;a<e.length-1;a++){const[u,c]=e[a-1],[d,f]=e[a],[p,y]=e[a+1],x=Math.min(t,Math.hypot(d-u,f-c)/2),w=Math.min(t,Math.hypot(p-d,y-f)/2),m=Math.sign(d-u),v=Math.sign(f-c),g=Math.sign(p-d),k=Math.sign(y-f);r+=` L ${d-m*x} ${f-v*x} Q ${d} ${f} ${d+g*w} ${f+k*w}`}const o=e[e.length-1];r+=` L ${o[0]} ${o[1]}`;const[i,s]=n!==void 0?[e[n],e[n+1]]:[];if(i&&s)return[r,(i[0]+s[0])/2,(i[1]+s[1])/2];let l=[0,e[0][0],e[0][1]];for(let a=1;a<e.length;a++){const[u,c]=e[a-1],[d,f]=e[a];c===f&&Math.abs(d-u)>l[0]&&(l=[Math.abs(d-u),(u+d)/2,f])}return[r,l[1],l[2]]}function dj({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,d]=a!=null&&a.route?Sh(a.route.points,18,a.route.label):(a==null?void 0:a.wrapY)!==void 0&&i===re.Right?Sh([[t,n],[t+30,n],[t+30,a.wrapY],[r,a.wrapY],[r,o]]):(a==null?void 0:a.wrapY)!==void 0?Ws({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s,borderRadius:18,centerY:a.wrapY}):a!=null&&a.offset?cj(t,n,r,o,a.offset):Tc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});return a?h.jsxs(h.Fragment,{children:[a.selected&&h.jsx("path",{d:u,className:"edge-halo"}),h.jsx(gi,{id:e,path:u,markerEnd:l,interactionWidth:18}),h.jsx(w2,{children:h.jsxs("div",{className:nn("link-label",`link-${a.variant}`,!a.confirmed&&"unconfirmed",Cl(a.proposal),jl(a.change),a.ghost&&"ghost",Ml(a.branch),a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),"data-id":e,style:{transform:`translate(-50%, -50%) translate(${c}px, ${d}px)`},onClick:f=>{var p;f.stopPropagation(),(p=a.onClick)==null||p.call(a,f.shiftKey||f.metaKey)},children:[a.variant==="absence"&&h.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),a.proposal&&h.jsx("span",{className:"pmark",title:a.proposal.state==="done"?Wn[a.proposal.kind].done:Wn[a.proposal.kind].title,children:a.proposal.state==="done"&&a.proposal.kind==="add"?"✓":Wn[a.proposal.kind].mark}),a.change&&h.jsx("span",{className:"cmark",title:Un[a.change].title,children:Un[a.change].mark}),h.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&h.jsx("span",{className:"q",children:" ?"})]})})]}):null}const fj={step:lj,area:uj},hj={link:dj};function Nh(e,t){const n=new Set;for(const r of t){e.nodes.some(s=>s.id===r)&&n.add(r);const o=e.edges.find(s=>s.id===r);o&&n.add(o.from).add(o.to);const i=e.absences.find(s=>s.id===r);i!=null&&i.between&&n.add(i.between.from).add(i.between.to)}return[...n]}const pj="440px",mj=e=>e.length>28?`${e.slice(0,26)}…`:e;function gj(e){var L,U,B,N,T,z,O,$,M,A;const t=(L=e.ghost)!=null&&L.connects&&e.map.nodes.some(I=>I.id===e.ghost.connects.from)&&e.map.nodes.some(I=>I.id===e.ghost.connects.to)?e.ghost:null,n=P.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=P.useMemo(()=>e.map.view==="journey"?e.map.nodes.filter(I=>{var H,ee,K;return I.kind!=="action"&&I.kind!=="choice"&&((K=(ee=(H=e.report)==null?void 0:H.screens)==null?void 0:ee[I.id])==null?void 0:K.status)==="confirmed"}).map(I=>I.id):[],[e.map,e.report]),o=tj(e.map,n,e.added,r),[i,s]=P.useState(null),l=mi(),[a,u]=P.useState("both"),d=!!((B=(U=e.report)==null?void 0:U.since)!=null&&B.commit)?a:"both",f=I=>{var H,ee,K,Y,V,X;return((K=(ee=(H=e.report)==null?void 0:H.nodes[I])==null?void 0:ee.change)==null?void 0:K.kind)??((X=(V=(Y=e.report)==null?void 0:Y.edges[I])==null?void 0:V.change)==null?void 0:X.kind)??null},p=I=>d==="before"&&f(I)==="added"?"later":d==="after"&&f(I)==="removed"?"gone":null,y=I=>d==="both"||I==="changed"?I:null;P.useEffect(()=>{let I=!0;return QC(e.map,n,new Set(e.added),new Set(r)).then(H=>I&&s({key:o,layout:H}),H=>console.error("illuminate: the map could not be laid out",H)),()=>{I=!1}},[o]);const x=(N=e.view)!=null&&N.highlight.length?new Set(e.view.highlight):null,w=P.useMemo(()=>x?new Set(Nh(e.map,[...x])):null,[x,e.map]),m=e.selection,v=P.useMemo(()=>((i==null?void 0:i.layout.branches)??[]).map((I,H)=>({name:I,colour:H%ij+1})),[i]),g=I=>I?v.find(H=>H.name===I)??null:null,k=(I,H,ee)=>{var V;if(!v.length||!ee)return null;if(I==="node")return g((V=e.map.nodes.find(X=>X.id===H))==null?void 0:V.branch);const K=e.map.edges.find(X=>X.id===H),Y=X=>{var E;return(E=e.map.nodes.find(R=>R.id===X))==null?void 0:E.branch};return g((K==null?void 0:K.branch)??Y(K==null?void 0:K.to)??Y(K==null?void 0:K.from))},C=P.useMemo(()=>{if(!i)return[];const I=i.layout,H=V=>!w||e.map.nodes.some(X=>X.area===V&&w.has(X.id)),ee=e.map.areas.flatMap(V=>{const X=I.areas[V.id];return X?[{id:`area:${V.id}`,type:"area",position:{x:X.x,y:X.y},style:{width:X.w,height:X.h},data:{label:V.label,note:null,dim:!H(V.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),K=new Map;if(I.flat){const V=X=>I.branches&&X.branch?1:0;for(const X of e.map.areas){const E=e.map.nodes.filter(R=>R.area===X.id&&I.nodes[R.id]).sort((R,Q)=>V(R)-V(Q)||I.nodes[R.id].x-I.nodes[Q.id].x||I.nodes[R.id].y-I.nodes[Q.id].y)[0];E&&K.set(E.id,X.label)}}const Y=e.map.nodes.flatMap(V=>{var Q,G,q,D,W,Z,te,oe,de,me,ke,Me,ie,Ae,tt,Pe,He,Be,ct;const X=I.nodes[V.id];if(!X)return[];const E=V.evidence[0],R=V.symbol?V.symbol.slice(V.symbol.indexOf("#")+1):E?`${E.file.split("/").pop()}:${E.line}`:"not in the code yet";return[{id:V.id,type:"step",...I.flat?{}:{parentId:`area:${V.area}`,extent:"parent"},position:{x:X.x,y:X.y},data:{name:V.name,sub:R,kind:V.kind,confirmed:!!e.report&&((Q=e.report.nodes[V.id])==null?void 0:Q.status)!=="unconfirmed",proposal:((q=(G=e.report)==null?void 0:G.nodes[V.id])==null?void 0:q.proposal)??null,screen:((Z=(W=(D=e.report)==null?void 0:D.screens)==null?void 0:W[V.id])==null?void 0:Z.status)==="confirmed",selected:m.nodes.includes(V.id),hl:!!(w!=null&&w.has(V.id)),dim:!!w&&!w.has(V.id)&&!m.nodes.includes(V.id),fresh:e.fresh.includes(V.id),change:y(((de=(oe=(te=e.report)==null?void 0:te.nodes[V.id])==null?void 0:oe.change)==null?void 0:de.kind)??null),changeSize:nj((Me=(ke=(me=e.report)==null?void 0:me.nodes[V.id])==null?void 0:ke.change)==null?void 0:Me.diff),ghost:p(V.id),quiet:d==="both"?null:d,...I.flat&&{journey:{w:X.w,h:X.h,shape:V.kind==="choice"?"choice":V.kind==="action"?"action":"screen",outside:V.kind==="external",stage:K.get(V.id)??null,show:r.includes(V.id)?((tt=(Ae=(ie=e.report)==null?void 0:ie.screens)==null?void 0:Ae[V.id])==null?void 0:tt.show)??null:null,branch:k("node",V.id,!!e.report&&((Pe=e.report.nodes[V.id])==null?void 0:Pe.status)!=="unconfirmed"&&!((He=e.report.nodes[V.id])!=null&&He.proposal)&&!y(((ct=(Be=e.report.nodes[V.id])==null?void 0:Be.change)==null?void 0:ct.kind)??null)&&!p(V.id))}},onClick:qr=>e.onSelect("nodes",V.id,qr)},draggable:!1,zIndex:1}]});return[...ee,...Y]},[i,e.map,e.report,m,w,e.fresh,e.onSelect,r,d,v]),S=P.useMemo(()=>{var R,Q,G,q;if(!i)return[];const I=D=>({type:qo.ArrowClosed,width:16,height:16,color:D}),H=D=>!!(x!=null&&x.has(D)),ee=(D,W)=>{const[Z,te]=ej(e.map,i.layout,D,W);return{sourceHandle:`s${Z}`,targetHandle:`t${te}`}},K=new Map,Y=(D,W)=>{const Z=i.layout.rowTops,te=Ks(i.layout,D),oe=Ks(i.layout,W);if(!Z||te===oe)return;const de=Math.max(te,oe),me=K.get(de)??0;return K.set(de,me+1),Z[de]-_u/2+(me%2?1:-1)*Math.ceil(me/2)*18},V=e.map.edges.map(D=>{var Me,ie,Ae,tt,Pe,He,Be;const W=!!e.report&&((Me=e.report.edges[D.id])==null?void 0:Me.status)!=="unconfirmed",Z=((Ae=(ie=e.report)==null?void 0:ie.edges[D.id])==null?void 0:Ae.proposal)??null,te=y(((He=(Pe=(tt=e.report)==null?void 0:tt.edges[D.id])==null?void 0:Pe.change)==null?void 0:He.kind)??null),oe=p(D.id)??p(D.from)??p(D.to),de=H(D.id)||!!w&&w.has(D.from)&&w.has(D.to)&&!x,me="edge",ke=k("edge",D.id,!Z&&!te&&!oe);return{id:`e:${D.id}`,source:D.from,target:D.to,...ee(D.from,D.to),type:"link",className:nn("link",`link-${me}`,!W&&"unconfirmed",Cl(Z),jl(te),oe&&"ghost",Ml(ke),H(D.id)&&"hl",!!x&&!H(D.id)&&"dim",m.edges.includes(D.id)&&"selected"),markerEnd:I(oe?"var(--line)":(Z==null?void 0:Z.state)==="pending"&&Z.kind!=="remove"?"var(--ai)":te==="added"?"var(--ok)":te==="removed"?"var(--dead)":ke?`var(--branch-${ke.colour})`:H(D.id)?"var(--path)":"var(--line-strong)"),zIndex:2,data:{label:D.label,wrapY:Y(D.from,D.to),route:(Be=i.layout.routes)==null?void 0:Be[`e:${D.id}`],branch:ke,variant:me,proposal:Z,change:te,ghost:oe,confirmed:W,hl:de,dim:!!x&&!H(D.id)&&!m.edges.includes(D.id),selected:m.edges.includes(D.id),onClick:ct=>e.onSelect("edges",D.id,ct)}}}),X=D=>{var W;return((W=t==null?void 0:t.connects)==null?void 0:W.from)===D.from&&t.connects.to===D.to};for(const D of e.map.absences){if(!D.between||X(D.between))continue;const W=((Q=(R=e.report)==null?void 0:R.absences[D.id])==null?void 0:Q.status)==="confirmed";V.push({id:`a:${D.id}`,hidden:d==="before",source:D.between.from,target:D.between.to,...ee(D.between.from,D.between.to),type:"link",className:nn("link","link-absence",!W&&"unconfirmed",H(D.id)&&"hl",!!x&&!H(D.id)&&"dim",m.absences.includes(D.id)&&"selected"),markerEnd:I("var(--dead)"),zIndex:2,data:{label:mj(D.claim),route:(G=i.layout.routes)==null?void 0:G[`a:${D.id}`],variant:"absence",confirmed:W,hl:H(D.id),dim:!!x&&!H(D.id)&&!m.absences.includes(D.id),selected:m.absences.includes(D.id),onClick:Z=>e.onSelect("absences",D.id,Z)}})}t!=null&&t.connects&&V.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,...ee(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:I("var(--ok)"),zIndex:3,data:{label:`+ ${t.connects.label}`,route:(q=i.layout.routes)==null?void 0:q[`x:${t.id}`],variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const E=new Map;for(const D of V){const W=[D.source,D.target].sort().join("|");E.set(W,[...E.get(W)??[],D])}for(const D of E.values())D.length<2||D.some(W=>{var Z;return(Z=W.data)==null?void 0:Z.route})||D.forEach((W,Z)=>{W.data&&(W.data.offset=(Z-(D.length-1)/2)*44)});return V},[i,e.map,e.report,m,x,w,t,e.onSelect,d,v]),_=le(I=>I.width),j=P.useRef(0);P.useEffect(()=>{const I=j.current;if(j.current=_,!I||!_||I===_||e.touring)return;const H=l.getViewport();l.setViewport({...H,x:H.x+(_-I)/2})},[_]);const b=JSON.stringify([i==null?void 0:i.key,(T=e.view)==null?void 0:T.focus,(z=e.view)==null?void 0:z.highlight,e.touring,e.touring?_:null]),F=P.useRef(!0);return P.useEffect(()=>{if(!i)return;const I=e.view?Nh(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let H=0,ee=0;const K=()=>{var D;const Y=l.getNodes();if(H<2||!Y.length||!Y.every(W=>{var Z,te;return(te=(Z=l.getInternalNode(W.id))==null?void 0:Z.measured)==null?void 0:te.width})){H++<60&&(ee=requestAnimationFrame(K));return}const V=F.current?0:650;F.current=!1;const X=Object.values(i.layout.nodes),E=Object.values(i.layout.routes??{}).flatMap(W=>W.points),R=Math.max(0,Math.min(0,...X.map(W=>W.y))-Math.min(0,...E.map(W=>W[1]))),Q=Math.max(0,Math.max(0,...E.map(W=>W[1]))-Math.max(0,...X.map(W=>W.y+W.h))+(E.length?16:0)),G=(D=i.layout.branches)!=null&&D.length?56:0,q=I.length?{top:`${60+G}px`,left:e.touring?pj:"60px",right:"60px",bottom:"150px"}:{top:`${64+R+G}px`,left:"32px",right:"32px",bottom:`${130+Q}px`};l.fitView(I.length?{nodes:I.map(W=>({id:W})),duration:V,padding:q,maxZoom:1.15}:{duration:V,padding:q,maxZoom:1.1})};return ee=requestAnimationFrame(K),()=>cancelAnimationFrame(ee)},[b]),h.jsxs(v2,{className:i!=null&&i.layout.flat?"journey":void 0,nodes:C,edges:S,nodeTypes:fj,edgeTypes:hj,onNodeClick:()=>{},onEdgeClick:(I,H)=>{H.id.startsWith("e:")&&e.onSelect("edges",H.id.slice(2),I.shiftKey||I.metaKey),H.id.startsWith("a:")&&e.onSelect("absences",H.id.slice(2),I.shiftKey||I.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:[h.jsx(_2,{variant:Qt.Dots,gap:22,size:1.3}),((($=(O=e.report)==null?void 0:O.since)==null?void 0:$.commit)||v.length>0)&&h.jsx(pi,{position:"top-left",children:h.jsxs("div",{className:"map-keys",children:[((A=(M=e.report)==null?void 0:M.since)==null?void 0:A.commit)&&h.jsx(oj,{commit:e.report.since.commit.slice(0,7),when:d,onWhen:u}),v.length>0&&h.jsx(sj,{branches:v})]})})]})}function $l(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function yj(){const[e,t]=P.useState(location.pathname);return P.useEffect(()=>{const n=()=>t(location.pathname),r=o=>{var s,l;if(o.defaultPrevented||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const i=(l=(s=o.target)==null?void 0:s.closest)==null?void 0:l.call(s,"a[href]");!(i instanceof HTMLAnchorElement)||i.target||i.origin!==location.origin||(o.preventDefault(),$l(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}const vj=8e3;function K0({busy:e,agentName:t="Claude",onStopped:n,onError:r}){const[o,i]=P.useState(!1);return P.useEffect(()=>{if(!o)return;const s=setTimeout(()=>i(!1),vj),l=a=>{a.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>{clearTimeout(s),window.removeEventListener("keydown",l)}},[o]),o&&!e?h.jsxs("span",{className:"stop-ask",role:"group","aria-label":"Stop illuminate?",children:[h.jsx("span",{className:"stop-ask-text",children:"Stop illuminate? Maps stay saved."}),h.jsx("button",{className:"pill-btn stop-yes",autoFocus:!0,onClick:()=>{i(!1),_t.stop().then(n,s=>r(s.message))},children:"Stop"}),h.jsx("button",{className:"pill-btn",onClick:()=>i(!1),children:"Keep running"})]}):h.jsx("button",{className:"pill-btn",disabled:e,title:e?`${t} is still working`:"Maps stay saved. Undo for applied fixes ends.",onClick:()=>i(!0),children:"Stop illuminate"})}function xj(){return h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"illuminate has stopped"}),h.jsx("p",{className:"muted lede",children:"You can close this tab."}),h.jsxs("p",{className:"muted lede",children:["Maps are saved in ",h.jsx("code",{children:".illuminate/maps"}),". Run ",h.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function wj({onStopped:e}){const[t,n]=P.useState(""),[r,o]=P.useState(null),[i,s]=P.useState([]),[l,a]=P.useState(""),[u,c]=P.useState(null),[d,f]=P.useState(!1),[p,y]=P.useState(T0);P.useEffect(()=>I0(()=>{},()=>{},e),[e]),P.useEffect(()=>{_t.list().then(w=>{n(w.repo),o(w.maps),s(w.making),w.agent&&y(w.agent)},w=>c(w.message))},[]);const x=async()=>{if(l.trim()){f(!0);try{const{id:w}=await _t.make(l.trim());$l(Dt(w))}catch(w){c(w.message),f(!1)}}};return h.jsxs("main",{className:"home",children:[h.jsxs("div",{className:"home-brand",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&h.jsx("span",{className:"muted",children:t})]}),h.jsx("h1",{children:"Ask how your code works"}),h.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),Nl(p)?h.jsxs("p",{className:"home-ask chat-hint",children:[h.jsxs("strong",{children:["Ask for a new map in the ",p.name," chat beside this page"]})," ",h.jsx("span",{className:"muted",children:"for example: “Map what happens when a user signs up.”"})]}):h.jsxs("form",{className:"home-ask",onSubmit:w=>{w.preventDefault(),x()},children:[h.jsx("input",{id:"question",value:l,onChange:w=>a(w.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),h.jsx("button",{className:"btn primary",disabled:d||!l.trim(),children:d?"Starting…":"Map it"})]}),u&&h.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Being made now"}),h.jsx("ul",{className:"maplist",children:i.map(w=>h.jsxs("li",{children:[h.jsx("a",{href:Dt(w.id),children:w.question}),h.jsxs("span",{className:"muted small",children:[p.name," is exploring…"]})]},w.id))})]}),h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?h.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?h.jsx("p",{className:"muted",children:"None yet."}):h.jsx("ul",{className:"maplist",children:r.map(w=>h.jsxs("li",{children:[h.jsx("a",{href:Dt(w.id),children:w.question}),h.jsxs("span",{className:"muted small",children:[new Date(w.updatedAt).toLocaleString(),w.commit?` · ${w.commit.slice(0,7)}`:""]})]},w.id))})]}),h.jsx("footer",{className:"home-foot",children:h.jsx(K0,{busy:i.length>0,agentName:p.name,onStopped:e,onError:c})})]})}const Eh="illuminate-panel-width",Cu=300,G0=400,kj=360,ma=e=>Math.round(Math.max(Cu,Math.min(e,Math.max(Cu,window.innerWidth-kj))));function Sj(){const[e,t]=P.useState(()=>{const r=Number(localStorage.getItem(Eh));return ma(r>0?r:G0)}),n=P.useCallback(r=>{const o=ma(r);t(o),localStorage.setItem(Eh,String(o))},[]);return P.useEffect(()=>{const r=()=>t(o=>ma(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function Nj({width:e,onWidth:t}){return h.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":Cu,tabIndex:0,title:"Drag to resize the panel",onPointerDown:n=>{n.preventDefault();const r=n.currentTarget;r.setPointerCapture(n.pointerId),document.body.classList.add("resizing");const o=s=>t(window.innerWidth-s.clientX),i=()=>{r.removeEventListener("pointermove",o),r.removeEventListener("pointerup",i),r.removeEventListener("pointercancel",i),document.body.classList.remove("resizing")};r.addEventListener("pointermove",o),r.addEventListener("pointerup",i),r.addEventListener("pointercancel",i)},onDoubleClick:()=>t(G0),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const Ej=(...e)=>e.filter(Boolean).join(" ");function _j({map:e,stop:t,onTour:n,onAsk:r}){var s;const o=e.tour[t];if(!o)return null;const i=t===e.tour.length-1;return h.jsxs("section",{className:"card card-focus tour-bubble","aria-label":"Walkthrough","aria-live":"polite",children:[h.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>n(null),children:"×"}),h.jsxs("div",{className:"tour-head",children:[h.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",t+1," of ",e.tour.length]}),h.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((l,a)=>h.jsx("i",{className:Ej(a===t&&"on",a<t&&"done")},l.id))})]}),h.jsx("h2",{className:"card-title",children:o.title}),h.jsx(ni,{text:o.text,className:"depth-text"}),(s=o.terms)!=null&&s.length?h.jsxs("p",{className:"muted small",children:["Terms: ",o.terms.join(", ")]}):null,h.jsxs("div",{className:"tour-nav",children:[h.jsx("button",{className:"btn",disabled:t===0,onClick:()=>n(t-1),children:"‹ Back"}),r&&h.jsx("button",{className:"btn",onClick:r,children:"Ask about this step"}),h.jsx("span",{className:"grow"}),i?h.jsx("button",{className:"btn primary",onClick:()=>n(null),children:"Done"}):h.jsx("button",{className:"btn primary",onClick:()=>n(t+1),children:"Next ›"})]}),h.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}function Cj(){return Yr?h.jsx(jj,{}):h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"Open illuminate from its link"}),h.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",h.jsx("code",{children:"?t=…"}),")."]})]})}function jj(){const[e,t]=P.useState(!1),n=P.useCallback(()=>{window.close(),t(!0)},[]),r=yj();if(e)return h.jsx(xj,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?h.jsx(Pj,{mapId:o[1],onStopped:n},o[1]):h.jsx(wj,{onStopped:n})}function Mj({mapId:e,question:t,making:n}){const[r,o]=P.useState([]);P.useEffect(()=>{_t.list().then(s=>o([...s.making.map(l=>({...l,making:!0})),...s.maps.map(l=>({id:l.id,question:l.question}))]),()=>{})},[e,n]);const i=r.some(s=>s.id===e)?r:[{id:e,question:t},...r];return h.jsx("select",{className:"switcher",value:e,onChange:s=>$l(Dt(s.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:i.map(s=>h.jsxs("option",{value:s.id,children:[s.question||s.id,s.making?" (being made)":""]},s.id))})}function $j({report:e}){if(!e)return null;const t=e.summary.unconfirmed,{pending:n,done:r}=e.summary.proposals??{pending:0,done:0},o=n+r,i=o?h.jsx("span",{className:"map-status proposals",title:"Parts of this map are a proposal, drawn in violet: they aren't in the code yet, or would change or go. illuminate checks the code to see which have been done.",children:r===0?`${o} proposed ${o===1?"change":"changes"}`:`${r} of ${o} proposed changes done`}):null,s=h.jsxs(h.Fragment,{children:[i,h.jsx(bj,{report:e})]});return t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status off",title:"Every time the map is shown, illuminate re-checks it against the code. These parts no longer hold, usually because the code changed after the map was made. They're dashed and marked ? on the map; click one to see why.",children:t===1?"1 part of this map doesn’t match the code":`${t} parts of this map don’t match the code`}),s]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status ok",title:"Every box and arrow on this map was just re-checked and is really in the code, and every gap's search still finds nothing. That shows each part is real; it doesn't show the map covers everything.",children:"✓ Every part is in the code"}),s]})}function bj({report:e}){const t=e.since;if(!t)return null;if(!t.commit)return h.jsx("span",{className:"map-status off",title:`This map compares the code with "${t.ref}", but that isn't a commit in this repo, so nothing could be compared.`,children:"Can’t find the commit this map compares with"});const{added:n,changed:r,removed:o}=e.summary.changes??{added:0,changed:0,removed:0},i=t.date?new Date(t.date).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null,s=[n&&`${n} added`,r&&`${r} changed`,o&&`${o} removed`].filter(Boolean).join(" · ");return h.jsxs("span",{className:"map-status changes",title:`This map shows the code as it is now, compared with commit ${t.commit.slice(0,7)}${t.subject?` ("${t.subject}")`:""}. illuminate works out from the two versions which boxes and arrows are new, different or gone. It can't tell who made a change.`,children:["Changes since ",t.commit.slice(0,7),i?` (${i})`:"",s?`: ${s}`:": nothing on this map differs"]})}function Pj({mapId:e,onStopped:t}){var O,$,M,A,I,H,ee,K;const[n,r]=P.useReducer(SC,e,yC),[o,i]=P.useState(""),[s,l]=Sj(),a=P.useRef(!1),u=P.useCallback(()=>{_t.get(e).then(Y=>r({type:"loaded",payload:Y}),Y=>r(Y instanceof P0&&/No such map/.test(Y.message)?{type:"missing"}:{type:"error",message:Y.message}))},[e]);P.useEffect(u,[u]),P.useEffect(()=>I0(Y=>r({type:"event",event:Y}),Y=>{r({type:"connected",value:Y}),Y&&a.current===!1&&n.phase!=="loading"&&u(),a.current=Y},t,e),[]);const c=n.map&&n.tour!==null?((O=n.map.tour[n.tour])==null?void 0:O.title)??null:null;P.useEffect(()=>{const Y=n.phase==="ready"?q2(n.agent,n.selection,c):null;if(!Y)return;const V=setTimeout(()=>void _t.selection(e,Y.selection,Y.step).catch(()=>{}),250);return()=>clearTimeout(V)},[e,n.phase,n.agent,n.selection,c]);const d=Nl(n.agent),[f,p]=P.useState(null);P.useEffect(()=>p(null),[n.tour]);const y=n.map&&n.tour!==null&&f===n.tour?(($=n.map.tour[n.tour])==null?void 0:$.title)??null:null,x=P.useCallback(Y=>{const V=Y.trim();if(!V||n.job)return;const X=y?mC(y,V):V;_t.ask(e,X,n.selection).then(()=>i(""),E=>r({type:"error",message:E.message}))},[e,n.job,n.selection,y]),w=(Y,V)=>{V==="approve"&&r({type:"fixStatus",fixId:Y,status:"applying",problems:[]}),_t[V](e,Y).catch(X=>{r(V==="approve"?{type:"fixStatus",fixId:Y,status:"failed",problems:X.problems.length?X.problems:[X.message]}:{type:"error",message:[X.message,...X.problems].join(" ")})})},m=(Y,V)=>{_t.offer(e,Y,V).then(X=>{X.id&&$l(Dt(X.id))},X=>r({type:"error",message:X.message}))};P.useEffect(()=>{const Y=V=>{const X=V.target instanceof HTMLTextAreaElement||V.target instanceof HTMLInputElement;if(V.key==="Escape"){mo(n.selection)?r({type:"clearSelection"}):n.tour!==null&&n.peek?r({type:"peek",open:!1}):n.tour!==null?r({type:"tour",stop:null}):r({type:"overview"});return}X||n.tour===null||(V.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),V.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[n.tour,n.peek,n.selection]);const v=n.answers.find(Y=>Y.id===n.shown),g=v!=null&&v.fix&&["proposed","applying","failed"].includes(((M=n.fixes[v.fix.id])==null?void 0:M.status)??"")?v.fix:null,k=P.useCallback((Y,V,X)=>r({type:"select",kind:Y,id:V,additive:X}),[]),C=P.useCallback(()=>r({type:"clearSelection"}),[]),S=O0(n),_=xC(n),j=vC(n),b=!!n.map&&n.tour!==null,F=P.useMemo(()=>({...n,answers:J2(n.agent,n.answers,n.fixes)}),[n]),L=n.shown!==null&&F.answers.some(Y=>Y.id===n.shown),U=((A=n.job)==null?void 0:A.kind)==="ask"&&!d,N=(!n.map||!!n.error||!!n.job&&(n.job.kind==="make"||U)||L)&&(!b||n.peek||!!n.error||U),T=N&&!!n.map,z=n.map&&d?h.jsx(TC,{map:n.map,agent:n.agent,selection:n.selection,step:c,onRemove:(Y,V)=>r({type:"select",kind:Y,id:V,additive:!0})}):n.map?h.jsx(IC,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,agentName:n.agent.name,autoFocus:T,onDraft:i,onRemove:(Y,V)=>r({type:"select",kind:Y,id:V,additive:!0}),step:y,onRemoveStep:()=>p(null),onSend:()=>x(o)}):null;return h.jsx(j0,{children:h.jsxs("div",{className:"app",children:[h.jsxs("header",{className:"topbar",children:[h.jsxs("a",{className:"brand",href:Dt(),title:"All maps in this repo",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),h.jsxs("div",{className:"topbar-map",children:[((I=n.meta)==null?void 0:I.parent)&&h.jsxs("a",{className:"crumb",href:Dt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),h.jsx(Mj,{mapId:e,question:((H=n.map)==null?void 0:H.question)??((ee=n.job)==null?void 0:ee.question)??"",making:((K=n.job)==null?void 0:K.kind)==="make"})]}),h.jsx($j,{report:n.report}),h.jsx("a",{className:"pill-btn",href:Dt(),title:"Ask a new question and make a map for it",children:"New map"}),h.jsx(K0,{busy:!!n.job,agentName:n.agent.name,onStopped:t,onError:Y=>r({type:"error",message:Y})}),h.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),h.jsxs("div",{className:N?"body":"body full",style:{"--panel-w":`${s}px`},children:[h.jsx("div",{className:"canvas",children:n.map&&S?h.jsxs(h.Fragment,{children:[h.jsx(gj,{map:S,report:n.report,selection:n.selection,view:j,fresh:n.fresh,added:_,ghost:g??null,touring:b,onSelect:k,onClear:C}),!N&&h.jsx(DC,{state:F,dispatch:r}),mo(n.selection)>0&&h.jsx(HC,{mapId:e,map:S,report:n.report,selection:n.selection,onClose:C}),b&&mo(n.selection)===0&&h.jsx(_j,{map:n.map,stop:n.tour,onTour:Y=>r({type:"tour",stop:Y}),onAsk:d?void 0:()=>{var Y;p(n.tour),(Y=document.getElementById("ask"))==null||Y.focus()}}),h.jsx(RC,{map:n.map,mapId:e,tour:n.tour,onTour:Y=>r({type:"tour",stop:Y}),selected:mo(n.selection),children:T?null:z})]}):h.jsx("div",{className:"empty",children:n.phase==="making"?h.jsxs("div",{className:"pulse",children:[n.agent.name," is exploring the code…"]}):null})}),N&&h.jsx(Nj,{width:s,onWidth:l}),N&&h.jsx(jC,{state:F,dispatch:r,onFix:w,onFocus:Y=>r({type:"focus",id:Y}),onOffer:m,composer:T?z:null})]})]})})}Om(document.getElementById("root")).render(h.jsx(P.StrictMode,{children:h.jsx(Cj,{})}));export{Ij as c,_h as g};
|
|
71
|
-
//# sourceMappingURL=index-hKIGtEeA.js.map
|