var e1=Object.defineProperty;var ov=e=>{throw TypeError(e)};var t1=(e,o,r)=>o in e?e1(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r;var zn=(e,o,r)=>t1(e,typeof o!="symbol"?o+"":o,r),iv=(e,o,r)=>o.has(e)||ov("Cannot "+r);var Pu=(e,o,r)=>(iv(e,o,"read from private field"),r?r.call(e):o.get(e)),av=(e,o,r)=>o.has(e)?ov("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(e):o.set(e,r),sv=(e,o,r,t)=>(iv(e,o,"write to private field"),t?t.call(e,r):o.set(e,r),r);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))t(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const f of i.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&t(f)}).observe(document,{childList:!0,subtree:!0});function r(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(n){if(n.ep)return;n.ep=!0;const i=r(n);fetch(n.href,i)}})();var no=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rd={exports:{}},Ou={},Md={exports:{}},Mt={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var uv;function n1(){if(uv)return Mt;uv=1;var e=Symbol.for("react.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),t=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),f=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),s=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),a=Symbol.iterator;function l(J){return J===null||typeof J!="object"?null:(J=a&&J[a]||J["@@iterator"],typeof J=="function"?J:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,_={};function w(J,ne,fe){this.props=J,this.context=ne,this.refs=_,this.updater=fe||p}w.prototype.isReactComponent={},w.prototype.setState=function(J,ne){if(typeof J!="object"&&typeof J!="function"&&J!=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,J,ne,"setState")},w.prototype.forceUpdate=function(J){this.updater.enqueueForceUpdate(this,J,"forceUpdate")};function x(){}x.prototype=w.prototype;function m(J,ne,fe){this.props=J,this.context=ne,this.refs=_,this.updater=fe||p}var g=m.prototype=new x;g.constructor=m,v(g,w.prototype),g.isPureReactComponent=!0;var b=Array.isArray,S=Object.prototype.hasOwnProperty,E={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function T(J,ne,fe){var ce,ue={},ge=null,xe=null;if(ne!=null)for(ce in ne.ref!==void 0&&(xe=ne.ref),ne.key!==void 0&&(ge=""+ne.key),ne)S.call(ne,ce)&&!A.hasOwnProperty(ce)&&(ue[ce]=ne[ce]);var ye=arguments.length-2;if(ye===1)ue.children=fe;else if(1>>1,ne=U[J];if(0>>1;Jn(ue,G))gen(xe,ue)?(U[J]=xe,U[ge]=G,J=ge):(U[J]=ue,U[ce]=G,J=ce);else if(gen(xe,G))U[J]=xe,U[ge]=G,J=ge;else break e}}return H}function n(U,H){var G=U.sortIndex-H.sortIndex;return G!==0?G:U.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var f=Date,u=f.now();e.unstable_now=function(){return f.now()-u}}var h=[],s=[],d=1,a=null,l=3,p=!1,v=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,m=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(U){for(var H=r(s);H!==null;){if(H.callback===null)t(s);else if(H.startTime<=U)t(s),H.sortIndex=H.expirationTime,o(h,H);else break;H=r(s)}}function b(U){if(_=!1,g(U),!v)if(r(h)!==null)v=!0,z(S);else{var H=r(s);H!==null&&K(b,H.startTime-U)}}function S(U,H){v=!1,_&&(_=!1,x(T),T=-1),p=!0;var G=l;try{for(g(H),a=r(h);a!==null&&(!(a.expirationTime>H)||U&&!I());){var J=a.callback;if(typeof J=="function"){a.callback=null,l=a.priorityLevel;var ne=J(a.expirationTime<=H);H=e.unstable_now(),typeof ne=="function"?a.callback=ne:a===r(h)&&t(h),g(H)}else t(h);a=r(h)}if(a!==null)var fe=!0;else{var ce=r(s);ce!==null&&K(b,ce.startTime-H),fe=!1}return fe}finally{a=null,l=G,p=!1}}var E=!1,A=null,T=-1,D=5,O=-1;function I(){return!(e.unstable_now()-OU||125J?(U.sortIndex=G,o(s,U),r(h)===null&&U===r(s)&&(_?(x(T),T=-1):_=!0,K(b,G-J))):(U.sortIndex=ne,o(h,U),v||p||(v=!0,z(S))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var H=l;return function(){var G=l;l=H;try{return U.apply(this,arguments)}finally{l=G}}}}(Bd)),Bd}var dv;function a1(){return dv||(dv=1,jd.exports=i1()),jd.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var pv;function s1(){if(pv)return or;pv=1;var e=yl(),o=a1();function r(c){for(var y="https://reactjs.org/docs/error-decoder.html?invariant="+c,C=1;C"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,s=/^[: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]*$/,d={},a={};function l(c){return h.call(a,c)?!0:h.call(d,c)?!1:s.test(c)?a[c]=!0:(d[c]=!0,!1)}function p(c,y,C,P){if(C!==null&&C.type===0)return!1;switch(typeof y){case"function":case"symbol":return!0;case"boolean":return P?!1:C!==null?!C.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function v(c,y,C,P){if(y===null||typeof y>"u"||p(c,y,C,P))return!0;if(P)return!1;if(C!==null)switch(C.type){case 3:return!y;case 4:return y===!1;case 5:return isNaN(y);case 6:return isNaN(y)||1>y}return!1}function _(c,y,C,P,j,W,oe){this.acceptsBooleans=y===2||y===3||y===4,this.attributeName=P,this.attributeNamespace=j,this.mustUseProperty=C,this.propertyName=c,this.type=y,this.sanitizeURL=W,this.removeEmptyString=oe}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){w[c]=new _(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var y=c[0];w[y]=new _(y,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){w[c]=new _(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){w[c]=new _(c,2,!1,c,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(c){w[c]=new _(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){w[c]=new _(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){w[c]=new _(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){w[c]=new _(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){w[c]=new _(c,5,!1,c.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function m(c){return c[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(c){var y=c.replace(x,m);w[y]=new _(y,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var y=c.replace(x,m);w[y]=new _(y,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var y=c.replace(x,m);w[y]=new _(y,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){w[c]=new _(c,1,!1,c.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){w[c]=new _(c,1,!1,c.toLowerCase(),null,!0,!0)});function g(c,y,C,P){var j=w.hasOwnProperty(y)?w[y]:null;(j!==null?j.type!==0:P||!(2de||j[oe]!==W[de]){var _e=` `+j[oe].replace(" at new "," at ");return c.displayName&&_e.includes("")&&(_e=_e.replace("",c.displayName)),_e}while(1<=oe&&0<=de);break}}}finally{fe=!1,Error.prepareStackTrace=C}return(c=c?c.displayName||c.name:"")?ne(c):""}function ue(c){switch(c.tag){case 5:return ne(c.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return c=ce(c.type,!1),c;case 11:return c=ce(c.type.render,!1),c;case 1:return c=ce(c.type,!0),c;default:return""}}function ge(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case A:return"Fragment";case E:return"Portal";case D:return"Profiler";case T:return"StrictMode";case B:return"Suspense";case R:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case I:return(c.displayName||"Context")+".Consumer";case O:return(c._context.displayName||"Context")+".Provider";case M:var y=c.render;return c=c.displayName,c||(c=y.displayName||y.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case L:return y=c.displayName||null,y!==null?y:ge(c.type)||"Memo";case z:y=c._payload,c=c._init;try{return ge(c(y))}catch{}}return null}function xe(c){var y=c.type;switch(c.tag){case 24:return"Cache";case 9:return(y.displayName||"Context")+".Consumer";case 10:return(y._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=y.render,c=c.displayName||c.name||"",y.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return y;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(y);case 8:return y===T?"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 y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y}return null}function ye(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function he(c){var y=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(y==="checkbox"||y==="radio")}function $(c){var y=he(c)?"checked":"value",C=Object.getOwnPropertyDescriptor(c.constructor.prototype,y),P=""+c[y];if(!c.hasOwnProperty(y)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var j=C.get,W=C.set;return Object.defineProperty(c,y,{configurable:!0,get:function(){return j.call(this)},set:function(oe){P=""+oe,W.call(this,oe)}}),Object.defineProperty(c,y,{enumerable:C.enumerable}),{getValue:function(){return P},setValue:function(oe){P=""+oe},stopTracking:function(){c._valueTracker=null,delete c[y]}}}}function k(c){c._valueTracker||(c._valueTracker=$(c))}function q(c){if(!c)return!1;var y=c._valueTracker;if(!y)return!0;var C=y.getValue(),P="";return c&&(P=he(c)?c.checked?"true":"false":c.value),c=P,c!==C?(y.setValue(c),!0):!1}function X(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function Z(c,y){var C=y.checked;return G({},y,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??c._wrapperState.initialChecked})}function te(c,y){var C=y.defaultValue==null?"":y.defaultValue,P=y.checked!=null?y.checked:y.defaultChecked;C=ye(y.value!=null?y.value:C),c._wrapperState={initialChecked:P,initialValue:C,controlled:y.type==="checkbox"||y.type==="radio"?y.checked!=null:y.value!=null}}function re(c,y){y=y.checked,y!=null&&g(c,"checked",y,!1)}function ve(c,y){re(c,y);var C=ye(y.value),P=y.type;if(C!=null)P==="number"?(C===0&&c.value===""||c.value!=C)&&(c.value=""+C):c.value!==""+C&&(c.value=""+C);else if(P==="submit"||P==="reset"){c.removeAttribute("value");return}y.hasOwnProperty("value")?Be(c,y.type,C):y.hasOwnProperty("defaultValue")&&Be(c,y.type,ye(y.defaultValue)),y.checked==null&&y.defaultChecked!=null&&(c.defaultChecked=!!y.defaultChecked)}function Oe(c,y,C){if(y.hasOwnProperty("value")||y.hasOwnProperty("defaultValue")){var P=y.type;if(!(P!=="submit"&&P!=="reset"||y.value!==void 0&&y.value!==null))return;y=""+c._wrapperState.initialValue,C||y===c.value||(c.value=y),c.defaultValue=y}C=c.name,C!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,C!==""&&(c.name=C)}function Be(c,y,C){(y!=="number"||X(c.ownerDocument)!==c)&&(C==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+C&&(c.defaultValue=""+C))}var He=Array.isArray;function at(c,y,C,P){if(c=c.options,y){y={};for(var j=0;j"+y.valueOf().toString()+"",y=pt.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;y.firstChild;)c.appendChild(y.firstChild)}});function it(c,y){if(y){var C=c.firstChild;if(C&&C===c.lastChild&&C.nodeType===3){C.nodeValue=y;return}}c.textContent=y}var Ce={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},ze=["Webkit","ms","Moz","O"];Object.keys(Ce).forEach(function(c){ze.forEach(function(y){y=y+c.charAt(0).toUpperCase()+c.substring(1),Ce[y]=Ce[c]})});function Ze(c,y,C){return y==null||typeof y=="boolean"||y===""?"":C||typeof y!="number"||y===0||Ce.hasOwnProperty(c)&&Ce[c]?(""+y).trim():y+"px"}function Xe(c,y){c=c.style;for(var C in y)if(y.hasOwnProperty(C)){var P=C.indexOf("--")===0,j=Ze(C,y[C],P);C==="float"&&(C="cssFloat"),P?c.setProperty(C,j):c[C]=j}}var Ve=G({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 St(c,y){if(y){if(Ve[c]&&(y.children!=null||y.dangerouslySetInnerHTML!=null))throw Error(r(137,c));if(y.dangerouslySetInnerHTML!=null){if(y.children!=null)throw Error(r(60));if(typeof y.dangerouslySetInnerHTML!="object"||!("__html"in y.dangerouslySetInnerHTML))throw Error(r(61))}if(y.style!=null&&typeof y.style!="object")throw Error(r(62))}}function lt(c,y){if(c.indexOf("-")===-1)return typeof y.is=="string";switch(c){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 Et=null;function $e(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Gt=null,Xt=null,Lt=null;function mn(c){if(c=mu(c)){if(typeof Gt!="function")throw Error(r(280));var y=c.stateNode;y&&(y=Ql(y),Gt(c.stateNode,c.type,y))}}function Mr(c){Xt?Lt?Lt.push(c):Lt=[c]:Xt=c}function ci(){if(Xt){var c=Xt,y=Lt;if(Lt=Xt=null,mn(c),y)for(c=0;c>>=0,c===0?32:31-(Ja(c)/Qa|0)|0}var Cr=64,Ar=4194304;function kn(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function go(c,y){var C=c.pendingLanes;if(C===0)return 0;var P=0,j=c.suspendedLanes,W=c.pingedLanes,oe=C&268435455;if(oe!==0){var de=oe&~j;de!==0?P=kn(de):(W&=oe,W!==0&&(P=kn(W)))}else oe=C&~j,oe!==0?P=kn(oe):W!==0&&(P=kn(W));if(P===0)return 0;if(y!==0&&y!==P&&(y&j)===0&&(j=P&-P,W=y&-y,j>=W||j===16&&(W&4194240)!==0))return y;if((P&4)!==0&&(P|=C&16),y=c.entangledLanes,y!==0)for(c=c.entanglements,y&=P;0C;C++)y.push(c);return y}function Gn(c,y,C){c.pendingLanes|=y,y!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,y=31-On(y),c[y]=C}function ra(c,y){var C=c.pendingLanes&~y;c.pendingLanes=y,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=y,c.mutableReadLanes&=y,c.entangledLanes&=y,y=c.entanglements;var P=c.eventTimes;for(c=c.expirationTimes;0=xi),Wl=" ",Gl=!1;function ma(c,y){switch(c){case"keyup":return Vl.indexOf(y.keyCode)!==-1;case"keydown":return y.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tr(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var qt=!1;function ps(c,y){switch(c){case"compositionend":return Tr(y);case"keypress":return y.which!==32?null:(Gl=!0,Wl);case"textInput":return c=y.data,c===Wl&&Gl?null:c;default:return null}}function Qn(c,y){if(qt)return c==="compositionend"||!pa&&ma(c,y)?(c=as(),vi=ru=vo=null,qt=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(y.ctrlKey||y.altKey||y.metaKey)||y.ctrlKey&&y.altKey){if(y.char&&1=y)return{node:C,offset:y-c};c=P}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=be(C)}}function Pe(c,y){return c&&y?c===y?!0:c&&c.nodeType===3?!1:y&&y.nodeType===3?Pe(c,y.parentNode):"contains"in c?c.contains(y):c.compareDocumentPosition?!!(c.compareDocumentPosition(y)&16):!1:!1}function Ae(){for(var c=window,y=X();y instanceof c.HTMLIFrameElement;){try{var C=typeof y.contentWindow.location.href=="string"}catch{C=!1}if(C)c=y.contentWindow;else break;y=X(c.document)}return y}function Ie(c){var y=c&&c.nodeName&&c.nodeName.toLowerCase();return y&&(y==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||y==="textarea"||c.contentEditable==="true")}function Me(c){var y=Ae(),C=c.focusedElem,P=c.selectionRange;if(y!==C&&C&&C.ownerDocument&&Pe(C.ownerDocument.documentElement,C)){if(P!==null&&Ie(C)){if(y=P.start,c=P.end,c===void 0&&(c=y),"selectionStart"in C)C.selectionStart=y,C.selectionEnd=Math.min(c,C.value.length);else if(c=(y=C.ownerDocument||document)&&y.defaultView||window,c.getSelection){c=c.getSelection();var j=C.textContent.length,W=Math.min(P.start,j);P=P.end===void 0?W:Math.min(P.end,j),!c.extend&&W>P&&(j=P,P=W,W=j),j=De(C,W);var oe=De(C,P);j&&oe&&(c.rangeCount!==1||c.anchorNode!==j.node||c.anchorOffset!==j.offset||c.focusNode!==oe.node||c.focusOffset!==oe.offset)&&(y=y.createRange(),y.setStart(j.node,j.offset),c.removeAllRanges(),W>P?(c.addRange(y),c.extend(oe.node,oe.offset)):(y.setEnd(oe.node,oe.offset),c.addRange(y)))}}for(y=[],c=C;c=c.parentNode;)c.nodeType===1&&y.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C=document.documentMode,Ue=null,Ye=null,rt=null,Je=!1;function et(c,y,C){var P=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;Je||Ue==null||Ue!==X(P)||(P=Ue,"selectionStart"in P&&Ie(P)?P={start:P.selectionStart,end:P.selectionEnd}:(P=(P.ownerDocument&&P.ownerDocument.defaultView||window).getSelection(),P={anchorNode:P.anchorNode,anchorOffset:P.anchorOffset,focusNode:P.focusNode,focusOffset:P.focusOffset}),rt&&Ne(rt,P)||(rt=P,P=Kl(Ye,"onSelect"),0_s||(c.current=kf[_s],kf[_s]=null,_s--)}function Zt(c,y){_s++,kf[_s]=c.current,c.current=y}var Ei={},Mn=Si(Ei),Zn=Si(!1),_a=Ei;function xs(c,y){var C=c.type.contextTypes;if(!C)return Ei;var P=c.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===y)return P.__reactInternalMemoizedMaskedChildContext;var j={},W;for(W in C)j[W]=y[W];return P&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=y,c.__reactInternalMemoizedMaskedChildContext=j),j}function er(c){return c=c.childContextTypes,c!=null}function Zl(){nn(Zn),nn(Mn)}function Ag(c,y,C){if(Mn.current!==Ei)throw Error(r(168));Zt(Mn,y),Zt(Zn,C)}function Dg(c,y,C){var P=c.stateNode;if(y=y.childContextTypes,typeof P.getChildContext!="function")return C;P=P.getChildContext();for(var j in P)if(!(j in y))throw Error(r(108,xe(c)||"Unknown",j));return G({},C,P)}function ec(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Ei,_a=Mn.current,Zt(Mn,c),Zt(Zn,Zn.current),!0}function Tg(c,y,C){var P=c.stateNode;if(!P)throw Error(r(169));C?(c=Dg(c,y,_a),P.__reactInternalMemoizedMergedChildContext=c,nn(Zn),nn(Mn),Zt(Mn,c)):nn(Zn),Zt(Zn,C)}var Uo=null,tc=!1,If=!1;function Ng(c){Uo===null?Uo=[c]:Uo.push(c)}function _S(c){tc=!0,Ng(c)}function Ci(){if(!If&&Uo!==null){If=!0;var c=0,y=$t;try{var C=Uo;for($t=1;c>=oe,j-=oe,Vo=1<<32-On(y)+j|C<Dt?(Cn=wt,wt=null):Cn=wt.sibling;var Ht=Ge(ke,wt,Fe[Dt],nt);if(Ht===null){wt===null&&(wt=Cn);break}c&&wt&&Ht.alternate===null&&y(ke,wt),Ee=W(Ht,Ee,Dt),xt===null?mt=Ht:xt.sibling=Ht,xt=Ht,wt=Cn}if(Dt===Fe.length)return C(ke,wt),on&&wa(ke,Dt),mt;if(wt===null){for(;DtDt?(Cn=wt,wt=null):Cn=wt.sibling;var Fi=Ge(ke,wt,Ht.value,nt);if(Fi===null){wt===null&&(wt=Cn);break}c&&wt&&Fi.alternate===null&&y(ke,wt),Ee=W(Fi,Ee,Dt),xt===null?mt=Fi:xt.sibling=Fi,xt=Fi,wt=Cn}if(Ht.done)return C(ke,wt),on&&wa(ke,Dt),mt;if(wt===null){for(;!Ht.done;Dt++,Ht=Fe.next())Ht=Ke(ke,Ht.value,nt),Ht!==null&&(Ee=W(Ht,Ee,Dt),xt===null?mt=Ht:xt.sibling=Ht,xt=Ht);return on&&wa(ke,Dt),mt}for(wt=P(ke,wt);!Ht.done;Dt++,Ht=Fe.next())Ht=ut(wt,ke,Dt,Ht.value,nt),Ht!==null&&(c&&Ht.alternate!==null&&wt.delete(Ht.key===null?Dt:Ht.key),Ee=W(Ht,Ee,Dt),xt===null?mt=Ht:xt.sibling=Ht,xt=Ht);return c&&wt.forEach(function(ZS){return y(ke,ZS)}),on&&wa(ke,Dt),mt}function pn(ke,Ee,Fe,nt){if(typeof Fe=="object"&&Fe!==null&&Fe.type===A&&Fe.key===null&&(Fe=Fe.props.children),typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case S:e:{for(var mt=Fe.key,xt=Ee;xt!==null;){if(xt.key===mt){if(mt=Fe.type,mt===A){if(xt.tag===7){C(ke,xt.sibling),Ee=j(xt,Fe.props.children),Ee.return=ke,ke=Ee;break e}}else if(xt.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===z&&Rg(mt)===xt.type){C(ke,xt.sibling),Ee=j(xt,Fe.props),Ee.ref=gu(ke,xt,Fe),Ee.return=ke,ke=Ee;break e}C(ke,xt);break}else y(ke,xt);xt=xt.sibling}Fe.type===A?(Ee=Na(Fe.props.children,ke.mode,nt,Fe.key),Ee.return=ke,ke=Ee):(nt=Nc(Fe.type,Fe.key,Fe.props,null,ke.mode,nt),nt.ref=gu(ke,Ee,Fe),nt.return=ke,ke=nt)}return oe(ke);case E:e:{for(xt=Fe.key;Ee!==null;){if(Ee.key===xt)if(Ee.tag===4&&Ee.stateNode.containerInfo===Fe.containerInfo&&Ee.stateNode.implementation===Fe.implementation){C(ke,Ee.sibling),Ee=j(Ee,Fe.children||[]),Ee.return=ke,ke=Ee;break e}else{C(ke,Ee);break}else y(ke,Ee);Ee=Ee.sibling}Ee=Pd(Fe,ke.mode,nt),Ee.return=ke,ke=Ee}return oe(ke);case z:return xt=Fe._init,pn(ke,Ee,xt(Fe._payload),nt)}if(He(Fe))return ft(ke,Ee,Fe,nt);if(H(Fe))return dt(ke,Ee,Fe,nt);ic(ke,Fe)}return typeof Fe=="string"&&Fe!==""||typeof Fe=="number"?(Fe=""+Fe,Ee!==null&&Ee.tag===6?(C(ke,Ee.sibling),Ee=j(Ee,Fe),Ee.return=ke,ke=Ee):(C(ke,Ee),Ee=Nd(Fe,ke.mode,nt),Ee.return=ke,ke=Ee),oe(ke)):C(ke,Ee)}return pn}var Es=Mg(!0),Lg=Mg(!1),ac=Si(null),sc=null,Cs=null,Bf=null;function zf(){Bf=Cs=sc=null}function Uf(c){var y=ac.current;nn(ac),c._currentValue=y}function Vf(c,y,C){for(;c!==null;){var P=c.alternate;if((c.childLanes&y)!==y?(c.childLanes|=y,P!==null&&(P.childLanes|=y)):P!==null&&(P.childLanes&y)!==y&&(P.childLanes|=y),c===C)break;c=c.return}}function As(c,y){sc=c,Bf=Cs=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&y)!==0&&(tr=!0),c.firstContext=null)}function Or(c){var y=c._currentValue;if(Bf!==c)if(c={context:c,memoizedValue:y,next:null},Cs===null){if(sc===null)throw Error(r(308));Cs=c,sc.dependencies={lanes:0,firstContext:c}}else Cs=Cs.next=c;return y}var ba=null;function Hf(c){ba===null?ba=[c]:ba.push(c)}function jg(c,y,C,P){var j=y.interleaved;return j===null?(C.next=C,Hf(y)):(C.next=j.next,j.next=C),y.interleaved=C,$o(c,P)}function $o(c,y){c.lanes|=y;var C=c.alternate;for(C!==null&&(C.lanes|=y),C=c,c=c.return;c!==null;)c.childLanes|=y,C=c.alternate,C!==null&&(C.childLanes|=y),C=c,c=c.return;return C.tag===3?C.stateNode:null}var Ai=!1;function $f(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bg(c,y){c=c.updateQueue,y.updateQueue===c&&(y.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Wo(c,y){return{eventTime:c,lane:y,tag:0,payload:null,callback:null,next:null}}function Di(c,y,C){var P=c.updateQueue;if(P===null)return null;if(P=P.shared,(Ut&2)!==0){var j=P.pending;return j===null?y.next=y:(y.next=j.next,j.next=y),P.pending=y,$o(c,C)}return j=P.interleaved,j===null?(y.next=y,Hf(P)):(y.next=j.next,j.next=y),P.interleaved=y,$o(c,C)}function uc(c,y,C){if(y=y.updateQueue,y!==null&&(y=y.shared,(C&4194240)!==0)){var P=y.lanes;P&=c.pendingLanes,C|=P,y.lanes=C,ns(c,C)}}function zg(c,y){var C=c.updateQueue,P=c.alternate;if(P!==null&&(P=P.updateQueue,C===P)){var j=null,W=null;if(C=C.firstBaseUpdate,C!==null){do{var oe={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};W===null?j=W=oe:W=W.next=oe,C=C.next}while(C!==null);W===null?j=W=y:W=W.next=y}else j=W=y;C={baseState:P.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:P.shared,effects:P.effects},c.updateQueue=C;return}c=C.lastBaseUpdate,c===null?C.firstBaseUpdate=y:c.next=y,C.lastBaseUpdate=y}function lc(c,y,C,P){var j=c.updateQueue;Ai=!1;var W=j.firstBaseUpdate,oe=j.lastBaseUpdate,de=j.shared.pending;if(de!==null){j.shared.pending=null;var _e=de,Re=_e.next;_e.next=null,oe===null?W=Re:oe.next=Re,oe=_e;var qe=c.alternate;qe!==null&&(qe=qe.updateQueue,de=qe.lastBaseUpdate,de!==oe&&(de===null?qe.firstBaseUpdate=Re:de.next=Re,qe.lastBaseUpdate=_e))}if(W!==null){var Ke=j.baseState;oe=0,qe=Re=_e=null,de=W;do{var Ge=de.lane,ut=de.eventTime;if((P&Ge)===Ge){qe!==null&&(qe=qe.next={eventTime:ut,lane:0,tag:de.tag,payload:de.payload,callback:de.callback,next:null});e:{var ft=c,dt=de;switch(Ge=y,ut=C,dt.tag){case 1:if(ft=dt.payload,typeof ft=="function"){Ke=ft.call(ut,Ke,Ge);break e}Ke=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=dt.payload,Ge=typeof ft=="function"?ft.call(ut,Ke,Ge):ft,Ge==null)break e;Ke=G({},Ke,Ge);break e;case 2:Ai=!0}}de.callback!==null&&de.lane!==0&&(c.flags|=64,Ge=j.effects,Ge===null?j.effects=[de]:Ge.push(de))}else ut={eventTime:ut,lane:Ge,tag:de.tag,payload:de.payload,callback:de.callback,next:null},qe===null?(Re=qe=ut,_e=Ke):qe=qe.next=ut,oe|=Ge;if(de=de.next,de===null){if(de=j.shared.pending,de===null)break;Ge=de,de=Ge.next,Ge.next=null,j.lastBaseUpdate=Ge,j.shared.pending=null}}while(!0);if(qe===null&&(_e=Ke),j.baseState=_e,j.firstBaseUpdate=Re,j.lastBaseUpdate=qe,y=j.shared.interleaved,y!==null){j=y;do oe|=j.lane,j=j.next;while(j!==y)}else W===null&&(j.shared.lanes=0);Ca|=oe,c.lanes=oe,c.memoizedState=Ke}}function Ug(c,y,C){if(c=y.effects,y.effects=null,c!==null)for(y=0;yC?C:4,c(!0);var P=Kf.transition;Kf.transition={};try{c(!1),y()}finally{$t=C,Kf.transition=P}}function ay(){return kr().memoizedState}function SS(c,y,C){var P=Oi(c);if(C={lane:P,action:C,hasEagerState:!1,eagerState:null,next:null},sy(c))uy(y,C);else if(C=jg(c,y,C,P),C!==null){var j=Xn();Yr(C,c,P,j),ly(C,y,P)}}function ES(c,y,C){var P=Oi(c),j={lane:P,action:C,hasEagerState:!1,eagerState:null,next:null};if(sy(c))uy(y,j);else{var W=c.alternate;if(c.lanes===0&&(W===null||W.lanes===0)&&(W=y.lastRenderedReducer,W!==null))try{var oe=y.lastRenderedState,de=W(oe,C);if(j.hasEagerState=!0,j.eagerState=de,me(de,oe)){var _e=y.interleaved;_e===null?(j.next=j,Hf(y)):(j.next=_e.next,_e.next=j),y.interleaved=j;return}}catch{}finally{}C=jg(c,y,j,P),C!==null&&(j=Xn(),Yr(C,c,P,j),ly(C,y,P))}}function sy(c){var y=c.alternate;return c===sn||y!==null&&y===sn}function uy(c,y){xu=fc=!0;var C=c.pending;C===null?y.next=y:(y.next=C.next,C.next=y),c.pending=y}function ly(c,y,C){if((C&4194240)!==0){var P=y.lanes;P&=c.pendingLanes,C|=P,y.lanes=C,ns(c,C)}}var mc={readContext:Or,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},CS={readContext:Or,useCallback:function(c,y){return bo().memoizedState=[c,y===void 0?null:y],c},useContext:Or,useEffect:Qg,useImperativeHandle:function(c,y,C){return C=C!=null?C.concat([c]):null,dc(4194308,4,ty.bind(null,y,c),C)},useLayoutEffect:function(c,y){return dc(4194308,4,c,y)},useInsertionEffect:function(c,y){return dc(4,2,c,y)},useMemo:function(c,y){var C=bo();return y=y===void 0?null:y,c=c(),C.memoizedState=[c,y],c},useReducer:function(c,y,C){var P=bo();return y=C!==void 0?C(y):y,P.memoizedState=P.baseState=y,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:y},P.queue=c,c=c.dispatch=SS.bind(null,sn,c),[P.memoizedState,c]},useRef:function(c){var y=bo();return c={current:c},y.memoizedState=c},useState:Yg,useDebugValue:nd,useDeferredValue:function(c){return bo().memoizedState=c},useTransition:function(){var c=Yg(!1),y=c[0];return c=bS.bind(null,c[1]),bo().memoizedState=c,[y,c]},useMutableSource:function(){},useSyncExternalStore:function(c,y,C){var P=sn,j=bo();if(on){if(C===void 0)throw Error(r(407));C=C()}else{if(C=y(),En===null)throw Error(r(349));(Ea&30)!==0||Wg(P,y,C)}j.memoizedState=C;var W={value:C,getSnapshot:y};return j.queue=W,Qg(qg.bind(null,P,W,c),[c]),P.flags|=2048,Su(9,Gg.bind(null,P,W,C,y),void 0,null),C},useId:function(){var c=bo(),y=En.identifierPrefix;if(on){var C=Ho,P=Vo;C=(P&~(1<<32-On(P)-1)).toString(32)+C,y=":"+y+"R"+C,C=wu++,0<\/script>",c=c.removeChild(c.firstChild)):typeof P.is=="string"?c=oe.createElement(C,{is:P.is}):(c=oe.createElement(C),C==="select"&&(oe=c,P.multiple?oe.multiple=!0:P.size&&(oe.size=P.size))):c=oe.createElementNS(c,C),c[xo]=y,c[pu]=P,Ny(c,y,!1,!1),y.stateNode=c;e:{switch(oe=lt(C,P),C){case"dialog":tn("cancel",c),tn("close",c),j=P;break;case"iframe":case"object":case"embed":tn("load",c),j=P;break;case"video":case"audio":for(j=0;jOs&&(y.flags|=128,P=!0,Eu(W,!1),y.lanes=4194304)}else{if(!P)if(c=cc(oe),c!==null){if(y.flags|=128,P=!0,C=c.updateQueue,C!==null&&(y.updateQueue=C,y.flags|=4),Eu(W,!0),W.tail===null&&W.tailMode==="hidden"&&!oe.alternate&&!on)return jn(y),null}else 2*Qt()-W.renderingStartTime>Os&&C!==1073741824&&(y.flags|=128,P=!0,Eu(W,!1),y.lanes=4194304);W.isBackwards?(oe.sibling=y.child,y.child=oe):(C=W.last,C!==null?C.sibling=oe:y.child=oe,W.last=oe)}return W.tail!==null?(y=W.tail,W.rendering=y,W.tail=y.sibling,W.renderingStartTime=Qt(),y.sibling=null,C=an.current,Zt(an,P?C&1|2:C&1),y):(jn(y),null);case 22:case 23:return Ad(),P=y.memoizedState!==null,c!==null&&c.memoizedState!==null!==P&&(y.flags|=8192),P&&(y.mode&1)!==0?(pr&1073741824)!==0&&(jn(y),y.subtreeFlags&6&&(y.flags|=8192)):jn(y),null;case 24:return null;case 25:return null}throw Error(r(156,y.tag))}function IS(c,y){switch(Rf(y),y.tag){case 1:return er(y.type)&&Zl(),c=y.flags,c&65536?(y.flags=c&-65537|128,y):null;case 3:return Ds(),nn(Zn),nn(Mn),Xf(),c=y.flags,(c&65536)!==0&&(c&128)===0?(y.flags=c&-65537|128,y):null;case 5:return Gf(y),null;case 13:if(nn(an),c=y.memoizedState,c!==null&&c.dehydrated!==null){if(y.alternate===null)throw Error(r(340));Ss()}return c=y.flags,c&65536?(y.flags=c&-65537|128,y):null;case 19:return nn(an),null;case 4:return Ds(),null;case 10:return Uf(y.type._context),null;case 22:case 23:return Ad(),null;case 24:return null;default:return null}}var _c=!1,Bn=!1,FS=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Ns(c,y){var C=c.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(P){hn(c,y,P)}else C.current=null}function pd(c,y,C){try{C()}catch(P){hn(c,y,P)}}var ky=!1;function RS(c,y){if(Af=yo,c=Ae(),Ie(c)){if("selectionStart"in c)var C={start:c.selectionStart,end:c.selectionEnd};else e:{C=(C=c.ownerDocument)&&C.defaultView||window;var P=C.getSelection&&C.getSelection();if(P&&P.rangeCount!==0){C=P.anchorNode;var j=P.anchorOffset,W=P.focusNode;P=P.focusOffset;try{C.nodeType,W.nodeType}catch{C=null;break e}var oe=0,de=-1,_e=-1,Re=0,qe=0,Ke=c,Ge=null;t:for(;;){for(var ut;Ke!==C||j!==0&&Ke.nodeType!==3||(de=oe+j),Ke!==W||P!==0&&Ke.nodeType!==3||(_e=oe+P),Ke.nodeType===3&&(oe+=Ke.nodeValue.length),(ut=Ke.firstChild)!==null;)Ge=Ke,Ke=ut;for(;;){if(Ke===c)break t;if(Ge===C&&++Re===j&&(de=oe),Ge===W&&++qe===P&&(_e=oe),(ut=Ke.nextSibling)!==null)break;Ke=Ge,Ge=Ke.parentNode}Ke=ut}C=de===-1||_e===-1?null:{start:de,end:_e}}else C=null}C=C||{start:0,end:0}}else C=null;for(Df={focusedElem:c,selectionRange:C},yo=!1,ht=y;ht!==null;)if(y=ht,c=y.child,(y.subtreeFlags&1028)!==0&&c!==null)c.return=y,ht=c;else for(;ht!==null;){y=ht;try{var ft=y.alternate;if((y.flags&1024)!==0)switch(y.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var dt=ft.memoizedProps,pn=ft.memoizedState,ke=y.stateNode,Ee=ke.getSnapshotBeforeUpdate(y.elementType===y.type?dt:qr(y.type,dt),pn);ke.__reactInternalSnapshotBeforeUpdate=Ee}break;case 3:var Fe=y.stateNode.containerInfo;Fe.nodeType===1?Fe.textContent="":Fe.nodeType===9&&Fe.documentElement&&Fe.removeChild(Fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(nt){hn(y,y.return,nt)}if(c=y.sibling,c!==null){c.return=y.return,ht=c;break}ht=y.return}return ft=ky,ky=!1,ft}function Cu(c,y,C){var P=y.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var j=P=P.next;do{if((j.tag&c)===c){var W=j.destroy;j.destroy=void 0,W!==void 0&&pd(y,C,W)}j=j.next}while(j!==P)}}function xc(c,y){if(y=y.updateQueue,y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&c)===c){var P=C.create;C.destroy=P()}C=C.next}while(C!==y)}}function md(c){var y=c.ref;if(y!==null){var C=c.stateNode;switch(c.tag){case 5:c=C;break;default:c=C}typeof y=="function"?y(c):y.current=c}}function Iy(c){var y=c.alternate;y!==null&&(c.alternate=null,Iy(y)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(y=c.stateNode,y!==null&&(delete y[xo],delete y[pu],delete y[Of],delete y[yS],delete y[vS])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Fy(c){return c.tag===5||c.tag===3||c.tag===4}function Ry(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Fy(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function gd(c,y,C){var P=c.tag;if(P===5||P===6)c=c.stateNode,y?C.nodeType===8?C.parentNode.insertBefore(c,y):C.insertBefore(c,y):(C.nodeType===8?(y=C.parentNode,y.insertBefore(c,C)):(y=C,y.appendChild(c)),C=C._reactRootContainer,C!=null||y.onclick!==null||(y.onclick=Jl));else if(P!==4&&(c=c.child,c!==null))for(gd(c,y,C),c=c.sibling;c!==null;)gd(c,y,C),c=c.sibling}function yd(c,y,C){var P=c.tag;if(P===5||P===6)c=c.stateNode,y?C.insertBefore(c,y):C.appendChild(c);else if(P!==4&&(c=c.child,c!==null))for(yd(c,y,C),c=c.sibling;c!==null;)yd(c,y,C),c=c.sibling}var Dn=null,Xr=!1;function Ti(c,y,C){for(C=C.child;C!==null;)My(c,y,C),C=C.sibling}function My(c,y,C){if(Wn&&typeof Wn.onCommitFiberUnmount=="function")try{Wn.onCommitFiberUnmount(zr,C)}catch{}switch(C.tag){case 5:Bn||Ns(C,y);case 6:var P=Dn,j=Xr;Dn=null,Ti(c,y,C),Dn=P,Xr=j,Dn!==null&&(Xr?(c=Dn,C=C.stateNode,c.nodeType===8?c.parentNode.removeChild(C):c.removeChild(C)):Dn.removeChild(C.stateNode));break;case 18:Dn!==null&&(Xr?(c=Dn,C=C.stateNode,c.nodeType===8?Pf(c.parentNode,C):c.nodeType===1&&Pf(c,C),mi(c)):Pf(Dn,C.stateNode));break;case 4:P=Dn,j=Xr,Dn=C.stateNode.containerInfo,Xr=!0,Ti(c,y,C),Dn=P,Xr=j;break;case 0:case 11:case 14:case 15:if(!Bn&&(P=C.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){j=P=P.next;do{var W=j,oe=W.destroy;W=W.tag,oe!==void 0&&((W&2)!==0||(W&4)!==0)&&pd(C,y,oe),j=j.next}while(j!==P)}Ti(c,y,C);break;case 1:if(!Bn&&(Ns(C,y),P=C.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=C.memoizedProps,P.state=C.memoizedState,P.componentWillUnmount()}catch(de){hn(C,y,de)}Ti(c,y,C);break;case 21:Ti(c,y,C);break;case 22:C.mode&1?(Bn=(P=Bn)||C.memoizedState!==null,Ti(c,y,C),Bn=P):Ti(c,y,C);break;default:Ti(c,y,C)}}function Ly(c){var y=c.updateQueue;if(y!==null){c.updateQueue=null;var C=c.stateNode;C===null&&(C=c.stateNode=new FS),y.forEach(function(P){var j=$S.bind(null,c,P);C.has(P)||(C.add(P),P.then(j,j))})}}function Kr(c,y){var C=y.deletions;if(C!==null)for(var P=0;Pj&&(j=oe),P&=~W}if(P=j,P=Qt()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*LS(P/1960))-P,10c?16:c,Pi===null)var P=!1;else{if(c=Pi,Pi=null,Cc=0,(Ut&6)!==0)throw Error(r(331));var j=Ut;for(Ut|=4,ht=c.current;ht!==null;){var W=ht,oe=W.child;if((ht.flags&16)!==0){var de=W.deletions;if(de!==null){for(var _e=0;_eQt()-xd?Da(c,0):_d|=C),rr(c,y)}function Yy(c,y){y===0&&((c.mode&1)===0?y=1:(y=Ar,Ar<<=1,(Ar&130023424)===0&&(Ar=4194304)));var C=Xn();c=$o(c,y),c!==null&&(Gn(c,y,C),rr(c,C))}function HS(c){var y=c.memoizedState,C=0;y!==null&&(C=y.retryLane),Yy(c,C)}function $S(c,y){var C=0;switch(c.tag){case 13:var P=c.stateNode,j=c.memoizedState;j!==null&&(C=j.retryLane);break;case 19:P=c.stateNode;break;default:throw Error(r(314))}P!==null&&P.delete(y),Yy(c,C)}var Jy;Jy=function(c,y,C){if(c!==null)if(c.memoizedProps!==y.pendingProps||Zn.current)tr=!0;else{if((c.lanes&C)===0&&(y.flags&128)===0)return tr=!1,OS(c,y,C);tr=(c.flags&131072)!==0}else tr=!1,on&&(y.flags&1048576)!==0&&Pg(y,rc,y.index);switch(y.lanes=0,y.tag){case 2:var P=y.type;vc(c,y),c=y.pendingProps;var j=xs(y,Mn.current);As(y,C),j=Jf(null,y,P,c,j,C);var W=Qf();return y.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(y.tag=1,y.memoizedState=null,y.updateQueue=null,er(P)?(W=!0,ec(y)):W=!1,y.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,$f(y),j.updater=gc,y.stateNode=j,j._reactInternals=y,od(y,P,c,C),y=ud(null,y,P,!0,W,C)):(y.tag=0,on&&W&&Ff(y),qn(null,y,j,C),y=y.child),y;case 16:P=y.elementType;e:{switch(vc(c,y),c=y.pendingProps,j=P._init,P=j(P._payload),y.type=P,j=y.tag=GS(P),c=qr(P,c),j){case 0:y=sd(null,y,P,c,C);break e;case 1:y=Sy(null,y,P,c,C);break e;case 11:y=vy(null,y,P,c,C);break e;case 14:y=_y(null,y,P,qr(P.type,c),C);break e}throw Error(r(306,P,""))}return y;case 0:return P=y.type,j=y.pendingProps,j=y.elementType===P?j:qr(P,j),sd(c,y,P,j,C);case 1:return P=y.type,j=y.pendingProps,j=y.elementType===P?j:qr(P,j),Sy(c,y,P,j,C);case 3:e:{if(Ey(y),c===null)throw Error(r(387));P=y.pendingProps,W=y.memoizedState,j=W.element,Bg(c,y),lc(y,P,null,C);var oe=y.memoizedState;if(P=oe.element,W.isDehydrated)if(W={element:P,isDehydrated:!1,cache:oe.cache,pendingSuspenseBoundaries:oe.pendingSuspenseBoundaries,transitions:oe.transitions},y.updateQueue.baseState=W,y.memoizedState=W,y.flags&256){j=Ts(Error(r(423)),y),y=Cy(c,y,P,C,j);break e}else if(P!==j){j=Ts(Error(r(424)),y),y=Cy(c,y,P,C,j);break e}else for(dr=bi(y.stateNode.containerInfo.firstChild),fr=y,on=!0,Gr=null,C=Lg(y,null,P,C),y.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Ss(),P===j){y=Go(c,y,C);break e}qn(c,y,P,C)}y=y.child}return y;case 5:return Vg(y),c===null&&Lf(y),P=y.type,j=y.pendingProps,W=c!==null?c.memoizedProps:null,oe=j.children,Tf(P,j)?oe=null:W!==null&&Tf(P,W)&&(y.flags|=32),by(c,y),qn(c,y,oe,C),y.child;case 6:return c===null&&Lf(y),null;case 13:return Ay(c,y,C);case 4:return Wf(y,y.stateNode.containerInfo),P=y.pendingProps,c===null?y.child=Es(y,null,P,C):qn(c,y,P,C),y.child;case 11:return P=y.type,j=y.pendingProps,j=y.elementType===P?j:qr(P,j),vy(c,y,P,j,C);case 7:return qn(c,y,y.pendingProps,C),y.child;case 8:return qn(c,y,y.pendingProps.children,C),y.child;case 12:return qn(c,y,y.pendingProps.children,C),y.child;case 10:e:{if(P=y.type._context,j=y.pendingProps,W=y.memoizedProps,oe=j.value,Zt(ac,P._currentValue),P._currentValue=oe,W!==null)if(me(W.value,oe)){if(W.children===j.children&&!Zn.current){y=Go(c,y,C);break e}}else for(W=y.child,W!==null&&(W.return=y);W!==null;){var de=W.dependencies;if(de!==null){oe=W.child;for(var _e=de.firstContext;_e!==null;){if(_e.context===P){if(W.tag===1){_e=Wo(-1,C&-C),_e.tag=2;var Re=W.updateQueue;if(Re!==null){Re=Re.shared;var qe=Re.pending;qe===null?_e.next=_e:(_e.next=qe.next,qe.next=_e),Re.pending=_e}}W.lanes|=C,_e=W.alternate,_e!==null&&(_e.lanes|=C),Vf(W.return,C,y),de.lanes|=C;break}_e=_e.next}}else if(W.tag===10)oe=W.type===y.type?null:W.child;else if(W.tag===18){if(oe=W.return,oe===null)throw Error(r(341));oe.lanes|=C,de=oe.alternate,de!==null&&(de.lanes|=C),Vf(oe,C,y),oe=W.sibling}else oe=W.child;if(oe!==null)oe.return=W;else for(oe=W;oe!==null;){if(oe===y){oe=null;break}if(W=oe.sibling,W!==null){W.return=oe.return,oe=W;break}oe=oe.return}W=oe}qn(c,y,j.children,C),y=y.child}return y;case 9:return j=y.type,P=y.pendingProps.children,As(y,C),j=Or(j),P=P(j),y.flags|=1,qn(c,y,P,C),y.child;case 14:return P=y.type,j=qr(P,y.pendingProps),j=qr(P.type,j),_y(c,y,P,j,C);case 15:return xy(c,y,y.type,y.pendingProps,C);case 17:return P=y.type,j=y.pendingProps,j=y.elementType===P?j:qr(P,j),vc(c,y),y.tag=1,er(P)?(c=!0,ec(y)):c=!1,As(y,C),hy(y,P,j),od(y,P,j,C),ud(null,y,P,!0,c,C);case 19:return Ty(c,y,C);case 22:return wy(c,y,C)}throw Error(r(156,y.tag))};function Qy(c,y){return hi(c,y)}function WS(c,y,C,P){this.tag=c,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=y,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(c,y,C,P){return new WS(c,y,C,P)}function Td(c){return c=c.prototype,!(!c||!c.isReactComponent)}function GS(c){if(typeof c=="function")return Td(c)?1:0;if(c!=null){if(c=c.$$typeof,c===M)return 11;if(c===L)return 14}return 2}function Ii(c,y){var C=c.alternate;return C===null?(C=Fr(c.tag,y,c.key,c.mode),C.elementType=c.elementType,C.type=c.type,C.stateNode=c.stateNode,C.alternate=c,c.alternate=C):(C.pendingProps=y,C.type=c.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=c.flags&14680064,C.childLanes=c.childLanes,C.lanes=c.lanes,C.child=c.child,C.memoizedProps=c.memoizedProps,C.memoizedState=c.memoizedState,C.updateQueue=c.updateQueue,y=c.dependencies,C.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext},C.sibling=c.sibling,C.index=c.index,C.ref=c.ref,C}function Nc(c,y,C,P,j,W){var oe=2;if(P=c,typeof c=="function")Td(c)&&(oe=1);else if(typeof c=="string")oe=5;else e:switch(c){case A:return Na(C.children,j,W,y);case T:oe=8,j|=8;break;case D:return c=Fr(12,C,y,j|2),c.elementType=D,c.lanes=W,c;case B:return c=Fr(13,C,y,j),c.elementType=B,c.lanes=W,c;case R:return c=Fr(19,C,y,j),c.elementType=R,c.lanes=W,c;case K:return Pc(C,j,W,y);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case O:oe=10;break e;case I:oe=9;break e;case M:oe=11;break e;case L:oe=14;break e;case z:oe=16,P=null;break e}throw Error(r(130,c==null?c:typeof c,""))}return y=Fr(oe,C,y,j),y.elementType=c,y.type=P,y.lanes=W,y}function Na(c,y,C,P){return c=Fr(7,c,P,y),c.lanes=C,c}function Pc(c,y,C,P){return c=Fr(22,c,P,y),c.elementType=K,c.lanes=C,c.stateNode={isHidden:!1},c}function Nd(c,y,C){return c=Fr(6,c,null,y),c.lanes=C,c}function Pd(c,y,C){return y=Fr(4,c.children!==null?c.children:[],c.key,y),y.lanes=C,y.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},y}function qS(c,y,C,P,j){this.tag=y,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ts(0),this.expirationTimes=ts(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ts(0),this.identifierPrefix=P,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Od(c,y,C,P,j,W,oe,de,_e){return c=new qS(c,y,C,de,_e),y===1?(y=1,W===!0&&(y|=8)):y=0,W=Fr(3,null,null,y),c.current=W,W.stateNode=c,W.memoizedState={element:P,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},$f(W),c}function XS(c,y,C){var P=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),Ld.exports=s1(),Ld.exports}var gv;function u1(){if(gv)return Lc;gv=1;var e=M_();return Lc.createRoot=e.createRoot,Lc.hydrateRoot=e.hydrateRoot,Lc}var l1=u1();const yv=e=>{let o;const r=new Set,t=(s,d)=>{const a=typeof s=="function"?s(o):s;if(!Object.is(a,o)){const l=o;o=d??(typeof a!="object"||a===null)?a:Object.assign({},o,a),r.forEach(p=>p(o,l))}},n=()=>o,u={setState:t,getState:n,getInitialState:()=>h,subscribe:s=>(r.add(s),()=>r.delete(s))},h=o=e(t,n,u);return u},c1=e=>e?yv(e):yv,h1=e=>e;function f1(e,o=h1){const r=Nn.useSyncExternalStore(e.subscribe,()=>o(e.getState()),()=>o(e.getInitialState()));return Nn.useDebugValue(r),r}const d1=e=>{const o=c1(e),r=t=>f1(o,t);return Object.assign(r,o),r},p1=e=>d1;function yn(e){if(typeof e=="string"||typeof e=="number")return""+e;let o="";if(Array.isArray(e))for(let r=0,t;r{}};function jh(){for(var e=0,o=arguments.length,r={},t;e=0&&(t=r.slice(n+1),r=r.slice(0,n)),r&&!o.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:t}})}ah.prototype=jh.prototype={constructor:ah,on:function(e,o){var r=this._,t=g1(e+"",r),n,i=-1,f=t.length;if(arguments.length<2){for(;++i0)for(var r=new Array(n),t=0,n,i;t=0&&(o=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),_v.hasOwnProperty(o)?{space:_v[o],local:e}:e}function v1(e){return function(){var o=this.ownerDocument,r=this.namespaceURI;return r===Dp&&o.documentElement.namespaceURI===Dp?o.createElement(e):o.createElementNS(r,e)}}function _1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function L_(e){var o=Bh(e);return(o.local?_1:v1)(o)}function x1(){}function mm(e){return e==null?x1:function(){return this.querySelector(e)}}function w1(e){typeof e!="function"&&(e=mm(e));for(var o=this._groups,r=o.length,t=new Array(r),n=0;n=g&&(g=m+1);!(S=w[g])&&++g=0;)(f=t[n])&&(i&&f.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(f,i),i=f);return this}function G1(e){e||(e=q1);function o(a,l){return a&&l?e(a.__data__,l.__data__):!a-!l}for(var r=this._groups,t=r.length,n=new Array(t),i=0;io?1:e>=o?0:NaN}function X1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function K1(){return Array.from(this)}function Y1(){for(var e=this._groups,o=0,r=e.length;o1?this.each((o==null?sE:typeof o=="function"?lE:uE)(e,o,r??"")):Us(this.node(),e)}function Us(e,o){return e.style.getPropertyValue(o)||V_(e).getComputedStyle(e,null).getPropertyValue(o)}function hE(e){return function(){delete this[e]}}function fE(e,o){return function(){this[e]=o}}function dE(e,o){return function(){var r=o.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function pE(e,o){return arguments.length>1?this.each((o==null?hE:typeof o=="function"?dE:fE)(e,o)):this.node()[e]}function H_(e){return e.trim().split(/^|\s+/)}function gm(e){return e.classList||new $_(e)}function $_(e){this._node=e,this._names=H_(e.getAttribute("class")||"")}$_.prototype={add:function(e){var o=this._names.indexOf(e);o<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var o=this._names.indexOf(e);o>=0&&(this._names.splice(o,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function W_(e,o){for(var r=gm(e),t=-1,n=o.length;++t=0&&(r=o.slice(t+1),o=o.slice(0,t)),{type:o,name:r}})}function VE(e){return function(){var o=this.__on;if(o){for(var r=0,t=-1,n=o.length,i;r()=>e;function Tp(e,{sourceEvent:o,subject:r,target:t,identifier:n,active:i,x:f,y:u,dx:h,dy:s,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:o,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},identifier:{value:n,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:d}})}Tp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function QE(e){return!e.ctrlKey&&!e.button}function ZE(){return this.parentNode}function eC(e,o){return o??{x:e.x,y:e.y}}function tC(){return navigator.maxTouchPoints||"ontouchstart"in this}function J_(){var e=QE,o=ZE,r=eC,t=tC,n={},i=jh("start","drag","end"),f=0,u,h,s,d,a=0;function l(b){b.on("mousedown.drag",p).filter(t).on("touchstart.drag",w).on("touchmove.drag",x,JE).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,S){if(!(d||!e.call(this,b,S))){var E=g(this,o.call(this,b,S),b,S,"mouse");E&&(gr(b.view).on("mousemove.drag",v,Qu).on("mouseup.drag",_,Qu),K_(b.view),zd(b),s=!1,u=b.clientX,h=b.clientY,E("start",b))}}function v(b){if(js(b),!s){var S=b.clientX-u,E=b.clientY-h;s=S*S+E*E>a}n.mouse("drag",b)}function _(b){gr(b.view).on("mousemove.drag mouseup.drag",null),Y_(b.view,s),js(b),n.mouse("end",b)}function w(b,S){if(e.call(this,b,S)){var E=b.changedTouches,A=o.call(this,b,S),T=E.length,D,O;for(D=0;D>8&15|o>>4&240,o>>4&15|o&240,(o&15)<<4|o&15,1):r===8?Bc(o>>24&255,o>>16&255,o>>8&255,(o&255)/255):r===4?Bc(o>>12&15|o>>8&240,o>>8&15|o>>4&240,o>>4&15|o&240,((o&15)<<4|o&15)/255):null):(o=rC.exec(e))?new ir(o[1],o[2],o[3],1):(o=oC.exec(e))?new ir(o[1]*255/100,o[2]*255/100,o[3]*255/100,1):(o=iC.exec(e))?Bc(o[1],o[2],o[3],o[4]):(o=aC.exec(e))?Bc(o[1]*255/100,o[2]*255/100,o[3]*255/100,o[4]):(o=sC.exec(e))?Av(o[1],o[2]/100,o[3]/100,1):(o=uC.exec(e))?Av(o[1],o[2]/100,o[3]/100,o[4]):xv.hasOwnProperty(e)?Sv(xv[e]):e==="transparent"?new ir(NaN,NaN,NaN,0):null}function Sv(e){return new ir(e>>16&255,e>>8&255,e&255,1)}function Bc(e,o,r,t){return t<=0&&(e=o=r=NaN),new ir(e,o,r,t)}function hC(e){return e instanceof _l||(e=tl(e)),e?(e=e.rgb(),new ir(e.r,e.g,e.b,e.opacity)):new ir}function Np(e,o,r,t){return arguments.length===1?hC(e):new ir(e,o,r,t??1)}function ir(e,o,r,t){this.r=+e,this.g=+o,this.b=+r,this.opacity=+t}ym(ir,Np,Q_(_l,{brighter(e){return e=e==null?xh:Math.pow(xh,e),new ir(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zu:Math.pow(Zu,e),new ir(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ir(Ba(this.r),Ba(this.g),Ba(this.b),wh(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:Ev,formatHex:Ev,formatHex8:fC,formatRgb:Cv,toString:Cv}));function Ev(){return`#${La(this.r)}${La(this.g)}${La(this.b)}`}function fC(){return`#${La(this.r)}${La(this.g)}${La(this.b)}${La((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cv(){const e=wh(this.opacity);return`${e===1?"rgb(":"rgba("}${Ba(this.r)}, ${Ba(this.g)}, ${Ba(this.b)}${e===1?")":`, ${e})`}`}function wh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ba(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function La(e){return e=Ba(e),(e<16?"0":"")+e.toString(16)}function Av(e,o,r,t){return t<=0?e=o=r=NaN:r<=0||r>=1?e=o=NaN:o<=0&&(e=NaN),new eo(e,o,r,t)}function Z_(e){if(e instanceof eo)return new eo(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=tl(e)),!e)return new eo;if(e instanceof eo)return e;e=e.rgb();var o=e.r/255,r=e.g/255,t=e.b/255,n=Math.min(o,r,t),i=Math.max(o,r,t),f=NaN,u=i-n,h=(i+n)/2;return u?(o===i?f=(r-t)/u+(r0&&h<1?0:f,new eo(f,u,h,e.opacity)}function dC(e,o,r,t){return arguments.length===1?Z_(e):new eo(e,o,r,t??1)}function eo(e,o,r,t){this.h=+e,this.s=+o,this.l=+r,this.opacity=+t}ym(eo,dC,Q_(_l,{brighter(e){return e=e==null?xh:Math.pow(xh,e),new eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zu:Math.pow(Zu,e),new eo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,o=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,t=r+(r<.5?r:1-r)*o,n=2*r-t;return new ir(Ud(e>=240?e-240:e+120,n,t),Ud(e,n,t),Ud(e<120?e+240:e-120,n,t),this.opacity)},clamp(){return new eo(Dv(this.h),zc(this.s),zc(this.l),wh(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=wh(this.opacity);return`${e===1?"hsl(":"hsla("}${Dv(this.h)}, ${zc(this.s)*100}%, ${zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dv(e){return e=(e||0)%360,e<0?e+360:e}function zc(e){return Math.max(0,Math.min(1,e||0))}function Ud(e,o,r){return(e<60?o+(r-o)*e/60:e<180?r:e<240?o+(r-o)*(240-e)/60:o)*255}const ex=e=>()=>e;function pC(e,o){return function(r){return e+r*o}}function mC(e,o,r){return e=Math.pow(e,r),o=Math.pow(o,r)-e,r=1/r,function(t){return Math.pow(e+t*o,r)}}function gC(e){return(e=+e)==1?tx:function(o,r){return r-o?mC(o,r,e):ex(isNaN(o)?r:o)}}function tx(e,o){var r=o-e;return r?pC(e,r):ex(isNaN(e)?o:e)}const Tv=function e(o){var r=gC(o);function t(n,i){var f=r((n=Np(n)).r,(i=Np(i)).r),u=r(n.g,i.g),h=r(n.b,i.b),s=tx(n.opacity,i.opacity);return function(d){return n.r=f(d),n.g=u(d),n.b=h(d),n.opacity=s(d),n+""}}return t.gamma=e,t}(1);function ji(e,o){return e=+e,o=+o,function(r){return e*(1-r)+o*r}}var Pp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vd=new RegExp(Pp.source,"g");function yC(e){return function(){return e}}function vC(e){return function(o){return e(o)+""}}function _C(e,o){var r=Pp.lastIndex=Vd.lastIndex=0,t,n,i,f=-1,u=[],h=[];for(e=e+"",o=o+"";(t=Pp.exec(e))&&(n=Vd.exec(o));)(i=n.index)>r&&(i=o.slice(r,i),u[f]?u[f]+=i:u[++f]=i),(t=t[0])===(n=n[0])?u[f]?u[f]+=n:u[++f]=n:(u[++f]=null,h.push({i:f,x:ji(t,n)})),r=Vd.lastIndex;return r180?d+=360:d-s>180&&(s+=360),l.push({i:a.push(n(a)+"rotate(",null,t)-2,x:ji(s,d)})):d&&a.push(n(a)+"rotate("+d+t)}function u(s,d,a,l){s!==d?l.push({i:a.push(n(a)+"skewX(",null,t)-2,x:ji(s,d)}):d&&a.push(n(a)+"skewX("+d+t)}function h(s,d,a,l,p,v){if(s!==a||d!==l){var _=p.push(n(p)+"scale(",null,",",null,")");v.push({i:_-4,x:ji(s,a)},{i:_-2,x:ji(d,l)})}else(a!==1||l!==1)&&p.push(n(p)+"scale("+a+","+l+")")}return function(s,d){var a=[],l=[];return s=e(s),d=e(d),i(s.translateX,s.translateY,d.translateX,d.translateY,a,l),f(s.rotate,d.rotate,a,l),u(s.skewX,d.skewX,a,l),h(s.scaleX,s.scaleY,d.scaleX,d.scaleY,a,l),s=d=null,function(p){for(var v=-1,_=l.length,w;++v<_;)a[(w=l[v]).i]=w.x(p);return a.join("")}}}var bC=rx(xC,"px, ","px)","deg)"),SC=rx(wC,", ",")",")"),EC=1e-12;function Pv(e){return((e=Math.exp(e))+1/e)/2}function CC(e){return((e=Math.exp(e))-1/e)/2}function AC(e){return((e=Math.exp(2*e))-1)/(e+1)}const DC=function e(o,r,t){function n(i,f){var u=i[0],h=i[1],s=i[2],d=f[0],a=f[1],l=f[2],p=d-u,v=a-h,_=p*p+v*v,w,x;if(_=0&&e._call.call(void 0,o),e=e._next;--Vs}function Ov(){Ha=(Sh=nl.now())+zh,Vs=Wu=0;try{NC()}finally{Vs=0,OC(),Ha=0}}function PC(){var e=nl.now(),o=e-Sh;o>ox&&(zh-=o,Sh=e)}function OC(){for(var e,o=bh,r,t=1/0;o;)o._call?(t>o._time&&(t=o._time),e=o,o=o._next):(r=o._next,o._next=null,o=e?e._next=r:bh=r);Gu=e,kp(t)}function kp(e){if(!Vs){Wu&&(Wu=clearTimeout(Wu));var o=e-Ha;o>24?(e<1/0&&(Wu=setTimeout(Ov,e-nl.now()-zh)),ku&&(ku=clearInterval(ku))):(ku||(Sh=nl.now(),ku=setInterval(PC,ox)),Vs=1,ix(Ov))}}function kv(e,o,r){var t=new Eh;return o=o==null?0:+o,t.restart(n=>{t.stop(),e(n+o)},o,r),t}var kC=jh("start","end","cancel","interrupt"),IC=[],sx=0,Iv=1,Ip=2,sh=3,Fv=4,Fp=5,uh=6;function Uh(e,o,r,t,n,i){var f=e.__transition;if(!f)e.__transition={};else if(r in f)return;FC(e,r,{name:o,index:t,group:n,on:kC,tween:IC,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:sx})}function _m(e,o){var r=uo(e,o);if(r.state>sx)throw new Error("too late; already scheduled");return r}function To(e,o){var r=uo(e,o);if(r.state>sh)throw new Error("too late; already running");return r}function uo(e,o){var r=e.__transition;if(!r||!(r=r[o]))throw new Error("transition not found");return r}function FC(e,o,r){var t=e.__transition,n;t[o]=r,r.timer=ax(i,0,r.time);function i(s){r.state=Iv,r.timer.restart(f,r.delay,r.time),r.delay<=s&&f(s-r.delay)}function f(s){var d,a,l,p;if(r.state!==Iv)return h();for(d in t)if(p=t[d],p.name===r.name){if(p.state===sh)return kv(f);p.state===Fv?(p.state=uh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete t[d]):+dIp&&t.state=0&&(o=o.slice(0,r)),!o||o==="start"})}function cA(e,o,r){var t,n,i=lA(o)?_m:To;return function(){var f=i(this,e),u=f.on;u!==t&&(n=(t=u).copy()).on(o,r),f.on=n}}function hA(e,o){var r=this._id;return arguments.length<2?uo(this.node(),r).on.on(e):this.each(cA(r,e,o))}function fA(e){return function(){var o=this.parentNode;for(var r in this.__transition)if(+r!==e)return;o&&o.removeChild(this)}}function dA(){return this.on("end.remove",fA(this._id))}function pA(e){var o=this._name,r=this._id;typeof e!="function"&&(e=mm(e));for(var t=this._groups,n=t.length,i=new Array(n),f=0;f()=>e;function BA(e,{sourceEvent:o,target:r,transform:t,dispatch:n}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:o,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:t,enumerable:!0,configurable:!0},_:{value:n}})}function ei(e,o,r){this.k=e,this.x=o,this.y=r}ei.prototype={constructor:ei,scale:function(e){return e===1?this:new ei(this.k*e,this.x,this.y)},translate:function(e,o){return e===0&o===0?this:new ei(this.k,this.x+this.k*e,this.y+this.k*o)},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 Vh=new ei(1,0,0);hx.prototype=ei.prototype;function hx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vh;return e.__zoom}function Hd(e){e.stopImmediatePropagation()}function Iu(e){e.preventDefault(),e.stopImmediatePropagation()}function zA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function UA(){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 Rv(){return this.__zoom||Vh}function VA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function HA(){return navigator.maxTouchPoints||"ontouchstart"in this}function $A(e,o,r){var t=e.invertX(o[0][0])-r[0][0],n=e.invertX(o[1][0])-r[1][0],i=e.invertY(o[0][1])-r[0][1],f=e.invertY(o[1][1])-r[1][1];return e.translate(n>t?(t+n)/2:Math.min(0,t)||Math.max(0,n),f>i?(i+f)/2:Math.min(0,i)||Math.max(0,f))}function fx(){var e=zA,o=UA,r=$A,t=VA,n=HA,i=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],u=250,h=DC,s=jh("start","zoom","end"),d,a,l,p=500,v=150,_=0,w=10;function x(R){R.property("__zoom",Rv).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",O).filter(n).on("touchstart.zoom",I).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(R,L,z,K){var U=R.selection?R.selection():R;U.property("__zoom",Rv),R!==U?S(R,L,z,K):U.interrupt().each(function(){E(this,arguments).event(K).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},x.scaleBy=function(R,L,z,K){x.scaleTo(R,function(){var U=this.__zoom.k,H=typeof L=="function"?L.apply(this,arguments):L;return U*H},z,K)},x.scaleTo=function(R,L,z,K){x.transform(R,function(){var U=o.apply(this,arguments),H=this.__zoom,G=z==null?b(U):typeof z=="function"?z.apply(this,arguments):z,J=H.invert(G),ne=typeof L=="function"?L.apply(this,arguments):L;return r(g(m(H,ne),G,J),U,f)},z,K)},x.translateBy=function(R,L,z,K){x.transform(R,function(){return r(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof z=="function"?z.apply(this,arguments):z),o.apply(this,arguments),f)},null,K)},x.translateTo=function(R,L,z,K,U){x.transform(R,function(){var H=o.apply(this,arguments),G=this.__zoom,J=K==null?b(H):typeof K=="function"?K.apply(this,arguments):K;return r(Vh.translate(J[0],J[1]).scale(G.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof z=="function"?-z.apply(this,arguments):-z),H,f)},K,U)};function m(R,L){return L=Math.max(i[0],Math.min(i[1],L)),L===R.k?R:new ei(L,R.x,R.y)}function g(R,L,z){var K=L[0]-z[0]*R.k,U=L[1]-z[1]*R.k;return K===R.x&&U===R.y?R:new ei(R.k,K,U)}function b(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function S(R,L,z,K){R.on("start.zoom",function(){E(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(K).end()}).tween("zoom",function(){var U=this,H=arguments,G=E(U,H).event(K),J=o.apply(U,H),ne=z==null?b(J):typeof z=="function"?z.apply(U,H):z,fe=Math.max(J[1][0]-J[0][0],J[1][1]-J[0][1]),ce=U.__zoom,ue=typeof L=="function"?L.apply(U,H):L,ge=h(ce.invert(ne).concat(fe/ce.k),ue.invert(ne).concat(fe/ue.k));return function(xe){if(xe===1)xe=ue;else{var ye=ge(xe),he=fe/ye[2];xe=new ei(he,ne[0]-ye[0]*he,ne[1]-ye[1]*he)}G.zoom(null,xe)}})}function E(R,L,z){return!z&&R.__zooming||new A(R,L)}function A(R,L){this.that=R,this.args=L,this.active=0,this.sourceEvent=null,this.extent=o.apply(R,L),this.taps=0}A.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,L){return this.mouse&&R!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var L=gr(this.that).datum();s.call(R,this.that,new BA(R,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:s}),L)}};function T(R,...L){if(!e.apply(this,arguments))return;var z=E(this,L).event(R),K=this.__zoom,U=Math.max(i[0],Math.min(i[1],K.k*Math.pow(2,t.apply(this,arguments)))),H=Qr(R);if(z.wheel)(z.mouse[0][0]!==H[0]||z.mouse[0][1]!==H[1])&&(z.mouse[1]=K.invert(z.mouse[0]=H)),clearTimeout(z.wheel);else{if(K.k===U)return;z.mouse=[H,K.invert(H)],lh(this),z.start()}Iu(R),z.wheel=setTimeout(G,v),z.zoom("mouse",r(g(m(K,U),z.mouse[0],z.mouse[1]),z.extent,f));function G(){z.wheel=null,z.end()}}function D(R,...L){if(l||!e.apply(this,arguments))return;var z=R.currentTarget,K=E(this,L,!0).event(R),U=gr(R.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",fe,!0),H=Qr(R,z),G=R.clientX,J=R.clientY;K_(R.view),Hd(R),K.mouse=[H,this.__zoom.invert(H)],lh(this),K.start();function ne(ce){if(Iu(ce),!K.moved){var ue=ce.clientX-G,ge=ce.clientY-J;K.moved=ue*ue+ge*ge>_}K.event(ce).zoom("mouse",r(g(K.that.__zoom,K.mouse[0]=Qr(ce,z),K.mouse[1]),K.extent,f))}function fe(ce){U.on("mousemove.zoom mouseup.zoom",null),Y_(ce.view,K.moved),Iu(ce),K.event(ce).end()}}function O(R,...L){if(e.apply(this,arguments)){var z=this.__zoom,K=Qr(R.changedTouches?R.changedTouches[0]:R,this),U=z.invert(K),H=z.k*(R.shiftKey?.5:2),G=r(g(m(z,H),K,U),o.apply(this,L),f);Iu(R),u>0?gr(this).transition().duration(u).call(S,G,K,R):gr(this).call(x.transform,G,K,R)}}function I(R,...L){if(e.apply(this,arguments)){var z=R.touches,K=z.length,U=E(this,L,R.changedTouches.length===K).event(R),H,G,J,ne;for(Hd(R),G=0;G"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:o,sourceHandle:r,targetHandle:t})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:t}", edge id: ${o}.`,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."},rl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],dx=["Enter"," ","Escape"];var Hs;(function(e){e.Strict="strict",e.Loose="loose"})(Hs||(Hs={}));var za;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(za||(za={}));var ol;(function(e){e.Partial="partial",e.Full="full"})(ol||(ol={}));const px={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Zo;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zo||(Zo={}));var Ch;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ch||(Ch={}));var vt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vt||(vt={}));const Mv={[vt.Left]:vt.Right,[vt.Right]:vt.Left,[vt.Top]:vt.Bottom,[vt.Bottom]:vt.Top};function WA(e,o){if(!e&&!o)return!0;if(!e||!o||e.size!==o.size)return!1;if(!e.size&&!o.size)return!0;for(const r of e.keys())if(!o.has(r))return!1;return!0}function Lv(e,o,r){if(!r)return;const t=[];e.forEach((n,i)=>{o!=null&&o.has(i)||t.push(n)}),t.length&&r(t)}function mx(e){return e===null?null:e?"valid":"invalid"}const gx=e=>"id"in e&&"source"in e&&"target"in e,GA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),wm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),qA=(e,o,r)=>{if(!e.id)return[];const t=new Set;return r.forEach(n=>{n.target===e.id&&t.add(n.source)}),o.filter(n=>t.has(n.id))},xl=(e,o=[0,0])=>{const{width:r,height:t}=ui(e),n=e.origin??o,i=r*n[0],f=t*n[1];return{x:e.position.x-i,y:e.position.y-f}},XA=(e,o={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((t,n)=>{const i=typeof n=="string";let f=!o.nodeLookup&&!i?n:void 0;o.nodeLookup&&(f=i?o.nodeLookup.get(n):wm(n)?n:o.nodeLookup.get(n.id));const u=f?Ah(f,o.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hh(t,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $h(r)},wl=(e,o={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(t=>{if(o.filter===void 0||o.filter(t)){const n=Ah(t);r=Hh(r,n)}}),$h(r)},yx=(e,o,[r,t,n]=[0,0,1],i=!1,f=!1)=>{const u={...bl(o,[r,t,n]),width:o.width/n,height:o.height/n},h=[];for(const s of e.values()){const{measured:d,selectable:a=!0,hidden:l=!1}=s;if(f&&!a||l)continue;const p=d.width??s.width??s.initialWidth??null,v=d.height??s.height??s.initialHeight??null,_=il(u,Ws(s)),w=(p??0)*(v??0),x=i&&_>0;(!s.internals.handleBounds||x||_>=w||s.dragging)&&h.push(s)}return h},KA=(e,o)=>{const r=new Set;return e.forEach(t=>{r.add(t.id)}),o.filter(t=>r.has(t.source)||r.has(t.target))};function Rp(e,o){const r=new Map,t=o!=null&&o.nodes?new Set(o.nodes.map(n=>n.id)):null;return e.forEach(n=>{n.measured.width&&n.measured.height&&((o==null?void 0:o.includeHiddenNodes)||!n.hidden)&&(!t||t.has(n.id))&&r.set(n.id,n)}),r}async function Mp({nodes:e,width:o,height:r,panZoom:t,minZoom:n,maxZoom:i},f){if(e.size===0)return Promise.resolve(!1);const u=wl(e),h=bm(u,o,r,(f==null?void 0:f.minZoom)??n,(f==null?void 0:f.maxZoom)??i,(f==null?void 0:f.padding)??.1);return await t.setViewport(h,{duration:f==null?void 0:f.duration}),Promise.resolve(!0)}function vx({nodeId:e,nextPosition:o,nodeLookup:r,nodeOrigin:t=[0,0],nodeExtent:n,onError:i}){const f=r.get(e),u=f.parentId?r.get(f.parentId):void 0,{x:h,y:s}=u?u.internals.positionAbsolute:{x:0,y:0},d=f.origin??t;let a=n;if(f.extent==="parent"&&!f.expandParent)if(!u)i==null||i("005",No.error005());else{const p=u.measured.width,v=u.measured.height;p&&v&&(a=[[h,s],[h+p,s+v]])}else u&&Gs(f.extent)&&(a=[[f.extent[0][0]+h,f.extent[0][1]+s],[f.extent[1][0]+h,f.extent[1][1]+s]]);const l=Gs(a)?$a(o,a,f.measured):o;return{position:{x:l.x-h+f.measured.width*d[0],y:l.y-s+f.measured.height*d[1]},positionAbsolute:l}}async function YA({nodesToRemove:e=[],edgesToRemove:o=[],nodes:r,edges:t,onBeforeDelete:n}){const i=new Set(e.map(l=>l.id)),f=[];for(const l of r){if(l.deletable===!1)continue;const p=i.has(l.id),v=!p&&l.parentId&&f.find(_=>_.id===l.parentId);(p||v)&&f.push(l)}const u=new Set(o.map(l=>l.id)),h=t.filter(l=>l.deletable!==!1),d=KA(f,h);for(const l of h)u.has(l.id)&&!d.find(v=>v.id===l.id)&&d.push(l);if(!n)return{edges:d,nodes:f};const a=await n({nodes:f,edges:d});return typeof a=="boolean"?a?{edges:d,nodes:f}:{edges:[],nodes:[]}:a}const $s=(e,o=0,r=1)=>Math.min(Math.max(e,o),r),$a=(e={x:0,y:0},o,r)=>({x:$s(e.x,o[0][0],o[1][0]-((r==null?void 0:r.width)??0)),y:$s(e.y,o[0][1],o[1][1]-((r==null?void 0:r.height)??0))});function _x(e,o,r){const{width:t,height:n}=ui(r),{x:i,y:f}=r.internals.positionAbsolute;return $a(e,[[i,f],[i+t,f+n]],o)}const jv=(e,o,r)=>er?-$s(Math.abs(e-r),1,o)/o:0,xx=(e,o,r=15,t=40)=>{const n=jv(e.x,t,o.width-t)*r,i=jv(e.y,t,o.height-t)*r;return[n,i]},Hh=(e,o)=>({x:Math.min(e.x,o.x),y:Math.min(e.y,o.y),x2:Math.max(e.x2,o.x2),y2:Math.max(e.y2,o.y2)}),Lp=({x:e,y:o,width:r,height:t})=>({x:e,y:o,x2:e+r,y2:o+t}),$h=({x:e,y:o,x2:r,y2:t})=>({x:e,y:o,width:r-e,height:t-o}),Ws=(e,o=[0,0])=>{var n,i;const{x:r,y:t}=wm(e)?e.internals.positionAbsolute:xl(e,o);return{x:r,y:t,width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Ah=(e,o=[0,0])=>{var n,i;const{x:r,y:t}=wm(e)?e.internals.positionAbsolute:xl(e,o);return{x:r,y:t,x2:r+(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0),y2:t+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},wx=(e,o)=>$h(Hh(Lp(e),Lp(o))),il=(e,o)=>{const r=Math.max(0,Math.min(e.x+e.width,o.x+o.width)-Math.max(e.x,o.x)),t=Math.max(0,Math.min(e.y+e.height,o.y+o.height)-Math.max(e.y,o.y));return Math.ceil(r*t)},Bv=e=>ro(e.width)&&ro(e.height)&&ro(e.x)&&ro(e.y),ro=e=>!isNaN(e)&&isFinite(e),JA=(e,o)=>{},Wh=(e,o=[1,1])=>({x:o[0]*Math.round(e.x/o[0]),y:o[1]*Math.round(e.y/o[1])}),bl=({x:e,y:o},[r,t,n],i=!1,f=[1,1])=>{const u={x:(e-r)/n,y:(o-t)/n};return i?Wh(u,f):u},bx=({x:e,y:o},[r,t,n])=>({x:e*n+r,y:o*n+t}),bm=(e,o,r,t,n,i)=>{const f=o/(e.width*(1+i)),u=r/(e.height*(1+i)),h=Math.min(f,u),s=$s(h,t,n),d=e.x+e.width/2,a=e.y+e.height/2,l=o/2-d*s,p=r/2-a*s;return{x:l,y:p,zoom:s}},Dh=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Gs(e){return e!==void 0&&e!=="parent"}function ui(e){var o,r;return{width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function Sx(e){var o,r;return(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function Ex(e,o={width:0,height:0},r,t,n){const i={...e},f=t.get(r);if(f){const u=f.origin||n;i.x+=f.internals.positionAbsolute.x-(o.width??0)*u[0],i.y+=f.internals.positionAbsolute.y-(o.height??0)*u[1]}return i}function zv(e,o){if(e.size!==o.size)return!1;for(const r of e)if(!o.has(r))return!1;return!0}function Xu(e,{snapGrid:o=[0,0],snapToGrid:r=!1,transform:t,containerBounds:n}){const{x:i,y:f}=ni(e),u=bl({x:i-((n==null?void 0:n.left)??0),y:f-((n==null?void 0:n.top)??0)},t),{x:h,y:s}=r?Wh(u,o):u;return{xSnapped:h,ySnapped:s,...u}}const Gh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Cx=e=>{var o;return((o=e==null?void 0:e.getRootNode)==null?void 0:o.call(e))||(window==null?void 0:window.document)},QA=["INPUT","SELECT","TEXTAREA"];function jp(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target;return(o==null?void 0:o.nodeType)!==1?!1:QA.includes(o.nodeName)||o.hasAttribute("contenteditable")||!!o.closest(".nokey")}const Ax=e=>"clientX"in e,ni=(e,o)=>{var i,f;const r=Ax(e),t=r?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,n=r?e.clientY:(f=e.touches)==null?void 0:f[0].clientY;return{x:t-((o==null?void 0:o.left)??0),y:n-((o==null?void 0:o.top)??0)}},Uv=(e,o,r,t,n)=>{const i=o.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(f=>{const u=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),type:e,nodeId:n,position:f.getAttribute("data-handlepos"),x:(u.left-r.left)/t,y:(u.top-r.top)/t,...Gh(f)}})};function Dx({sourceX:e,sourceY:o,targetX:r,targetY:t,sourceControlX:n,sourceControlY:i,targetControlX:f,targetControlY:u}){const h=e*.125+n*.375+f*.375+r*.125,s=o*.125+i*.375+u*.375+t*.125,d=Math.abs(h-e),a=Math.abs(s-o);return[h,s,d,a]}function Hc(e,o){return e>=0?.5*e:o*25*Math.sqrt(-e)}function Vv({pos:e,x1:o,y1:r,x2:t,y2:n,c:i}){switch(e){case vt.Left:return[o-Hc(o-t,i),r];case vt.Right:return[o+Hc(t-o,i),r];case vt.Top:return[o,r-Hc(r-n,i)];case vt.Bottom:return[o,r+Hc(n-r,i)]}}function Tx({sourceX:e,sourceY:o,sourcePosition:r=vt.Bottom,targetX:t,targetY:n,targetPosition:i=vt.Top,curvature:f=.25}){const[u,h]=Vv({pos:r,x1:e,y1:o,x2:t,y2:n,c:f}),[s,d]=Vv({pos:i,x1:t,y1:n,x2:e,y2:o,c:f}),[a,l,p,v]=Dx({sourceX:e,sourceY:o,targetX:t,targetY:n,sourceControlX:u,sourceControlY:h,targetControlX:s,targetControlY:d});return[`M${e},${o} C${u},${h} ${s},${d} ${t},${n}`,a,l,p,v]}function Nx({sourceX:e,sourceY:o,targetX:r,targetY:t}){const n=Math.abs(r-e)/2,i=r0}const tD=({source:e,sourceHandle:o,target:r,targetHandle:t})=>`xy-edge__${e}${o||""}-${r}${t||""}`,nD=(e,o)=>o.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),Bp=(e,o)=>{if(!e.source||!e.target)return o;let r;return gx(e)?r={...e}:r={...e,id:tD(e)},nD(r,o)?o:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,o.concat(r))};function Px({sourceX:e,sourceY:o,targetX:r,targetY:t}){const[n,i,f,u]=Nx({sourceX:e,sourceY:o,targetX:r,targetY:t});return[`M ${e},${o}L ${r},${t}`,n,i,f,u]}const Hv={[vt.Left]:{x:-1,y:0},[vt.Right]:{x:1,y:0},[vt.Top]:{x:0,y:-1},[vt.Bottom]:{x:0,y:1}},rD=({source:e,sourcePosition:o=vt.Bottom,target:r})=>o===vt.Left||o===vt.Right?e.xMath.sqrt(Math.pow(o.x-e.x,2)+Math.pow(o.y-e.y,2));function oD({source:e,sourcePosition:o=vt.Bottom,target:r,targetPosition:t=vt.Top,center:n,offset:i}){const f=Hv[o],u=Hv[t],h={x:e.x+f.x*i,y:e.y+f.y*i},s={x:r.x+u.x*i,y:r.y+u.y*i},d=rD({source:h,sourcePosition:o,target:s}),a=d.x!==0?"x":"y",l=d[a];let p=[],v,_;const w={x:0,y:0},x={x:0,y:0},[m,g,b,S]=Nx({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[a]*u[a]===-1){v=n.x??m,_=n.y??g;const A=[{x:v,y:h.y},{x:v,y:s.y}],T=[{x:h.x,y:_},{x:s.x,y:_}];f[a]===l?p=a==="x"?A:T:p=a==="x"?T:A}else{const A=[{x:h.x,y:s.y}],T=[{x:s.x,y:h.y}];if(a==="x"?p=f.x===l?T:A:p=f.y===l?A:T,o===t){const B=Math.abs(e[a]-r[a]);if(B<=i){const R=Math.min(i-1,i-B);f[a]===l?w[a]=(h[a]>e[a]?-1:1)*R:x[a]=(s[a]>r[a]?-1:1)*R}}if(o!==t){const B=a==="x"?"y":"x",R=f[a]===u[B],L=h[B]>s[B],z=h[B]=M?(v=(D.x+O.x)/2,_=p[0].y):(v=p[0].x,_=(D.y+O.y)/2)}return[[e,{x:h.x+w.x,y:h.y+w.y},...p,{x:s.x+x.x,y:s.y+x.y},r],v,_,b,S]}function iD(e,o,r,t){const n=Math.min($v(e,o)/2,$v(o,r)/2,t),{x:i,y:f}=o;if(e.x===i&&i===r.x||e.y===f&&f===r.y)return`L${i} ${f}`;if(e.y===f){const s=e.x{let g="";return m>0&&mr.id===o):e[0])||null}function Up(e,o){return e?typeof e=="string"?e:`${o?`${o}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}function sD(e,{id:o,defaultColor:r,defaultMarkerStart:t,defaultMarkerEnd:n}){const i=new Set;return e.reduce((f,u)=>([u.markerStart||t,u.markerEnd||n].forEach(h=>{if(h&&typeof h=="object"){const s=Up(h,o);i.has(s)||(f.push({id:s,color:h.color||r,...h}),i.add(s))}}),f),[]).sort((f,u)=>f.id.localeCompare(u.id))}const Sm={nodeOrigin:[0,0],nodeExtent:rl,elevateNodesOnSelect:!0,defaults:{}},uD={...Sm,checkEquality:!0};function Em(e,o){const r={...e};for(const t in o)o[t]!==void 0&&(r[t]=o[t]);return r}function lD(e,o,r){const t=Em(Sm,r);for(const n of e.values())if(n.parentId)Cm(n,e,o,t);else{const i=xl(n,t.nodeOrigin),f=Gs(n.extent)?n.extent:t.nodeExtent,u=$a(i,f,ui(n));n.internals.positionAbsolute=u}}function Vp(e,o,r,t){var u,h;const n=Em(uD,t),i=new Map(o),f=n!=null&&n.elevateNodesOnSelect?1e3:0;o.clear(),r.clear();for(const s of e){let d=i.get(s.id);if(n.checkEquality&&s===(d==null?void 0:d.internals.userNode))o.set(s.id,d);else{const a=xl(s,n.nodeOrigin),l=Gs(s.extent)?s.extent:n.nodeExtent,p=$a(a,l,ui(s));d={...n.defaults,...s,measured:{width:(u=s.measured)==null?void 0:u.width,height:(h=s.measured)==null?void 0:h.height},internals:{positionAbsolute:p,handleBounds:s.measured?d==null?void 0:d.internals.handleBounds:void 0,z:Ox(s,f),userNode:s}},o.set(s.id,d)}s.parentId&&Cm(d,o,r,t)}}function cD(e,o){if(!e.parentId)return;const r=o.get(e.parentId);r?r.set(e.id,e):o.set(e.parentId,new Map([[e.id,e]]))}function Cm(e,o,r,t){const{elevateNodesOnSelect:n,nodeOrigin:i,nodeExtent:f}=Em(Sm,t),u=e.parentId,h=o.get(u);if(!h){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}cD(e,r);const s=n?1e3:0,{x:d,y:a,z:l}=hD(e,h,i,f,s),{positionAbsolute:p}=e.internals,v=d!==p.x||a!==p.y;(v||l!==e.internals.z)&&o.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:a}:p,z:l}})}function Ox(e,o){return(ro(e.zIndex)?e.zIndex:0)+(e.selected?o:0)}function hD(e,o,r,t,n){const{x:i,y:f}=o.internals.positionAbsolute,u=ui(e),h=xl(e,r),s=Gs(e.extent)?$a(h,e.extent,u):h;let d=$a({x:i+s.x,y:f+s.y},t,u);e.extent==="parent"&&(d=_x(d,u,o));const a=Ox(e,n),l=o.internals.z??0;return{x:d.x,y:d.y,z:l>a?l:a}}function Am(e,o,r,t=[0,0]){var f;const n=[],i=new Map;for(const u of e){const h=o.get(u.parentId);if(!h)continue;const s=((f=i.get(u.parentId))==null?void 0:f.expandedRect)??Ws(h),d=wx(s,u.rect);i.set(u.parentId,{expandedRect:d,parent:h})}return i.size>0&&i.forEach(({expandedRect:u,parent:h},s)=>{var g;const d=h.internals.positionAbsolute,a=ui(h),l=h.origin??t,p=u.x0||v>0||x||m)&&(n.push({id:s,type:"position",position:{x:h.position.x-p+x,y:h.position.y-v+m}}),(g=r.get(s))==null||g.forEach(b=>{e.some(S=>S.id===b.id)||n.push({id:b.id,type:"position",position:{x:b.position.x+p,y:b.position.y+v}})})),(a.width0){const l=Am(a,o,r,n);h.push(...l)}return{changes:h,updatedInternals:u}}async function dD({delta:e,panZoom:o,transform:r,translateExtent:t,width:n,height:i}){if(!o||!e.x&&!e.y)return Promise.resolve(!1);const f=await o.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[n,i]],t),u=!!f&&(f.x!==r[0]||f.y!==r[1]||f.k!==r[2]);return Promise.resolve(u)}function Xv(e,o,r,t,n,i){let f=n;const u=t.get(f)||new Map;t.set(f,u.set(r,o)),f=`${n}-${e}`;const h=t.get(f)||new Map;if(t.set(f,h.set(r,o)),i){f=`${n}-${e}-${i}`;const s=t.get(f)||new Map;t.set(f,s.set(r,o))}}function kx(e,o,r){e.clear(),o.clear();for(const t of r){const{source:n,target:i,sourceHandle:f=null,targetHandle:u=null}=t,h={edgeId:t.id,source:n,target:i,sourceHandle:f,targetHandle:u},s=`${n}-${f}--${i}-${u}`,d=`${i}-${u}--${n}-${f}`;Xv("source",h,d,e,n,f),Xv("target",h,s,e,i,u),o.set(t.id,t)}}function Ix(e,o){if(!e.parentId)return!1;const r=o.get(e.parentId);return r?r.selected?!0:Ix(r,o):!1}function Kv(e,o,r){var n;let t=e;do{if((n=t==null?void 0:t.matches)!=null&&n.call(t,o))return!0;if(t===r)return!1;t=t==null?void 0:t.parentElement}while(t);return!1}function pD(e,o,r,t){const n=new Map;for(const[i,f]of e)if((f.selected||f.id===t)&&(!f.parentId||!Ix(f,e))&&(f.draggable||o&&typeof f.draggable>"u")){const u=e.get(i);u&&n.set(i,{id:i,position:u.position||{x:0,y:0},distance:{x:r.x-u.internals.positionAbsolute.x,y:r.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return n}function $d({nodeId:e,dragItems:o,nodeLookup:r,dragging:t=!0}){var f,u,h;const n=[];for(const[s,d]of o){const a=(f=r.get(s))==null?void 0:f.internals.userNode;a&&n.push({...a,position:d.position,dragging:t})}if(!e)return[n[0],n];const i=(u=r.get(e))==null?void 0:u.internals.userNode;return[i?{...i,position:((h=o.get(e))==null?void 0:h.position)||i.position,dragging:t}:n[0],n]}function mD({onNodeMouseDown:e,getStoreItems:o,onDragStart:r,onDrag:t,onDragStop:n}){let i={x:null,y:null},f=0,u=new Map,h=!1,s={x:0,y:0},d=null,a=!1,l=null,p=!1;function v({noDragClassName:w,handleSelector:x,domNode:m,isSelectable:g,nodeId:b,nodeClickDistance:S=0}){l=gr(m);function E({x:O,y:I},M){const{nodeLookup:B,nodeExtent:R,snapGrid:L,snapToGrid:z,nodeOrigin:K,onNodeDrag:U,onSelectionDrag:H,onError:G,updateNodePositions:J}=o();i={x:O,y:I};let ne=!1,fe={x:0,y:0,x2:0,y2:0};if(u.size>1&&R){const ce=wl(u);fe=Lp(ce)}for(const[ce,ue]of u){if(!B.has(ce))continue;let ge={x:O-ue.distance.x,y:I-ue.distance.y};z&&(ge=Wh(ge,L));let xe=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(u.size>1&&R&&!ue.extent){const{positionAbsolute:$}=ue.internals,k=$.x-fe.x+R[0][0],q=$.x+ue.measured.width-fe.x2+R[1][0],X=$.y-fe.y+R[0][1],Z=$.y+ue.measured.height-fe.y2+R[1][1];xe=[[k,X],[q,Z]]}const{position:ye,positionAbsolute:he}=vx({nodeId:ce,nextPosition:ge,nodeLookup:B,nodeExtent:xe,nodeOrigin:K,onError:G});ne=ne||ue.position.x!==ye.x||ue.position.y!==ye.y,ue.position=ye,ue.internals.positionAbsolute=he}if(ne&&(J(u,!0),M&&(t||U||!b&&H))){const[ce,ue]=$d({nodeId:b,dragItems:u,nodeLookup:B});t==null||t(M,u,ce,ue),U==null||U(M,ce,ue),b||H==null||H(M,ue)}}async function A(){if(!d)return;const{transform:O,panBy:I,autoPanSpeed:M}=o(),[B,R]=xx(s,d,M);(B!==0||R!==0)&&(i.x=(i.x??0)-B/O[2],i.y=(i.y??0)-R/O[2],await I({x:B,y:R})&&E(i,null)),f=requestAnimationFrame(A)}function T(O){var ne;const{nodeLookup:I,multiSelectionActive:M,nodesDraggable:B,transform:R,snapGrid:L,snapToGrid:z,selectNodesOnDrag:K,onNodeDragStart:U,onSelectionDragStart:H,unselectNodesAndEdges:G}=o();a=!0,(!K||!g)&&!M&&b&&((ne=I.get(b))!=null&&ne.selected||G()),g&&K&&b&&(e==null||e(b));const J=Xu(O.sourceEvent,{transform:R,snapGrid:L,snapToGrid:z,containerBounds:d});if(i=J,u=pD(I,B,J,b),u.size>0&&(r||U||!b&&H)){const[fe,ce]=$d({nodeId:b,dragItems:u,nodeLookup:I});r==null||r(O.sourceEvent,u,fe,ce),U==null||U(O.sourceEvent,fe,ce),b||H==null||H(O.sourceEvent,ce)}}const D=J_().clickDistance(S).on("start",O=>{const{domNode:I,nodeDragThreshold:M,transform:B,snapGrid:R,snapToGrid:L}=o();d=(I==null?void 0:I.getBoundingClientRect())||null,p=!1,M===0&&T(O),i=Xu(O.sourceEvent,{transform:B,snapGrid:R,snapToGrid:L,containerBounds:d}),s=ni(O.sourceEvent,d)}).on("drag",O=>{const{autoPanOnNodeDrag:I,transform:M,snapGrid:B,snapToGrid:R,nodeDragThreshold:L,nodeLookup:z}=o(),K=Xu(O.sourceEvent,{transform:M,snapGrid:B,snapToGrid:R,containerBounds:d});if((O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||b&&!z.has(b))&&(p=!0),!p){if(!h&&I&&a&&(h=!0,A()),!a){const U=K.xSnapped-(i.x??0),H=K.ySnapped-(i.y??0);Math.sqrt(U*U+H*H)>L&&T(O)}(i.x!==K.xSnapped||i.y!==K.ySnapped)&&u&&a&&(s=ni(O.sourceEvent,d),E(K,O.sourceEvent))}}).on("end",O=>{if(!(!a||p)&&(h=!1,a=!1,cancelAnimationFrame(f),u.size>0)){const{nodeLookup:I,updateNodePositions:M,onNodeDragStop:B,onSelectionDragStop:R}=o();if(M(u,!1),n||B||!b&&R){const[L,z]=$d({nodeId:b,dragItems:u,nodeLookup:I,dragging:!1});n==null||n(O.sourceEvent,u,L,z),B==null||B(O.sourceEvent,L,z),b||R==null||R(O.sourceEvent,z)}}}).filter(O=>{const I=O.target;return!O.button&&(!w||!Kv(I,`.${w}`,m))&&(!x||Kv(I,x,m))});l.call(D)}function _(){l==null||l.on(".drag",null)}return{update:v,destroy:_}}function gD(e,o,r){const t=[],n={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const i of o.values())il(n,Ws(i))>0&&t.push(i);return t}const yD=250;function vD(e,o,r,t){var u,h;let n=[],i=1/0;const f=gD(e,r,o+yD);for(const s of f){const d=[...((u=s.internals.handleBounds)==null?void 0:u.source)??[],...((h=s.internals.handleBounds)==null?void 0:h.target)??[]];for(const a of d){if(t.nodeId===a.nodeId&&t.type===a.type&&t.id===a.id)continue;const{x:l,y:p}=al(s,a,a.position,!0),v=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(p-e.y,2));v>o||(v1){const s=t.type==="source"?"target":"source";return n.find(d=>d.type===s)??n[0]}return n[0]}function Fx(e,o,r,t,n,i=!1){var s,d,a;const f=t.get(e);if(!f)return null;const u=n==="strict"?(s=f.internals.handleBounds)==null?void 0:s[o]:[...((d=f.internals.handleBounds)==null?void 0:d.source)??[],...((a=f.internals.handleBounds)==null?void 0:a.target)??[]],h=(r?u==null?void 0:u.find(l=>l.id===r):u==null?void 0:u[0])??null;return h&&i?{...h,...al(f,h,h.position,!0)}:h}function Rx(e,o){return e||(o!=null&&o.classList.contains("target")?"target":o!=null&&o.classList.contains("source")?"source":null)}function _D(e,o){let r=null;return o?r=!0:e&&!o&&(r=!1),r}const Mx=()=>!0;function xD(e,{connectionMode:o,connectionRadius:r,handleId:t,nodeId:n,edgeUpdaterType:i,isTarget:f,domNode:u,nodeLookup:h,lib:s,autoPanOnConnect:d,flowId:a,panBy:l,cancelConnection:p,onConnectStart:v,onConnect:_,onConnectEnd:w,isValidConnection:x=Mx,onReconnectEnd:m,updateConnection:g,getTransform:b,getFromHandle:S,autoPanSpeed:E}){const A=Cx(e.target);let T=0,D;const{x:O,y:I}=ni(e),M=A==null?void 0:A.elementFromPoint(O,I),B=Rx(i,M),R=u==null?void 0:u.getBoundingClientRect();if(!R||!B)return;const L=Fx(n,B,t,h,o);if(!L)return;let z=ni(e,R),K=!1,U=null,H=!1,G=null;function J(){if(!d||!R)return;const[he,$]=xx(z,R,E);l({x:he,y:$}),T=requestAnimationFrame(J)}const ne={...L,nodeId:n,type:B,position:L.position},fe=h.get(n),ue={inProgress:!0,isValid:null,from:al(fe,ne,vt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:fe,to:z,toHandle:null,toPosition:Mv[ne.position],toNode:null};g(ue);let ge=ue;v==null||v(e,{nodeId:n,handleId:t,handleType:B});function xe(he){if(!S()||!ne){ye(he);return}const $=b();z=ni(he,R),D=vD(bl(z,$,!1,[1,1]),r,h,ne),K||(J(),K=!0);const k=Lx(he,{handle:D,connectionMode:o,fromNodeId:n,fromHandleId:t,fromType:f?"target":"source",isValidConnection:x,doc:A,lib:s,flowId:a,nodeLookup:h});G=k.handleDomNode,U=k.connection,H=_D(!!D,k.isValid);const q={...ge,isValid:H,to:D&&H?bx({x:D.x,y:D.y},$):z,toHandle:k.toHandle,toPosition:H&&k.toHandle?k.toHandle.position:Mv[ne.position],toNode:k.toHandle?h.get(k.toHandle.nodeId):null};H&&D&&ge.toHandle&&q.toHandle&&ge.toHandle.type===q.toHandle.type&&ge.toHandle.nodeId===q.toHandle.nodeId&&ge.toHandle.id===q.toHandle.id&&ge.to.x===q.to.x&&ge.to.y===q.to.y||(g(q),ge=q)}function ye(he){(D||G)&&U&&H&&(_==null||_(U));const{inProgress:$,...k}=ge,q={...k,toPosition:ge.toHandle?ge.toPosition:null};w==null||w(he,q),i&&(m==null||m(he,q)),p(),cancelAnimationFrame(T),K=!1,H=!1,U=null,G=null,A.removeEventListener("mousemove",xe),A.removeEventListener("mouseup",ye),A.removeEventListener("touchmove",xe),A.removeEventListener("touchend",ye)}A.addEventListener("mousemove",xe),A.addEventListener("mouseup",ye),A.addEventListener("touchmove",xe),A.addEventListener("touchend",ye)}function Lx(e,{handle:o,connectionMode:r,fromNodeId:t,fromHandleId:n,fromType:i,doc:f,lib:u,flowId:h,isValidConnection:s=Mx,nodeLookup:d}){const a=i==="target",l=o?f.querySelector(`.${u}-flow__handle[data-id="${h}-${o==null?void 0:o.nodeId}-${o==null?void 0:o.id}-${o==null?void 0:o.type}"]`):null,{x:p,y:v}=ni(e),_=f.elementFromPoint(p,v),w=_!=null&&_.classList.contains(`${u}-flow__handle`)?_:l,x={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const m=Rx(void 0,w),g=w.getAttribute("data-nodeid"),b=w.getAttribute("data-handleid"),S=w.classList.contains("connectable"),E=w.classList.contains("connectableend");if(!g||!m)return x;const A={source:a?g:t,sourceHandle:a?b:n,target:a?t:g,targetHandle:a?n:b};x.connection=A;const D=S&&E&&(r===Hs.Strict?a&&m==="source"||!a&&m==="target":g!==t||b!==n);x.isValid=D&&s(A),x.toHandle=Fx(g,m,b,d,r,!1)}return x}const Hp={onPointerDown:xD,isValid:Lx};function wD({domNode:e,panZoom:o,getTransform:r,getViewScale:t}){const n=gr(e);function i({translateExtent:u,width:h,height:s,zoomStep:d=10,pannable:a=!0,zoomable:l=!0,inversePan:p=!1}){const v=g=>{const b=r();if(g.sourceEvent.type!=="wheel"||!o)return;const S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,E=b[2]*Math.pow(2,S);o.scaleTo(E)};let _=[0,0];const w=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(_=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},x=g=>{const b=r();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!o)return;const S=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],E=[S[0]-_[0],S[1]-_[1]];_=S;const A=t()*Math.max(b[2],Math.log(b[2]))*(p?-1:1),T={x:b[0]-E[0]*A,y:b[1]-E[1]*A},D=[[0,0],[h,s]];o.setViewportConstrained({x:T.x,y:T.y,zoom:b[2]},D,u)},m=fx().on("start",w).on("zoom",a?x:null).on("zoom.wheel",l?v:null);n.call(m,{})}function f(){n.on("zoom",null)}return{update:i,destroy:f,pointer:Qr}}const bD=(e,o)=>e.x!==o.x||e.y!==o.y||e.zoom!==o.k,qh=e=>({x:e.x,y:e.y,zoom:e.k}),Wd=({x:e,y:o,zoom:r})=>Vh.translate(e,o).scale(r),Ms=(e,o)=>e.target.closest(`.${o}`),jx=(e,o)=>o===2&&Array.isArray(e)&&e.includes(2),Gd=(e,o=0,r=()=>{})=>{const t=typeof o=="number"&&o>0;return t||r(),t?e.transition().duration(o).on("end",r):e},Bx=e=>{const o=e.ctrlKey&&Dh()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*o};function SD({zoomPanValues:e,noWheelClassName:o,d3Selection:r,d3Zoom:t,panOnScrollMode:n,panOnScrollSpeed:i,zoomOnPinch:f,onPanZoomStart:u,onPanZoom:h,onPanZoomEnd:s}){return d=>{if(Ms(d,o))return!1;d.preventDefault(),d.stopImmediatePropagation();const a=r.property("__zoom").k||1;if(d.ctrlKey&&f){const w=Qr(d),x=Bx(d),m=a*Math.pow(2,x);t.scaleTo(r,m,w,d);return}const l=d.deltaMode===1?20:1;let p=n===za.Vertical?0:d.deltaX*l,v=n===za.Horizontal?0:d.deltaY*l;!Dh()&&d.shiftKey&&n!==za.Vertical&&(p=d.deltaY*l,v=0),t.translateBy(r,-(p/a)*i,-(v/a)*i,{internal:!0});const _=qh(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u==null||u(d,_)),e.isPanScrolling&&(h==null||h(d,_),e.panScrollTimeout=setTimeout(()=>{s==null||s(d,_),e.isPanScrolling=!1},150))}}function ED({noWheelClassName:e,preventScrolling:o,d3ZoomHandler:r}){return function(t,n){if(!o&&t.type==="wheel"&&!t.ctrlKey||Ms(t,e))return null;t.preventDefault(),r.call(this,t,n)}}function CD({zoomPanValues:e,onDraggingChange:o,onPanZoomStart:r}){return t=>{var i,f,u;if((i=t.sourceEvent)!=null&&i.internal)return;const n=qh(t.transform);e.mouseButton=((f=t.sourceEvent)==null?void 0:f.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=n,((u=t.sourceEvent)==null?void 0:u.type)==="mousedown"&&o(!0),r&&(r==null||r(t.sourceEvent,n))}}function AD({zoomPanValues:e,panOnDrag:o,onPaneContextMenu:r,onTransformChange:t,onPanZoom:n}){return i=>{var f,u;e.usedRightMouseButton=!!(r&&jx(o,e.mouseButton??0)),(f=i.sourceEvent)!=null&&f.sync||t([i.transform.x,i.transform.y,i.transform.k]),n&&!((u=i.sourceEvent)!=null&&u.internal)&&(n==null||n(i.sourceEvent,qh(i.transform)))}}function DD({zoomPanValues:e,panOnDrag:o,panOnScroll:r,onDraggingChange:t,onPanZoomEnd:n,onPaneContextMenu:i}){return f=>{var u;if(!((u=f.sourceEvent)!=null&&u.internal)&&(e.isZoomingOrPanning=!1,i&&jx(o,e.mouseButton??0)&&!e.usedRightMouseButton&&f.sourceEvent&&i(f.sourceEvent),e.usedRightMouseButton=!1,t(!1),n&&bD(e.prevViewport,f.transform))){const h=qh(f.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{n==null||n(f.sourceEvent,h)},r?150:0)}}}function TD({zoomActivationKeyPressed:e,zoomOnScroll:o,zoomOnPinch:r,panOnDrag:t,panOnScroll:n,zoomOnDoubleClick:i,userSelectionActive:f,noWheelClassName:u,noPanClassName:h,lib:s}){return d=>{var v;const a=e||o,l=r&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(Ms(d,`${s}-flow__node`)||Ms(d,`${s}-flow__edge`)))return!0;if(!t&&!a&&!n&&!i&&!r||f||Ms(d,u)&&d.type==="wheel"||Ms(d,h)&&(d.type!=="wheel"||n&&d.type==="wheel"&&!e)||!r&&d.ctrlKey&&d.type==="wheel")return!1;if(!r&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!a&&!n&&!l&&d.type==="wheel"||!t&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(t)&&!t.includes(d.button)&&d.type==="mousedown")return!1;const p=Array.isArray(t)&&t.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&p}}function ND({domNode:e,minZoom:o,maxZoom:r,paneClickDistance:t,translateExtent:n,viewport:i,onPanZoom:f,onPanZoomStart:u,onPanZoomEnd:h,onDraggingChange:s}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},a=e.getBoundingClientRect(),l=fx().clickDistance(!ro(t)||t<0?0:t).scaleExtent([o,r]).translateExtent(n),p=gr(e).call(l);g({x:i.x,y:i.y,zoom:$s(i.zoom,o,r)},[[0,0],[a.width,a.height]],n);const v=p.on("wheel.zoom"),_=p.on("dblclick.zoom");l.wheelDelta(Bx);function w(M,B){return p?new Promise(R=>{l==null||l.transform(Gd(p,B==null?void 0:B.duration,()=>R(!0)),M)}):Promise.resolve(!1)}function x({noWheelClassName:M,noPanClassName:B,onPaneContextMenu:R,userSelectionActive:L,panOnScroll:z,panOnDrag:K,panOnScrollMode:U,panOnScrollSpeed:H,preventScrolling:G,zoomOnPinch:J,zoomOnScroll:ne,zoomOnDoubleClick:fe,zoomActivationKeyPressed:ce,lib:ue,onTransformChange:ge}){L&&!d.isZoomingOrPanning&&m();const ye=z&&!ce&&!L?SD({zoomPanValues:d,noWheelClassName:M,d3Selection:p,d3Zoom:l,panOnScrollMode:U,panOnScrollSpeed:H,zoomOnPinch:J,onPanZoomStart:u,onPanZoom:f,onPanZoomEnd:h}):ED({noWheelClassName:M,preventScrolling:G,d3ZoomHandler:v});if(p.on("wheel.zoom",ye,{passive:!1}),!L){const $=CD({zoomPanValues:d,onDraggingChange:s,onPanZoomStart:u});l.on("start",$);const k=AD({zoomPanValues:d,panOnDrag:K,onPaneContextMenu:!!R,onPanZoom:f,onTransformChange:ge});l.on("zoom",k);const q=DD({zoomPanValues:d,panOnDrag:K,panOnScroll:z,onPaneContextMenu:R,onPanZoomEnd:h,onDraggingChange:s});l.on("end",q)}const he=TD({zoomActivationKeyPressed:ce,panOnDrag:K,zoomOnScroll:ne,panOnScroll:z,zoomOnDoubleClick:fe,zoomOnPinch:J,userSelectionActive:L,noPanClassName:B,noWheelClassName:M,lib:ue});l.filter(he),fe?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function m(){l.on("zoom",null)}async function g(M,B,R){const L=Wd(M),z=l==null?void 0:l.constrain()(L,B,R);return z&&await w(z),new Promise(K=>K(z))}async function b(M,B){const R=Wd(M);return await w(R,B),new Promise(L=>L(R))}function S(M){if(p){const B=Wd(M),R=p.property("__zoom");(R.k!==M.zoom||R.x!==M.x||R.y!==M.y)&&(l==null||l.transform(p,B,null,{sync:!0}))}}function E(){const M=p?hx(p.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function A(M,B){return p?new Promise(R=>{l==null||l.scaleTo(Gd(p,B==null?void 0:B.duration,()=>R(!0)),M)}):Promise.resolve(!1)}function T(M,B){return p?new Promise(R=>{l==null||l.scaleBy(Gd(p,B==null?void 0:B.duration,()=>R(!0)),M)}):Promise.resolve(!1)}function D(M){l==null||l.scaleExtent(M)}function O(M){l==null||l.translateExtent(M)}function I(M){const B=!ro(M)||M<0?0:M;l==null||l.clickDistance(B)}return{update:x,destroy:m,setViewport:b,setViewportConstrained:g,getViewport:E,scaleTo:A,scaleBy:T,setScaleExtent:D,setTranslateExtent:O,syncViewport:S,setClickDistance:I}}var Ku;(function(e){e.Line="line",e.Handle="handle"})(Ku||(Ku={}));function PD({width:e,prevWidth:o,height:r,prevHeight:t,affectsX:n,affectsY:i}){const f=e-o,u=r-t,h=[f>0?1:f<0?-1:0,u>0?1:u<0?-1:0];return f&&n&&(h[0]=h[0]*-1),u&&i&&(h[1]=h[1]*-1),h}function OD(e){const o=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),t=e.includes("left"),n=e.includes("top");return{isHorizontal:o,isVertical:r,affectsX:t,affectsY:n}}function Ri(e,o){return Math.max(0,o-e)}function Mi(e,o){return Math.max(0,e-o)}function $c(e,o,r){return Math.max(0,o-e,e-r)}function Yv(e,o){return e?!o:o}function kD(e,o,r,t,n,i,f,u){let{affectsX:h,affectsY:s}=o;const{isHorizontal:d,isVertical:a}=o,l=d&&a,{xSnapped:p,ySnapped:v}=r,{minWidth:_,maxWidth:w,minHeight:x,maxHeight:m}=t,{x:g,y:b,width:S,height:E,aspectRatio:A}=e;let T=Math.floor(d?p-e.pointerX:0),D=Math.floor(a?v-e.pointerY:0);const O=S+(h?-T:T),I=E+(s?-D:D),M=-i[0]*S,B=-i[1]*E;let R=$c(O,_,w),L=$c(I,x,m);if(f){let U=0,H=0;h&&T<0?U=Ri(g+T+M,f[0][0]):!h&&T>0&&(U=Mi(g+O+M,f[1][0])),s&&D<0?H=Ri(b+D+B,f[0][1]):!s&&D>0&&(H=Mi(b+I+B,f[1][1])),R=Math.max(R,U),L=Math.max(L,H)}if(u){let U=0,H=0;h&&T>0?U=Mi(g+T,u[0][0]):!h&&T<0&&(U=Ri(g+O,u[1][0])),s&&D>0?H=Mi(b+D,u[0][1]):!s&&D<0&&(H=Ri(b+I,u[1][1])),R=Math.max(R,U),L=Math.max(L,H)}if(n){if(d){const U=$c(O/A,x,m)*A;if(R=Math.max(R,U),f){let H=0;!h&&!s||h&&!s&&l?H=Mi(b+B+O/A,f[1][1])*A:H=Ri(b+B+(h?T:-T)/A,f[0][1])*A,R=Math.max(R,H)}if(u){let H=0;!h&&!s||h&&!s&&l?H=Ri(b+O/A,u[1][1])*A:H=Mi(b+(h?T:-T)/A,u[0][1])*A,R=Math.max(R,H)}}if(a){const U=$c(I*A,_,w)/A;if(L=Math.max(L,U),f){let H=0;!h&&!s||s&&!h&&l?H=Mi(g+I*A+M,f[1][0])/A:H=Ri(g+(s?D:-D)*A+M,f[0][0])/A,L=Math.max(L,H)}if(u){let H=0;!h&&!s||s&&!h&&l?H=Ri(g+I*A,u[1][0])/A:H=Mi(g+(s?D:-D)*A,u[0][0])/A,L=Math.max(L,H)}}}D=D+(D<0?L:-L),T=T+(T<0?R:-R),n&&(l?O>I*A?D=(Yv(h,s)?-T:T)/A:T=(Yv(h,s)?-D:D)*A:d?(D=T/A,s=h):(T=D*A,h=s));const z=h?g+T:g,K=s?b+D:b;return{width:S+(h?-T:T),height:E+(s?-D:D),x:i[0]*T*(h?-1:1)+z,y:i[1]*D*(s?-1:1)+K}}const zx={width:0,height:0,x:0,y:0},ID={...zx,pointerX:0,pointerY:0,aspectRatio:1};function FD(e){return[[0,0],[e.measured.width,e.measured.height]]}function RD(e,o,r){const t=o.position.x+e.position.x,n=o.position.y+e.position.y,i=e.measured.width??0,f=e.measured.height??0,u=r[0]*i,h=r[1]*f;return[[t-u,n-h],[t+i-u,n+f-h]]}function MD({domNode:e,nodeId:o,getStoreItems:r,onChange:t,onEnd:n}){const i=gr(e);function f({controlPosition:h,boundaries:s,keepAspectRatio:d,onResizeStart:a,onResize:l,onResizeEnd:p,shouldResize:v}){let _={...zx},w={...ID};const x=OD(h);let m,g=null,b=[],S,E,A;const T=J_().on("start",D=>{const{nodeLookup:O,transform:I,snapGrid:M,snapToGrid:B,nodeOrigin:R,paneDomNode:L}=r();if(m=O.get(o),!m)return;g=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:K}=Xu(D.sourceEvent,{transform:I,snapGrid:M,snapToGrid:B,containerBounds:g});_={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},w={..._,pointerX:z,pointerY:K,aspectRatio:_.width/_.height},S=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(S=O.get(m.parentId),E=S&&m.extent==="parent"?FD(S):void 0),b=[],A=void 0;for(const[U,H]of O)if(H.parentId===o&&(b.push({id:U,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const G=RD(H,m,H.origin??R);A?A=[[Math.min(G[0][0],A[0][0]),Math.min(G[0][1],A[0][1])],[Math.max(G[1][0],A[1][0]),Math.max(G[1][1],A[1][1])]]:A=G}a==null||a(D,{..._})}).on("drag",D=>{const{transform:O,snapGrid:I,snapToGrid:M,nodeOrigin:B}=r(),R=Xu(D.sourceEvent,{transform:O,snapGrid:I,snapToGrid:M,containerBounds:g}),L=[];if(!m)return;const{x:z,y:K,width:U,height:H}=_,G={},J=m.origin??B,{width:ne,height:fe,x:ce,y:ue}=kD(w,x,R,s,d,J,E,A),ge=ne!==U,xe=fe!==H,ye=ce!==z&&ge,he=ue!==K&&xe;if(!ye&&!he&&!ge&&!xe)return;if((ye||he||J[0]===1||J[1]===1)&&(G.x=ye?ce:_.x,G.y=he?ue:_.y,_.x=G.x,_.y=G.y,b.length>0)){const X=ce-z,Z=ue-K;for(const te of b)te.position={x:te.position.x-X+J[0]*(ne-U),y:te.position.y-Z+J[1]*(fe-H)},L.push(te)}if((ge||xe)&&(G.width=ge?ne:_.width,G.height=xe?fe:_.height,_.width=G.width,_.height=G.height),S&&m.expandParent){const X=J[0]*(G.width??0);G.x&&G.x{p==null||p(D,{..._}),n==null||n()});i.call(T)}function u(){i.on(".drag",null)}return{update:f,destroy:u}}var qd={exports:{}},Xd={},Kd={exports:{}},Yd={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Jv;function LD(){if(Jv)return Yd;Jv=1;var e=yl();function o(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var r=typeof Object.is=="function"?Object.is:o,t=e.useState,n=e.useEffect,i=e.useLayoutEffect,f=e.useDebugValue;function u(a,l){var p=l(),v=t({inst:{value:p,getSnapshot:l}}),_=v[0].inst,w=v[1];return i(function(){_.value=p,_.getSnapshot=l,h(_)&&w({inst:_})},[a,p,l]),n(function(){return h(_)&&w({inst:_}),a(function(){h(_)&&w({inst:_})})},[a]),f(p),p}function h(a){var l=a.getSnapshot;a=a.value;try{var p=l();return!r(a,p)}catch{return!0}}function s(a,l){return l()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:u;return Yd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Yd}var Qv;function jD(){return Qv||(Qv=1,Kd.exports=LD()),Kd.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Zv;function BD(){if(Zv)return Xd;Zv=1;var e=yl(),o=jD();function r(s,d){return s===d&&(s!==0||1/s===1/d)||s!==s&&d!==d}var t=typeof Object.is=="function"?Object.is:r,n=o.useSyncExternalStore,i=e.useRef,f=e.useEffect,u=e.useMemo,h=e.useDebugValue;return Xd.useSyncExternalStoreWithSelector=function(s,d,a,l,p){var v=i(null);if(v.current===null){var _={hasValue:!1,value:null};v.current=_}else _=v.current;v=u(function(){function x(E){if(!m){if(m=!0,g=E,E=l(E),p!==void 0&&_.hasValue){var A=_.value;if(p(A,E))return b=A}return b=E}if(A=b,t(g,E))return A;var T=l(E);return p!==void 0&&p(A,T)?(g=E,A):(g=E,b=T)}var m=!1,g,b,S=a===void 0?null:a;return[function(){return x(d())},S===null?void 0:function(){return x(S())}]},[d,a,l,p]);var w=n(s,v[0],v[1]);return f(function(){_.hasValue=!0,_.value=w},[w]),h(w),w},Xd}var e0;function zD(){return e0||(e0=1,qd.exports=BD()),qd.exports}var UD=zD();const VD=gl(UD),HD={},t0=e=>{let o;const r=new Set,t=(d,a)=>{const l=typeof d=="function"?d(o):d;if(!Object.is(l,o)){const p=o;o=a??(typeof l!="object"||l===null)?l:Object.assign({},o,l),r.forEach(v=>v(o,p))}},n=()=>o,h={setState:t,getState:n,getInitialState:()=>s,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(HD?"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."),r.clear()}},s=o=e(t,n,h);return h},$D=e=>e?t0(e):t0,{useDebugValue:WD}=Nn,{useSyncExternalStoreWithSelector:GD}=VD,qD=e=>e;function Ux(e,o=qD,r){const t=GD(e.subscribe,e.getState,e.getServerState||e.getInitialState,o,r);return WD(t),t}const n0=(e,o)=>{const r=$D(e),t=(n,i=o)=>Ux(r,n,i);return Object.assign(t,r),t},XD=(e,o)=>e?n0(e,o):n0;function fn(e,o){if(Object.is(e,o))return!0;if(typeof e!="object"||e===null||typeof o!="object"||o===null)return!1;if(e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(const[t,n]of e)if(!Object.is(n,o.get(t)))return!1;return!0}if(e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(const t of e)if(!o.has(t))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(o).length)return!1;for(const t of r)if(!Object.prototype.hasOwnProperty.call(o,t)||!Object.is(e[t],o[t]))return!1;return!0}var KD=M_();const Xh=ae.createContext(null),YD=Xh.Provider,Vx=No.error001();function zt(e,o){const r=ae.useContext(Xh);if(r===null)throw new Error(Vx);return Ux(r,e,o)}function en(){const e=ae.useContext(Xh);if(e===null)throw new Error(Vx);return ae.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const r0={display:"none"},JD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Hx="react-flow__node-desc",$x="react-flow__edge-desc",QD="react-flow__aria-live",ZD=e=>e.ariaLiveMessage;function eT({rfId:e}){const o=zt(ZD);return Q.jsx("div",{id:`${QD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:JD,children:o})}function tT({rfId:e,disableKeyboardA11y:o}){return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{id:`${Hx}-${e}`,style:r0,children:["Press enter or space to select a node.",!o&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),Q.jsx("div",{id:`${$x}-${e}`,style:r0,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!o&&Q.jsx(eT,{rfId:e})]})}const nT=e=>e.userSelectionActive?"none":"all",Dm=ae.forwardRef(({position:e="top-left",children:o,className:r,style:t,...n},i)=>{const f=zt(nT),u=`${e}`.split("-");return Q.jsx("div",{className:yn(["react-flow__panel",r,...u]),style:{...t,pointerEvents:f},ref:i,...n,children:o})});function rT({proOptions:e,position:o="bottom-right"}){return e!=null&&e.hideAttribution?null:Q.jsx(Dm,{position:o,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:Q.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oT=e=>{const o=[],r=[];for(const[,t]of e.nodeLookup)t.selected&&o.push(t.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&r.push(t);return{selectedNodes:o,selectedEdges:r}},Wc=e=>e.id;function iT(e,o){return fn(e.selectedNodes.map(Wc),o.selectedNodes.map(Wc))&&fn(e.selectedEdges.map(Wc),o.selectedEdges.map(Wc))}function aT({onSelectionChange:e}){const o=en(),{selectedNodes:r,selectedEdges:t}=zt(oT,iT);return ae.useEffect(()=>{const n={nodes:r,edges:t};e==null||e(n),o.getState().onSelectionChangeHandlers.forEach(i=>i(n))},[r,t,e]),null}const sT=e=>!!e.onSelectionChangeHandlers;function uT({onSelectionChange:e}){const o=zt(sT);return e||o?Q.jsx(aT,{onSelectionChange:e}):null}const Wx=[0,0],lT={x:0,y:0,zoom:1},cT=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],o0=[...cT,"rfId"],hT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),i0={translateExtent:rl,nodeOrigin:Wx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function fT(e){const{setNodes:o,setEdges:r,setMinZoom:t,setMaxZoom:n,setTranslateExtent:i,setNodeExtent:f,reset:u,setDefaultNodesAndEdges:h,setPaneClickDistance:s}=zt(hT,fn),d=en();ae.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{a.current=i0,u()}),[]);const a=ae.useRef(i0);return ae.useEffect(()=>{for(const l of o0){const p=e[l],v=a.current[l];p!==v&&(typeof e[l]>"u"||(l==="nodes"?o(p):l==="edges"?r(p):l==="minZoom"?t(p):l==="maxZoom"?n(p):l==="translateExtent"?i(p):l==="nodeExtent"?f(p):l==="paneClickDistance"?s(p):l==="fitView"?d.setState({fitViewOnInit:p}):l==="fitViewOptions"?d.setState({fitViewOnInitOptions:p}):d.setState({[l]:p})))}a.current=e},o0.map(l=>e[l])),null}function a0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function dT(e){var t;const[o,r]=ae.useState(e==="system"?null:e);return ae.useEffect(()=>{if(e!=="system"){r(e);return}const n=a0(),i=()=>r(n!=null&&n.matches?"dark":"light");return i(),n==null||n.addEventListener("change",i),()=>{n==null||n.removeEventListener("change",i)}},[e]),o!==null?o:(t=a0())!=null&&t.matches?"dark":"light"}const s0=typeof document<"u"?document:null;function sl(e=null,o={target:s0,actInsideInputWithModifier:!0}){const[r,t]=ae.useState(!1),n=ae.useRef(!1),i=ae.useRef(new Set([])),[f,u]=ae.useMemo(()=>{if(e!==null){const s=(Array.isArray(e)?e:[e]).filter(a=>typeof a=="string").map(a=>a.replace("+",` `).replace(` `,` +`).split(` `)),d=s.reduce((a,l)=>a.concat(...l),[]);return[s,d]}return[[],[]]},[e]);return ae.useEffect(()=>{const h=(o==null?void 0:o.target)||s0;if(e!==null){const s=l=>{if(n.current=l.ctrlKey||l.metaKey||l.shiftKey,(!n.current||n.current&&!o.actInsideInputWithModifier)&&jp(l))return!1;const v=l0(l.code,u);i.current.add(l[v]),u0(f,i.current,!1)&&(l.preventDefault(),t(!0))},d=l=>{if((!n.current||n.current&&!o.actInsideInputWithModifier)&&jp(l))return!1;const v=l0(l.code,u);u0(f,i.current,!0)?(t(!1),i.current.clear()):i.current.delete(l[v]),l.key==="Meta"&&i.current.clear(),n.current=!1},a=()=>{i.current.clear(),t(!1)};return h==null||h.addEventListener("keydown",s),h==null||h.addEventListener("keyup",d),window.addEventListener("blur",a),window.addEventListener("contextmenu",a),()=>{h==null||h.removeEventListener("keydown",s),h==null||h.removeEventListener("keyup",d),window.removeEventListener("blur",a),window.removeEventListener("contextmenu",a)}}},[e,t]),r}function u0(e,o,r){return e.filter(t=>r||t.length===o.size).some(t=>t.every(n=>o.has(n)))}function l0(e,o){return o.includes(e)?"code":"key"}const pT=()=>{const e=en();return ae.useMemo(()=>({zoomIn:o=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:o==null?void 0:o.duration}):Promise.resolve(!1)},zoomOut:o=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:o==null?void 0:o.duration}):Promise.resolve(!1)},zoomTo:(o,r)=>{const{panZoom:t}=e.getState();return t?t.scaleTo(o,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(o,r)=>{const{transform:[t,n,i],panZoom:f}=e.getState();return f?(await f.setViewport({x:o.x??t,y:o.y??n,zoom:o.zoom??i},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[o,r,t]=e.getState().transform;return{x:o,y:r,zoom:t}},fitView:o=>{const{nodeLookup:r,minZoom:t,maxZoom:n,panZoom:i,domNode:f}=e.getState();if(!i||!f)return Promise.resolve(!1);const u=Rp(r,o),{width:h,height:s}=Gh(f);return Mp({nodes:u,width:h,height:s,minZoom:t,maxZoom:n,panZoom:i},o)},setCenter:async(o,r,t)=>{const{width:n,height:i,maxZoom:f,panZoom:u}=e.getState(),h=typeof(t==null?void 0:t.zoom)<"u"?t.zoom:f,s=n/2-o*h,d=i/2-r*h;return u?(await u.setViewport({x:s,y:d,zoom:h},{duration:t==null?void 0:t.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(o,r)=>{const{width:t,height:n,minZoom:i,maxZoom:f,panZoom:u}=e.getState(),h=bm(o,t,n,i,f,(r==null?void 0:r.padding)??.1);return u?(await u.setViewport(h,{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(o,r={snapToGrid:!0})=>{const{transform:t,snapGrid:n,domNode:i}=e.getState();if(!i)return o;const{x:f,y:u}=i.getBoundingClientRect(),h={x:o.x-f,y:o.y-u};return bl(h,t,r.snapToGrid,n)},flowToScreenPosition:o=>{const{transform:r,domNode:t}=e.getState();if(!t)return o;const{x:n,y:i}=t.getBoundingClientRect(),f=bx(o,r);return{x:f.x+n,y:f.y+i}}}),[])};function Gx(e,o){const r=[],t=new Map,n=[];for(const i of e)if(i.type==="add"){n.push(i);continue}else if(i.type==="remove"||i.type==="replace")t.set(i.id,[i]);else{const f=t.get(i.id);f?f.push(i):t.set(i.id,[i])}for(const i of o){const f=t.get(i.id);if(!f){r.push(i);continue}if(f[0].type==="remove")continue;if(f[0].type==="replace"){r.push({...f[0].item});continue}const u={...i};for(const h of f)mT(h,u);r.push(u)}return n.length&&n.forEach(i=>{i.index!==void 0?r.splice(i.index,0,{...i.item}):r.push({...i.item})}),r}function mT(e,o){switch(e.type){case"select":{o.selected=e.selected;break}case"position":{typeof e.position<"u"&&(o.position=e.position),typeof e.dragging<"u"&&(o.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(o.measured??(o.measured={}),o.measured.width=e.dimensions.width,o.measured.height=e.dimensions.height,e.setAttributes&&(o.width=e.dimensions.width,o.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(o.resizing=e.resizing);break}}}function qx(e,o){return Gx(e,o)}function Xx(e,o){return Gx(e,o)}function Ia(e,o){return{id:e,type:"select",selected:o}}function Ls(e,o=new Set,r=!1){const t=[];for(const[n,i]of e){const f=o.has(n);!(i.selected===void 0&&!f)&&i.selected!==f&&(r&&(i.selected=f),t.push(Ia(i.id,f)))}return t}function c0({items:e=[],lookup:o}){var n;const r=[],t=new Map(e.map(i=>[i.id,i]));for(const[i,f]of e.entries()){const u=o.get(f.id),h=((n=u==null?void 0:u.internals)==null?void 0:n.userNode)??u;h!==void 0&&h!==f&&r.push({id:f.id,item:f,type:"replace"}),h===void 0&&r.push({item:f,type:"add",index:i})}for(const[i]of o)t.get(i)===void 0&&r.push({id:i,type:"remove"});return r}function h0(e){return{id:e.id,type:"remove"}}const f0=e=>GA(e),gT=e=>gx(e);function Kx(e){return ae.forwardRef(e)}const yT=typeof window<"u"?ae.useLayoutEffect:ae.useEffect;function d0(e){const[o,r]=ae.useState(BigInt(0)),[t]=ae.useState(()=>vT(()=>r(n=>n+BigInt(1))));return yT(()=>{const n=t.get();n.length&&(e(n),t.reset())},[o]),t}function vT(e){let o=[];return{get:()=>o,reset:()=>{o=[]},push:r=>{o.push(r),e()}}}const Yx=ae.createContext(null);function _T({children:e}){const o=en(),r=ae.useCallback(u=>{const{nodes:h=[],setNodes:s,hasDefaultNodes:d,onNodesChange:a,nodeLookup:l}=o.getState();let p=h;for(const v of u)p=typeof v=="function"?v(p):v;d?s(p):a&&a(c0({items:p,lookup:l}))},[]),t=d0(r),n=ae.useCallback(u=>{const{edges:h=[],setEdges:s,hasDefaultEdges:d,onEdgesChange:a,edgeLookup:l}=o.getState();let p=h;for(const v of u)p=typeof v=="function"?v(p):v;d?s(p):a&&a(c0({items:p,lookup:l}))},[]),i=d0(n),f=ae.useMemo(()=>({nodeQueue:t,edgeQueue:i}),[]);return Q.jsx(Yx.Provider,{value:f,children:e})}function xT(){const e=ae.useContext(Yx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const wT=e=>!!e.panZoom;function Kh(){const e=pT(),o=en(),r=xT(),t=zt(wT),n=ae.useMemo(()=>{const i=a=>o.getState().nodeLookup.get(a),f=a=>{r.nodeQueue.push(a)},u=a=>{r.edgeQueue.push(a)},h=a=>{var x,m;const{nodeLookup:l,nodeOrigin:p}=o.getState(),v=f0(a)?a:l.get(a.id),_=v.parentId?Ex(v.position,v.measured,v.parentId,l,p):v.position,w={...v,position:_,width:((x=v.measured)==null?void 0:x.width)??v.width,height:((m=v.measured)==null?void 0:m.height)??v.height};return Ws(w)},s=(a,l,p={replace:!1})=>{f(v=>v.map(_=>{if(_.id===a){const w=typeof l=="function"?l(_):l;return p.replace&&f0(w)?w:{..._,...w}}return _}))},d=(a,l,p={replace:!1})=>{u(v=>v.map(_=>{if(_.id===a){const w=typeof l=="function"?l(_):l;return p.replace&&gT(w)?w:{..._,...w}}return _}))};return{getNodes:()=>o.getState().nodes.map(a=>({...a})),getNode:a=>{var l;return(l=i(a))==null?void 0:l.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:a=[]}=o.getState();return a.map(l=>({...l}))},getEdge:a=>o.getState().edgeLookup.get(a),setNodes:f,setEdges:u,addNodes:a=>{const l=Array.isArray(a)?a:[a];r.nodeQueue.push(p=>[...p,...l])},addEdges:a=>{const l=Array.isArray(a)?a:[a];r.edgeQueue.push(p=>[...p,...l])},toObject:()=>{const{nodes:a=[],edges:l=[],transform:p}=o.getState(),[v,_,w]=p;return{nodes:a.map(x=>({...x})),edges:l.map(x=>({...x})),viewport:{x:v,y:_,zoom:w}}},deleteElements:async({nodes:a=[],edges:l=[]})=>{const{nodes:p,edges:v,onNodesDelete:_,onEdgesDelete:w,triggerNodeChanges:x,triggerEdgeChanges:m,onDelete:g,onBeforeDelete:b}=o.getState(),{nodes:S,edges:E}=await YA({nodesToRemove:a,edgesToRemove:l,nodes:p,edges:v,onBeforeDelete:b}),A=E.length>0,T=S.length>0;if(A){const D=E.map(h0);w==null||w(E),m(D)}if(T){const D=S.map(h0);_==null||_(S),x(D)}return(T||A)&&(g==null||g({nodes:S,edges:E})),{deletedNodes:S,deletedEdges:E}},getIntersectingNodes:(a,l=!0,p)=>{const v=Bv(a),_=v?a:h(a),w=p!==void 0;return _?(p||o.getState().nodes).filter(x=>{const m=o.getState().nodeLookup.get(x.id);if(m&&!v&&(x.id===a.id||!m.internals.positionAbsolute))return!1;const g=Ws(w?x:m),b=il(g,_);return l&&b>0||b>=_.width*_.height}):[]},isNodeIntersecting:(a,l,p=!0)=>{const _=Bv(a)?a:h(a);if(!_)return!1;const w=il(_,l);return p&&w>0||w>=_.width*_.height},updateNode:s,updateNodeData:(a,l,p={replace:!1})=>{s(a,v=>{const _=typeof l=="function"?l(v):l;return p.replace?{...v,data:_}:{...v,data:{...v.data,..._}}},p)},updateEdge:d,updateEdgeData:(a,l,p={replace:!1})=>{d(a,v=>{const _=typeof l=="function"?l(v):l;return p.replace?{...v,data:_}:{...v,data:{...v.data,..._}}},p)},getNodesBounds:a=>{const{nodeLookup:l,nodeOrigin:p}=o.getState();return XA(a,{nodeLookup:l,nodeOrigin:p})},getHandleConnections:({type:a,id:l,nodeId:p})=>{var v;return Array.from(((v=o.getState().connectionLookup.get(`${p}-${a}${l?`-${l}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:a,handleId:l,nodeId:p})=>{var v;return Array.from(((v=o.getState().connectionLookup.get(`${p}${a?l?`-${a}-${l}`:`-${a}`:""}`))==null?void 0:v.values())??[])}}},[]);return ae.useMemo(()=>({...n,...e,viewportInitialized:t}),[t])}const p0=e=>e.selected,bT={actInsideInputWithModifier:!1},ST=typeof window<"u"?window:void 0;function ET({deleteKeyCode:e,multiSelectionKeyCode:o}){const r=en(),{deleteElements:t}=Kh(),n=sl(e,bT),i=sl(o,{target:ST});ae.useEffect(()=>{if(n){const{edges:f,nodes:u}=r.getState();t({nodes:u.filter(p0),edges:f.filter(p0)}),r.setState({nodesSelectionActive:!1})}},[n]),ae.useEffect(()=>{r.setState({multiSelectionActive:i})},[i])}function CT(e){const o=en();ae.useEffect(()=>{const r=()=>{var n,i;if(!e.current)return!1;const t=Gh(e.current);(t.height===0||t.width===0)&&((i=(n=o.getState()).onError)==null||i.call(n,"004",No.error004())),o.setState({width:t.width||500,height:t.height||500})};if(e.current){r(),window.addEventListener("resize",r);const t=new ResizeObserver(()=>r());return t.observe(e.current),()=>{window.removeEventListener("resize",r),t&&e.current&&t.unobserve(e.current)}}},[])}const Yh={position:"absolute",width:"100%",height:"100%",top:0,left:0},AT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function DT({onPaneContextMenu:e,zoomOnScroll:o=!0,zoomOnPinch:r=!0,panOnScroll:t=!1,panOnScrollSpeed:n=.5,panOnScrollMode:i=za.Free,zoomOnDoubleClick:f=!0,panOnDrag:u=!0,defaultViewport:h,translateExtent:s,minZoom:d,maxZoom:a,zoomActivationKeyCode:l,preventScrolling:p=!0,children:v,noWheelClassName:_,noPanClassName:w,onViewportChange:x,isControlledViewport:m,paneClickDistance:g}){const b=en(),S=ae.useRef(null),{userSelectionActive:E,lib:A}=zt(AT,fn),T=sl(l),D=ae.useRef();CT(S);const O=ae.useCallback(I=>{x==null||x({x:I[0],y:I[1],zoom:I[2]}),m||b.setState({transform:I})},[x,m]);return ae.useEffect(()=>{if(S.current){D.current=ND({domNode:S.current,minZoom:d,maxZoom:a,translateExtent:s,viewport:h,paneClickDistance:g,onDraggingChange:R=>b.setState({paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:z,onMoveStart:K}=b.getState();K==null||K(R,L),z==null||z(L)},onPanZoom:(R,L)=>{const{onViewportChange:z,onMove:K}=b.getState();K==null||K(R,L),z==null||z(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:z,onMoveEnd:K}=b.getState();K==null||K(R,L),z==null||z(L)}});const{x:I,y:M,zoom:B}=D.current.getViewport();return b.setState({panZoom:D.current,transform:[I,M,B],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=D.current)==null||R.destroy()}}},[]),ae.useEffect(()=>{var I;(I=D.current)==null||I.update({onPaneContextMenu:e,zoomOnScroll:o,zoomOnPinch:r,panOnScroll:t,panOnScrollSpeed:n,panOnScrollMode:i,zoomOnDoubleClick:f,panOnDrag:u,zoomActivationKeyPressed:T,preventScrolling:p,noPanClassName:w,userSelectionActive:E,noWheelClassName:_,lib:A,onTransformChange:O})},[e,o,r,t,n,i,f,u,T,p,w,E,_,A,O]),Q.jsx("div",{className:"react-flow__renderer",ref:S,style:Yh,children:v})}const TT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function NT(){const{userSelectionActive:e,userSelectionRect:o}=zt(TT,fn);return e&&o?Q.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:o.width,height:o.height,transform:`translate(${o.x}px, ${o.y}px)`}}):null}const Jd=(e,o)=>r=>{r.target===o.current&&(e==null||e(r))},PT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function OT({isSelecting:e,selectionKeyPressed:o,selectionMode:r=ol.Full,panOnDrag:t,selectionOnDrag:n,onSelectionStart:i,onSelectionEnd:f,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:s,onPaneMouseEnter:d,onPaneMouseMove:a,onPaneMouseLeave:l,children:p}){const v=en(),{userSelectionActive:_,elementsSelectable:w,dragging:x}=zt(PT,fn),m=w&&(e||_),g=ae.useRef(null),b=ae.useRef(),S=ae.useRef(new Set),E=ae.useRef(new Set),A=ae.useRef(!1),T=ae.useRef(!1),D=z=>{if(A.current){A.current=!1;return}u==null||u(z),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},O=z=>{if(Array.isArray(t)&&(t!=null&&t.includes(2))){z.preventDefault();return}h==null||h(z)},I=s?z=>s(z):void 0,M=z=>{var J,ne;const{resetSelectedElements:K,domNode:U}=v.getState();if(b.current=U==null?void 0:U.getBoundingClientRect(),!w||!e||z.button!==0||z.target!==g.current||!b.current)return;(ne=(J=z.target)==null?void 0:J.setPointerCapture)==null||ne.call(J,z.pointerId),T.current=!0,A.current=!1;const{x:H,y:G}=ni(z.nativeEvent,b.current);K(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:G,x:H,y:G}}),i==null||i(z)},B=z=>{const{userSelectionRect:K,transform:U,nodeLookup:H,edgeLookup:G,connectionLookup:J,triggerNodeChanges:ne,triggerEdgeChanges:fe,defaultEdgeOptions:ce}=v.getState();if(!b.current||!K)return;A.current=!0;const{x:ue,y:ge}=ni(z.nativeEvent,b.current),{startX:xe,startY:ye}=K,he={startX:xe,startY:ye,x:ueX.id)),E.current=new Set;const q=(ce==null?void 0:ce.selectable)??!0;for(const X of S.current){const Z=J.get(X);if(Z)for(const{edgeId:te}of Z.values()){const re=G.get(te);re&&(re.selectable??q)&&E.current.add(te)}}if(!zv($,S.current)){const X=Ls(H,S.current,!0);ne(X)}if(!zv(k,E.current)){const X=Ls(G,E.current);fe(X)}v.setState({userSelectionRect:he,userSelectionActive:!0,nodesSelectionActive:!1})},R=z=>{var U,H;if(z.button!==0||!T.current)return;(H=(U=z.target)==null?void 0:U.releasePointerCapture)==null||H.call(U,z.pointerId);const{userSelectionRect:K}=v.getState();!_&&K&&z.target===g.current&&(D==null||D(z)),v.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:S.current.size>0}),f==null||f(z),(o||n)&&(A.current=!1),T.current=!1},L=t===!0||Array.isArray(t)&&t.includes(0);return Q.jsxs("div",{className:yn(["react-flow__pane",{draggable:L,dragging:x,selection:e}]),onClick:m?void 0:Jd(D,g),onContextMenu:Jd(O,g),onWheel:Jd(I,g),onPointerEnter:m?void 0:d,onPointerDown:m?M:a,onPointerMove:m?B:a,onPointerUp:m?R:void 0,onPointerLeave:l,ref:g,style:Yh,children:[p,Q.jsx(NT,{})]})}function $p({id:e,store:o,unselect:r=!1,nodeRef:t}){const{addSelectedNodes:n,unselectNodesAndEdges:i,multiSelectionActive:f,nodeLookup:u,onError:h}=o.getState(),s=u.get(e);if(!s){h==null||h("012",No.error012(e));return}o.setState({nodesSelectionActive:!1}),s.selected?(r||s.selected&&f)&&(i({nodes:[s],edges:[]}),requestAnimationFrame(()=>{var d;return(d=t==null?void 0:t.current)==null?void 0:d.blur()})):n([e])}function Jx({nodeRef:e,disabled:o=!1,noDragClassName:r,handleSelector:t,nodeId:n,isSelectable:i,nodeClickDistance:f}){const u=en(),[h,s]=ae.useState(!1),d=ae.useRef();return ae.useEffect(()=>{d.current=mD({getStoreItems:()=>u.getState(),onNodeMouseDown:a=>{$p({id:a,store:u,nodeRef:e})},onDragStart:()=>{s(!0)},onDragStop:()=>{s(!1)}})},[]),ae.useEffect(()=>{var a,l;if(o)(a=d.current)==null||a.destroy();else if(e.current)return(l=d.current)==null||l.update({noDragClassName:r,handleSelector:t,domNode:e.current,isSelectable:i,nodeId:n,nodeClickDistance:f}),()=>{var p;(p=d.current)==null||p.destroy()}},[r,t,o,i,e,n]),h}const kT=e=>o=>o.selected&&(o.draggable||e&&typeof o.draggable>"u");function Qx(){const e=en();return ae.useCallback(r=>{const{nodeExtent:t,snapToGrid:n,snapGrid:i,nodesDraggable:f,onError:u,updateNodePositions:h,nodeLookup:s,nodeOrigin:d}=e.getState(),a=new Map,l=kT(f),p=n?i[0]:5,v=n?i[1]:5,_=r.direction.x*p*r.factor,w=r.direction.y*v*r.factor;for(const[,x]of s){if(!l(x))continue;let m={x:x.internals.positionAbsolute.x+_,y:x.internals.positionAbsolute.y+w};n&&(m=Wh(m,i));const{position:g,positionAbsolute:b}=vx({nodeId:x.id,nextPosition:m,nodeLookup:s,nodeExtent:t,nodeOrigin:d,onError:u});x.position=g,x.internals.positionAbsolute=b,a.set(x.id,x)}h(a)},[])}const Tm=ae.createContext(null),IT=Tm.Provider;Tm.Consumer;const Jh=()=>ae.useContext(Tm),FT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),RT=(e,o,r)=>t=>{const{connectionClickStartHandle:n,connectionMode:i,connection:f}=t,{fromHandle:u,toHandle:h,isValid:s}=f,d=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===o&&(h==null?void 0:h.type)===r;return{connectingFrom:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===o&&(u==null?void 0:u.type)===r,connectingTo:d,clickConnecting:(n==null?void 0:n.nodeId)===e&&(n==null?void 0:n.id)===o&&(n==null?void 0:n.type)===r,isPossibleEndHandle:i===Hs.Strict?(u==null?void 0:u.type)!==r:e!==(u==null?void 0:u.nodeId)||o!==(u==null?void 0:u.id),connectionInProcess:!!u,valid:d&&s}};function MT({type:e="source",position:o=vt.Top,isValidConnection:r,isConnectable:t=!0,isConnectableStart:n=!0,isConnectableEnd:i=!0,id:f,onConnect:u,children:h,className:s,onMouseDown:d,onTouchStart:a,...l},p){var R,L;const v=f||null,_=e==="target",w=en(),x=Jh(),{connectOnClick:m,noPanClassName:g,rfId:b}=zt(FT,fn),{connectingFrom:S,connectingTo:E,clickConnecting:A,isPossibleEndHandle:T,connectionInProcess:D,valid:O}=zt(RT(x,v,e),fn);x||(L=(R=w.getState()).onError)==null||L.call(R,"010",No.error010());const I=z=>{const{defaultEdgeOptions:K,onConnect:U,hasDefaultEdges:H}=w.getState(),G={...K,...z};if(H){const{edges:J,setEdges:ne}=w.getState();ne(Bp(G,J))}U==null||U(G),u==null||u(G)},M=z=>{if(!x)return;const K=Ax(z.nativeEvent);if(n&&(K&&z.button===0||!K)){const U=w.getState();Hp.onPointerDown(z.nativeEvent,{autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:_,handleId:v,nodeId:x,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:I,isValidConnection:r||U.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed})}K?d==null||d(z):a==null||a(z)},B=z=>{const{onClickConnectStart:K,onClickConnectEnd:U,connectionClickStartHandle:H,connectionMode:G,isValidConnection:J,lib:ne,rfId:fe,nodeLookup:ce,connection:ue}=w.getState();if(!x||!H&&!n)return;if(!H){K==null||K(z.nativeEvent,{nodeId:x,handleId:v,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:x,type:e,id:v}});return}const ge=Cx(z.target),xe=r||J,{connection:ye,isValid:he}=Hp.isValid(z.nativeEvent,{handle:{nodeId:x,id:v,type:e},connectionMode:G,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:xe,flowId:fe,doc:ge,lib:ne,nodeLookup:ce});he&&ye&&I(ye);const $=structuredClone(ue);delete $.inProgress,$.toPosition=$.toHandle?$.toHandle.position:null,U==null||U(z,$),w.setState({connectionClickStartHandle:null})};return Q.jsx("div",{"data-handleid":v,"data-nodeid":x,"data-handlepos":o,"data-id":`${b}-${x}-${v}-${e}`,className:yn(["react-flow__handle",`react-flow__handle-${o}`,"nodrag",g,s,{source:!_,target:_,connectable:t,connectablestart:n,connectableend:i,clickconnecting:A,connectingfrom:S,connectingto:E,valid:O,connectionindicator:t&&(!D||T)&&(D?i:n)}]),onMouseDown:M,onTouchStart:M,onClick:m?B:void 0,ref:p,...l,children:h})}const ul=ae.memo(Kx(MT));function LT({data:e,isConnectable:o,sourcePosition:r=vt.Bottom}){return Q.jsxs(Q.Fragment,{children:[e==null?void 0:e.label,Q.jsx(ul,{type:"source",position:r,isConnectable:o})]})}function jT({data:e,isConnectable:o,targetPosition:r=vt.Top,sourcePosition:t=vt.Bottom}){return Q.jsxs(Q.Fragment,{children:[Q.jsx(ul,{type:"target",position:r,isConnectable:o}),e==null?void 0:e.label,Q.jsx(ul,{type:"source",position:t,isConnectable:o})]})}function BT(){return null}function zT({data:e,isConnectable:o,targetPosition:r=vt.Top}){return Q.jsxs(Q.Fragment,{children:[Q.jsx(ul,{type:"target",position:r,isConnectable:o}),e==null?void 0:e.label]})}const Th={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},m0={input:LT,default:jT,output:zT,group:BT};function UT(e){var o,r,t,n;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((o=e.style)==null?void 0:o.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((t=e.style)==null?void 0:t.width),height:e.height??((n=e.style)==null?void 0:n.height)}}const VT=e=>{const{width:o,height:r,x:t,y:n}=wl(e.nodeLookup,{filter:i=>!!i.selected});return{width:ro(o)?o:null,height:ro(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${t}px,${n}px)`}};function HT({onSelectionContextMenu:e,noPanClassName:o,disableKeyboardA11y:r}){const t=en(),{width:n,height:i,transformString:f,userSelectionActive:u}=zt(VT,fn),h=Qx(),s=ae.useRef(null);if(ae.useEffect(()=>{var l;r||(l=s.current)==null||l.focus({preventScroll:!0})},[r]),Jx({nodeRef:s}),u||!n||!i)return null;const d=e?l=>{const p=t.getState().nodes.filter(v=>v.selected);e(l,p)}:void 0,a=l=>{Object.prototype.hasOwnProperty.call(Th,l.key)&&(l.preventDefault(),h({direction:Th[l.key],factor:l.shiftKey?4:1}))};return Q.jsx("div",{className:yn(["react-flow__nodesselection","react-flow__container",o]),style:{transform:f},children:Q.jsx("div",{ref:s,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:r?void 0:-1,onKeyDown:r?void 0:a,style:{width:n,height:i}})})}const g0=typeof window<"u"?window:void 0,$T=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Zx({children:e,onPaneClick:o,onPaneMouseEnter:r,onPaneMouseMove:t,onPaneMouseLeave:n,onPaneContextMenu:i,onPaneScroll:f,paneClickDistance:u,deleteKeyCode:h,selectionKeyCode:s,selectionOnDrag:d,selectionMode:a,onSelectionStart:l,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:_,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:m,zoomOnPinch:g,panOnScroll:b,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:A,panOnDrag:T,defaultViewport:D,translateExtent:O,minZoom:I,maxZoom:M,preventScrolling:B,onSelectionContextMenu:R,noWheelClassName:L,noPanClassName:z,disableKeyboardA11y:K,onViewportChange:U,isControlledViewport:H}){const{nodesSelectionActive:G,userSelectionActive:J}=zt($T),ne=sl(s,{target:g0}),fe=sl(_,{target:g0}),ce=fe||T,ue=fe||b,ge=d&&ce!==!0,xe=ne||J||ge;return ET({deleteKeyCode:h,multiSelectionKeyCode:v}),Q.jsx(DT,{onPaneContextMenu:i,elementsSelectable:x,zoomOnScroll:m,zoomOnPinch:g,panOnScroll:ue,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:A,panOnDrag:!ne&&ce,defaultViewport:D,translateExtent:O,minZoom:I,maxZoom:M,zoomActivationKeyCode:w,preventScrolling:B,noWheelClassName:L,noPanClassName:z,onViewportChange:U,isControlledViewport:H,paneClickDistance:u,children:Q.jsxs(OT,{onSelectionStart:l,onSelectionEnd:p,onPaneClick:o,onPaneMouseEnter:r,onPaneMouseMove:t,onPaneMouseLeave:n,onPaneContextMenu:i,onPaneScroll:f,panOnDrag:ce,isSelecting:!!xe,selectionMode:a,selectionKeyPressed:ne,selectionOnDrag:ge,children:[e,G&&Q.jsx(HT,{onSelectionContextMenu:R,noPanClassName:z,disableKeyboardA11y:K})]})})}Zx.displayName="FlowRenderer";const WT=ae.memo(Zx),GT=e=>o=>e?yx(o.nodeLookup,{x:0,y:0,width:o.width,height:o.height},o.transform,!0).map(r=>r.id):Array.from(o.nodeLookup.keys());function qT(e){return zt(ae.useCallback(GT(e),[e]),fn)}const XT=e=>e.updateNodeInternals;function KT(){const e=zt(XT),[o]=ae.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const t=new Map;r.forEach(n=>{const i=n.target.getAttribute("data-id");t.set(i,{id:i,nodeElement:n.target,force:!0})}),e(t)}));return ae.useEffect(()=>()=>{o==null||o.disconnect()},[o]),o}function YT({node:e,nodeType:o,hasDimensions:r,resizeObserver:t}){const n=en(),i=ae.useRef(null),f=ae.useRef(null),u=ae.useRef(e.sourcePosition),h=ae.useRef(e.targetPosition),s=ae.useRef(o),d=r&&!!e.internals.handleBounds;return ae.useEffect(()=>{i.current&&!e.hidden&&(!d||f.current!==i.current)&&(f.current&&(t==null||t.unobserve(f.current)),t==null||t.observe(i.current),f.current=i.current)},[d,e.hidden]),ae.useEffect(()=>()=>{f.current&&(t==null||t.unobserve(f.current),f.current=null)},[]),ae.useEffect(()=>{if(i.current){const a=s.current!==o,l=u.current!==e.sourcePosition,p=h.current!==e.targetPosition;(a||l||p)&&(s.current=o,u.current=e.sourcePosition,h.current=e.targetPosition,n.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,o,e.sourcePosition,e.targetPosition]),i}function JT({id:e,onClick:o,onMouseEnter:r,onMouseMove:t,onMouseLeave:n,onContextMenu:i,onDoubleClick:f,nodesDraggable:u,elementsSelectable:h,nodesConnectable:s,nodesFocusable:d,resizeObserver:a,noDragClassName:l,noPanClassName:p,disableKeyboardA11y:v,rfId:_,nodeTypes:w,nodeExtent:x,nodeClickDistance:m,onError:g}){const{node:b,internals:S,isParent:E}=zt(ye=>{const he=ye.nodeLookup.get(e),$=ye.parentLookup.has(e);return{node:he,internals:he.internals,isParent:$}},fn);let A=b.type||"default",T=(w==null?void 0:w[A])||m0[A];T===void 0&&(g==null||g("003",No.error003(A)),A="default",T=m0.default);const D=!!(b.draggable||u&&typeof b.draggable>"u"),O=!!(b.selectable||h&&typeof b.selectable>"u"),I=!!(b.connectable||s&&typeof b.connectable>"u"),M=!!(b.focusable||d&&typeof b.focusable>"u"),B=en(),R=Sx(b),L=YT({node:b,nodeType:A,hasDimensions:R,resizeObserver:a}),z=Jx({nodeRef:L,disabled:b.hidden||!D,noDragClassName:l,handleSelector:b.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:m}),K=Qx();if(b.hidden)return null;const U=ui(b),H=UT(b),G=O||D||o||r||t||n,J=r?ye=>r(ye,{...S.userNode}):void 0,ne=t?ye=>t(ye,{...S.userNode}):void 0,fe=n?ye=>n(ye,{...S.userNode}):void 0,ce=i?ye=>i(ye,{...S.userNode}):void 0,ue=f?ye=>f(ye,{...S.userNode}):void 0,ge=ye=>{const{selectNodesOnDrag:he,nodeDragThreshold:$}=B.getState();O&&(!he||!D||$>0)&&$p({id:e,store:B,nodeRef:L}),o&&o(ye,{...S.userNode})},xe=ye=>{if(!(jp(ye.nativeEvent)||v))if(dx.includes(ye.key)&&O){const he=ye.key==="Escape";$p({id:e,store:B,unselect:he,nodeRef:L})}else D&&b.selected&&Object.prototype.hasOwnProperty.call(Th,ye.key)&&(ye.preventDefault(),B.setState({ariaLiveMessage:`Moved selected node ${ye.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.positionAbsolute.x}, y: ${~~S.positionAbsolute.y}`}),K({direction:Th[ye.key],factor:ye.shiftKey?4:1}))};return Q.jsx("div",{className:yn(["react-flow__node",`react-flow__node-${A}`,{[p]:D},b.className,{selected:b.selected,selectable:O,parent:E,draggable:D,dragging:z}]),ref:L,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:R?"visible":"hidden",...b.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:J,onMouseMove:ne,onMouseLeave:fe,onContextMenu:ce,onClick:ge,onDoubleClick:ue,onKeyDown:M?xe:void 0,tabIndex:M?0:void 0,role:M?"button":void 0,"aria-describedby":v?void 0:`${Hx}-${_}`,"aria-label":b.ariaLabel,children:Q.jsx(IT,{value:e,children:Q.jsx(T,{id:e,data:b.data,type:A,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:b.selected??!1,selectable:O,draggable:D,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:z,dragHandle:b.dragHandle,zIndex:S.z,parentId:b.parentId,...U})})})}const QT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ew(e){const{nodesDraggable:o,nodesConnectable:r,nodesFocusable:t,elementsSelectable:n,onError:i}=zt(QT,fn),f=qT(e.onlyRenderVisibleElements),u=KT();return Q.jsx("div",{className:"react-flow__nodes",style:Yh,children:f.map(h=>Q.jsx(JT,{id:h,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:u,nodesDraggable:o,nodesConnectable:r,nodesFocusable:t,elementsSelectable:n,nodeClickDistance:e.nodeClickDistance,onError:i},h))})}ew.displayName="NodeRenderer";const ZT=ae.memo(ew);function eN(e){return zt(ae.useCallback(r=>{if(!e)return r.edges.map(n=>n.id);const t=[];if(r.width&&r.height)for(const n of r.edges){const i=r.nodeLookup.get(n.source),f=r.nodeLookup.get(n.target);i&&f&&eD({sourceNode:i,targetNode:f,width:r.width,height:r.height,transform:r.transform})&&t.push(n.id)}return t},[e]),fn)}const tN=({color:e="none",strokeWidth:o=1})=>Q.jsx("polyline",{style:{stroke:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),nN=({color:e="none",strokeWidth:o=1})=>Q.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),y0={[Ch.Arrow]:tN,[Ch.ArrowClosed]:nN};function rN(e){const o=en();return ae.useMemo(()=>{var n,i;return Object.prototype.hasOwnProperty.call(y0,e)?y0[e]:((i=(n=o.getState()).onError)==null||i.call(n,"009",No.error009(e)),null)},[e])}const oN=({id:e,type:o,color:r,width:t=12.5,height:n=12.5,markerUnits:i="strokeWidth",strokeWidth:f,orient:u="auto-start-reverse"})=>{const h=rN(o);return h?Q.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${t}`,markerHeight:`${n}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:u,refX:"0",refY:"0",children:Q.jsx(h,{color:r,strokeWidth:f})}):null},tw=({defaultColor:e,rfId:o})=>{const r=zt(i=>i.edges),t=zt(i=>i.defaultEdgeOptions),n=ae.useMemo(()=>sD(r,{id:o,defaultColor:e,defaultMarkerStart:t==null?void 0:t.markerStart,defaultMarkerEnd:t==null?void 0:t.markerEnd}),[r,t,o,e]);return n.length?Q.jsx("svg",{className:"react-flow__marker",children:Q.jsx("defs",{children:n.map(i=>Q.jsx(oN,{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};tw.displayName="MarkerDefinitions";var iN=ae.memo(tw);function nw({x:e,y:o,label:r,labelStyle:t={},labelShowBg:n=!0,labelBgStyle:i={},labelBgPadding:f=[2,4],labelBgBorderRadius:u=2,children:h,className:s,...d}){const[a,l]=ae.useState({x:1,y:0,width:0,height:0}),p=yn(["react-flow__edge-textwrapper",s]),v=ae.useRef(null);return ae.useEffect(()=>{if(v.current){const _=v.current.getBBox();l({x:_.x,y:_.y,width:_.width,height:_.height})}},[r]),typeof r>"u"||!r?null:Q.jsxs("g",{transform:`translate(${e-a.width/2} ${o-a.height/2})`,className:p,visibility:a.width?"visible":"hidden",...d,children:[n&&Q.jsx("rect",{width:a.width+2*f[0],x:-f[0],y:-f[1],height:a.height+2*f[1],className:"react-flow__edge-textbg",style:i,rx:u,ry:u}),Q.jsx("text",{className:"react-flow__edge-text",y:a.height/2,dy:"0.3em",ref:v,style:t,children:r}),h]})}nw.displayName="EdgeText";const aN=ae.memo(nw);function Qh({path:e,labelX:o,labelY:r,label:t,labelStyle:n,labelShowBg:i,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h,interactionWidth:s=20,...d}){return Q.jsxs(Q.Fragment,{children:[Q.jsx("path",{...d,d:e,fill:"none",className:yn(["react-flow__edge-path",d.className])}),s&&Q.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:s,className:"react-flow__edge-interaction"}),t&&ro(o)&&ro(r)?Q.jsx(aN,{x:o,y:r,label:t,labelStyle:n,labelShowBg:i,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h}):null]})}function v0({pos:e,x1:o,y1:r,x2:t,y2:n}){return e===vt.Left||e===vt.Right?[.5*(o+t),r]:[o,.5*(r+n)]}function rw({sourceX:e,sourceY:o,sourcePosition:r=vt.Bottom,targetX:t,targetY:n,targetPosition:i=vt.Top}){const[f,u]=v0({pos:r,x1:e,y1:o,x2:t,y2:n}),[h,s]=v0({pos:i,x1:t,y1:n,x2:e,y2:o}),[d,a,l,p]=Dx({sourceX:e,sourceY:o,targetX:t,targetY:n,sourceControlX:f,sourceControlY:u,targetControlX:h,targetControlY:s});return[`M${e},${o} C${f},${u} ${h},${s} ${t},${n}`,d,a,l,p]}function ow(e){return ae.memo(({id:o,sourceX:r,sourceY:t,targetX:n,targetY:i,sourcePosition:f=vt.Bottom,targetPosition:u=vt.Top,label:h,labelStyle:s,labelShowBg:d,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:p,style:v,markerEnd:_,markerStart:w,interactionWidth:x})=>{const[m,g,b]=rw({sourceX:r,sourceY:t,sourcePosition:f,targetX:n,targetY:i,targetPosition:u}),S=e.isInternal?void 0:o;return Q.jsx(Qh,{id:S,path:m,labelX:g,labelY:b,label:h,labelStyle:s,labelShowBg:d,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:p,style:v,markerEnd:_,markerStart:w,interactionWidth:x})})}const sN=ow({isInternal:!1}),iw=ow({isInternal:!0});sN.displayName="SimpleBezierEdge";iw.displayName="SimpleBezierEdgeInternal";function aw(e){return ae.memo(({id:o,sourceX:r,sourceY:t,targetX:n,targetY:i,label:f,labelStyle:u,labelShowBg:h,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:a,style:l,sourcePosition:p=vt.Bottom,targetPosition:v=vt.Top,markerEnd:_,markerStart:w,pathOptions:x,interactionWidth:m})=>{const[g,b,S]=zp({sourceX:r,sourceY:t,sourcePosition:p,targetX:n,targetY:i,targetPosition:v,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset}),E=e.isInternal?void 0:o;return Q.jsx(Qh,{id:E,path:g,labelX:b,labelY:S,label:f,labelStyle:u,labelShowBg:h,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:a,style:l,markerEnd:_,markerStart:w,interactionWidth:m})})}const sw=aw({isInternal:!1}),uw=aw({isInternal:!0});sw.displayName="SmoothStepEdge";uw.displayName="SmoothStepEdgeInternal";function lw(e){return ae.memo(({id:o,...r})=>{var n;const t=e.isInternal?void 0:o;return Q.jsx(sw,{...r,id:t,pathOptions:ae.useMemo(()=>{var i;return{borderRadius:0,offset:(i=r.pathOptions)==null?void 0:i.offset}},[(n=r.pathOptions)==null?void 0:n.offset])})})}const uN=lw({isInternal:!1}),cw=lw({isInternal:!0});uN.displayName="StepEdge";cw.displayName="StepEdgeInternal";function hw(e){return ae.memo(({id:o,sourceX:r,sourceY:t,targetX:n,targetY:i,label:f,labelStyle:u,labelShowBg:h,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:a,style:l,markerEnd:p,markerStart:v,interactionWidth:_})=>{const[w,x,m]=Px({sourceX:r,sourceY:t,targetX:n,targetY:i}),g=e.isInternal?void 0:o;return Q.jsx(Qh,{id:g,path:w,labelX:x,labelY:m,label:f,labelStyle:u,labelShowBg:h,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:a,style:l,markerEnd:p,markerStart:v,interactionWidth:_})})}const lN=hw({isInternal:!1}),fw=hw({isInternal:!0});lN.displayName="StraightEdge";fw.displayName="StraightEdgeInternal";function dw(e){return ae.memo(({id:o,sourceX:r,sourceY:t,targetX:n,targetY:i,sourcePosition:f=vt.Bottom,targetPosition:u=vt.Top,label:h,labelStyle:s,labelShowBg:d,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:p,style:v,markerEnd:_,markerStart:w,pathOptions:x,interactionWidth:m})=>{const[g,b,S]=Tx({sourceX:r,sourceY:t,sourcePosition:f,targetX:n,targetY:i,targetPosition:u,curvature:x==null?void 0:x.curvature}),E=e.isInternal?void 0:o;return Q.jsx(Qh,{id:E,path:g,labelX:b,labelY:S,label:h,labelStyle:s,labelShowBg:d,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:p,style:v,markerEnd:_,markerStart:w,interactionWidth:m})})}const cN=dw({isInternal:!1}),pw=dw({isInternal:!0});cN.displayName="BezierEdge";pw.displayName="BezierEdgeInternal";const _0={default:pw,straight:fw,step:cw,smoothstep:uw,simplebezier:iw},x0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},hN=(e,o,r)=>r===vt.Left?e-o:r===vt.Right?e+o:e,fN=(e,o,r)=>r===vt.Top?e-o:r===vt.Bottom?e+o:e,w0="react-flow__edgeupdater";function b0({position:e,centerX:o,centerY:r,radius:t=10,onMouseDown:n,onMouseEnter:i,onMouseOut:f,type:u}){return Q.jsx("circle",{onMouseDown:n,onMouseEnter:i,onMouseOut:f,className:yn([w0,`${w0}-${u}`]),cx:hN(o,t,e),cy:fN(r,t,e),r:t,stroke:"transparent",fill:"transparent"})}function dN({isReconnectable:e,reconnectRadius:o,edge:r,sourceX:t,sourceY:n,targetX:i,targetY:f,sourcePosition:u,targetPosition:h,onReconnect:s,onReconnectStart:d,onReconnectEnd:a,setReconnecting:l,setUpdateHover:p}){const v=en(),_=(b,S)=>{if(b.button!==0)return;const{autoPanOnConnect:E,domNode:A,isValidConnection:T,connectionMode:D,connectionRadius:O,lib:I,onConnectStart:M,onConnectEnd:B,cancelConnection:R,nodeLookup:L,rfId:z,panBy:K,updateConnection:U}=v.getState(),H=S.type==="target";l(!0),d==null||d(b,r,S.type);const G=(ne,fe)=>{l(!1),a==null||a(ne,r,S.type,fe)},J=ne=>s==null?void 0:s(r,ne);Hp.onPointerDown(b.nativeEvent,{autoPanOnConnect:E,connectionMode:D,connectionRadius:O,domNode:A,handleId:S.id,nodeId:S.nodeId,nodeLookup:L,isTarget:H,edgeUpdaterType:S.type,lib:I,flowId:z,cancelConnection:R,panBy:K,isValidConnection:T,onConnect:J,onConnectStart:M,onConnectEnd:B,onReconnectEnd:G,updateConnection:U,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},w=b=>_(b,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),x=b=>_(b,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),m=()=>p(!0),g=()=>p(!1);return Q.jsxs(Q.Fragment,{children:[(e===!0||e==="source")&&Q.jsx(b0,{position:u,centerX:t,centerY:n,radius:o,onMouseDown:w,onMouseEnter:m,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&Q.jsx(b0,{position:h,centerX:i,centerY:f,radius:o,onMouseDown:x,onMouseEnter:m,onMouseOut:g,type:"target"})]})}function pN({id:e,edgesFocusable:o,edgesReconnectable:r,elementsSelectable:t,onClick:n,onDoubleClick:i,onContextMenu:f,onMouseEnter:u,onMouseMove:h,onMouseLeave:s,reconnectRadius:d,onReconnect:a,onReconnectStart:l,onReconnectEnd:p,rfId:v,edgeTypes:_,noPanClassName:w,onError:x,disableKeyboardA11y:m}){let g=zt(q=>q.edgeLookup.get(e));const b=zt(q=>q.defaultEdgeOptions);g=b?{...b,...g}:g;let S=g.type||"default",E=(_==null?void 0:_[S])||_0[S];E===void 0&&(x==null||x("011",No.error011(S)),S="default",E=_0.default);const A=!!(g.focusable||o&&typeof g.focusable>"u"),T=typeof a<"u"&&(g.reconnectable||r&&typeof g.reconnectable>"u"),D=!!(g.selectable||t&&typeof g.selectable>"u"),O=ae.useRef(null),[I,M]=ae.useState(!1),[B,R]=ae.useState(!1),L=en(),{zIndex:z,sourceX:K,sourceY:U,targetX:H,targetY:G,sourcePosition:J,targetPosition:ne}=zt(ae.useCallback(q=>{const X=q.nodeLookup.get(g.source),Z=q.nodeLookup.get(g.target);if(!X||!Z)return{zIndex:g.zIndex,...x0};const te=aD({id:e,sourceNode:X,targetNode:Z,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:q.connectionMode,onError:x});return{zIndex:ZA({selected:g.selected,zIndex:g.zIndex,sourceNode:X,targetNode:Z,elevateOnSelect:q.elevateEdgesOnSelect}),...te||x0}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),fn),fe=ae.useMemo(()=>g.markerStart?`url('#${Up(g.markerStart,v)}')`:void 0,[g.markerStart,v]),ce=ae.useMemo(()=>g.markerEnd?`url('#${Up(g.markerEnd,v)}')`:void 0,[g.markerEnd,v]);if(g.hidden||K===null||U===null||H===null||G===null)return null;const ue=q=>{var re;const{addSelectedEdges:X,unselectNodesAndEdges:Z,multiSelectionActive:te}=L.getState();D&&(L.setState({nodesSelectionActive:!1}),g.selected&&te?(Z({nodes:[],edges:[g]}),(re=O.current)==null||re.blur()):X([e])),n&&n(q,g)},ge=i?q=>{i(q,{...g})}:void 0,xe=f?q=>{f(q,{...g})}:void 0,ye=u?q=>{u(q,{...g})}:void 0,he=h?q=>{h(q,{...g})}:void 0,$=s?q=>{s(q,{...g})}:void 0,k=q=>{var X;if(!m&&dx.includes(q.key)&&D){const{unselectNodesAndEdges:Z,addSelectedEdges:te}=L.getState();q.key==="Escape"?((X=O.current)==null||X.blur(),Z({edges:[g]})):te([e])}};return Q.jsx("svg",{style:{zIndex:z},children:Q.jsxs("g",{className:yn(["react-flow__edge",`react-flow__edge-${S}`,g.className,w,{selected:g.selected,animated:g.animated,inactive:!D&&!n,updating:I,selectable:D}]),onClick:ue,onDoubleClick:ge,onContextMenu:xe,onMouseEnter:ye,onMouseMove:he,onMouseLeave:$,onKeyDown:A?k:void 0,tabIndex:A?0:void 0,role:A?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":A?`${$x}-${v}`:void 0,ref:O,children:[!B&&Q.jsx(E,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:D,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:K,sourceY:U,targetX:H,targetY:G,sourcePosition:J,targetPosition:ne,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:fe,markerEnd:ce,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),T&&Q.jsx(dN,{edge:g,isReconnectable:T,reconnectRadius:d,onReconnect:a,onReconnectStart:l,onReconnectEnd:p,sourceX:K,sourceY:U,targetX:H,targetY:G,sourcePosition:J,targetPosition:ne,setUpdateHover:M,setReconnecting:R})]})})}const mN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function mw({defaultMarkerColor:e,onlyRenderVisibleElements:o,rfId:r,edgeTypes:t,noPanClassName:n,onReconnect:i,onEdgeContextMenu:f,onEdgeMouseEnter:u,onEdgeMouseMove:h,onEdgeMouseLeave:s,onEdgeClick:d,reconnectRadius:a,onEdgeDoubleClick:l,onReconnectStart:p,onReconnectEnd:v,disableKeyboardA11y:_}){const{edgesFocusable:w,edgesReconnectable:x,elementsSelectable:m,onError:g}=zt(mN,fn),b=eN(o);return Q.jsxs("div",{className:"react-flow__edges",children:[Q.jsx(iN,{defaultColor:e,rfId:r}),b.map(S=>Q.jsx(pN,{id:S,edgesFocusable:w,edgesReconnectable:x,elementsSelectable:m,noPanClassName:n,onReconnect:i,onContextMenu:f,onMouseEnter:u,onMouseMove:h,onMouseLeave:s,onClick:d,reconnectRadius:a,onDoubleClick:l,onReconnectStart:p,onReconnectEnd:v,rfId:r,onError:g,edgeTypes:t,disableKeyboardA11y:_},S))]})}mw.displayName="EdgeRenderer";const gN=ae.memo(mw),yN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function vN({children:e}){const o=zt(yN);return Q.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:o},children:e})}function _N(e){const o=Kh(),r=ae.useRef(!1);ae.useEffect(()=>{!r.current&&o.viewportInitialized&&e&&(setTimeout(()=>e(o),1),r.current=!0)},[e,o.viewportInitialized])}const xN=e=>{var o;return(o=e.panZoom)==null?void 0:o.syncViewport};function wN(e){const o=zt(xN),r=en();return ae.useEffect(()=>{e&&(o==null||o(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,o]),null}function bN(e){return e.connection.inProgress?{...e.connection,to:bl(e.connection.to,e.transform)}:{...e.connection}}function SN(e){return bN}function EN(e){const o=SN();return zt(o,fn)}const CN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function AN({containerStyle:e,style:o,type:r,component:t}){const{nodesConnectable:n,width:i,height:f,isValid:u,inProgress:h}=zt(CN,fn);return!(i&&n&&h)?null:Q.jsx("svg",{style:e,width:i,height:f,className:"react-flow__connectionline react-flow__container",children:Q.jsx("g",{className:yn(["react-flow__connection",mx(u)]),children:Q.jsx(gw,{style:o,type:r,CustomComponent:t,isValid:u})})})}const gw=({style:e,type:o=Zo.Bezier,CustomComponent:r,isValid:t})=>{const{inProgress:n,from:i,fromNode:f,fromHandle:u,fromPosition:h,to:s,toNode:d,toHandle:a,toPosition:l}=EN();if(!n)return;if(r)return Q.jsx(r,{connectionLineType:o,connectionLineStyle:e,fromNode:f,fromHandle:u,fromX:i.x,fromY:i.y,toX:s.x,toY:s.y,fromPosition:h,toPosition:l,connectionStatus:mx(t),toNode:d,toHandle:a});let p="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:h,targetX:s.x,targetY:s.y,targetPosition:l};switch(o){case Zo.Bezier:[p]=Tx(v);break;case Zo.SimpleBezier:[p]=rw(v);break;case Zo.Step:[p]=zp({...v,borderRadius:0});break;case Zo.SmoothStep:[p]=zp(v);break;default:[p]=Px(v)}return Q.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};gw.displayName="ConnectionLine";const DN={};function S0(e=DN){ae.useRef(e),en(),ae.useEffect(()=>{},[e])}function TN(){en(),ae.useRef(!1),ae.useEffect(()=>{},[])}function yw({nodeTypes:e,edgeTypes:o,onInit:r,onNodeClick:t,onEdgeClick:n,onNodeDoubleClick:i,onEdgeDoubleClick:f,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:s,onNodeContextMenu:d,onSelectionContextMenu:a,onSelectionStart:l,onSelectionEnd:p,connectionLineType:v,connectionLineStyle:_,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:m,selectionOnDrag:g,selectionMode:b,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:A,deleteKeyCode:T,onlyRenderVisibleElements:D,elementsSelectable:O,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:R,preventScrolling:L,defaultMarkerColor:z,zoomOnScroll:K,zoomOnPinch:U,panOnScroll:H,panOnScrollSpeed:G,panOnScrollMode:J,zoomOnDoubleClick:ne,panOnDrag:fe,onPaneClick:ce,onPaneMouseEnter:ue,onPaneMouseMove:ge,onPaneMouseLeave:xe,onPaneScroll:ye,onPaneContextMenu:he,paneClickDistance:$,nodeClickDistance:k,onEdgeContextMenu:q,onEdgeMouseEnter:X,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:re,onReconnect:ve,onReconnectStart:Oe,onReconnectEnd:Be,noDragClassName:He,noWheelClassName:at,noPanClassName:ct,disableKeyboardA11y:Nt,nodeExtent:bt,rfId:Qe,viewport:kt,onViewportChange:se}){return S0(e),S0(o),TN(),_N(r),wN(kt),Q.jsx(WT,{onPaneClick:ce,onPaneMouseEnter:ue,onPaneMouseMove:ge,onPaneMouseLeave:xe,onPaneContextMenu:he,onPaneScroll:ye,paneClickDistance:$,deleteKeyCode:T,selectionKeyCode:m,selectionOnDrag:g,selectionMode:b,onSelectionStart:l,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:A,elementsSelectable:O,zoomOnScroll:K,zoomOnPinch:U,zoomOnDoubleClick:ne,panOnScroll:H,panOnScrollSpeed:G,panOnScrollMode:J,panOnDrag:fe,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:R,onSelectionContextMenu:a,preventScrolling:L,noDragClassName:He,noWheelClassName:at,noPanClassName:ct,disableKeyboardA11y:Nt,onViewportChange:se,isControlledViewport:!!kt,children:Q.jsxs(vN,{children:[Q.jsx(gN,{edgeTypes:o,onEdgeClick:n,onEdgeDoubleClick:f,onReconnect:ve,onReconnectStart:Oe,onReconnectEnd:Be,onlyRenderVisibleElements:D,onEdgeContextMenu:q,onEdgeMouseEnter:X,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:re,defaultMarkerColor:z,noPanClassName:ct,disableKeyboardA11y:Nt,rfId:Qe}),Q.jsx(AN,{style:_,type:v,component:w,containerStyle:x}),Q.jsx("div",{className:"react-flow__edgelabel-renderer"}),Q.jsx(ZT,{nodeTypes:e,onNodeClick:t,onNodeDoubleClick:i,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:s,onNodeContextMenu:d,nodeClickDistance:k,onlyRenderVisibleElements:D,noPanClassName:ct,noDragClassName:He,disableKeyboardA11y:Nt,nodeExtent:bt,rfId:Qe}),Q.jsx("div",{className:"react-flow__viewport-portal"})]})})}yw.displayName="GraphView";const NN=ae.memo(yw),E0=({nodes:e,edges:o,defaultNodes:r,defaultEdges:t,width:n,height:i,fitView:f,nodeOrigin:u,nodeExtent:h}={})=>{const s=new Map,d=new Map,a=new Map,l=new Map,p=t??o??[],v=r??e??[],_=u??[0,0],w=h??rl;kx(a,l,p),Vp(v,s,d,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:!1});let x=[0,0,1];if(f&&n&&i){const m=wl(s,{filter:E=>!!((E.width||E.initialWidth)&&(E.height||E.initialHeight))}),{x:g,y:b,zoom:S}=bm(m,n,i,.5,2,.1);x=[g,b,S]}return{rfId:"1",width:0,height:0,transform:x,nodes:v,nodeLookup:s,parentLookup:d,edges:p,edgeLookup:l,connectionLookup:a,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:t!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:rl,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Hs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...px},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:JA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},PN=({nodes:e,edges:o,defaultNodes:r,defaultEdges:t,width:n,height:i,fitView:f,nodeOrigin:u,nodeExtent:h})=>XD((s,d)=>({...E0({nodes:e,edges:o,width:n,height:i,fitView:f,nodeOrigin:u,nodeExtent:h,defaultNodes:r,defaultEdges:t}),setNodes:a=>{const{nodeLookup:l,parentLookup:p,nodeOrigin:v,elevateNodesOnSelect:_}=d();Vp(a,l,p,{nodeOrigin:v,nodeExtent:h,elevateNodesOnSelect:_,checkEquality:!0}),s({nodes:a})},setEdges:a=>{const{connectionLookup:l,edgeLookup:p}=d();kx(l,p,a),s({edges:a})},setDefaultNodesAndEdges:(a,l)=>{if(a){const{setNodes:p}=d();p(a),s({hasDefaultNodes:!0})}if(l){const{setEdges:p}=d();p(l),s({hasDefaultEdges:!0})}},updateNodeInternals:(a,l={triggerFitView:!0})=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:_,fitViewOnInit:w,fitViewDone:x,fitViewOnInitOptions:m,domNode:g,nodeOrigin:b,nodeExtent:S,debug:E,fitViewSync:A}=d(),{changes:T,updatedInternals:D}=fD(a,v,_,g,b,S);if(D){if(lD(v,_,{nodeOrigin:b,nodeExtent:S}),l.triggerFitView){let O=x;!x&&w&&(O=A({...m,nodes:m==null?void 0:m.nodes})),s({fitViewDone:O})}else s({});(T==null?void 0:T.length)>0&&(E&&console.log("React Flow: trigger node changes",T),p==null||p(T))}},updateNodePositions:(a,l=!1)=>{const p=[],v=[];for(const[_,w]of a){const x=!!(w!=null&&w.expandParent&&(w!=null&&w.parentId)&&(w!=null&&w.position)),m={id:_,type:"position",position:x?{x:Math.max(0,w.position.x),y:Math.max(0,w.position.y)}:w.position,dragging:l};x&&p.push({id:_,parentId:w.parentId,rect:{...w.internals.positionAbsolute,width:w.measured.width,height:w.measured.height}}),v.push(m)}if(p.length>0){const{nodeLookup:_,parentLookup:w,nodeOrigin:x}=d(),m=Am(p,_,w,x);v.push(...m)}d().triggerNodeChanges(v)},triggerNodeChanges:a=>{const{onNodesChange:l,setNodes:p,nodes:v,hasDefaultNodes:_,debug:w}=d();if(a!=null&&a.length){if(_){const x=qx(a,v);p(x)}w&&console.log("React Flow: trigger node changes",a),l==null||l(a)}},triggerEdgeChanges:a=>{const{onEdgesChange:l,setEdges:p,edges:v,hasDefaultEdges:_,debug:w}=d();if(a!=null&&a.length){if(_){const x=Xx(a,v);p(x)}w&&console.log("React Flow: trigger edge changes",a),l==null||l(a)}},addSelectedNodes:a=>{const{multiSelectionActive:l,edgeLookup:p,nodeLookup:v,triggerNodeChanges:_,triggerEdgeChanges:w}=d();if(l){const x=a.map(m=>Ia(m,!0));_(x);return}_(Ls(v,new Set([...a]),!0)),w(Ls(p))},addSelectedEdges:a=>{const{multiSelectionActive:l,edgeLookup:p,nodeLookup:v,triggerNodeChanges:_,triggerEdgeChanges:w}=d();if(l){const x=a.map(m=>Ia(m,!0));w(x);return}w(Ls(p,new Set([...a]))),_(Ls(v,new Set,!0))},unselectNodesAndEdges:({nodes:a,edges:l}={})=>{const{edges:p,nodes:v,nodeLookup:_,triggerNodeChanges:w,triggerEdgeChanges:x}=d(),m=a||v,g=l||p,b=m.map(E=>{const A=_.get(E.id);return A&&(A.selected=!1),Ia(E.id,!1)}),S=g.map(E=>Ia(E.id,!1));w(b),x(S)},setMinZoom:a=>{const{panZoom:l,maxZoom:p}=d();l==null||l.setScaleExtent([a,p]),s({minZoom:a})},setMaxZoom:a=>{const{panZoom:l,minZoom:p}=d();l==null||l.setScaleExtent([p,a]),s({maxZoom:a})},setTranslateExtent:a=>{var l;(l=d().panZoom)==null||l.setTranslateExtent(a),s({translateExtent:a})},setPaneClickDistance:a=>{var l;(l=d().panZoom)==null||l.setClickDistance(a)},resetSelectedElements:()=>{const{edges:a,nodes:l,triggerNodeChanges:p,triggerEdgeChanges:v}=d(),_=l.reduce((x,m)=>m.selected?[...x,Ia(m.id,!1)]:x,[]),w=a.reduce((x,m)=>m.selected?[...x,Ia(m.id,!1)]:x,[]);p(_),v(w)},setNodeExtent:a=>{const{nodes:l,nodeLookup:p,parentLookup:v,nodeOrigin:_,elevateNodesOnSelect:w,nodeExtent:x}=d();a[0][0]===x[0][0]&&a[0][1]===x[0][1]&&a[1][0]===x[1][0]&&a[1][1]===x[1][1]||(Vp(l,p,v,{nodeOrigin:_,nodeExtent:a,elevateNodesOnSelect:w,checkEquality:!1}),s({nodeExtent:a}))},panBy:a=>{const{transform:l,width:p,height:v,panZoom:_,translateExtent:w}=d();return dD({delta:a,panZoom:_,transform:l,translateExtent:w,width:p,height:v})},fitView:a=>{const{panZoom:l,width:p,height:v,minZoom:_,maxZoom:w,nodeLookup:x}=d();if(!l)return Promise.resolve(!1);const m=Rp(x,a);return Mp({nodes:m,width:p,height:v,panZoom:l,minZoom:_,maxZoom:w},a)},fitViewSync:a=>{const{panZoom:l,width:p,height:v,minZoom:_,maxZoom:w,nodeLookup:x}=d();if(!l)return!1;const m=Rp(x,a);return Mp({nodes:m,width:p,height:v,panZoom:l,minZoom:_,maxZoom:w},a),m.size>0},cancelConnection:()=>{s({connection:{...px}})},updateConnection:a=>{s({connection:a})},reset:()=>s({...E0()})}),Object.is);function vw({initialNodes:e,initialEdges:o,defaultNodes:r,defaultEdges:t,initialWidth:n,initialHeight:i,fitView:f,nodeOrigin:u,nodeExtent:h,children:s}){const[d]=ae.useState(()=>PN({nodes:e,edges:o,defaultNodes:r,defaultEdges:t,width:n,height:i,fitView:f,nodeOrigin:u,nodeExtent:h}));return Q.jsx(YD,{value:d,children:Q.jsx(_T,{children:s})})}function ON({children:e,nodes:o,edges:r,defaultNodes:t,defaultEdges:n,width:i,height:f,fitView:u,nodeOrigin:h,nodeExtent:s}){return ae.useContext(Xh)?Q.jsx(Q.Fragment,{children:e}):Q.jsx(vw,{initialNodes:o,initialEdges:r,defaultNodes:t,defaultEdges:n,initialWidth:i,initialHeight:f,fitView:u,nodeOrigin:h,nodeExtent:s,children:e})}const kN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function IN({nodes:e,edges:o,defaultNodes:r,defaultEdges:t,className:n,nodeTypes:i,edgeTypes:f,onNodeClick:u,onEdgeClick:h,onInit:s,onMove:d,onMoveStart:a,onMoveEnd:l,onConnect:p,onConnectStart:v,onConnectEnd:_,onClickConnectStart:w,onClickConnectEnd:x,onNodeMouseEnter:m,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:S,onNodeDoubleClick:E,onNodeDragStart:A,onNodeDrag:T,onNodeDragStop:D,onNodesDelete:O,onEdgesDelete:I,onDelete:M,onSelectionChange:B,onSelectionDragStart:R,onSelectionDrag:L,onSelectionDragStop:z,onSelectionContextMenu:K,onSelectionStart:U,onSelectionEnd:H,onBeforeDelete:G,connectionMode:J,connectionLineType:ne=Zo.Bezier,connectionLineStyle:fe,connectionLineComponent:ce,connectionLineContainerStyle:ue,deleteKeyCode:ge="Backspace",selectionKeyCode:xe="Shift",selectionOnDrag:ye=!1,selectionMode:he=ol.Full,panActivationKeyCode:$="Space",multiSelectionKeyCode:k=Dh()?"Meta":"Control",zoomActivationKeyCode:q=Dh()?"Meta":"Control",snapToGrid:X,snapGrid:Z,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:re,nodesDraggable:ve,nodesConnectable:Oe,nodesFocusable:Be,nodeOrigin:He=Wx,edgesFocusable:at,edgesReconnectable:ct,elementsSelectable:Nt=!0,defaultViewport:bt=lT,minZoom:Qe=.5,maxZoom:kt=2,translateExtent:se=rl,preventScrolling:pt=!0,nodeExtent:yt,defaultMarkerColor:it="#b1b1b7",zoomOnScroll:Ce=!0,zoomOnPinch:ze=!0,panOnScroll:Ze=!1,panOnScrollSpeed:Xe=.5,panOnScrollMode:Ve=za.Free,zoomOnDoubleClick:St=!0,panOnDrag:lt=!0,onPaneClick:Et,onPaneMouseEnter:$e,onPaneMouseMove:Gt,onPaneMouseLeave:Xt,onPaneScroll:Lt,onPaneContextMenu:mn,paneClickDistance:Mr=0,nodeClickDistance:ci=0,children:Le,onReconnect:We,onReconnectStart:_t,onReconnectEnd:cn,onEdgeContextMenu:Pn,onEdgeDoubleClick:Vt,onEdgeMouseEnter:Yt,onEdgeMouseMove:Zs,onEdgeMouseLeave:wr,reconnectRadius:Lr=10,onNodesChange:jr,onEdgesChange:ea,noDragClassName:br="nodrag",noWheelClassName:ho="nowheel",noPanClassName:ar="nopan",fitView:$n,fitViewOptions:Ka,connectOnClick:sr,attributionPosition:Ya,proOptions:Sr,defaultEdgeOptions:ta,elevateNodesOnSelect:hi,elevateEdgesOnSelect:Jt,disableKeyboardA11y:Er=!1,autoPanOnConnect:ur,autoPanOnNodeDrag:Qt,autoPanSpeed:fo,connectionRadius:po,isValidConnection:fi,onError:mo,style:Br,id:di,nodeDragThreshold:zr,viewport:Wn,onViewportChange:Rt,width:On,height:Ja,colorMode:Qa="light",debug:Wt,...Cr},Ar){const kn=di||"1",go=dT(Qa);return Q.jsx("div",{"data-testid":"rf__wrapper",...Cr,style:{...Br,...kN},ref:Ar,className:yn(["react-flow",n,go]),id:di,children:Q.jsxs(ON,{nodes:e,edges:o,width:On,height:Ja,fitView:$n,nodeOrigin:He,nodeExtent:yt,children:[Q.jsx(NN,{onInit:s,onNodeClick:u,onEdgeClick:h,onNodeMouseEnter:m,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:S,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:f,connectionLineType:ne,connectionLineStyle:fe,connectionLineComponent:ce,connectionLineContainerStyle:ue,selectionKeyCode:xe,selectionOnDrag:ye,selectionMode:he,deleteKeyCode:ge,multiSelectionKeyCode:k,panActivationKeyCode:$,zoomActivationKeyCode:q,onlyRenderVisibleElements:te,defaultViewport:bt,translateExtent:se,minZoom:Qe,maxZoom:kt,preventScrolling:pt,zoomOnScroll:Ce,zoomOnPinch:ze,zoomOnDoubleClick:St,panOnScroll:Ze,panOnScrollSpeed:Xe,panOnScrollMode:Ve,panOnDrag:lt,onPaneClick:Et,onPaneMouseEnter:$e,onPaneMouseMove:Gt,onPaneMouseLeave:Xt,onPaneScroll:Lt,onPaneContextMenu:mn,paneClickDistance:Mr,nodeClickDistance:ci,onSelectionContextMenu:K,onSelectionStart:U,onSelectionEnd:H,onReconnect:We,onReconnectStart:_t,onReconnectEnd:cn,onEdgeContextMenu:Pn,onEdgeDoubleClick:Vt,onEdgeMouseEnter:Yt,onEdgeMouseMove:Zs,onEdgeMouseLeave:wr,reconnectRadius:Lr,defaultMarkerColor:it,noDragClassName:br,noWheelClassName:ho,noPanClassName:ar,rfId:kn,disableKeyboardA11y:Er,nodeExtent:yt,viewport:Wn,onViewportChange:Rt}),Q.jsx(fT,{nodes:e,edges:o,defaultNodes:r,defaultEdges:t,onConnect:p,onConnectStart:v,onConnectEnd:_,onClickConnectStart:w,onClickConnectEnd:x,nodesDraggable:ve,nodesConnectable:Oe,nodesFocusable:Be,edgesFocusable:at,edgesReconnectable:ct,elementsSelectable:Nt,elevateNodesOnSelect:hi,elevateEdgesOnSelect:Jt,minZoom:Qe,maxZoom:kt,nodeExtent:yt,onNodesChange:jr,onEdgesChange:ea,snapToGrid:X,snapGrid:Z,connectionMode:J,translateExtent:se,connectOnClick:sr,defaultEdgeOptions:ta,fitView:$n,fitViewOptions:Ka,onNodesDelete:O,onEdgesDelete:I,onDelete:M,onNodeDragStart:A,onNodeDrag:T,onNodeDragStop:D,onSelectionDrag:L,onSelectionDragStart:R,onSelectionDragStop:z,onMove:d,onMoveStart:a,onMoveEnd:l,noPanClassName:ar,nodeOrigin:He,rfId:kn,autoPanOnConnect:ur,autoPanOnNodeDrag:Qt,autoPanSpeed:fo,onError:mo,connectionRadius:po,isValidConnection:fi,selectNodesOnDrag:re,nodeDragThreshold:zr,onBeforeDelete:G,paneClickDistance:Mr,debug:Wt}),Q.jsx(uT,{onSelectionChange:B}),Le,Q.jsx(rT,{proOptions:Sr,position:Ya}),Q.jsx(tT,{rfId:kn,disableKeyboardA11y:Er})]})})}var FN=Kx(IN);function RN(){const e=en();return ae.useCallback(o=>{const{domNode:r,updateNodeInternals:t}=e.getState(),n=Array.isArray(o)?o:[o],i=new Map;n.forEach(f=>{const u=r==null?void 0:r.querySelector(`.react-flow__node[data-id="${f}"]`);u&&i.set(f,{id:f,nodeElement:u,force:!0})}),requestAnimationFrame(()=>t(i,{triggerFitView:!1}))},[])}function MN({onStart:e,onChange:o,onEnd:r}){const t=en();ae.useEffect(()=>{t.setState({onViewportChangeStart:e})},[e]),ae.useEffect(()=>{t.setState({onViewportChange:o})},[o]),ae.useEffect(()=>{t.setState({onViewportChangeEnd:r})},[r])}const LN=No.error014();function jN({id:e,handleType:o,handleId:r,onConnect:t,onDisconnect:n}={}){const i=Jh(),f=e??i;if(!f)throw new Error(LN);const u=ae.useRef(null),h=zt(s=>s.connectionLookup.get(`${f}${o?r?`-${o}-${r}`:`-${o}`:""}`),WA);return ae.useEffect(()=>{if(u.current&&u.current!==h){const s=h??new Map;Lv(u.current,s,n),Lv(s,u.current,t)}u.current=h??new Map},[h,t,n]),ae.useMemo(()=>Array.from((h==null?void 0:h.values())??[]),[h])}function BN({dimensions:e,lineWidth:o,variant:r,className:t}){return Q.jsx("path",{strokeWidth:o,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:yn(["react-flow__background-pattern",r,t])})}function zN({radius:e,className:o}){return Q.jsx("circle",{cx:e,cy:e,r:e,className:yn(["react-flow__background-pattern","dots",o])})}var Ui;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ui||(Ui={}));const UN={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},VN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function _w({id:e,variant:o=Ui.Dots,gap:r=20,size:t,lineWidth:n=1,offset:i=0,color:f,bgColor:u,style:h,className:s,patternClassName:d}){const a=ae.useRef(null),{transform:l,patternId:p}=zt(VN,fn),v=t||UN[o],_=o===Ui.Dots,w=o===Ui.Cross,x=Array.isArray(r)?r:[r,r],m=[x[0]*l[2]||1,x[1]*l[2]||1],g=v*l[2],b=Array.isArray(i)?i:[i,i],S=w?[g,g]:m,E=[b[0]*l[2]||1+S[0]/2,b[1]*l[2]||1+S[1]/2],A=`${p}${e||""}`;return Q.jsxs("svg",{className:yn(["react-flow__background",s]),style:{...h,...Yh,"--xy-background-color-props":u,"--xy-background-pattern-color-props":f},ref:a,"data-testid":"rf__background",children:[Q.jsx("pattern",{id:A,x:l[0]%m[0],y:l[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:_?Q.jsx(zN,{radius:g/2,className:d}):Q.jsx(BN,{dimensions:S,lineWidth:n,variant:o,className:d})}),Q.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}_w.displayName="Background";const HN=ae.memo(_w);function $N(){return Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:Q.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function WN(){return Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:Q.jsx("path",{d:"M0 0h32v4.2H0z"})})}function GN(){return Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:Q.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 qN(){return Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:Q.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 XN(){return Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:Q.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 Gc({children:e,className:o,...r}){return Q.jsx("button",{type:"button",className:yn(["react-flow__controls-button",o]),...r,children:e})}const KN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function xw({style:e,showZoom:o=!0,showFitView:r=!0,showInteractive:t=!0,fitViewOptions:n,onZoomIn:i,onZoomOut:f,onFitView:u,onInteractiveChange:h,className:s,children:d,position:a="bottom-left",orientation:l="vertical","aria-label":p="React Flow controls"}){const v=en(),{isInteractive:_,minZoomReached:w,maxZoomReached:x}=zt(KN,fn),{zoomIn:m,zoomOut:g,fitView:b}=Kh(),S=()=>{m(),i==null||i()},E=()=>{g(),f==null||f()},A=()=>{b(n),u==null||u()},T=()=>{v.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),h==null||h(!_)},D=l==="horizontal"?"horizontal":"vertical";return Q.jsxs(Dm,{className:yn(["react-flow__controls",D,s]),position:a,style:e,"data-testid":"rf__controls","aria-label":p,children:[o&&Q.jsxs(Q.Fragment,{children:[Q.jsx(Gc,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:x,children:Q.jsx($N,{})}),Q.jsx(Gc,{onClick:E,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:w,children:Q.jsx(WN,{})})]}),r&&Q.jsx(Gc,{className:"react-flow__controls-fitview",onClick:A,title:"fit view","aria-label":"fit view",children:Q.jsx(GN,{})}),t&&Q.jsx(Gc,{className:"react-flow__controls-interactive",onClick:T,title:"toggle interactivity","aria-label":"toggle interactivity",children:_?Q.jsx(XN,{}):Q.jsx(qN,{})}),d]})}xw.displayName="Controls";const YN=ae.memo(xw);function JN({id:e,x:o,y:r,width:t,height:n,style:i,color:f,strokeColor:u,strokeWidth:h,className:s,borderRadius:d,shapeRendering:a,selected:l,onClick:p}){const{background:v,backgroundColor:_}=i||{},w=f||v||_;return Q.jsx("rect",{className:yn(["react-flow__minimap-node",{selected:l},s]),x:o,y:r,rx:d,ry:d,width:t,height:n,style:{fill:w,stroke:u,strokeWidth:h},shapeRendering:a,onClick:p?x=>p(x,e):void 0})}const QN=ae.memo(JN),ZN=e=>e.nodes.map(o=>o.id),Qd=e=>e instanceof Function?e:()=>e;function eP({nodeStrokeColor:e,nodeColor:o,nodeClassName:r="",nodeBorderRadius:t=5,nodeStrokeWidth:n,nodeComponent:i=QN,onClick:f}){const u=zt(ZN,fn),h=Qd(o),s=Qd(e),d=Qd(r),a=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return Q.jsx(Q.Fragment,{children:u.map(l=>Q.jsx(nP,{id:l,nodeColorFunc:h,nodeStrokeColorFunc:s,nodeClassNameFunc:d,nodeBorderRadius:t,nodeStrokeWidth:n,NodeComponent:i,onClick:f,shapeRendering:a},l))})}function tP({id:e,nodeColorFunc:o,nodeStrokeColorFunc:r,nodeClassNameFunc:t,nodeBorderRadius:n,nodeStrokeWidth:i,shapeRendering:f,NodeComponent:u,onClick:h}){const{node:s,x:d,y:a,width:l,height:p}=zt(v=>{const _=v.nodeLookup.get(e),{x:w,y:x}=_.internals.positionAbsolute,{width:m,height:g}=ui(_);return{node:_,x:w,y:x,width:m,height:g}},fn);return!s||s.hidden||!Sx(s)?null:Q.jsx(u,{x:d,y:a,width:l,height:p,style:s.style,selected:!!s.selected,className:t(s),color:o(s),borderRadius:n,strokeColor:r(s),strokeWidth:i,shapeRendering:f,onClick:h,id:s.id})}const nP=ae.memo(tP);var rP=ae.memo(eP);const oP=200,iP=150,aP=e=>{const o={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:o,boundingRect:e.nodeLookup.size>0?wx(wl(e.nodeLookup),o):o,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},sP="react-flow__minimap-desc";function ww({style:e,className:o,nodeStrokeColor:r,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:f,nodeComponent:u,bgColor:h,maskColor:s,maskStrokeColor:d,maskStrokeWidth:a,position:l="bottom-right",onClick:p,onNodeClick:v,pannable:_=!1,zoomable:w=!1,ariaLabel:x="React Flow mini map",inversePan:m,zoomStep:g=10,offsetScale:b=5}){const S=en(),E=ae.useRef(null),{boundingRect:A,viewBB:T,rfId:D,panZoom:O,translateExtent:I,flowWidth:M,flowHeight:B}=zt(aP,fn),R=(e==null?void 0:e.width)??oP,L=(e==null?void 0:e.height)??iP,z=A.width/R,K=A.height/L,U=Math.max(z,K),H=U*R,G=U*L,J=b*U,ne=A.x-(H-A.width)/2-J,fe=A.y-(G-A.height)/2-J,ce=H+J*2,ue=G+J*2,ge=`${sP}-${D}`,xe=ae.useRef(0),ye=ae.useRef();xe.current=U,ae.useEffect(()=>{if(E.current&&O)return ye.current=wD({domNode:E.current,panZoom:O,getTransform:()=>S.getState().transform,getViewScale:()=>xe.current}),()=>{var k;(k=ye.current)==null||k.destroy()}},[O]),ae.useEffect(()=>{var k;(k=ye.current)==null||k.update({translateExtent:I,width:M,height:B,inversePan:m,pannable:_,zoomStep:g,zoomable:w})},[_,w,m,g,I,M,B]);const he=p?k=>{var Z;const[q,X]=((Z=ye.current)==null?void 0:Z.pointer(k))||[0,0];p(k,{x:q,y:X})}:void 0,$=v?ae.useCallback((k,q)=>{const X=S.getState().nodeLookup.get(q);v(k,X)},[]):void 0;return Q.jsx(Dm,{position:l,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof a=="number"?a*U:void 0,"--xy-minimap-node-background-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof f=="string"?f:void 0},className:yn(["react-flow__minimap",o]),"data-testid":"rf__minimap",children:Q.jsxs("svg",{width:R,height:L,viewBox:`${ne} ${fe} ${ce} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ge,ref:E,onClick:he,children:[x&&Q.jsx("title",{id:ge,children:x}),Q.jsx(rP,{onClick:$,nodeColor:t,nodeStrokeColor:r,nodeBorderRadius:i,nodeClassName:n,nodeStrokeWidth:f,nodeComponent:u}),Q.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-J},${fe-J}h${ce+J*2}v${ue+J*2}h${-ce-J*2}z M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ww.displayName="MiniMap";ae.memo(ww);function uP({nodeId:e,position:o,variant:r=Ku.Handle,className:t,style:n={},children:i,color:f,minWidth:u=10,minHeight:h=10,maxWidth:s=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:a=!1,shouldResize:l,onResizeStart:p,onResize:v,onResizeEnd:_}){const w=Jh(),x=typeof e=="string"?e:w,m=en(),g=ae.useRef(null),b=r===Ku.Line?"right":"bottom-right",S=o??b,E=ae.useRef(null);ae.useEffect(()=>{if(!(!g.current||!x))return E.current||(E.current=MD({domNode:g.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:O,transform:I,snapGrid:M,snapToGrid:B,nodeOrigin:R,domNode:L}=m.getState();return{nodeLookup:O,transform:I,snapGrid:M,snapToGrid:B,nodeOrigin:R,paneDomNode:L}},onChange:(O,I)=>{const{triggerNodeChanges:M,nodeLookup:B,parentLookup:R,nodeOrigin:L}=m.getState(),z=[],K={x:O.x,y:O.y},U=B.get(x);if(U&&U.expandParent&&U.parentId){const H=U.origin??L,G=O.width??U.measured.width,J=O.height??U.measured.height,ne={id:U.id,parentId:U.parentId,rect:{width:G,height:J,...Ex({x:O.x??U.position.x,y:O.y??U.position.y},{width:G,height:J},U.parentId,B,H)}},fe=Am([ne],B,R,L);z.push(...fe),K.x=O.x?Math.max(H[0]*G,O.x):void 0,K.y=O.y?Math.max(H[1]*J,O.y):void 0}if(K.x!==void 0&&K.y!==void 0){const H={id:x,type:"position",position:{...K}};z.push(H)}if(O.width!==void 0&&O.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:O.width,height:O.height}};z.push(H)}for(const H of I){const G={...H,type:"position"};z.push(G)}M(z)},onEnd:()=>{const O={id:x,type:"dimensions",resizing:!1};m.getState().triggerNodeChanges([O])}})),E.current.update({controlPosition:S,boundaries:{minWidth:u,minHeight:h,maxWidth:s,maxHeight:d},keepAspectRatio:a,onResizeStart:p,onResize:v,onResizeEnd:_,shouldResize:l}),()=>{var O;(O=E.current)==null||O.destroy()}},[S,u,h,s,d,a,p,v,_,l]);const A=S.split("-"),T=r===Ku.Line?"borderColor":"backgroundColor",D=f?{...n,[T]:f}:n;return Q.jsx("div",{className:yn(["react-flow__resize-control","nodrag",...A,r,t]),ref:g,style:D,children:i})}ae.memo(uP);function bw(e,o){let r;try{r=e()}catch{return}return{getItem:n=>{var i;const f=h=>h===null?null:JSON.parse(h,void 0),u=(i=r.getItem(n))!=null?i:null;return u instanceof Promise?u.then(f):f(u)},setItem:(n,i)=>r.setItem(n,JSON.stringify(i,void 0)),removeItem:n=>r.removeItem(n)}}const Wp=e=>o=>{try{const r=e(o);return r instanceof Promise?r:{then(t){return Wp(t)(r)},catch(t){return this}}}catch(r){return{then(t){return this},catch(t){return Wp(t)(r)}}}},lP=(e,o)=>(r,t,n)=>{let i={storage:bw(()=>localStorage),partialize:_=>_,version:0,merge:(_,w)=>({...w,..._}),...o},f=!1;const u=new Set,h=new Set;let s=i.storage;if(!s)return e((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(..._)},t,n);const d=()=>{const _=i.partialize({...t()});return s.setItem(i.name,{state:_,version:i.version})},a=n.setState;n.setState=(_,w)=>{a(_,w),d()};const l=e((..._)=>{r(..._),d()},t,n);n.getInitialState=()=>l;let p;const v=()=>{var _,w;if(!s)return;f=!1,u.forEach(m=>{var g;return m((g=t())!=null?g:l)});const x=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(_=t())!=null?_:l))||void 0;return Wp(s.getItem.bind(s))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate){const g=i.migrate(m.state,m.version);return g instanceof Promise?g.then(b=>[!0,b]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,m.state];return[!1,void 0]}).then(m=>{var g;const[b,S]=m;if(p=i.merge(S,(g=t())!=null?g:l),r(p,!0),b)return d()}).then(()=>{x==null||x(p,void 0),p=t(),f=!0,h.forEach(m=>m(p))}).catch(m=>{x==null||x(void 0,m)})};return n.persist={setOptions:_=>{i={...i,..._},_.storage&&(s=_.storage)},clearStorage:()=>{s==null||s.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>f,onHydrate:_=>(u.add(_),()=>{u.delete(_)}),onFinishHydration:_=>(h.add(_),()=>{h.delete(_)})},i.skipHydration||v(),p||l},cP=lP,C0=e=>Symbol.iterator in e,A0=e=>"entries"in e,D0=(e,o)=>{const r=e instanceof Map?e:new Map(e.entries()),t=o instanceof Map?o:new Map(o.entries());if(r.size!==t.size)return!1;for(const[n,i]of r)if(!Object.is(i,t.get(n)))return!1;return!0},hP=(e,o)=>{const r=e[Symbol.iterator](),t=o[Symbol.iterator]();let n=r.next(),i=t.next();for(;!n.done&&!i.done;){if(!Object.is(n.value,i.value))return!1;n=r.next(),i=t.next()}return!!n.done&&!!i.done};function fP(e,o){return Object.is(e,o)?!0:typeof e!="object"||e===null||typeof o!="object"||o===null?!1:!C0(e)||!C0(o)?D0({entries:()=>Object.entries(e)},{entries:()=>Object.entries(o)}):A0(e)&&A0(o)?D0(e,o):hP(e,o)}function Sw(e){const o=Nn.useRef(void 0);return r=>{const t=e(r);return fP(o.current,t)?o.current:o.current=t}}const T0={x:0,y:0,zoom:.5},N0=p1()(cP((e,o)=>({flows:{},flowMetadata:{},currentFlowId:"",nodeTypes:{},createFlow:(r,t,n,i)=>{e(f=>({flows:{...f.flows,[r]:{nodes:n,edges:i,viewport:T0}},currentFlowId:r,flowMetadata:{...f.flowMetadata,[r]:t}}))},updateFlowMetadata:(r,t)=>{o().flows[r]&&e(n=>({flowMetadata:{...n.flowMetadata,[r]:{...n.flowMetadata[r],...t}}}))},setCurrentFlow:r=>{o().flows[r]&&e({currentFlowId:r})},updateNodeTypes:r=>{e({nodeTypes:r})},renameCurrentFlow:r=>{const{currentFlowId:t,flows:n}=o();if(!n[t])return;const i={...n,[r]:n[t]};delete i[t],e({flows:i,currentFlowId:r})},deleteFlow:r=>{e(t=>{const n={...t.flows},i={...t.flowMetadata};return delete n[r],delete i[r],{flows:n,flowMetadata:i,currentFlowId:Object.keys(n)[0]||""}})},currentFlow:()=>o().flows[o().currentFlowId]||null,onNodesChange:r=>{e(t=>{const n=t.flows[t.currentFlowId];return n?{flows:{...t.flows,[t.currentFlowId]:{...n,nodes:qx(r,n.nodes)}}}:{}})},onEdgesChange:r=>{e(t=>{const n=t.flows[t.currentFlowId];return n?{flows:{...t.flows,[t.currentFlowId]:{...n,edges:Xx(r,n.edges)}}}:{}})},onConnect:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],edges:Bp({...r,type:"smoothstep"},n[t].edges)}}})},setNodes:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],nodes:r}}})},setEdges:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],edges:r}}})},addEdge:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],edges:Bp({...r,type:"smoothstep"},n[t].edges)}}})},setViewport:r=>{e(t=>{const n=t.flows[t.currentFlowId];return n?{flows:{...t.flows,[t.currentFlowId]:{...n,viewport:r}}}:{}})},clearState:()=>{const{currentFlowId:r,flows:t}=o();t[r]&&e({flows:{...t,[r]:{nodes:[],edges:[],viewport:T0}}})},addNode:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],nodes:[...n[t].nodes,r]}}})},removeNode:r=>{const{currentFlowId:t,flows:n}=o();n[t]&&e({flows:{...n,[t]:{...n[t],nodes:n[t].nodes.filter(i=>i.id!==r)}}})},updateNodePosition:(r,t)=>{const{currentFlowId:n,flows:i}=o();i[n]&&e({flows:{...i,[n]:{...i[n],nodes:i[n].nodes.map(f=>f.id===r?{...f,position:t}:f)}}})},updateNodeData:(r,t)=>{const{currentFlowId:n,flows:i}=o();i[n]&&e({flows:{...i,[n]:{...i[n],nodes:i[n].nodes.map(f=>f.id===r?{...f,data:{...f.data,...t}}:f)}}})}}),{name:"multi-flow-state",storage:bw(()=>localStorage),partialize:e=>({flows:e.flows,currentFlowId:e.currentFlowId,flowMetadata:e.flowMetadata})})),Ew=e=>({flows:e.flows,currentFlowId:e.currentFlowId,flowMetadata:e.flowMetadata,updateFlowMetadata:e.updateFlowMetadata,createFlow:e.createFlow,setCurrentFlow:e.setCurrentFlow,renameCurrentFlow:e.renameCurrentFlow,deleteFlow:e.deleteFlow,currentFlow:e.currentFlow,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect,addNode:e.addNode,updateNodePosition:e.updateNodePosition,addEdge:e.addEdge,setViewport:e.setViewport,clearStore:e.clearStore,updateNodeData:e.updateNodeData,updateNodeTypes:e.updateNodeTypes,nodeTypes:e.nodeTypes,setNodes:e.setNodes,setEdges:e.setEdges}),dP=e=>({nodes:e.flows[e.currentFlowId].nodes,edges:e.flows[e.currentFlowId].edges,viewport:e.flows[e.currentFlowId].viewport,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect,addNode:e.addNode,updateNodePosition:e.updateNodePosition,addEdge:e.addEdge,setViewport:e.setViewport,updateNodeData:e.updateNodeData,updateNodeTypes:e.updateNodeTypes,nodeTypes:e.nodeTypes,setNodes:e.setNodes,setEdges:e.setEdges}),lo=()=>{const e=VL(),o=N0(Sw(Ew));return e!=null&&e.isParent?dP(o):N0()},pP=Symbol(),Nm=Symbol(),qu="a",Cw="f",P0="p",Aw="c",Dw="t",Tw="h",ch="w",Nw="o",Pw="k";let mP=(e,o)=>new Proxy(e,o);const Gp=Object.getPrototypeOf,qp=new WeakMap,Ow=e=>e&&(qp.has(e)?qp.get(e):Gp(e)===Object.prototype||Gp(e)===Array.prototype),O0=e=>typeof e=="object"&&e!==null,gP=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(o=>!o.configurable&&!o.writable),yP=e=>{if(Array.isArray(e))return Array.from(e);const o=Object.getOwnPropertyDescriptors(e);return Object.values(o).forEach(r=>{r.configurable=!0}),Object.create(Gp(e),o)},vP=(e,o)=>{const r={[Cw]:o};let t=!1;const n=(u,h)=>{if(!t){let s=r[qu].get(e);if(s||(s={},r[qu].set(e,s)),u===ch)s[ch]=!0;else{let d=s[u];d||(d=new Set,s[u]=d),d.add(h)}}},i=()=>{t=!0,r[qu].delete(e)},f={get(u,h){return h===Nm?e:(n(Pw,h),Iw(Reflect.get(u,h),r[qu],r[Aw],r[Dw]))},has(u,h){return h===pP?(i(),!0):(n(Tw,h),Reflect.has(u,h))},getOwnPropertyDescriptor(u,h){return n(Nw,h),Reflect.getOwnPropertyDescriptor(u,h)},ownKeys(u){return n(ch),Reflect.ownKeys(u)}};return o&&(f.set=f.deleteProperty=()=>!1),[f,r]},kw=e=>e[Nm]||e,Iw=(e,o,r,t)=>{if(!Ow(e))return e;let n=t&&t.get(e);if(!n){const h=kw(e);gP(h)?n=[h,yP(h)]:n=[h],t==null||t.set(e,n)}const[i,f]=n;let u=r&&r.get(i);return(!u||u[1][Cw]!==!!f)&&(u=vP(i,!!f),u[1][P0]=mP(f||i,u[0]),r&&r.set(i,u)),u[1][qu]=o,u[1][Aw]=r,u[1][Dw]=t,u[1][P0]},_P=(e,o)=>{const r=Reflect.ownKeys(e),t=Reflect.ownKeys(o);return r.length!==t.length||r.some((n,i)=>n!==t[i])},Fw=(e,o,r,t,n=Object.is)=>{if(n(e,o))return!1;if(!O0(e)||!O0(o))return!0;const i=r.get(kw(e));if(!i)return!0;if(t){if(t.get(e)===o)return!1;t.set(e,o)}let f=null;for(const u of i[Tw]||[])if(f=Reflect.has(e,u)!==Reflect.has(o,u),f)return f;if(i[ch]===!0){if(f=_P(e,o),f)return f}else for(const u of i[Nw]||[]){const h=!!Reflect.getOwnPropertyDescriptor(e,u),s=!!Reflect.getOwnPropertyDescriptor(o,u);if(f=h!==s,f)return f}for(const u of i[Pw]||[])if(f=Fw(e[u],o[u],r,t,n),f)return f;if(f===null)throw new Error("invalid used");return f},xP=e=>Ow(e)&&e[Nm]||null,k0=(e,o=!0)=>{qp.set(e,o)};function wP(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Pm(e,o){const r=wP();return r?(r[e]||(r[e]=o()),r[e]):o()}var Yu=Pm("__zag__refSet",()=>new WeakSet),bP=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,SP=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,EP=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",CP=e=>bP(e)||SP(e)||EP(e),Xp=e=>e!==null&&typeof e=="object",Kp=e=>Xp(e)&&!Yu.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!CP(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise);function I0(e,o,r){typeof r.value=="object"&&!Kp(r.value)&&(r.value=ja(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||o==="__proto__"?Object.defineProperty(e,o,r):e[o]=r.value}function ja(e){if(typeof e!="object")return e;var o=0,r,t,n,i=Object.prototype.toString.call(e);if(i==="[object Object]"?n=Object.create(Object.getPrototypeOf(e)||null):i==="[object Array]"?n=Array(e.length):i==="[object Set]"?(n=new Set,e.forEach(function(f){n.add(ja(f))})):i==="[object Map]"?(n=new Map,e.forEach(function(f,u){n.set(ja(u),ja(f))})):i==="[object Date]"?n=new Date(+e):i==="[object RegExp]"?n=new RegExp(e.source,e.flags):i==="[object DataView]"?n=new e.constructor(ja(e.buffer)):i==="[object ArrayBuffer]"?n=e.slice(0):i==="[object Blob]"?n=e.slice():i.slice(-6)==="Array]"&&(n=new e.constructor(e)),n){for(t=Object.getOwnPropertySymbols(e);onew WeakMap),AP=(e=Object.is,o=(u,h)=>new Proxy(u,h),r=new WeakMap,t=(u,h)=>{const s=r.get(u);if((s==null?void 0:s[0])===h)return s[1];const d=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return k0(d,!0),r.set(u,[h,d]),Reflect.ownKeys(u).forEach(a=>{const l=Reflect.get(u,a);Yu.has(l)?(k0(l,!1),d[a]=l):Ma.has(l)?d[a]=Bi(l):d[a]=l}),Object.freeze(d)},n=new WeakMap,i=[1,1],f=u=>{if(!Xp(u))throw new Error("object required");const h=n.get(u);if(h)return h;let s=i[0];const d=new Set,a=(A,T=++i[0])=>{s!==T&&(s=T,d.forEach(D=>D(A,T)))};let l=i[1];const p=(A=++i[1])=>(l!==A&&!d.size&&(l=A,_.forEach(([T])=>{const D=T[1](A);D>s&&(s=D)})),s),v=A=>(T,D)=>{const O=[...T];O[1]=[A,...O[1]],a(O,D)},_=new Map,w=(A,T)=>{if(d.size){const D=T[3](v(A));_.set(A,[T,D])}else _.set(A,[T])},x=A=>{var D;const T=_.get(A);T&&(_.delete(A),(D=T[1])==null||D.call(T))},m=A=>(d.add(A),d.size===1&&_.forEach(([D,O],I)=>{const M=D[3](v(I));_.set(I,[D,M])}),()=>{d.delete(A),d.size===0&&_.forEach(([D,O],I)=>{O&&(O(),_.set(I,[D]))})}),g=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),S=o(g,{deleteProperty(A,T){const D=Reflect.get(A,T);x(T);const O=Reflect.deleteProperty(A,T);return O&&a(["delete",[T],D]),O},set(A,T,D,O){var R;const I=Reflect.has(A,T),M=Reflect.get(A,T,O);if(I&&(e(M,D)||n.has(D)&&e(M,n.get(D))))return!0;x(T),Xp(D)&&(D=xP(D)||D);let B=D;if(!((R=Object.getOwnPropertyDescriptor(A,T))!=null&&R.set)){!Ma.has(D)&&Kp(D)&&(B=Om(D));const L=!Yu.has(B)&&Ma.get(B);L&&w(T,L)}return Reflect.set(A,T,B,O),a(["set",[T],D,M]),!0}});n.set(u,S);const E=[g,p,t,m];return Ma.set(S,E),Reflect.ownKeys(u).forEach(A=>{const T=Object.getOwnPropertyDescriptor(u,A);T.get||T.set?Object.defineProperty(g,A,T):S[A]=u[A]}),S})=>[f,Ma,Yu,e,o,Kp,r,t,n,i],[DP]=AP();function Om(e={}){return DP(e)}function Yp(e,o,r){const t=Ma.get(e);let n;const i=[],f=t[3];let u=!1;const s=f(d=>{if(i.push(d),r){o(i.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,u&&o(i.splice(0))}))});return u=!0,()=>{u=!1,s()}}function Bi(e){const o=Ma.get(e),[r,t,n]=o;return n(r,t())}function Nh(e){return Yu.add(e),e}function TP(e,o){Object.keys(o).forEach(n=>{if(Object.getOwnPropertyDescriptor(e,n))throw new Error("object property already defined");const i=o[n],{get:f,set:u}=typeof i=="function"?{get:i}:i,h={};h.get=()=>f(Bi(t)),u&&(h.set=s=>u(t,s)),Object.defineProperty(e,n,h)});const t=Om(e);return t}var NP=e=>e[0],PP=e=>e[e.length-1];function OP(e){for(;e.length>0;)e.pop();return e}var F0=e=>(e==null?void 0:e.constructor.name)==="Array",kP=(e,o)=>{if(e.length!==o.length)return!1;for(let r=0;r{if(Object.is(e,o))return!0;if(e==null&&o!=null||e!=null&&o==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(o==null?void 0:o.isEqual)=="function")return e.isEqual(o);if(typeof e=="function"&&typeof o=="function")return e.toString()===o.toString();if(F0(e)&&F0(o))return kP(Array.from(e),Array.from(o));if(typeof e!="object"||typeof o!="object")return!1;const r=Object.keys(o??Object.create(null)),t=r.length;for(let n=0;n(typeof e=="function"?e(...o):e)??void 0,Qo=e=>e,Rw=()=>{},Qp=(...e)=>(...o)=>{e.forEach(function(r){r==null||r(...o)})},R0=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Ph=e=>Array.isArray(e),Mw=e=>e!=null&&typeof e=="object",hh=e=>Mw(e)&&!Ph(e),km=e=>typeof e=="number"&&!Number.isNaN(e),yr=e=>typeof e=="string",cl=e=>typeof e=="function",IP=e=>e==null,Lw=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),FP=e=>Object.prototype.toString.call(e),jw=Function.prototype.toString,RP=jw.call(Object),qc=e=>{if(!Mw(e)||FP(e)!="[object Object]")return!1;const o=Object.getPrototypeOf(e);if(o===null)return!0;const r=Lw(o,"constructor")&&o.constructor;return typeof r=="function"&&r instanceof r&&jw.call(r)==RP};function Ji(e){if(!MP(e)||e===void 0)return e;const o=Reflect.ownKeys(e).filter(t=>typeof t=="string"),r={};for(const t of o){const n=e[t];n!==void 0&&(r[t]=Ji(n))}return r}var MP=e=>e&&typeof e=="object"&&e.constructor===Object;function fh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function dh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}var LP=Object.defineProperty,jP=(e,o,r)=>o in e?LP(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,gt=(e,o,r)=>jP(e,typeof o!="symbol"?o+"":o,r);function Bw(e,...o){if(!qc(e))throw new TypeError("Source argument must be a plain object");for(const r of o){if(!qc(r))continue;const t=Ji(r);for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||n==="__proto__"||n==="constructor"||n==="prototype")continue;const i=e[n],f=r[n];qc(f)?e[n]=qc(i)?Bw(i,f):{...f}:e[n]=f}}return e}function Jr(e){return yr(e)?{type:e}:e}function Li(e){return e?Ph(e)?e.slice():[e]:[]}function zw(e){return hh(e)&&e.predicate!=null}var BP=()=>!0;function Uw(e,o,r,t){return n=>{var i;return yr(n)?!!((i=e[n])!=null&&i.call(e,o,r,t)):cl(n)?n(o,r,t):n.predicate(e)(o,r,t)}}function zP(...e){return{predicate:o=>(r,t,n)=>e.map(Uw(o,r,t,n)).every(Boolean)}}function UP(e){return{predicate:o=>(r,t,n)=>!Uw(o,r,t,n)(e)}}var Vw={and:zP,not:UP};function Hw(e,o){return e=e??BP,(r,t,n)=>{if(yr(e)){const i=o[e];return cl(i)?i(r,t,n):i}return zw(e)?e.predicate(o)(r,t,n):e==null?void 0:e(r,t,n)}}function Zd(e,o){return(r,t,n)=>zw(e)?e.predicate(o)(r,t,n):e}function VP(e){var i,f;const o=e.computed??Qo({}),r=e.context??Qo({}),t=e.initial?(f=(i=e.states)==null?void 0:i[e.initial])==null?void 0:f.tags:[],n=Om({value:e.initial??"",previousValue:"",event:Qo({}),previousEvent:Qo({}),context:TP(r,o),done:!1,tags:t??[],hasTag(u){return this.tags.includes(u)},matches(...u){return u.includes(this.value)},can(u){return Qo(this).nextEvents.includes(u)},get nextEvents(){var s,d;const u=((d=(s=e.states)==null?void 0:s[this.value])==null?void 0:d.on)??{},h=(e==null?void 0:e.on)??{};return Object.keys({...u,...h})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Qo(n)}function Fu(e,o){return(r,t)=>{if(km(e))return e;if(cl(e))return e(r,t);if(yr(e)){const n=Number.parseFloat(e);if(!Number.isNaN(n))return n;if(o){const i=o==null?void 0:o[e];return dh(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),cl(i)?i(r,t):i}}}}function HP(e){return yr(e)?{target:e}:e}function $P(e,o){return(r,t,n)=>Li(e).map(HP).find(i=>Hw(i.guard,o)(r,t,n)??i.target??i.actions)}var WP=class{constructor(e,o){var r,t,n,i,f;gt(this,"status","Not Started"),gt(this,"state"),gt(this,"initialState"),gt(this,"initialContext"),gt(this,"id"),gt(this,"type","machine"),gt(this,"activityEvents",new Map),gt(this,"delayedEvents",new Map),gt(this,"stateListeners",new Set),gt(this,"doneListeners",new Set),gt(this,"contextWatchers",new Set),gt(this,"removeStateListener",Rw),gt(this,"parent"),gt(this,"children",new Map),gt(this,"guardMap"),gt(this,"actionMap"),gt(this,"delayMap"),gt(this,"activityMap"),gt(this,"sync"),gt(this,"options"),gt(this,"config"),gt(this,"_created",()=>{if(!this.config.created)return;const u=Jr("machine.created");this.executeActions(this.config.created,u)}),gt(this,"start",u=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Yp(this.state,()=>{this.stateListeners.forEach(p=>{p(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Jr("machine.start"),Li(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Jr("machine.start"));const h=Jr("machine.init"),s=hh(u)?u.value:u,d=hh(u)?u.context:void 0;d&&this.setContext(d);const a={target:s??this.config.initial},l=this.getNextStateInfo(a,h);return this.initialState=l,this.performStateChangeEffects(this.state.value,l,h),this}),gt(this,"setupContextWatchers",()=>{const{watch:u}=this.config;if(!u)return;let h=Bi(this.state.context);const s=Yp(this.state.context,()=>{var a;const d=Bi(this.state.context);for(const[l,p]of Object.entries(u))(((a=this.options.compareFns)==null?void 0:a[l])??Object.is)(h[l],d[l])||this.executeActions(p,this.state.event);h=d});this.contextWatchers.add(s)}),gt(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Jr("machine.stop")),this.executeActions(this.config.exit,Jr("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),gt(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),gt(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(u=>u()),this.contextWatchers.clear()}),gt(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(u=>{u.forEach(h=>h())}),this.delayedEvents.clear()}),gt(this,"stopActivities",u=>{var h,s;u?((h=this.activityEvents.get(u))==null||h.forEach(d=>d()),(s=this.activityEvents.get(u))==null||s.clear(),this.activityEvents.delete(u)):(this.activityEvents.forEach(d=>{d.forEach(a=>a()),d.clear()}),this.activityEvents.clear())}),gt(this,"sendChild",(u,h)=>{const s=Jr(u),d=Jp(h,this.contextSnapshot),a=this.children.get(d);a||dh(`[@zag-js/core] Cannot send '${s.type}' event to unknown child`),a.send(s)}),gt(this,"stopChild",u=>{this.children.has(u)||dh(`[@zag-js/core > stop-child] Cannot stop unknown child ${u}`),this.children.get(u).stop(),this.children.delete(u)}),gt(this,"removeChild",u=>{this.children.delete(u)}),gt(this,"stopChildren",()=>{this.children.forEach(u=>u.stop()),this.children.clear()}),gt(this,"setParent",u=>{this.parent=u}),gt(this,"spawn",(u,h)=>{const s=Jp(u);return h&&(s.id=h),s.type="machine.actor",s.setParent(this),this.children.set(s.id,Qo(s)),s.onDone(()=>{this.removeChild(s.id)}).start(),Qo(Nh(s))}),gt(this,"stopActivity",u=>{var s;if(!this.state.value)return;const h=this.activityEvents.get(this.state.value);(s=h==null?void 0:h.get(u))==null||s(),h==null||h.delete(u)}),gt(this,"addActivityCleanup",(u,h,s)=>{var d;u&&(this.activityEvents.has(u)?(d=this.activityEvents.get(u))==null||d.set(h,s):this.activityEvents.set(u,new Map([[h,s]])))}),gt(this,"setState",u=>{this.state.previousValue=this.state.value,this.state.value=u;const h=this.getStateNode(u);u==null?OP(this.state.tags):this.state.tags=Li(h==null?void 0:h.tags)}),gt(this,"setContext",u=>{u&&Bw(this.state.context,u)}),gt(this,"setOptions",u=>{const h=Ji(u);this.actionMap={...this.actionMap,...h.actions},this.delayMap={...this.delayMap,...h.delays},this.activityMap={...this.activityMap,...h.activities},this.guardMap={...this.guardMap,...h.guards}}),gt(this,"getStateNode",u=>{var h;if(u)return(h=this.config.states)==null?void 0:h[u]}),gt(this,"getNextStateInfo",(u,h)=>{const s=this.determineTransition(u,h),d=!(s!=null&&s.target),a=(s==null?void 0:s.target)??this.state.value,l=this.state.value!==a,p=this.getStateNode(a),_={reenter:!d&&!l&&!(s!=null&&s.internal),transition:s,stateNode:p,target:a,changed:l};return this.log("NextState:",`[${h.type}]`,this.state.value,"---->",_.target),_}),gt(this,"getAfterActions",(u,h)=>{let s;const d=this.state.value;return{entry:()=>{s=globalThis.setTimeout(()=>{const a=this.getNextStateInfo(u,this.state.event);this.performStateChangeEffects(d,a,this.state.event)},h)},exit:()=>{globalThis.clearTimeout(s)}}}),gt(this,"getDelayedEventActions",u=>{const h=this.getStateNode(u),s=this.state.event;if(!h||!h.after)return;const d=[],a=[];if(Ph(h.after)){const l=this.determineTransition(h.after,s);if(!l)return;if(!Lw(l,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(l)}`);const v=Fu(l.delay,this.delayMap)(this.contextSnapshot,s),_=this.getAfterActions(l,v);return d.push(_.entry),a.push(_.exit),{entries:d,exits:a}}if(hh(h.after))for(const l in h.after){const p=h.after[l],_=Fu(l,this.delayMap)(this.contextSnapshot,s),w=this.getAfterActions(p,_);d.push(w.entry),a.push(w.exit)}return{entries:d,exits:a}}),gt(this,"executeActions",(u,h)=>{var d;const s=Zd(u,this.guardMap)(this.contextSnapshot,h,this.guardMeta);for(const a of Li(s)){const l=yr(a)?(d=this.actionMap)==null?void 0:d[a]:a;fh(yr(a)&&!l,`[@zag-js/core > execute-actions] No implementation found for action: \`${a}\``),l==null||l(this.state.context,h,this.meta)}}),gt(this,"executeActivities",(u,h,s)=>{var d;for(const a of h){const l=yr(a)?(d=this.activityMap)==null?void 0:d[a]:a;if(!l){fh(`[@zag-js/core > execute-activity] No implementation found for activity: \`${a}\``);continue}const p=l(this.state.context,u,this.meta);if(p){const v=yr(a)?a:a.name||R0();this.addActivityCleanup(s??this.state.value,v,p)}}}),gt(this,"createEveryActivities",(u,h)=>{if(u)if(Ph(u)){const s=Li(u).find(p=>{const v=p.delay,w=Fu(v,this.delayMap)(this.contextSnapshot,this.state.event);return Hw(p.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??w!=null});if(!s)return;const a=Fu(s.delay,this.delayMap)(this.contextSnapshot,this.state.event);h(()=>{const p=globalThis.setInterval(()=>{this.executeActions(s.actions,this.state.event)},a);return()=>{globalThis.clearInterval(p)}})}else for(const s in u){const d=u==null?void 0:u[s],l=Fu(s,this.delayMap)(this.contextSnapshot,this.state.event);h(()=>{const v=globalThis.setInterval(()=>{this.executeActions(d,this.state.event)},l);return()=>{globalThis.clearInterval(v)}})}}),gt(this,"setEvent",u=>{this.state.previousEvent=this.state.event,this.state.event=Nh(Jr(u))}),gt(this,"performExitEffects",(u,h)=>{const s=this.state.value;if(s==="")return;const d=u?this.getStateNode(u):void 0;this.stopActivities(s);const a=Zd(d==null?void 0:d.exit,this.guardMap)(this.contextSnapshot,h,this.guardMeta),l=Li(a),p=this.delayedEvents.get(s);p&&l.push(...p),this.executeActions(l,h),this.delayedEvents.delete(s)}),gt(this,"performEntryEffects",(u,h)=>{const s=this.getStateNode(u),d=Li(s==null?void 0:s.activities);this.createEveryActivities(s==null?void 0:s.every,v=>{d.unshift(v)}),d.length>0&&this.executeActivities(h,d);const a=Zd(s==null?void 0:s.entry,this.guardMap)(this.contextSnapshot,h,this.guardMeta),l=Li(a),p=this.getDelayedEventActions(u);s!=null&&s.after&&p&&(this.delayedEvents.set(u,p==null?void 0:p.exits),l.push(...p.entries)),this.executeActions(l,h),(s==null?void 0:s.type)==="final"&&(this.state.done=!0,this.doneListeners.forEach(v=>{v(this.stateSnapshot)}),this.stop())}),gt(this,"performTransitionEffects",(u,h)=>{const s=this.determineTransition(u,h);this.executeActions(s==null?void 0:s.actions,h)}),gt(this,"performStateChangeEffects",(u,h,s)=>{this.setEvent(s);const d=h.changed||h.reenter;d&&this.performExitEffects(u,s),this.performTransitionEffects(h.transition,s),this.setState(h.target),d&&this.performEntryEffects(h.target,s)}),gt(this,"determineTransition",(u,h)=>{const s=$P(u,this.guardMap);return s==null?void 0:s(this.contextSnapshot,h,this.guardMeta)}),gt(this,"sendParent",u=>{var s;this.parent||dh("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=Jr(u);(s=this.parent)==null||s.send(h)}),gt(this,"log",(...u)=>{}),gt(this,"send",u=>{const h=Jr(u);this.transition(this.state.value,h)}),gt(this,"transition",(u,h)=>{var p,v;const s=yr(u)?this.getStateNode(u):u==null?void 0:u.stateNode,d=Jr(h);if(!s&&!this.config.on){const _=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${u}, \`event\`: ${d.type}`;fh(_);return}const a=((p=s==null?void 0:s.on)==null?void 0:p[d.type])??((v=this.config.on)==null?void 0:v[d.type]),l=this.getNextStateInfo(a,d);return this.performStateChangeEffects(this.state.value,l,d),l.stateNode}),gt(this,"subscribe",u=>(this.stateListeners.add(u),this.status==="Running"&&u(this.stateSnapshot),()=>{this.stateListeners.delete(u)})),gt(this,"onDone",u=>(this.doneListeners.add(u),this)),gt(this,"onTransition",u=>(this.stateListeners.add(u),this.status==="Running"&&u(this.stateSnapshot),this)),this.config=ja(e),this.options=ja(o??{}),this.id=this.config.id??`machine-${R0()}`,this.guardMap=((r=this.options)==null?void 0:r.guards)??{},this.actionMap=((t=this.options)==null?void 0:t.actions)??{},this.delayMap=((n=this.options)==null?void 0:n.delays)??{},this.activityMap=((i=this.options)==null?void 0:i.activities)??{},this.sync=((f=this.options)==null?void 0:f.sync)??!1,this.state=VP(this.config),this.initialContext=Bi(this.state.context)}get stateSnapshot(){return Qo(Bi(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var o;return((o=e.initialState)==null?void 0:o.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:o=>this.actionMap[o],getGuard:o=>this.guardMap[o]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},Sl=(e,o)=>new WP(e,o),GP=(...e)=>e.map(o=>{var r;return(r=o==null?void 0:o.trim)==null?void 0:r.call(o)}).filter(Boolean).join(" "),qP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,M0=e=>{const o={};let r;for(;r=qP.exec(e);)o[r[1]]=r[2];return o},XP=(e,o)=>{if(yr(e)){if(yr(o))return`${e};${o}`;e=M0(e)}else yr(o)&&(o=M0(o));return Object.assign({},e??{},o??{})};function An(...e){let o={};for(let r of e){for(let t in o){if(t.startsWith("on")&&typeof o[t]=="function"&&typeof r[t]=="function"){o[t]=Qp(r[t],o[t]);continue}if(t==="className"||t==="class"){o[t]=GP(o[t],r[t]);continue}if(t==="style"){o[t]=XP(o[t],r[t]);continue}o[t]=r[t]!==void 0?r[t]:o[t]}for(let t in r)o[t]===void 0&&(o[t]=r[t])}return o}function KP(e){return new Proxy({},{get(){return e}})}var Ga=()=>e=>Array.from(new Set(e)),Zh=KP(e=>e),L0=e=>(e==null?void 0:e.constructor.name)==="Array",YP=(e,o)=>{if(e.length!==o.length)return!1;for(let r=0;r{if(Object.is(e,o))return!0;if(e==null&&o!=null||e!=null&&o==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(o==null?void 0:o.isEqual)=="function")return e.isEqual(o);if(typeof e=="function"&&typeof o=="function")return e.toString()===o.toString();if(L0(e)&&L0(o))return YP(Array.from(e),Array.from(o));if(typeof e!="object"||typeof o!="object")return!1;const r=Object.keys(o??Object.create(null)),t=r.length;for(let n=0;ntypeof t=="string"),r={};for(const t of o){const n=e[t];n!==void 0&&(r[t]=$w(n))}return r}var QP=e=>e&&typeof e=="object"&&e.constructor===Object;function ZP(e,o){const r=ae.useRef(!1),t=ae.useRef(!1);ae.useEffect(()=>{if(r.current&&t.current)return e();t.current=!0},o),ae.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])}var eO=Pm("__zag__targetCache",()=>new WeakMap);function tO(e,o){const{actions:r,context:t,sync:n}=o??{},i=ae.useRef(void 0),f=ae.useRef(void 0),u=ae.useSyncExternalStore(ae.useCallback(a=>Yp(e.state,a,n),[n]),()=>{const a=Bi(e.state);try{if(i.current&&f.current&&!Fw(i.current,a,f.current,new WeakMap))return i.current}catch{}return a},()=>Bi(e.state));e.setOptions({actions:r});const h=ae.useMemo(()=>$w(t??{}),[t]);ZP(()=>{const a=Object.entries(h),l=e.contextSnapshot??{};a.map(([_,w])=>({key:_,curr:w,prev:l[_],equal:Im(l[_],w)})).every(({equal:_})=>_)||e.setContext(h)},[h]);const s=new WeakMap;ae.useEffect(()=>{i.current=u,f.current=s});const d=ae.useMemo(()=>new WeakMap,[]);return Iw(u,s,d,eO)}function nO(e){const o=ae.useRef(void 0);return o.current||(o.current={v:e()}),o.current.v}var rO=typeof document<"u"?ae.useLayoutEffect:ae.useEffect;function oO(e,o){const{state:r,context:t}=o??{},n=nO(()=>{const f=typeof e=="function"?e():e;return t&&f.setContext(t),f._created(),f}),i=ae.useRef(void 0);return rO(()=>{const f=r??i.current;return n.start(f),()=>{n.stop()}},[]),n}function El(e,o){const r=oO(e,o);return[tO(r,o),r.send,r]}function iO(e,o){typeof e=="function"?e(o):e!=null&&(e.current=o)}function Cl(...e){return o=>{for(const r of e)iO(r,o)}}function aO(e){var t,n;let o=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?e.ref:(o=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const ep=e=>{const o=ae.memo(ae.forwardRef((r,t)=>{const{asChild:n,children:i,...f}=r;if(!n)return ae.createElement(e,{...f,ref:t},i);const u=ae.Children.only(i);if(!ae.isValidElement(u))return null;const h=aO(u);return ae.cloneElement(u,{...An(f,u.props),ref:t?Cl(t,h):h})}));return o.displayName=e.displayName||e.name,o},sO=()=>{const e=new Map;return new Proxy(ep,{apply(o,r,t){return ep(t[0])},get(o,r){const t=r;return e.has(t)||e.set(t,ep(t)),e.get(t)}})},Yn=sO();function uO(e,o){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${o}`}function qa(e={}){const{name:o,strict:r=!0,hookName:t="useContext",providerName:n="Provider",errorMessage:i,defaultValue:f}=e,u=ae.createContext(f);u.displayName=o;function h(){var d;const s=ae.useContext(u);if(!s&&r){const a=new Error(i??uO(t,n));throw a.name="ContextError",(d=Error.captureStackTrace)==null||d.call(Error,a,h),a}return s}return[u.Provider,h,u]}const[lO,Al]=qa({name:"HoverCardContext",hookName:"useHoverCardContext",providerName:""}),Ww=ae.forwardRef((e,o)=>{const r=Al(),t=An(r.getArrowProps(),e);return Q.jsx(Yn.div,{...t,ref:o})});Ww.displayName="HoverCardArrow";const Gw=ae.forwardRef((e,o)=>{const r=Al(),t=An(r.getArrowTipProps(),e);return Q.jsx(Yn.div,{...t,ref:o})});Gw.displayName="HoverCardArrowTip";const[Fm,ef]=qa({name:"PresenceContext",hookName:"usePresenceContext",providerName:""}),qw=ae.forwardRef((e,o)=>{const r=Al(),t=ef(),n=An(r.getContentProps(),t.getPresenceProps(),e);return t.unmounted?null:Q.jsx(Yn.div,{...n,ref:Cl(t.ref,o)})});qw.displayName="HoverCardContent";const Xw=ae.forwardRef((e,o)=>{const r=Al(),t=An(r.getPositionerProps(),e);return ef().unmounted?null:Q.jsx(Yn.div,{...t,ref:o})});Xw.displayName="HoverCardPositioner";const Dl=()=>(e,o)=>o.reduce((r,t)=>{const[n,i]=r,f=t;return i[f]!==void 0&&(n[f]=i[f]),delete i[f],[n,i]},[{},{...e}]),Kw=e=>Dl()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]);function cO(e,o,r){const t=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&t,present:t,setNode(n){n&&o({type:"NODE.SET",node:n})},unmount(){o({type:"UNMOUNT"})}}}function hO(e){return Sl({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial","cleanupNode"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],after:{ANIMATION_DURATION:{target:"unmounted",actions:["invokeOnExitComplete"]}},on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{delays:{ANIMATION_DURATION(o){var r,t;return j0((r=o.styles)==null?void 0:r.animationDuration)+j0((t=o.styles)==null?void 0:t.animationDelay)+fO}},actions:{setInitial(o){o.initial=!0},clearInitial(o){o.initial=!1},cleanupNode(o){o.node=null,o.styles=null},invokeOnExitComplete(o){var r;(r=o.onExitComplete)==null||r.call(o)},setNode(o,r){o.node=Nh(r.node)},setStyles(o,r){const t=r.node.ownerDocument.defaultView||window;o.styles=Nh(t.getComputedStyle(r.node))},syncPresence(o,r,{send:t}){var f;if(o.present){t({type:"MOUNT",src:"presence.changed"});return}if(!o.present&&((f=o.node)==null?void 0:f.ownerDocument.visibilityState)==="hidden"){t({type:"UNMOUNT",src:"visibilitychange"});return}const n=Xc(o.styles);(o.immediate?queueMicrotask:requestAnimationFrame)(()=>{var u,h;o.unmountAnimationName=n,n==="none"||n===o.prevAnimationName||((u=o.styles)==null?void 0:u.display)==="none"||((h=o.styles)==null?void 0:h.animationDuration)==="0s"?t({type:"UNMOUNT",src:"presence.changed"}):t({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(o){(o.immediate?queueMicrotask:requestAnimationFrame)(()=>{o.prevAnimationName=Xc(o.styles)})},clearPrevAnimationName(o){o.prevAnimationName=null}},activities:{trackAnimationEvents(o,r,{send:t}){const n=o.node;if(!n)return;const i=u=>{var s,d;(((d=(s=u.composedPath)==null?void 0:s.call(u))==null?void 0:d[0])??u.target)===n&&(o.prevAnimationName=Xc(o.styles))},f=u=>{var d,a;const h=Xc(o.styles);(((a=(d=u.composedPath)==null?void 0:d.call(u))==null?void 0:a[0])??u.target)===n&&h===o.unmountAnimationName&&t({type:"UNMOUNT",src:"animationend"})};return n.addEventListener("animationstart",i),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",i),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}}})}function Xc(e){return(e==null?void 0:e.animationName)||"none"}function j0(e){return parseFloat(e||"0")*1e3}var fO=16.667;Ga()(["onExitComplete","present","immediate"]);function Vi(e,o={}){const{sync:r=!1}=o,t=dO(e);return ae.useCallback((...n)=>{var i;return r?queueMicrotask(()=>{var f;return(f=t.current)==null?void 0:f.call(t,...n)}):(i=t.current)==null?void 0:i.call(t,...n)},[r,t])}function dO(e){const o=ae.useRef(e);return o.current=e,o}const tf=e=>{const{lazyMount:o,unmountOnExit:r,present:t,...n}=e,i=ae.useRef(!1),f={...n,present:t,onExitComplete:Vi(e.onExitComplete)},[u,h]=El(hO(f),{context:f}),s=cO(u,h);s.present&&(i.current=!0);const d=!s.present&&!i.current&&o||r&&!s.present&&i.current,a=()=>({"data-state":t?"open":"closed",hidden:!s.present});return{ref:s.setNode,getPresenceProps:a,present:s.present,unmounted:d}};var Ua=(e,o=[])=>({parts:(...r)=>{if(pO(o))return Ua(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Ua(e,[...o,...r]),rename:r=>Ua(r,o),keys:()=>o,build:()=>[...new Set(o)].reduce((r,t)=>Object.assign(r,{[t]:{selector:[`&[data-scope="${Is(e)}"][data-part="${Is(t)}"]`,`& [data-scope="${Is(e)}"][data-part="${Is(t)}"]`].join(", "),attrs:{"data-scope":Is(e),"data-part":Is(t)}}}),{})}),Is=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),pO=e=>e.length===0;const mO=["top","right","bottom","left"],Gi=Math.min,mr=Math.max,Oh=Math.round,Kc=Math.floor,Ao=e=>({x:e,y:e}),gO={left:"right",right:"left",bottom:"top",top:"bottom"},yO={start:"end",end:"start"};function Zp(e,o,r){return mr(e,Gi(o,r))}function ii(e,o){return typeof e=="function"?e(o):e}function ai(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function Rm(e){return e==="x"?"y":"x"}function Mm(e){return e==="y"?"height":"width"}function qi(e){return["top","bottom"].includes(ai(e))?"y":"x"}function Lm(e){return Rm(qi(e))}function vO(e,o,r){r===void 0&&(r=!1);const t=Xs(e),n=Lm(e),i=Mm(n);let f=n==="x"?t===(r?"end":"start")?"right":"left":t==="start"?"bottom":"top";return o.reference[i]>o.floating[i]&&(f=kh(f)),[f,kh(f)]}function _O(e){const o=kh(e);return[em(e),o,em(o)]}function em(e){return e.replace(/start|end/g,o=>yO[o])}function xO(e,o,r){const t=["left","right"],n=["right","left"],i=["top","bottom"],f=["bottom","top"];switch(e){case"top":case"bottom":return r?o?n:t:o?t:n;case"left":case"right":return o?i:f;default:return[]}}function wO(e,o,r,t){const n=Xs(e);let i=xO(ai(e),r==="start",t);return n&&(i=i.map(f=>f+"-"+n),o&&(i=i.concat(i.map(em)))),i}function kh(e){return e.replace(/left|right|bottom|top/g,o=>gO[o])}function bO(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yw(e){return typeof e!="number"?bO(e):{top:e,right:e,bottom:e,left:e}}function Ih(e){const{x:o,y:r,width:t,height:n}=e;return{width:t,height:n,top:r,left:o,right:o+t,bottom:r+n,x:o,y:r}}function B0(e,o,r){let{reference:t,floating:n}=e;const i=qi(o),f=Lm(o),u=Mm(f),h=ai(o),s=i==="y",d=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l=t[u]/2-n[u]/2;let p;switch(h){case"top":p={x:d,y:t.y-n.height};break;case"bottom":p={x:d,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:a};break;case"left":p={x:t.x-n.width,y:a};break;default:p={x:t.x,y:t.y}}switch(Xs(o)){case"start":p[f]-=l*(r&&s?-1:1);break;case"end":p[f]+=l*(r&&s?-1:1);break}return p}const SO=async(e,o,r)=>{const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:f}=r,u=i.filter(Boolean),h=await(f.isRTL==null?void 0:f.isRTL(o));let s=await f.getElementRects({reference:e,floating:o,strategy:n}),{x:d,y:a}=B0(s,t,h),l=t,p={},v=0;for(let _=0;_({name:"arrow",options:e,async fn(o){const{x:r,y:t,placement:n,rects:i,platform:f,elements:u,middlewareData:h}=o,{element:s,padding:d=0}=ii(e,o)||{};if(s==null)return{};const a=Yw(d),l={x:r,y:t},p=Lm(n),v=Mm(p),_=await f.getDimensions(s),w=p==="y",x=w?"top":"left",m=w?"bottom":"right",g=w?"clientHeight":"clientWidth",b=i.reference[v]+i.reference[p]-l[p]-i.floating[v],S=l[p]-i.reference[p],E=await(f.getOffsetParent==null?void 0:f.getOffsetParent(s));let A=E?E[g]:0;(!A||!await(f.isElement==null?void 0:f.isElement(E)))&&(A=u.floating[g]||i.floating[v]);const T=b/2-S/2,D=A/2-_[v]/2-1,O=Gi(a[x],D),I=Gi(a[m],D),M=O,B=A-_[v]-I,R=A/2-_[v]/2+T,L=Zp(M,R,B),z=!h.arrow&&Xs(n)!=null&&R!==L&&i.reference[v]/2-(RR<=0)){var I,M;const R=(((I=i.flip)==null?void 0:I.index)||0)+1,L=A[R];if(L)return{data:{index:R,overflows:O},reset:{placement:L}};let z=(M=O.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:M.placement;if(!z)switch(p){case"bestFit":{var B;const K=(B=O.filter(U=>{if(E){const H=qi(U.placement);return H===m||H==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(H=>H>0).reduce((H,G)=>H+G,0)]).sort((U,H)=>U[1]-H[1])[0])==null?void 0:B[0];K&&(z=K);break}case"initialPlacement":z=u;break}if(n!==z)return{reset:{placement:z}}}return{}}}};function z0(e,o){return{top:e.top-o.height,right:e.right-o.width,bottom:e.bottom-o.height,left:e.left-o.width}}function U0(e){return mO.some(o=>e[o]>=0)}const AO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(o){const{rects:r}=o,{strategy:t="referenceHidden",...n}=ii(e,o);switch(t){case"referenceHidden":{const i=await hl(o,{...n,elementContext:"reference"}),f=z0(i,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:U0(f)}}}case"escaped":{const i=await hl(o,{...n,altBoundary:!0}),f=z0(i,r.floating);return{data:{escapedOffsets:f,escaped:U0(f)}}}default:return{}}}}};async function DO(e,o){const{placement:r,platform:t,elements:n}=e,i=await(t.isRTL==null?void 0:t.isRTL(n.floating)),f=ai(r),u=Xs(r),h=qi(r)==="y",s=["left","top"].includes(f)?-1:1,d=i&&h?-1:1,a=ii(o,e);let{mainAxis:l,crossAxis:p,alignmentAxis:v}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return u&&typeof v=="number"&&(p=u==="end"?v*-1:v),h?{x:p*d,y:l*s}:{x:l*s,y:p*d}}const TO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(o){var r,t;const{x:n,y:i,placement:f,middlewareData:u}=o,h=await DO(o,e);return f===((r=u.offset)==null?void 0:r.placement)&&(t=u.arrow)!=null&&t.alignmentOffset?{}:{x:n+h.x,y:i+h.y,data:{...h,placement:f}}}}},NO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(o){const{x:r,y:t,placement:n}=o,{mainAxis:i=!0,crossAxis:f=!1,limiter:u={fn:w=>{let{x,y:m}=w;return{x,y:m}}},...h}=ii(e,o),s={x:r,y:t},d=await hl(o,h),a=qi(ai(n)),l=Rm(a);let p=s[l],v=s[a];if(i){const w=l==="y"?"top":"left",x=l==="y"?"bottom":"right",m=p+d[w],g=p-d[x];p=Zp(m,p,g)}if(f){const w=a==="y"?"top":"left",x=a==="y"?"bottom":"right",m=v+d[w],g=v-d[x];v=Zp(m,v,g)}const _=u.fn({...o,[l]:p,[a]:v});return{..._,data:{x:_.x-r,y:_.y-t,enabled:{[l]:i,[a]:f}}}}}},PO=function(e){return e===void 0&&(e={}),{options:e,fn(o){const{x:r,y:t,placement:n,rects:i,middlewareData:f}=o,{offset:u=0,mainAxis:h=!0,crossAxis:s=!0}=ii(e,o),d={x:r,y:t},a=qi(n),l=Rm(a);let p=d[l],v=d[a];const _=ii(u,o),w=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(h){const g=l==="y"?"height":"width",b=i.reference[l]-i.floating[g]+w.mainAxis,S=i.reference[l]+i.reference[g]-w.mainAxis;pS&&(p=S)}if(s){var x,m;const g=l==="y"?"width":"height",b=["top","left"].includes(ai(n)),S=i.reference[a]-i.floating[g]+(b&&((x=f.offset)==null?void 0:x[a])||0)+(b?0:w.crossAxis),E=i.reference[a]+i.reference[g]+(b?0:((m=f.offset)==null?void 0:m[a])||0)-(b?w.crossAxis:0);vE&&(v=E)}return{[l]:p,[a]:v}}}},OO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(o){var r,t;const{placement:n,rects:i,platform:f,elements:u}=o,{apply:h=()=>{},...s}=ii(e,o),d=await hl(o,s),a=ai(n),l=Xs(n),p=qi(n)==="y",{width:v,height:_}=i.floating;let w,x;a==="top"||a==="bottom"?(w=a,x=l===(await(f.isRTL==null?void 0:f.isRTL(u.floating))?"start":"end")?"left":"right"):(x=a,w=l==="end"?"top":"bottom");const m=_-d.top-d.bottom,g=v-d.left-d.right,b=Gi(_-d[w],m),S=Gi(v-d[x],g),E=!o.middlewareData.shift;let A=b,T=S;if((r=o.middlewareData.shift)!=null&&r.enabled.x&&(T=g),(t=o.middlewareData.shift)!=null&&t.enabled.y&&(A=m),E&&!l){const O=mr(d.left,0),I=mr(d.right,0),M=mr(d.top,0),B=mr(d.bottom,0);p?T=v-2*(O!==0||I!==0?O+I:mr(d.left,d.right)):A=_-2*(M!==0||B!==0?M+B:mr(d.top,d.bottom))}await h({...o,availableWidth:T,availableHeight:A});const D=await f.getDimensions(u.floating);return v!==D.width||_!==D.height?{reset:{rects:!0}}:{}}}};function nf(){return typeof window<"u"}function Ks(e){return Jw(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var o;return(e==null||(o=e.ownerDocument)==null?void 0:o.defaultView)||window}function Po(e){var o;return(o=(Jw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:o.documentElement}function Jw(e){return nf()?e instanceof Node||e instanceof vr(e).Node:!1}function io(e){return nf()?e instanceof Element||e instanceof vr(e).Element:!1}function Do(e){return nf()?e instanceof HTMLElement||e instanceof vr(e).HTMLElement:!1}function V0(e){return!nf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function Tl(e){const{overflow:o,overflowX:r,overflowY:t,display:n}=ao(e);return/auto|scroll|overlay|hidden|clip/.test(o+t+r)&&!["inline","contents"].includes(n)}function kO(e){return["table","td","th"].includes(Ks(e))}function rf(e){return[":popover-open",":modal"].some(o=>{try{return e.matches(o)}catch{return!1}})}function jm(e){const o=Bm(),r=io(e)?ao(e):e;return["transform","translate","scale","rotate","perspective"].some(t=>r[t]?r[t]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!o&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!o&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(t=>(r.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(r.contain||"").includes(t))}function IO(e){let o=Xi(e);for(;Do(o)&&!qs(o);){if(jm(o))return o;if(rf(o))return null;o=Xi(o)}return null}function Bm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function qs(e){return["html","body","#document"].includes(Ks(e))}function ao(e){return vr(e).getComputedStyle(e)}function of(e){return io(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xi(e){if(Ks(e)==="html")return e;const o=e.assignedSlot||e.parentNode||V0(e)&&e.host||Po(e);return V0(o)?o.host:o}function Qw(e){const o=Xi(e);return qs(o)?e.ownerDocument?e.ownerDocument.body:e.body:Do(o)&&Tl(o)?o:Qw(o)}function fl(e,o,r){var t;o===void 0&&(o=[]),r===void 0&&(r=!0);const n=Qw(e),i=n===((t=e.ownerDocument)==null?void 0:t.body),f=vr(n);if(i){const u=tm(f);return o.concat(f,f.visualViewport||[],Tl(n)?n:[],u&&r?fl(u):[])}return o.concat(n,fl(n,[],r))}function tm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zw(e){const o=ao(e);let r=parseFloat(o.width)||0,t=parseFloat(o.height)||0;const n=Do(e),i=n?e.offsetWidth:r,f=n?e.offsetHeight:t,u=Oh(r)!==i||Oh(t)!==f;return u&&(r=i,t=f),{width:r,height:t,$:u}}function zm(e){return io(e)?e:e.contextElement}function zs(e){const o=zm(e);if(!Do(o))return Ao(1);const r=o.getBoundingClientRect(),{width:t,height:n,$:i}=Zw(o);let f=(i?Oh(r.width):r.width)/t,u=(i?Oh(r.height):r.height)/n;return(!f||!Number.isFinite(f))&&(f=1),(!u||!Number.isFinite(u))&&(u=1),{x:f,y:u}}const FO=Ao(0);function eb(e){const o=vr(e);return!Bm()||!o.visualViewport?FO:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function RO(e,o,r){return o===void 0&&(o=!1),!r||o&&r!==vr(e)?!1:o}function Wa(e,o,r,t){o===void 0&&(o=!1),r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=zm(e);let f=Ao(1);o&&(t?io(t)&&(f=zs(t)):f=zs(e));const u=RO(i,r,t)?eb(i):Ao(0);let h=(n.left+u.x)/f.x,s=(n.top+u.y)/f.y,d=n.width/f.x,a=n.height/f.y;if(i){const l=vr(i),p=t&&io(t)?vr(t):t;let v=l,_=tm(v);for(;_&&t&&p!==v;){const w=zs(_),x=_.getBoundingClientRect(),m=ao(_),g=x.left+(_.clientLeft+parseFloat(m.paddingLeft))*w.x,b=x.top+(_.clientTop+parseFloat(m.paddingTop))*w.y;h*=w.x,s*=w.y,d*=w.x,a*=w.y,h+=g,s+=b,v=vr(_),_=tm(v)}}return Ih({width:d,height:a,x:h,y:s})}function Um(e,o){const r=of(e).scrollLeft;return o?o.left+r:Wa(Po(e)).left+r}function tb(e,o,r){r===void 0&&(r=!1);const t=e.getBoundingClientRect(),n=t.left+o.scrollLeft-(r?0:Um(e,t)),i=t.top+o.scrollTop;return{x:n,y:i}}function MO(e){let{elements:o,rect:r,offsetParent:t,strategy:n}=e;const i=n==="fixed",f=Po(t),u=o?rf(o.floating):!1;if(t===f||u&&i)return r;let h={scrollLeft:0,scrollTop:0},s=Ao(1);const d=Ao(0),a=Do(t);if((a||!a&&!i)&&((Ks(t)!=="body"||Tl(f))&&(h=of(t)),Do(t))){const p=Wa(t);s=zs(t),d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}const l=f&&!a&&!i?tb(f,h,!0):Ao(0);return{width:r.width*s.x,height:r.height*s.y,x:r.x*s.x-h.scrollLeft*s.x+d.x+l.x,y:r.y*s.y-h.scrollTop*s.y+d.y+l.y}}function LO(e){return Array.from(e.getClientRects())}function jO(e){const o=Po(e),r=of(e),t=e.ownerDocument.body,n=mr(o.scrollWidth,o.clientWidth,t.scrollWidth,t.clientWidth),i=mr(o.scrollHeight,o.clientHeight,t.scrollHeight,t.clientHeight);let f=-r.scrollLeft+Um(e);const u=-r.scrollTop;return ao(t).direction==="rtl"&&(f+=mr(o.clientWidth,t.clientWidth)-n),{width:n,height:i,x:f,y:u}}function BO(e,o){const r=vr(e),t=Po(e),n=r.visualViewport;let i=t.clientWidth,f=t.clientHeight,u=0,h=0;if(n){i=n.width,f=n.height;const s=Bm();(!s||s&&o==="fixed")&&(u=n.offsetLeft,h=n.offsetTop)}return{width:i,height:f,x:u,y:h}}function zO(e,o){const r=Wa(e,!0,o==="fixed"),t=r.top+e.clientTop,n=r.left+e.clientLeft,i=Do(e)?zs(e):Ao(1),f=e.clientWidth*i.x,u=e.clientHeight*i.y,h=n*i.x,s=t*i.y;return{width:f,height:u,x:h,y:s}}function H0(e,o,r){let t;if(o==="viewport")t=BO(e,r);else if(o==="document")t=jO(Po(e));else if(io(o))t=zO(o,r);else{const n=eb(e);t={x:o.x-n.x,y:o.y-n.y,width:o.width,height:o.height}}return Ih(t)}function nb(e,o){const r=Xi(e);return r===o||!io(r)||qs(r)?!1:ao(r).position==="fixed"||nb(r,o)}function UO(e,o){const r=o.get(e);if(r)return r;let t=fl(e,[],!1).filter(u=>io(u)&&Ks(u)!=="body"),n=null;const i=ao(e).position==="fixed";let f=i?Xi(e):e;for(;io(f)&&!qs(f);){const u=ao(f),h=jm(f);!h&&u.position==="fixed"&&(n=null),(i?!h&&!n:!h&&u.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Tl(f)&&!h&&nb(e,f))?t=t.filter(d=>d!==f):n=u,f=Xi(f)}return o.set(e,t),t}function VO(e){let{element:o,boundary:r,rootBoundary:t,strategy:n}=e;const f=[...r==="clippingAncestors"?rf(o)?[]:UO(o,this._c):[].concat(r),t],u=f[0],h=f.reduce((s,d)=>{const a=H0(o,d,n);return s.top=mr(a.top,s.top),s.right=Gi(a.right,s.right),s.bottom=Gi(a.bottom,s.bottom),s.left=mr(a.left,s.left),s},H0(o,u,n));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function HO(e){const{width:o,height:r}=Zw(e);return{width:o,height:r}}function $O(e,o,r){const t=Do(o),n=Po(o),i=r==="fixed",f=Wa(e,!0,i,o);let u={scrollLeft:0,scrollTop:0};const h=Ao(0);if(t||!t&&!i)if((Ks(o)!=="body"||Tl(n))&&(u=of(o)),t){const l=Wa(o,!0,i,o);h.x=l.x+o.clientLeft,h.y=l.y+o.clientTop}else n&&(h.x=Um(n));const s=n&&!t&&!i?tb(n,u):Ao(0),d=f.left+u.scrollLeft-h.x-s.x,a=f.top+u.scrollTop-h.y-s.y;return{x:d,y:a,width:f.width,height:f.height}}function tp(e){return ao(e).position==="static"}function $0(e,o){if(!Do(e)||ao(e).position==="fixed")return null;if(o)return o(e);let r=e.offsetParent;return Po(e)===r&&(r=r.ownerDocument.body),r}function rb(e,o){const r=vr(e);if(rf(e))return r;if(!Do(e)){let n=Xi(e);for(;n&&!qs(n);){if(io(n)&&!tp(n))return n;n=Xi(n)}return r}let t=$0(e,o);for(;t&&kO(t)&&tp(t);)t=$0(t,o);return t&&qs(t)&&tp(t)&&!jm(t)?r:t||IO(e)||r}const WO=async function(e){const o=this.getOffsetParent||rb,r=this.getDimensions,t=await r(e.floating);return{reference:$O(e.reference,await o(e.floating),e.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function GO(e){return ao(e).direction==="rtl"}const qO={convertOffsetParentRelativeRectToViewportRelativeRect:MO,getDocumentElement:Po,getClippingRect:VO,getOffsetParent:rb,getElementRects:WO,getClientRects:LO,getDimensions:HO,getScale:zs,isElement:io,isRTL:GO};function ob(e,o){return e.x===o.x&&e.y===o.y&&e.width===o.width&&e.height===o.height}function XO(e,o){let r=null,t;const n=Po(e);function i(){var u;clearTimeout(t),(u=r)==null||u.disconnect(),r=null}function f(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),i();const s=e.getBoundingClientRect(),{left:d,top:a,width:l,height:p}=s;if(u||o(),!l||!p)return;const v=Kc(a),_=Kc(n.clientWidth-(d+l)),w=Kc(n.clientHeight-(a+p)),x=Kc(d),g={rootMargin:-v+"px "+-_+"px "+-w+"px "+-x+"px",threshold:mr(0,Gi(1,h))||1};let b=!0;function S(E){const A=E[0].intersectionRatio;if(A!==h){if(!b)return f();A?f(!1,A):t=setTimeout(()=>{f(!1,1e-7)},1e3)}A===1&&!ob(s,e.getBoundingClientRect())&&f(),b=!1}try{r=new IntersectionObserver(S,{...g,root:n.ownerDocument})}catch{r=new IntersectionObserver(S,g)}r.observe(e)}return f(!0),i}function KO(e,o,r,t){t===void 0&&(t={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=t,s=zm(e),d=n||i?[...s?fl(s):[],...fl(o)]:[];d.forEach(x=>{n&&x.addEventListener("scroll",r,{passive:!0}),i&&x.addEventListener("resize",r)});const a=s&&u?XO(s,r):null;let l=-1,p=null;f&&(p=new ResizeObserver(x=>{let[m]=x;m&&m.target===s&&p&&(p.unobserve(o),cancelAnimationFrame(l),l=requestAnimationFrame(()=>{var g;(g=p)==null||g.observe(o)})),r()}),s&&!h&&p.observe(s),p.observe(o));let v,_=h?Wa(e):null;h&&w();function w(){const x=Wa(e);_&&!ob(_,x)&&r(),_=x,v=requestAnimationFrame(w)}return r(),()=>{var x;d.forEach(m=>{n&&m.removeEventListener("scroll",r),i&&m.removeEventListener("resize",r)}),a==null||a(),(x=p)==null||x.disconnect(),p=null,h&&cancelAnimationFrame(v)}}const YO=TO,JO=NO,QO=CO,ZO=OO,ek=AO,tk=EO,nk=PO,rk=(e,o,r)=>{const t=new Map,n={platform:qO,...r},i={...n.platform,_c:t};return SO(e,o,{...n,platform:i})};var af=e=>typeof e=="object"&&e!==null,Pa=e=>e?"":void 0,ok=1,ik=9,ak=11,Hn=e=>af(e)&&e.nodeType===ok&&typeof e.nodeName=="string",Vm=e=>af(e)&&e.nodeType===ik,sk=e=>af(e)&&e===e.window,ib=e=>Hn(e)?e.localName||"":"#document";function uk(e){return["html","body","#document"].includes(ib(e))}var lk=e=>af(e)&&e.nodeType!==void 0,dl=e=>lk(e)&&e.nodeType===ak&&"host"in e,ck=e=>Hn(e)&&e.localName==="input",hk=e=>!!(e!=null&&e.matches("a[href]")),fk=e=>Hn(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,dk=/(textarea|select)/;function pk(e){if(e==null||!Hn(e))return!1;try{return ck(e)&&e.selectionStart!=null||dk.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function pl(e,o){var t;if(!e||!o||!Hn(e)||!Hn(o))return!1;const r=(t=o.getRootNode)==null?void 0:t.call(o);if(e===o||e.contains(o))return!0;if(r&&dl(r)){let n=o;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function li(e){return Vm(e)?e:sk(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function mk(e){return li(e).documentElement}function Ys(e){var o;return dl(e)?Ys(e.host):Vm(e)?e.defaultView??window:Hn(e)?((o=e.ownerDocument)==null?void 0:o.defaultView)??window:window}function ab(e){let o=e.activeElement;for(;o!=null&&o.shadowRoot;){const r=o.shadowRoot.activeElement;if(r===o)break;o=r}return o}function gk(e){if(ib(e)==="html")return e;const o=e.assignedSlot||e.parentNode||dl(e)&&e.host||mk(e);return dl(o)?o.host:o}var np=new WeakMap;function sb(e){return np.has(e)||np.set(e,Ys(e).getComputedStyle(e)),np.get(e)}var Hm=()=>typeof document<"u";function yk(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}function vk(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:o,version:r})=>`${o}/${r}`).join(" "):navigator.userAgent}var $m=e=>Hm()&&e.test(yk()),_k=e=>Hm()&&e.test(vk()),xk=e=>Hm()&&e.test(navigator.vendor),wk=()=>$m(/^Mac/),bk=()=>Ek()&&xk(/apple/i),Sk=()=>_k(/firefox\//i),Ek=()=>$m(/mac|iphone|ipad|ipod/i),Ck=()=>$m(/iP(hone|ad|od)|iOS/);function Ak(e){var o,r,t;return((o=e.composedPath)==null?void 0:o.call(e))??((t=(r=e.nativeEvent)==null?void 0:r.composedPath)==null?void 0:t.call(r))}function ti(e){const o=Ak(e);return(o==null?void 0:o[0])??e.target}var Dk=e=>pl(e.currentTarget,ti(e));function Tk(e){return kk(e).isComposing}var Nk=e=>e.button===2||wk()&&e.ctrlKey&&e.button===0,Pk={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},W0={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ok(e,o={}){const{dir:r="ltr",orientation:t="horizontal"}=o;let n=e.key;return n=Pk[n]??n,r==="rtl"&&t==="horizontal"&&n in W0&&(n=W0[n]),n}function kk(e){return e.nativeEvent??e}var Eo=(e,o,r,t)=>{const n=typeof e=="function"?e():e;return n==null||n.addEventListener(o,r,t),()=>{n==null||n.removeEventListener(o,r,t)}};function Ik(e,o){const{type:r="HTMLInputElement",property:t="value"}=o,n=Ys(e)[r].prototype;return Object.getOwnPropertyDescriptor(n,t)??{}}function Fk(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Rk(e,o,r="value"){var n;const t=Fk(e);t&&((n=Ik(e,{type:t,property:r}).set)==null||n.call(e,o)),e.setAttribute(r,o)}var ub=e=>Hn(e)&&e.tagName==="IFRAME",Mk=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),Lk=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Wm="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Gm=(e,o=!1)=>{if(!e)return[];const r=Array.from(e.querySelectorAll(Wm));(o==!0||o=="if-empty"&&r.length===0)&&Hn(e)&&Hi(e)&&r.unshift(e);const n=r.filter(Hi);return n.forEach((i,f)=>{if(ub(i)&&i.contentDocument){const u=i.contentDocument.body;n.splice(f,1,...Gm(u))}}),n};function Hi(e){return!e||e.closest("[inert]")?!1:e.matches(Wm)&&fk(e)}function lb(e,o){if(!e)return[];const t=Array.from(e.querySelectorAll(Wm)).filter(Fa);return t.forEach((n,i)=>{if(ub(n)&&n.contentDocument){const f=n.contentDocument.body,u=lb(f);t.splice(i,1,...u)}}),t.length,t}function Fa(e){return e!=null&&e.tabIndex>0?!0:Hi(e)&&!Lk(e)}function Ru(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||pk(e))&&!Mk(e)?0:e.tabIndex}function G0(e){const o=new Set;function r(t){const n=globalThis.requestAnimationFrame(t);o.add(()=>globalThis.cancelAnimationFrame(n))}return r(()=>r(e)),function(){o.forEach(n=>n())}}function Kn(e){const o=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(o)}}function jk(e,o,r){const t=Kn(()=>{e.removeEventListener(o,n,!0),r()}),n=()=>{t(),r()};return e.addEventListener(o,n,{once:!0,capture:!0}),t}function Bk(e){const o=()=>e.click();Sk()?jk(e,"keyup",o):queueMicrotask(o)}function nm(e){const o=gk(e);return uk(o)?li(o).body:Hn(o)&&Uk(o)?o:nm(o)}var zk=/auto|scroll|overlay|hidden|clip/;function Uk(e){const o=Ys(e),{overflow:r,overflowX:t,overflowY:n,display:i}=o.getComputedStyle(e);return zk.test(r+n+t)&&!["inline","contents"].includes(i)}function Vk(e,o){return Array.from((e==null?void 0:e.querySelectorAll(o))??[])}var cb=e=>e.id;function hb(e,o,r=cb){return e.find(t=>r(t)===o)}function fb(e,o,r=cb){const t=hb(e,o,r);return t?e.indexOf(t):-1}function Hk(e,o,r=!0){let t=fb(e,o);return t=r?(t+1)%e.length:Math.min(t+1,e.length-1),e[t]}function $k(e,o,r=!0){let t=fb(e,o);return t===-1?r?e[e.length-1]:null:(t=r?(t-1+e.length)%e.length:Math.max(0,t-1),e[t])}function sf(e){const o={getRootNode:r=>{var t;return((t=r.getRootNode)==null?void 0:t.call(r))??document},getDoc:r=>li(o.getRootNode(r)),getWin:r=>o.getDoc(r).defaultView??window,getActiveElement:r=>ab(o.getRootNode(r)),isActiveElement:(r,t)=>t===o.getActiveElement(r),getById:(r,t)=>o.getRootNode(r).getElementById(t),setValue:(r,t)=>{r==null||t==null||Rk(r,t.toString())}};return{...o,...e}}var rp=new WeakMap;function Wk(e,o,r){rp.has(e)||rp.set(e,new Map);const t=rp.get(e),n=t.get(o);if(!n)return t.set(o,r()),()=>{var u;(u=t.get(o))==null||u(),t.delete(o)};const i=r(),f=()=>{i(),n(),t.delete(o)};return t.set(o,f),()=>{t.get(o)===f&&(i(),t.set(o,n))}}function Gk(e,o){return e?Wk(e,"style",()=>{const t=e.style.cssText;return Object.assign(e.style,o),()=>{e.style.cssText=t}}):()=>{}}var qk=1e3/60;function Xk(e,o){const r=e();if(Hn(r)&&r.isConnected)return o(r),()=>{};{const t=setInterval(()=>{const n=e();Hn(n)&&n.isConnected&&(o(n),clearInterval(t))},qk);return()=>clearInterval(t)}}function Kk(e,o){const r=[];return e==null||e.forEach(t=>{const n=Xk(t,o);r.push(n)}),()=>{r.forEach(t=>t())}}function q0(e=0,o=0,r=0,t=0){if(typeof DOMRect=="function")return new DOMRect(e,o,r,t);const n={x:e,y:o,width:r,height:t,top:o,right:e+r,bottom:o+t,left:e};return{...n,toJSON:()=>n}}function Yk(e){if(!e)return q0();const{x:o,y:r,width:t,height:n}=e;return q0(o,r,t,n)}function Jk(e,o){return{contextElement:Hn(e)?e:void 0,getBoundingClientRect:()=>{const r=e,t=o==null?void 0:o(r);return t||!r?Yk(t):r.getBoundingClientRect()}}}var Mu=e=>({variable:e,reference:`var(${e})`}),Yo={arrowSize:Mu("--arrow-size"),arrowSizeHalf:Mu("--arrow-size-half"),arrowBg:Mu("--arrow-background"),transformOrigin:Mu("--transform-origin"),arrowOffset:Mu("--arrow-offset")},Qk=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),Zk={name:"transformOrigin",fn({placement:e,elements:o,middlewareData:r}){const{arrow:t}=r,n=Qk(t)[e],{floating:i}=o;return i.style.setProperty(Yo.transformOrigin.variable,n),{data:{transformOrigin:n}}}},e2={name:"rects",fn({rects:e}){return{data:e}}},t2=e=>{if(e)return{name:"shiftArrow",fn({placement:o,middlewareData:r}){if(!r.arrow)return{};const{x:t,y:n}=r.arrow,i=o.split("-")[0];return Object.assign(e.style,{left:t!=null?`${t}px`:"",top:n!=null?`${n}px`:"",[i]:`calc(100% + ${Yo.arrowOffset.reference})`}),{}}}};function n2(e){const[o,r]=e.split("-");return{side:o,align:r,hasAlign:r!=null}}var r2={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function X0(e,o){const r=e.devicePixelRatio||1;return Math.round(o*r)/r}function db(e){return Jp(e.boundary)}function o2(e,o){if(e)return tk({element:e,padding:o.arrowPadding})}function i2(e,o){if(!IP(o.offset??o.gutter))return YO(({placement:r})=>{var s,d;const t=((e==null?void 0:e.clientHeight)||0)/2,n=((s=o.offset)==null?void 0:s.mainAxis)??o.gutter,i=typeof n=="number"?n+t:n??t,{hasAlign:f}=n2(r),u=f?void 0:o.shift,h=((d=o.offset)==null?void 0:d.crossAxis)??u;return Ji({crossAxis:h,mainAxis:i,alignmentAxis:o.shift})})}function a2(e){if(e.flip)return QO({boundary:db(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function s2(e){if(!(!e.slide&&!e.overlap))return JO({boundary:db(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:nk()})}function u2(e){return ZO({padding:e.overflowPadding,apply({elements:o,rects:r,availableHeight:t,availableWidth:n}){const i=o.floating,f=Math.round(r.reference.width);n=Math.floor(n),t=Math.floor(t),i.style.setProperty("--reference-width",`${f}px`),i.style.setProperty("--available-width",`${n}px`),i.style.setProperty("--available-height",`${t}px`)}})}function l2(e){var o;if(e.hideWhenDetached)return ek({strategy:"referenceHidden",boundary:((o=e.boundary)==null?void 0:o.call(e))??"clippingAncestors"})}function c2(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function h2(e,o,r={}){const t=Jk(e,r.getAnchorRect);if(!o||!t)return;const n=Object.assign({},r2,r),i=o.querySelector("[data-part=arrow]"),f=[i2(i,n),a2(n),s2(n),o2(i,n),t2(i),Zk,u2(n),l2(n),e2],{placement:u,strategy:h,onComplete:s,onPositioned:d}=n,a=async()=>{var b;if(!t||!o)return;const _=await rk(t,o,{placement:u,middleware:f,strategy:h});s==null||s(_),d==null||d({placed:!0});const w=Ys(o),x=X0(w,_.x),m=X0(w,_.y);o.style.setProperty("--x",`${x}px`),o.style.setProperty("--y",`${m}px`),n.hideWhenDetached&&(((b=_.middlewareData.hide)==null?void 0:b.referenceHidden)?(o.style.setProperty("visibility","hidden"),o.style.setProperty("pointer-events","none")):(o.style.removeProperty("visibility"),o.style.removeProperty("pointer-events")));const g=o.firstElementChild;if(g){const S=sb(g);o.style.setProperty("--z-index",S.zIndex)}},l=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:a}),d==null||d({placed:!0})):await a()},p=c2(n.listeners),v=n.listeners?KO(t,o,l,p):Rw;return l(),()=>{v==null||v(),d==null||d({placed:!1})}}function K0(e,o,r={}){const{defer:t,...n}=r,i=t?Kn:u=>u(),f=[];return f.push(i(()=>{const u=typeof e=="function"?e():e,h=typeof o=="function"?o():o;f.push(h2(u,h,n))})),()=>{f.forEach(u=>u==null?void 0:u())}}var f2={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function d2(e={}){const{placement:o,sameWidth:r,fitViewport:t,strategy:n="absolute"}=e;return{arrow:{position:"absolute",width:Yo.arrowSize.reference,height:Yo.arrowSize.reference,[Yo.arrowSizeHalf.variable]:`calc(${Yo.arrowSize.reference} / 2)`,[Yo.arrowOffset.variable]:`calc(${Yo.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:o?f2[o.split("-")[0]]:void 0,background:Yo.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:n,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:t?"var(--available-width)":void 0,maxHeight:t?"var(--available-height)":void 0,top:"0px",left:"0px",transform:o?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function p2(e){const o={each(r){var t;for(let n=0;n<((t=e.frames)==null?void 0:t.length);n+=1){const i=e.frames[n];i&&r(i)}},addEventListener(r,t,n){return o.each(i=>{try{i.document.addEventListener(r,t,n)}catch{}}),()=>{try{o.removeEventListener(r,t,n)}catch{}}},removeEventListener(r,t,n){o.each(i=>{try{i.document.removeEventListener(r,t,n)}catch{}})}};return o}function m2(e){const o=e.frameElement!=null?e.parent:null;return{addEventListener:(r,t,n)=>{try{o==null||o.addEventListener(r,t,n)}catch{}return()=>{try{o==null||o.removeEventListener(r,t,n)}catch{}}},removeEventListener:(r,t,n)=>{try{o==null||o.removeEventListener(r,t,n)}catch{}}}}var Y0="pointerdown.outside",J0="focus.outside";function g2(e){for(const o of e)if(Hn(o)&&Hi(o))return!0;return!1}var pb=e=>"clientY"in e;function y2(e,o){if(!pb(o)||!e)return!1;const r=e.getBoundingClientRect();return r.width===0||r.height===0?!1:r.top<=o.clientY&&o.clientY<=r.top+r.height&&r.left<=o.clientX&&o.clientX<=r.left+r.width}function v2(e,o){return e.y<=o.y&&o.y<=e.y+e.height&&e.x<=o.x&&o.x<=e.x+e.width}function Q0(e,o){if(!o||!pb(e))return!1;const r=o.scrollHeight>o.clientHeight,t=r&&e.clientX>o.offsetLeft+o.clientWidth,n=o.scrollWidth>o.clientWidth,i=n&&e.clientY>o.offsetTop+o.clientHeight,f={x:o.offsetLeft,y:o.offsetTop,width:o.clientWidth+(r?16:0),height:o.clientHeight+(n?16:0)},u={x:e.clientX,y:e.clientY};return v2(f,u)?t||i:!1}function _2(e,o){const{exclude:r,onFocusOutside:t,onPointerDownOutside:n,onInteractOutside:i,defer:f}=o;if(!e)return;const u=li(e),h=Ys(e),s=p2(h),d=m2(h);function a(x){const m=ti(x);if(!Hn(m)||!m.isConnected||pl(e,m)||y2(e,x))return!1;const g=u.querySelector(`[aria-controls="${e.id}"]`);if(g){const S=nm(g);if(Q0(x,S))return!1}const b=nm(e);return Q0(x,b)?!1:!(r!=null&&r(m))}const l=new Set;function p(x){function m(){var S;const g=f?Kn:E=>E(),b=((S=x.composedPath)==null?void 0:S.call(x))??[x.target];g(()=>{if(!(!e||!a(x))){if(n||i){const E=Qp(n,i);e.addEventListener(Y0,E,{once:!0})}Z0(e,Y0,{bubbles:!1,cancelable:!0,detail:{originalEvent:x,contextmenu:Nk(x),focusable:g2(b)}})}})}x.pointerType==="touch"?(l.forEach(g=>g()),l.add(Eo(u,"click",m,{once:!0})),l.add(d.addEventListener("click",m,{once:!0})),l.add(s.addEventListener("click",m,{once:!0}))):m()}const v=new Set,_=setTimeout(()=>{v.add(Eo(u,"pointerdown",p,!0)),v.add(d.addEventListener("pointerdown",p,!0)),v.add(s.addEventListener("pointerdown",p,!0))},0);function w(x){(f?Kn:g=>g())(()=>{if(!(!e||!a(x))){if(t||i){const g=Qp(t,i);e.addEventListener(J0,g,{once:!0})}Z0(e,J0,{bubbles:!1,cancelable:!0,detail:{originalEvent:x,contextmenu:!1,focusable:Hi(ti(x))}})}})}return v.add(Eo(u,"focusin",w,!0)),v.add(d.addEventListener("focusin",w,!0)),v.add(s.addEventListener("focusin",w,!0)),()=>{clearTimeout(_),l.forEach(x=>x()),v.forEach(x=>x())}}function x2(e,o){const{defer:r}=o,t=r?Kn:i=>i(),n=[];return n.push(t(()=>{const i=typeof e=="function"?e():e;n.push(_2(i,o))})),()=>{n.forEach(i=>i==null?void 0:i())}}function Z0(e,o,r){const t=e.ownerDocument.defaultView||window,n=new t.CustomEvent(o,r);return e.dispatchEvent(n)}function w2(e,o){const r=t=>{t.key==="Escape"&&(t.isComposing||o==null||o(t))};return Eo(li(e),"keydown",r,{capture:!0})}var Zr={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var t;const o=this.indexOf(e),r=this.topMostPointerBlockingLayer()?this.indexOf((t=this.topMostPointerBlockingLayer())==null?void 0:t.node):-1;return opl(r.node,o))},isInBranch(e){return Array.from(this.branches).some(o=>pl(o,e))},add(e){const o=this.layers.push(e);e.node.style.setProperty("--layer-index",`${o}`)},addBranch(e){this.branches.push(e)},remove(e){const o=this.indexOf(e);o<0||(ot.dismiss()),this.layers.splice(o,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const o=this.branches.indexOf(e);o>=0&&this.branches.splice(o,1)},indexOf(e){return this.layers.findIndex(o=>o.node===e)},dismiss(e){var o;(o=this.layers[this.indexOf(e)])==null||o.dismiss()},clear(){this.remove(this.layers[0].node)}},e_;function t_(){Zr.layers.forEach(({node:e})=>{e.style.pointerEvents=Zr.isBelowPointerBlockingLayer(e)?"none":"auto"})}function b2(e){e.style.pointerEvents=""}function S2(e,o){const r=li(e),t=[];if(Zr.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(e_=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","")})),o){const n=Kk(o,i=>{t.push(Gk(i,{pointerEvents:"auto"}))});t.push(n)}return()=>{Zr.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=e_,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style")}),t.forEach(n=>n()))}}function E2(e,o){if(!e){fh("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:r,pointerBlocking:t,exclude:n,debug:i}=o,f={dismiss:r,node:e,pointerBlocking:t};Zr.add(f),t_();function u(l){var v,_;const p=ti(l.detail.originalEvent);Zr.isBelowPointerBlockingLayer(e)||Zr.isInBranch(p)||((v=o.onPointerDownOutside)==null||v.call(o,l),(_=o.onInteractOutside)==null||_.call(o,l),!l.defaultPrevented&&(i&&console.log("onPointerDownOutside:",l.detail.originalEvent),r==null||r()))}function h(l){var v,_;const p=ti(l.detail.originalEvent);Zr.isInBranch(p)||((v=o.onFocusOutside)==null||v.call(o,l),(_=o.onInteractOutside)==null||_.call(o,l),!l.defaultPrevented&&(i&&console.log("onFocusOutside:",l.detail.originalEvent),r==null||r()))}function s(l){var p;Zr.isTopMost(e)&&((p=o.onEscapeKeyDown)==null||p.call(o,l),!l.defaultPrevented&&r&&(l.preventDefault(),r()))}function d(l){var w;if(!e)return!1;const p=typeof n=="function"?n():n,v=Array.isArray(p)?p:[p],_=(w=o.persistentElements)==null?void 0:w.map(x=>x()).filter(Hn);return _&&v.push(..._),v.some(x=>pl(x,l))||Zr.isInNestedLayer(e,l)}const a=[t?S2(e,o.persistentElements):void 0,w2(e,s),x2(e,{exclude:d,onFocusOutside:h,onPointerDownOutside:u,defer:o.defer})];return()=>{Zr.remove(e),t_(),b2(e),a.forEach(l=>l==null?void 0:l())}}function mb(e,o){const{defer:r}=o,t=r?Kn:i=>i(),n=[];return n.push(t(()=>{const i=cl(e)?e():e;n.push(E2(i,o))})),()=>{n.forEach(i=>i==null?void 0:i())}}var C2=Ua("hoverCard").parts("arrow","arrowTip","trigger","positioner","content"),Lu=C2.build(),Vn=sf({getTriggerId:e=>{var o;return((o=e.ids)==null?void 0:o.trigger)??`hover-card:${e.id}:trigger`},getContentId:e=>{var o;return((o=e.ids)==null?void 0:o.content)??`hover-card:${e.id}:content`},getPositionerId:e=>{var o;return((o=e.ids)==null?void 0:o.positioner)??`hover-card:${e.id}:popper`},getArrowId:e=>{var o;return((o=e.ids)==null?void 0:o.arrow)??`hover-card:${e.id}:arrow`},getTriggerEl:e=>Vn.getById(e,Vn.getTriggerId(e)),getContentEl:e=>Vn.getById(e,Vn.getContentId(e)),getPositionerEl:e=>Vn.getById(e,Vn.getPositionerId(e))});function A2(e,o,r){const t=e.hasTag("open"),n=d2({...e.context.positioning,placement:e.context.currentPlacement});return{open:t,setOpen(i){i!==t&&o(i?"OPEN":"CLOSE")},reposition(i={}){o({type:"POSITIONING.SET",options:i})},getArrowProps(){return r.element({id:Vn.getArrowId(e.context),...Lu.arrow.attrs,dir:e.context.dir,style:n.arrow})},getArrowTipProps(){return r.element({...Lu.arrowTip.attrs,dir:e.context.dir,style:n.arrowTip})},getTriggerProps(){return r.element({...Lu.trigger.attrs,dir:e.context.dir,"data-placement":e.context.currentPlacement,id:Vn.getTriggerId(e.context),"data-state":t?"open":"closed",onPointerEnter(i){i.pointerType!=="touch"&&o({type:"POINTER_ENTER",src:"trigger"})},onPointerLeave(i){i.pointerType!=="touch"&&o({type:"POINTER_LEAVE",src:"trigger"})},onFocus(){o("TRIGGER_FOCUS")},onBlur(){o("TRIGGER_BLUR")}})},getPositionerProps(){return r.element({id:Vn.getPositionerId(e.context),...Lu.positioner.attrs,dir:e.context.dir,style:n.floating})},getContentProps(){return r.element({...Lu.content.attrs,dir:e.context.dir,id:Vn.getContentId(e.context),hidden:!t,"data-state":t?"open":"closed","data-placement":e.context.currentPlacement,onPointerEnter(i){i.pointerType!=="touch"&&o({type:"POINTER_ENTER",src:"content"})},onPointerLeave(i){i.pointerType!=="touch"&&o({type:"POINTER_LEAVE",src:"content"})}})}}}var{not:Yc,and:n_}=Vw;function D2(e){const o=Ji(e);return Sl({id:"hover-card",initial:o.open?"open":"closed",context:{openDelay:700,closeDelay:300,currentPlacement:void 0,...o,positioning:{placement:"bottom",...o.positioning}},watch:{open:["toggleVisibility"]},states:{closed:{tags:["closed"],entry:["clearIsPointer"],on:{"CONTROLLED.OPEN":"open",POINTER_ENTER:{target:"opening",actions:["setIsPointer"]},TRIGGER_FOCUS:"opening",OPEN:"opening"}},opening:{tags:["closed"],after:{OPEN_DELAY:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",POINTER_LEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:n_("isOpenControlled",Yc("isPointer")),actions:["invokeOnClose","toggleVisibility"]},{guard:Yc("isPointer"),target:"closed",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{tags:["open"],activities:["trackDismissableElement","trackPositioning"],on:{"CONTROLLED.CLOSE":"closed",POINTER_ENTER:{actions:["setIsPointer"]},POINTER_LEAVE:"closing",CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:n_("isOpenControlled",Yc("isPointer")),actions:["invokeOnClose"]},{guard:Yc("isPointer"),target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:"reposition"}}},closing:{tags:["open"],activities:["trackPositioning"],after:{CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]},on:{"CONTROLLED.CLOSE":"closed","CONTROLLED.OPEN":"open",POINTER_ENTER:{target:"open",actions:["setIsPointer"]}}}}},{delays:{OPEN_DELAY:r=>r.openDelay,CLOSE_DELAY:r=>r.closeDelay},guards:{isPointer:r=>!!r.isPointer,isOpenControlled:r=>!!r["open.controlled"]},activities:{trackPositioning(r){r.currentPlacement||(r.currentPlacement=r.positioning.placement);const t=()=>Vn.getPositionerEl(r);return K0(Vn.getTriggerEl(r),t,{...r.positioning,defer:!0,onComplete(n){r.currentPlacement=n.placement}})},trackDismissableElement(r,t,{send:n}){return mb(()=>Vn.getContentEl(r),{defer:!0,exclude:[Vn.getTriggerEl(r)],onDismiss(){n({type:"CLOSE",src:"interact-outside"})},onFocusOutside(f){f.preventDefault()}})}},actions:{invokeOnClose(r){var t;(t=r.onOpenChange)==null||t.call(r,{open:!1})},invokeOnOpen(r){var t;(t=r.onOpenChange)==null||t.call(r,{open:!0})},setIsPointer(r){r.isPointer=!0},clearIsPointer(r){r.isPointer=!1},reposition(r,t){const n=()=>Vn.getPositionerEl(r);K0(Vn.getTriggerEl(r),n,{...r.positioning,...t.options,defer:!0,listeners:!1,onComplete(i){r.currentPlacement=i.placement}})},toggleVisibility(r,t,{send:n}){queueMicrotask(()=>{n({type:r.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})})}}})}Ga()(["closeDelay","dir","getRootNode","id","ids","onOpenChange","open.controlled","open","openDelay","positioning"]);const[XL,Nl]=qa({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[KL,uf]=qa({name:"LocaleContext",hookName:"useLocaleContext",providerName:"",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),T2=(e={})=>{const{getRootNode:o}=Nl(),{dir:r}=uf(),t={id:ae.useId(),dir:r,getRootNode:o,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e},n={...t,open:e.open,onOpenChange:Vi(e.onOpenChange,{sync:!0})},[i,f]=El(D2(t),{context:n});return A2(i,f,Zh)},N2=e=>{const[o,{children:r,...t}]=Kw(e),n=T2(t),i=tf(An({present:n.open},o));return Q.jsx(lO,{value:n,children:Q.jsx(Fm,{value:i,children:r})})},gb=ae.forwardRef((e,o)=>{const r=Al(),t=An(r.getTriggerProps(),e);return Q.jsx(Yn.button,{...t,ref:o})});gb.displayName="HoverCardTrigger";const qm=e=>{var h;const{children:o,disabled:r}=e,[t,n]=ae.useState((h=e.container)==null?void 0:h.current),i=ae.useSyncExternalStore(O2,()=>!1,()=>!0),{getRootNode:f}=Nl();if(ae.useEffect(()=>{n(()=>{var s;return(s=e.container)==null?void 0:s.current})},[e.container]),i||r)return Q.jsx(Q.Fragment,{children:o});const u=t??P2(f);return Q.jsx(Q.Fragment,{children:ae.Children.map(o,s=>KD.createPortal(s,u))})},P2=e=>{const o=e==null?void 0:e(),r=o.getRootNode();return dl(r)?r:li(o).body},O2=()=>()=>{},[yb,vb]=qa({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:""}),_b=e=>Dl()(e,["lazyMount","unmountOnExit"]);function k2(e,o){const[r,t]=ae.useState(e);return ae.useEffect(()=>{const n=setTimeout(()=>{t(e)},o);return()=>{clearTimeout(n)}},[e,o]),r}const[I2,Xm]=qa({name:"TabsContext",hookName:"useTabsContext",providerName:""}),$i=ae.forwardRef((e,o)=>{const[r,t]=Dl()(e,["value"]),n=Xm(),i=vb(),f=tf({...i,present:k2(n.value===e.value,0),immediate:!0}),u=An(n.getContentProps(r),f.getPresenceProps(),t);return Q.jsx(Fm,{value:f,children:f.unmounted?null:Q.jsx(Yn.div,{...u,ref:Cl(f.ref,o)})})});$i.displayName="TabContent";const lf=ae.forwardRef((e,o)=>{const r=Xm(),t=An(r.getListProps(),e);return Q.jsx(Yn.div,{...t,ref:o})});lf.displayName="TabList";const Wi=ae.forwardRef((e,o)=>{const[r,t]=Dl()(e,["disabled","value"]),n=Xm(),i=An(n.getTriggerProps(r),t);return Q.jsx(Yn.button,{...i,ref:o})});Wi.displayName="TabTrigger";var rm,Ra=new Map,F2=e=>e.getBoundingClientRect();function R2(e,o){const{scope:r="rect",getRect:t=F2,onChange:n}=o,i=M2({scope:r,getRect:t}),f=Ra.get(e);return f?(f.callbacks.push(n),n(t(e))):(Ra.set(e,{rect:{},callbacks:[n]}),Ra.size===1&&(rm=requestAnimationFrame(i))),function(){const h=Ra.get(e);if(!h)return;const s=h.callbacks.indexOf(n);s>-1&&h.callbacks.splice(s,1),h.callbacks.length===0&&(Ra.delete(e),Ra.size===0&&cancelAnimationFrame(rm))}}function M2(e){const{scope:o,getRect:r}=e,t=j2(o);return function n(){const i=[];Ra.forEach((f,u)=>{const h=r(u);t(f.rect,h)||(f.rect=h,i.push(f))}),i.forEach(f=>{f.callbacks.forEach(u=>u(f.rect))}),rm=requestAnimationFrame(n)}}var xb=(e,o)=>e.width===o.width&&e.height===o.height,wb=(e,o)=>e.top===o.top&&e.left===o.left,L2=(e,o)=>xb(e,o)&&wb(e,o);function j2(e){return e==="size"?xb:e==="position"?wb:L2}var B2=Ua("tabs").parts("root","list","trigger","content","indicator"),ju=B2.build(),Ot=sf({getRootId:e=>{var o;return((o=e.ids)==null?void 0:o.root)??`tabs:${e.id}`},getListId:e=>{var o;return((o=e.ids)==null?void 0:o.list)??`tabs:${e.id}:list`},getContentId:(e,o)=>{var r;return((r=e.ids)==null?void 0:r.content)??`tabs:${e.id}:content-${o}`},getTriggerId:(e,o)=>{var r;return((r=e.ids)==null?void 0:r.trigger)??`tabs:${e.id}:trigger-${o}`},getIndicatorId:e=>{var o;return((o=e.ids)==null?void 0:o.indicator)??`tabs:${e.id}:indicator`},getListEl:e=>Ot.getById(e,Ot.getListId(e)),getContentEl:(e,o)=>Ot.getById(e,Ot.getContentId(e,o)),getTriggerEl:(e,o)=>Ot.getById(e,Ot.getTriggerId(e,o)),getIndicatorEl:e=>Ot.getById(e,Ot.getIndicatorId(e)),getElements:e=>{const r=`[role=tab][data-ownedby='${CSS.escape(Ot.getListId(e))}']:not([disabled])`;return Vk(Ot.getListEl(e),r)},getFirstTriggerEl:e=>NP(Ot.getElements(e)),getLastTriggerEl:e=>PP(Ot.getElements(e)),getNextTriggerEl:(e,o)=>Hk(Ot.getElements(e),Ot.getTriggerId(e,o),e.loopFocus),getPrevTriggerEl:(e,o)=>$k(Ot.getElements(e),Ot.getTriggerId(e,o),e.loopFocus),getSelectedContentEl:e=>{if(e.value)return Ot.getContentEl(e,e.value)},getSelectedTriggerEl:e=>{if(e.value)return Ot.getTriggerEl(e,e.value)},getOffsetRect:e=>({left:(e==null?void 0:e.offsetLeft)??0,top:(e==null?void 0:e.offsetTop)??0,width:(e==null?void 0:e.offsetWidth)??0,height:(e==null?void 0:e.offsetHeight)??0}),getRectById:(e,o)=>{const r=hb(Ot.getElements(e),Ot.getTriggerId(e,o));return Ot.resolveRect(Ot.getOffsetRect(r))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function z2(e,o,r){const t=e.context.translations,n=e.matches("focused"),i=e.context.orientation==="vertical",f=e.context.orientation==="horizontal",u=e.context.composite,h=e.context.indicatorState;function s(d){return{selected:e.context.value===d.value,focused:e.context.focusedValue===d.value,disabled:!!d.disabled}}return{value:e.context.value,focusedValue:e.context.focusedValue,setValue(d){o({type:"SET_VALUE",value:d})},clearValue(){o({type:"CLEAR_VALUE"})},setIndicatorRect(d){const a=Ot.getTriggerId(e.context,d);o({type:"SET_INDICATOR_RECT",id:a})},syncTabIndex(){o("SYNC_TAB_INDEX")},selectNext(d){o({type:"TAB_FOCUS",value:d,src:"selectNext"}),o({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(d){o({type:"TAB_FOCUS",value:d,src:"selectPrev"}),o({type:"ARROW_PREV",src:"selectPrev"})},focus(){var d;(d=Ot.getSelectedTriggerEl(e.context))==null||d.focus()},getRootProps(){return r.element({...ju.root.attrs,id:Ot.getRootId(e.context),"data-orientation":e.context.orientation,"data-focus":Pa(n),dir:e.context.dir})},getListProps(){return r.element({...ju.list.attrs,id:Ot.getListId(e.context),role:"tablist",dir:e.context.dir,"data-focus":Pa(n),"aria-orientation":e.context.orientation,"data-orientation":e.context.orientation,"aria-label":t==null?void 0:t.listLabel,onKeyDown(d){if(d.defaultPrevented||!Dk(d)||Tk(d))return;const a={ArrowDown(){f||o({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){f||o({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){i||o({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){i||o({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){o("HOME")},End(){o("END")},Enter(){o({type:"ENTER"})}};let l=Ok(d,e.context);const p=a[l];p&&(d.preventDefault(),p(d))}})},getTriggerState:s,getTriggerProps(d){const{value:a,disabled:l}=d,p=s(d);return r.button({...ju.trigger.attrs,role:"tab",type:"button",disabled:l,dir:e.context.dir,"data-orientation":e.context.orientation,"data-disabled":Pa(l),"aria-disabled":l,"data-value":a,"aria-selected":p.selected,"data-selected":Pa(p.selected),"data-focus":Pa(p.focused),"aria-controls":p.selected?Ot.getContentId(e.context,a):void 0,"data-ownedby":Ot.getListId(e.context),"data-ssr":Pa(e.context.ssr),id:Ot.getTriggerId(e.context,a),tabIndex:p.selected&&u?0:-1,onFocus(){o({type:"TAB_FOCUS",value:a})},onBlur(v){const _=v.relatedTarget;(_==null?void 0:_.getAttribute("role"))!=="tab"&&o({type:"TAB_BLUR"})},onClick(v){v.defaultPrevented||l||(bk()&&v.currentTarget.focus(),o({type:"TAB_CLICK",value:a}))}})},getContentProps(d){const{value:a}=d,l=e.context.value===a;return r.element({...ju.content.attrs,dir:e.context.dir,id:Ot.getContentId(e.context,a),tabIndex:u?0:-1,"aria-labelledby":Ot.getTriggerId(e.context,a),role:"tabpanel","data-ownedby":Ot.getListId(e.context),"data-selected":Pa(l),"data-orientation":e.context.orientation,hidden:!l})},getIndicatorProps(){var d,a,l,p;return r.element({id:Ot.getIndicatorId(e.context),...ju.indicator.attrs,dir:e.context.dir,"data-orientation":e.context.orientation,style:{"--transition-property":"left, right, top, bottom, width, height","--left":(d=h.rect)==null?void 0:d.left,"--top":(a=h.rect)==null?void 0:a.top,"--width":(l=h.rect)==null?void 0:l.width,"--height":(p=h.rect)==null?void 0:p.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:h.transition?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[f?"left":"top"]:f?"var(--left)":"var(--top)"}})}}}var{not:U2}=Vw;function V2(e){const o=Ji(e);return Sl({initial:"idle",context:{dir:"ltr",orientation:"horizontal",activationMode:"automatic",value:null,loopFocus:!0,composite:!0,navigate(r){Bk(r.node)},...o,focusedValue:o.value??null,ssr:!0,indicatorState:{rendered:!1,transition:!1,rect:{left:"0px",top:"0px",width:"0px",height:"0px"}}},watch:{value:["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"],dir:["syncIndicatorRect"],orientation:["syncIndicatorRect"]},on:{SET_VALUE:{actions:"setValue"},CLEAR_VALUE:{actions:"clearValue"},SET_INDICATOR_RECT:{actions:"setIndicatorRect"},SYNC_TAB_INDEX:{actions:"syncTabIndex"}},created:["syncFocusedValue"],entry:["checkRenderedElements","syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:"setFocusedValue"},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:"focusPrevTab"}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:"focusNextTab"}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:"focusFirstTab"}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:"focusLastTab"}],ENTER:{guard:U2("selectOnFocus"),actions:"selectFocusedTab"},TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:"clearFocusedValue"}}}}},{guards:{selectOnFocus:r=>r.activationMode==="automatic"},actions:{syncFocusedValue(r){r.value!=null&&r.focusedValue==null&&(r.focusedValue=r.value)},selectFocusedTab(r){Kn(()=>{const n=r.deselectable&&r.value===r.focusedValue?null:r.focusedValue;Oa.value(r,n)})},setFocusedValue(r,t){t.value!=null&&Oa.focusedValue(r,t.value)},clearFocusedValue(r){Oa.focusedValue(r,null)},setValue(r,t){const i=r.deselectable&&r.value===r.focusedValue?null:t.value;Oa.value(r,i)},clearValue(r){Oa.value(r,null)},focusFirstTab(r){Kn(()=>{var t;(t=Ot.getFirstTriggerEl(r))==null||t.focus()})},focusLastTab(r){Kn(()=>{var t;(t=Ot.getLastTriggerEl(r))==null||t.focus()})},focusNextTab(r){if(!r.focusedValue)return;const t=Ot.getNextTriggerEl(r,r.focusedValue);Kn(()=>{r.composite?t==null||t.focus():(t==null?void 0:t.dataset.value)!=null&&Oa.focusedValue(r,t.dataset.value)})},focusPrevTab(r){if(!r.focusedValue)return;const t=Ot.getPrevTriggerEl(r,r.focusedValue);Kn(()=>{r.composite?t==null||t.focus():(t==null?void 0:t.dataset.value)!=null&&Oa.focusedValue(r,t.dataset.value)})},checkRenderedElements(r){r.indicatorState.rendered=!!Ot.getIndicatorEl(r)},syncTabIndex(r){Kn(()=>{const t=Ot.getSelectedContentEl(r);if(!t)return;Gm(t).length>0?t.removeAttribute("tabindex"):t.setAttribute("tabindex","0")})},cleanupObserver(r){var t;(t=r.indicatorCleanup)==null||t.call(r)},allowIndicatorTransition(r){r.indicatorState.transition=!0},setIndicatorRect(r,t){const n=t.id??r.value;!r.indicatorState.rendered||!n||!Ot.getTriggerEl(r,n)||(r.indicatorState.rect=Ot.getRectById(r,n),G0(()=>{r.indicatorState.transition=!1}))},syncSsr(r){r.ssr=!1},syncIndicatorRect(r){var i;(i=r.indicatorCleanup)==null||i.call(r);const t=r.value;if(!r.indicatorState.rendered||!t)return;const n=Ot.getSelectedTriggerEl(r);n&&(r.indicatorCleanup=R2(n,{getRect(f){return Ot.getOffsetRect(f)},onChange(f){r.indicatorState.rect=Ot.resolveRect(f),G0(()=>{r.indicatorState.transition=!1})}}))},navigateIfNeeded(r){const t=Ot.getSelectedTriggerEl(r);hk(t)&&r.navigate({value:r.value,node:t})}}})}var r_={change:e=>{var o;e.value!=null&&((o=e.onValueChange)==null||o.call(e,{value:e.value}))},focusChange:e=>{var o;e.focusedValue!=null&&((o=e.onFocusChange)==null||o.call(e,{focusedValue:e.focusedValue}))}},Oa={value:(e,o)=>{ll(o,e.value)||(e.value=o,r_.change(e))},focusedValue:(e,o)=>{ll(o,e.focusedValue)||(e.focusedValue=o,r_.focusChange(e))}};Ga()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]);Ga()(["disabled","value"]);Ga()(["value"]);const H2=(e={})=>{const{getRootNode:o}=Nl(),{dir:r}=uf(),t={id:ae.useId(),dir:r,getRootNode:o,value:e.defaultValue,...e},n={...t,value:e.value,onValueChange:Vi(e.onValueChange,{sync:!0}),onFocusChange:Vi(e.onFocusChange)},[i,f]=El(V2(t),{context:n});return z2(i,f,Zh)},cf=ae.forwardRef((e,o)=>{const[r,t]=_b(e),[n,i]=Dl()(t,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),f=H2(n),u=An(f.getRootProps(),i);return Q.jsx(I2,{value:f,children:Q.jsx(yb,{value:r,children:Q.jsx(Yn.div,{...u,ref:o})})})});cf.displayName="TabsRoot";var bb={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o_=Nn.createContext&&Nn.createContext(bb),$2=["attr","size","title"];function W2(e,o){if(e==null)return{};var r=G2(e,o),t,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function G2(e,o){if(e==null)return{};var r={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(o.indexOf(t)>=0)continue;r[t]=e[t]}return r}function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var o=1;oNn.createElement(o.tag,Rh({key:r},o.attr),Sb(o.child)))}function Rr(e){return o=>Nn.createElement(Y2,Fh({attr:Rh({},e.attr)},o),Sb(e.child))}function Y2(e){var o=r=>{var{attr:t,size:n,title:i}=e,f=W2(e,$2),u=n||r.size||"1em",h;return r.className&&(h=r.className),e.className&&(h=(h?h+" ":"")+e.className),Nn.createElement("svg",Fh({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,t,f,{className:h,style:Rh(Rh({color:e.color||r.color},r.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),i&&Nn.createElement("title",null,i),e.children)};return o_!==void 0?Nn.createElement(o_.Consumer,null,r=>o(r)):o(bb)}function J2(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Q2(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5a2.5 2.5 0 0 0-5 0V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5a2.5 2.5 0 0 0 0-5z"},child:[]}]})(e)}function Z2(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 3a9 9 0 0 0-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"},child:[]}]})(e)}function eI(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"},child:[]}]})(e)}function tI(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"},child:[]}]})(e)}function nI(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18.41 5.8 17.2 4.59c-.78-.78-2.05-.78-2.83 0l-2.68 2.68L3 15.96V20h4.04l8.74-8.74 2.63-2.63c.79-.78.79-2.05 0-2.83zM6.21 18H5v-1.21l8.66-8.66 1.21 1.21L6.21 18zM11 20l4-4h6v4H11z"},child:[]}]})(e)}function rI(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"},child:[]}]})(e)}function oI(e){return Rr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19.88 18.47c.44-.7.7-1.51.7-2.39 0-2.49-2.01-4.5-4.5-4.5s-4.5 2.01-4.5 4.5 2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21.58 23 23 21.58l-3.12-3.11zm-3.8.11a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5zm-.36-8.5c-.74.02-1.45.18-2.1.45l-.55-.83-3.8 6.18-3.01-3.52-3.63 5.81L1 17l5-8 3 3.5L13 6l2.72 4.08zm2.59.5c-.64-.28-1.33-.45-2.05-.49L21.38 2 23 3.18l-4.69 7.4z"},child:[]}]})(e)}function Eb(e){var o,r,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(o=0;oe&&(e.host||Cb(e.parentNode)),iI=(e,o)=>o.map(r=>{if(e.contains(r))return r;const t=Cb(r);return t&&e.contains(t)?t:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",e,". Doing nothing"),null)}).filter(r=>!!r),aI=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),sI=(e,o)=>{const{parentNode:r,markerName:t,controlAttribute:n,explicitBooleanValue:i}=o,f=iI(r,Array.isArray(e)?e:[e]);Qc[t]||(Qc[t]=new WeakMap);const u=Qc[t],h=[],s=new Set,d=new Set(f),a=p=>{!p||s.has(p)||(s.add(p),a(p.parentNode))};f.forEach(a);const l=p=>{!p||d.has(p)||Array.prototype.forEach.call(p.children,v=>{if(s.has(v))l(v);else try{if(aI(v))return;const _=v.getAttribute(n),w=i?_==="true":_!==null&&_!=="false",x=(Fs.get(v)||0)+1,m=(u.get(v)||0)+1;Fs.set(v,x),u.set(v,m),h.push(v),x===1&&w&&Jc.set(v,!0),m===1&&v.setAttribute(t,""),w||v.setAttribute(n,i?"true":"")}catch(_){console.error("[zag-js > ariaHidden] cannot operate on ",v,_)}})};return l(r),s.clear(),op++,()=>{h.forEach(p=>{const v=Fs.get(p)-1,_=u.get(p)-1;Fs.set(p,v),u.set(p,_),v||(Jc.has(p)||p.removeAttribute(n),Jc.delete(p)),_||p.removeAttribute(t)}),op--,op||(Fs=new WeakMap,Fs=new WeakMap,Jc=new WeakMap,Qc={})}},uI=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,lI=(e,o=uI(e),r="data-aria-hidden")=>{if(o)return sI(e,{parentNode:o,markerName:r,controlAttribute:"aria-hidden",explicitBooleanValue:!0})},cI=e=>{const o=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(o)};function hI(e,o={}){const{defer:r=!0}=o,t=r?cI:i=>i(),n=[];return n.push(t(()=>{const f=(typeof e=="function"?e():e).filter(Boolean);f.length!==0&&n.push(lI(f))})),()=>{n.forEach(i=>i==null?void 0:i())}}const[fI,Js]=qa({name:"DialogContext",hookName:"useDialogContext",providerName:""}),Ym=ae.forwardRef((e,o)=>{const r=Js(),t=vb(),n=tf({...t,present:r.open}),i=An(r.getBackdropProps(),n.getPresenceProps(),e);return n.unmounted?null:Q.jsx(Yn.div,{...i,ref:Cl(n.ref,o)})});Ym.displayName="DialogBackdrop";const Jm=ae.forwardRef((e,o)=>{const r=Js(),t=An(r.getCloseTriggerProps(),e);return Q.jsx(Yn.button,{...t,ref:o})});Jm.displayName="DialogCloseTrigger";const Qm=ae.forwardRef((e,o)=>{const r=Js(),t=ef(),n=An(r.getContentProps(),t.getPresenceProps(),e);return t.unmounted?null:Q.jsx(Yn.div,{...n,ref:Cl(t.ref,o)})});Qm.displayName="DialogContent";const Zm=ae.forwardRef((e,o)=>{const r=Js(),t=An(r.getDescriptionProps(),e);return Q.jsx(Yn.div,{...t,ref:o})});Zm.displayName="DialogDescription";const eg=ae.forwardRef((e,o)=>{const r=Js(),t=An(r.getPositionerProps(),e);return ef().unmounted?null:Q.jsx(Yn.div,{...t,ref:o})});eg.displayName="DialogPositioner";var dI=Object.defineProperty,pI=(e,o,r)=>o in e?dI(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,un=(e,o,r)=>pI(e,typeof o!="symbol"?o+"":o,r),a_={activateTrap(e,o){if(e.length>0){const t=e[e.length-1];t!==o&&t.pause()}const r=e.indexOf(o);r===-1||e.splice(r,1),e.push(o)},deactivateTrap(e,o){const r=e.indexOf(o);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},mI=[],gI=class{constructor(e,o){un(this,"trapStack"),un(this,"config"),un(this,"doc"),un(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),un(this,"listenerCleanups",[]),un(this,"handleFocus",t=>{const n=ti(t),i=this.findContainerIndex(n,t)>=0;if(i||Vm(n))i&&(this.state.mostRecentlyFocusedNode=n);else{t.stopImmediatePropagation();let f,u=!0;if(this.state.mostRecentlyFocusedNode)if(Ru(this.state.mostRecentlyFocusedNode)>0){const h=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:s}=this.state.containerGroups[h];if(s.length>0){const d=s.findIndex(a=>a===this.state.mostRecentlyFocusedNode);d>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?d+1=0&&(f=s[d-1],u=!1))}}else this.state.containerGroups.some(h=>h.tabbableNodes.some(s=>Ru(s)>0))||(u=!1);else u=!1;u&&(f=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),f?this.tryFocus(f):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),un(this,"handlePointerDown",t=>{const n=ti(t);if(!(this.findContainerIndex(n,t)>=0)){if(zu(this.config.clickOutsideDeactivates,t)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}zu(this.config.allowOutsideClick,t)||t.preventDefault()}}),un(this,"handleClick",t=>{const n=ti(t);this.findContainerIndex(n,t)>=0||zu(this.config.clickOutsideDeactivates,t)||zu(this.config.allowOutsideClick,t)||(t.preventDefault(),t.stopImmediatePropagation())}),un(this,"handleTabKey",t=>{if(this.config.isKeyForward(t)||this.config.isKeyBackward(t)){this.state.recentNavEvent=t;const n=this.config.isKeyBackward(t),i=this.findNextNavNode({event:t,isBackward:n});if(!i)return;Bu(t)&&t.preventDefault(),this.tryFocus(i)}}),un(this,"handleEscapeKey",t=>{yI(t)&&zu(this.config.escapeDeactivates,t)!==!1&&(t.preventDefault(),this.deactivate())}),un(this,"_mutationObserver"),un(this,"setupMutationObserver",()=>{const t=this.doc.defaultView||window;this._mutationObserver=new t.MutationObserver(n=>{n.some(f=>Array.from(f.removedNodes).some(h=>h===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),un(this,"updateObservedNodes",()=>{var t;(t=this._mutationObserver)==null||t.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(n=>{var i;(i=this._mutationObserver)==null||i.observe(n,{subtree:!0,childList:!0})})}),un(this,"getInitialFocusNode",()=>{let t=this.getNodeForOption("initialFocus",{hasFallback:!0});if(t===!1)return!1;if(t===void 0||t&&!Hi(t))if(this.findContainerIndex(this.doc.activeElement)>=0)t=this.doc.activeElement;else{const n=this.state.tabbableGroups[0];t=n&&n.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else t===null&&(t=this.getNodeForOption("fallbackFocus"));if(!t)throw new Error("Your focus-trap needs to have at least one focusable element");return t.isConnected||(t=this.getNodeForOption("fallbackFocus")),t}),un(this,"tryFocus",t=>{if(t!==!1&&t!==ab(this.doc)){if(!t||!t.focus){this.tryFocus(this.getInitialFocusNode());return}t.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=t,vI(t)&&t.select()}}),un(this,"deactivate",t=>{if(!this.state.active)return this;const n={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...t};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),a_.deactivateTrap(this.trapStack,this);const i=this.getOption(n,"onDeactivate"),f=this.getOption(n,"onPostDeactivate"),u=this.getOption(n,"checkCanReturnFocus"),h=this.getOption(n,"returnFocus","returnFocusOnDeactivate");i==null||i();const s=()=>{s_(()=>{if(h){const d=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(d)}f==null||f()})};if(h&&u){const d=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return u(d).then(s,s),this}return s(),this}),un(this,"pause",t=>{if(this.state.paused||!this.state.active)return this;const n=this.getOption(t,"onPause"),i=this.getOption(t,"onPostPause");return this.state.paused=!0,n==null||n(),this.removeListeners(),this.updateObservedNodes(),i==null||i(),this}),un(this,"unpause",t=>{if(!this.state.paused||!this.state.active)return this;const n=this.getOption(t,"onUnpause"),i=this.getOption(t,"onPostUnpause");return this.state.paused=!1,n==null||n(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i==null||i(),this}),un(this,"updateContainerElements",t=>(this.state.containers=Array.isArray(t)?t.filter(Boolean):[t].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),un(this,"getReturnFocusNode",t=>{const n=this.getNodeForOption("setReturnFocus",{params:[t]});return n||(n===!1?!1:t)}),un(this,"getOption",(t,n,i)=>t&&t[n]!==void 0?t[n]:this.config[i||n]),un(this,"getNodeForOption",(t,{hasFallback:n=!1,params:i=[]}={})=>{let f=this.config[t];if(typeof f=="function"&&(f=f(...i)),f===!0&&(f=void 0),!f){if(f===void 0||f===!1)return f;throw new Error(`\`${t}\` was specified but was not a node, or did not return a node`)}let u=f;if(typeof f=="string"){try{u=this.doc.querySelector(f)}catch(h){throw new Error(`\`${t}\` appears to be an invalid selector; error="${h.message}"`)}if(!u&&!n)throw new Error(`\`${t}\` as selector refers to no known node`)}return u}),un(this,"findNextNavNode",t=>{const{event:n,isBackward:i=!1}=t,f=t.target||ti(n);this.updateTabbableNodes();let u=null;if(this.state.tabbableGroups.length>0){const h=this.findContainerIndex(f,n),s=h>=0?this.state.containerGroups[h]:void 0;if(h<0)i?u=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:u=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let d=this.state.tabbableGroups.findIndex(({firstTabbableNode:a})=>f===a);if(d<0&&((s==null?void 0:s.container)===f||Hi(f)&&!Fa(f)&&!(s!=null&&s.nextTabbableNode(f,!1)))&&(d=h),d>=0){const a=d===0?this.state.tabbableGroups.length-1:d-1,l=this.state.tabbableGroups[a];u=Ru(f)>=0?l.lastTabbableNode:l.lastDomTabbableNode}else Bu(n)||(u=s==null?void 0:s.nextTabbableNode(f,!1))}else{let d=this.state.tabbableGroups.findIndex(({lastTabbableNode:a})=>f===a);if(d<0&&((s==null?void 0:s.container)===f||Hi(f)&&!Fa(f)&&!(s!=null&&s.nextTabbableNode(f)))&&(d=h),d>=0){const a=d===this.state.tabbableGroups.length-1?0:d+1,l=this.state.tabbableGroups[a];u=Ru(f)>=0?l.firstTabbableNode:l.firstDomTabbableNode}else Bu(n)||(u=s==null?void 0:s.nextTabbableNode(f))}}else u=this.getNodeForOption("fallbackFocus");return u}),this.trapStack=o.trapStack||mI;const r={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(t){return Bu(t)&&!t.shiftKey},isKeyBackward(t){return Bu(t)&&t.shiftKey},...o};this.doc=r.document||li(Array.isArray(e)?e[0]:e),this.config=r,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,o){const r=typeof(o==null?void 0:o.composedPath)=="function"?o.composedPath():void 0;return this.state.containerGroups.findIndex(({container:t,tabbableNodes:n})=>t.contains(e)||(r==null?void 0:r.includes(t))||n.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const o=lb(e),r=Gm(e),t=o.length>0?o[0]:void 0,n=o.length>0?o[o.length-1]:void 0,i=r.find(s=>Fa(s)),f=r.slice().reverse().find(s=>Fa(s)),u=!!o.find(s=>Ru(s)>0);function h(s,d=!0){const a=o.indexOf(s);return a<0?d?r.slice(r.indexOf(s)+1).find(l=>Fa(l)):r.slice(0,r.indexOf(s)).reverse().find(l=>Fa(l)):o[a+(d?1:-1)]}return{container:e,tabbableNodes:o,focusableNodes:r,posTabIndexesFound:u,firstTabbableNode:t,lastTabbableNode:n,firstDomTabbableNode:i,lastDomTabbableNode:f,nextTabbableNode:h}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return a_.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?s_(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Eo(this.doc,"focusin",this.handleFocus,!0),Eo(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Eo(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Eo(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Eo(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Eo(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const o=this.getOption(e,"onActivate"),r=this.getOption(e,"onPostActivate"),t=this.getOption(e,"checkCanFocusTrap");t||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,o==null||o();const n=()=>{t&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r==null||r()};return t?(t(this.state.containers.concat()).then(n,n),this):(n(),this)}},Bu=e=>e.key==="Tab",zu=(e,...o)=>typeof e=="function"?e(...o):e,yI=e=>!e.isComposing&&e.key==="Escape",s_=e=>setTimeout(e,0),vI=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function _I(e,o={}){let r;const t=Kn(()=>{const n=typeof e=="function"?e():e;if(n){r=new gI(n,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:n,...o,document:li(n)});try{r.activate()}catch{}}});return function(){r==null||r.deactivate(),t()}}var ip="data-scroll-lock";function u_(e,o){if(!e)return;const r=Object.keys(o).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return Object.assign(e.style,o),()=>{Object.assign(e.style,r)}}function xI(e,o,r){if(!e)return;const t=e.style.getPropertyValue(o);return e.style.setProperty(o,r),()=>{t?e.style.setProperty(o,t):e.style.removeProperty(o)}}function wI(e){const o=e.getBoundingClientRect().left;return Math.round(o)+e.scrollLeft?"paddingLeft":"paddingRight"}function bI(e){const o=e??document,r=o.defaultView??window,{documentElement:t,body:n}=o;if(n.hasAttribute(ip))return;n.setAttribute(ip,"");const f=r.innerWidth-t.clientWidth,u=()=>xI(t,"--scrollbar-width",`${f}px`),h=wI(t),s=()=>u_(n,{overflow:"hidden",[h]:`${f}px`}),d=()=>{const{scrollX:l,scrollY:p,visualViewport:v}=r,_=(v==null?void 0:v.offsetLeft)??0,w=(v==null?void 0:v.offsetTop)??0,x=u_(n,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(w))}px`,left:`${-(l-Math.floor(_))}px`,right:"0",[h]:`${f}px`});return()=>{x==null||x(),r.scrollTo({left:l,top:p,behavior:"instant"})}},a=[u(),Ck()?d():s()];return()=>{a.forEach(l=>l==null?void 0:l()),n.removeAttribute(ip)}}var SI=Ua("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),ka=SI.build(),Bt=sf({getPositionerId:e=>{var o;return((o=e.ids)==null?void 0:o.positioner)??`dialog:${e.id}:positioner`},getBackdropId:e=>{var o;return((o=e.ids)==null?void 0:o.backdrop)??`dialog:${e.id}:backdrop`},getContentId:e=>{var o;return((o=e.ids)==null?void 0:o.content)??`dialog:${e.id}:content`},getTriggerId:e=>{var o;return((o=e.ids)==null?void 0:o.trigger)??`dialog:${e.id}:trigger`},getTitleId:e=>{var o;return((o=e.ids)==null?void 0:o.title)??`dialog:${e.id}:title`},getDescriptionId:e=>{var o;return((o=e.ids)==null?void 0:o.description)??`dialog:${e.id}:description`},getCloseTriggerId:e=>{var o;return((o=e.ids)==null?void 0:o.closeTrigger)??`dialog:${e.id}:close`},getContentEl:e=>Bt.getById(e,Bt.getContentId(e)),getPositionerEl:e=>Bt.getById(e,Bt.getPositionerId(e)),getBackdropEl:e=>Bt.getById(e,Bt.getBackdropId(e)),getTriggerEl:e=>Bt.getById(e,Bt.getTriggerId(e)),getTitleEl:e=>Bt.getById(e,Bt.getTitleId(e)),getDescriptionEl:e=>Bt.getById(e,Bt.getDescriptionId(e)),getCloseTriggerEl:e=>Bt.getById(e,Bt.getCloseTriggerId(e))});function EI(e,o,r){const t=e.context["aria-label"],n=e.matches("open"),i=e.context.renderedElements;return{open:n,setOpen(f){f!==n&&o(f?"OPEN":"CLOSE")},getTriggerProps(){return r.button({...ka.trigger.attrs,dir:e.context.dir,id:Bt.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":n,"data-state":n?"open":"closed","aria-controls":Bt.getContentId(e.context),onClick(f){f.defaultPrevented||o("TOGGLE")}})},getBackdropProps(){return r.element({...ka.backdrop.attrs,dir:e.context.dir,hidden:!n,id:Bt.getBackdropId(e.context),"data-state":n?"open":"closed"})},getPositionerProps(){return r.element({...ka.positioner.attrs,dir:e.context.dir,id:Bt.getPositionerId(e.context),style:{pointerEvents:n?void 0:"none"}})},getContentProps(){return r.element({...ka.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!n,id:Bt.getContentId(e.context),tabIndex:-1,"data-state":n?"open":"closed","aria-modal":!0,"aria-label":t||void 0,"aria-labelledby":t||!i.title?void 0:Bt.getTitleId(e.context),"aria-describedby":i.description?Bt.getDescriptionId(e.context):void 0})},getTitleProps(){return r.element({...ka.title.attrs,dir:e.context.dir,id:Bt.getTitleId(e.context)})},getDescriptionProps(){return r.element({...ka.description.attrs,dir:e.context.dir,id:Bt.getDescriptionId(e.context)})},getCloseTriggerProps(){return r.button({...ka.closeTrigger.attrs,dir:e.context.dir,id:Bt.getCloseTriggerId(e.context),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),o("CLOSE"))}})}}}function CI(e){const o=Ji(e);return Sl({id:"dialog",initial:o.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...o},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:r=>!!r["open.controlled"]},activities:{trackDismissableElement(r,t,{send:n}){return mb(()=>Bt.getContentEl(r),{defer:!0,pointerBlocking:r.modal,exclude:[Bt.getTriggerEl(r)],onInteractOutside(f){var u;(u=r.onInteractOutside)==null||u.call(r,f),r.closeOnInteractOutside||f.preventDefault()},persistentElements:r.persistentElements,onFocusOutside:r.onFocusOutside,onPointerDownOutside:r.onPointerDownOutside,onEscapeKeyDown(f){var u;(u=r.onEscapeKeyDown)==null||u.call(r,f),r.closeOnEscape||f.preventDefault()},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}})},preventScroll(r){if(r.preventScroll)return bI(Bt.getDoc(r))},trapFocus(r){return!r.trapFocus||!r.modal?void 0:_I(()=>Bt.getContentEl(r),{preventScroll:!0,returnFocusOnDeactivate:!!r.restoreFocus,initialFocus:r.initialFocusEl,setReturnFocus:n=>{var i;return((i=r.finalFocusEl)==null?void 0:i.call(r))??n}})},hideContentBelow(r){return r.modal?hI(()=>[Bt.getContentEl(r)],{defer:!0}):void 0}},actions:{setAlertDialogProps(r){r.role==="alertdialog"&&(r.initialFocusEl||(r.initialFocusEl=()=>Bt.getCloseTriggerEl(r)),r.closeOnInteractOutside=!1)},checkRenderedElements(r){Kn(()=>{r.renderedElements.title=!!Bt.getTitleEl(r),r.renderedElements.description=!!Bt.getDescriptionEl(r)})},syncZIndex(r){Kn(()=>{const t=Bt.getContentEl(r);if(!t)return;const n=sb(t);[Bt.getPositionerEl(r),Bt.getBackdropEl(r)].forEach(f=>{f==null||f.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose(r){var t;(t=r.onOpenChange)==null||t.call(r,{open:!1})},invokeOnOpen(r){var t;(t=r.onOpenChange)==null||t.call(r,{open:!0})},toggleVisibility(r,t,{send:n}){n({type:r.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}Ga()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const AI=(e={})=>{const{getRootNode:o}=Nl(),{dir:r}=uf(),t={id:ae.useId(),getRootNode:o,dir:r,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e},n={...t,open:e.open,onOpenChange:Vi(e.onOpenChange,{sync:!0}),onEscapeKeyDown:Vi(e.onEscapeKeyDown),onInteractOutside:Vi(e.onInteractOutside)},[i,f]=El(CI(t),{context:n});return EI(i,f,Zh)},Ab=e=>{const[o,{children:r,...t}]=Kw(e),[n]=_b(o),i=AI(t),f=tf(An({present:i.open},o));return Q.jsx(fI,{value:i,children:Q.jsx(yb,{value:n,children:Q.jsx(Fm,{value:f,children:r})})})},tg=ae.forwardRef((e,o)=>{const r=Js(),t=An(r.getTitleProps(),e);return Q.jsx(Yn.h2,{...t,ref:o})});tg.displayName="DialogTitle";var DI=Ua("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Ko=DI.build(),Zc=sf({getRootId:e=>{var o;return((o=e.ids)==null?void 0:o.root)??`progress-${e.id}`},getTrackId:e=>{var o;return((o=e.ids)==null?void 0:o.track)??`progress-${e.id}-track`},getLabelId:e=>{var o;return((o=e.ids)==null?void 0:o.label)??`progress-${e.id}-label`},getCircleId:e=>{var o;return((o=e.ids)==null?void 0:o.circle)??`progress-${e.id}-circle`}});function TI(e,o,r){const t=e.context.percent,n=e.context.isIndeterminate?"":`${t}%`,i=e.context.max,f=e.context.min,u=e.context.orientation,h=e.context.translations,s=e.context.isIndeterminate,d=e.context.value,a=h.value({value:d,max:i,percent:t,min:f}),l=NI(d,i),p={role:"progressbar","aria-label":a,"data-max":i,"aria-valuemin":f,"aria-valuemax":i,"aria-valuenow":d??void 0,"data-orientation":u,"data-state":l},v=PI(e.context);return{value:d,valueAsString:a,min:f,max:i,percent:t,percentAsString:n,indeterminate:s,setValue(_){o({type:"VALUE.SET",value:_})},setToMax(){o({type:"VALUE.SET",value:i})},setToMin(){o({type:"VALUE.SET",value:f})},getRootProps(){return r.element({dir:e.context.dir,...Ko.root.attrs,id:Zc.getRootId(e.context),"data-max":i,"data-value":d??void 0,"data-state":l,"data-orientation":u,style:{"--percent":s?void 0:t}})},getLabelProps(){return r.element({dir:e.context.dir,id:Zc.getLabelId(e.context),...Ko.label.attrs,"data-orientation":u})},getValueTextProps(){return r.element({dir:e.context.dir,"aria-live":"polite",...Ko.valueText.attrs})},getTrackProps(){return r.element({dir:e.context.dir,id:Zc.getTrackId(e.context),...Ko.track.attrs,...p})},getRangeProps(){return r.element({dir:e.context.dir,...Ko.range.attrs,"data-orientation":u,"data-state":l,style:{[e.context.isHorizontal?"width":"height"]:s?void 0:`${t}%`}})},getCircleProps(){return r.element({dir:e.context.dir,id:Zc.getCircleId(e.context),...Ko.circle.attrs,...p,...v.root})},getCircleTrackProps(){return r.element({dir:e.context.dir,"data-orientation":u,...Ko.circleTrack.attrs,...v.track})},getCircleRangeProps(){return r.element({dir:e.context.dir,...Ko.circleRange.attrs,...v.range,"data-state":l})},getViewProps(_){return r.element({dir:e.context.dir,...Ko.view.attrs,"data-state":_.state,hidden:_.state!==l})}}}function NI(e,o){return e==null?"indeterminate":e===o?"complete":"loading"}function PI(e){const o={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{style:{width:"var(--size)",height:"var(--size)"}},track:o,range:{opacity:e.value===0?0:void 0,style:{...o.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}function OI(e,o){return e+(o-e)/2}function kI(e){const o=Ji(e);return Sl({id:"progress",initial:"idle",context:{max:o.max??100,min:o.min??0,value:OI(o.min??0,o.max??100),orientation:"horizontal",translations:{value:({percent:r})=>r===-1?"loading...":`${r} percent`,...o.translations},...o},created:["validateContext"],computed:{isIndeterminate:r=>r.value===null,percent(r){return km(r.value)?Math.round((r.value-r.min)/(r.max-r.min)*100):-1},isAtMax:r=>r.value===r.max,isHorizontal:r=>r.orientation==="horizontal",isRtl:r=>r.dir==="rtl"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(r,t)=>{RI.value(r,t.value)},validateContext:r=>{if(r.value!=null){if(!ng(r.max))throw new Error(`[progress] The max value passed \`${r.max}\` is not a valid number`);if(!II(r.value,r.max))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the max value \`${r.max}\``);if(!FI(r.value,r.min))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the min value \`${r.min}\``)}}}})}function ng(e){return km(e)&&!isNaN(e)}function II(e,o){return ng(e)&&e<=o}function FI(e,o){return ng(e)&&e>=o}var RI={value(e,o){var r;ll(e.value,o)||(e.value=o===null?null:Math.max(0,Math.min(o,e.max)),(r=e.onValueChange)==null||r.call(e,{value:o}))}};Ga()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange"]);const MI=(e={})=>{const{getRootNode:o}=Nl(),{dir:r}=uf(),t={id:ae.useId(),dir:r,getRootNode:o,value:e.defaultValue,...e},n={...t,value:e.value,onValueChange:Vi(e.onValueChange,{sync:!0})},[i,f]=El(kI(t),{context:n});return TI(i,f,Zh)},rg=ae.createContext(void 0),LI=({title:e,children:o,footer:r,onClick:t,className:n=""})=>Q.jsxs("div",{onClickCapture:t,className:Km("h-50 w-100 bg-white p-4 rounded-lg shadow-md flex flex-col",n),children:[Q.jsx("div",{className:"font-semibold text-lg border-b pb-2",children:e}),Q.jsx("div",{className:"flex-1 flex py-4",children:o}),r&&Q.jsx("div",{className:"border-t pt-2 text-sm text-gray-600",children:r})]}),Db=({title:e="Dialog Title",closeText:o="Close",contentClassName:r="",backdropClassName:t="",submitButton:n=null,isOpen:i=!1,setIsOpen:f=()=>{},children:u})=>Q.jsx(Ab,{open:i,onOpenChange:h=>f(h.open),children:Q.jsxs(qm,{children:[Q.jsx(Ym,{className:`fixed inset-0 bg-black opacity-20 ${t}`}),Q.jsx(eg,{className:"fixed inset-0 flex justify-center items-center",children:Q.jsxs(Qm,{className:`bg-white p-6 rounded-lg shadow-xl w-96 ${r}`,children:[Q.jsx(tg,{className:"!text-xl font-semibold text-gray-800",children:e}),u,Q.jsx(Zm,{}),Q.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[Q.jsx(Jm,{className:"cancel-button",children:o}),u&&Q.jsx("div",{children:n})]})]})})]})}),jI=({handlePosition:e,createNode:o})=>{const[r,t]=ae.useState("recent"),{nodeTypes:n,recentNodeTypes:i}=ae.useContext(rg);return Q.jsxs(cf,{value:r,onValueChange:f=>t(f.value),className:"w-50 translate-x-1/2 !max-h-[300px !overflow-hidden",children:[Q.jsxs(lf,{className:"flex",children:[Q.jsx(Wi,{value:"recent",className:`tabTrigger ${r==="recent"?"bg-gray-50":"!bg-gray-200"}`,children:Q.jsx(Z2,{className:"w-3 h-3"})}),Q.jsx(Wi,{value:"favorites",className:`tabTrigger ${r==="favorites"?"bg-gray-50":"!bg-gray-200"}`,children:Q.jsx(rI,{className:"w-3 h-3"})})]}),Q.jsx($i,{value:"recent",className:"tabContent",children:i.map((f,u)=>Q.jsxs("div",{onClick:()=>o(e,f),className:"hover:bg-white p-1 cursor-pointer flex flex-row ",children:[Q.jsx("div",{className:"bg-blue-200 p-1 rounded-l-sm shadow-md justify-center align-center",children:n[f].display_source}),Q.jsx("div",{className:"bg-white p-1 rounded-r-sm w-full content-center shadow-md justify-center",children:n[f].display_label})]},u))}),Q.jsx($i,{value:"favorites",className:"tabContent",children:Object.keys(n).map((f,u)=>Q.jsxs("div",{onClick:()=>o(e,f),className:"hover:bg-white p-1 cursor-pointer flex flex-row",children:[Q.jsx("div",{className:"bg-blue-200 p-1 rounded-l-sm shadow-md justify-center align-center",children:n[f].display_source}),Q.jsx("div",{className:"bg-white p-1 rounded-r-sm w-full content-center shadow-md justify-center",children:n[f].display_label})]},u))})]})},BI=({children:e,handlePosition:o,createNode:r,recentNodeTypes:t,nodeTypes:n})=>Q.jsxs(N2,{children:[Q.jsx(gb,{children:e}),Q.jsx(qm,{children:Q.jsx(Xw,{children:Q.jsxs(qw,{children:[Q.jsx(Ww,{children:Q.jsx(Gw,{})}),Q.jsx(jI,{handlePosition:o,createNode:r,recentNodeTypes:t,nodeTypes:n})]})})})]}),zI=({handleId:e,position:o,type:r,id:t,connectState:n,createNode:i,recentNodeTypes:f,nodeTypes:u})=>{const[h,s]=ae.useState(!1);Km("flex",{"pr-10":e==="incomingL","pb-10":e==="incomingT","pl-10":e==="outgoingR","pt-10":e==="outgoingB"});const d=ae.useMemo(()=>n==="connectable"?{borderColor:h?"blue":"black",opacity:h?.6:.5,backgroundColor:"white",borderRadius:"0.5rem",width:"3rem",height:"3rem",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"1.5rem",color:"grey",transition:"all 0.2s ease-in-out"}:{},[n,h]);return Q.jsx(ul,{style:d,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),type:r,position:o,id:e,children:n==="connectable"&&Q.jsx(BI,{handlePosition:o,createNode:i,recentNodeTypes:f,nodeTypes:u,children:Q.jsx("div",{className:"w-[2rem] text-black text-bold h-[2rem] border-1 border-gray-200 hover:border-blue-600 text-2xl rounded-md justify-center hover:bg-blue-200",children:"+"})})})},UI=({children:e,incoming:o,outgoing:r})=>{const t=Jh(),n=jN({id:t||""}),i=RN(),{nodes:f,nodeTypes:u}=lo(),{createNodeContext:h}=ae.useContext(rg),s=(v,_)=>{h(t,v,_)},d=ae.useMemo(()=>{const v={l:"connectable",t:"connectable",b:"connectable",r:"connectable"},_=w=>n.some(x=>x.targetHandle===w&&x.target===t||x.sourceHandle===w&&x.source===t);return v.l=_("incomingL")?"connected":"connectable",v.t=_("incomingT")?"connected":"connectable",v.b=_("outgoingB")?"connected":"connectable",v.r=_("outgoingR")?"connected":"connectable",v.l==="connected"&&(v.t="disabled"),v.t==="connected"&&(v.l="disabled"),v.r==="connected"&&(v.b="disabled"),v.b==="connected"&&(v.r="disabled"),v},[n,t]),a=[{position:vt.Left,type:"target",id:"incomingL",p:"l"},{position:vt.Right,type:"source",id:"outgoingR",p:"r"},{position:vt.Top,type:"target",id:"incomingT",p:"t"},{position:vt.Bottom,type:"source",id:"outgoingB",p:"b"}],l=ae.useMemo(()=>a.map(({position:v,type:_,id:w,p:x})=>{const m=d[x];return i(t),_==="target"&&o||_==="source"&&r?Q.jsx(zI,{position:v,type:_,handleId:w,createNode:s,connectState:m},w):Q.jsx("div",{})}),[n,d]),p=Nn.useMemo(()=>e,[e]);return Q.jsxs("div",{className:"relative flex flex-col items-center",children:[Q.jsx("div",{className:`absolute top-1/2 transform -translate-y-1/2 ${d.l!=="connected"?"left-[-50px]":"left-[-0px]"} ${d.l!=="connectable"?"[visibility:hidden]":""}`,children:l[0]}),Q.jsxs("div",{className:"flex",children:[Q.jsx("div",{className:`absolute left-1/2 transform -translate-y-1/2 ${d.t!=="connected"?"top-[-50px]":"top-[-0px]"} ${d.t!=="connectable"?"[visibility:hidden]":""}`,children:l[2]}),Q.jsx("div",{className:"node-container",children:p}),Q.jsx("div",{className:`absolute left-1/2 transform -translate-x-1/2 ${d.b!=="connected"?"bottom-[-50px]":"bottom-[0px]"} ${d.b!=="connectable"?"[visibility:hidden]":""}`,children:l[3]})]}),Q.jsx("div",{className:`absolute top-1/2 transform -translate-y-1/2 ${d.r!=="connected"?"right-[-50px]":"right-[-0px]"} ${d.r!=="connectable"?"[visibility:hidden]":""}`,children:l[1]})]})},og=Nn.memo(UI),VI=({type:e,children:o,group:r})=>Q.jsx(og,{incoming:!1,outgoing:!0,children:Q.jsxs("div",{className:"flex absoluterow",children:[Q.jsx("div",{className:"node-group bold bg-blue-200",children:r}),Q.jsxs("div",{className:"node-content !w-[400px]",children:[Q.jsx("h1",{className:"node-title",children:e}),Q.jsx("div",{className:"flex",children:o})]})]})}),Qi=({id:e,data:o})=>{const{updateNodeData:r}=lo(),t=ae.useCallback(n=>{r(e,{filter_value:n.target.value,filter:"abstract.search"})},[e,r]);return Q.jsx(VI,{type:"Open Alex",group:Qi.group,children:Q.jsxs("div",{className:"flex flex-row text-2xl w-[40vw]",children:[Q.jsx("p",{children:"Base Term"}),Q.jsx("input",{placeholder:"",className:"filter-input",value:o.filter_value||"",onChange:t})]})},e)};Qi.label="base_term";Qi.display_label="Base_Term";Qi.source="OpenAlex";Qi.display_source="OA";Qi.group="Repository";Qi.type="Input";const HI=Object.freeze(Object.defineProperty({__proto__:null,default:Qi},Symbol.toStringTag,{value:"Module"})),$I=[{value:"authorships.author.id",label:"Author ID",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.author.orcid",label:"Author ORCID",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.institutions.country_code",label:"Institution Country Code",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.institutions.id",label:"Institution ID",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.institutions.ror",label:"Institution ROR",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.institutions.type",label:"Institution Type",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"authorships.is_corresponding",label:"Is Corresponding",groupLabel:"Authorship",group:"authorship",inputType:"boolean"},{value:"apc_list.value",label:"APC Value",groupLabel:"APC",group:"apc",inputType:"range"},{value:"apc_list.currency",label:"APC Currency",groupLabel:"APC",group:"apc",inputType:"term"},{value:"apc_list.provenance",label:"APC Provenance",groupLabel:"APC",group:"apc",inputType:"term"},{value:"apc_list.value_usd",label:"APC Value USD",groupLabel:"APC",group:"apc",inputType:"range"},{value:"apc_paid.value",label:"APC Paid Value",groupLabel:"APC",group:"apc",inputType:"range"},{value:"apc_paid.currency",label:"APC Paid Currency",groupLabel:"APC",group:"apc",inputType:"term"},{value:"apc_paid.provenance",label:"APC Paid Provenance",groupLabel:"APC",group:"apc",inputType:"term"},{value:"apc_paid.value_usd",label:"APC Paid Value USD",groupLabel:"APC",group:"apc",inputType:"range"},{value:"best_oa_location.license",label:"Best OA Location License",groupLabel:"Open Access",group:"open_access",inputType:"OA-license"},{value:"best_oa_location.source.id",label:"Best OA Location Source ID",groupLabel:"Open Access",group:"open_access",inputType:"term"},{value:"best_oa_location.source.is_in_doaj",label:"Best OA Location Source In DOAJ",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"best_oa_location.source.issn",label:"Best OA Location Source ISSN",groupLabel:"Open Access",group:"open_access",inputType:"term"},{value:"best_oa_location.source.host_organization",label:"Best OA Location Source Host Organization",groupLabel:"Open Access",group:"open_access",inputType:"term"},{value:"best_oa_location.source.type",label:"Best OA Location Source Type",groupLabel:"Open Access",group:"open_access",inputType:"select"},{value:"best_oa_location.version",label:"Best OA Location Version",groupLabel:"Open Access",group:"open_access",inputType:"select"},{value:"cited_by_count",label:"Cited By Count",groupLabel:"Citations",group:"citations",inputType:"range"},{value:"concepts.id",label:"Concept ID",groupLabel:"Concepts",group:"concepts",inputType:"term"},{value:"concepts.wikidata",label:"Concept Wikidata ID",groupLabel:"Concepts",group:"concepts",inputType:"terms"},{value:"corresponding_author_ids",label:"Corresponding Author IDs",groupLabel:"Correspondance",group:"correspondance",inputType:"terms"},{value:"corresponding_institution_ids",label:"Corresponding Institution IDs",groupLabel:"Correspondance",group:"correspondance",inputType:"terms"},{value:"doi",label:"DOI",groupLabel:"Identifiers",group:"identifiers",inputType:"term"},{value:"grants.award_id",label:"Grant Award ID",groupLabel:"Funding",group:"funding",inputType:"term"},{value:"grants.funder",label:"Grant Funder",groupLabel:"Funding",group:"funding",inputType:"term"},{value:"ids.pmcid",label:"PMCID",groupLabel:"Identifiers",group:"identifiers",inputType:"term"},{value:"ids.pmid",label:"PMID",groupLabel:"Identifiers",group:"identifiers",inputType:"term"},{value:"ids.openalex",label:"OpenAlex ID",groupLabel:"Identifiers",group:"identifiers",inputType:"term"},{value:"ids.mag",label:"MAG ID",groupLabel:"Identifiers",group:"identifiers",inputType:"term"},{value:"is_paratext",label:"Is Paratext",groupLabel:"Identifiers",group:"identifiers",inputType:"boolean"},{value:"is_retracted",label:"Is Retracted",groupLabel:"Core",group:"core",inputType:"boolean"},{value:"language",label:"Language",groupLabel:"Core",group:"core",inputType:"language_code"},{value:"locations.is_oa",label:"Location is OA",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"locations.license",label:"Location License",groupLabel:"Open Access",group:"open_access",inputType:"OA-license"},{value:"locations.source.id",label:"Location Source ID",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"locations.source.is_in_doaj",label:"Location Source In DOAJ",groupLabel:"Publication",group:"publication",inputType:"boolean"},{value:"locations.source.issn",label:"Location Source ISSN",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"locations.source.host_organization",label:"Location Source Host Organization",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"locations.source.type",label:"Location Source Type",groupLabel:"Publication",group:"publication",inputType:"select"},{value:"locations.version",label:"Location Version",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"locations_count",label:"Location Count",groupLabel:"Publication",group:"publication",inputType:"range"},{value:"open_access.any_repository_has_fulltext",label:"Any Repository has Fulltext",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"open_access.is_oa",label:"Is OA",groupLabel:"Core",group:"core",inputType:"boolean"},{value:"open_access.oa_status",label:"OA Status",groupLabel:"Core",group:"core",inputType:"OA-license"},{value:"primary_location.is_oa",label:"Primary Location is OA",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"primary_location.license",label:"Primary Location License",groupLabel:"Open Access",group:"open_access",inputType:"OA-license"},{value:"primary_location.source.id",label:"Primary Location Source ID",groupLabel:"Open Access",group:"open_access",inputType:"term"},{value:"primary_location.source.is_in_doaj",label:"Primary Location Source In DOAJ",groupLabel:"Publication",group:"publication",inputType:"boolean"},{value:"primary_location.source.issn",label:"Primary Location Source ISSN",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"primary_location.source.host_organization",label:"Primary Location Source Host Organization",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"primary_location.source.type",label:"Primary Location Source Type",groupLabel:"Publication",group:"publication",inputType:"OA-license"},{value:"primary_location.version",label:"Primary Location Version",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"publication_year",label:"Publication Year",groupLabel:"Core",group:"core",inputType:"year"},{value:"publication_date",label:"Publication Date",groupLabel:"Core",group:"core",inputType:"date"},{value:"type",label:"Type",groupLabel:"Core",group:"core",inputType:"OA-pub_type"},{value:"abstract.search",label:"Abstract",groupLabel:"Search Fields",group:"search_fields",inputType:"term"},{value:"authors_count",label:"Author Count",groupLabel:"Authorship",group:"authorship",inputType:"range"},{value:"authorships.institutions.continent",label:"Institution Continent",groupLabel:"Authorship",group:"authorship",inputType:"country_code"},{value:"authorships.institutions.is_global_south",label:"Institution is Global South",groupLabel:"Authorship",group:"authorship",inputType:"boolean"},{value:"best_open_version",label:"Best Open Version",groupLabel:"Open Access",group:"open_access",inputType:"OA-license"},{value:"cited_by",label:"Cited By",groupLabel:"Citations",group:"citations",inputType:"term"},{value:"cites",label:"Cites",groupLabel:"Citations",group:"citations",inputType:"term"},{value:"concepts_count",label:"Concept Count",groupLabel:"Concepts",group:"concepts",inputType:"range"},{value:"default.search",label:"Default Search",groupLabel:"Search Fields",group:"search_fields",inputType:"term"},{value:"display_name.search",label:"Display Name Search",groupLabel:"Authorship",group:"authorship",inputType:"term"},{value:"from_created_date",label:"From Created Date",groupLabel:"Publication Dates",group:"publication_dates",inputType:"date"},{value:"from_publication_date",label:"From Publication Date",groupLabel:"Publication Dates",group:"publication_dates",inputType:"date"},{value:"from_updated_date",label:"From Updated Date",groupLabel:"Publication Dates",group:"publication_dates",inputType:"date"},{value:"fulltext.search",label:"Fulltext Search",groupLabel:"Search Fields",group:"search_fields",inputType:"term"},{value:"has_abstract",label:"Has Abstract",groupLabel:"Core",group:"core",inputType:"boolean"},{value:"has_doi",label:"Has DOI",groupLabel:"Core",group:"core",inputType:"boolean"},{value:"has_oa_accepted_or_published_version",label:"Has OA Accepted/Published Version",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"has_oa_submitted_version",label:"Has OA Submitted Version",groupLabel:"Open Access",group:"open_access",inputType:"boolean"},{value:"has_orcid",label:"Has ORCID",groupLabel:"Identifiers",group:"identifiers",inputType:"boolean"},{value:"has_pmcid",label:"Has PMCID",groupLabel:"Identifiers",group:"identifiers",inputType:"boolean"},{value:"has_pmid",label:"Has PMID",groupLabel:"Identifiers",group:"identifiers",inputType:"boolean"},{value:"has_fulltext",label:"Has FullText",groupLabel:"Misc",group:"misc",inputType:"boolean"},{value:"has_references",label:"Has References",groupLabel:"Citations",group:"citations",inputType:"boolean"},{value:"journal",label:"Journal",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"locations.source.host_institution_lineage",label:"Location Source Host Institution Lineage",groupLabel:"Publication",group:"publication",inputType:"boolean"},{value:"locations.source.publisher_lineage",label:"Location Source Publisher Lineage",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"primary_location.source.has_issn",label:"Primary Location Source Has ISSN",groupLabel:"Publication",group:"publication",inputType:"boolean"},{value:"primary_location.source.publisher_lineage",label:"Primary Location Source Publisher Lineage",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"raw_affiliation_string.search",label:"Raw Affiliation String Search",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"related_to",label:"Related To",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"repository",label:"Repository",groupLabel:"Publication",group:"publication",inputType:"term"},{value:"to_publication_date",label:"To Publication Date",groupLabel:"Publication Dates",group:"publication_dates",inputType:"date"},{value:"version",label:"Version",groupLabel:"Publication",group:"publication",inputType:"date"}],l_=["Search Fields","Core","Authorship","Publication","Concepts","Open Access","Citations","Identifiers","APC","Correspondance","Funding",void 0,"Publication Dates","Misc"],WI={items:$I},GI=Object.values(WI.items.reduce((e,o)=>(e[o.group]||(e[o.group]={filterType:o.group,filterTypeLabel:o.groupLabel,items:[]}),e[o.group].items.push(o),e),{})),qI=GI.sort((e,o)=>{if(!e.groupLabel&&!o.groupLabel)return 0;if(!e.groupLabel)return 1;if(!o.groupLabel)return-1;const r=l_.indexOf(e.groupLabel),t=l_.indexOf(o.groupLabel);return r===-1&&t===-1?0:r===-1?1:t===-1?-1:r-t}),XI=({children:e,filterType:o})=>Q.jsx(og,{incoming:!0,outgoing:!0,children:Q.jsxs("div",{className:"flex row",children:[Q.jsx("div",{className:"node-group bg-orange-100",children:o.groupLabel}),e]})}),KI=Nn.memo(XI),YI=({id:e,data:o})=>{const{updateNodeData:r}=lo(),t=ae.useCallback(i=>{r(e,{filter_value:i.target.value})},[o]),n=["true","false"];return Q.jsx(Q.Fragment,{children:Q.jsx("select",{value:o==null?void 0:o.filter_value,onChange:t,className:"filter-input",children:n.map(i=>Q.jsx("option",{value:i,className:"filter-option",children:i},i))})})},JI=({id:e,data:o})=>{const{updateNodeData:r}=lo(),t=ae.useCallback(n=>{r(e,{filter_value:n.target.value})},[o]);return Q.jsx(Q.Fragment,{children:Q.jsx("input",{className:"filter-input",defaultValue:(o==null?void 0:o.filter_value)??"",onChange:t})})},QI=({id:e,data:o})=>{const{updateNodeData:r}=lo(),t=ae.useCallback(n=>{r(e,{filter_value:n.target.value})},[o]);return Q.jsx(Q.Fragment,{children:Q.jsx("input",{id:"year",name:"date",min:"1800",max:"2050",className:"filter-input",defaultValue:(o==null?void 0:o.filter_value)??"",onChange:t})})},ZI=({id:e,data:o})=>{const{updateNodeData:r}=lo(),t=ae.useCallback(n=>{r(e,{filter_value:n.target.value})},[o]);return Q.jsx(Q.Fragment,{children:Q.jsx("input",{id:"year",type:"date",min:"1800-01-01",max:"2050-01-01",className:"filter-input",defaultValue:(o==null?void 0:o.filter_value)??"",onChange:t})})},eF=({id:e,data:o})=>{var u,h;const{updateNodeData:r}=lo(),[t,n]=ae.useState(((u=o==null?void 0:o.filter_value)==null?void 0:u.from)??null),[i,f]=ae.useState(((h=o==null?void 0:o.filter_value)==null?void 0:h.to)??null);return ae.useEffect(()=>{r(e,{filter_value:{to:i,from:t}})},[t,i]),Q.jsxs("div",{className:"flex flex-row w-40",children:[Q.jsx("input",{className:"filter-input",id:"to",defaultValue:i,onChange:s=>f(s.target.value)}),Q.jsx("div",{className:"!justify-text-center !text-2xl",children:"-"}),Q.jsx("input",{className:"filter-input",id:"from",defaultValue:t,onChange:s=>n(s.target.value)})]})},tF=({id:e,filterType:o,itemsCollection:r})=>{const{updateNodeData:t,nodes:n}=lo(),i=Object(n.find(h=>h.id===e)).data,f=ae.useCallback(h=>{t(e,{filter:h.target.value})},[e,t]);ae.useEffect(()=>{i!=null&&i.filter||t(e,{filter:r.items[0].value})},[]);const u=ae.useMemo(()=>r.items.map(h=>Q.jsx("option",{value:h.value,className:"filter-option",children:h.label},h.value)),[o,r]);return Q.jsx("select",{id:"select-filter",defaultValue:(i==null?void 0:i.filter)??"",onChange:f,className:"filter-input",children:u})},nF=({filterTypeLabel:e,itemsCollection:o,data:r,id:t})=>{r={filter:"abstract.search"};const n=o.items.find(i=>i.value===r.filter)??o.items[0];return Q.jsx(KI,{label:e,lazyMount:!0,filterType:n,children:Q.jsxs("div",{className:"node-content",children:[Q.jsx(tF,{id:t,itemsCollection:o,filterType:n}),(n==null?void 0:n.inputType)==="boolean"?Q.jsx(YI,{id:t,data:r}):(n==null?void 0:n.inputType)==="range"?Q.jsx(eF,{id:t,data:r}):(n==null?void 0:n.inputType)==="year"?Q.jsx(QI,{id:t,data:r}):(n==null?void 0:n.inputType)==="date"?Q.jsx(ZI,{id:t,data:r}):n?Q.jsx(JI,{id:t,data:r}):null]})})},rF=()=>qI.map(({filterType:e,filterTypeLabel:o,items:r})=>{const t={items:r},n=i=>Q.jsx(nF,{filterTypeLabel:o,itemsCollection:t,...i});return n.label=e,n.display_label=o,n.source="OpenAlex",n.display_source="OA",n.group="Repository",n.type="Input",{label:o,source:"OpenAlex",component:n}}),oF=Object.freeze(Object.defineProperty({__proto__:null,factory:rF},Symbol.toStringTag,{value:"Module"})),iF=({type:e,children:o,group:r})=>Q.jsx(og,{incoming:!0,outgoing:!0,children:Q.jsxs("div",{className:"flex",children:[Q.jsx("div",{className:"node-group bold bg-fuchsia-200",children:e}),Q.jsx("div",{className:"flex flex-col w-[240px] h-[120px]",children:o})]})}),aF=Nn.memo(iF),Tb=({id:e,nodes:o,edges:r,visited:t=new Set})=>{const n=o.find(u=>u.id===e);if(!n||t.has(e))return[];t.add(e);const i=qA(n,o,r);let f=[];for(const u of i)f=f.concat(u,Tb({id:u.id,nodes:o,edges:r,visited:t}));return f};function sF(e){const o=e.split(" ");if(o.length===1)return{givenName:"",familyName:o[0]};const r=o.pop()||"";return{givenName:o.join(" "),familyName:r}}function uF(e){return{article:"JournalArticle",book:"Book","book-chapter":"BookChapter","conference-paper":"ConferencePaper",dataset:"Dataset",preprint:"Preprint"}[e]||"Other"}function lF(e){return!e||!e.length?[]:e.map(o=>({subject:o.display_name,schemeUri:o.wikidata||"",valueUri:o.id,subjectScheme:"OpenAlex",lang:"en",classificationCode:o.id.split("/").pop()||""}))}function cF(e){const o=[];return e.openalex&&o.push({alternateIdentifier:e.openalex,alternateIdentifierType:"OpenAlex"}),e.mag&&o.push({alternateIdentifier:e.mag.toString(),alternateIdentifierType:"MAG"}),e.pmid&&o.push({alternateIdentifier:e.pmid,alternateIdentifierType:"PMID"}),e.pmcid&&o.push({alternateIdentifier:e.pmcid,alternateIdentifierType:"PMCID"}),o}function hF(e){return!e||!e.length?[]:e.map(o=>({relationType:"References",relatedIdentifier:o,relatedIdentifierType:"URL",resourceTypeGeneral:"JournalArticle"}))}function fF(e){return!e||!e.length?[]:e.map(o=>({funderName:o.funder_display_name,funderIdentifier:o.funder,funderIdentifierType:"ROR",awardNumber:o.award_id||"",awardTitle:"",awardUri:"",schemeURI:""}))}function dF(e){if(!e)return"";const o=Object.keys(e);Object.values(e).flat();const r=o.flatMap(t=>e[t].map(i=>({word:t,position:i})));return r.sort((t,n)=>t.position-n.position),r.map(t=>t.word).join(" ")}function pF(e){var f,u,h,s;const o=e.authorships.map(d=>{var p;const{givenName:a,familyName:l}=sF(d.author.display_name);return{name:d.author.display_name,nameType:"Personal",givenName:a,familyName:l,nameIdentifiers:d.author.orcid?[{nameIdentifier:d.author.orcid,nameIdentifierScheme:"ORCID",schemeUri:"https://orcid.org"}]:[],affiliation:((p=d.institutions)==null?void 0:p.map(v=>({name:v.display_name,affiliationIdentifier:v.id,affiliationIdentifierScheme:"OpenAlex",schemeUri:v.ror||""})))||[],language:"en"}}),r=((f=e.primary_location)==null?void 0:f.source.display_name)||"",t=((u=e.primary_location)==null?void 0:u.source.id)||"",n={rights:e.open_access.is_oa?`Open Access (${e.open_access.oa_status})`:"Closed Access",rightsUri:e.open_access.oa_url||"",schemeUri:"",rightsIdentifier:((h=e.primary_location)==null?void 0:h.license)||"",rightsIdentifierScheme:"License",lang:"en"};return{id:e.id,identifier:{identifier:e.doi||e.id},creators:o,titles:[{title:e.title,lang:"en"}],publisher:{name:r,publisherIdentifier:t,publisherIdentifierScheme:"OpenAlex",schemeURI:""},publicationYear:e.publication_year,subjects:lF(e.concepts),contributors:[],dates:[{date:e.publication_date||e.created_date,dateType:"Issued",dateInformation:"Publication date"},{date:e.updated_date,dateType:"Updated",dateInformation:"Last updated in OpenAlex"}],language:e.language||"en",resourceType:{resourceType:e.type,resourceTypeGeneral:uF(e.type)},alternateIdentifiers:cF(e.ids),relatedIdentifiers:hF(e.referenced_works),sizes:[],format:"",version:((s=e.primary_location)==null?void 0:s.version)||"",rights:n,description:e.abstract_inverted_index?[{description:dF(e.abstract_inverted_index),descriptionType:"Abstract",lang:"en"}]:[],geoLocation:[],fundingReferences:fF(e.grants),relatedItems:[]}}function mF(e){try{return pF(e)}catch(o){throw console.error("Error processing OpenAlex file:",o),o}}var ph={exports:{}},gF=ph.exports,c_;function yF(){return c_||(c_=1,function(e,o){(function(r,t){e.exports=t()})(gF,function(){var r=function(N,F){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,Y){V.__proto__=Y}||function(V,Y){for(var ee in Y)Object.prototype.hasOwnProperty.call(Y,ee)&&(V[ee]=Y[ee])})(N,F)},t=function(){return(t=Object.assign||function(N){for(var F,V=1,Y=arguments.length;V"u"||i.Promise||(i.Promise=Promise);var s=Object.getPrototypeOf,d={}.hasOwnProperty;function a(N,F){return d.call(N,F)}function l(N,F){typeof F=="function"&&(F=F(s(N))),(typeof Reflect>"u"?f:Reflect.ownKeys)(F).forEach(function(V){v(N,V,F[V])})}var p=Object.defineProperty;function v(N,F,V,Y){p(N,F,h(V&&a(V,"get")&&typeof V.get=="function"?{get:V.get,set:V.set,configurable:!0}:{value:V,configurable:!0,writable:!0},Y))}function _(N){return{from:function(F){return N.prototype=Object.create(F.prototype),v(N.prototype,"constructor",N),{extend:l.bind(null,N.prototype)}}}}var w=Object.getOwnPropertyDescriptor,x=[].slice;function m(N,F,V){return x.call(N,F,V)}function g(N,F){return F(N)}function b(N){if(!N)throw new Error("Assertion Failed")}function S(N){i.setImmediate?setImmediate(N):setTimeout(N,0)}function E(N,F){if(typeof F=="string"&&a(N,F))return N[F];if(!F)return N;if(typeof F!="string"){for(var V=[],Y=0,ee=F.length;Y"u"?[]:function(){var N=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[N,s(N),N];var F=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[F,s(F),N]}(),Qe=Gn[0],Qn=Gn[1],Gn=Gn[2],Qn=Qn&&Qn.then,kt=Qe&&Qe.constructor,se=!!Gn,pt=function(N,F){St.push([N,F]),it&&(queueMicrotask(Le),it=!1)},yt=!0,it=!0,Ce=[],ze=[],Ze=X,Xe={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:q,pgp:!1,env:{},finalize:q},Ve=Xe,St=[],lt=0,Et=[];function $e(N){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var F=this._PSD=Ve;if(typeof N!="function"){if(N!==Nt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Lt(this,this._value))}this._state=null,this._value=null,++F.ref,function V(Y,ee){try{ee(function(ie){if(Y._state===null){if(ie===Y)throw new TypeError("A promise cannot be resolved with itself.");var le=Y._lib&&We();ie&&typeof ie.then=="function"?V(Y,function(pe,we){ie instanceof $e?ie._then(pe,we):ie.then(pe,we)}):(Y._state=!0,Y._value=ie,mn(Y)),le&&_t()}},Lt.bind(null,Y))}catch(ie){Lt(Y,ie)}}(this,N)}var Gt={get:function(){var N=Ve,F=jr;function V(Y,ee){var ie=this,le=!N.global&&(N!==Ve||F!==jr),pe=le&&!ar(),we=new $e(function(Se,Te){Mr(ie,new Xt(ta(Y,N,le,pe),ta(ee,N,le,pe),Se,Te,N))});return this._consoleTask&&(we._consoleTask=this._consoleTask),we}return V.prototype=Nt,V},set:function(N){v(this,"then",N&&N.prototype===Nt?Gt:{get:function(){return N},set:Gt.set})}};function Xt(N,F,V,Y,ee){this.onFulfilled=typeof N=="function"?N:null,this.onRejected=typeof F=="function"?F:null,this.resolve=V,this.reject=Y,this.psd=ee}function Lt(N,F){var V,Y;ze.push(F),N._state===null&&(V=N._lib&&We(),F=Ze(F),N._state=!1,N._value=F,Y=N,Ce.some(function(ee){return ee._value===Y._value})||Ce.push(Y),mn(N),V&&_t())}function mn(N){var F=N._listeners;N._listeners=[];for(var V=0,Y=F.length;V.",Qt="String expected.",fo=[],po="__dbnames",fi="readonly",mo="readwrite";function Br(N,F){return N?F?function(){return N.apply(this,arguments)&&F.apply(this,arguments)}:N:F}var di={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function zr(N){return typeof N!="string"||/\./.test(N)?function(F){return F}:function(F){return F[N]===void 0&&N in F&&delete(F=B(F))[N],F}}function Wn(){throw he.Type()}function Rt(N,F){try{var V=On(N),Y=On(F);if(V!==Y)return V==="Array"?1:Y==="Array"?-1:V==="binary"?1:Y==="binary"?-1:V==="string"?1:Y==="string"?-1:V==="Date"?1:Y!=="Date"?NaN:-1;switch(V){case"number":case"Date":case"string":return Fje+Ue&&Ie(je+Te)})})}var Me=kn(V)&&V.limit===1/0&&(typeof N!="function"||N===rs)&&{index:V.index,range:V.range};return Ie(0).then(function(){if(0=Ne})).length!==0?(Te.forEach(function(Ie){Pe.push(function(){var Me=Ae,je=Ie._cfg.dbschema;bn(me,Me,De),bn(me,je,De),Ae=me._dbSchema=je;var Ue=vi(Me,je);Ue.add.forEach(function(ot){as(De,ot[0],ot[1].primKey,ot[1].indexes)}),Ue.change.forEach(function(ot){if(ot.recreate)throw new he.Upgrade("Not yet support for changing primary key");var tt=De.objectStore(ot.name);ot.add.forEach(function(st){return Ro(tt,st)}),ot.change.forEach(function(st){tt.deleteIndex(st.name),Ro(tt,st)}),ot.del.forEach(function(st){return tt.deleteIndex(st)})});var Ye=Ie._cfg.contentUpgrade;if(Ye&&Ie._cfg.version>Ne){yi(me,De),be._memoizedTables={};var rt=T(je);Ue.del.forEach(function(ot){rt[ot]=Me[ot]}),sa(me,[me.Transaction.prototype]),Fo(me,[me.Transaction.prototype],f(rt),rt),be.schema=rt;var Je,et=J(Ye);return et&&ho(),Ue=$e.follow(function(){var ot;(Je=Ye(be))&&et&&(ot=ar.bind(null,null),Je.then(ot,ot))}),Je&&typeof Je.then=="function"?$e.resolve(Je):Ue.then(function(){return Je})}}),Pe.push(function(Me){var je,Ue,Ye=Ie._cfg.dbschema;je=Ye,Ue=Me,[].slice.call(Ue.db.objectStoreNames).forEach(function(rt){return je[rt]==null&&Ue.db.deleteObjectStore(rt)}),sa(me,[me.Transaction.prototype]),Fo(me,[me.Transaction.prototype],me._storeNames,me._dbSchema),be.schema=me._dbSchema}),Pe.push(function(Me){me.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(me.idbdb.version/10)===Ie._cfg.version?(me.idbdb.deleteObjectStore("$meta"),delete me._dbSchema.$meta,me._storeNames=me._storeNames.filter(function(je){return je!=="$meta"})):Me.objectStore("$meta").put(Ie._cfg.version,"version"))})}),function Ie(){return Pe.length?$e.resolve(Pe.shift()(be.idbtrans)).then(Ie):$e.resolve()}().then(function(){ua(Ae,De)})):$e.resolve();var me,Ne,be,De,Pe,Ae}).catch(le)):(f(ee).forEach(function(Te){as(V,Te,ee[Te].primKey,ee[Te].indexes)}),yi(N,V),void $e.follow(function(){return N.on.populate.fire(ie)}).catch(le));var we,Se})}function ru(N,F){ua(N._dbSchema,F),F.db.version%10!=0||F.objectStoreNames.contains("$meta")||F.db.createObjectStore("$meta").add(Math.ceil(F.db.version/10-1),"version");var V=la(0,N.idbdb,F);bn(N,N._dbSchema,F);for(var Y=0,ee=vi(V,N._dbSchema).change;YMath.pow(2,62)?0:Ae.oldVersion,me=Ae<1,N.idbdb=Pe.result,ie&&ru(N,Te),vo(N,Ae/10,Te,be))},be),Pe.onsuccess=Vt(function(){Te=null;var Ae,Ie,Me,je,Ue,Ye=N.idbdb=Pe.result,rt=m(Ye.objectStoreNames);if(0"u"?$e.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Ne){function be(){return indexedDB.databases().finally(Ne)}we=setInterval(be,100),be()}).finally(function(){return clearInterval(we)}):Promise.resolve()).then(pe)]).then(function(){return le(),F.onReadyBeingFired=[],$e.resolve(ha(function(){return N.on.ready.fire(N.vip)})).then(function Ne(){if(0F.limit?Ne.length=F.limit:N.length===F.limit&&Ne.length=Ie.limit&&(!Ie.values||Ye.req.values)&&$l(Ye.req.query.range,Ie.query.range)}),!1,Me,je];case"count":return Ue=je.find(function(Ye){return Hl(Ye.req.query.range,Ie.query.range)}),[Ue,!!Ue,Me,je]}}(F,V,"query",ie),Te=Se[0],me=Se[1],Ne=Se[2],be=Se[3];return Te&&me?Te.obsSet=ie.obsSet:(me=Y.query(ie).then(function(De){var Pe=De.result;if(Te&&(Te.res=Pe),le){for(var Ae=0,Ie=Pe.length;Ae{async function u(){try{n(!0);const h=new _F(e);r(h),f(null)}catch(h){console.error("Database initialization failed:",h),f(h instanceof Error?h:new Error("Unknown database error"))}finally{n(!1)}}u()},[e]),{db:o,isLoading:t,error:i}}const Nb=({value:e=50,min:o=0,max:r=100,label:t="Progress"})=>(MI(),Q.jsx("div",{className:"w-4 h-4 border-2 border-black border-b-transparent rounded-full animate-spin"})),si=({id:e})=>{const o="https://api.openalex.org/works?per-page=20&filter=",{nodes:r,edges:t}=lo(),[n,i]=ae.useState(),[f,u]=ae.useState(!1),[h,s]=ae.useState(),{db:d}=ig("flow1"),[a,l]=ae.useState(!1),p=async x=>{if(d)try{await d.metadata.add(x);const m=await d.metadata.toArray();l(!0)}catch(m){console.error("Error adding data:",m)}},v=()=>{u(!0);let g=w.map(b=>b.data).map(b=>b.filter+":"+b.filter_value).join(",");fetch(o+g).then(b=>{if(b.ok)return b.json();throw new Error("Something went wrong!")}).then(b=>{s(b)}).catch(b=>{console.error(b)})};function _(){if(h){let x=Object(h);if(i(x.meta.count),x.results[0])for(let m of x.results){const g=mF(m);p(g)}u(!1)}}ae.useEffect(()=>_(),[h]);const w=ae.useMemo(()=>Tb({id:e,nodes:r,edges:t}),[r,t]);return Q.jsx(aF,{type:si.name,group:si.group,children:Q.jsxs("div",{className:"flex flex-col flex-grow items-stretch justify-between",children:[Q.jsx("div",{className:"flex flex-grow justify-center items-center text-xl",children:f?Q.jsx(Nb,{}):`n = ${n?n.toLocaleString():"?"}`}),Q.jsxs("div",{className:"flex flex-shrink flex-row justify-center border-t-2 rounded-b-md gap-4 text-2xl px-2 py-2 items-center",children:[Q.jsx(oI,{className:"border-1 border-black rounded-sm text-4xl bg-green-100",onClick:()=>v()}),Q.jsx(tI,{className:"border-1 border-black rounded-sm text-4xl"}),Q.jsx(eI,{className:"border-1 border-black rounded-sm text-4xl"})]})]})},e)};si.label="sink";si.display_label="Sink";si.source="OpenAlex";si.display_source="OA";si.group="Repository";si.type="Computation";const xF=Object.freeze(Object.defineProperty({__proto__:null,Loader:Nb,default:si},Symbol.toStringTag,{value:"Module"})),Pb="nodeRegistry",to={};async function wF(){const e=Object.assign({"/src/flow/core/OpenAlex/nodes/BaseTermNode.tsx":HI,"/src/flow/core/OpenAlex/nodes/FilterNodeFactory.tsx":oF,"/src/flow/core/OpenAlex/nodes/SinkNode.jsx":xF});for(const o in e){const r=e[o];if(r.default){const t=r.default;if(!t.name){console.warn(`Skipping invalid core node module: ${o}`);continue}f_(`${t.source}-${t.label}`,t);continue}if(r.factory&&typeof r.factory=="function"){const t=r.factory();if(!Array.isArray(t)){console.warn(`Factory in ${o} did not return an array of nodes.`);continue}t.forEach(n=>{if(!n||!n.label||!n.component){console.warn(`Skipping invalid node in factory from ${o}`);return}f_(`${n.source}-${n.label}`,n.component)})}}}function bF(){const e=localStorage.getItem(Pb);if(e)try{const o=JSON.parse(e);Object.keys(o).forEach(r=>{to[r]&&(to[r].config=o[r])})}catch(o){console.error("Failed to parse registry from storage:",o)}}function SF(){const e={};Object.keys(to).forEach(o=>{e[o]=to[o].config});try{localStorage.setItem(Pb,JSON.stringify(e,null,2))}catch(o){console.error("Failed to save registry to storage:",o)}}function f_(e,o,r={}){to[e]?(to[e].config={...to[e].config,...r},to[e].component=o):to[e]={component:o,config:r},SF()}function EF(){const e={};return Object.keys(to).forEach(o=>{e[o]=to[o].component}),e}async function CF(){bF(),await wF()}const AF="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let im=(e=21)=>{let o="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)o+=AF[r[e]&63];return o};const DF=({nodeMenuVisible:e,setNodeMenuVisible:o})=>Q.jsx(Db,{isOpen:e,setIsOpen:o,closeText:"Close",title:"Add Node",children:Q.jsx("div",{className:"flex flex-col mt-2 gap-2"})});CF();const eh=EF(),TF=({nodesIn:e,edgesIn:o})=>{const r=ae.useRef(null),{viewport:t,onNodesChange:n,onEdgesChange:i,onConnect:f,addNode:u,addEdge:h,setViewport:s,updateNodeTypes:d}=lo();ae.useMemo(()=>{d(Object.keys(eh))},[]);const a=e,l=o,p=ae.useMemo(()=>[...new Set(a.map(m=>m.type))].slice(-10),[]),[v,_]=ae.useState(!1),w=Kh(),x=ae.useCallback((m,g,b)=>{if(!Object.keys(eh).includes(b))return;const S=w.getNodes().find(R=>R.id===m);if(!S||!S.measured)return;let{x:E,y:A}=S.position;const{width:T,height:D}=S.measured,O=40,I=40,M=im();g==="right"&&(E+=O+T),g==="left"&&(E-=O+T),g==="top"&&(A-=I+D),g==="bottom"&&(A+=I+D),u({id:M,type:b,position:{x:E,y:A},data:{}});const B={id:im(),source:"",sourceHandle:"",target:"",targetHandle:""};switch(g){case"left":Object.assign(B,{source:M,sourceHandle:"outgoingR",target:m,targetHandle:"incomingL"});break;case"right":Object.assign(B,{source:m,sourceHandle:"outgoingR",target:M,targetHandle:"incomingL"});break;case"top":Object.assign(B,{source:M,sourceHandle:"outgoingB",target:m,targetHandle:"incomingT"});break;case"bottom":Object.assign(B,{source:m,sourceHandle:"outgoingB",target:M,targetHandle:"incomingT"});break}h(B)},[h,u,w]);return MN({onEnd:m=>s(m)}),Q.jsxs("div",{className:"flow",children:[Q.jsx(DF,{nodeMenuVisible:v,setNodeMenuVisible:_}),Q.jsx("div",{ref:r,className:"reactflow-wrapper",children:Q.jsx(rg.Provider,{value:{createNodeContext:x,nodeTypes:eh,recentNodeTypes:p},children:Q.jsxs(FN,{nodes:a,defaultViewport:t,edges:l,nodeTypes:eh,onNodesChange:n,onEdgesChange:i,onConnect:f,nodeOrigin:[.5,.5],snapToGrid:!0,snapGrid:[4,4],minZoom:.2,connectionLineType:Zo.SmoothStep,children:[Q.jsx(YN,{}),Q.jsx(HN,{gap:16})]})})})]})};class NF extends ae.Component{constructor(o){super(o),this.state={hasError:!1,errorMessage:""}}static getDerivedStateFromError(o){return{hasError:!0,errorMessage:o.toString()}}componentDidCatch(o,r){console.error("ErrorBoundary caught an error:",o,r)}render(){return this.state.hasError?Q.jsxs("div",{style:{padding:"20px",color:"red",backgroundColor:"#ffe6e6"},children:[Q.jsx("h2",{children:"Something went wrong."}),Q.jsx("p",{children:this.state.errorMessage})]}):this.props.children}}const PF=({nodes:e,edges:o})=>{const[r,t]=ae.useState();return Q.jsx(Q.Fragment,{children:Q.jsx(NF,{children:Q.jsx(vw,{children:Q.jsx(TF,{nodesIn:e,edgesIn:o})})})})};var Uu={},d_;function OF(){if(d_)return Uu;d_=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.parse=f,Uu.serialize=s;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,o=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,t=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,i=(()=>{const l=function(){};return l.prototype=Object.create(null),l})();function f(l,p){const v=new i,_=l.length;if(_<2)return v;const w=(p==null?void 0:p.decode)||d;let x=0;do{const m=l.indexOf("=",x);if(m===-1)break;const g=l.indexOf(";",x),b=g===-1?_:g;if(m>b){x=l.lastIndexOf(";",m-1)+1;continue}const S=u(l,x,m),E=h(l,m,S),A=l.slice(S,E);if(v[A]===void 0){let T=u(l,m+1,b),D=h(l,b,T);const O=w(l.slice(T,D));v[A]=O}x=b+1}while(x<_);return v}function u(l,p,v){do{const _=l.charCodeAt(p);if(_!==32&&_!==9)return p}while(++pv;){const _=l.charCodeAt(--p);if(_!==32&&_!==9)return p+1}return v}function s(l,p,v){const _=(v==null?void 0:v.encode)||encodeURIComponent;if(!e.test(l))throw new TypeError(`argument name is invalid: ${l}`);const w=_(p);if(!o.test(w))throw new TypeError(`argument val is invalid: ${p}`);let x=l+"="+w;if(!v)return x;if(v.maxAge!==void 0){if(!Number.isInteger(v.maxAge))throw new TypeError(`option maxAge is invalid: ${v.maxAge}`);x+="; Max-Age="+v.maxAge}if(v.domain){if(!r.test(v.domain))throw new TypeError(`option domain is invalid: ${v.domain}`);x+="; Domain="+v.domain}if(v.path){if(!t.test(v.path))throw new TypeError(`option path is invalid: ${v.path}`);x+="; Path="+v.path}if(v.expires){if(!a(v.expires)||!Number.isFinite(v.expires.valueOf()))throw new TypeError(`option expires is invalid: ${v.expires}`);x+="; Expires="+v.expires.toUTCString()}if(v.httpOnly&&(x+="; HttpOnly"),v.secure&&(x+="; Secure"),v.partitioned&&(x+="; Partitioned"),v.priority)switch(typeof v.priority=="string"?v.priority.toLowerCase():void 0){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${v.priority}`)}if(v.sameSite)switch(typeof v.sameSite=="string"?v.sameSite.toLowerCase():v.sameSite){case!0:case"strict":x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"none":x+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${v.sameSite}`)}return x}function d(l){if(l.indexOf("%")===-1)return l;try{return decodeURIComponent(l)}catch{return l}}function a(l){return n.call(l)==="[object Date]"}return Uu}OF();/** * react-router v7.1.5 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var p_="popstate";function kF(e={}){function o(n,i){let{pathname:f="/",search:u="",hash:h=""}=Xa(n.location.hash.substring(1));return!f.startsWith("/")&&!f.startsWith(".")&&(f="/"+f),am("",{pathname:f,search:u,hash:h},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){let f=n.document.querySelector("base"),u="";if(f&&f.getAttribute("href")){let h=n.location.href,s=h.indexOf("#");u=s===-1?h:h.slice(0,s)}return u+"#"+(typeof i=="string"?i:ml(i))}function t(n,i){so(n.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(i)})`)}return FF(o,r,t,e)}function ln(e,o){if(e===!1||e===null||typeof e>"u")throw new Error(o)}function so(e,o){if(!e){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function IF(){return Math.random().toString(36).substring(2,10)}function m_(e,o){return{usr:e.state,key:e.key,idx:o}}function am(e,o,r=null,t){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof o=="string"?Xa(o):o,state:r,key:o&&o.key||t||IF()}}function ml({pathname:e="/",search:o="",hash:r=""}){return o&&o!=="?"&&(e+=o.charAt(0)==="?"?o:"?"+o),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Xa(e){let o={};if(e){let r=e.indexOf("#");r>=0&&(o.hash=e.substring(r),e=e.substring(0,r));let t=e.indexOf("?");t>=0&&(o.search=e.substring(t),e=e.substring(0,t)),e&&(o.pathname=e)}return o}function FF(e,o,r,t={}){let{window:n=document.defaultView,v5Compat:i=!1}=t,f=n.history,u="POP",h=null,s=d();s==null&&(s=0,f.replaceState({...f.state,idx:s},""));function d(){return(f.state||{idx:null}).idx}function a(){u="POP";let w=d(),x=w==null?null:w-s;s=w,h&&h({action:u,location:_.location,delta:x})}function l(w,x){u="PUSH";let m=am(_.location,w,x);r&&r(m,w),s=d()+1;let g=m_(m,s),b=_.createHref(m);try{f.pushState(g,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;n.location.assign(b)}i&&h&&h({action:u,location:_.location,delta:1})}function p(w,x){u="REPLACE";let m=am(_.location,w,x);r&&r(m,w),s=d();let g=m_(m,s),b=_.createHref(m);f.replaceState(g,"",b),i&&h&&h({action:u,location:_.location,delta:0})}function v(w){let x=n.location.origin!=="null"?n.location.origin:n.location.href,m=typeof w=="string"?w:ml(w);return m=m.replace(/ $/,"%20"),ln(x,`No window.location.(origin|href) available to create URL for href: ${m}`),new URL(m,x)}let _={get action(){return u},get location(){return e(n,f)},listen(w){if(h)throw new Error("A history only accepts one active listener");return n.addEventListener(p_,a),h=w,()=>{n.removeEventListener(p_,a),h=null}},createHref(w){return o(n,w)},createURL:v,encodeLocation(w){let x=v(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:l,replace:p,go(w){return f.go(w)}};return _}function Ob(e,o,r="/"){return RF(e,o,r,!1)}function RF(e,o,r,t){let n=typeof o=="string"?Xa(o):o,i=Ki(n.pathname||"/",r);if(i==null)return null;let f=kb(e);MF(f);let u=null;for(let h=0;u==null&&h{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:f,route:i};h.relativePath.startsWith("/")&&(ln(h.relativePath.startsWith(t),`Absolute route path "${h.relativePath}" nested under path "${t}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(t.length));let s=ri([t,h.relativePath]),d=r.concat(h);i.children&&i.children.length>0&&(ln(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),kb(i.children,o,d,s)),!(i.path==null&&!i.index)&&o.push({path:s,score:HF(s,i.index),routesMeta:d})};return e.forEach((i,f)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))n(i,f);else for(let h of Ib(i.path))n(i,f,h)}),o}function Ib(e){let o=e.split("/");if(o.length===0)return[];let[r,...t]=o,n=r.endsWith("?"),i=r.replace(/\?$/,"");if(t.length===0)return n?[i,""]:[i];let f=Ib(t.join("/")),u=[];return u.push(...f.map(h=>h===""?i:[i,h].join("/"))),n&&u.push(...f),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function MF(e){e.sort((o,r)=>o.score!==r.score?r.score-o.score:$F(o.routesMeta.map(t=>t.childrenIndex),r.routesMeta.map(t=>t.childrenIndex)))}var LF=/^:[\w-]+$/,jF=3,BF=2,zF=1,UF=10,VF=-2,g_=e=>e==="*";function HF(e,o){let r=e.split("/"),t=r.length;return r.some(g_)&&(t+=VF),o&&(t+=BF),r.filter(n=>!g_(n)).reduce((n,i)=>n+(LF.test(i)?jF:i===""?zF:UF),t)}function $F(e,o){return e.length===o.length&&e.slice(0,-1).every((t,n)=>t===o[n])?e[e.length-1]-o[o.length-1]:0}function WF(e,o,r=!1){let{routesMeta:t}=e,n={},i="/",f=[];for(let u=0;u{if(d==="*"){let v=u[l]||"";f=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const p=u[l];return a&&!p?s[d]=void 0:s[d]=(p||"").replace(/%2F/g,"/"),s},{}),pathname:i,pathnameBase:f,pattern:e}}function GF(e,o=!1,r=!0){so(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let t=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,u,h)=>(t.push({paramName:u,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(t.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,o?void 0:"i"),t]}function qF(e){try{return e.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return so(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),e}}function Ki(e,o){if(o==="/")return e;if(!e.toLowerCase().startsWith(o.toLowerCase()))return null;let r=o.endsWith("/")?o.length-1:o.length,t=e.charAt(r);return t&&t!=="/"?null:e.slice(r)||"/"}function XF(e,o="/"){let{pathname:r,search:t="",hash:n=""}=typeof e=="string"?Xa(e):e;return{pathname:r?r.startsWith("/")?r:KF(r,o):o,search:QF(t),hash:ZF(n)}}function KF(e,o){let r=o.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function ap(e,o,r,t){return`Cannot include a '${e}' character in a manually specified \`to.${o}\` field [${JSON.stringify(t)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function YF(e){return e.filter((o,r)=>r===0||o.route.path&&o.route.path.length>0)}function Fb(e){let o=YF(e);return o.map((r,t)=>t===o.length-1?r.pathname:r.pathnameBase)}function Rb(e,o,r,t=!1){let n;typeof e=="string"?n=Xa(e):(n={...e},ln(!n.pathname||!n.pathname.includes("?"),ap("?","pathname","search",n)),ln(!n.pathname||!n.pathname.includes("#"),ap("#","pathname","hash",n)),ln(!n.search||!n.search.includes("#"),ap("#","search","hash",n)));let i=e===""||n.pathname==="",f=i?"/":n.pathname,u;if(f==null)u=r;else{let a=o.length-1;if(!t&&f.startsWith("..")){let l=f.split("/");for(;l[0]==="..";)l.shift(),a-=1;n.pathname=l.join("/")}u=a>=0?o[a]:"/"}let h=XF(n,u),s=f&&f!=="/"&&f.endsWith("/"),d=(i||f===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(s||d)&&(h.pathname+="/"),h}var ri=e=>e.join("/").replace(/\/\/+/g,"/"),JF=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function eR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Mb=["POST","PUT","PATCH","DELETE"];new Set(Mb);var tR=["GET",...Mb];new Set(tR);var Qs=ae.createContext(null);Qs.displayName="DataRouter";var hf=ae.createContext(null);hf.displayName="DataRouterState";var Lb=ae.createContext({isTransitioning:!1});Lb.displayName="ViewTransition";var nR=ae.createContext(new Map);nR.displayName="Fetchers";var rR=ae.createContext(null);rR.displayName="Await";var Oo=ae.createContext(null);Oo.displayName="Navigation";var Pl=ae.createContext(null);Pl.displayName="Location";var co=ae.createContext({outlet:null,matches:[],isDataRoute:!1});co.displayName="Route";var ag=ae.createContext(null);ag.displayName="RouteError";function oR(e,{relative:o}={}){ln(Ol(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:t}=ae.useContext(Oo),{hash:n,pathname:i,search:f}=kl(e,{relative:o}),u=i;return r!=="/"&&(u=i==="/"?r:ri([r,i])),t.createHref({pathname:u,search:f,hash:n})}function Ol(){return ae.useContext(Pl)!=null}function Zi(){return ln(Ol(),"useLocation() may be used only in the context of a component."),ae.useContext(Pl).location}var jb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bb(e){ae.useContext(Oo).static||ae.useLayoutEffect(e)}function sg(){let{isDataRoute:e}=ae.useContext(co);return e?xR():iR()}function iR(){ln(Ol(),"useNavigate() may be used only in the context of a component.");let e=ae.useContext(Qs),{basename:o,navigator:r}=ae.useContext(Oo),{matches:t}=ae.useContext(co),{pathname:n}=Zi(),i=JSON.stringify(Fb(t)),f=ae.useRef(!1);return Bb(()=>{f.current=!0}),ae.useCallback((h,s={})=>{if(so(f.current,jb),!f.current)return;if(typeof h=="number"){r.go(h);return}let d=Rb(h,JSON.parse(i),n,s.relative==="path");e==null&&o!=="/"&&(d.pathname=d.pathname==="/"?o:ri([o,d.pathname])),(s.replace?r.replace:r.push)(d,s.state,s)},[o,r,i,n,e])}var aR=ae.createContext(null);function sR(e){let o=ae.useContext(co).outlet;return o&&ae.createElement(aR.Provider,{value:e},o)}function uR(){let{matches:e}=ae.useContext(co),o=e[e.length-1];return o?o.params:{}}function kl(e,{relative:o}={}){let{matches:r}=ae.useContext(co),{pathname:t}=Zi(),n=JSON.stringify(Fb(r));return ae.useMemo(()=>Rb(e,JSON.parse(n),t,o==="path"),[e,n,t,o])}function lR(e,o){return zb(e,o)}function zb(e,o,r,t){var m;ln(Ol(),"useRoutes() may be used only in the context of a component.");let{navigator:n,static:i}=ae.useContext(Oo),{matches:f}=ae.useContext(co),u=f[f.length-1],h=u?u.params:{},s=u?u.pathname:"/",d=u?u.pathnameBase:"/",a=u&&u.route;{let g=a&&a.path||"";Ub(s,!a||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${s}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let l=Zi(),p;if(o){let g=typeof o=="string"?Xa(o):o;ln(d==="/"||((m=g.pathname)==null?void 0:m.startsWith(d)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${g.pathname}" was given in the \`location\` prop.`),p=g}else p=l;let v=p.pathname||"/",_=v;if(d!=="/"){let g=d.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(g.length).join("/")}let w=!i&&r&&r.matches&&r.matches.length>0?r.matches:Ob(e,{pathname:_});so(a||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),so(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let x=pR(w&&w.map(g=>Object.assign({},g,{params:Object.assign({},h,g.params),pathname:ri([d,n.encodeLocation?n.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?d:ri([d,n.encodeLocation?n.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),f,r,t);return o&&x?ae.createElement(Pl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},x):x}function cR(){let e=_R(),o=eR(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,t="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:t},i={padding:"2px 4px",backgroundColor:t},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=ae.createElement(ae.Fragment,null,ae.createElement("p",null,"💿 Hey developer 👋"),ae.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ae.createElement("code",{style:i},"ErrorBoundary")," or"," ",ae.createElement("code",{style:i},"errorElement")," prop on your route.")),ae.createElement(ae.Fragment,null,ae.createElement("h2",null,"Unexpected Application Error!"),ae.createElement("h3",{style:{fontStyle:"italic"}},o),r?ae.createElement("pre",{style:n},r):null,f)}var hR=ae.createElement(cR,null),fR=class extends ae.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,o){return o.location!==e.location||o.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:o.error,location:o.location,revalidation:e.revalidation||o.revalidation}}componentDidCatch(e,o){console.error("React Router caught the following error during render",e,o)}render(){return this.state.error!==void 0?ae.createElement(co.Provider,{value:this.props.routeContext},ae.createElement(ag.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function dR({routeContext:e,match:o,children:r}){let t=ae.useContext(Qs);return t&&t.static&&t.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(t.staticContext._deepestRenderedBoundaryId=o.route.id),ae.createElement(co.Provider,{value:e},r)}function pR(e,o=[],r=null,t=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(o.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,i=r==null?void 0:r.errors;if(i!=null){let h=n.findIndex(s=>s.route.id&&(i==null?void 0:i[s.route.id])!==void 0);ln(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),n=n.slice(0,Math.min(n.length,h+1))}let f=!1,u=-1;if(r)for(let h=0;h=0?n=n.slice(0,u+1):n=[n[0]];break}}}return n.reduceRight((h,s,d)=>{let a,l=!1,p=null,v=null;r&&(a=i&&s.route.id?i[s.route.id]:void 0,p=s.route.errorElement||hR,f&&(u<0&&d===0?(Ub("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),l=!0,v=null):u===d&&(l=!0,v=s.route.hydrateFallbackElement||null)));let _=o.concat(n.slice(0,d+1)),w=()=>{let x;return a?x=p:l?x=v:s.route.Component?x=ae.createElement(s.route.Component,null):s.route.element?x=s.route.element:x=h,ae.createElement(dR,{match:s,routeContext:{outlet:h,matches:_,isDataRoute:r!=null},children:x})};return r&&(s.route.ErrorBoundary||s.route.errorElement||d===0)?ae.createElement(fR,{location:r.location,revalidation:r.revalidation,component:p,error:a,children:w(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):w()},null)}function ug(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mR(e){let o=ae.useContext(Qs);return ln(o,ug(e)),o}function gR(e){let o=ae.useContext(hf);return ln(o,ug(e)),o}function yR(e){let o=ae.useContext(co);return ln(o,ug(e)),o}function lg(e){let o=yR(e),r=o.matches[o.matches.length-1];return ln(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function vR(){return lg("useRouteId")}function _R(){var t;let e=ae.useContext(ag),o=gR("useRouteError"),r=lg("useRouteError");return e!==void 0?e:(t=o.errors)==null?void 0:t[r]}function xR(){let{router:e}=mR("useNavigate"),o=lg("useNavigate"),r=ae.useRef(!1);return Bb(()=>{r.current=!0}),ae.useCallback(async(n,i={})=>{so(r.current,jb),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:o,...i}))},[e,o])}var y_={};function Ub(e,o,r){!o&&!y_[e]&&(y_[e]=!0,so(!1,r))}ae.memo(wR);function wR({routes:e,future:o,state:r}){return zb(e,void 0,r,o)}function Vb(e){return sR(e.context)}function Rs(e){ln(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function bR({basename:e="/",children:o=null,location:r,navigationType:t="POP",navigator:n,static:i=!1}){ln(!Ol(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),u=ae.useMemo(()=>({basename:f,navigator:n,static:i,future:{}}),[f,n,i]);typeof r=="string"&&(r=Xa(r));let{pathname:h="/",search:s="",hash:d="",state:a=null,key:l="default"}=r,p=ae.useMemo(()=>{let v=Ki(h,f);return v==null?null:{location:{pathname:v,search:s,hash:d,state:a,key:l},navigationType:t}},[f,h,s,d,a,l,t]);return so(p!=null,` is not able to match the URL "${h}${s}${d}" because it does not start with the basename, so the won't render anything.`),p==null?null:ae.createElement(Oo.Provider,{value:u},ae.createElement(Pl.Provider,{children:o,value:p}))}function SR({children:e,location:o}){return lR(sm(e),o)}function sm(e,o=[]){let r=[];return ae.Children.forEach(e,(t,n)=>{if(!ae.isValidElement(t))return;let i=[...o,n];if(t.type===ae.Fragment){r.push.apply(r,sm(t.props.children,i));return}ln(t.type===Rs,`[${typeof t.type=="string"?t.type:t.type.name}] is not a component. All component children of must be a or `),ln(!t.props.index||!t.props.children,"An index route cannot have child routes.");let f={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:t.props.hasErrorBoundary===!0||t.props.ErrorBoundary!=null||t.props.errorElement!=null,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(f.children=sm(t.props.children,i)),r.push(f)}),r}var mh="get",gh="application/x-www-form-urlencoded";function ff(e){return e!=null&&typeof e.tagName=="string"}function ER(e){return ff(e)&&e.tagName.toLowerCase()==="button"}function CR(e){return ff(e)&&e.tagName.toLowerCase()==="form"}function AR(e){return ff(e)&&e.tagName.toLowerCase()==="input"}function DR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function TR(e,o){return e.button===0&&(!o||o==="_self")&&!DR(e)}var th=null;function NR(){if(th===null)try{new FormData(document.createElement("form"),0),th=!1}catch{th=!0}return th}var PR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sp(e){return e!=null&&!PR.has(e)?(so(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${gh}"`),null):e}function OR(e,o){let r,t,n,i,f;if(CR(e)){let u=e.getAttribute("action");t=u?Ki(u,o):null,r=e.getAttribute("method")||mh,n=sp(e.getAttribute("enctype"))||gh,i=new FormData(e)}else if(ER(e)||AR(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a