claude-cwc 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@
46
46
  `+u[l].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=l&&0<=a);break}}}finally{pu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Fn(n):""}function Px(e,t){switch(e.tag){case 26:case 27:case 5:return Fn(e.type);case 16:return Fn("Lazy");case 13:return e.child!==t&&t!==null?Fn("Suspense Fallback"):Fn("Suspense");case 19:return Fn("SuspenseList");case 0:case 15:return yu(e.type,!1);case 11:return yu(e.type.render,!1);case 1:return yu(e.type,!0);case 31:return Fn("Activity");default:return""}}function Pf(e){try{var t="",n=null;do t+=Px(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
47
  Error generating stack: `+l.message+`
48
48
  `+l.stack}}var mr=Object.prototype.hasOwnProperty,Nc=Be.unstable_scheduleCallback,vu=Be.unstable_cancelCallback,e1=Be.unstable_shouldYield,t1=Be.unstable_requestPaint,ft=Be.unstable_now,n1=Be.unstable_getCurrentPriorityLevel,Fg=Be.unstable_ImmediatePriority,Ig=Be.unstable_UserBlockingPriority,Ks=Be.unstable_NormalPriority,l1=Be.unstable_LowPriority,Pg=Be.unstable_IdlePriority,a1=Be.log,i1=Be.unstable_setDisableYieldValue,Oi=null,dt=null;function Mn(e){if(typeof a1=="function"&&i1(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Oi,e)}catch{}}var ht=Math.clz32?Math.clz32:u1,s1=Math.log,o1=Math.LN2;function u1(e){return e>>>=0,e===0?32:31-(s1(e)/o1|0)|0}var ts=256,ns=262144,ls=4194304;function In(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ho(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~i,l!==0?a=In(l):(s&=o,s!==0?a=In(s):n||(n=o&~e,n!==0&&(a=In(n))))):(o=l&~i,o!==0?a=In(o):s!==0?a=In(s):n||(n=l&~e,n!==0&&(a=In(n)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Hi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function r1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function em(){var e=ls;return ls<<=1,!(ls&62914560)&&(ls=4194304),e}function xu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ri(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function c1(e,t,n,l,a,i){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,u=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var h=31-ht(n),d=1<<h;o[h]=0,u[h]=-1;var f=c[h];if(f!==null)for(c[h]=null,h=0;h<f.length;h++){var g=f[h];g!==null&&(g.lane&=-536870913)}n&=~d}l!==0&&tm(e,l,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function tm(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-ht(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function nm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-ht(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function lm(e,t){var n=t&-t;return n=n&42?1:jc(n),n&(e.suspendedLanes|t)?0:n}function jc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Cc(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function am(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:C0(e.type))}function ed(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var Zn=Math.random().toString(36).slice(2),Ge="__reactFiber$"+Zn,at="__reactProps$"+Zn,ba="__reactContainer$"+Zn,pr="__reactEvents$"+Zn,f1="__reactListeners$"+Zn,d1="__reactHandles$"+Zn,td="__reactResources$"+Zn,Li="__reactMarker$"+Zn;function Mc(e){delete e[Ge],delete e[at],delete e[pr],delete e[f1],delete e[d1]}function kl(e){var t=e[Ge];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ba]||n[Ge]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uh(e);e!==null;){if(n=e[Ge])return n;e=uh(e)}return t}e=n,n=e.parentNode}return null}function wa(e){if(e=e[Ge]||e[ba]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(V(33))}function $l(e){var t=e[td];return t||(t=e[td]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ye(e){e[Li]=!0}var im=new Set,sm={};function xl(e,t){ta(e,t),ta(e+"Capture",t)}function ta(e,t){for(sm[e]=t,e=0;e<t.length;e++)im.add(t[e])}var h1=RegExp("^[: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]*$"),nd={},ld={};function g1(e){return mr.call(ld,e)?!0:mr.call(nd,e)?!1:h1.test(e)?ld[e]=!0:(nd[e]=!0,!1)}function Ns(e,t,n){if(g1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function as(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Zt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function om(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m1(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){if(!e._valueTracker){var t=om(e)?"checked":"value";e._valueTracker=m1(e,t,""+e[t])}}function um(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=om(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Js(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var p1=/[\n"\\]/g;function wt(e){return e.replace(p1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vr(e,t,n,l,a,i,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?xr(e,s,xt(t)):n!=null?xr(e,s,xt(n)):l!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+xt(o):e.removeAttribute("name")}function rm(e,t,n,l,a,i,s,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){yr(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=o?e.checked:!!l,e.defaultChecked=!!l,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),yr(e)}function xr(e,t,n){t==="number"&&Js(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ql(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function cm(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function fm(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(V(92));if(Xa(l)){if(1<l.length)throw Error(V(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),yr(e)}function na(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var y1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ad(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||y1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function dm(e,t,n){if(t!=null&&typeof t!="object")throw Error(V(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&ad(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&ad(e,i,t[i])}function Tc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),x1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function js(e){return x1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nn(){}var _r=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ol=null,Zl=null;function id(e){var t=wa(e);if(t&&(e=t.stateNode)){var n=e[at]||null;e:switch(e=t.stateNode,t.type){case"input":if(vr(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+wt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[at]||null;if(!a)throw Error(V(90));vr(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&um(l)}break e;case"textarea":cm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ql(e,!!n.multiple,t,!1)}}}var _u=!1;function hm(e,t,n){if(_u)return e(t,n);_u=!0;try{var l=e(t);return l}finally{if(_u=!1,(Ol!==null||Zl!==null)&&(Zo(),Ol&&(t=Ol,e=Zl,Zl=Ol=null,id(t),e)))for(t=0;t<e.length;t++)id(e[t])}}function fi(e,t){var n=e.stateNode;if(n===null)return null;var l=n[at]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(V(231,t,typeof n));return n}var rn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),br=!1;if(rn)try{var ka={};Object.defineProperty(ka,"passive",{get:function(){br=!0}}),window.addEventListener("test",ka,ka),window.removeEventListener("test",ka,ka)}catch{br=!1}var Tn=null,zc=null,Cs=null;function gm(){if(Cs)return Cs;var e,t=zc,n=t.length,l,a="value"in Tn?Tn.value:Tn.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(l=1;l<=s&&t[n-l]===a[i-l];l++);return Cs=a.slice(e,1<l?1-l:void 0)}function Ms(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function is(){return!0}function sd(){return!1}function it(e){function t(n,l,a,i,s){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?is:sd,this.isPropagationStopped=sd,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=is)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=is)},persist:function(){},isPersistent:is}),t}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ro=it(_l),Bi=we({},_l,{view:0,detail:0}),_1=it(Bi),bu,wu,Oa,Lo=we({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Oa&&(Oa&&e.type==="mousemove"?(bu=e.screenX-Oa.screenX,wu=e.screenY-Oa.screenY):wu=bu=0,Oa=e),bu)},movementY:function(e){return"movementY"in e?e.movementY:wu}}),od=it(Lo),b1=we({},Lo,{dataTransfer:0}),w1=it(b1),S1=we({},Bi,{relatedTarget:0}),Su=it(S1),E1=we({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),N1=it(E1),j1=we({},_l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),C1=it(j1),M1=we({},_l,{data:0}),ud=it(M1),T1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},z1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=z1[e])?!!t[e]:!1}function Dc(){return D1}var k1=we({},Bi,{key:function(e){if(e.key){var t=T1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?A1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dc,charCode:function(e){return e.type==="keypress"?Ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),O1=it(k1),H1=we({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rd=it(H1),R1=we({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dc}),L1=it(R1),B1=we({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),U1=it(B1),Y1=we({},Lo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),V1=it(Y1),X1=we({},_l,{newState:0,oldState:0}),q1=it(X1),G1=[9,13,27,32],kc=rn&&"CompositionEvent"in window,Ja=null;rn&&"documentMode"in document&&(Ja=document.documentMode);var $1=rn&&"TextEvent"in window&&!Ja,mm=rn&&(!kc||Ja&&8<Ja&&11>=Ja),cd=" ",fd=!1;function pm(e,t){switch(e){case"keyup":return G1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ym(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hl=!1;function Q1(e,t){switch(e){case"compositionend":return ym(t);case"keypress":return t.which!==32?null:(fd=!0,cd);case"textInput":return e=t.data,e===cd&&fd?null:e;default:return null}}function Z1(e,t){if(Hl)return e==="compositionend"||!kc&&pm(e,t)?(e=gm(),Cs=zc=Tn=null,Hl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return mm&&t.locale!=="ko"?null:t.data;default:return null}}var K1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function dd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!K1[e.type]:t==="textarea"}function vm(e,t,n,l){Ol?Zl?Zl.push(l):Zl=[l]:Ol=l,t=go(t,"onChange"),0<t.length&&(n=new Ro("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Wa=null,di=null;function J1(e){h0(e,0)}function Bo(e){var t=qa(e);if(um(t))return e}function hd(e,t){if(e==="change")return t}var xm=!1;if(rn){var Eu;if(rn){var Nu="oninput"in document;if(!Nu){var gd=document.createElement("div");gd.setAttribute("oninput","return;"),Nu=typeof gd.oninput=="function"}Eu=Nu}else Eu=!1;xm=Eu&&(!document.documentMode||9<document.documentMode)}function md(){Wa&&(Wa.detachEvent("onpropertychange",_m),di=Wa=null)}function _m(e){if(e.propertyName==="value"&&Bo(di)){var t=[];vm(t,di,e,Ac(e)),hm(J1,t)}}function W1(e,t,n){e==="focusin"?(md(),Wa=t,di=n,Wa.attachEvent("onpropertychange",_m)):e==="focusout"&&md()}function F1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bo(di)}function I1(e,t){if(e==="click")return Bo(t)}function P1(e,t){if(e==="input"||e==="change")return Bo(t)}function e_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mt=typeof Object.is=="function"?Object.is:e_;function hi(e,t){if(mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!mr.call(t,a)||!mt(e[a],t[a]))return!1}return!0}function pd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yd(e,t){var n=pd(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pd(n)}}function bm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Js(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Js(e.document)}return t}function Oc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var t_=rn&&"documentMode"in document&&11>=document.documentMode,Rl=null,wr=null,Fa=null,Sr=!1;function vd(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sr||Rl==null||Rl!==Js(l)||(l=Rl,"selectionStart"in l&&Oc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fa&&hi(Fa,l)||(Fa=l,l=go(wr,"onSelect"),0<l.length&&(t=new Ro("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Rl)))}function Wn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ll={animationend:Wn("Animation","AnimationEnd"),animationiteration:Wn("Animation","AnimationIteration"),animationstart:Wn("Animation","AnimationStart"),transitionrun:Wn("Transition","TransitionRun"),transitionstart:Wn("Transition","TransitionStart"),transitioncancel:Wn("Transition","TransitionCancel"),transitionend:Wn("Transition","TransitionEnd")},ju={},Sm={};rn&&(Sm=document.createElement("div").style,"AnimationEvent"in window||(delete Ll.animationend.animation,delete Ll.animationiteration.animation,delete Ll.animationstart.animation),"TransitionEvent"in window||delete Ll.transitionend.transition);function bl(e){if(ju[e])return ju[e];if(!Ll[e])return e;var t=Ll[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sm)return ju[e]=t[n];return e}var Em=bl("animationend"),Nm=bl("animationiteration"),jm=bl("animationstart"),n_=bl("transitionrun"),l_=bl("transitionstart"),a_=bl("transitioncancel"),Cm=bl("transitionend"),Mm=new Map,Er="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Er.push("scrollEnd");function Ot(e,t){Mm.set(e,t),xl(t,[e])}var Ws=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vt=[],Bl=0,Hc=0;function Uo(){for(var e=Bl,t=Hc=Bl=0;t<e;){var n=vt[t];vt[t++]=null;var l=vt[t];vt[t++]=null;var a=vt[t];vt[t++]=null;var i=vt[t];if(vt[t++]=null,l!==null&&a!==null){var s=l.pending;s===null?a.next=a:(a.next=s.next,s.next=a),l.pending=a}i!==0&&Tm(n,a,i)}}function Yo(e,t,n,l){vt[Bl++]=e,vt[Bl++]=t,vt[Bl++]=n,vt[Bl++]=l,Hc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Rc(e,t,n,l){return Yo(e,t,n,l),Fs(e)}function wl(e,t){return Yo(e,null,null,t),Fs(e)}function Tm(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,l=i.alternate,l!==null&&(l.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-ht(n),e=i.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),i):null}function Fs(e){if(50<si)throw si=0,$r=null,Error(V(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ul={};function i_(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ut(e,t,n,l){return new i_(e,t,n,l)}function Lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sn(e,t){var n=e.alternate;return n===null?(n=ut(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Am(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ts(e,t,n,l,a,i){var s=0;if(l=e,typeof e=="function")Lc(e)&&(s=1);else if(typeof e=="string")s=c2(e,n,Yt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case fr:return e=ut(31,n,t,a),e.elementType=fr,e.lanes=i,e;case zl:return al(n.children,a,i,t);case Jg:s=8,a|=24;break;case ur:return e=ut(12,n,t,a|2),e.elementType=ur,e.lanes=i,e;case rr:return e=ut(13,n,t,a),e.elementType=rr,e.lanes=i,e;case cr:return e=ut(19,n,t,a),e.elementType=cr,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tn:s=10;break e;case Wg:s=9;break e;case Sc:s=11;break e;case Ec:s=14;break e;case bn:s=16,l=null;break e}s=29,n=Error(V(130,e===null?"null":typeof e,"")),l=null}return t=ut(s,n,t,a),t.elementType=e,t.type=l,t.lanes=i,t}function al(e,t,n,l){return e=ut(7,e,l,t),e.lanes=n,e}function Cu(e,t,n){return e=ut(6,e,null,t),e.lanes=n,e}function zm(e){var t=ut(18,null,null,0);return t.stateNode=e,t}function Mu(e,t,n){return t=ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xd=new WeakMap;function St(e,t){if(typeof e=="object"&&e!==null){var n=xd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Pf(t)},xd.set(e,t),t)}return{value:e,source:t,stack:Pf(t)}}var Yl=[],Vl=0,Is=null,gi=0,_t=[],bt=0,qn=null,Lt=1,Bt="";function Pt(e,t){Yl[Vl++]=gi,Yl[Vl++]=Is,Is=e,gi=t}function Dm(e,t,n){_t[bt++]=Lt,_t[bt++]=Bt,_t[bt++]=qn,qn=e;var l=Lt;e=Bt;var a=32-ht(l)-1;l&=~(1<<a),n+=1;var i=32-ht(t)+a;if(30<i){var s=a-a%5;i=(l&(1<<s)-1).toString(32),l>>=s,a-=s,Lt=1<<32-ht(t)+a|n<<a|l,Bt=i+e}else Lt=1<<i|n<<a|l,Bt=e}function Bc(e){e.return!==null&&(Pt(e,1),Dm(e,1,0))}function Uc(e){for(;e===Is;)Is=Yl[--Vl],Yl[Vl]=null,gi=Yl[--Vl],Yl[Vl]=null;for(;e===qn;)qn=_t[--bt],_t[bt]=null,Bt=_t[--bt],_t[bt]=null,Lt=_t[--bt],_t[bt]=null}function km(e,t){_t[bt++]=Lt,_t[bt++]=Bt,_t[bt++]=qn,Lt=t.id,Bt=t.overflow,qn=e}var $e=null,_e=null,se=!1,On=null,Et=!1,Nr=Error(V(519));function Gn(e){var t=Error(V(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mi(St(t,e)),Nr}function _d(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ge]=e,t[at]=l,n){case"dialog":le("cancel",t),le("close",t);break;case"iframe":case"object":case"embed":le("load",t);break;case"video":case"audio":for(n=0;n<xi.length;n++)le(xi[n],t);break;case"source":le("error",t);break;case"img":case"image":case"link":le("error",t),le("load",t);break;case"details":le("toggle",t);break;case"input":le("invalid",t),rm(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":le("invalid",t);break;case"textarea":le("invalid",t),fm(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||m0(t.textContent,n)?(l.popover!=null&&(le("beforetoggle",t),le("toggle",t)),l.onScroll!=null&&le("scroll",t),l.onScrollEnd!=null&&le("scrollend",t),l.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Gn(e,!0)}function bd(e){for($e=e.return;$e;)switch($e.tag){case 5:case 31:case 13:Et=!1;return;case 27:case 3:Et=!0;return;default:$e=$e.return}}function Nl(e){if(e!==$e)return!1;if(!se)return bd(e),se=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Wr(e.type,e.memoizedProps)),n=!n),n&&_e&&Gn(e),bd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));_e=oh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));_e=oh(e)}else t===27?(t=_e,Kn(e.type)?(e=ec,ec=null,_e=e):_e=t):_e=$e?jt(e.stateNode.nextSibling):null;return!0}function cl(){_e=$e=null,se=!1}function Tu(){var e=On;return e!==null&&(tt===null?tt=e:tt.push.apply(tt,e),On=null),e}function mi(e){On===null?On=[e]:On.push(e)}var jr=qt(null),Sl=null,ln=null;function Sn(e,t,n){ye(jr,t._currentValue),t._currentValue=n}function on(e){e._currentValue=jr.current,Ve(jr)}function Cr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Mr(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var s=a.child;i=i.firstContext;e:for(;i!==null;){var o=i;i=a;for(var u=0;u<t.length;u++)if(o.context===t[u]){i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Cr(i.return,n,e),l||(s=null);break e}i=o.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(V(341));s.lanes|=n,i=s.alternate,i!==null&&(i.lanes|=n),Cr(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Sa(e,t,n,l){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(V(387));if(s=s.memoizedProps,s!==null){var o=a.type;mt(a.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(a===$s.current){if(s=a.alternate,s===null)throw Error(V(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(bi):e=[bi])}a=a.return}e!==null&&Mr(t,e,n,l),t.flags|=262144}function Ps(e){for(e=e.firstContext;e!==null;){if(!mt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fl(e){Sl=e,ln=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qe(e){return Om(Sl,e)}function ss(e,t){return Sl===null&&fl(e),Om(e,t)}function Om(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ln===null){if(e===null)throw Error(V(308));ln=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ln=ln.next=t;return n}var s_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},o_=Be.unstable_scheduleCallback,u_=Be.unstable_NormalPriority,ke={$$typeof:tn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yc(){return{controller:new s_,data:new Map,refCount:0}}function Ui(e){e.refCount--,e.refCount===0&&o_(u_,function(){e.controller.abort()})}var Ia=null,Tr=0,la=0,Kl=null;function r_(e,t){if(Ia===null){var n=Ia=[];Tr=0,la=df(),Kl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Tr++,t.then(wd,wd),t}function wd(){if(--Tr===0&&Ia!==null){Kl!==null&&(Kl.status="fulfilled");var e=Ia;Ia=null,la=0,Kl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function c_(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Sd=I.S;I.S=function(e,t){Kp=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&r_(e,t),Sd!==null&&Sd(e,t)};var il=qt(null);function Vc(){var e=il.current;return e!==null?e:pe.pooledCache}function As(e,t){t===null?ye(il,il.current):ye(il,t.pool)}function Hm(){var e=Vc();return e===null?null:{parent:ke._currentValue,pool:e}}var Ea=Error(V(460)),Xc=Error(V(474)),Vo=Error(V(542)),eo={then:function(){}};function Ed(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jd(e),e;default:if(typeof t.status=="string")t.then(nn,nn);else{if(e=pe,e!==null&&100<e.shellSuspendCounter)throw Error(V(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jd(e),e}throw sl=t,Ea}}function Pn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(sl=n,Ea):n}}var sl=null;function Nd(){if(sl===null)throw Error(V(459));var e=sl;return sl=null,e}function jd(e){if(e===Ea||e===Vo)throw Error(V(483))}var Jl=null,pi=0;function os(e){var t=pi;return pi+=1,Jl===null&&(Jl=[]),Rm(Jl,e,t)}function Ha(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function us(e,t){throw t.$$typeof===Wx?Error(V(525)):(e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Lm(e){function t(m,y){if(e){var p=m.deletions;p===null?(m.deletions=[y],m.flags|=16):p.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function l(m){for(var y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function a(m,y){return m=sn(m,y),m.index=0,m.sibling=null,m}function i(m,y,p){return m.index=p,e?(p=m.alternate,p!==null?(p=p.index,p<y?(m.flags|=67108866,y):p):(m.flags|=67108866,y)):(m.flags|=1048576,y)}function s(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function o(m,y,p,_){return y===null||y.tag!==6?(y=Cu(p,m.mode,_),y.return=m,y):(y=a(y,p),y.return=m,y)}function u(m,y,p,_){var j=p.type;return j===zl?h(m,y,p.props.children,_,p.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===bn&&Pn(j)===y.type)?(y=a(y,p.props),Ha(y,p),y.return=m,y):(y=Ts(p.type,p.key,p.props,null,m.mode,_),Ha(y,p),y.return=m,y)}function c(m,y,p,_){return y===null||y.tag!==4||y.stateNode.containerInfo!==p.containerInfo||y.stateNode.implementation!==p.implementation?(y=Mu(p,m.mode,_),y.return=m,y):(y=a(y,p.children||[]),y.return=m,y)}function h(m,y,p,_,j){return y===null||y.tag!==7?(y=al(p,m.mode,_,j),y.return=m,y):(y=a(y,p),y.return=m,y)}function d(m,y,p){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Cu(""+y,m.mode,p),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case es:return p=Ts(y.type,y.key,y.props,null,m.mode,p),Ha(p,y),p.return=m,p;case Va:return y=Mu(y,m.mode,p),y.return=m,y;case bn:return y=Pn(y),d(m,y,p)}if(Xa(y)||Da(y))return y=al(y,m.mode,p,null),y.return=m,y;if(typeof y.then=="function")return d(m,os(y),p);if(y.$$typeof===tn)return d(m,ss(m,y),p);us(m,y)}return null}function f(m,y,p,_){var j=y!==null?y.key:null;if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return j!==null?null:o(m,y,""+p,_);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case es:return p.key===j?u(m,y,p,_):null;case Va:return p.key===j?c(m,y,p,_):null;case bn:return p=Pn(p),f(m,y,p,_)}if(Xa(p)||Da(p))return j!==null?null:h(m,y,p,_,null);if(typeof p.then=="function")return f(m,y,os(p),_);if(p.$$typeof===tn)return f(m,y,ss(m,p),_);us(m,p)}return null}function g(m,y,p,_,j){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return m=m.get(p)||null,o(y,m,""+_,j);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case es:return m=m.get(_.key===null?p:_.key)||null,u(y,m,_,j);case Va:return m=m.get(_.key===null?p:_.key)||null,c(y,m,_,j);case bn:return _=Pn(_),g(m,y,p,_,j)}if(Xa(_)||Da(_))return m=m.get(p)||null,h(y,m,_,j,null);if(typeof _.then=="function")return g(m,y,p,os(_),j);if(_.$$typeof===tn)return g(m,y,p,ss(y,_),j);us(y,_)}return null}function v(m,y,p,_){for(var j=null,S=null,w=y,E=y=0,M=null;w!==null&&E<p.length;E++){w.index>E?(M=w,w=null):M=w.sibling;var R=f(m,w,p[E],_);if(R===null){w===null&&(w=M);break}e&&w&&R.alternate===null&&t(m,w),y=i(R,y,E),S===null?j=R:S.sibling=R,S=R,w=M}if(E===p.length)return n(m,w),se&&Pt(m,E),j;if(w===null){for(;E<p.length;E++)w=d(m,p[E],_),w!==null&&(y=i(w,y,E),S===null?j=w:S.sibling=w,S=w);return se&&Pt(m,E),j}for(w=l(w);E<p.length;E++)M=g(w,m,E,p[E],_),M!==null&&(e&&M.alternate!==null&&w.delete(M.key===null?E:M.key),y=i(M,y,E),S===null?j=M:S.sibling=M,S=M);return e&&w.forEach(function(k){return t(m,k)}),se&&Pt(m,E),j}function x(m,y,p,_){if(p==null)throw Error(V(151));for(var j=null,S=null,w=y,E=y=0,M=null,R=p.next();w!==null&&!R.done;E++,R=p.next()){w.index>E?(M=w,w=null):M=w.sibling;var k=f(m,w,R.value,_);if(k===null){w===null&&(w=M);break}e&&w&&k.alternate===null&&t(m,w),y=i(k,y,E),S===null?j=k:S.sibling=k,S=k,w=M}if(R.done)return n(m,w),se&&Pt(m,E),j;if(w===null){for(;!R.done;E++,R=p.next())R=d(m,R.value,_),R!==null&&(y=i(R,y,E),S===null?j=R:S.sibling=R,S=R);return se&&Pt(m,E),j}for(w=l(w);!R.done;E++,R=p.next())R=g(w,m,E,R.value,_),R!==null&&(e&&R.alternate!==null&&w.delete(R.key===null?E:R.key),y=i(R,y,E),S===null?j=R:S.sibling=R,S=R);return e&&w.forEach(function(O){return t(m,O)}),se&&Pt(m,E),j}function b(m,y,p,_){if(typeof p=="object"&&p!==null&&p.type===zl&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case es:e:{for(var j=p.key;y!==null;){if(y.key===j){if(j=p.type,j===zl){if(y.tag===7){n(m,y.sibling),_=a(y,p.props.children),_.return=m,m=_;break e}}else if(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===bn&&Pn(j)===y.type){n(m,y.sibling),_=a(y,p.props),Ha(_,p),_.return=m,m=_;break e}n(m,y);break}else t(m,y);y=y.sibling}p.type===zl?(_=al(p.props.children,m.mode,_,p.key),_.return=m,m=_):(_=Ts(p.type,p.key,p.props,null,m.mode,_),Ha(_,p),_.return=m,m=_)}return s(m);case Va:e:{for(j=p.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===p.containerInfo&&y.stateNode.implementation===p.implementation){n(m,y.sibling),_=a(y,p.children||[]),_.return=m,m=_;break e}else{n(m,y);break}else t(m,y);y=y.sibling}_=Mu(p,m.mode,_),_.return=m,m=_}return s(m);case bn:return p=Pn(p),b(m,y,p,_)}if(Xa(p))return v(m,y,p,_);if(Da(p)){if(j=Da(p),typeof j!="function")throw Error(V(150));return p=j.call(p),x(m,y,p,_)}if(typeof p.then=="function")return b(m,y,os(p),_);if(p.$$typeof===tn)return b(m,y,ss(m,p),_);us(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,y!==null&&y.tag===6?(n(m,y.sibling),_=a(y,p),_.return=m,m=_):(n(m,y),_=Cu(p,m.mode,_),_.return=m,m=_),s(m)):n(m,y)}return function(m,y,p,_){try{pi=0;var j=b(m,y,p,_);return Jl=null,j}catch(w){if(w===Ea||w===Vo)throw w;var S=ut(29,w,null,m.mode);return S.lanes=_,S.return=m,S}finally{}}}var dl=Lm(!0),Bm=Lm(!1),wn=!1;function qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ar(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Hn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,ce&2){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=Fs(e),Tm(e,null,n),t}return Yo(e,l,t,n),Fs(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,nm(e,n)}}function Au(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var zr=!1;function ei(){if(zr){var e=Kl;if(e!==null)throw e}}function ti(e,t,n,l){zr=!1;var a=e.updateQueue;wn=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var u=o,c=u.next;u.next=null,s===null?i=c:s.next=c,s=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==s&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=u))}if(i!==null){var d=a.baseState;s=0,h=c=u=null,o=i;do{var f=o.lane&-536870913,g=f!==o.lane;if(g?(ie&f)===f:(l&f)===f){f!==0&&f===la&&(zr=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var v=e,x=o;f=t;var b=n;switch(x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(b,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,f=typeof v=="function"?v.call(b,d,f):v,f==null)break e;d=we({},d,f);break e;case 2:wn=!0}}f=o.callback,f!==null&&(e.flags|=64,g&&(e.flags|=8192),g=a.callbacks,g===null?a.callbacks=[f]:g.push(f))}else g={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=g,u=d):h=h.next=g,s|=f;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);h===null&&(u=d),a.baseState=u,a.firstBaseUpdate=c,a.lastBaseUpdate=h,i===null&&(a.shared.lanes=0),Qn|=s,e.lanes=s,e.memoizedState=d}}function Um(e,t){if(typeof e!="function")throw Error(V(191,e));e.call(t)}function Ym(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Um(n[e],t)}var aa=qt(null),to=qt(0);function Cd(e,t){e=hn,ye(to,e),ye(aa,t),hn=e|t.baseLanes}function Dr(){ye(to,hn),ye(aa,aa.current)}function Gc(){hn=to.current,Ve(aa),Ve(to)}var pt=qt(null),Nt=null;function En(e){var t=e.alternate;ye(Te,Te.current&1),ye(pt,e),Nt===null&&(t===null||aa.current!==null||t.memoizedState!==null)&&(Nt=e)}function kr(e){ye(Te,Te.current),ye(pt,e),Nt===null&&(Nt=e)}function Vm(e){e.tag===22?(ye(Te,Te.current),ye(pt,e),Nt===null&&(Nt=e)):Nn()}function Nn(){ye(Te,Te.current),ye(pt,pt.current)}function ot(e){Ve(pt),Nt===e&&(Nt=null),Ve(Te)}var Te=qt(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ir(n)||Pr(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cn=0,te=null,me=null,ze=null,lo=!1,Wl=!1,hl=!1,ao=0,yi=0,Fl=null,f_=0;function je(){throw Error(V(321))}function $c(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mt(e[n],t[n]))return!1;return!0}function Qc(e,t,n,l,a,i){return cn=i,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?vp:lf,hl=!1,i=n(l,a),hl=!1,Wl&&(i=qm(t,n,l,a)),Xm(e),i}function Xm(e){I.H=vi;var t=me!==null&&me.next!==null;if(cn=0,ze=me=te=null,lo=!1,yi=0,Fl=null,t)throw Error(V(300));e===null||Oe||(e=e.dependencies,e!==null&&Ps(e)&&(Oe=!0))}function qm(e,t,n,l){te=e;var a=0;do{if(Wl&&(Fl=null),yi=0,Wl=!1,25<=a)throw Error(V(301));if(a+=1,ze=me=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}I.H=xp,i=t(n,l)}while(Wl);return i}function d_(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?Yi(t):t,e=e.useState()[0],(me!==null?me.memoizedState:null)!==e&&(te.flags|=1024),t}function Zc(){var e=ao!==0;return ao=0,e}function Kc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Jc(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}cn=0,ze=me=te=null,Wl=!1,yi=ao=0,Fl=null}function Je(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?te.memoizedState=ze=e:ze=ze.next=e,ze}function Ae(){if(me===null){var e=te.alternate;e=e!==null?e.memoizedState:null}else e=me.next;var t=ze===null?te.memoizedState:ze.next;if(t!==null)ze=t,me=e;else{if(e===null)throw te.alternate===null?Error(V(467)):Error(V(310));me=e,e={memoizedState:me.memoizedState,baseState:me.baseState,baseQueue:me.baseQueue,queue:me.queue,next:null},ze===null?te.memoizedState=ze=e:ze=ze.next=e}return ze}function Xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yi(e){var t=yi;return yi+=1,Fl===null&&(Fl=[]),e=Rm(Fl,e,t),t=te,(ze===null?t.memoizedState:ze.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?vp:lf),e}function qo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yi(e);if(e.$$typeof===tn)return Qe(e)}throw Error(V(438,String(e)))}function Wc(e){var t=null,n=te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Xo(),te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Fx;return t.index++,n}function fn(e,t){return typeof t=="function"?t(e):t}function zs(e){var t=Ae();return Fc(t,me,e)}function Fc(e,t,n){var l=e.queue;if(l===null)throw Error(V(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var o=s=null,u=null,c=t,h=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(ie&d)===d:(cn&d)===d){var f=c.revertLane;if(f===0)u!==null&&(u=u.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===la&&(h=!0);else if((cn&f)===f){c=c.next,f===la&&(h=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},u===null?(o=u=d,s=i):u=u.next=d,te.lanes|=f,Qn|=f;d=c.action,hl&&n(i,d),i=c.hasEagerState?c.eagerState:n(i,d)}else f={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},u===null?(o=u=f,s=i):u=u.next=f,te.lanes|=d,Qn|=d;c=c.next}while(c!==null&&c!==t);if(u===null?s=i:u.next=o,!mt(i,e.memoizedState)&&(Oe=!0,h&&(n=Kl,n!==null)))throw n;e.memoizedState=i,e.baseState=s,e.baseQueue=u,l.lastRenderedState=i}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function zu(e){var t=Ae(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);mt(i,t.memoizedState)||(Oe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function Gm(e,t,n){var l=te,a=Ae(),i=se;if(i){if(n===void 0)throw Error(V(407));n=n()}else n=t();var s=!mt((me||a).memoizedState,n);if(s&&(a.memoizedState=n,Oe=!0),a=a.queue,Ic(Zm.bind(null,l,a,e),[e]),a.getSnapshot!==t||s||ze!==null&&ze.memoizedState.tag&1){if(l.flags|=2048,ia(9,{destroy:void 0},Qm.bind(null,l,a,n,t),null),pe===null)throw Error(V(349));i||cn&127||$m(l,t,n)}return n}function $m(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t=Xo(),te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qm(e,t,n,l){t.value=n,t.getSnapshot=l,Km(t)&&Jm(e)}function Zm(e,t,n){return n(function(){Km(t)&&Jm(e)})}function Km(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mt(e,n)}catch{return!0}}function Jm(e){var t=wl(e,2);t!==null&&lt(t,e,2)}function Or(e){var t=Je();if(typeof e=="function"){var n=e;if(e=n(),hl){Mn(!0);try{n()}finally{Mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t}function Wm(e,t,n,l){return e.baseState=n,Fc(e,me,typeof l=="function"?l:fn)}function h_(e,t,n,l,a){if($o(e))throw Error(V(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){i.listeners.push(s)}};I.T!==null?n(!0):i.isTransition=!1,l(i),n=t.pending,n===null?(i.next=t.pending=i,Fm(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Fm(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var i=I.T,s={};I.T=s;try{var o=n(a,l),u=I.S;u!==null&&u(s,o),Md(e,t,o)}catch(c){Hr(e,t,c)}finally{i!==null&&s.types!==null&&(i.types=s.types),I.T=i}}else try{i=n(a,l),Md(e,t,i)}catch(c){Hr(e,t,c)}}function Md(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Td(e,t,l)},function(l){return Hr(e,t,l)}):Td(e,t,n)}function Td(e,t,n){t.status="fulfilled",t.value=n,Im(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Fm(e,n)))}function Hr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Im(t),t=t.next;while(t!==l)}e.action=null}function Im(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Pm(e,t){return t}function Ad(e,t){if(se){var n=pe.formState;if(n!==null){e:{var l=te;if(se){if(_e){t:{for(var a=_e,i=Et;a.nodeType!==8;){if(!i){a=null;break t}if(a=jt(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){_e=jt(a.nextSibling),l=a.data==="F!";break e}}Gn(l)}l=!1}l&&(t=n[0])}}return n=Je(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pm,lastRenderedState:t},n.queue=l,n=mp.bind(null,te,l),l.dispatch=n,l=Or(!1),i=nf.bind(null,te,!1,l.queue),l=Je(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=h_.bind(null,te,a,i,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function zd(e){var t=Ae();return ep(t,me,e)}function ep(e,t,n){if(t=Fc(e,t,Pm)[0],e=zs(fn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Yi(t)}catch(s){throw s===Ea?Vo:s}else l=t;t=Ae();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(te.flags|=2048,ia(9,{destroy:void 0},g_.bind(null,a,n),null)),[l,i,e]}function g_(e,t){e.action=t}function Dd(e){var t=Ae(),n=me;if(n!==null)return ep(t,n,e);Ae(),t=t.memoizedState,n=Ae();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function ia(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=te.updateQueue,t===null&&(t=Xo(),te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function tp(){return Ae().memoizedState}function Ds(e,t,n,l){var a=Je();te.flags|=e,a.memoizedState=ia(1|t,{destroy:void 0},n,l===void 0?null:l)}function Go(e,t,n,l){var a=Ae();l=l===void 0?null:l;var i=a.memoizedState.inst;me!==null&&l!==null&&$c(l,me.memoizedState.deps)?a.memoizedState=ia(t,i,n,l):(te.flags|=e,a.memoizedState=ia(1|t,i,n,l))}function kd(e,t){Ds(8390656,8,e,t)}function Ic(e,t){Go(2048,8,e,t)}function m_(e){te.flags|=4;var t=te.updateQueue;if(t===null)t=Xo(),te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function np(e){var t=Ae().memoizedState;return m_({ref:t,nextImpl:e}),function(){if(ce&2)throw Error(V(440));return t.impl.apply(void 0,arguments)}}function lp(e,t){return Go(4,2,e,t)}function ap(e,t){return Go(4,4,e,t)}function ip(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sp(e,t,n){n=n!=null?n.concat([e]):null,Go(4,4,ip.bind(null,t,e),n)}function Pc(){}function op(e,t){var n=Ae();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&$c(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function up(e,t){var n=Ae();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&$c(t,l[1]))return l[0];if(l=e(),hl){Mn(!0);try{e()}finally{Mn(!1)}}return n.memoizedState=[l,t],l}function ef(e,t,n){return n===void 0||cn&1073741824&&!(ie&261930)?e.memoizedState=t:(e.memoizedState=n,e=Wp(),te.lanes|=e,Qn|=e,n)}function rp(e,t,n,l){return mt(n,t)?n:aa.current!==null?(e=ef(e,n,l),mt(e,t)||(Oe=!0),e):!(cn&42)||cn&1073741824&&!(ie&261930)?(Oe=!0,e.memoizedState=n):(e=Wp(),te.lanes|=e,Qn|=e,t)}function cp(e,t,n,l,a){var i=fe.p;fe.p=i!==0&&8>i?i:8;var s=I.T,o={};I.T=o,nf(e,!1,t,n);try{var u=a(),c=I.S;if(c!==null&&c(o,u),u!==null&&typeof u=="object"&&typeof u.then=="function"){var h=c_(u,l);ni(e,t,h,gt(e))}else ni(e,t,l,gt(e))}catch(d){ni(e,t,{then:function(){},status:"rejected",reason:d},gt())}finally{fe.p=i,s!==null&&o.types!==null&&(s.types=o.types),I.T=s}}function p_(){}function Rr(e,t,n,l){if(e.tag!==5)throw Error(V(476));var a=fp(e).queue;cp(e,a,t,ll,n===null?p_:function(){return dp(e),n(l)})}function fp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ll,baseState:ll,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:ll},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dp(e){var t=fp(e);t.next===null&&(t=e.alternate.memoizedState),ni(e,t.next.queue,{},gt())}function tf(){return Qe(bi)}function hp(){return Ae().memoizedState}function gp(){return Ae().memoizedState}function y_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gt();e=Hn(n);var l=Rn(t,e,n);l!==null&&(lt(l,t,n),Pa(l,t,n)),t={cache:Yc()},e.payload=t;return}t=t.return}}function v_(e,t,n){var l=gt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$o(e)?pp(t,n):(n=Rc(e,t,n,l),n!==null&&(lt(n,e,l),yp(n,t,l)))}function mp(e,t,n){var l=gt();ni(e,t,n,l)}function ni(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if($o(e))pp(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,o=i(s,n);if(a.hasEagerState=!0,a.eagerState=o,mt(o,s))return Yo(e,t,a,0),pe===null&&Uo(),!1}catch{}finally{}if(n=Rc(e,t,a,l),n!==null)return lt(n,e,l),yp(n,t,l),!0}return!1}function nf(e,t,n,l){if(l={lane:2,revertLane:df(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$o(e)){if(t)throw Error(V(479))}else t=Rc(e,n,l,2),t!==null&&lt(t,e,2)}function $o(e){var t=e.alternate;return e===te||t!==null&&t===te}function pp(e,t){Wl=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yp(e,t,n){if(n&4194048){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,nm(e,n)}}var vi={readContext:Qe,use:qo,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useLayoutEffect:je,useInsertionEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useSyncExternalStore:je,useId:je,useHostTransitionStatus:je,useFormState:je,useActionState:je,useOptimistic:je,useMemoCache:je,useCacheRefresh:je};vi.useEffectEvent=je;var vp={readContext:Qe,use:qo,useCallback:function(e,t){return Je().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:kd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ds(4194308,4,ip.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ds(4194308,4,e,t)},useInsertionEffect:function(e,t){Ds(4,2,e,t)},useMemo:function(e,t){var n=Je();t=t===void 0?null:t;var l=e();if(hl){Mn(!0);try{e()}finally{Mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Je();if(n!==void 0){var a=n(t);if(hl){Mn(!0);try{n(t)}finally{Mn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=v_.bind(null,te,e),[l.memoizedState,e]},useRef:function(e){var t=Je();return e={current:e},t.memoizedState=e},useState:function(e){e=Or(e);var t=e.queue,n=mp.bind(null,te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Pc,useDeferredValue:function(e,t){var n=Je();return ef(n,e,t)},useTransition:function(){var e=Or(!1);return e=cp.bind(null,te,e.queue,!0,!1),Je().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=te,a=Je();if(se){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),pe===null)throw Error(V(349));ie&127||$m(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,kd(Zm.bind(null,l,i,e),[e]),l.flags|=2048,ia(9,{destroy:void 0},Qm.bind(null,l,i,n,t),null),n},useId:function(){var e=Je(),t=pe.identifierPrefix;if(se){var n=Bt,l=Lt;n=(l&~(1<<32-ht(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ao++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=f_++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tf,useFormState:Ad,useActionState:Ad,useOptimistic:function(e){var t=Je();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=nf.bind(null,te,!0,n),n.dispatch=t,[e,t]},useMemoCache:Wc,useCacheRefresh:function(){return Je().memoizedState=y_.bind(null,te)},useEffectEvent:function(e){var t=Je(),n={impl:e};return t.memoizedState=n,function(){if(ce&2)throw Error(V(440));return n.impl.apply(void 0,arguments)}}},lf={readContext:Qe,use:qo,useCallback:op,useContext:Qe,useEffect:Ic,useImperativeHandle:sp,useInsertionEffect:lp,useLayoutEffect:ap,useMemo:up,useReducer:zs,useRef:tp,useState:function(){return zs(fn)},useDebugValue:Pc,useDeferredValue:function(e,t){var n=Ae();return rp(n,me.memoizedState,e,t)},useTransition:function(){var e=zs(fn)[0],t=Ae().memoizedState;return[typeof e=="boolean"?e:Yi(e),t]},useSyncExternalStore:Gm,useId:hp,useHostTransitionStatus:tf,useFormState:zd,useActionState:zd,useOptimistic:function(e,t){var n=Ae();return Wm(n,me,e,t)},useMemoCache:Wc,useCacheRefresh:gp};lf.useEffectEvent=np;var xp={readContext:Qe,use:qo,useCallback:op,useContext:Qe,useEffect:Ic,useImperativeHandle:sp,useInsertionEffect:lp,useLayoutEffect:ap,useMemo:up,useReducer:zu,useRef:tp,useState:function(){return zu(fn)},useDebugValue:Pc,useDeferredValue:function(e,t){var n=Ae();return me===null?ef(n,e,t):rp(n,me.memoizedState,e,t)},useTransition:function(){var e=zu(fn)[0],t=Ae().memoizedState;return[typeof e=="boolean"?e:Yi(e),t]},useSyncExternalStore:Gm,useId:hp,useHostTransitionStatus:tf,useFormState:Dd,useActionState:Dd,useOptimistic:function(e,t){var n=Ae();return me!==null?Wm(n,me,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Wc,useCacheRefresh:gp};xp.useEffectEvent=np;function Du(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lr={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=gt(),a=Hn(l);a.payload=t,n!=null&&(a.callback=n),t=Rn(e,a,l),t!==null&&(lt(t,e,l),Pa(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=gt(),a=Hn(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Rn(e,a,l),t!==null&&(lt(t,e,l),Pa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gt(),l=Hn(n);l.tag=2,t!=null&&(l.callback=t),t=Rn(e,l,n),t!==null&&(lt(t,e,n),Pa(t,e,n))}};function Od(e,t,n,l,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,s):t.prototype&&t.prototype.isPureReactComponent?!hi(n,l)||!hi(a,i):!0}function Hd(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Lr.enqueueReplaceState(t,t.state,null)}function gl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=we({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function _p(e){Ws(e)}function bp(e){console.error(e)}function wp(e){Ws(e)}function io(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Rd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Br(e,t,n){return n=Hn(n),n.tag=3,n.payload={element:null},n.callback=function(){io(e,t)},n}function Sp(e){return e=Hn(e),e.tag=3,e}function Ep(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=l.value;e.payload=function(){return a(i)},e.callback=function(){Rd(t,n,l)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Rd(t,n,l),typeof a!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var o=l.stack;this.componentDidCatch(l.value,{componentStack:o!==null?o:""})})}function x_(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=pt.current,n!==null){switch(n.tag){case 31:case 13:return Nt===null?co():n.alternate===null&&Ce===0&&(Ce=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===eo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),qu(e,l,a)),!1;case 22:return n.flags|=65536,l===eo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),qu(e,l,a)),!1}throw Error(V(435,n.tag))}return qu(e,l,a),co(),!1}if(se)return t=pt.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Nr&&(e=Error(V(422),{cause:l}),mi(St(e,n)))):(l!==Nr&&(t=Error(V(423),{cause:l}),mi(St(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=St(l,n),a=Br(e.stateNode,l,a),Au(e,a),Ce!==4&&(Ce=2)),!1;var i=Error(V(520),{cause:l});if(i=St(i,n),ii===null?ii=[i]:ii.push(i),Ce!==4&&(Ce=2),t===null)return!0;l=St(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Br(n.stateNode,l,e),Au(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ln===null||!Ln.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sp(a),Ep(a,e,n,l),Au(n,a),!1}n=n.return}while(n!==null);return!1}var af=Error(V(461)),Oe=!1;function qe(e,t,n,l){t.child=e===null?Bm(t,null,n,l):dl(t,e.child,n,l)}function Ld(e,t,n,l,a){n=n.render;var i=t.ref;if("ref"in l){var s={};for(var o in l)o!=="ref"&&(s[o]=l[o])}else s=l;return fl(t),l=Qc(e,t,n,s,i,a),o=Zc(),e!==null&&!Oe?(Kc(e,t,a),dn(e,t,a)):(se&&o&&Bc(t),t.flags|=1,qe(e,t,l,a),t.child)}function Bd(e,t,n,l,a){if(e===null){var i=n.type;return typeof i=="function"&&!Lc(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,Np(e,t,i,l,a)):(e=Ts(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!sf(e,a)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:hi,n(s,l)&&e.ref===t.ref)return dn(e,t,a)}return t.flags|=1,e=sn(i,l),e.ref=t.ref,e.return=t,t.child=e}function Np(e,t,n,l,a){if(e!==null){var i=e.memoizedProps;if(hi(i,l)&&e.ref===t.ref)if(Oe=!1,t.pendingProps=l=i,sf(e,a))e.flags&131072&&(Oe=!0);else return t.lanes=e.lanes,dn(e,t,a)}return Ur(e,t,n,l,a)}function jp(e,t,n,l){var a=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~i}else l=0,t.child=null;return Ud(e,t,i,n,l)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&As(t,i!==null?i.cachePool:null),i!==null?Cd(t,i):Dr(),Vm(t);else return l=t.lanes=536870912,Ud(e,t,i!==null?i.baseLanes|n:n,n,l)}else i!==null?(As(t,i.cachePool),Cd(t,i),Nn(),t.memoizedState=null):(e!==null&&As(t,null),Dr(),Nn());return qe(e,t,a,n),t.child}function Ga(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ud(e,t,n,l,a){var i=Vc();return i=i===null?null:{parent:ke._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&As(t,null),Dr(),Vm(t),e!==null&&Sa(e,t,l,!0),t.childLanes=a,null}function ks(e,t){return t=so({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yd(e,t,n){return dl(t,e.child,null,n),e=ks(t,t.pendingProps),e.flags|=2,ot(t),t.memoizedState=null,e}function __(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(se){if(l.mode==="hidden")return e=ks(t,l),t.lanes=536870912,Ga(null,e);if(kr(t),(e=_e)?(e=v0(e,Et),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qn!==null?{id:Lt,overflow:Bt}:null,retryLane:536870912,hydrationErrors:null},n=zm(e),n.return=t,t.child=n,$e=t,_e=null)):e=null,e===null)throw Gn(t);return t.lanes=536870912,null}return ks(t,l)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(kr(t),a)if(t.flags&256)t.flags&=-257,t=Yd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(V(558));else if(Oe||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,Oe||a){if(l=pe,l!==null&&(s=lm(l,n),s!==0&&s!==i.retryLane))throw i.retryLane=s,wl(e,s),lt(l,e,s),af;co(),t=Yd(e,t,n)}else e=i.treeContext,_e=jt(s.nextSibling),$e=t,se=!0,On=null,Et=!1,e!==null&&km(t,e),t=ks(t,l),t.flags|=4096;return t}return e=sn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Os(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(V(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ur(e,t,n,l,a){return fl(t),n=Qc(e,t,n,l,void 0,a),l=Zc(),e!==null&&!Oe?(Kc(e,t,a),dn(e,t,a)):(se&&l&&Bc(t),t.flags|=1,qe(e,t,n,a),t.child)}function Vd(e,t,n,l,a,i){return fl(t),t.updateQueue=null,n=qm(t,l,n,a),Xm(e),l=Zc(),e!==null&&!Oe?(Kc(e,t,i),dn(e,t,i)):(se&&l&&Bc(t),t.flags|=1,qe(e,t,n,i),t.child)}function Xd(e,t,n,l,a){if(fl(t),t.stateNode===null){var i=Ul,s=n.contextType;typeof s=="object"&&s!==null&&(i=Qe(s)),i=new n(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Lr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},qc(t),s=n.contextType,i.context=typeof s=="object"&&s!==null?Qe(s):Ul,i.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Du(t,n,s,l),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(s=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),s!==i.state&&Lr.enqueueReplaceState(i,i.state,null),ti(t,l,i,a),ei(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var o=t.memoizedProps,u=gl(n,o);i.props=u;var c=i.context,h=n.contextType;s=Ul,typeof h=="object"&&h!==null&&(s=Qe(h));var d=n.getDerivedStateFromProps;h=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,h||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o||c!==s)&&Hd(t,i,l,s),wn=!1;var f=t.memoizedState;i.state=f,ti(t,l,i,a),ei(),c=t.memoizedState,o||f!==c||wn?(typeof d=="function"&&(Du(t,n,d,l),c=t.memoizedState),(u=wn||Od(t,n,u,l,f,c,s))?(h||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=c),i.props=l,i.state=c,i.context=s,l=u):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,Ar(e,t),s=t.memoizedProps,h=gl(n,s),i.props=h,d=t.pendingProps,f=i.context,c=n.contextType,u=Ul,typeof c=="object"&&c!==null&&(u=Qe(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==d||f!==u)&&Hd(t,i,l,u),wn=!1,f=t.memoizedState,i.state=f,ti(t,l,i,a),ei();var g=t.memoizedState;s!==d||f!==g||wn||e!==null&&e.dependencies!==null&&Ps(e.dependencies)?(typeof o=="function"&&(Du(t,n,o,l),g=t.memoizedState),(h=wn||Od(t,n,h,l,f,g,u)||e!==null&&e.dependencies!==null&&Ps(e.dependencies))?(c||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,g,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,g,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=g),i.props=l,i.state=g,i.context=u,l=h):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Os(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=dl(t,e.child,null,a),t.child=dl(t,null,n,a)):qe(e,t,n,a),t.memoizedState=i.state,e=t.child):e=dn(e,t,a),e}function qd(e,t,n,l){return cl(),t.flags|=256,qe(e,t,n,l),t.child}var ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ou(e){return{baseLanes:e,cachePool:Hm()}}function Hu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ct),e}function Cp(e,t,n){var l=t.pendingProps,a=!1,i=(t.flags&128)!==0,s;if((s=i)||(s=e!==null&&e.memoizedState===null?!1:(Te.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(se){if(a?En(t):Nn(),(e=_e)?(e=v0(e,Et),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qn!==null?{id:Lt,overflow:Bt}:null,retryLane:536870912,hydrationErrors:null},n=zm(e),n.return=t,t.child=n,$e=t,_e=null)):e=null,e===null)throw Gn(t);return Pr(e)?t.lanes=32:t.lanes=536870912,null}var o=l.children;return l=l.fallback,a?(Nn(),a=t.mode,o=so({mode:"hidden",children:o},a),l=al(l,a,n,null),o.return=t,l.return=t,o.sibling=l,t.child=o,l=t.child,l.memoizedState=Ou(n),l.childLanes=Hu(e,s,n),t.memoizedState=ku,Ga(null,l)):(En(t),Yr(t,o))}var u=e.memoizedState;if(u!==null&&(o=u.dehydrated,o!==null)){if(i)t.flags&256?(En(t),t.flags&=-257,t=Ru(e,t,n)):t.memoizedState!==null?(Nn(),t.child=e.child,t.flags|=128,t=null):(Nn(),o=l.fallback,a=t.mode,l=so({mode:"visible",children:l.children},a),o=al(o,a,n,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,dl(t,e.child,null,n),l=t.child,l.memoizedState=Ou(n),l.childLanes=Hu(e,s,n),t.memoizedState=ku,t=Ga(null,l));else if(En(t),Pr(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var c=s.dgst;s=c,l=Error(V(419)),l.stack="",l.digest=s,mi({value:l,source:null,stack:null}),t=Ru(e,t,n)}else if(Oe||Sa(e,t,n,!1),s=(n&e.childLanes)!==0,Oe||s){if(s=pe,s!==null&&(l=lm(s,n),l!==0&&l!==u.retryLane))throw u.retryLane=l,wl(e,l),lt(s,e,l),af;Ir(o)||co(),t=Ru(e,t,n)}else Ir(o)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,_e=jt(o.nextSibling),$e=t,se=!0,On=null,Et=!1,e!==null&&km(t,e),t=Yr(t,l.children),t.flags|=4096);return t}return a?(Nn(),o=l.fallback,a=t.mode,u=e.child,c=u.sibling,l=sn(u,{mode:"hidden",children:l.children}),l.subtreeFlags=u.subtreeFlags&65011712,c!==null?o=sn(c,o):(o=al(o,a,n,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Ga(null,l),l=t.child,o=e.child.memoizedState,o===null?o=Ou(n):(a=o.cachePool,a!==null?(u=ke._currentValue,a=a.parent!==u?{parent:u,pool:u}:a):a=Hm(),o={baseLanes:o.baseLanes|n,cachePool:a}),l.memoizedState=o,l.childLanes=Hu(e,s,n),t.memoizedState=ku,Ga(e.child,l)):(En(t),n=e.child,e=n.sibling,n=sn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Yr(e,t){return t=so({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function so(e,t){return e=ut(22,e,null,t),e.lanes=0,e}function Ru(e,t,n){return dl(t,e.child,null,n),e=Yr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Cr(e.return,t,n)}function Lu(e,t,n,l,a,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=l,s.tail=n,s.tailMode=a,s.treeForkCount=i)}function Mp(e,t,n){var l=t.pendingProps,a=l.revealOrder,i=l.tail;l=l.children;var s=Te.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,ye(Te,s),qe(e,t,l,n),l=se?gi:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gd(e,n,t);else if(e.tag===19)Gd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Lu(t,!1,a,n,i,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&no(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Lu(t,!0,n,null,i,l);break;case"together":Lu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qn|=t.lanes,!(n&t.childLanes))if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=sn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=sn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sf(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Ps(e)))}function b_(e,t,n){switch(t.tag){case 3:Qs(t,t.stateNode.containerInfo),Sn(t,ke,e.memoizedState.cache),cl();break;case 27:case 5:gr(t);break;case 4:Qs(t,t.stateNode.containerInfo);break;case 10:Sn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(En(t),t.flags|=128,null):n&t.child.childLanes?Cp(e,t,n):(En(t),e=dn(e,t,n),e!==null?e.sibling:null);En(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Sa(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Mp(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ye(Te,Te.current),l)break;return null;case 22:return t.lanes=0,jp(e,t,n,t.pendingProps);case 24:Sn(t,ke,e.memoizedState.cache)}return dn(e,t,n)}function Tp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Oe=!0;else{if(!sf(e,n)&&!(t.flags&128))return Oe=!1,b_(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,se&&t.flags&1048576&&Dm(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Pn(t.elementType),t.type=e,typeof e=="function")Lc(e)?(l=gl(e,l),t.tag=1,t=Xd(null,t,e,l,n)):(t.tag=0,t=Ur(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===Sc){t.tag=11,t=Ld(null,t,e,l,n);break e}else if(a===Ec){t.tag=14,t=Bd(null,t,e,l,n);break e}}throw t=dr(e)||e,Error(V(306,t,""))}}return t;case 0:return Ur(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=gl(l,t.pendingProps),Xd(e,t,l,a,n);case 3:e:{if(Qs(t,t.stateNode.containerInfo),e===null)throw Error(V(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,Ar(e,t),ti(t,l,null,n);var s=t.memoizedState;if(l=s.cache,Sn(t,ke,l),l!==i.cache&&Mr(t,[ke],n,!0),ei(),l=s.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=qd(e,t,l,n);break e}else if(l!==a){a=St(Error(V(424)),t),mi(a),t=qd(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(_e=jt(e.firstChild),$e=t,se=!0,On=null,Et=!0,n=Bm(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(cl(),l===a){t=dn(e,t,n);break e}qe(e,t,l,n)}t=t.child}return t;case 26:return Os(e,t),e===null?(n=ch(t.type,null,t.pendingProps,null))?t.memoizedState=n:se||(n=t.type,e=t.pendingProps,l=mo(kn.current).createElement(n),l[Ge]=t,l[at]=e,Ze(l,n,e),Ye(l),t.stateNode=l):t.memoizedState=ch(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return gr(t),e===null&&se&&(l=t.stateNode=x0(t.type,t.pendingProps,kn.current),$e=t,Et=!0,a=_e,Kn(t.type)?(ec=a,_e=jt(l.firstChild)):_e=a),qe(e,t,t.pendingProps.children,n),Os(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&se&&((a=l=_e)&&(l=F_(l,t.type,t.pendingProps,Et),l!==null?(t.stateNode=l,$e=t,_e=jt(l.firstChild),Et=!1,a=!0):a=!1),a||Gn(t)),gr(t),a=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,l=i.children,Wr(a,i)?l=null:s!==null&&Wr(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qc(e,t,d_,null,null,n),bi._currentValue=a),Os(e,t),qe(e,t,l,n),t.child;case 6:return e===null&&se&&((e=n=_e)&&(n=I_(n,t.pendingProps,Et),n!==null?(t.stateNode=n,$e=t,_e=null,e=!0):e=!1),e||Gn(t)),null;case 13:return Cp(e,t,n);case 4:return Qs(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=dl(t,null,l,n):qe(e,t,l,n),t.child;case 11:return Ld(e,t,t.type,t.pendingProps,n);case 7:return qe(e,t,t.pendingProps,n),t.child;case 8:return qe(e,t,t.pendingProps.children,n),t.child;case 12:return qe(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Sn(t,t.type,l.value),qe(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,fl(t),a=Qe(a),l=l(a),t.flags|=1,qe(e,t,l,n),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,n);case 15:return Np(e,t,t.type,t.pendingProps,n);case 19:return Mp(e,t,n);case 31:return __(e,t,n);case 22:return jp(e,t,n,t.pendingProps);case 24:return fl(t),l=Qe(ke),e===null?(a=Vc(),a===null&&(a=pe,i=Yc(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},qc(t),Sn(t,ke,a)):(e.lanes&n&&(Ar(e,t),ti(t,null,null,n),ei()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Sn(t,ke,l)):(l=i.cache,Sn(t,ke,l),l!==a.cache&&Mr(t,[ke],n,!0))),qe(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(V(156,t.tag))}function Kt(e){e.flags|=4}function Bu(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Pp())e.flags|=8192;else throw sl=eo,Xc}else e.flags&=-16777217}function $d(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!w0(t))if(Pp())e.flags|=8192;else throw sl=eo,Xc}function rs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?em():536870912,e.lanes|=t,sa|=t)}function Ra(e,t){if(!se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function w_(e,t,n){var l=t.pendingProps;switch(Uc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(t),null;case 1:return xe(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),on(ke),ea(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tu())),xe(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Kt(t),i!==null?(xe(t),$d(t,i)):(xe(t),Bu(t,a,null,l,n))):i?i!==e.memoizedState?(Kt(t),xe(t),$d(t,i)):(xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Kt(t),xe(t),Bu(t,a,e,l,n)),null;case 27:if(Zs(t),n=kn.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Kt(t);else{if(!l){if(t.stateNode===null)throw Error(V(166));return xe(t),null}e=Yt.current,Nl(t)?_d(t):(e=x0(a,l,n),t.stateNode=e,Kt(t))}return xe(t),null;case 5:if(Zs(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Kt(t);else{if(!l){if(t.stateNode===null)throw Error(V(166));return xe(t),null}if(i=Yt.current,Nl(t))_d(t);else{var s=mo(kn.current);switch(i){case 1:i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=s.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?s.createElement("select",{is:l.is}):s.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?s.createElement(a,{is:l.is}):s.createElement(a)}}i[Ge]=t,i[at]=l;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(Ze(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Kt(t)}}return xe(t),Bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Kt(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(V(166));if(e=kn.current,Nl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=$e,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Ge]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||m0(e.nodeValue,n)),e||Gn(t,!0)}else e=mo(e).createTextNode(l),e[Ge]=t,t.stateNode=e}return xe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Nl(t),n!==null){if(e===null){if(!l)throw Error(V(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(557));e[Ge]=t}else cl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xe(t),e=!1}else n=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ot(t),t):(ot(t),null);if(t.flags&128)throw Error(V(558))}return xe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Nl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(V(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(V(317));a[Ge]=t}else cl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xe(t),a=!1}else a=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ot(t),t):(ot(t),null)}return ot(t),t.flags&128?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),rs(t,t.updateQueue),xe(t),null);case 4:return ea(),e===null&&hf(t.stateNode.containerInfo),xe(t),null;case 10:return on(t.type),xe(t),null;case 19:if(Ve(Te),l=t.memoizedState,l===null)return xe(t),null;if(a=(t.flags&128)!==0,i=l.rendering,i===null)if(a)Ra(l,!1);else{if(Ce!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=no(e),i!==null){for(t.flags|=128,Ra(l,!1),e=i.updateQueue,t.updateQueue=e,rs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Am(n,e),n=n.sibling;return ye(Te,Te.current&1|2),se&&Pt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ft()>uo&&(t.flags|=128,a=!0,Ra(l,!1),t.lanes=4194304)}else{if(!a)if(e=no(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,rs(t,e),Ra(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!se)return xe(t),null}else 2*ft()-l.renderingStartTime>uo&&n!==536870912&&(t.flags|=128,a=!0,Ra(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ft(),e.sibling=null,n=Te.current,ye(Te,a?n&1|2:n&1),se&&Pt(t,l.treeForkCount),e):(xe(t),null);case 22:case 23:return ot(t),Gc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?n&536870912&&!(t.flags&128)&&(xe(t),t.subtreeFlags&6&&(t.flags|=8192)):xe(t),n=t.updateQueue,n!==null&&rs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ve(il),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),on(ke),xe(t),null;case 25:return null;case 30:return null}throw Error(V(156,t.tag))}function S_(e,t){switch(Uc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return on(ke),ea(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zs(t),null;case 31:if(t.memoizedState!==null){if(ot(t),t.alternate===null)throw Error(V(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ot(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Te),null;case 4:return ea(),null;case 10:return on(t.type),null;case 22:case 23:return ot(t),Gc(),e!==null&&Ve(il),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return on(ke),null;case 25:return null;default:return null}}function Ap(e,t){switch(Uc(t),t.tag){case 3:on(ke),ea();break;case 26:case 27:case 5:Zs(t);break;case 4:ea();break;case 31:t.memoizedState!==null&&ot(t);break;case 13:ot(t);break;case 19:Ve(Te);break;case 10:on(t.type);break;case 22:case 23:ot(t),Gc(),e!==null&&Ve(il);break;case 24:on(ke)}}function Vi(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var i=n.create,s=n.inst;l=i(),s.destroy=l}n=n.next}while(n!==a)}}catch(o){he(t,t.return,o)}}function $n(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var i=a.next;l=i;do{if((l.tag&e)===e){var s=l.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=t;var u=n,c=o;try{c()}catch(h){he(a,u,h)}}}l=l.next}while(l!==i)}}catch(h){he(t,t.return,h)}}function zp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ym(t,n)}catch(l){he(e,e.return,l)}}}function Dp(e,t,n){n.props=gl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){he(e,t,l)}}function li(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){he(e,t,a)}}function Ut(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){he(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){he(e,t,a)}else n.current=null}function kp(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){he(e,e.return,a)}}function Uu(e,t,n){try{var l=e.stateNode;$_(l,e.type,n,t),l[at]=t}catch(a){he(e,e.return,a)}}function Op(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kn(e.type)||e.tag===4}function Yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Op(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vr(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(l!==4&&(l===27&&Kn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Vr(e,t,n),e=e.sibling;e!==null;)Vr(e,t,n),e=e.sibling}function oo(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Kn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(oo(e,t,n),e=e.sibling;e!==null;)oo(e,t,n),e=e.sibling}function Hp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Ze(t,l,n),t[Ge]=e,t[at]=n}catch(i){he(e,e.return,i)}}var en=!1,De=!1,Vu=!1,Qd=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function E_(e,t){if(e=e.containerInfo,Kr=xo,e=wm(e),Oc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,o=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||a!==0&&d.nodeType!==3||(o=s+a),d!==i||l!==0&&d.nodeType!==3||(u=s+l),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++c===a&&(o=s),f===i&&++h===l&&(u=s),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jr={focusedElem:e,selectionRange:n},xo=!1,Ue=t;Ue!==null;)if(t=Ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ue=e;else for(;Ue!==null;){switch(t=Ue,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var v=gl(n.type,a);e=l.getSnapshotBeforeUpdate(v,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(x){he(n,n.return,x)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Fr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(V(163))}if(e=t.sibling,e!==null){e.return=t.return,Ue=e;break}Ue=t.return}}function Rp(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Wt(e,n),l&4&&Vi(5,n);break;case 1:if(Wt(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){he(n,n.return,s)}else{var a=gl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){he(n,n.return,s)}}l&64&&zp(n),l&512&&li(n,n.return);break;case 3:if(Wt(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ym(e,t)}catch(s){he(n,n.return,s)}}break;case 27:t===null&&l&4&&Hp(n);case 26:case 5:Wt(e,n),t===null&&l&4&&kp(n),l&512&&li(n,n.return);break;case 12:Wt(e,n);break;case 31:Wt(e,n),l&4&&Up(e,n);break;case 13:Wt(e,n),l&4&&Yp(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=k_.bind(null,n),P_(e,n))));break;case 22:if(l=n.memoizedState!==null||en,!l){t=t!==null&&t.memoizedState!==null||De,a=en;var i=De;en=l,(De=t)&&!i?It(e,n,(n.subtreeFlags&8772)!==0):Wt(e,n),en=a,De=i}break;case 30:break;default:Wt(e,n)}}function Lp(e){var t=e.alternate;t!==null&&(e.alternate=null,Lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Se=null,et=!1;function Jt(e,t,n){for(n=n.child;n!==null;)Bp(e,t,n),n=n.sibling}function Bp(e,t,n){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Oi,n)}catch{}switch(n.tag){case 26:De||Ut(n,t),Jt(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:De||Ut(n,t);var l=Se,a=et;Kn(n.type)&&(Se=n.stateNode,et=!1),Jt(e,t,n),oi(n.stateNode),Se=l,et=a;break;case 5:De||Ut(n,t);case 6:if(l=Se,a=et,Se=null,Jt(e,t,n),Se=l,et=a,Se!==null)if(et)try{(Se.nodeType===9?Se.body:Se.nodeName==="HTML"?Se.ownerDocument.body:Se).removeChild(n.stateNode)}catch(i){he(n,t,i)}else try{Se.removeChild(n.stateNode)}catch(i){he(n,t,i)}break;case 18:Se!==null&&(et?(e=Se,ih(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ca(e)):ih(Se,n.stateNode));break;case 4:l=Se,a=et,Se=n.stateNode.containerInfo,et=!0,Jt(e,t,n),Se=l,et=a;break;case 0:case 11:case 14:case 15:$n(2,n,t),De||$n(4,n,t),Jt(e,t,n);break;case 1:De||(Ut(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Dp(n,t,l)),Jt(e,t,n);break;case 21:Jt(e,t,n);break;case 22:De=(l=De)||n.memoizedState!==null,Jt(e,t,n),De=l;break;default:Jt(e,t,n)}}function Up(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ca(e)}catch(n){he(t,t.return,n)}}}function Yp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ca(e)}catch(n){he(t,t.return,n)}}function N_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qd),t;default:throw Error(V(435,e.tag))}}function cs(e,t){var n=N_(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=O_.bind(null,e,l);l.then(a,a)}})}function Ie(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],i=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Kn(o.type)){Se=o.stateNode,et=!1;break e}break;case 5:Se=o.stateNode,et=!1;break e;case 3:case 4:Se=o.stateNode.containerInfo,et=!0;break e}o=o.return}if(Se===null)throw Error(V(160));Bp(i,s,a),Se=null,et=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vp(t,e),t=t.sibling}var Tt=null;function Vp(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ie(t,e),Pe(e),l&4&&($n(3,e,e.return),Vi(3,e),$n(5,e,e.return));break;case 1:Ie(t,e),Pe(e),l&512&&(De||n===null||Ut(n,n.return)),l&64&&en&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Tt;if(Ie(t,e),Pe(e),l&512&&(De||n===null||Ut(n,n.return)),l&4){var i=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Li]||i[Ge]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),Ze(i,l,n),i[Ge]=e,Ye(i),l=i;break e;case"link":var s=dh("link","href",a).get(l+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(i=s[o],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}i=a.createElement(l),Ze(i,l,n),a.head.appendChild(i);break;case"meta":if(s=dh("meta","content",a).get(l+(n.content||""))){for(o=0;o<s.length;o++)if(i=s[o],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}i=a.createElement(l),Ze(i,l,n),a.head.appendChild(i);break;default:throw Error(V(468,l))}i[Ge]=e,Ye(i),l=i}e.stateNode=l}else hh(a,e.type,e.stateNode);else e.stateNode=fh(a,l,e.memoizedProps);else i!==l?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,l===null?hh(a,e.type,e.stateNode):fh(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Uu(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ie(t,e),Pe(e),l&512&&(De||n===null||Ut(n,n.return)),n!==null&&l&4&&Uu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ie(t,e),Pe(e),l&512&&(De||n===null||Ut(n,n.return)),e.flags&32){a=e.stateNode;try{na(a,"")}catch(v){he(e,e.return,v)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Uu(e,a,n!==null?n.memoizedProps:a)),l&1024&&(Vu=!0);break;case 6:if(Ie(t,e),Pe(e),l&4){if(e.stateNode===null)throw Error(V(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(v){he(e,e.return,v)}}break;case 3:if(Ls=null,a=Tt,Tt=po(t.containerInfo),Ie(t,e),Tt=a,Pe(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ca(t.containerInfo)}catch(v){he(e,e.return,v)}Vu&&(Vu=!1,Xp(e));break;case 4:l=Tt,Tt=po(e.stateNode.containerInfo),Ie(t,e),Pe(e),Tt=l;break;case 12:Ie(t,e),Pe(e);break;case 31:Ie(t,e),Pe(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cs(e,l)));break;case 13:Ie(t,e),Pe(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Qo=ft()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cs(e,l)));break;case 22:a=e.memoizedState!==null;var u=n!==null&&n.memoizedState!==null,c=en,h=De;if(en=c||a,De=h||u,Ie(t,e),De=h,en=c,Pe(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||u||en||De||el(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){u=n=t;try{if(i=u.stateNode,a)s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=u.stateNode;var d=u.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;o.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(v){he(u,u.return,v)}}}else if(t.tag===6){if(n===null){u=t;try{u.stateNode.nodeValue=a?"":u.memoizedProps}catch(v){he(u,u.return,v)}}}else if(t.tag===18){if(n===null){u=t;try{var g=u.stateNode;a?sh(g,!0):sh(u.stateNode,!1)}catch(v){he(u,u.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,cs(e,n))));break;case 19:Ie(t,e),Pe(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,cs(e,l)));break;case 30:break;case 21:break;default:Ie(t,e),Pe(e)}}function Pe(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Op(l)){n=l;break}l=l.return}if(n==null)throw Error(V(160));switch(n.tag){case 27:var a=n.stateNode,i=Yu(e);oo(e,i,a);break;case 5:var s=n.stateNode;n.flags&32&&(na(s,""),n.flags&=-33);var o=Yu(e);oo(e,o,s);break;case 3:case 4:var u=n.stateNode.containerInfo,c=Yu(e);Vr(e,c,u);break;default:throw Error(V(161))}}catch(h){he(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Xp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Rp(e,t.alternate,t),t=t.sibling}function el(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$n(4,t,t.return),el(t);break;case 1:Ut(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Dp(t,t.return,n),el(t);break;case 27:oi(t.stateNode);case 26:case 5:Ut(t,t.return),el(t);break;case 22:t.memoizedState===null&&el(t);break;case 30:el(t);break;default:el(t)}e=e.sibling}}function It(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:It(a,i,n),Vi(4,i);break;case 1:if(It(a,i,n),l=i,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(c){he(l,l.return,c)}if(l=i,a=l.updateQueue,a!==null){var o=l.stateNode;try{var u=a.shared.hiddenCallbacks;if(u!==null)for(a.shared.hiddenCallbacks=null,a=0;a<u.length;a++)Um(u[a],o)}catch(c){he(l,l.return,c)}}n&&s&64&&zp(i),li(i,i.return);break;case 27:Hp(i);case 26:case 5:It(a,i,n),n&&l===null&&s&4&&kp(i),li(i,i.return);break;case 12:It(a,i,n);break;case 31:It(a,i,n),n&&s&4&&Up(a,i);break;case 13:It(a,i,n),n&&s&4&&Yp(a,i);break;case 22:i.memoizedState===null&&It(a,i,n),li(i,i.return);break;case 30:break;default:It(a,i,n)}t=t.sibling}}function of(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ui(n))}function uf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ui(e))}function Mt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qp(e,t,n,l),t=t.sibling}function qp(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Mt(e,t,n,l),a&2048&&Vi(9,t);break;case 1:Mt(e,t,n,l);break;case 3:Mt(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ui(e)));break;case 12:if(a&2048){Mt(e,t,n,l),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,o=i.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(u){he(t,t.return,u)}}else Mt(e,t,n,l);break;case 31:Mt(e,t,n,l);break;case 13:Mt(e,t,n,l);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?Mt(e,t,n,l):ai(e,t):i._visibility&2?Mt(e,t,n,l):(i._visibility|=2,Tl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&of(s,t);break;case 24:Mt(e,t,n,l),a&2048&&uf(t.alternate,t);break;default:Mt(e,t,n,l)}}function Tl(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,s=t,o=n,u=l,c=s.flags;switch(s.tag){case 0:case 11:case 15:Tl(i,s,o,u,a),Vi(8,s);break;case 23:break;case 22:var h=s.stateNode;s.memoizedState!==null?h._visibility&2?Tl(i,s,o,u,a):ai(i,s):(h._visibility|=2,Tl(i,s,o,u,a)),a&&c&2048&&of(s.alternate,s);break;case 24:Tl(i,s,o,u,a),a&&c&2048&&uf(s.alternate,s);break;default:Tl(i,s,o,u,a)}t=t.sibling}}function ai(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:ai(n,l),a&2048&&of(l.alternate,l);break;case 24:ai(n,l),a&2048&&uf(l.alternate,l);break;default:ai(n,l)}t=t.sibling}}var $a=8192;function jl(e,t,n){if(e.subtreeFlags&$a)for(e=e.child;e!==null;)Gp(e,t,n),e=e.sibling}function Gp(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&$a&&e.memoizedState!==null&&f2(n,Tt,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var l=Tt;Tt=po(e.stateNode.containerInfo),jl(e,t,n),Tt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=$a,$a=16777216,jl(e,t,n),$a=l):jl(e,t,n));break;default:jl(e,t,n)}}function $p(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function La(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ue=l,Zp(l,e)}$p(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qp(e),e=e.sibling}function Qp(e){switch(e.tag){case 0:case 11:case 15:La(e),e.flags&2048&&$n(9,e,e.return);break;case 3:La(e);break;case 12:La(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hs(e)):La(e);break;default:La(e)}}function Hs(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ue=l,Zp(l,e)}$p(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$n(8,t,t.return),Hs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hs(t));break;default:Hs(t)}e=e.sibling}}function Zp(e,t){for(;Ue!==null;){var n=Ue;switch(n.tag){case 0:case 11:case 15:$n(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ui(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ue=l;else e:for(n=e;Ue!==null;){l=Ue;var a=l.sibling,i=l.return;if(Lp(l),l===n){Ue=null;break e}if(a!==null){a.return=i,Ue=a;break e}Ue=i}}}var j_={getCacheForType:function(e){var t=Qe(ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qe(ke).controller.signal}},C_=typeof WeakMap=="function"?WeakMap:Map,ce=0,pe=null,ae=null,ie=0,de=0,st=null,An=!1,Na=!1,rf=!1,hn=0,Ce=0,Qn=0,ol=0,cf=0,ct=0,sa=0,ii=null,tt=null,Xr=!1,Qo=0,Kp=0,uo=1/0,ro=null,Ln=null,Le=0,Bn=null,oa=null,un=0,qr=0,Gr=null,Jp=null,si=0,$r=null;function gt(){return ce&2&&ie!==0?ie&-ie:I.T!==null?df():am()}function Wp(){if(ct===0)if(!(ie&536870912)||se){var e=ns;ns<<=1,!(ns&3932160)&&(ns=262144),ct=e}else ct=536870912;return e=pt.current,e!==null&&(e.flags|=32),ct}function lt(e,t,n){(e===pe&&(de===2||de===9)||e.cancelPendingCommit!==null)&&(ua(e,0),zn(e,ie,ct,!1)),Ri(e,n),(!(ce&2)||e!==pe)&&(e===pe&&(!(ce&2)&&(ol|=n),Ce===4&&zn(e,ie,ct,!1)),Gt(e))}function Fp(e,t,n){if(ce&6)throw Error(V(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Hi(e,t),a=l?A_(e,t):Xu(e,t,!0),i=l;do{if(a===0){Na&&!l&&zn(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!M_(n)){a=Xu(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;a=ii;var u=o.current.memoizedState.isDehydrated;if(u&&(ua(o,s).flags|=256),s=Xu(o,s,!1),s!==2){if(rf&&!u){o.errorRecoveryDisabledLanes|=i,ol|=i,a=4;break e}i=tt,tt=a,i!==null&&(tt===null?tt=i:tt.push.apply(tt,i))}a=s}if(i=!1,a!==2)continue}}if(a===1){ua(e,0),zn(e,t,0,!0);break}e:{switch(l=e,i=a,i){case 0:case 1:throw Error(V(345));case 4:if((t&4194048)!==t)break;case 6:zn(l,t,ct,!An);break e;case 2:tt=null;break;case 3:case 5:break;default:throw Error(V(329))}if((t&62914560)===t&&(a=Qo+300-ft(),10<a)){if(zn(l,t,ct,!An),Ho(l,0,!0)!==0)break e;un=t,l.timeoutHandle=y0(Zd.bind(null,l,n,tt,ro,Xr,t,ct,ol,sa,An,i,"Throttled",-0,0),a);break e}Zd(l,n,tt,ro,Xr,t,ct,ol,sa,An,i,null,-0,0)}}break}while(!0);Gt(e)}function Zd(e,t,n,l,a,i,s,o,u,c,h,d,f,g){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Gp(t,i,d);var v=(i&62914560)===i?Qo-ft():(i&4194048)===i?Kp-ft():0;if(v=d2(d,v),v!==null){un=i,e.cancelPendingCommit=v(Jd.bind(null,e,t,i,n,l,a,s,o,u,h,d,null,f,g)),zn(e,i,s,!c);return}}Jd(e,t,i,n,l,a,s,o,u)}function M_(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],i=a.getSnapshot;a=a.value;try{if(!mt(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zn(e,t,n,l){t&=~cf,t&=~ol,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var i=31-ht(a),s=1<<i;l[i]=-1,a&=~s}n!==0&&tm(e,n,t)}function Zo(){return ce&6?!0:(Xi(0),!1)}function ff(){if(ae!==null){if(de===0)var e=ae.return;else e=ae,ln=Sl=null,Jc(e),Jl=null,pi=0,e=ae;for(;e!==null;)Ap(e.alternate,e),e=e.return;ae=null}}function ua(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,K_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),un=0,ff(),pe=e,ae=n=sn(e.current,null),ie=t,de=0,st=null,An=!1,Na=Hi(e,t),rf=!1,sa=ct=cf=ol=Qn=Ce=0,tt=ii=null,Xr=!1,t&8&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-ht(l),i=1<<a;t|=e[a],l&=~i}return hn=t,Uo(),n}function Ip(e,t){te=null,I.H=vi,t===Ea||t===Vo?(t=Nd(),de=3):t===Xc?(t=Nd(),de=4):de=t===af?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,st=t,ae===null&&(Ce=1,io(e,St(t,e.current)))}function Pp(){var e=pt.current;return e===null?!0:(ie&4194048)===ie?Nt===null:(ie&62914560)===ie||ie&536870912?e===Nt:!1}function e0(){var e=I.H;return I.H=vi,e===null?vi:e}function t0(){var e=I.A;return I.A=j_,e}function co(){Ce=4,An||(ie&4194048)!==ie&&pt.current!==null||(Na=!0),!(Qn&134217727)&&!(ol&134217727)||pe===null||zn(pe,ie,ct,!1)}function Xu(e,t,n){var l=ce;ce|=2;var a=e0(),i=t0();(pe!==e||ie!==t)&&(ro=null,ua(e,t)),t=!1;var s=Ce;e:do try{if(de!==0&&ae!==null){var o=ae,u=st;switch(de){case 8:ff(),s=6;break e;case 3:case 2:case 9:case 6:pt.current===null&&(t=!0);var c=de;if(de=0,st=null,Xl(e,o,u,c),n&&Na){s=0;break e}break;default:c=de,de=0,st=null,Xl(e,o,u,c)}}T_(),s=Ce;break}catch(h){Ip(e,h)}while(!0);return t&&e.shellSuspendCounter++,ln=Sl=null,ce=l,I.H=a,I.A=i,ae===null&&(pe=null,ie=0,Uo()),s}function T_(){for(;ae!==null;)n0(ae)}function A_(e,t){var n=ce;ce|=2;var l=e0(),a=t0();pe!==e||ie!==t?(ro=null,uo=ft()+500,ua(e,t)):Na=Hi(e,t);e:do try{if(de!==0&&ae!==null){t=ae;var i=st;t:switch(de){case 1:de=0,st=null,Xl(e,t,i,1);break;case 2:case 9:if(Ed(i)){de=0,st=null,Kd(t);break}t=function(){de!==2&&de!==9||pe!==e||(de=7),Gt(e)},i.then(t,t);break e;case 3:de=7;break e;case 4:de=5;break e;case 7:Ed(i)?(de=0,st=null,Kd(t)):(de=0,st=null,Xl(e,t,i,7));break;case 5:var s=null;switch(ae.tag){case 26:s=ae.memoizedState;case 5:case 27:var o=ae;if(s?w0(s):o.stateNode.complete){de=0,st=null;var u=o.sibling;if(u!==null)ae=u;else{var c=o.return;c!==null?(ae=c,Ko(c)):ae=null}break t}}de=0,st=null,Xl(e,t,i,5);break;case 6:de=0,st=null,Xl(e,t,i,6);break;case 8:ff(),Ce=6;break e;default:throw Error(V(462))}}z_();break}catch(h){Ip(e,h)}while(!0);return ln=Sl=null,I.H=l,I.A=a,ce=n,ae!==null?0:(pe=null,ie=0,Uo(),Ce)}function z_(){for(;ae!==null&&!e1();)n0(ae)}function n0(e){var t=Tp(e.alternate,e,hn);e.memoizedProps=e.pendingProps,t===null?Ko(e):ae=t}function Kd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vd(n,t,t.pendingProps,t.type,void 0,ie);break;case 11:t=Vd(n,t,t.pendingProps,t.type.render,t.ref,ie);break;case 5:Jc(t);default:Ap(n,t),t=ae=Am(t,hn),t=Tp(n,t,hn)}e.memoizedProps=e.pendingProps,t===null?Ko(e):ae=t}function Xl(e,t,n,l){ln=Sl=null,Jc(t),Jl=null,pi=0;var a=t.return;try{if(x_(e,a,t,n,ie)){Ce=1,io(e,St(n,e.current)),ae=null;return}}catch(i){if(a!==null)throw ae=a,i;Ce=1,io(e,St(n,e.current)),ae=null;return}t.flags&32768?(se||l===1?e=!0:Na||ie&536870912?e=!1:(An=e=!0,(l===2||l===9||l===3||l===6)&&(l=pt.current,l!==null&&l.tag===13&&(l.flags|=16384))),l0(t,e)):Ko(t)}function Ko(e){var t=e;do{if(t.flags&32768){l0(t,An);return}e=t.return;var n=w_(t.alternate,t,hn);if(n!==null){ae=n;return}if(t=t.sibling,t!==null){ae=t;return}ae=t=e}while(t!==null);Ce===0&&(Ce=5)}function l0(e,t){do{var n=S_(e.alternate,e);if(n!==null){n.flags&=32767,ae=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ae=e;return}ae=e=n}while(e!==null);Ce=6,ae=null}function Jd(e,t,n,l,a,i,s,o,u){e.cancelPendingCommit=null;do Jo();while(Le!==0);if(ce&6)throw Error(V(327));if(t!==null){if(t===e.current)throw Error(V(177));if(i=t.lanes|t.childLanes,i|=Hc,c1(e,n,i,s,o,u),e===pe&&(ae=pe=null,ie=0),oa=t,Bn=e,un=n,qr=i,Gr=a,Jp=l,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,H_(Ks,function(){return u0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,t.subtreeFlags&13878||l){l=I.T,I.T=null,a=fe.p,fe.p=2,s=ce,ce|=4;try{E_(e,t,n)}finally{ce=s,fe.p=a,I.T=l}}Le=1,a0(),i0(),s0()}}function a0(){if(Le===1){Le=0;var e=Bn,t=oa,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var l=fe.p;fe.p=2;var a=ce;ce|=4;try{Vp(t,e);var i=Jr,s=wm(e.containerInfo),o=i.focusedElem,u=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&bm(o.ownerDocument.documentElement,o)){if(u!==null&&Oc(o)){var c=u.start,h=u.end;if(h===void 0&&(h=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(h,o.value.length);else{var d=o.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var g=f.getSelection(),v=o.textContent.length,x=Math.min(u.start,v),b=u.end===void 0?x:Math.min(u.end,v);!g.extend&&x>b&&(s=b,b=x,x=s);var m=yd(o,x),y=yd(o,b);if(m&&y&&(g.rangeCount!==1||g.anchorNode!==m.node||g.anchorOffset!==m.offset||g.focusNode!==y.node||g.focusOffset!==y.offset)){var p=d.createRange();p.setStart(m.node,m.offset),g.removeAllRanges(),x>b?(g.addRange(p),g.extend(y.node,y.offset)):(p.setEnd(y.node,y.offset),g.addRange(p))}}}}for(d=[],g=o;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<d.length;o++){var _=d[o];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}xo=!!Kr,Jr=Kr=null}finally{ce=a,fe.p=l,I.T=n}}e.current=t,Le=2}}function i0(){if(Le===2){Le=0;var e=Bn,t=oa,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var l=fe.p;fe.p=2;var a=ce;ce|=4;try{Rp(e,t.alternate,t)}finally{ce=a,fe.p=l,I.T=n}}Le=3}}function s0(){if(Le===4||Le===3){Le=0,t1();var e=Bn,t=oa,n=un,l=Jp;t.subtreeFlags&10256||t.flags&10256?Le=5:(Le=0,oa=Bn=null,o0(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Ln=null),Cc(n),t=t.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Oi,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=I.T,a=fe.p,fe.p=2,I.T=null;try{for(var i=e.onRecoverableError,s=0;s<l.length;s++){var o=l[s];i(o.value,{componentStack:o.stack})}}finally{I.T=t,fe.p=a}}un&3&&Jo(),Gt(e),a=e.pendingLanes,n&261930&&a&42?e===$r?si++:(si=0,$r=e):si=0,Xi(0)}}function o0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ui(t)))}function Jo(){return a0(),i0(),s0(),u0()}function u0(){if(Le!==5)return!1;var e=Bn,t=qr;qr=0;var n=Cc(un),l=I.T,a=fe.p;try{fe.p=32>n?32:n,I.T=null,n=Gr,Gr=null;var i=Bn,s=un;if(Le=0,oa=Bn=null,un=0,ce&6)throw Error(V(331));var o=ce;if(ce|=4,Qp(i.current),qp(i,i.current,s,n),ce=o,Xi(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Oi,i)}catch{}return!0}finally{fe.p=a,I.T=l,o0(e,t)}}function Wd(e,t,n){t=St(n,t),t=Br(e.stateNode,t,2),e=Rn(e,t,2),e!==null&&(Ri(e,2),Gt(e))}function he(e,t,n){if(e.tag===3)Wd(e,e,n);else for(;t!==null;){if(t.tag===3){Wd(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ln===null||!Ln.has(l))){e=St(n,e),n=Sp(2),l=Rn(t,n,2),l!==null&&(Ep(n,l,t,e),Ri(l,2),Gt(l));break}}t=t.return}}function qu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new C_;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(rf=!0,a.add(n),e=D_.bind(null,e,t,n),t.then(e,e))}function D_(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,pe===e&&(ie&n)===n&&(Ce===4||Ce===3&&(ie&62914560)===ie&&300>ft()-Qo?!(ce&2)&&ua(e,0):cf|=n,sa===ie&&(sa=0)),Gt(e)}function r0(e,t){t===0&&(t=em()),e=wl(e,t),e!==null&&(Ri(e,t),Gt(e))}function k_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),r0(e,n)}function O_(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(V(314))}l!==null&&l.delete(t),r0(e,n)}function H_(e,t){return Nc(e,t)}var fo=null,Al=null,Qr=!1,ho=!1,Gu=!1,Dn=0;function Gt(e){e!==Al&&e.next===null&&(Al===null?fo=Al=e:Al=Al.next=e),ho=!0,Qr||(Qr=!0,L_())}function Xi(e,t){if(!Gu&&ho){Gu=!0;do for(var n=!1,l=fo;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var i=0;else{var s=l.suspendedLanes,o=l.pingedLanes;i=(1<<31-ht(42|e)+1)-1,i&=a&~(s&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Fd(l,i))}else i=ie,i=Ho(l,l===pe?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(i&3)||Hi(l,i)||(n=!0,Fd(l,i));l=l.next}while(n);Gu=!1}}function R_(){c0()}function c0(){ho=Qr=!1;var e=0;Dn!==0&&Z_()&&(e=Dn);for(var t=ft(),n=null,l=fo;l!==null;){var a=l.next,i=f0(l,t);i===0?(l.next=null,n===null?fo=a:n.next=a,a===null&&(Al=n)):(n=l,(e!==0||i&3)&&(ho=!0)),l=a}Le!==0&&Le!==5||Xi(e),Dn!==0&&(Dn=0)}function f0(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-ht(i),o=1<<s,u=a[s];u===-1?(!(o&n)||o&l)&&(a[s]=r1(o,t)):u<=t&&(e.expiredLanes|=o),i&=~o}if(t=pe,n=ie,n=Ho(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(de===2||de===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&vu(l),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Hi(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&vu(l),Cc(n)){case 2:case 8:n=Ig;break;case 32:n=Ks;break;case 268435456:n=Pg;break;default:n=Ks}return l=d0.bind(null,e),n=Nc(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&vu(l),e.callbackPriority=2,e.callbackNode=null,2}function d0(e,t){if(Le!==0&&Le!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Jo()&&e.callbackNode!==n)return null;var l=ie;return l=Ho(e,e===pe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Fp(e,l,t),f0(e,ft()),e.callbackNode!=null&&e.callbackNode===n?d0.bind(null,e):null)}function Fd(e,t){if(Jo())return null;Fp(e,t,!0)}function L_(){J_(function(){ce&6?Nc(Fg,R_):c0()})}function df(){if(Dn===0){var e=la;e===0&&(e=ts,ts<<=1,!(ts&261888)&&(ts=256)),Dn=e}return Dn}function Id(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:js(""+e)}function Pd(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function B_(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var i=Id((a[at]||null).action),s=l.submitter;s&&(t=(t=s[at]||null)?Id(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var o=new Ro("action","action",null,l,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Dn!==0){var u=s?Pd(a,s):new FormData(a);Rr(n,{pending:!0,data:u,method:a.method,action:i},null,u)}}else typeof i=="function"&&(o.preventDefault(),u=s?Pd(a,s):new FormData(a),Rr(n,{pending:!0,data:u,method:a.method,action:i},i,u))},currentTarget:a}]})}}for(var $u=0;$u<Er.length;$u++){var Qu=Er[$u],U_=Qu.toLowerCase(),Y_=Qu[0].toUpperCase()+Qu.slice(1);Ot(U_,"on"+Y_)}Ot(Em,"onAnimationEnd");Ot(Nm,"onAnimationIteration");Ot(jm,"onAnimationStart");Ot("dblclick","onDoubleClick");Ot("focusin","onFocus");Ot("focusout","onBlur");Ot(n_,"onTransitionRun");Ot(l_,"onTransitionStart");Ot(a_,"onTransitionCancel");Ot(Cm,"onTransitionEnd");ta("onMouseEnter",["mouseout","mouseover"]);ta("onMouseLeave",["mouseout","mouseover"]);ta("onPointerEnter",["pointerout","pointerover"]);ta("onPointerLeave",["pointerout","pointerover"]);xl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xl("onBeforeInput",["compositionend","keypress","textInput","paste"]);xl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),V_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xi));function h0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var s=l.length-1;0<=s;s--){var o=l[s],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=c;try{i(a)}catch(h){Ws(h)}a.currentTarget=null,i=u}else for(s=0;s<l.length;s++){if(o=l[s],u=o.instance,c=o.currentTarget,o=o.listener,u!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=c;try{i(a)}catch(h){Ws(h)}a.currentTarget=null,i=u}}}}function le(e,t){var n=t[pr];n===void 0&&(n=t[pr]=new Set);var l=e+"__bubble";n.has(l)||(g0(t,e,2,!1),n.add(l))}function Zu(e,t,n){var l=0;t&&(l|=4),g0(n,e,l,t)}var fs="_reactListening"+Math.random().toString(36).slice(2);function hf(e){if(!e[fs]){e[fs]=!0,im.forEach(function(n){n!=="selectionchange"&&(V_.has(n)||Zu(n,!1,e),Zu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fs]||(t[fs]=!0,Zu("selectionchange",!1,t))}}function g0(e,t,n,l){switch(C0(t)){case 2:var a=m2;break;case 8:a=p2;break;default:a=yf}n=a.bind(null,t,n,e),a=void 0,!br||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Ku(e,t,n,l,a){var i=l;if(!(t&1)&&!(t&2)&&l!==null)e:for(;;){if(l===null)return;var s=l.tag;if(s===3||s===4){var o=l.stateNode.containerInfo;if(o===a)break;if(s===4)for(s=l.return;s!==null;){var u=s.tag;if((u===3||u===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;o!==null;){if(s=kl(o),s===null)return;if(u=s.tag,u===5||u===6||u===26||u===27){l=i=s;continue e}o=o.parentNode}}l=l.return}hm(function(){var c=i,h=Ac(n),d=[];e:{var f=Mm.get(e);if(f!==void 0){var g=Ro,v=e;switch(e){case"keypress":if(Ms(n)===0)break e;case"keydown":case"keyup":g=O1;break;case"focusin":v="focus",g=Su;break;case"focusout":v="blur",g=Su;break;case"beforeblur":case"afterblur":g=Su;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=w1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=L1;break;case Em:case Nm:case jm:g=N1;break;case Cm:g=U1;break;case"scroll":case"scrollend":g=_1;break;case"wheel":g=V1;break;case"copy":case"cut":case"paste":g=C1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=rd;break;case"toggle":case"beforetoggle":g=q1}var x=(t&4)!==0,b=!x&&(e==="scroll"||e==="scrollend"),m=x?f!==null?f+"Capture":null:f;x=[];for(var y=c,p;y!==null;){var _=y;if(p=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||p===null||m===null||(_=fi(y,m),_!=null&&x.push(_i(y,_,p))),b)break;y=y.return}0<x.length&&(f=new g(f,v,null,n,h),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==_r&&(v=n.relatedTarget||n.fromElement)&&(kl(v)||v[ba]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=c,v=v?kl(v):null,v!==null&&(b=ki(v),x=v.tag,v!==b||x!==5&&x!==27&&x!==6)&&(v=null)):(g=null,v=c),g!==v)){if(x=od,_="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=rd,_="onPointerLeave",m="onPointerEnter",y="pointer"),b=g==null?f:qa(g),p=v==null?f:qa(v),f=new x(_,y+"leave",g,n,h),f.target=b,f.relatedTarget=p,_=null,kl(h)===c&&(x=new x(m,y+"enter",v,n,h),x.target=p,x.relatedTarget=b,_=x),b=_,g&&v)t:{for(x=X_,m=g,y=v,p=0,_=m;_;_=x(_))p++;_=0;for(var j=y;j;j=x(j))_++;for(;0<p-_;)m=x(m),p--;for(;0<_-p;)y=x(y),_--;for(;p--;){if(m===y||y!==null&&m===y.alternate){x=m;break t}m=x(m),y=x(y)}x=null}else x=null;g!==null&&eh(d,f,g,x,!1),v!==null&&b!==null&&eh(d,b,v,x,!0)}}e:{if(f=c?qa(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=hd;else if(dd(f))if(xm)S=P1;else{S=F1;var w=W1}else g=f.nodeName,!g||g.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?c&&Tc(c.elementType)&&(S=hd):S=I1;if(S&&(S=S(e,c))){vm(d,S,n,h);break e}w&&w(e,f,c),e==="focusout"&&c&&f.type==="number"&&c.memoizedProps.value!=null&&xr(f,"number",f.value)}switch(w=c?qa(c):window,e){case"focusin":(dd(w)||w.contentEditable==="true")&&(Rl=w,wr=c,Fa=null);break;case"focusout":Fa=wr=Rl=null;break;case"mousedown":Sr=!0;break;case"contextmenu":case"mouseup":case"dragend":Sr=!1,vd(d,n,h);break;case"selectionchange":if(t_)break;case"keydown":case"keyup":vd(d,n,h)}var E;if(kc)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Hl?pm(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(mm&&n.locale!=="ko"&&(Hl||M!=="onCompositionStart"?M==="onCompositionEnd"&&Hl&&(E=gm()):(Tn=h,zc="value"in Tn?Tn.value:Tn.textContent,Hl=!0)),w=go(c,M),0<w.length&&(M=new ud(M,e,null,n,h),d.push({event:M,listeners:w}),E?M.data=E:(E=ym(n),E!==null&&(M.data=E)))),(E=$1?Q1(e,n):Z1(e,n))&&(M=go(c,"onBeforeInput"),0<M.length&&(w=new ud("onBeforeInput","beforeinput",null,n,h),d.push({event:w,listeners:M}),w.data=E)),B_(d,e,c,n,h)}h0(d,t)})}function _i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function go(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=fi(e,n),a!=null&&l.unshift(_i(e,a,i)),a=fi(e,t),a!=null&&l.push(_i(e,a,i))),e.tag===3)return l;e=e.return}return[]}function X_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function eh(e,t,n,l,a){for(var i=t._reactName,s=[];n!==null&&n!==l;){var o=n,u=o.alternate,c=o.stateNode;if(o=o.tag,u!==null&&u===l)break;o!==5&&o!==26&&o!==27||c===null||(u=c,a?(c=fi(n,i),c!=null&&s.unshift(_i(n,c,u))):a||(c=fi(n,i),c!=null&&s.push(_i(n,c,u)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var q_=/\r\n?/g,G_=/\u0000|\uFFFD/g;function th(e){return(typeof e=="string"?e:""+e).replace(q_,`
49
- `).replace(G_,"")}function m0(e,t){return t=th(t),th(e)===t}function ge(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||na(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&na(e,""+l);break;case"className":as(e,"class",l);break;case"tabIndex":as(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":as(e,n,l);break;case"style":dm(e,l,i);break;case"data":if(t!=="object"){as(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&ge(e,t,"name",a.name,a,null),ge(e,t,"formEncType",a.formEncType,a,null),ge(e,t,"formMethod",a.formMethod,a,null),ge(e,t,"formTarget",a.formTarget,a,null)):(ge(e,t,"encType",a.encType,a,null),ge(e,t,"method",a.method,a,null),ge(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=nn);break;case"onScroll":l!=null&&le("scroll",e);break;case"onScrollEnd":l!=null&&le("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(V(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(V(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=js(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":le("beforetoggle",e),le("toggle",e),Ns(e,"popover",l);break;case"xlinkActuate":Zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ns(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=v1.get(n)||n,Ns(e,n,l))}}function Zr(e,t,n,l,a,i){switch(n){case"style":dm(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(V(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(V(60));e.innerHTML=n}}break;case"children":typeof l=="string"?na(e,l):(typeof l=="number"||typeof l=="bigint")&&na(e,""+l);break;case"onScroll":l!=null&&le("scroll",e);break;case"onScrollEnd":l!=null&&le("scrollend",e);break;case"onClick":l!=null&&(e.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[at]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Ns(e,n,l)}}}function Ze(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",e),le("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(s!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(V(137,t));default:ge(e,t,i,s,n,null)}}a&&ge(e,t,"srcSet",n.srcSet,n,null),l&&ge(e,t,"src",n.src,n,null);return;case"input":le("invalid",e);var o=i=s=a=null,u=null,c=null;for(l in n)if(n.hasOwnProperty(l)){var h=n[l];if(h!=null)switch(l){case"name":a=h;break;case"type":s=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":i=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(V(137,t));break;default:ge(e,t,l,h,n,null)}}rm(e,i,o,u,c,s,a,!1);return;case"select":le("invalid",e),l=s=i=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":i=o;break;case"defaultValue":s=o;break;case"multiple":l=o;default:ge(e,t,a,o,n,null)}t=i,n=s,e.multiple=!!l,t!=null?Ql(e,!!l,t,!1):n!=null&&Ql(e,!!l,n,!0);return;case"textarea":le("invalid",e),i=a=l=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":l=o;break;case"defaultValue":a=o;break;case"children":i=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(V(91));break;default:ge(e,t,s,o,n,null)}fm(e,l,a,i);return;case"option":for(u in n)if(n.hasOwnProperty(u)&&(l=n[u],l!=null))switch(u){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ge(e,t,u,l,n,null)}return;case"dialog":le("beforetoggle",e),le("toggle",e),le("cancel",e),le("close",e);break;case"iframe":case"object":le("load",e);break;case"video":case"audio":for(l=0;l<xi.length;l++)le(xi[l],e);break;case"image":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"embed":case"source":case"link":le("error",e),le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(l=n[c],l!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(V(137,t));default:ge(e,t,c,l,n,null)}return;default:if(Tc(t)){for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!==void 0&&Zr(e,t,h,l,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(l=n[o],l!=null&&ge(e,t,o,l,n,null))}function $_(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,s=null,o=null,u=null,c=null,h=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":u=d;default:l.hasOwnProperty(g)||ge(e,t,g,null,l,d)}}for(var f in l){var g=l[f];if(d=n[f],l.hasOwnProperty(f)&&(g!=null||d!=null))switch(f){case"type":i=g;break;case"name":a=g;break;case"checked":c=g;break;case"defaultChecked":h=g;break;case"value":s=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(V(137,t));break;default:g!==d&&ge(e,t,f,g,l,d)}}vr(e,s,o,u,c,h,i,a);return;case"select":g=s=o=f=null;for(i in n)if(u=n[i],n.hasOwnProperty(i)&&u!=null)switch(i){case"value":break;case"multiple":g=u;default:l.hasOwnProperty(i)||ge(e,t,i,null,l,u)}for(a in l)if(i=l[a],u=n[a],l.hasOwnProperty(a)&&(i!=null||u!=null))switch(a){case"value":f=i;break;case"defaultValue":o=i;break;case"multiple":s=i;default:i!==u&&ge(e,t,a,i,l,u)}t=o,n=s,l=g,f!=null?Ql(e,!!n,f,!1):!!l!=!!n&&(t!=null?Ql(e,!!n,t,!0):Ql(e,!!n,n?[]:"",!1));return;case"textarea":g=f=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!l.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:ge(e,t,o,null,l,a)}for(s in l)if(a=l[s],i=n[s],l.hasOwnProperty(s)&&(a!=null||i!=null))switch(s){case"value":f=a;break;case"defaultValue":g=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(V(91));break;default:a!==i&&ge(e,t,s,a,l,i)}cm(e,f,g);return;case"option":for(var v in n)if(f=n[v],n.hasOwnProperty(v)&&f!=null&&!l.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:ge(e,t,v,null,l,f)}for(u in l)if(f=l[u],g=n[u],l.hasOwnProperty(u)&&f!==g&&(f!=null||g!=null))switch(u){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:ge(e,t,u,f,l,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in n)f=n[x],n.hasOwnProperty(x)&&f!=null&&!l.hasOwnProperty(x)&&ge(e,t,x,null,l,f);for(c in l)if(f=l[c],g=n[c],l.hasOwnProperty(c)&&f!==g&&(f!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(V(137,t));break;default:ge(e,t,c,f,l,g)}return;default:if(Tc(t)){for(var b in n)f=n[b],n.hasOwnProperty(b)&&f!==void 0&&!l.hasOwnProperty(b)&&Zr(e,t,b,void 0,l,f);for(h in l)f=l[h],g=n[h],!l.hasOwnProperty(h)||f===g||f===void 0&&g===void 0||Zr(e,t,h,f,l,g);return}}for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!=null&&!l.hasOwnProperty(m)&&ge(e,t,m,null,l,f);for(d in l)f=l[d],g=n[d],!l.hasOwnProperty(d)||f===g||f==null&&g==null||ge(e,t,d,f,l,g)}function nh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,s=a.initiatorType,o=a.duration;if(i&&o&&nh(s)){for(s=0,o=a.responseEnd,l+=1;l<n.length;l++){var u=n[l],c=u.startTime;if(c>o)break;var h=u.transferSize,d=u.initiatorType;h&&nh(d)&&(u=u.responseEnd,s+=h*(u<o?1:(o-c)/(u-c)))}if(--l,t+=8*(i+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Kr=null,Jr=null;function mo(e){return e.nodeType===9?e:e.ownerDocument}function lh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function p0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Wr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ju=null;function Z_(){var e=window.event;return e&&e.type==="popstate"?e===Ju?!1:(Ju=e,!0):(Ju=null,!1)}var y0=typeof setTimeout=="function"?setTimeout:void 0,K_=typeof clearTimeout=="function"?clearTimeout:void 0,ah=typeof Promise=="function"?Promise:void 0,J_=typeof queueMicrotask=="function"?queueMicrotask:typeof ah<"u"?function(e){return ah.resolve(null).then(e).catch(W_)}:y0;function W_(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function ih(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),ca(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")oi(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,oi(n);for(var i=n.firstChild;i;){var s=i.nextSibling,o=i.nodeName;i[Li]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=s}}else n==="body"&&oi(e.ownerDocument.body);n=a}while(n);ca(t)}function sh(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Fr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fr(n),Mc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function F_(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Li])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=jt(e.nextSibling),e===null)break}return null}function I_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jt(e.nextSibling),e===null))return null;return e}function v0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jt(e.nextSibling),e===null))return null;return e}function Ir(e){return e.data==="$?"||e.data==="$~"}function Pr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function P_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ec=null;function oh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function uh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function x0(e,t,n){switch(t=mo(n),e){case"html":if(e=t.documentElement,!e)throw Error(V(452));return e;case"head":if(e=t.head,!e)throw Error(V(453));return e;case"body":if(e=t.body,!e)throw Error(V(454));return e;default:throw Error(V(451))}}function oi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mc(e)}var Ct=new Map,rh=new Set;function po(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mn=fe.d;fe.d={f:e2,r:t2,D:n2,C:l2,L:a2,m:i2,X:o2,S:s2,M:u2};function e2(){var e=mn.f(),t=Zo();return e||t}function t2(e){var t=wa(e);t!==null&&t.tag===5&&t.type==="form"?dp(t):mn.r(e)}var ja=typeof document>"u"?null:document;function _0(e,t,n){var l=ja;if(l&&typeof t=="string"&&t){var a=wt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),rh.has(a)||(rh.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Ze(t,"link",e),Ye(t),l.head.appendChild(t)))}}function n2(e){mn.D(e),_0("dns-prefetch",e,null)}function l2(e,t){mn.C(e,t),_0("preconnect",e,t)}function a2(e,t,n){mn.L(e,t,n);var l=ja;if(l&&e&&t){var a='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+wt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+wt(n.imageSizes)+'"]')):a+='[href="'+wt(e)+'"]';var i=a;switch(t){case"style":i=ra(e);break;case"script":i=Ca(e)}Ct.has(i)||(e=we({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ct.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(qi(i))||t==="script"&&l.querySelector(Gi(i))||(t=l.createElement("link"),Ze(t,"link",e),Ye(t),l.head.appendChild(t)))}}function i2(e,t){mn.m(e,t);var n=ja;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+wt(l)+'"][href="'+wt(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ca(e)}if(!Ct.has(i)&&(e=we({rel:"modulepreload",href:e},t),Ct.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Gi(i)))return}l=n.createElement("link"),Ze(l,"link",e),Ye(l),n.head.appendChild(l)}}}function s2(e,t,n){mn.S(e,t,n);var l=ja;if(l&&e){var a=$l(l).hoistableStyles,i=ra(e);t=t||"default";var s=a.get(i);if(!s){var o={loading:0,preload:null};if(s=l.querySelector(qi(i)))o.loading=5;else{e=we({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ct.get(i))&&gf(e,n);var u=s=l.createElement("link");Ye(u),Ze(u,"link",e),u._p=new Promise(function(c,h){u.onload=c,u.onerror=h}),u.addEventListener("load",function(){o.loading|=1}),u.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Rs(s,t,l)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(i,s)}}}function o2(e,t){mn.X(e,t);var n=ja;if(n&&e){var l=$l(n).hoistableScripts,a=Ca(e),i=l.get(a);i||(i=n.querySelector(Gi(a)),i||(e=we({src:e,async:!0},t),(t=Ct.get(a))&&mf(e,t),i=n.createElement("script"),Ye(i),Ze(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function u2(e,t){mn.M(e,t);var n=ja;if(n&&e){var l=$l(n).hoistableScripts,a=Ca(e),i=l.get(a);i||(i=n.querySelector(Gi(a)),i||(e=we({src:e,async:!0,type:"module"},t),(t=Ct.get(a))&&mf(e,t),i=n.createElement("script"),Ye(i),Ze(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function ch(e,t,n,l){var a=(a=kn.current)?po(a):null;if(!a)throw Error(V(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ra(n.href),n=$l(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ra(n.href);var i=$l(a).hoistableStyles,s=i.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=a.querySelector(qi(e)))&&!i._p&&(s.instance=i,s.state.loading=5),Ct.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ct.set(e,n),i||r2(a,e,n,s.state))),t&&l===null)throw Error(V(528,""));return s}if(t&&l!==null)throw Error(V(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ca(n),n=$l(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(V(444,e))}}function ra(e){return'href="'+wt(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function b0(e){return we({},e,{"data-precedence":e.precedence,precedence:null})}function r2(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ze(t,"link",n),Ye(t),e.head.appendChild(t))}function Ca(e){return'[src="'+wt(e)+'"]'}function Gi(e){return"script[async]"+e}function fh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+wt(n.href)+'"]');if(l)return t.instance=l,Ye(l),l;var a=we({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ye(l),Ze(l,"style",a),Rs(l,n.precedence,e),t.instance=l;case"stylesheet":a=ra(n.href);var i=e.querySelector(qi(a));if(i)return t.state.loading|=4,t.instance=i,Ye(i),i;l=b0(n),(a=Ct.get(a))&&gf(l,a),i=(e.ownerDocument||e).createElement("link"),Ye(i);var s=i;return s._p=new Promise(function(o,u){s.onload=o,s.onerror=u}),Ze(i,"link",l),t.state.loading|=4,Rs(i,n.precedence,e),t.instance=i;case"script":return i=Ca(n.src),(a=e.querySelector(Gi(i)))?(t.instance=a,Ye(a),a):(l=n,(a=Ct.get(i))&&(l=we({},n),mf(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),Ye(a),Ze(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(V(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(l=t.instance,t.state.loading|=4,Rs(l,n.precedence,e));return t.instance}function Rs(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,s=0;s<l.length;s++){var o=l[s];if(o.dataset.precedence===t)i=o;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function gf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ls=null;function dh(e,t,n){if(Ls===null){var l=new Map,a=Ls=new Map;a.set(n,l)}else a=Ls,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Li]||i[Ge]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var o=l.get(s);o?o.push(i):l.set(s,[i])}}return l}function hh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function c2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function w0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function f2(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var a=ra(l.href),i=t.querySelector(qi(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,Ye(i);return}i=t.ownerDocument||t,l=b0(l),(a=Ct.get(a))&&gf(l,a),i=i.createElement("link"),Ye(i);var s=i;s._p=new Promise(function(o,u){s.onload=o,s.onerror=u}),Ze(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=yo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wu=0;function d2(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Wu===0&&(Wu=62500*Q_());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Wu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vo=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vo=new Map,t.forEach(h2,e),vo=null,yo.call(e))}function h2(e,t){if(!(t.state.loading&4)){var n=vo.get(e);if(n)var l=n.get(null);else{n=new Map,vo.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var s=a[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),l=s)}l&&n.set(null,l)}a=t.instance,s=a.getAttribute("data-precedence"),i=n.get(s)||l,i===l&&n.set(null,a),n.set(s,a),this.count++,l=yo.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var bi={$$typeof:tn,Provider:null,Consumer:null,_currentValue:ll,_currentValue2:ll,_threadCount:0};function g2(e,t,n,l,a,i,s,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xu(0),this.hiddenUpdates=xu(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function S0(e,t,n,l,a,i,s,o,u,c,h,d){return e=new g2(e,t,n,s,u,c,h,d,o),t=1,i===!0&&(t|=24),i=ut(3,null,null,t),e.current=i,i.stateNode=e,t=Yc(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},qc(i),e}function E0(e){return e?(e=Ul,e):Ul}function N0(e,t,n,l,a,i){a=E0(a),l.context===null?l.context=a:l.pendingContext=a,l=Hn(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=Rn(e,l,t),n!==null&&(lt(n,e,t),Pa(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pf(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function j0(e){if(e.tag===13||e.tag===31){var t=wl(e,67108864);t!==null&&lt(t,e,67108864),pf(e,67108864)}}function mh(e){if(e.tag===13||e.tag===31){var t=gt();t=jc(t);var n=wl(e,t);n!==null&&lt(n,e,t),pf(e,t)}}var xo=!0;function m2(e,t,n,l){var a=I.T;I.T=null;var i=fe.p;try{fe.p=2,yf(e,t,n,l)}finally{fe.p=i,I.T=a}}function p2(e,t,n,l){var a=I.T;I.T=null;var i=fe.p;try{fe.p=8,yf(e,t,n,l)}finally{fe.p=i,I.T=a}}function yf(e,t,n,l){if(xo){var a=tc(l);if(a===null)Ku(e,t,l,_o,n),ph(e,l);else if(v2(a,e,t,n,l))l.stopPropagation();else if(ph(e,l),t&4&&-1<y2.indexOf(e)){for(;a!==null;){var i=wa(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=In(i.pendingLanes);if(s!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var u=1<<31-ht(s);o.entanglements[1]|=u,s&=~u}Gt(i),!(ce&6)&&(uo=ft()+500,Xi(0))}}break;case 31:case 13:o=wl(i,2),o!==null&&lt(o,i,2),Zo(),pf(i,2)}if(i=tc(l),i===null&&Ku(e,t,l,_o,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else Ku(e,t,l,null,n)}}function tc(e){return e=Ac(e),vf(e)}var _o=null;function vf(e){if(_o=null,e=kl(e),e!==null){var t=ki(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Qg(t),e!==null)return e;e=null}else if(n===31){if(e=Zg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _o=e,null}function C0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(n1()){case Fg:return 2;case Ig:return 8;case Ks:case l1:return 32;case Pg:return 268435456;default:return 32}default:return 32}}var nc=!1,Un=null,Yn=null,Vn=null,wi=new Map,Si=new Map,jn=[],y2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ph(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Yn=null;break;case"mouseover":case"mouseout":Vn=null;break;case"pointerover":case"pointerout":wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Si.delete(t.pointerId)}}function Ba(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=wa(t),t!==null&&j0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function v2(e,t,n,l,a){switch(t){case"focusin":return Un=Ba(Un,e,t,n,l,a),!0;case"dragenter":return Yn=Ba(Yn,e,t,n,l,a),!0;case"mouseover":return Vn=Ba(Vn,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return wi.set(i,Ba(wi.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,Si.set(i,Ba(Si.get(i)||null,e,t,n,l,a)),!0}return!1}function M0(e){var t=kl(e.target);if(t!==null){var n=ki(t);if(n!==null){if(t=n.tag,t===13){if(t=Qg(n),t!==null){e.blockedOn=t,ed(e.priority,function(){mh(n)});return}}else if(t===31){if(t=Zg(n),t!==null){e.blockedOn=t,ed(e.priority,function(){mh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Us(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=tc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);_r=l,n.target.dispatchEvent(l),_r=null}else return t=wa(n),t!==null&&j0(t),e.blockedOn=n,!1;t.shift()}return!0}function yh(e,t,n){Us(e)&&n.delete(t)}function x2(){nc=!1,Un!==null&&Us(Un)&&(Un=null),Yn!==null&&Us(Yn)&&(Yn=null),Vn!==null&&Us(Vn)&&(Vn=null),wi.forEach(yh),Si.forEach(yh)}function ds(e,t){e.blockedOn===t&&(e.blockedOn=null,nc||(nc=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,x2)))}var hs=null;function vh(e){hs!==e&&(hs=e,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,function(){hs===e&&(hs=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(vf(l||n)===null)continue;break}var i=wa(n);i!==null&&(e.splice(t,3),t-=3,Rr(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function ca(e){function t(u){return ds(u,e)}Un!==null&&ds(Un,e),Yn!==null&&ds(Yn,e),Vn!==null&&ds(Vn,e),wi.forEach(t),Si.forEach(t);for(var n=0;n<jn.length;n++){var l=jn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<jn.length&&(n=jn[0],n.blockedOn===null);)M0(n),n.blockedOn===null&&jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],s=a[at]||null;if(typeof i=="function")s||vh(n);else if(s){var o=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[at]||null)o=s.formAction;else if(vf(a)!==null)continue}else o=s.action;typeof o=="function"?n[l+1]=o:(n.splice(l,3),l-=3),vh(n)}}}function T0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function xf(e){this._internalRoot=e}Wo.prototype.render=xf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));var n=t.current,l=gt();N0(n,l,e,t,null,null)};Wo.prototype.unmount=xf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;N0(e.current,2,null,e,null,null),Zo(),t[ba]=null}};function Wo(e){this._internalRoot=e}Wo.prototype.unstable_scheduleHydration=function(e){if(e){var t=am();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jn.length&&t!==0&&t<jn[n].priority;n++);jn.splice(n,0,e),n===0&&M0(e)}};var xh=Gg.version;if(xh!=="19.2.6")throw Error(V(527,xh,"19.2.6"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Jx(t),e=e!==null?Kg(e):null,e=e===null?null:e.stateNode,e};var _2={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gs.isDisabled&&gs.supportsFiber)try{Oi=gs.inject(_2),dt=gs}catch{}}ko.createRoot=function(e,t){if(!$g(e))throw Error(V(299));var n=!1,l="",a=_p,i=bp,s=wp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=S0(e,1,!1,null,null,n,l,null,a,i,s,T0),e[ba]=t.current,hf(e),new xf(t)};ko.hydrateRoot=function(e,t,n){if(!$g(e))throw Error(V(299));var l=!1,a="",i=_p,s=bp,o=wp,u=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=S0(e,1,!0,t,n??null,l,a,u,i,s,o,T0),t.context=E0(null),n=t.current,l=gt(),l=jc(l),a=Hn(l),a.callback=null,Rn(n,a,l),n=l,t.current.lanes=n,Ri(t,n),Gt(t),e[ba]=t.current,hf(e),new Wo(t)};ko.version="19.2.6";function A0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A0)}catch(e){console.error(e)}}A0(),Bg.exports=ko;var b2=Bg.exports;const w2="/api";async function Re(e,t,n){const l=await fetch(`${w2}${t}`,{method:e,headers:n?{"Content-Type":"application/json"}:{},body:n?JSON.stringify(n):void 0});if(!l.ok)throw new Error(`${e} ${t} failed: ${l.status}`);return l.json()}const Me={health:()=>Re("GET","/health"),claudeCheck:()=>Re("GET","/claude-check"),workflows:{list:()=>Re("GET","/workflows/list"),read:e=>Re("GET",`/workflows?path=${encodeURIComponent(e)}`),save:(e,t)=>Re("POST","/workflows",{path:e,content:t}),delete:e=>Re("DELETE",`/workflows?path=${encodeURIComponent(e)}`),rename:(e,t)=>Re("POST","/workflows/rename",{oldPath:e,newName:t})},agents:e=>Re("GET",`/agents${e?`?projectDir=${encodeURIComponent(e)}`:""}`),recents:{list:()=>Re("GET","/recents"),add:e=>Re("POST","/recents",{path:e}),remove:e=>Re("DELETE",`/recents?path=${encodeURIComponent(e)}`)},skills:()=>Re("GET","/skills"),export:(e,t)=>Re("POST","/export",{cwcFile:e,target:t}),exportPreview:(e,t)=>Re("POST","/export/preview",{cwcFile:e,target:t}),deleteExport:(e,t)=>Re("POST","/export/delete",{cwcFile:e,target:t}),exportedWorkflows:{list:()=>Re("GET","/exported-workflows"),delete:e=>Re("DELETE",`/exported-workflows?slug=${encodeURIComponent(e)}`)},fileContent:e=>Re("GET",`/file-content?path=${encodeURIComponent(e)}`),openFile:e=>Re("POST","/open-file",{path:e})};function S2(e,t=Date.now()){const n=t-new Date(e).getTime(),l=Math.floor(n/1e3);if(l<60)return"just now";const a=Math.floor(l/60);if(a<60)return`${a} min ago`;const i=Math.floor(a/60);return i<24?`${i} hr ago`:`${Math.floor(i/24)} days ago`}function E2(e){return e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~")}function N2({onSelect:e,onOpenRecent:t}){const[n,l]=T.useState([]),[a,i]=T.useState([]),[s,o]=T.useState(!1),[u,c]=T.useState(null),[h,d]=T.useState("new"),[f,g]=T.useState(!1),[v,x]=T.useState(null),[b,m]=T.useState(null),y=T.useRef(null);T.useEffect(()=>{Me.claudeCheck().then(S=>{S.installed||o(!0)}).catch(()=>{}),Me.workflows.list().then(S=>{l(S.slice().sort((w,E)=>E.updated.localeCompare(w.updated)))}).catch(()=>{}),Me.exportedWorkflows.list().then(i).catch(()=>{})},[]),T.useEffect(()=>{if(!v)return;function S(E){E.key==="Escape"&&x(null)}function w(E){var M;(M=y.current)!=null&&M.contains(E.target)||x(null)}return document.addEventListener("keydown",S),document.addEventListener("mousedown",w),()=>{document.removeEventListener("keydown",S),document.removeEventListener("mousedown",w)}},[v]);async function p(S){try{let w;try{w=await Me.workflows.read(S)}catch{}if(w)try{await Me.deleteExport(w,{type:"user"})}catch{}await Me.workflows.delete(S),await Me.recents.remove(S),l(E=>E.filter(M=>M.path!==S))}catch{l(w=>w.filter(E=>E.path!==S))}finally{x(null)}}async function _(S){try{await Me.exportedWorkflows.delete(S),i(w=>w.filter(E=>E.slug!==S))}catch{}finally{m(null)}}async function j(){c(null),g(!0);try{const S={meta:{id:crypto.randomUUID(),name:"Untitled Workflow",description:"",version:1,created:new Date().toISOString(),updated:new Date().toISOString()},nodes:[],edges:[]},w=await fetch(`/api/workflows/default-path?name=${encodeURIComponent(S.meta.name)}`),{path:E}=await w.json();await Me.workflows.save(E,S),await Me.recents.add(E),e(S,E)}catch{c("Failed to create workflow. Is the server running?"),g(!1)}}return s?r.jsx("div",{className:"template-picker",children:r.jsxs("div",{className:"template-picker__notice",children:[r.jsx("div",{className:"template-picker__notice-icon",children:r.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M12 8v4"}),r.jsx("path",{d:"M12 16h.01"})]})}),r.jsx("h2",{className:"template-picker__notice-title",children:"Claude Code not found"}),r.jsxs("p",{className:"template-picker__notice-desc",children:["Install Claude Code first, then relaunch ",r.jsx("code",{children:"npx cwc"}),"."]})]})}):r.jsxs("div",{className:"template-picker",children:[r.jsxs("header",{className:"template-picker__header",children:[r.jsx("div",{className:"template-picker__logo",children:r.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),r.jsx("path",{d:"M2 17l10 5 10-5"}),r.jsx("path",{d:"M2 12l10 5 10-5"})]})}),r.jsx("h1",{className:"template-picker__title",children:"Workflow Composer"}),r.jsx("p",{className:"template-picker__subtitle",children:"Visually compose multi-agent workflows for Claude Code. Drag agents, attach skills, wire handoffs, and export."})]}),r.jsxs("div",{className:"template-picker__tabs",children:[r.jsxs("button",{className:`template-picker__tab${h==="new"?" template-picker__tab--active":""}`,onClick:()=>d("new"),type:"button",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 5v14"}),r.jsx("path",{d:"M5 12h14"})]}),"New Workflow"]}),r.jsxs("button",{className:`template-picker__tab${h==="workflows"?" template-picker__tab--active":""}`,onClick:()=>d("workflows"),type:"button",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"})]}),"Workflows",n.length>0&&r.jsx("span",{className:"template-picker__tab-badge",children:n.length})]}),r.jsxs("button",{className:`template-picker__tab${h==="deployed"?" template-picker__tab--active":""}`,onClick:()=>d("deployed"),type:"button",children:[r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Deployed",a.length>0&&r.jsx("span",{className:"template-picker__tab-badge",children:a.length})]})]}),u&&r.jsxs("div",{className:"template-picker__error",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M12 8v4"}),r.jsx("path",{d:"M12 16h.01"})]}),u]}),h==="new"&&r.jsx("section",{className:"template-picker__section",children:r.jsxs("button",{className:"template-card template-card--blank",onClick:j,disabled:f,type:"button",children:[r.jsx("div",{className:"template-card__icon",children:r.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 5v14"}),r.jsx("path",{d:"M5 12h14"})]})}),r.jsx("span",{className:"template-card__title",children:"Blank Canvas"}),r.jsx("span",{className:"template-card__desc",children:"Start from scratch with your own agents and skills"})]})}),h==="deployed"&&r.jsx("section",{className:"template-picker__section",children:a.length===0?r.jsxs("div",{className:"template-picker__empty-state",children:[r.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),r.jsx("p",{className:"template-picker__empty-text",children:"No deployed workflows."}),r.jsx("p",{className:"template-picker__empty-hint",children:"Export a workflow to see it here."})]}):r.jsx("div",{className:"template-picker__recent-list",children:a.map(S=>{const w=b===S.slug;return r.jsxs("div",{className:`template-picker__recent-item${w?" template-picker__recent-item--confirming":""}`,children:[r.jsxs("div",{className:"template-picker__recent-link template-picker__recent-link--static",children:[r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),r.jsxs("div",{className:"template-picker__recent-info",children:[r.jsx("span",{className:"template-picker__recent-name",children:S.name}),S.description&&r.jsx("span",{className:"template-picker__recent-meta",children:S.description}),r.jsxs("span",{className:"template-picker__recent-dir",children:["~/.claude/skills/",S.slug]})]})]}),w?r.jsxs("div",{ref:y,className:"template-picker__confirm-delete",children:[r.jsx("span",{className:"template-picker__confirm-msg",children:"Remove from Claude?"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--yes",onClick:()=>_(S.slug),type:"button",children:"Remove"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--no",onClick:()=>m(null),type:"button",children:"Cancel"})]}):r.jsx("button",{className:"template-picker__recent-delete",onClick:()=>m(S.slug),"aria-label":"Remove deployed workflow",type:"button",children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},S.slug)})})}),h==="workflows"&&r.jsx("section",{className:"template-picker__section",children:n.length===0?r.jsxs("div",{className:"template-picker__empty-state",children:[r.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"}),r.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),r.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),r.jsx("p",{className:"template-picker__empty-text",children:"No workflows yet."}),r.jsx("p",{className:"template-picker__empty-hint",children:"Create a new workflow to get started."})]}):r.jsx("div",{className:"template-picker__recent-list",children:n.map(S=>{const w=E2(S.path).replace(/\/[^/]*\.cwc$/,""),E=v===S.path;return r.jsxs("div",{className:`template-picker__recent-item${E?" template-picker__recent-item--confirming":""}`,children:[r.jsxs("button",{className:"template-picker__recent-link",onClick:()=>{t(S.path).catch(()=>{l(M=>M.filter(R=>R.path!==S.path)),c("That workflow was deleted or moved.")})},type:"button",children:[r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"})]}),r.jsxs("div",{className:"template-picker__recent-info",children:[r.jsx("span",{className:"template-picker__recent-name",children:S.name}),r.jsxs("span",{className:"template-picker__recent-meta",children:[S.nodeCount," agent",S.nodeCount!==1?"s":""," · ",S2(S.updated)]}),r.jsx("span",{className:"template-picker__recent-dir",children:w})]})]}),E?r.jsxs("div",{ref:y,className:"template-picker__confirm-delete",children:[r.jsx("span",{className:"template-picker__confirm-msg",children:"Delete?"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--yes",onClick:()=>p(S.path),type:"button",children:"Delete"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--no",onClick:()=>x(null),type:"button",children:"Cancel"})]}):r.jsx("button",{className:"template-picker__recent-delete",onClick:()=>x(S.path),"aria-label":"Delete workflow",type:"button",children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},S.path)})})})]})}let ms;const j2=new Uint8Array(16);function C2(){if(!ms&&(ms=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ms))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ms(j2)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function M2(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const T2=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_h={randomUUID:T2};function bh(e,t,n){if(_h.randomUUID&&!e)return _h.randomUUID();e=e||{};const l=e.random||(e.rng||C2)();return l[6]=l[6]&15|64,l[8]=l[8]&63|128,M2(l)}function A2(e,t){const n=new Date().toISOString();switch(t.type){case"LOAD":return t.payload;case"SET_META":return{...e,meta:{...e.meta,...t.payload,updated:n}};case"ADD_NODE":{const l={id:`node-${bh().slice(0,8)}`,position:t.payload.position,exportedSlug:null,agent:t.payload.agent,agentRef:t.payload.agentRef};return{...e,nodes:[...e.nodes,l],meta:{...e.meta,updated:n}}}case"UPDATE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,agent:{...l.agent,...t.payload.agent},startTrigger:t.payload.startTrigger??l.startTrigger}:l)};case"MOVE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,position:t.payload.position}:l)};case"REMOVE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.filter(l=>l.id!==t.payload.nodeId),edges:e.edges.filter(l=>l.from!==t.payload.nodeId&&l.to!==t.payload.nodeId)};case"ADD_EDGE":return{...e,meta:{...e.meta,updated:n},edges:[...e.edges,{id:`edge-${bh().slice(0,8)}`,...t.payload}]};case"UPDATE_EDGE":{const{edgeId:l,...a}=t.payload;return{...e,meta:{...e.meta,updated:n},edges:e.edges.map(i=>i.id===l?{...i,...a}:i)}}case"REMOVE_EDGE":return{...e,meta:{...e.meta,updated:n},edges:e.edges.filter(l=>l.id!==t.payload.edgeId)};case"UPDATE_EXPORTED_SLUG":return{...e,nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,exportedSlug:t.payload.slug}:l)};default:return e}}function z2(){const e=new Date().toISOString();return{meta:{id:"",name:"Untitled Workflow",description:"",version:1,created:e,updated:e},nodes:[],edges:[]}}function D2(e){const[t,n]=T.useReducer(A2,e??z2());return{workflow:t,dispatch:n}}function k2(e,t,n){const l=T.useRef(null),a=T.useRef(""),i=T.useRef(n==null?void 0:n.onError),s=T.useRef(n==null?void 0:n.onSuccess),o=T.useRef(e),u=T.useRef(t),[c,h]=T.useState(!1),[d,f]=T.useState(!1);T.useEffect(()=>{i.current=n==null?void 0:n.onError,s.current=n==null?void 0:n.onSuccess,o.current=e,u.current=t});const g=T.useCallback(async()=>{var y,p;const x=u.current,b=o.current;if(!x)return;h(!0);let m=!1;try{await Me.workflows.save(x,b),m=!0}catch(_){throw(y=i.current)==null||y.call(i,_),_}finally{h(!1),f(!1)}m&&((p=s.current)==null||p.call(s))},[]),v=T.useCallback(async()=>{l.current&&(clearTimeout(l.current),l.current=null),await g()},[g]);return T.useEffect(()=>{if(!t)return;const x=JSON.stringify(e);if(x!==a.current)return a.current=x,l.current&&clearTimeout(l.current),f(!0),l.current=setTimeout(()=>{l.current=null,g().catch(()=>{})},500),()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[e,t,g]),{isSaving:c,isDirty:d||c,flush:v}}function _f(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function O2(e){var a;const t=[],n=[];if(e.nodes.length===0)return{errors:t,warnings:n,canExport:!1};const l=new Map;for(const i of e.nodes)if(!i.agent.name.trim())t.push({type:"missing-name",nodeId:i.id,message:"Agent needs a name before export"});else{!i.agentRef&&!((a=i.agent.completionCriteria)!=null&&a.trim())&&n.push({type:"missing-completion-criteria",nodeId:i.id,message:"Add completion criteria so the agent knows when to stop"});const s=i.agentRef??_f(i.agent.name),o=l.get(s)??[];l.set(s,[...o,i.id])}for(const[,i]of l)i.length>1&&i.forEach(s=>n.push({type:"duplicate-slug",nodeId:s,message:"Two agents produce the same filename — rename one"}));if(e.edges.length>0){const i=new Set(e.edges.filter(u=>u.to).map(u=>u.to)),s=new Set(e.edges.map(u=>u.from)),o=new Set(e.edges.filter(u=>u.to===null).map(u=>u.from));for(const u of e.nodes){const c=i.has(u.id),h=s.has(u.id),d=o.has(u.id);!c&&!h?n.push({type:"disconnected-node",nodeId:u.id,message:"This agent isn't connected to the workflow"}):!h&&!d&&n.push({type:"no-handoff",nodeId:u.id,message:"This agent has no handoff — add an arrow or mark it as a workflow end"})}}return{errors:t,warnings:n,canExport:t.length===0}}function He(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,l;n<e.length;n++)(l=He(e[n]))!==""&&(t+=(t&&" ")+l);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var H2={value:()=>{}};function Fo(){for(var e=0,t=arguments.length,n={},l;e<t;++e){if(!(l=arguments[e]+"")||l in n||/[\s.]/.test(l))throw new Error("illegal type: "+l);n[l]=[]}return new Ys(n)}function Ys(e){this._=e}function R2(e,t){return e.trim().split(/^|\s+/).map(function(n){var l="",a=n.indexOf(".");if(a>=0&&(l=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:l}})}Ys.prototype=Fo.prototype={constructor:Ys,on:function(e,t){var n=this._,l=R2(e+"",n),a,i=-1,s=l.length;if(arguments.length<2){for(;++i<s;)if((a=(e=l[i]).type)&&(a=L2(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=l[i]).type)n[a]=wh(n[a],e.name,t);else if(t==null)for(a in n)n[a]=wh(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ys(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),l=0,a,i;l<a;++l)n[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],l=0,a=i.length;l<a;++l)i[l].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var l=this._[e],a=0,i=l.length;a<i;++a)l[a].value.apply(t,n)}};function L2(e,t){for(var n=0,l=e.length,a;n<l;++n)if((a=e[n]).name===t)return a.value}function wh(e,t,n){for(var l=0,a=e.length;l<a;++l)if(e[l].name===t){e[l]=H2,e=e.slice(0,l).concat(e.slice(l+1));break}return n!=null&&e.push({name:t,value:n}),e}var lc="http://www.w3.org/1999/xhtml";const Sh={svg:"http://www.w3.org/2000/svg",xhtml:lc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Io(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Sh.hasOwnProperty(t)?{space:Sh[t],local:e}:e}function B2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lc&&t.documentElement.namespaceURI===lc?t.createElement(e):t.createElementNS(n,e)}}function U2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function z0(e){var t=Io(e);return(t.local?U2:B2)(t)}function Y2(){}function bf(e){return e==null?Y2:function(){return this.querySelector(e)}}function V2(e){typeof e!="function"&&(e=bf(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=new Array(s),u,c,h=0;h<s;++h)(u=i[h])&&(c=e.call(u,u.__data__,h,i))&&("__data__"in u&&(c.__data__=u.__data__),o[h]=c);return new yt(l,this._parents)}function X2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function q2(){return[]}function D0(e){return e==null?q2:function(){return this.querySelectorAll(e)}}function G2(e){return function(){return X2(e.apply(this,arguments))}}function $2(e){typeof e=="function"?e=G2(e):e=D0(e);for(var t=this._groups,n=t.length,l=[],a=[],i=0;i<n;++i)for(var s=t[i],o=s.length,u,c=0;c<o;++c)(u=s[c])&&(l.push(e.call(u,u.__data__,c,s)),a.push(u));return new yt(l,a)}function k0(e){return function(){return this.matches(e)}}function O0(e){return function(t){return t.matches(e)}}var Q2=Array.prototype.find;function Z2(e){return function(){return Q2.call(this.children,e)}}function K2(){return this.firstElementChild}function J2(e){return this.select(e==null?K2:Z2(typeof e=="function"?e:O0(e)))}var W2=Array.prototype.filter;function F2(){return Array.from(this.children)}function I2(e){return function(){return W2.call(this.children,e)}}function P2(e){return this.selectAll(e==null?F2:I2(typeof e=="function"?e:O0(e)))}function eb(e){typeof e!="function"&&(e=k0(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=[],u,c=0;c<s;++c)(u=i[c])&&e.call(u,u.__data__,c,i)&&o.push(u);return new yt(l,this._parents)}function H0(e){return new Array(e.length)}function tb(){return new yt(this._enter||this._groups.map(H0),this._parents)}function bo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bo.prototype={constructor:bo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function nb(e){return function(){return e}}function lb(e,t,n,l,a,i){for(var s=0,o,u=t.length,c=i.length;s<c;++s)(o=t[s])?(o.__data__=i[s],l[s]=o):n[s]=new bo(e,i[s]);for(;s<u;++s)(o=t[s])&&(a[s]=o)}function ab(e,t,n,l,a,i,s){var o,u,c=new Map,h=t.length,d=i.length,f=new Array(h),g;for(o=0;o<h;++o)(u=t[o])&&(f[o]=g=s.call(u,u.__data__,o,t)+"",c.has(g)?a[o]=u:c.set(g,u));for(o=0;o<d;++o)g=s.call(e,i[o],o,i)+"",(u=c.get(g))?(l[o]=u,u.__data__=i[o],c.delete(g)):n[o]=new bo(e,i[o]);for(o=0;o<h;++o)(u=t[o])&&c.get(f[o])===u&&(a[o]=u)}function ib(e){return e.__data__}function sb(e,t){if(!arguments.length)return Array.from(this,ib);var n=t?ab:lb,l=this._parents,a=this._groups;typeof e!="function"&&(e=nb(e));for(var i=a.length,s=new Array(i),o=new Array(i),u=new Array(i),c=0;c<i;++c){var h=l[c],d=a[c],f=d.length,g=ob(e.call(h,h&&h.__data__,c,l)),v=g.length,x=o[c]=new Array(v),b=s[c]=new Array(v),m=u[c]=new Array(f);n(h,d,x,b,m,g,t);for(var y=0,p=0,_,j;y<v;++y)if(_=x[y]){for(y>=p&&(p=y+1);!(j=b[p])&&++p<v;);_._next=j||null}}return s=new yt(s,l),s._enter=o,s._exit=u,s}function ob(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ub(){return new yt(this._exit||this._groups.map(H0),this._parents)}function rb(e,t,n){var l=this.enter(),a=this,i=this.exit();return typeof e=="function"?(l=e(l),l&&(l=l.selection())):l=l.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),l&&a?l.merge(a).order():a}function cb(e){for(var t=e.selection?e.selection():e,n=this._groups,l=t._groups,a=n.length,i=l.length,s=Math.min(a,i),o=new Array(a),u=0;u<s;++u)for(var c=n[u],h=l[u],d=c.length,f=o[u]=new Array(d),g,v=0;v<d;++v)(g=c[v]||h[v])&&(f[v]=g);for(;u<a;++u)o[u]=n[u];return new yt(o,this._parents)}function fb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var l=e[t],a=l.length-1,i=l[a],s;--a>=0;)(s=l[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function db(e){e||(e=hb);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,l=n.length,a=new Array(l),i=0;i<l;++i){for(var s=n[i],o=s.length,u=a[i]=new Array(o),c,h=0;h<o;++h)(c=s[h])&&(u[h]=c);u.sort(t)}return new yt(a,this._parents).order()}function hb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mb(){return Array.from(this)}function pb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var l=e[t],a=0,i=l.length;a<i;++a){var s=l[a];if(s)return s}return null}function yb(){let e=0;for(const t of this)++e;return e}function vb(){return!this.node()}function xb(e){for(var t=this._groups,n=0,l=t.length;n<l;++n)for(var a=t[n],i=0,s=a.length,o;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this}function _b(e){return function(){this.removeAttribute(e)}}function bb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wb(e,t){return function(){this.setAttribute(e,t)}}function Sb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Eb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Nb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jb(e,t){var n=Io(e);if(arguments.length<2){var l=this.node();return n.local?l.getAttributeNS(n.space,n.local):l.getAttribute(n)}return this.each((t==null?n.local?bb:_b:typeof t=="function"?n.local?Nb:Eb:n.local?Sb:wb)(n,t))}function R0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Cb(e){return function(){this.style.removeProperty(e)}}function Mb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Tb(e,t,n){return function(){var l=t.apply(this,arguments);l==null?this.style.removeProperty(e):this.style.setProperty(e,l,n)}}function Ab(e,t,n){return arguments.length>1?this.each((t==null?Cb:typeof t=="function"?Tb:Mb)(e,t,n??"")):fa(this.node(),e)}function fa(e,t){return e.style.getPropertyValue(t)||R0(e).getComputedStyle(e,null).getPropertyValue(t)}function zb(e){return function(){delete this[e]}}function Db(e,t){return function(){this[e]=t}}function kb(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ob(e,t){return arguments.length>1?this.each((t==null?zb:typeof t=="function"?kb:Db)(e,t)):this.node()[e]}function L0(e){return e.trim().split(/^|\s+/)}function wf(e){return e.classList||new B0(e)}function B0(e){this._node=e,this._names=L0(e.getAttribute("class")||"")}B0.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function U0(e,t){for(var n=wf(e),l=-1,a=t.length;++l<a;)n.add(t[l])}function Y0(e,t){for(var n=wf(e),l=-1,a=t.length;++l<a;)n.remove(t[l])}function Hb(e){return function(){U0(this,e)}}function Rb(e){return function(){Y0(this,e)}}function Lb(e,t){return function(){(t.apply(this,arguments)?U0:Y0)(this,e)}}function Bb(e,t){var n=L0(e+"");if(arguments.length<2){for(var l=wf(this.node()),a=-1,i=n.length;++a<i;)if(!l.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Lb:t?Hb:Rb)(n,t))}function Ub(){this.textContent=""}function Yb(e){return function(){this.textContent=e}}function Vb(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Xb(e){return arguments.length?this.each(e==null?Ub:(typeof e=="function"?Vb:Yb)(e)):this.node().textContent}function qb(){this.innerHTML=""}function Gb(e){return function(){this.innerHTML=e}}function $b(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qb(e){return arguments.length?this.each(e==null?qb:(typeof e=="function"?$b:Gb)(e)):this.node().innerHTML}function Zb(){this.nextSibling&&this.parentNode.appendChild(this)}function Kb(){return this.each(Zb)}function Jb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wb(){return this.each(Jb)}function Fb(e){var t=typeof e=="function"?e:z0(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ib(){return null}function Pb(e,t){var n=typeof e=="function"?e:z0(e),l=t==null?Ib:typeof t=="function"?t:bf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),l.apply(this,arguments)||null)})}function ew(){var e=this.parentNode;e&&e.removeChild(this)}function tw(){return this.each(ew)}function nw(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function aw(e){return this.select(e?lw:nw)}function iw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sw(e){return function(t){e.call(this,t,this.__data__)}}function ow(e){return e.trim().split(/^|\s+/).map(function(t){var n="",l=t.indexOf(".");return l>=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function uw(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++l]=i;++l?t.length=l:delete this.__on}}}function rw(e,t,n){return function(){var l=this.__on,a,i=sw(t);if(l){for(var s=0,o=l.length;s<o;++s)if((a=l[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},l?l.push(a):this.__on=[a]}}function cw(e,t,n){var l=ow(e+""),a,i=l.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,c=o.length,h;u<c;++u)for(a=0,h=o[u];a<i;++a)if((s=l[a]).type===h.type&&s.name===h.name)return h.value}return}for(o=t?rw:uw,a=0;a<i;++a)this.each(o(l[a],t,n));return this}function V0(e,t,n){var l=R0(e),a=l.CustomEvent;typeof a=="function"?a=new a(t,n):(a=l.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function fw(e,t){return function(){return V0(this,e,t)}}function dw(e,t){return function(){return V0(this,e,t.apply(this,arguments))}}function hw(e,t){return this.each((typeof t=="function"?dw:fw)(e,t))}function*gw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var l=e[t],a=0,i=l.length,s;a<i;++a)(s=l[a])&&(yield s)}var X0=[null];function yt(e,t){this._groups=e,this._parents=t}function $i(){return new yt([[document.documentElement]],X0)}function mw(){return this}yt.prototype=$i.prototype={constructor:yt,select:V2,selectAll:$2,selectChild:J2,selectChildren:P2,filter:eb,data:sb,enter:tb,exit:ub,join:rb,merge:cb,selection:mw,order:fb,sort:db,call:gb,nodes:mb,node:pb,size:yb,empty:vb,each:xb,attr:jb,style:Ab,property:Ob,classed:Bb,text:Xb,html:Qb,raise:Kb,lower:Wb,append:Fb,insert:Pb,remove:tw,clone:aw,datum:iw,on:cw,dispatch:hw,[Symbol.iterator]:gw};function rt(e){return typeof e=="string"?new yt([[document.querySelector(e)]],[document.documentElement]):new yt([[e]],X0)}function pw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function At(e,t){if(e=pw(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var l=n.createSVGPoint();return l.x=e.clientX,l.y=e.clientY,l=l.matrixTransform(t.getScreenCTM().inverse()),[l.x,l.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const yw={passive:!1},Ei={capture:!0,passive:!1};function Fu(e){e.stopImmediatePropagation()}function Il(e){e.preventDefault(),e.stopImmediatePropagation()}function q0(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",Il,Ei);"onselectstart"in t?n.on("selectstart.drag",Il,Ei):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function G0(e,t){var n=e.document.documentElement,l=rt(e).on("dragstart.drag",null);t&&(l.on("click.drag",Il,Ei),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in n?l.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ps=e=>()=>e;function ac(e,{sourceEvent:t,subject:n,target:l,identifier:a,active:i,x:s,y:o,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:l,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}ac.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vw(e){return!e.ctrlKey&&!e.button}function xw(){return this.parentNode}function _w(e,t){return t??{x:e.x,y:e.y}}function bw(){return navigator.maxTouchPoints||"ontouchstart"in this}function $0(){var e=vw,t=xw,n=_w,l=bw,a={},i=Fo("start","drag","end"),s=0,o,u,c,h,d=0;function f(_){_.on("mousedown.drag",g).filter(l).on("touchstart.drag",b).on("touchmove.drag",m,yw).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(_,j){if(!(h||!e.call(this,_,j))){var S=p(this,t.call(this,_,j),_,j,"mouse");S&&(rt(_.view).on("mousemove.drag",v,Ei).on("mouseup.drag",x,Ei),q0(_.view),Fu(_),c=!1,o=_.clientX,u=_.clientY,S("start",_))}}function v(_){if(Il(_),!c){var j=_.clientX-o,S=_.clientY-u;c=j*j+S*S>d}a.mouse("drag",_)}function x(_){rt(_.view).on("mousemove.drag mouseup.drag",null),G0(_.view,c),Il(_),a.mouse("end",_)}function b(_,j){if(e.call(this,_,j)){var S=_.changedTouches,w=t.call(this,_,j),E=S.length,M,R;for(M=0;M<E;++M)(R=p(this,w,_,j,S[M].identifier,S[M]))&&(Fu(_),R("start",_,S[M]))}}function m(_){var j=_.changedTouches,S=j.length,w,E;for(w=0;w<S;++w)(E=a[j[w].identifier])&&(Il(_),E("drag",_,j[w]))}function y(_){var j=_.changedTouches,S=j.length,w,E;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),w=0;w<S;++w)(E=a[j[w].identifier])&&(Fu(_),E("end",_,j[w]))}function p(_,j,S,w,E,M){var R=i.copy(),k=At(M||S,j),O,Y,C;if((C=n.call(_,new ac("beforestart",{sourceEvent:S,target:f,identifier:E,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:R}),w))!=null)return O=C.x-k[0]||0,Y=C.y-k[1]||0,function H(N,z,A){var D=k,B;switch(N){case"start":a[E]=H,B=s++;break;case"end":delete a[E],--s;case"drag":k=At(A||z,j),B=s;break}R.call(N,_,new ac(N,{sourceEvent:z,subject:C,target:f,identifier:E,active:B,x:k[0]+O,y:k[1]+Y,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:R}),w)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ps(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:ps(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:ps(_),f):n},f.touchable=function(_){return arguments.length?(l=typeof _=="function"?_:ps(!!_),f):l},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Sf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Q0(e,t){var n=Object.create(e.prototype);for(var l in t)n[l]=t[l];return n}function Qi(){}var Ni=.7,wo=1/Ni,Pl="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ww=/^#([0-9a-f]{3,8})$/,Sw=new RegExp(`^rgb\\(${Pl},${Pl},${Pl}\\)$`),Ew=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),Nw=new RegExp(`^rgba\\(${Pl},${Pl},${Pl},${ji}\\)$`),jw=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${ji}\\)$`),Cw=new RegExp(`^hsl\\(${ji},${Vt},${Vt}\\)$`),Mw=new RegExp(`^hsla\\(${ji},${Vt},${Vt},${ji}\\)$`),Eh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sf(Qi,ml,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nh,formatHex:Nh,formatHex8:Tw,formatHsl:Aw,formatRgb:jh,toString:jh});function Nh(){return this.rgb().formatHex()}function Tw(){return this.rgb().formatHex8()}function Aw(){return Z0(this).formatHsl()}function jh(){return this.rgb().formatRgb()}function ml(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ww.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ch(t):n===3?new nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ys(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ys(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Sw.exec(e))?new nt(t[1],t[2],t[3],1):(t=Ew.exec(e))?new nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nw.exec(e))?ys(t[1],t[2],t[3],t[4]):(t=jw.exec(e))?ys(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Cw.exec(e))?Ah(t[1],t[2]/100,t[3]/100,1):(t=Mw.exec(e))?Ah(t[1],t[2]/100,t[3]/100,t[4]):Eh.hasOwnProperty(e)?Ch(Eh[e]):e==="transparent"?new nt(NaN,NaN,NaN,0):null}function Ch(e){return new nt(e>>16&255,e>>8&255,e&255,1)}function ys(e,t,n,l){return l<=0&&(e=t=n=NaN),new nt(e,t,n,l)}function zw(e){return e instanceof Qi||(e=ml(e)),e?(e=e.rgb(),new nt(e.r,e.g,e.b,e.opacity)):new nt}function ic(e,t,n,l){return arguments.length===1?zw(e):new nt(e,t,n,l??1)}function nt(e,t,n,l){this.r=+e,this.g=+t,this.b=+n,this.opacity=+l}Sf(nt,ic,Q0(Qi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nt(ul(this.r),ul(this.g),ul(this.b),So(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:Mh,formatHex:Mh,formatHex8:Dw,formatRgb:Th,toString:Th}));function Mh(){return`#${nl(this.r)}${nl(this.g)}${nl(this.b)}`}function Dw(){return`#${nl(this.r)}${nl(this.g)}${nl(this.b)}${nl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Th(){const e=So(this.opacity);return`${e===1?"rgb(":"rgba("}${ul(this.r)}, ${ul(this.g)}, ${ul(this.b)}${e===1?")":`, ${e})`}`}function So(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ul(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nl(e){return e=ul(e),(e<16?"0":"")+e.toString(16)}function Ah(e,t,n,l){return l<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zt(e,t,n,l)}function Z0(e){if(e instanceof zt)return new zt(e.h,e.s,e.l,e.opacity);if(e instanceof Qi||(e=ml(e)),!e)return new zt;if(e instanceof zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,l=e.b/255,a=Math.min(t,n,l),i=Math.max(t,n,l),s=NaN,o=i-a,u=(i+a)/2;return o?(t===i?s=(n-l)/o+(n<l)*6:n===i?s=(l-t)/o+2:s=(t-n)/o+4,o/=u<.5?i+a:2-i-a,s*=60):o=u>0&&u<1?0:s,new zt(s,o,u,e.opacity)}function kw(e,t,n,l){return arguments.length===1?Z0(e):new zt(e,t,n,l??1)}function zt(e,t,n,l){this.h=+e,this.s=+t,this.l=+n,this.opacity=+l}Sf(zt,kw,Q0(Qi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new zt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,l=n+(n<.5?n:1-n)*t,a=2*n-l;return new nt(Iu(e>=240?e-240:e+120,a,l),Iu(e,a,l),Iu(e<120?e+240:e-120,a,l),this.opacity)},clamp(){return new zt(zh(this.h),vs(this.s),vs(this.l),So(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=So(this.opacity);return`${e===1?"hsl(":"hsla("}${zh(this.h)}, ${vs(this.s)*100}%, ${vs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zh(e){return e=(e||0)%360,e<0?e+360:e}function vs(e){return Math.max(0,Math.min(1,e||0))}function Iu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ef=e=>()=>e;function Ow(e,t){return function(n){return e+n*t}}function Hw(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(l){return Math.pow(e+l*t,n)}}function Rw(e){return(e=+e)==1?K0:function(t,n){return n-t?Hw(t,n,e):Ef(isNaN(t)?n:t)}}function K0(e,t){var n=t-e;return n?Ow(e,n):Ef(isNaN(e)?t:e)}const Eo=function e(t){var n=Rw(t);function l(a,i){var s=n((a=ic(a)).r,(i=ic(i)).r),o=n(a.g,i.g),u=n(a.b,i.b),c=K0(a.opacity,i.opacity);return function(h){return a.r=s(h),a.g=o(h),a.b=u(h),a.opacity=c(h),a+""}}return l.gamma=e,l}(1);function Lw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,l=t.slice(),a;return function(i){for(a=0;a<n;++a)l[a]=e[a]*(1-i)+t[a]*i;return l}}function Bw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uw(e,t){var n=t?t.length:0,l=e?Math.min(n,e.length):0,a=new Array(l),i=new Array(n),s;for(s=0;s<l;++s)a[s]=ui(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(o){for(s=0;s<l;++s)i[s]=a[s](o);return i}}function Yw(e,t){var n=new Date;return e=+e,t=+t,function(l){return n.setTime(e*(1-l)+t*l),n}}function Rt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vw(e,t){var n={},l={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=ui(e[a],t[a]):l[a]=t[a];return function(i){for(a in n)l[a]=n[a](i);return l}}var sc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pu=new RegExp(sc.source,"g");function Xw(e){return function(){return e}}function qw(e){return function(t){return e(t)+""}}function J0(e,t){var n=sc.lastIndex=Pu.lastIndex=0,l,a,i,s=-1,o=[],u=[];for(e=e+"",t=t+"";(l=sc.exec(e))&&(a=Pu.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),o[s]?o[s]+=i:o[++s]=i),(l=l[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,u.push({i:s,x:Rt(l,a)})),n=Pu.lastIndex;return n<t.length&&(i=t.slice(n),o[s]?o[s]+=i:o[++s]=i),o.length<2?u[0]?qw(u[0].x):Xw(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)o[(d=u[h]).i]=d.x(c);return o.join("")})}function ui(e,t){var n=typeof t,l;return t==null||n==="boolean"?Ef(t):(n==="number"?Rt:n==="string"?(l=ml(t))?(t=l,Eo):J0:t instanceof ml?Eo:t instanceof Date?Yw:Bw(t)?Lw:Array.isArray(t)?Uw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vw:Rt)(e,t)}var Dh=180/Math.PI,oc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function W0(e,t,n,l,a,i){var s,o,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*l)&&(n-=e*u,l-=t*u),(o=Math.sqrt(n*n+l*l))&&(n/=o,l/=o,u/=o),e*l<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*Dh,skewX:Math.atan(u)*Dh,scaleX:s,scaleY:o}}var xs;function Gw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oc:W0(t.a,t.b,t.c,t.d,t.e,t.f)}function $w(e){return e==null||(xs||(xs=document.createElementNS("http://www.w3.org/2000/svg","g")),xs.setAttribute("transform",e),!(e=xs.transform.baseVal.consolidate()))?oc:(e=e.matrix,W0(e.a,e.b,e.c,e.d,e.e,e.f))}function F0(e,t,n,l){function a(c){return c.length?c.pop()+" ":""}function i(c,h,d,f,g,v){if(c!==d||h!==f){var x=g.push("translate(",null,t,null,n);v.push({i:x-4,x:Rt(c,d)},{i:x-2,x:Rt(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(a(d)+"rotate(",null,l)-2,x:Rt(c,h)})):h&&d.push(a(d)+"rotate("+h+l)}function o(c,h,d,f){c!==h?f.push({i:d.push(a(d)+"skewX(",null,l)-2,x:Rt(c,h)}):h&&d.push(a(d)+"skewX("+h+l)}function u(c,h,d,f,g,v){if(c!==d||h!==f){var x=g.push(a(g)+"scale(",null,",",null,")");v.push({i:x-4,x:Rt(c,d)},{i:x-2,x:Rt(h,f)})}else(d!==1||f!==1)&&g.push(a(g)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),i(c.translateX,c.translateY,h.translateX,h.translateY,d,f),s(c.rotate,h.rotate,d,f),o(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(g){for(var v=-1,x=f.length,b;++v<x;)d[(b=f[v]).i]=b.x(g);return d.join("")}}}var Qw=F0(Gw,"px, ","px)","deg)"),Zw=F0($w,", ",")",")"),Kw=1e-12;function kh(e){return((e=Math.exp(e))+1/e)/2}function Jw(e){return((e=Math.exp(e))-1/e)/2}function Ww(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vs=function e(t,n,l){function a(i,s){var o=i[0],u=i[1],c=i[2],h=s[0],d=s[1],f=s[2],g=h-o,v=d-u,x=g*g+v*v,b,m;if(x<Kw)m=Math.log(f/c)/t,b=function(w){return[o+w*g,u+w*v,c*Math.exp(t*w*m)]};else{var y=Math.sqrt(x),p=(f*f-c*c+l*x)/(2*c*n*y),_=(f*f-c*c-l*x)/(2*f*n*y),j=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(_*_+1)-_);m=(S-j)/t,b=function(w){var E=w*m,M=kh(j),R=c/(n*y)*(M*Ww(t*E+j)-Jw(j));return[o+R*g,u+R*v,c*M/kh(t*E+j)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return a.rho=function(i){var s=Math.max(.001,+i),o=s*s,u=o*o;return e(s,o,u)},a}(Math.SQRT2,2,4);var da=0,Qa=0,Ua=0,I0=1e3,No,Za,jo=0,pl=0,Po=0,Ci=typeof performance=="object"&&performance.now?performance:Date,P0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nf(){return pl||(P0(Fw),pl=Ci.now()+Po)}function Fw(){pl=0}function Co(){this._call=this._time=this._next=null}Co.prototype=ey.prototype={constructor:Co,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nf():+n)+(t==null?0:+t),!this._next&&Za!==this&&(Za?Za._next=this:No=this,Za=this),this._call=e,this._time=n,uc()},stop:function(){this._call&&(this._call=null,this._time=1/0,uc())}};function ey(e,t,n){var l=new Co;return l.restart(e,t,n),l}function Iw(){Nf(),++da;for(var e=No,t;e;)(t=pl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--da}function Oh(){pl=(jo=Ci.now())+Po,da=Qa=0;try{Iw()}finally{da=0,eS(),pl=0}}function Pw(){var e=Ci.now(),t=e-jo;t>I0&&(Po-=t,jo=e)}function eS(){for(var e,t=No,n,l=1/0;t;)t._call?(l>t._time&&(l=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:No=n);Za=e,uc(l)}function uc(e){if(!da){Qa&&(Qa=clearTimeout(Qa));var t=e-pl;t>24?(e<1/0&&(Qa=setTimeout(Oh,e-Ci.now()-Po)),Ua&&(Ua=clearInterval(Ua))):(Ua||(jo=Ci.now(),Ua=setInterval(Pw,I0)),da=1,P0(Oh))}}function Hh(e,t,n){var l=new Co;return t=t==null?0:+t,l.restart(a=>{l.stop(),e(a+t)},t,n),l}var tS=Fo("start","end","cancel","interrupt"),nS=[],ty=0,Rh=1,rc=2,Xs=3,Lh=4,cc=5,qs=6;function eu(e,t,n,l,a,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;lS(e,n,{name:t,index:l,group:a,on:tS,tween:nS,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ty})}function jf(e,t){var n=Ht(e,t);if(n.state>ty)throw new Error("too late; already scheduled");return n}function $t(e,t){var n=Ht(e,t);if(n.state>Xs)throw new Error("too late; already running");return n}function Ht(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lS(e,t,n){var l=e.__transition,a;l[t]=n,n.timer=ey(i,0,n.time);function i(c){n.state=Rh,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var h,d,f,g;if(n.state!==Rh)return u();for(h in l)if(g=l[h],g.name===n.name){if(g.state===Xs)return Hh(s);g.state===Lh?(g.state=qs,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete l[h]):+h<t&&(g.state=qs,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete l[h])}if(Hh(function(){n.state===Xs&&(n.state=Lh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=rc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===rc){for(n.state=Xs,a=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=g);a.length=d+1}}function o(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=cc,1),d=-1,f=a.length;++d<f;)a[d].call(e,h);n.state===cc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=qs,n.timer.stop(),delete l[t];for(var c in l)return;delete e.__transition}}function Gs(e,t){var n=e.__transition,l,a,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((l=n[s]).name!==t){i=!1;continue}a=l.state>rc&&l.state<cc,l.state=qs,l.timer.stop(),l.on.call(a?"interrupt":"cancel",e,e.__data__,l.index,l.group),delete n[s]}i&&delete e.__transition}}function aS(e){return this.each(function(){Gs(this,e)})}function iS(e,t){var n,l;return function(){var a=$t(this,e),i=a.tween;if(i!==n){l=n=i;for(var s=0,o=l.length;s<o;++s)if(l[s].name===t){l=l.slice(),l.splice(s,1);break}}a.tween=l}}function sS(e,t,n){var l,a;if(typeof n!="function")throw new Error;return function(){var i=$t(this,e),s=i.tween;if(s!==l){a=(l=s).slice();for(var o={name:t,value:n},u=0,c=a.length;u<c;++u)if(a[u].name===t){a[u]=o;break}u===c&&a.push(o)}i.tween=a}}function oS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var l=Ht(this.node(),n).tween,a=0,i=l.length,s;a<i;++a)if((s=l[a]).name===e)return s.value;return null}return this.each((t==null?iS:sS)(n,e,t))}function Cf(e,t,n){var l=e._id;return e.each(function(){var a=$t(this,l);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Ht(a,l).value[t]}}function ny(e,t){var n;return(typeof t=="number"?Rt:t instanceof ml?Eo:(n=ml(t))?(t=n,Eo):J0)(e,t)}function uS(e){return function(){this.removeAttribute(e)}}function rS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cS(e,t,n){var l,a=n+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===l?i:i=t(l=s,n)}}function fS(e,t,n){var l,a=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===l?i:i=t(l=s,n)}}function dS(e,t,n){var l,a,i;return function(){var s,o=n(this),u;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=o+"",s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o)))}}function hS(e,t,n){var l,a,i;return function(){var s,o=n(this),u;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=o+"",s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o)))}}function gS(e,t){var n=Io(e),l=n==="transform"?Zw:ny;return this.attrTween(e,typeof t=="function"?(n.local?hS:dS)(n,l,Cf(this,"attr."+e,t)):t==null?(n.local?rS:uS)(n):(n.local?fS:cS)(n,l,t))}function mS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yS(e,t){var n,l;function a(){var i=t.apply(this,arguments);return i!==l&&(n=(l=i)&&pS(e,i)),n}return a._value=t,a}function vS(e,t){var n,l;function a(){var i=t.apply(this,arguments);return i!==l&&(n=(l=i)&&mS(e,i)),n}return a._value=t,a}function xS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var l=Io(e);return this.tween(n,(l.local?yS:vS)(l,t))}function _S(e,t){return function(){jf(this,e).delay=+t.apply(this,arguments)}}function bS(e,t){return t=+t,function(){jf(this,e).delay=t}}function wS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_S:bS)(t,e)):Ht(this.node(),t).delay}function SS(e,t){return function(){$t(this,e).duration=+t.apply(this,arguments)}}function ES(e,t){return t=+t,function(){$t(this,e).duration=t}}function NS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?SS:ES)(t,e)):Ht(this.node(),t).duration}function jS(e,t){if(typeof t!="function")throw new Error;return function(){$t(this,e).ease=t}}function CS(e){var t=this._id;return arguments.length?this.each(jS(t,e)):Ht(this.node(),t).ease}function MS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$t(this,e).ease=n}}function TS(e){if(typeof e!="function")throw new Error;return this.each(MS(this._id,e))}function AS(e){typeof e!="function"&&(e=k0(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=[],u,c=0;c<s;++c)(u=i[c])&&e.call(u,u.__data__,c,i)&&o.push(u);return new gn(l,this._parents,this._name,this._id)}function zS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,l=t.length,a=n.length,i=Math.min(l,a),s=new Array(l),o=0;o<i;++o)for(var u=t[o],c=n[o],h=u.length,d=s[o]=new Array(h),f,g=0;g<h;++g)(f=u[g]||c[g])&&(d[g]=f);for(;o<l;++o)s[o]=t[o];return new gn(s,this._parents,this._name,this._id)}function DS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function kS(e,t,n){var l,a,i=DS(t)?jf:$t;return function(){var s=i(this,e),o=s.on;o!==l&&(a=(l=o).copy()).on(t,n),s.on=a}}function OS(e,t){var n=this._id;return arguments.length<2?Ht(this.node(),n).on.on(e):this.each(kS(n,e,t))}function HS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RS(){return this.on("end.remove",HS(this._id))}function LS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bf(e));for(var l=this._groups,a=l.length,i=new Array(a),s=0;s<a;++s)for(var o=l[s],u=o.length,c=i[s]=new Array(u),h,d,f=0;f<u;++f)(h=o[f])&&(d=e.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,eu(c[f],t,n,f,c,Ht(h,n)));return new gn(i,this._parents,t,n)}function BS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=D0(e));for(var l=this._groups,a=l.length,i=[],s=[],o=0;o<a;++o)for(var u=l[o],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),g,v=Ht(h,n),x=0,b=f.length;x<b;++x)(g=f[x])&&eu(g,t,n,x,f,v);i.push(f),s.push(h)}return new gn(i,s,t,n)}var US=$i.prototype.constructor;function YS(){return new US(this._groups,this._parents)}function VS(e,t){var n,l,a;return function(){var i=fa(this,e),s=(this.style.removeProperty(e),fa(this,e));return i===s?null:i===n&&s===l?a:a=t(n=i,l=s)}}function ly(e){return function(){this.style.removeProperty(e)}}function XS(e,t,n){var l,a=n+"",i;return function(){var s=fa(this,e);return s===a?null:s===l?i:i=t(l=s,n)}}function qS(e,t,n){var l,a,i;return function(){var s=fa(this,e),o=n(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(e),fa(this,e))),s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o))}}function GS(e,t){var n,l,a,i="style."+t,s="end."+i,o;return function(){var u=$t(this,e),c=u.on,h=u.value[i]==null?o||(o=ly(t)):void 0;(c!==n||a!==h)&&(l=(n=c).copy()).on(s,a=h),u.on=l}}function $S(e,t,n){var l=(e+="")=="transform"?Qw:ny;return t==null?this.styleTween(e,VS(e,l)).on("end.style."+e,ly(e)):typeof t=="function"?this.styleTween(e,qS(e,l,Cf(this,"style."+e,t))).each(GS(this._id,e)):this.styleTween(e,XS(e,l,t),n).on("end.style."+e,null)}function QS(e,t,n){return function(l){this.style.setProperty(e,t.call(this,l),n)}}function ZS(e,t,n){var l,a;function i(){var s=t.apply(this,arguments);return s!==a&&(l=(a=s)&&QS(e,s,n)),l}return i._value=t,i}function KS(e,t,n){var l="style."+(e+="");if(arguments.length<2)return(l=this.tween(l))&&l._value;if(t==null)return this.tween(l,null);if(typeof t!="function")throw new Error;return this.tween(l,ZS(e,t,n??""))}function JS(e){return function(){this.textContent=e}}function WS(e){return function(){var t=e(this);this.textContent=t??""}}function FS(e){return this.tween("text",typeof e=="function"?WS(Cf(this,"text",e)):JS(e==null?"":e+""))}function IS(e){return function(t){this.textContent=e.call(this,t)}}function PS(e){var t,n;function l(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&IS(a)),t}return l._value=e,l}function eE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,PS(e))}function tE(){for(var e=this._name,t=this._id,n=ay(),l=this._groups,a=l.length,i=0;i<a;++i)for(var s=l[i],o=s.length,u,c=0;c<o;++c)if(u=s[c]){var h=Ht(u,t);eu(u,e,n,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gn(l,this._parents,e,n)}function nE(){var e,t,n=this,l=n._id,a=n.size();return new Promise(function(i,s){var o={value:s},u={value:function(){--a===0&&i()}};n.each(function(){var c=$t(this,l),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(u)),c.on=t}),a===0&&i()})}var lE=0;function gn(e,t,n,l){this._groups=e,this._parents=t,this._name=n,this._id=l}function ay(){return++lE}var Ft=$i.prototype;gn.prototype={constructor:gn,select:LS,selectAll:BS,selectChild:Ft.selectChild,selectChildren:Ft.selectChildren,filter:AS,merge:zS,selection:YS,transition:tE,call:Ft.call,nodes:Ft.nodes,node:Ft.node,size:Ft.size,empty:Ft.empty,each:Ft.each,on:OS,attr:gS,attrTween:xS,style:$S,styleTween:KS,text:FS,textTween:eE,remove:RS,tween:oS,delay:wS,duration:NS,ease:CS,easeVarying:TS,end:nE,[Symbol.iterator]:Ft[Symbol.iterator]};function aE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var iE={time:null,delay:0,duration:250,ease:aE};function sE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function oE(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=ay(),(n=iE).time=Nf(),e=e==null?null:e+"");for(var l=this._groups,a=l.length,i=0;i<a;++i)for(var s=l[i],o=s.length,u,c=0;c<o;++c)(u=s[c])&&eu(u,e,t,c,s,n||sE(u,t));return new gn(l,this._parents,e,t)}$i.prototype.interrupt=aS;$i.prototype.transition=oE;const _s=e=>()=>e;function uE(e,{sourceEvent:t,target:n,transform:l,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:l,enumerable:!0,configurable:!0},_:{value:a}})}function an(e,t,n){this.k=e,this.x=t,this.y=n}an.prototype={constructor:an,scale:function(e){return e===1?this:new an(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new an(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tu=new an(1,0,0);iy.prototype=an.prototype;function iy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tu;return e.__zoom}function er(e){e.stopImmediatePropagation()}function Ya(e){e.preventDefault(),e.stopImmediatePropagation()}function rE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function cE(){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 Bh(){return this.__zoom||tu}function fE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dE(){return navigator.maxTouchPoints||"ontouchstart"in this}function hE(e,t,n){var l=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(a>l?(l+a)/2:Math.min(0,l)||Math.max(0,a),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function sy(){var e=rE,t=cE,n=hE,l=fE,a=dE,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],o=250,u=Vs,c=Fo("start","zoom","end"),h,d,f,g=500,v=150,x=0,b=10;function m(C){C.property("__zoom",Bh).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",R).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(C,H,N,z){var A=C.selection?C.selection():C;A.property("__zoom",Bh),C!==A?j(C,H,N,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(C,H,N,z){m.scaleTo(C,function(){var A=this.__zoom.k,D=typeof H=="function"?H.apply(this,arguments):H;return A*D},N,z)},m.scaleTo=function(C,H,N,z){m.transform(C,function(){var A=t.apply(this,arguments),D=this.__zoom,B=N==null?_(A):typeof N=="function"?N.apply(this,arguments):N,L=D.invert(B),U=typeof H=="function"?H.apply(this,arguments):H;return n(p(y(D,U),B,L),A,s)},N,z)},m.translateBy=function(C,H,N,z){m.transform(C,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,z)},m.translateTo=function(C,H,N,z,A){m.transform(C,function(){var D=t.apply(this,arguments),B=this.__zoom,L=z==null?_(D):typeof z=="function"?z.apply(this,arguments):z;return n(tu.translate(L[0],L[1]).scale(B.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof N=="function"?-N.apply(this,arguments):-N),D,s)},z,A)};function y(C,H){return H=Math.max(i[0],Math.min(i[1],H)),H===C.k?C:new an(H,C.x,C.y)}function p(C,H,N){var z=H[0]-N[0]*C.k,A=H[1]-N[1]*C.k;return z===C.x&&A===C.y?C:new an(C.k,z,A)}function _(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function j(C,H,N,z){C.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,D=arguments,B=S(A,D).event(z),L=t.apply(A,D),U=N==null?_(L):typeof N=="function"?N.apply(A,D):N,G=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),q=A.__zoom,$=typeof H=="function"?H.apply(A,D):H,W=u(q.invert(U).concat(G/q.k),$.invert(U).concat(G/$.k));return function(K){if(K===1)K=$;else{var X=W(K),Z=G/X[2];K=new an(Z,U[0]-X[0]*Z,U[1]-X[1]*Z)}B.zoom(null,K)}})}function S(C,H,N){return!N&&C.__zooming||new w(C,H)}function w(C,H){this.that=C,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,H),this.taps=0}w.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,H){return this.mouse&&C!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var H=rt(this.that).datum();c.call(C,this.that,new uE(C,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),H)}};function E(C,...H){if(!e.apply(this,arguments))return;var N=S(this,H).event(C),z=this.__zoom,A=Math.max(i[0],Math.min(i[1],z.k*Math.pow(2,l.apply(this,arguments)))),D=At(C);if(N.wheel)(N.mouse[0][0]!==D[0]||N.mouse[0][1]!==D[1])&&(N.mouse[1]=z.invert(N.mouse[0]=D)),clearTimeout(N.wheel);else{if(z.k===A)return;N.mouse=[D,z.invert(D)],Gs(this),N.start()}Ya(C),N.wheel=setTimeout(B,v),N.zoom("mouse",n(p(y(z,A),N.mouse[0],N.mouse[1]),N.extent,s));function B(){N.wheel=null,N.end()}}function M(C,...H){if(f||!e.apply(this,arguments))return;var N=C.currentTarget,z=S(this,H,!0).event(C),A=rt(C.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),D=At(C,N),B=C.clientX,L=C.clientY;q0(C.view),er(C),z.mouse=[D,this.__zoom.invert(D)],Gs(this),z.start();function U(q){if(Ya(q),!z.moved){var $=q.clientX-B,W=q.clientY-L;z.moved=$*$+W*W>x}z.event(q).zoom("mouse",n(p(z.that.__zoom,z.mouse[0]=At(q,N),z.mouse[1]),z.extent,s))}function G(q){A.on("mousemove.zoom mouseup.zoom",null),G0(q.view,z.moved),Ya(q),z.event(q).end()}}function R(C,...H){if(e.apply(this,arguments)){var N=this.__zoom,z=At(C.changedTouches?C.changedTouches[0]:C,this),A=N.invert(z),D=N.k*(C.shiftKey?.5:2),B=n(p(y(N,D),z,A),t.apply(this,H),s);Ya(C),o>0?rt(this).transition().duration(o).call(j,B,z,C):rt(this).call(m.transform,B,z,C)}}function k(C,...H){if(e.apply(this,arguments)){var N=C.touches,z=N.length,A=S(this,H,C.changedTouches.length===z).event(C),D,B,L,U;for(er(C),B=0;B<z;++B)L=N[B],U=At(L,this),U=[U,this.__zoom.invert(U),L.identifier],A.touch0?!A.touch1&&A.touch0[2]!==U[2]&&(A.touch1=U,A.taps=0):(A.touch0=U,D=!0,A.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(A.taps<2&&(d=U[0],h=setTimeout(function(){h=null},g)),Gs(this),A.start())}}function O(C,...H){if(this.__zooming){var N=S(this,H).event(C),z=C.changedTouches,A=z.length,D,B,L,U;for(Ya(C),D=0;D<A;++D)B=z[D],L=At(B,this),N.touch0&&N.touch0[2]===B.identifier?N.touch0[0]=L:N.touch1&&N.touch1[2]===B.identifier&&(N.touch1[0]=L);if(B=N.that.__zoom,N.touch1){var G=N.touch0[0],q=N.touch0[1],$=N.touch1[0],W=N.touch1[1],K=(K=$[0]-G[0])*K+(K=$[1]-G[1])*K,X=(X=W[0]-q[0])*X+(X=W[1]-q[1])*X;B=y(B,Math.sqrt(K/X)),L=[(G[0]+$[0])/2,(G[1]+$[1])/2],U=[(q[0]+W[0])/2,(q[1]+W[1])/2]}else if(N.touch0)L=N.touch0[0],U=N.touch0[1];else return;N.zoom("touch",n(p(B,L,U),N.extent,s))}}function Y(C,...H){if(this.__zooming){var N=S(this,H).event(C),z=C.changedTouches,A=z.length,D,B;for(er(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),D=0;D<A;++D)B=z[D],N.touch0&&N.touch0[2]===B.identifier?delete N.touch0:N.touch1&&N.touch1[2]===B.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(B=At(B,this),Math.hypot(d[0]-B[0],d[1]-B[1])<b)){var L=rt(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(C){return arguments.length?(l=typeof C=="function"?C:_s(+C),m):l},m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:_s(!!C),m):e},m.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:_s(!!C),m):a},m.extent=function(C){return arguments.length?(t=typeof C=="function"?C:_s([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),m):t},m.scaleExtent=function(C){return arguments.length?(i[0]=+C[0],i[1]=+C[1],m):[i[0],i[1]]},m.translateExtent=function(C){return arguments.length?(s[0][0]=+C[0][0],s[1][0]=+C[1][0],s[0][1]=+C[0][1],s[1][1]=+C[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(C){return arguments.length?(n=C,m):n},m.duration=function(C){return arguments.length?(o=+C,m):o},m.interpolate=function(C){return arguments.length?(u=C,m):u},m.on=function(){var C=c.on.apply(c,arguments);return C===c?m:C},m.clickDistance=function(C){return arguments.length?(x=(C=+C)*C,m):Math.sqrt(x)},m.tapDistance=function(C){return arguments.length?(b=+C,m):b},m}const Xt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:l})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:l}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Mi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],oy=["Enter"," ","Escape"],uy={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ha;(function(e){e.Strict="strict",e.Loose="loose"})(ha||(ha={}));var rl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rl||(rl={}));var Ti;(function(e){e.Partial="partial",e.Full="full"})(Ti||(Ti={}));const ry={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Cn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Cn||(Cn={}));var Mo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Mo||(Mo={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Uh={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function cy(e){return e===null?null:e?"valid":"invalid"}const fy=e=>"id"in e&&"source"in e&&"target"in e,gE=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zi=(e,t=[0,0])=>{const{width:n,height:l}=pn(e),a=e.origin??t,i=n*a[0],s=l*a[1];return{x:e.position.x-i,y:e.position.y-s}},mE=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((l,a)=>{const i=typeof a=="string";let s=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(a):Mf(a)?a:t.nodeLookup.get(a.id));const o=s?To(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return nu(l,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return lu(n)},Ki=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},l=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=nu(n,To(a)),l=!0)}),l?lu(n):{x:0,y:0,width:0,height:0}},Tf=(e,t,[n,l,a]=[0,0,1],i=!1,s=!1)=>{const o={...Wi(t,[n,l,a]),width:t.width/a,height:t.height/a},u=[];for(const c of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=c;if(s&&!d||f)continue;const g=h.width??c.width??c.initialWidth??null,v=h.height??c.height??c.initialHeight??null,x=Ai(o,ma(c)),b=(g??0)*(v??0),m=i&&x>0;(!c.internals.handleBounds||m||x>=b||c.dragging)&&u.push(c)}return u},pE=(e,t)=>{const n=new Set;return e.forEach(l=>{n.add(l.id)}),t.filter(l=>n.has(l.source)||n.has(l.target))};function yE(e,t){const n=new Map,l=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!l||l.has(a.id))&&n.set(a.id,a)}),n}async function vE({nodes:e,width:t,height:n,panZoom:l,minZoom:a,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const o=yE(e,s),u=Ki(o),c=Af(u,t,n,(s==null?void 0:s.minZoom)??a,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await l.setViewport(c,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function dy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:l=[0,0],nodeExtent:a,onError:i}){const s=n.get(e),o=s.parentId?n.get(s.parentId):void 0,{x:u,y:c}=o?o.internals.positionAbsolute:{x:0,y:0},h=s.origin??l;let d=s.extent||a;if(s.extent==="parent"&&!s.expandParent)if(!o)i==null||i("005",Xt.error005());else{const g=o.measured.width,v=o.measured.height;g&&v&&(d=[[u,c],[u+g,c+v]])}else o&&pa(s.extent)&&(d=[[s.extent[0][0]+u,s.extent[0][1]+c],[s.extent[1][0]+u,s.extent[1][1]+c]]);const f=pa(d)?yl(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Xt.error015())),{position:{x:f.x-u+(s.measured.width??0)*h[0],y:f.y-c+(s.measured.height??0)*h[1]},positionAbsolute:f}}async function xE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:l,onBeforeDelete:a}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),v=!g&&f.parentId&&s.find(x=>x.id===f.parentId);(g||v)&&s.push(f)}const o=new Set(t.map(f=>f.id)),u=l.filter(f=>f.deletable!==!1),h=pE(s,u);for(const f of u)o.has(f.id)&&!h.find(v=>v.id===f.id)&&h.push(f);if(!a)return{edges:h,nodes:s};const d=await a({nodes:s,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:s}:{edges:[],nodes:[]}:d}const ga=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),yl=(e={x:0,y:0},t,n)=>({x:ga(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ga(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function hy(e,t,n){const{width:l,height:a}=pn(n),{x:i,y:s}=n.internals.positionAbsolute;return yl(e,[[i,s],[i+l,s+a]],t)}const Yh=(e,t,n)=>e<t?ga(Math.abs(e-t),1,t)/t:e>n?-ga(Math.abs(e-n),1,t)/t:0,gy=(e,t,n=15,l=40)=>{const a=Yh(e.x,l,t.width-l)*n,i=Yh(e.y,l,t.height-l)*n;return[a,i]},nu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),fc=({x:e,y:t,width:n,height:l})=>({x:e,y:t,x2:e+n,y2:t+l}),lu=({x:e,y:t,x2:n,y2:l})=>({x:e,y:t,width:n-e,height:l-t}),ma=(e,t=[0,0])=>{var a,i;const{x:n,y:l}=Mf(e)?e.internals.positionAbsolute:Zi(e,t);return{x:n,y:l,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},To=(e,t=[0,0])=>{var a,i;const{x:n,y:l}=Mf(e)?e.internals.positionAbsolute:Zi(e,t);return{x:n,y:l,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:l+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},my=(e,t)=>lu(nu(fc(e),fc(t))),Ai=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),l=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*l)},Vh=e=>Dt(e.width)&&Dt(e.height)&&Dt(e.x)&&Dt(e.y),Dt=e=>!isNaN(e)&&isFinite(e),_E=(e,t)=>{},Ji=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Wi=({x:e,y:t},[n,l,a],i=!1,s=[1,1])=>{const o={x:(e-n)/a,y:(t-l)/a};return i?Ji(o,s):o},Ao=({x:e,y:t},[n,l,a])=>({x:e*a+n,y:t*a+l});function Cl(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function bE(e,t,n){if(typeof e=="string"||typeof e=="number"){const l=Cl(e,n),a=Cl(e,t);return{top:l,right:a,bottom:l,left:a,x:a*2,y:l*2}}if(typeof e=="object"){const l=Cl(e.top??e.y??0,n),a=Cl(e.bottom??e.y??0,n),i=Cl(e.left??e.x??0,t),s=Cl(e.right??e.x??0,t);return{top:l,right:s,bottom:a,left:i,x:i+s,y:l+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function wE(e,t,n,l,a,i){const{x:s,y:o}=Ao(e,[t,n,l]),{x:u,y:c}=Ao({x:e.x+e.width,y:e.y+e.height},[t,n,l]),h=a-u,d=i-c;return{left:Math.floor(s),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(d)}}const Af=(e,t,n,l,a,i)=>{const s=bE(i,t,n),o=(t-s.x)/e.width,u=(n-s.y)/e.height,c=Math.min(o,u),h=ga(c,l,a),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*h,v=n/2-f*h,x=wE(e,g,v,h,t,n),b={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:g-b.left+b.right,y:v-b.top+b.bottom,zoom:h}},zi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function pa(e){return e!=null&&e!=="parent"}function pn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function py(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function yy(e,t={width:0,height:0},n,l,a){const i={...e},s=l.get(n);if(s){const o=s.origin||a;i.x+=s.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function Xh(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function SE(){let e,t;return{promise:new Promise((l,a)=>{e=l,t=a}),resolve:e,reject:t}}function EE(e){return{...uy,...e||{}}}function ri(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:l,containerBounds:a}){const{x:i,y:s}=kt(e),o=Wi({x:i-((a==null?void 0:a.left)??0),y:s-((a==null?void 0:a.top)??0)},l),{x:u,y:c}=n?Ji(o,t):o;return{xSnapped:u,ySnapped:c,...o}}const zf=e=>({width:e.offsetWidth,height:e.offsetHeight}),vy=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},NE=["INPUT","SELECT","TEXTAREA"];function xy(e){var l,a;const t=((a=(l=e.composedPath)==null?void 0:l.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:NE.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _y=e=>"clientX"in e,kt=(e,t)=>{var i,s;const n=_y(e),l=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:l-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},qh=(e,t,n,l,a)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const o=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:a,position:s.getAttribute("data-handlepos"),x:(o.left-n.left)/l,y:(o.top-n.top)/l,...zf(s)}})};function by({sourceX:e,sourceY:t,targetX:n,targetY:l,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:o}){const u=e*.125+a*.375+s*.375+n*.125,c=t*.125+i*.375+o*.375+l*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function bs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gh({pos:e,x1:t,y1:n,x2:l,y2:a,c:i}){switch(e){case Q.Left:return[t-bs(t-l,i),n];case Q.Right:return[t+bs(l-t,i),n];case Q.Top:return[t,n-bs(n-a,i)];case Q.Bottom:return[t,n+bs(a-n,i)]}}function wy({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:l,targetY:a,targetPosition:i=Q.Top,curvature:s=.25}){const[o,u]=Gh({pos:n,x1:e,y1:t,x2:l,y2:a,c:s}),[c,h]=Gh({pos:i,x1:l,y1:a,x2:e,y2:t,c:s}),[d,f,g,v]=by({sourceX:e,sourceY:t,targetX:l,targetY:a,sourceControlX:o,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${o},${u} ${c},${h} ${l},${a}`,d,f,g,v]}function Sy({sourceX:e,sourceY:t,targetX:n,targetY:l}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,s=Math.abs(l-t)/2,o=l<t?l+s:l-s;return[i,o,a,s]}function jE({sourceNode:e,targetNode:t,selected:n=!1,zIndex:l=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return l;const s=a&&n?l+1e3:l,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return s+o}function CE({sourceNode:e,targetNode:t,width:n,height:l,transform:a}){const i=nu(To(e),To(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:l/a[2]};return Ai(s,lu(i))>0}const ME=({source:e,sourceHandle:t,target:n,targetHandle:l})=>`xy-edge__${e}${t||""}-${n}${l||""}`,TE=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),AE=(e,t,n={})=>{if(!e.source||!e.target)return t;const l=n.getEdgeId||ME;let a;return fy(e)?a={...e}:a={...e,id:l(e)},TE(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function Ey({sourceX:e,sourceY:t,targetX:n,targetY:l}){const[a,i,s,o]=Sy({sourceX:e,sourceY:t,targetX:n,targetY:l});return[`M ${e},${t}L ${n},${l}`,a,i,s,o]}const $h={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},zE=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Qh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function DE({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:l=Q.Top,center:a,offset:i,stepPosition:s}){const o=$h[t],u=$h[l],c={x:e.x+o.x*i,y:e.y+o.y*i},h={x:n.x+u.x*i,y:n.y+u.y*i},d=zE({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",g=d[f];let v=[],x,b;const m={x:0,y:0},y={x:0,y:0},[,,p,_]=Sy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[f]*u[f]===-1){f==="x"?(x=a.x??c.x+(h.x-c.x)*s,b=a.y??(c.y+h.y)/2):(x=a.x??(c.x+h.x)/2,b=a.y??c.y+(h.y-c.y)*s);const E=[{x,y:c.y},{x,y:h.y}],M=[{x:c.x,y:b},{x:h.x,y:b}];o[f]===g?v=f==="x"?E:M:v=f==="x"?M:E}else{const E=[{x:c.x,y:h.y}],M=[{x:h.x,y:c.y}];if(f==="x"?v=o.x===g?M:E:v=o.y===g?E:M,t===l){const C=Math.abs(e[f]-n[f]);if(C<=i){const H=Math.min(i-1,i-C);o[f]===g?m[f]=(c[f]>e[f]?-1:1)*H:y[f]=(h[f]>n[f]?-1:1)*H}}if(t!==l){const C=f==="x"?"y":"x",H=o[f]===u[C],N=c[C]>h[C],z=c[C]<h[C];(o[f]===1&&(!H&&N||H&&z)||o[f]!==1&&(!H&&z||H&&N))&&(v=f==="x"?E:M)}const R={x:c.x+m.x,y:c.y+m.y},k={x:h.x+y.x,y:h.y+y.y},O=Math.max(Math.abs(R.x-v[0].x),Math.abs(k.x-v[0].x)),Y=Math.max(Math.abs(R.y-v[0].y),Math.abs(k.y-v[0].y));O>=Y?(x=(R.x+k.x)/2,b=v[0].y):(x=v[0].x,b=(R.y+k.y)/2)}const j={x:c.x+m.x,y:c.y+m.y},S={x:h.x+y.x,y:h.y+y.y};return[[e,...j.x!==v[0].x||j.y!==v[0].y?[j]:[],...v,...S.x!==v[v.length-1].x||S.y!==v[v.length-1].y?[S]:[],n],x,b,p,_]}function kE(e,t,n,l){const a=Math.min(Qh(e,t)/2,Qh(t,n)/2,l),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+a*c},${s}Q ${i},${s} ${i},${s+a*h}`}const o=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${s+a*u}Q ${i},${s} ${i+a*o},${s}`}function dc({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:l,targetY:a,targetPosition:i=Q.Top,borderRadius:s=5,centerX:o,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,g,v,x]=DE({source:{x:e,y:t},sourcePosition:n,target:{x:l,y:a},targetPosition:i,center:{x:o,y:u},offset:c,stepPosition:h});let b=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)b+=kE(d[m-1],d[m],d[m+1],s);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,f,g,v,x]}function Zh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function OE(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Zh(t)||!Zh(n))return null;const l=t.internals.handleBounds||Kh(t.handles),a=n.internals.handleBounds||Kh(n.handles),i=Jh((l==null?void 0:l.source)??[],e.sourceHandle),s=Jh(e.connectionMode===ha.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Xt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(i==null?void 0:i.position)||Q.Bottom,u=(s==null?void 0:s.position)||Q.Top,c=vl(t,i,o),h=vl(n,s,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:o,targetPosition:u}}function Kh(e){if(!e)return null;const t=[],n=[];for(const l of e)l.width=l.width??1,l.height=l.height??1,l.type==="source"?t.push(l):l.type==="target"&&n.push(l);return{source:t,target:n}}function vl(e,t,n=Q.Left,l=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:o}=t??pn(e);if(l)return{x:a+s/2,y:i+o/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:a+s/2,y:i};case Q.Right:return{x:a+s,y:i+o/2};case Q.Bottom:return{x:a+s/2,y:i+o};case Q.Left:return{x:a,y:i+o/2}}}function Jh(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(l=>`${l}=${e[l]}`).join("&")}`:""}function HE(e,{id:t,defaultColor:n,defaultMarkerStart:l,defaultMarkerEnd:a}){const i=new Set;return e.reduce((s,o)=>([o.markerStart||l,o.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const c=hc(u,t);i.has(c)||(s.push({id:c,color:u.color||n,...u}),i.add(c))}}),s),[]).sort((s,o)=>s.id.localeCompare(o.id))}const Ny=1e3,RE=10,Df={nodeOrigin:[0,0],nodeExtent:Mi,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},LE={...Df,checkEquality:!0};function kf(e,t){const n={...e};for(const l in t)t[l]!==void 0&&(n[l]=t[l]);return n}function BE(e,t,n){const l=kf(Df,n);for(const a of e.values())if(a.parentId)Hf(a,e,t,l);else{const i=Zi(a,l.nodeOrigin),s=pa(a.extent)?a.extent:l.nodeExtent,o=yl(i,s,pn(a));a.internals.positionAbsolute=o}}function UE(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],l=[];for(const a of e.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&l.push(i)}return{source:n,target:l}}function Of(e){return e==="manual"}function gc(e,t,n,l={}){var h,d;const a=kf(LE,l),i={i:0},s=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Of(a.zIndexMode)?Ny:0;let u=e.length>0,c=!1;t.clear(),n.clear();for(const f of e){let g=s.get(f.id);if(a.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const v=Zi(f,a.nodeOrigin),x=pa(f.extent)?f.extent:a.nodeExtent,b=yl(v,x,pn(f));g={...a.defaults,...f,measured:{width:(h=f.measured)==null?void 0:h.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:UE(f,g),z:jy(f,o,a.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),f.parentId&&Hf(g,t,n,l,i),c||(c=f.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:c}}function YE(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Hf(e,t,n,l,a){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:o,zIndexMode:u}=kf(Df,l),c=e.parentId,h=t.get(c);if(!h){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}YE(e,n),a&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++a.i,h.internals.z=h.internals.z+a.i*RE),a&&h.internals.rootParentIndex!==void 0&&(a.i=h.internals.rootParentIndex);const d=i&&!Of(u)?Ny:0,{x:f,y:g,z:v}=VE(e,h,s,o,d,u),{positionAbsolute:x}=e.internals,b=f!==x.x||g!==x.y;(b||v!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:f,y:g}:x,z:v}})}function jy(e,t,n){const l=Dt(e.zIndex)?e.zIndex:0;return Of(n)?l:l+(e.selected?t:0)}function VE(e,t,n,l,a,i){const{x:s,y:o}=t.internals.positionAbsolute,u=pn(e),c=Zi(e,n),h=pa(e.extent)?yl(c,e.extent,u):c;let d=yl({x:s+h.x,y:o+h.y},l,u);e.extent==="parent"&&(d=hy(d,u,t));const f=jy(e,a,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function Rf(e,t,n,l=[0,0]){var s;const a=[],i=new Map;for(const o of e){const u=t.get(o.parentId);if(!u)continue;const c=((s=i.get(o.parentId))==null?void 0:s.expandedRect)??ma(u),h=my(c,o.rect);i.set(o.parentId,{expandedRect:h,parent:u})}return i.size>0&&i.forEach(({expandedRect:o,parent:u},c)=>{var p;const h=u.internals.positionAbsolute,d=pn(u),f=u.origin??l,g=o.x<h.x?Math.round(Math.abs(h.x-o.x)):0,v=o.y<h.y?Math.round(Math.abs(h.y-o.y)):0,x=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),m=(x-d.width)*f[0],y=(b-d.height)*f[1];(g>0||v>0||m||y)&&(a.push({id:c,type:"position",position:{x:u.position.x-g+m,y:u.position.y-v+y}}),(p=n.get(c))==null||p.forEach(_=>{e.some(j=>j.id===_.id)||a.push({id:_.id,type:"position",position:{x:_.position.x+g,y:_.position.y+v}})})),(d.width<o.width||d.height<o.height||g||v)&&a.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(g?f[0]*g-m:0),height:b+(v?f[1]*v-y:0)}})}),a}function XE(e,t,n,l,a,i,s){const o=l==null?void 0:l.querySelector(".xyflow__viewport");let u=!1;if(!o)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const g of e.values()){const v=t.get(g.id);if(!v)continue;if(v.hidden){t.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),u=!0;continue}const x=zf(g.nodeElement),b=v.measured.width!==x.width||v.measured.height!==x.height;if(!!(x.width&&x.height&&(b||!v.internals.handleBounds||g.force))){const y=g.nodeElement.getBoundingClientRect(),p=pa(v.extent)?v.extent:i;let{positionAbsolute:_}=v.internals;v.parentId&&v.extent==="parent"?_=hy(_,x,t.get(v.parentId)):p&&(_=yl(_,p,x));const j={...v,measured:x,internals:{...v.internals,positionAbsolute:_,handleBounds:{source:qh("source",g.nodeElement,y,d,v.id),target:qh("target",g.nodeElement,y,d,v.id)}}};t.set(v.id,j),v.parentId&&Hf(j,t,n,{nodeOrigin:a,zIndexMode:s}),u=!0,b&&(c.push({id:v.id,type:"dimensions",dimensions:x}),v.expandParent&&v.parentId&&f.push({id:v.id,parentId:v.parentId,rect:ma(j,a)}))}}if(f.length>0){const g=Rf(f,t,n,a);c.push(...g)}return{changes:c,updatedInternals:u}}async function qE({delta:e,panZoom:t,transform:n,translateExtent:l,width:a,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,i]],l),o=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(o)}function Wh(e,t,n,l,a,i){let s=a;const o=l.get(s)||new Map;l.set(s,o.set(n,t)),s=`${a}-${e}`;const u=l.get(s)||new Map;if(l.set(s,u.set(n,t)),i){s=`${a}-${e}-${i}`;const c=l.get(s)||new Map;l.set(s,c.set(n,t))}}function Cy(e,t,n){e.clear(),t.clear();for(const l of n){const{source:a,target:i,sourceHandle:s=null,targetHandle:o=null}=l,u={edgeId:l.id,source:a,target:i,sourceHandle:s,targetHandle:o},c=`${a}-${s}--${i}-${o}`,h=`${i}-${o}--${a}-${s}`;Wh("source",u,h,e,a,s),Wh("target",u,c,e,i,o),t.set(l.id,l)}}function My(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:My(n,t):!1}function Fh(e,t,n){var a;let l=e;do{if((a=l==null?void 0:l.matches)!=null&&a.call(l,t))return!0;if(l===n)return!1;l=l==null?void 0:l.parentElement}while(l);return!1}function GE(e,t,n,l){const a=new Map;for(const[i,s]of e)if((s.selected||s.id===l)&&(!s.parentId||!My(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const o=e.get(i);o&&a.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function tr({nodeId:e,dragItems:t,nodeLookup:n,dragging:l=!0}){var s,o,u;const a=[];for(const[c,h]of t){const d=(s=n.get(c))==null?void 0:s.internals.userNode;d&&a.push({...d,position:h.position,dragging:l})}if(!e)return[a[0],a];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:l}:a[0],a]}function $E({dragItems:e,snapGrid:t,x:n,y:l}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:l-a.distance.y},s=Ji(i,t);return{x:s.x-i.x,y:s.y-i.y}}function QE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:l,onDragStop:a}){let i={x:null,y:null},s=0,o=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,g=!1,v=!1,x=null;function b({noDragClassName:y,handleSelector:p,domNode:_,isSelectable:j,nodeId:S,nodeClickDistance:w=0}){f=rt(_);function E({x:O,y:Y}){const{nodeLookup:C,nodeExtent:H,snapGrid:N,snapToGrid:z,nodeOrigin:A,onNodeDrag:D,onSelectionDrag:B,onError:L,updateNodePositions:U}=t();i={x:O,y:Y};let G=!1;const q=o.size>1,$=q&&H?fc(Ki(o)):null,W=q&&z?$E({dragItems:o,snapGrid:N,x:O,y:Y}):null;for(const[K,X]of o){if(!C.has(K))continue;let Z={x:O-X.distance.x,y:Y-X.distance.y};z&&(Z=W?{x:Math.round(Z.x+W.x),y:Math.round(Z.y+W.y)}:Ji(Z,N));let ne=null;if(q&&H&&!X.extent&&$){const{positionAbsolute:J}=X.internals,re=J.x-$.x+H[0][0],ve=J.x+X.measured.width-$.x2+H[1][0],ue=J.y-$.y+H[0][1],Ke=J.y+X.measured.height-$.y2+H[1][1];ne=[[re,ue],[ve,Ke]]}const{position:P,positionAbsolute:F}=dy({nodeId:K,nextPosition:Z,nodeLookup:C,nodeExtent:ne||H,nodeOrigin:A,onError:L});G=G||X.position.x!==P.x||X.position.y!==P.y,X.position=P,X.internals.positionAbsolute=F}if(v=v||G,!!G&&(U(o,!0),x&&(l||D||!S&&B))){const[K,X]=tr({nodeId:S,dragItems:o,nodeLookup:C});l==null||l(x,o,K,X),D==null||D(x,K,X),S||B==null||B(x,X)}}async function M(){if(!h)return;const{transform:O,panBy:Y,autoPanSpeed:C,autoPanOnNodeDrag:H}=t();if(!H){u=!1,cancelAnimationFrame(s);return}const[N,z]=gy(c,h,C);(N!==0||z!==0)&&(i.x=(i.x??0)-N/O[2],i.y=(i.y??0)-z/O[2],await Y({x:N,y:z})&&E(i)),s=requestAnimationFrame(M)}function R(O){var q;const{nodeLookup:Y,multiSelectionActive:C,nodesDraggable:H,transform:N,snapGrid:z,snapToGrid:A,selectNodesOnDrag:D,onNodeDragStart:B,onSelectionDragStart:L,unselectNodesAndEdges:U}=t();d=!0,(!D||!j)&&!C&&S&&((q=Y.get(S))!=null&&q.selected||U()),j&&D&&S&&(e==null||e(S));const G=ri(O.sourceEvent,{transform:N,snapGrid:z,snapToGrid:A,containerBounds:h});if(i=G,o=GE(Y,H,G,S),o.size>0&&(n||B||!S&&L)){const[$,W]=tr({nodeId:S,dragItems:o,nodeLookup:Y});n==null||n(O.sourceEvent,o,$,W),B==null||B(O.sourceEvent,$,W),S||L==null||L(O.sourceEvent,W)}}const k=$0().clickDistance(w).on("start",O=>{const{domNode:Y,nodeDragThreshold:C,transform:H,snapGrid:N,snapToGrid:z}=t();h=(Y==null?void 0:Y.getBoundingClientRect())||null,g=!1,v=!1,x=O.sourceEvent,C===0&&R(O),i=ri(O.sourceEvent,{transform:H,snapGrid:N,snapToGrid:z,containerBounds:h}),c=kt(O.sourceEvent,h)}).on("drag",O=>{const{autoPanOnNodeDrag:Y,transform:C,snapGrid:H,snapToGrid:N,nodeDragThreshold:z,nodeLookup:A}=t(),D=ri(O.sourceEvent,{transform:C,snapGrid:H,snapToGrid:N,containerBounds:h});if(x=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||S&&!A.has(S))&&(g=!0),!g){if(!u&&Y&&d&&(u=!0,M()),!d){const B=kt(O.sourceEvent,h),L=B.x-c.x,U=B.y-c.y;Math.sqrt(L*L+U*U)>z&&R(O)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&o&&d&&(c=kt(O.sourceEvent,h),E(D))}}).on("end",O=>{if(!(!d||g)&&(u=!1,d=!1,cancelAnimationFrame(s),o.size>0)){const{nodeLookup:Y,updateNodePositions:C,onNodeDragStop:H,onSelectionDragStop:N}=t();if(v&&(C(o,!1),v=!1),a||H||!S&&N){const[z,A]=tr({nodeId:S,dragItems:o,nodeLookup:Y,dragging:!1});a==null||a(O.sourceEvent,o,z,A),H==null||H(O.sourceEvent,z,A),S||N==null||N(O.sourceEvent,A)}}}).filter(O=>{const Y=O.target;return!O.button&&(!y||!Fh(Y,`.${y}`,_))&&(!p||Fh(Y,p,_))});f.call(k)}function m(){f==null||f.on(".drag",null)}return{update:b,destroy:m}}function ZE(e,t,n){const l=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Ai(a,ma(i))>0&&l.push(i);return l}const KE=250;function JE(e,t,n,l){var o,u;let a=[],i=1/0;const s=ZE(e,n,t+KE);for(const c of s){const h=[...((o=c.internals.handleBounds)==null?void 0:o.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of h){if(l.nodeId===d.nodeId&&l.type===d.type&&l.id===d.id)continue;const{x:f,y:g}=vl(c,d,d.position,!0),v=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));v>t||(v<i?(a=[{...d,x:f,y:g}],i=v):v===i&&a.push({...d,x:f,y:g}))}}if(!a.length)return null;if(a.length>1){const c=l.type==="source"?"target":"source";return a.find(h=>h.type===c)??a[0]}return a[0]}function Ty(e,t,n,l,a,i=!1){var c,h,d;const s=l.get(e);if(!s)return null;const o=a==="strict"?(c=s.internals.handleBounds)==null?void 0:c[t]:[...((h=s.internals.handleBounds)==null?void 0:h.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?o==null?void 0:o.find(f=>f.id===n):o==null?void 0:o[0])??null;return u&&i?{...u,...vl(s,u,u.position,!0)}:u}function Ay(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const zy=()=>!0;function FE(e,{connectionMode:t,connectionRadius:n,handleId:l,nodeId:a,edgeUpdaterType:i,isTarget:s,domNode:o,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:x,onConnectEnd:b,isValidConnection:m=zy,onReconnectEnd:y,updateConnection:p,getTransform:_,getFromHandle:j,autoPanSpeed:S,dragThreshold:w=1,handleDomNode:E}){const M=vy(e.target);let R=0,k;const{x:O,y:Y}=kt(e),C=Ay(i,E),H=o==null?void 0:o.getBoundingClientRect();let N=!1;if(!H||!C)return;const z=Ty(a,C,l,u,t);if(!z)return;let A=kt(e,H),D=!1,B=null,L=!1,U=null;function G(){if(!h||!H)return;const[P,F]=gy(A,H,S);f({x:P,y:F}),R=requestAnimationFrame(G)}const q={...z,nodeId:a,type:C,position:z.position},$=u.get(a);let K={inProgress:!0,isValid:null,from:vl($,q,Q.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:$,to:A,toHandle:null,toPosition:Uh[q.position],toNode:null,pointer:A};function X(){N=!0,p(K),v==null||v(e,{nodeId:a,handleId:l,handleType:C})}w===0&&X();function Z(P){if(!N){const{x:Ke,y:yn}=kt(P),Qt=Ke-O,Jn=yn-Y;if(!(Qt*Qt+Jn*Jn>w*w))return;X()}if(!j()||!q){ne(P);return}const F=_();A=kt(P,H),k=JE(Wi(A,F,!1,[1,1]),n,u,q),D||(G(),D=!0);const J=Dy(P,{handle:k,connectionMode:t,fromNodeId:a,fromHandleId:l,fromType:s?"target":"source",isValidConnection:m,doc:M,lib:c,flowId:d,nodeLookup:u});U=J.handleDomNode,B=J.connection,L=WE(!!k,J.isValid);const re=u.get(a),ve=re?vl(re,q,Q.Left,!0):K.from,ue={...K,from:ve,isValid:L,to:J.toHandle&&L?Ao({x:J.toHandle.x,y:J.toHandle.y},F):A,toHandle:J.toHandle,toPosition:L&&J.toHandle?J.toHandle.position:Uh[q.position],toNode:J.toHandle?u.get(J.toHandle.nodeId):null,pointer:A};p(ue),K=ue}function ne(P){if(!("touches"in P&&P.touches.length>0)){if(N){(k||U)&&B&&L&&(x==null||x(B));const{inProgress:F,...J}=K,re={...J,toPosition:K.toHandle?K.toPosition:null};b==null||b(P,re),i&&(y==null||y(P,re))}g(),cancelAnimationFrame(R),D=!1,L=!1,B=null,U=null,M.removeEventListener("mousemove",Z),M.removeEventListener("mouseup",ne),M.removeEventListener("touchmove",Z),M.removeEventListener("touchend",ne)}}M.addEventListener("mousemove",Z),M.addEventListener("mouseup",ne),M.addEventListener("touchmove",Z),M.addEventListener("touchend",ne)}function Dy(e,{handle:t,connectionMode:n,fromNodeId:l,fromHandleId:a,fromType:i,doc:s,lib:o,flowId:u,isValidConnection:c=zy,nodeLookup:h}){const d=i==="target",f=t?s.querySelector(`.${o}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:v}=kt(e),x=s.elementFromPoint(g,v),b=x!=null&&x.classList.contains(`${o}-flow__handle`)?x:f,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=Ay(void 0,b),p=b.getAttribute("data-nodeid"),_=b.getAttribute("data-handleid"),j=b.classList.contains("connectable"),S=b.classList.contains("connectableend");if(!p||!y)return m;const w={source:d?p:l,sourceHandle:d?_:a,target:d?l:p,targetHandle:d?a:_};m.connection=w;const M=j&&S&&(n===ha.Strict?d&&y==="source"||!d&&y==="target":p!==l||_!==a);m.isValid=M&&c(w),m.toHandle=Ty(p,y,_,h,n,!0)}return m}const mc={onPointerDown:FE,isValid:Dy};function IE({domNode:e,panZoom:t,getTransform:n,getViewScale:l}){const a=rt(e);function i({translateExtent:o,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const v=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const _=n(),j=p.sourceEvent.ctrlKey&&zi()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*h,w=_[2]*Math.pow(2,S*j);t.scaleTo(w)};let x=[0,0];const b=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(x=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const _=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const j=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[j[0]-x[0],j[1]-x[1]];x=j;const w=l()*Math.max(_[2],Math.log(_[2]))*(g?-1:1),E={x:_[0]-S[0]*w,y:_[1]-S[1]*w},M=[[0,0],[u,c]];t.setViewportConstrained({x:E.x,y:E.y,zoom:_[2]},M,o)},y=sy().on("start",b).on("zoom",d?m:null).on("zoom.wheel",f?v:null);a.call(y,{})}function s(){a.on("zoom",null)}return{update:i,destroy:s,pointer:At}}const au=e=>({x:e.x,y:e.y,zoom:e.k}),nr=({x:e,y:t,zoom:n})=>tu.translate(e,t).scale(n),ql=(e,t)=>e.target.closest(`.${t}`),ky=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),PE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,lr=(e,t=0,n=PE,l=()=>{})=>{const a=typeof t=="number"&&t>0;return a||l(),a?e.transition().duration(t).ease(n).on("end",l):e},Oy=e=>{const t=e.ctrlKey&&zi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function eN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:l,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:o,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(ql(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&s){const b=At(h),m=Oy(h),y=d*Math.pow(2,m);l.scaleTo(n,y,b,h);return}const f=h.deltaMode===1?20:1;let g=a===rl.Vertical?0:h.deltaX*f,v=a===rl.Horizontal?0:h.deltaY*f;!zi()&&h.shiftKey&&a!==rl.Vertical&&(g=h.deltaY*f,v=0),l.translateBy(n,-(g/d)*i,-(v/d)*i,{internal:!0});const x=au(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,x))}}function tN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(l,a){const i=l.type==="wheel",s=!t&&i&&!l.ctrlKey,o=ql(l,e);if(l.ctrlKey&&i&&o&&l.preventDefault(),s||o)return null;l.preventDefault(),n.call(this,l,a)}}function nN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return l=>{var i,s,o;if((i=l.sourceEvent)!=null&&i.internal)return;const a=au(l.transform);e.mouseButton=((s=l.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=l.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(l.sourceEvent,a))}}function lN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:l,onPanZoom:a}){return i=>{var s,o;e.usedRightMouseButton=!!(n&&ky(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||l([i.transform.x,i.transform.y,i.transform.k]),a&&!((o=i.sourceEvent)!=null&&o.internal)&&(a==null||a(i.sourceEvent,au(i.transform)))}}function aN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:l,onPanZoomEnd:a,onPaneContextMenu:i}){return s=>{var o;if(!((o=s.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&ky(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,l(!1),a)){const u=au(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(s.sourceEvent,u)},n?150:0)}}}function iN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:l,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:o,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var b;const f=e||t,g=n&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ql(d,`${c}-flow__node`)||ql(d,`${c}-flow__edge`)))return!0;if(!l&&!f&&!a&&!i&&!n||s||h&&!v||ql(d,o)&&v||ql(d,u)&&(!v||a&&v&&!e)||!n&&d.ctrlKey&&v)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!f&&!a&&!g&&v||!l&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(l)&&!l.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(l)&&l.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v)&&x}}function sN({domNode:e,minZoom:t,maxZoom:n,translateExtent:l,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:o,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=sy().scaleExtent([t,n]).translateExtent(l),f=rt(e).call(d);y({x:a.x,y:a.y,zoom:ga(a.zoom,t,n)},[[0,0],[h.width,h.height]],l);const g=f.on("wheel.zoom"),v=f.on("dblclick.zoom");d.wheelDelta(Oy);function x(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).transform(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function b({noWheelClassName:k,noPanClassName:O,onPaneContextMenu:Y,userSelectionActive:C,panOnScroll:H,panOnDrag:N,panOnScrollMode:z,panOnScrollSpeed:A,preventScrolling:D,zoomOnPinch:B,zoomOnScroll:L,zoomOnDoubleClick:U,zoomActivationKeyPressed:G,lib:q,onTransformChange:$,connectionInProgress:W,paneClickDistance:K,selectionOnDrag:X}){C&&!c.isZoomingOrPanning&&m();const Z=H&&!G&&!C;d.clickDistance(X?1/0:!Dt(K)||K<0?0:K);const ne=Z?eN({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:A,zoomOnPinch:B,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:o}):tN({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:g});if(f.on("wheel.zoom",ne,{passive:!1}),!C){const F=nN({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:s});d.on("start",F);const J=lN({zoomPanValues:c,panOnDrag:N,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:$});d.on("zoom",J);const re=aN({zoomPanValues:c,panOnDrag:N,panOnScroll:H,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:u});d.on("end",re)}const P=iN({zoomActivationKeyPressed:G,panOnDrag:N,zoomOnScroll:L,panOnScroll:H,zoomOnDoubleClick:U,zoomOnPinch:B,userSelectionActive:C,noPanClassName:O,noWheelClassName:k,lib:q,connectionInProgress:W});d.filter(P),U?f.on("dblclick.zoom",v):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function y(k,O,Y){const C=nr(k),H=d==null?void 0:d.constrain()(C,O,Y);return H&&await x(H),new Promise(N=>N(H))}async function p(k,O){const Y=nr(k);return await x(Y,O),new Promise(C=>C(Y))}function _(k){if(f){const O=nr(k),Y=f.property("__zoom");(Y.k!==k.zoom||Y.x!==k.x||Y.y!==k.y)&&(d==null||d.transform(f,O,null,{sync:!0}))}}function j(){const k=f?iy(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function S(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).scaleTo(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function w(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).scaleBy(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function E(k){d==null||d.scaleExtent(k)}function M(k){d==null||d.translateExtent(k)}function R(k){const O=!Dt(k)||k<0?0:k;d==null||d.clickDistance(O)}return{update:b,destroy:m,setViewport:p,setViewportConstrained:y,getViewport:j,scaleTo:S,scaleBy:w,setScaleExtent:E,setTranslateExtent:M,syncViewport:_,setClickDistance:R}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function oN({width:e,prevWidth:t,height:n,prevHeight:l,affectsX:a,affectsY:i}){const s=e-t,o=n-l,u=[s>0?1:s<0?-1:0,o>0?1:o<0?-1:0];return s&&a&&(u[0]=u[0]*-1),o&&i&&(u[1]=u[1]*-1),u}function Ih(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),l=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:l,affectsY:a}}function xn(e,t){return Math.max(0,t-e)}function _n(e,t){return Math.max(0,e-t)}function ws(e,t,n){return Math.max(0,t-e,e-n)}function Ph(e,t){return e?!t:t}function uN(e,t,n,l,a,i,s,o){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:g,ySnapped:v}=n,{minWidth:x,maxWidth:b,minHeight:m,maxHeight:y}=l,{x:p,y:_,width:j,height:S,aspectRatio:w}=e;let E=Math.floor(h?g-e.pointerX:0),M=Math.floor(d?v-e.pointerY:0);const R=j+(u?-E:E),k=S+(c?-M:M),O=-i[0]*j,Y=-i[1]*S;let C=ws(R,x,b),H=ws(k,m,y);if(s){let A=0,D=0;u&&E<0?A=xn(p+E+O,s[0][0]):!u&&E>0&&(A=_n(p+R+O,s[1][0])),c&&M<0?D=xn(_+M+Y,s[0][1]):!c&&M>0&&(D=_n(_+k+Y,s[1][1])),C=Math.max(C,A),H=Math.max(H,D)}if(o){let A=0,D=0;u&&E>0?A=_n(p+E,o[0][0]):!u&&E<0&&(A=xn(p+R,o[1][0])),c&&M>0?D=_n(_+M,o[0][1]):!c&&M<0&&(D=xn(_+k,o[1][1])),C=Math.max(C,A),H=Math.max(H,D)}if(a){if(h){const A=ws(R/w,m,y)*w;if(C=Math.max(C,A),s){let D=0;!u&&!c||u&&!c&&f?D=_n(_+Y+R/w,s[1][1])*w:D=xn(_+Y+(u?E:-E)/w,s[0][1])*w,C=Math.max(C,D)}if(o){let D=0;!u&&!c||u&&!c&&f?D=xn(_+R/w,o[1][1])*w:D=_n(_+(u?E:-E)/w,o[0][1])*w,C=Math.max(C,D)}}if(d){const A=ws(k*w,x,b)/w;if(H=Math.max(H,A),s){let D=0;!u&&!c||c&&!u&&f?D=_n(p+k*w+O,s[1][0])/w:D=xn(p+(c?M:-M)*w+O,s[0][0])/w,H=Math.max(H,D)}if(o){let D=0;!u&&!c||c&&!u&&f?D=xn(p+k*w,o[1][0])/w:D=_n(p+(c?M:-M)*w,o[0][0])/w,H=Math.max(H,D)}}}M=M+(M<0?H:-H),E=E+(E<0?C:-C),a&&(f?R>k*w?M=(Ph(u,c)?-E:E)/w:E=(Ph(u,c)?-M:M)*w:h?(M=E/w,c=u):(E=M*w,u=c));const N=u?p+E:p,z=c?_+M:_;return{width:j+(u?-E:E),height:S+(c?-M:M),x:i[0]*E*(u?-1:1)+N,y:i[1]*M*(c?-1:1)+z}}const Hy={width:0,height:0,x:0,y:0},rN={...Hy,pointerX:0,pointerY:0,aspectRatio:1};function cN(e){return[[0,0],[e.measured.width,e.measured.height]]}function fN(e,t,n){const l=t.position.x+e.position.x,a=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,o=n[0]*i,u=n[1]*s;return[[l-o,a-u],[l+i-o,a+s-u]]}function dN({domNode:e,nodeId:t,getStoreItems:n,onChange:l,onEnd:a}){const i=rt(e);let s={controlDirection:Ih("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:v,onResizeEnd:x,shouldResize:b}){let m={...Hy},y={...rN};s={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Ih(c)};let p,_=null,j=[],S,w,E,M=!1;const R=$0().on("start",k=>{const{nodeLookup:O,transform:Y,snapGrid:C,snapToGrid:H,nodeOrigin:N,paneDomNode:z}=n();if(p=O.get(t),!p)return;_=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:D}=ri(k.sourceEvent,{transform:Y,snapGrid:C,snapToGrid:H,containerBounds:_});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},y={...m,pointerX:A,pointerY:D,aspectRatio:m.width/m.height},S=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=O.get(p.parentId),w=S&&p.extent==="parent"?cN(S):void 0),j=[],E=void 0;for(const[B,L]of O)if(L.parentId===t&&(j.push({id:B,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const U=fN(L,p,L.origin??N);E?E=[[Math.min(U[0][0],E[0][0]),Math.min(U[0][1],E[0][1])],[Math.max(U[1][0],E[1][0]),Math.max(U[1][1],E[1][1])]]:E=U}g==null||g(k,{...m})}).on("drag",k=>{const{transform:O,snapGrid:Y,snapToGrid:C,nodeOrigin:H}=n(),N=ri(k.sourceEvent,{transform:O,snapGrid:Y,snapToGrid:C,containerBounds:_}),z=[];if(!p)return;const{x:A,y:D,width:B,height:L}=m,U={},G=p.origin??H,{width:q,height:$,x:W,y:K}=uN(y,s.controlDirection,N,s.boundaries,s.keepAspectRatio,G,w,E),X=q!==B,Z=$!==L,ne=W!==A&&X,P=K!==D&&Z;if(!ne&&!P&&!X&&!Z)return;if((ne||P||G[0]===1||G[1]===1)&&(U.x=ne?W:m.x,U.y=P?K:m.y,m.x=U.x,m.y=U.y,j.length>0)){const ve=W-A,ue=K-D;for(const Ke of j)Ke.position={x:Ke.position.x-ve+G[0]*(q-B),y:Ke.position.y-ue+G[1]*($-L)},z.push(Ke)}if((X||Z)&&(U.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?q:m.width,U.height=Z&&(!s.resizeDirection||s.resizeDirection==="vertical")?$:m.height,m.width=U.width,m.height=U.height),S&&p.expandParent){const ve=G[0]*(U.width??0);U.x&&U.x<ve&&(m.x=ve,y.x=y.x-(U.x-ve));const ue=G[1]*(U.height??0);U.y&&U.y<ue&&(m.y=ue,y.y=y.y-(U.y-ue))}const F=oN({width:m.width,prevWidth:B,height:m.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),J={...m,direction:F};(b==null?void 0:b(k,J))!==!1&&(M=!0,v==null||v(k,J),l(U,z))}).on("end",k=>{M&&(x==null||x(k,{...m}),a==null||a({...m}),M=!1)});i.call(R)}function u(){i.on(".drag",null)}return{update:o,destroy:u}}var Ry={exports:{}},Ly={},By={exports:{}},Uy={};/**
49
+ `).replace(G_,"")}function m0(e,t){return t=th(t),th(e)===t}function ge(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||na(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&na(e,""+l);break;case"className":as(e,"class",l);break;case"tabIndex":as(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":as(e,n,l);break;case"style":dm(e,l,i);break;case"data":if(t!=="object"){as(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&ge(e,t,"name",a.name,a,null),ge(e,t,"formEncType",a.formEncType,a,null),ge(e,t,"formMethod",a.formMethod,a,null),ge(e,t,"formTarget",a.formTarget,a,null)):(ge(e,t,"encType",a.encType,a,null),ge(e,t,"method",a.method,a,null),ge(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=nn);break;case"onScroll":l!=null&&le("scroll",e);break;case"onScrollEnd":l!=null&&le("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(V(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(V(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=js(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":le("beforetoggle",e),le("toggle",e),Ns(e,"popover",l);break;case"xlinkActuate":Zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ns(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=v1.get(n)||n,Ns(e,n,l))}}function Zr(e,t,n,l,a,i){switch(n){case"style":dm(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(V(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(V(60));e.innerHTML=n}}break;case"children":typeof l=="string"?na(e,l):(typeof l=="number"||typeof l=="bigint")&&na(e,""+l);break;case"onScroll":l!=null&&le("scroll",e);break;case"onScrollEnd":l!=null&&le("scrollend",e);break;case"onClick":l!=null&&(e.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[at]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Ns(e,n,l)}}}function Ze(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",e),le("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(s!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(V(137,t));default:ge(e,t,i,s,n,null)}}a&&ge(e,t,"srcSet",n.srcSet,n,null),l&&ge(e,t,"src",n.src,n,null);return;case"input":le("invalid",e);var o=i=s=a=null,u=null,c=null;for(l in n)if(n.hasOwnProperty(l)){var h=n[l];if(h!=null)switch(l){case"name":a=h;break;case"type":s=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":i=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(V(137,t));break;default:ge(e,t,l,h,n,null)}}rm(e,i,o,u,c,s,a,!1);return;case"select":le("invalid",e),l=s=i=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":i=o;break;case"defaultValue":s=o;break;case"multiple":l=o;default:ge(e,t,a,o,n,null)}t=i,n=s,e.multiple=!!l,t!=null?Ql(e,!!l,t,!1):n!=null&&Ql(e,!!l,n,!0);return;case"textarea":le("invalid",e),i=a=l=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":l=o;break;case"defaultValue":a=o;break;case"children":i=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(V(91));break;default:ge(e,t,s,o,n,null)}fm(e,l,a,i);return;case"option":for(u in n)if(n.hasOwnProperty(u)&&(l=n[u],l!=null))switch(u){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ge(e,t,u,l,n,null)}return;case"dialog":le("beforetoggle",e),le("toggle",e),le("cancel",e),le("close",e);break;case"iframe":case"object":le("load",e);break;case"video":case"audio":for(l=0;l<xi.length;l++)le(xi[l],e);break;case"image":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"embed":case"source":case"link":le("error",e),le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(l=n[c],l!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(V(137,t));default:ge(e,t,c,l,n,null)}return;default:if(Tc(t)){for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!==void 0&&Zr(e,t,h,l,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(l=n[o],l!=null&&ge(e,t,o,l,n,null))}function $_(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,s=null,o=null,u=null,c=null,h=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":u=d;default:l.hasOwnProperty(g)||ge(e,t,g,null,l,d)}}for(var f in l){var g=l[f];if(d=n[f],l.hasOwnProperty(f)&&(g!=null||d!=null))switch(f){case"type":i=g;break;case"name":a=g;break;case"checked":c=g;break;case"defaultChecked":h=g;break;case"value":s=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(V(137,t));break;default:g!==d&&ge(e,t,f,g,l,d)}}vr(e,s,o,u,c,h,i,a);return;case"select":g=s=o=f=null;for(i in n)if(u=n[i],n.hasOwnProperty(i)&&u!=null)switch(i){case"value":break;case"multiple":g=u;default:l.hasOwnProperty(i)||ge(e,t,i,null,l,u)}for(a in l)if(i=l[a],u=n[a],l.hasOwnProperty(a)&&(i!=null||u!=null))switch(a){case"value":f=i;break;case"defaultValue":o=i;break;case"multiple":s=i;default:i!==u&&ge(e,t,a,i,l,u)}t=o,n=s,l=g,f!=null?Ql(e,!!n,f,!1):!!l!=!!n&&(t!=null?Ql(e,!!n,t,!0):Ql(e,!!n,n?[]:"",!1));return;case"textarea":g=f=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!l.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:ge(e,t,o,null,l,a)}for(s in l)if(a=l[s],i=n[s],l.hasOwnProperty(s)&&(a!=null||i!=null))switch(s){case"value":f=a;break;case"defaultValue":g=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(V(91));break;default:a!==i&&ge(e,t,s,a,l,i)}cm(e,f,g);return;case"option":for(var v in n)if(f=n[v],n.hasOwnProperty(v)&&f!=null&&!l.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:ge(e,t,v,null,l,f)}for(u in l)if(f=l[u],g=n[u],l.hasOwnProperty(u)&&f!==g&&(f!=null||g!=null))switch(u){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:ge(e,t,u,f,l,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in n)f=n[x],n.hasOwnProperty(x)&&f!=null&&!l.hasOwnProperty(x)&&ge(e,t,x,null,l,f);for(c in l)if(f=l[c],g=n[c],l.hasOwnProperty(c)&&f!==g&&(f!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(V(137,t));break;default:ge(e,t,c,f,l,g)}return;default:if(Tc(t)){for(var b in n)f=n[b],n.hasOwnProperty(b)&&f!==void 0&&!l.hasOwnProperty(b)&&Zr(e,t,b,void 0,l,f);for(h in l)f=l[h],g=n[h],!l.hasOwnProperty(h)||f===g||f===void 0&&g===void 0||Zr(e,t,h,f,l,g);return}}for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!=null&&!l.hasOwnProperty(m)&&ge(e,t,m,null,l,f);for(d in l)f=l[d],g=n[d],!l.hasOwnProperty(d)||f===g||f==null&&g==null||ge(e,t,d,f,l,g)}function nh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,s=a.initiatorType,o=a.duration;if(i&&o&&nh(s)){for(s=0,o=a.responseEnd,l+=1;l<n.length;l++){var u=n[l],c=u.startTime;if(c>o)break;var h=u.transferSize,d=u.initiatorType;h&&nh(d)&&(u=u.responseEnd,s+=h*(u<o?1:(o-c)/(u-c)))}if(--l,t+=8*(i+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Kr=null,Jr=null;function mo(e){return e.nodeType===9?e:e.ownerDocument}function lh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function p0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Wr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ju=null;function Z_(){var e=window.event;return e&&e.type==="popstate"?e===Ju?!1:(Ju=e,!0):(Ju=null,!1)}var y0=typeof setTimeout=="function"?setTimeout:void 0,K_=typeof clearTimeout=="function"?clearTimeout:void 0,ah=typeof Promise=="function"?Promise:void 0,J_=typeof queueMicrotask=="function"?queueMicrotask:typeof ah<"u"?function(e){return ah.resolve(null).then(e).catch(W_)}:y0;function W_(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function ih(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),ca(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")oi(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,oi(n);for(var i=n.firstChild;i;){var s=i.nextSibling,o=i.nodeName;i[Li]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=s}}else n==="body"&&oi(e.ownerDocument.body);n=a}while(n);ca(t)}function sh(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Fr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fr(n),Mc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function F_(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Li])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=jt(e.nextSibling),e===null)break}return null}function I_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jt(e.nextSibling),e===null))return null;return e}function v0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jt(e.nextSibling),e===null))return null;return e}function Ir(e){return e.data==="$?"||e.data==="$~"}function Pr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function P_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ec=null;function oh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function uh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function x0(e,t,n){switch(t=mo(n),e){case"html":if(e=t.documentElement,!e)throw Error(V(452));return e;case"head":if(e=t.head,!e)throw Error(V(453));return e;case"body":if(e=t.body,!e)throw Error(V(454));return e;default:throw Error(V(451))}}function oi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mc(e)}var Ct=new Map,rh=new Set;function po(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mn=fe.d;fe.d={f:e2,r:t2,D:n2,C:l2,L:a2,m:i2,X:o2,S:s2,M:u2};function e2(){var e=mn.f(),t=Zo();return e||t}function t2(e){var t=wa(e);t!==null&&t.tag===5&&t.type==="form"?dp(t):mn.r(e)}var ja=typeof document>"u"?null:document;function _0(e,t,n){var l=ja;if(l&&typeof t=="string"&&t){var a=wt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),rh.has(a)||(rh.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Ze(t,"link",e),Ye(t),l.head.appendChild(t)))}}function n2(e){mn.D(e),_0("dns-prefetch",e,null)}function l2(e,t){mn.C(e,t),_0("preconnect",e,t)}function a2(e,t,n){mn.L(e,t,n);var l=ja;if(l&&e&&t){var a='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+wt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+wt(n.imageSizes)+'"]')):a+='[href="'+wt(e)+'"]';var i=a;switch(t){case"style":i=ra(e);break;case"script":i=Ca(e)}Ct.has(i)||(e=we({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ct.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(qi(i))||t==="script"&&l.querySelector(Gi(i))||(t=l.createElement("link"),Ze(t,"link",e),Ye(t),l.head.appendChild(t)))}}function i2(e,t){mn.m(e,t);var n=ja;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+wt(l)+'"][href="'+wt(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ca(e)}if(!Ct.has(i)&&(e=we({rel:"modulepreload",href:e},t),Ct.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Gi(i)))return}l=n.createElement("link"),Ze(l,"link",e),Ye(l),n.head.appendChild(l)}}}function s2(e,t,n){mn.S(e,t,n);var l=ja;if(l&&e){var a=$l(l).hoistableStyles,i=ra(e);t=t||"default";var s=a.get(i);if(!s){var o={loading:0,preload:null};if(s=l.querySelector(qi(i)))o.loading=5;else{e=we({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ct.get(i))&&gf(e,n);var u=s=l.createElement("link");Ye(u),Ze(u,"link",e),u._p=new Promise(function(c,h){u.onload=c,u.onerror=h}),u.addEventListener("load",function(){o.loading|=1}),u.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Rs(s,t,l)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(i,s)}}}function o2(e,t){mn.X(e,t);var n=ja;if(n&&e){var l=$l(n).hoistableScripts,a=Ca(e),i=l.get(a);i||(i=n.querySelector(Gi(a)),i||(e=we({src:e,async:!0},t),(t=Ct.get(a))&&mf(e,t),i=n.createElement("script"),Ye(i),Ze(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function u2(e,t){mn.M(e,t);var n=ja;if(n&&e){var l=$l(n).hoistableScripts,a=Ca(e),i=l.get(a);i||(i=n.querySelector(Gi(a)),i||(e=we({src:e,async:!0,type:"module"},t),(t=Ct.get(a))&&mf(e,t),i=n.createElement("script"),Ye(i),Ze(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function ch(e,t,n,l){var a=(a=kn.current)?po(a):null;if(!a)throw Error(V(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ra(n.href),n=$l(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ra(n.href);var i=$l(a).hoistableStyles,s=i.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=a.querySelector(qi(e)))&&!i._p&&(s.instance=i,s.state.loading=5),Ct.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ct.set(e,n),i||r2(a,e,n,s.state))),t&&l===null)throw Error(V(528,""));return s}if(t&&l!==null)throw Error(V(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ca(n),n=$l(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(V(444,e))}}function ra(e){return'href="'+wt(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function b0(e){return we({},e,{"data-precedence":e.precedence,precedence:null})}function r2(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ze(t,"link",n),Ye(t),e.head.appendChild(t))}function Ca(e){return'[src="'+wt(e)+'"]'}function Gi(e){return"script[async]"+e}function fh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+wt(n.href)+'"]');if(l)return t.instance=l,Ye(l),l;var a=we({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ye(l),Ze(l,"style",a),Rs(l,n.precedence,e),t.instance=l;case"stylesheet":a=ra(n.href);var i=e.querySelector(qi(a));if(i)return t.state.loading|=4,t.instance=i,Ye(i),i;l=b0(n),(a=Ct.get(a))&&gf(l,a),i=(e.ownerDocument||e).createElement("link"),Ye(i);var s=i;return s._p=new Promise(function(o,u){s.onload=o,s.onerror=u}),Ze(i,"link",l),t.state.loading|=4,Rs(i,n.precedence,e),t.instance=i;case"script":return i=Ca(n.src),(a=e.querySelector(Gi(i)))?(t.instance=a,Ye(a),a):(l=n,(a=Ct.get(i))&&(l=we({},n),mf(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),Ye(a),Ze(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(V(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(l=t.instance,t.state.loading|=4,Rs(l,n.precedence,e));return t.instance}function Rs(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,s=0;s<l.length;s++){var o=l[s];if(o.dataset.precedence===t)i=o;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function gf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ls=null;function dh(e,t,n){if(Ls===null){var l=new Map,a=Ls=new Map;a.set(n,l)}else a=Ls,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Li]||i[Ge]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var o=l.get(s);o?o.push(i):l.set(s,[i])}}return l}function hh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function c2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function w0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function f2(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var a=ra(l.href),i=t.querySelector(qi(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,Ye(i);return}i=t.ownerDocument||t,l=b0(l),(a=Ct.get(a))&&gf(l,a),i=i.createElement("link"),Ye(i);var s=i;s._p=new Promise(function(o,u){s.onload=o,s.onerror=u}),Ze(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=yo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wu=0;function d2(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Wu===0&&(Wu=62500*Q_());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Wu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vo=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vo=new Map,t.forEach(h2,e),vo=null,yo.call(e))}function h2(e,t){if(!(t.state.loading&4)){var n=vo.get(e);if(n)var l=n.get(null);else{n=new Map,vo.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var s=a[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),l=s)}l&&n.set(null,l)}a=t.instance,s=a.getAttribute("data-precedence"),i=n.get(s)||l,i===l&&n.set(null,a),n.set(s,a),this.count++,l=yo.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var bi={$$typeof:tn,Provider:null,Consumer:null,_currentValue:ll,_currentValue2:ll,_threadCount:0};function g2(e,t,n,l,a,i,s,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xu(0),this.hiddenUpdates=xu(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function S0(e,t,n,l,a,i,s,o,u,c,h,d){return e=new g2(e,t,n,s,u,c,h,d,o),t=1,i===!0&&(t|=24),i=ut(3,null,null,t),e.current=i,i.stateNode=e,t=Yc(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},qc(i),e}function E0(e){return e?(e=Ul,e):Ul}function N0(e,t,n,l,a,i){a=E0(a),l.context===null?l.context=a:l.pendingContext=a,l=Hn(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=Rn(e,l,t),n!==null&&(lt(n,e,t),Pa(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pf(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function j0(e){if(e.tag===13||e.tag===31){var t=wl(e,67108864);t!==null&&lt(t,e,67108864),pf(e,67108864)}}function mh(e){if(e.tag===13||e.tag===31){var t=gt();t=jc(t);var n=wl(e,t);n!==null&&lt(n,e,t),pf(e,t)}}var xo=!0;function m2(e,t,n,l){var a=I.T;I.T=null;var i=fe.p;try{fe.p=2,yf(e,t,n,l)}finally{fe.p=i,I.T=a}}function p2(e,t,n,l){var a=I.T;I.T=null;var i=fe.p;try{fe.p=8,yf(e,t,n,l)}finally{fe.p=i,I.T=a}}function yf(e,t,n,l){if(xo){var a=tc(l);if(a===null)Ku(e,t,l,_o,n),ph(e,l);else if(v2(a,e,t,n,l))l.stopPropagation();else if(ph(e,l),t&4&&-1<y2.indexOf(e)){for(;a!==null;){var i=wa(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=In(i.pendingLanes);if(s!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var u=1<<31-ht(s);o.entanglements[1]|=u,s&=~u}Gt(i),!(ce&6)&&(uo=ft()+500,Xi(0))}}break;case 31:case 13:o=wl(i,2),o!==null&&lt(o,i,2),Zo(),pf(i,2)}if(i=tc(l),i===null&&Ku(e,t,l,_o,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else Ku(e,t,l,null,n)}}function tc(e){return e=Ac(e),vf(e)}var _o=null;function vf(e){if(_o=null,e=kl(e),e!==null){var t=ki(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Qg(t),e!==null)return e;e=null}else if(n===31){if(e=Zg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _o=e,null}function C0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(n1()){case Fg:return 2;case Ig:return 8;case Ks:case l1:return 32;case Pg:return 268435456;default:return 32}default:return 32}}var nc=!1,Un=null,Yn=null,Vn=null,wi=new Map,Si=new Map,jn=[],y2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ph(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Yn=null;break;case"mouseover":case"mouseout":Vn=null;break;case"pointerover":case"pointerout":wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Si.delete(t.pointerId)}}function Ba(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=wa(t),t!==null&&j0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function v2(e,t,n,l,a){switch(t){case"focusin":return Un=Ba(Un,e,t,n,l,a),!0;case"dragenter":return Yn=Ba(Yn,e,t,n,l,a),!0;case"mouseover":return Vn=Ba(Vn,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return wi.set(i,Ba(wi.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,Si.set(i,Ba(Si.get(i)||null,e,t,n,l,a)),!0}return!1}function M0(e){var t=kl(e.target);if(t!==null){var n=ki(t);if(n!==null){if(t=n.tag,t===13){if(t=Qg(n),t!==null){e.blockedOn=t,ed(e.priority,function(){mh(n)});return}}else if(t===31){if(t=Zg(n),t!==null){e.blockedOn=t,ed(e.priority,function(){mh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Us(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=tc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);_r=l,n.target.dispatchEvent(l),_r=null}else return t=wa(n),t!==null&&j0(t),e.blockedOn=n,!1;t.shift()}return!0}function yh(e,t,n){Us(e)&&n.delete(t)}function x2(){nc=!1,Un!==null&&Us(Un)&&(Un=null),Yn!==null&&Us(Yn)&&(Yn=null),Vn!==null&&Us(Vn)&&(Vn=null),wi.forEach(yh),Si.forEach(yh)}function ds(e,t){e.blockedOn===t&&(e.blockedOn=null,nc||(nc=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,x2)))}var hs=null;function vh(e){hs!==e&&(hs=e,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,function(){hs===e&&(hs=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(vf(l||n)===null)continue;break}var i=wa(n);i!==null&&(e.splice(t,3),t-=3,Rr(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function ca(e){function t(u){return ds(u,e)}Un!==null&&ds(Un,e),Yn!==null&&ds(Yn,e),Vn!==null&&ds(Vn,e),wi.forEach(t),Si.forEach(t);for(var n=0;n<jn.length;n++){var l=jn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<jn.length&&(n=jn[0],n.blockedOn===null);)M0(n),n.blockedOn===null&&jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],s=a[at]||null;if(typeof i=="function")s||vh(n);else if(s){var o=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[at]||null)o=s.formAction;else if(vf(a)!==null)continue}else o=s.action;typeof o=="function"?n[l+1]=o:(n.splice(l,3),l-=3),vh(n)}}}function T0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function xf(e){this._internalRoot=e}Wo.prototype.render=xf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));var n=t.current,l=gt();N0(n,l,e,t,null,null)};Wo.prototype.unmount=xf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;N0(e.current,2,null,e,null,null),Zo(),t[ba]=null}};function Wo(e){this._internalRoot=e}Wo.prototype.unstable_scheduleHydration=function(e){if(e){var t=am();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jn.length&&t!==0&&t<jn[n].priority;n++);jn.splice(n,0,e),n===0&&M0(e)}};var xh=Gg.version;if(xh!=="19.2.6")throw Error(V(527,xh,"19.2.6"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Jx(t),e=e!==null?Kg(e):null,e=e===null?null:e.stateNode,e};var _2={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gs.isDisabled&&gs.supportsFiber)try{Oi=gs.inject(_2),dt=gs}catch{}}ko.createRoot=function(e,t){if(!$g(e))throw Error(V(299));var n=!1,l="",a=_p,i=bp,s=wp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=S0(e,1,!1,null,null,n,l,null,a,i,s,T0),e[ba]=t.current,hf(e),new xf(t)};ko.hydrateRoot=function(e,t,n){if(!$g(e))throw Error(V(299));var l=!1,a="",i=_p,s=bp,o=wp,u=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=S0(e,1,!0,t,n??null,l,a,u,i,s,o,T0),t.context=E0(null),n=t.current,l=gt(),l=jc(l),a=Hn(l),a.callback=null,Rn(n,a,l),n=l,t.current.lanes=n,Ri(t,n),Gt(t),e[ba]=t.current,hf(e),new Wo(t)};ko.version="19.2.6";function A0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A0)}catch(e){console.error(e)}}A0(),Bg.exports=ko;var b2=Bg.exports;const w2="/api";async function Re(e,t,n){const l=await fetch(`${w2}${t}`,{method:e,headers:n?{"Content-Type":"application/json"}:{},body:n?JSON.stringify(n):void 0});if(!l.ok)throw new Error(`${e} ${t} failed: ${l.status}`);return l.json()}const Me={health:()=>Re("GET","/health"),claudeCheck:()=>Re("GET","/claude-check"),workflows:{list:()=>Re("GET","/workflows/list"),read:e=>Re("GET",`/workflows?path=${encodeURIComponent(e)}`),save:(e,t)=>Re("POST","/workflows",{path:e,content:t}),delete:e=>Re("DELETE",`/workflows?path=${encodeURIComponent(e)}`),rename:(e,t)=>Re("POST","/workflows/rename",{oldPath:e,newName:t})},agents:e=>Re("GET",`/agents${e?`?projectDir=${encodeURIComponent(e)}`:""}`),recents:{list:()=>Re("GET","/recents"),add:e=>Re("POST","/recents",{path:e}),remove:e=>Re("DELETE",`/recents?path=${encodeURIComponent(e)}`)},skills:()=>Re("GET","/skills"),export:(e,t)=>Re("POST","/export",{cwcFile:e,target:t}),exportPreview:(e,t)=>Re("POST","/export/preview",{cwcFile:e,target:t}),deleteExport:(e,t)=>Re("POST","/export/delete",{cwcFile:e,target:t}),exportedWorkflows:{list:()=>Re("GET","/exported-workflows"),delete:e=>Re("DELETE",`/exported-workflows?slug=${encodeURIComponent(e)}`)},fileContent:e=>Re("GET",`/file-content?path=${encodeURIComponent(e)}`),openFile:e=>Re("POST","/open-file",{path:e})};function S2(e,t=Date.now()){const n=t-new Date(e).getTime(),l=Math.floor(n/1e3);if(l<60)return"just now";const a=Math.floor(l/60);if(a<60)return`${a} min ago`;const i=Math.floor(a/60);return i<24?`${i} hr ago`:`${Math.floor(i/24)} days ago`}function E2(e){return e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~")}function N2({onSelect:e,onOpenRecent:t}){const[n,l]=T.useState([]),[a,i]=T.useState([]),[s,o]=T.useState(!1),[u,c]=T.useState(null),[h,d]=T.useState("new"),[f,g]=T.useState(!1),[v,x]=T.useState(null),[b,m]=T.useState(null),y=T.useRef(null);T.useEffect(()=>{Me.claudeCheck().then(S=>{S.installed||o(!0)}).catch(()=>{}),Me.workflows.list().then(S=>{l(S.slice().sort((w,E)=>E.updated.localeCompare(w.updated)))}).catch(()=>{}),Me.exportedWorkflows.list().then(i).catch(()=>{})},[]),T.useEffect(()=>{if(!v)return;function S(E){E.key==="Escape"&&x(null)}function w(E){var M;(M=y.current)!=null&&M.contains(E.target)||x(null)}return document.addEventListener("keydown",S),document.addEventListener("mousedown",w),()=>{document.removeEventListener("keydown",S),document.removeEventListener("mousedown",w)}},[v]);async function p(S){try{let w;try{w=await Me.workflows.read(S)}catch{}if(w)try{await Me.deleteExport(w,{type:"user"})}catch{}await Me.workflows.delete(S),await Me.recents.remove(S),l(E=>E.filter(M=>M.path!==S))}catch{l(w=>w.filter(E=>E.path!==S))}finally{x(null)}}async function _(S){try{await Me.exportedWorkflows.delete(S)}catch{}finally{i(w=>w.filter(E=>E.slug!==S)),m(null)}}async function j(){c(null),g(!0);try{const S={meta:{id:crypto.randomUUID(),name:"Untitled Workflow",description:"",version:1,created:new Date().toISOString(),updated:new Date().toISOString()},nodes:[],edges:[]},w=await fetch(`/api/workflows/default-path?name=${encodeURIComponent(S.meta.name)}`),{path:E}=await w.json();await Me.workflows.save(E,S),await Me.recents.add(E),e(S,E)}catch{c("Failed to create workflow. Is the server running?"),g(!1)}}return s?r.jsx("div",{className:"template-picker",children:r.jsxs("div",{className:"template-picker__notice",children:[r.jsx("div",{className:"template-picker__notice-icon",children:r.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M12 8v4"}),r.jsx("path",{d:"M12 16h.01"})]})}),r.jsx("h2",{className:"template-picker__notice-title",children:"Claude Code not found"}),r.jsxs("p",{className:"template-picker__notice-desc",children:["Install Claude Code first, then relaunch ",r.jsx("code",{children:"npx cwc"}),"."]})]})}):r.jsxs("div",{className:"template-picker",children:[r.jsxs("header",{className:"template-picker__header",children:[r.jsx("div",{className:"template-picker__logo",children:r.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),r.jsx("path",{d:"M2 17l10 5 10-5"}),r.jsx("path",{d:"M2 12l10 5 10-5"})]})}),r.jsx("h1",{className:"template-picker__title",children:"Workflow Composer"}),r.jsx("p",{className:"template-picker__subtitle",children:"Visually compose multi-agent workflows for Claude Code. Drag agents, attach skills, wire handoffs, and export."})]}),r.jsxs("div",{className:"template-picker__tabs",children:[r.jsxs("button",{className:`template-picker__tab${h==="new"?" template-picker__tab--active":""}`,onClick:()=>d("new"),type:"button",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 5v14"}),r.jsx("path",{d:"M5 12h14"})]}),"New Workflow"]}),r.jsxs("button",{className:`template-picker__tab${h==="workflows"?" template-picker__tab--active":""}`,onClick:()=>d("workflows"),type:"button",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"})]}),"Workflows",n.length>0&&r.jsx("span",{className:"template-picker__tab-badge",children:n.length})]}),r.jsxs("button",{className:`template-picker__tab${h==="deployed"?" template-picker__tab--active":""}`,onClick:()=>d("deployed"),type:"button",children:[r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Deployed",a.length>0&&r.jsx("span",{className:"template-picker__tab-badge",children:a.length})]})]}),u&&r.jsxs("div",{className:"template-picker__error",children:[r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M12 8v4"}),r.jsx("path",{d:"M12 16h.01"})]}),u]}),h==="new"&&r.jsx("section",{className:"template-picker__section",children:r.jsxs("button",{className:"template-card template-card--blank",onClick:j,disabled:f,type:"button",children:[r.jsx("div",{className:"template-card__icon",children:r.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M12 5v14"}),r.jsx("path",{d:"M5 12h14"})]})}),r.jsx("span",{className:"template-card__title",children:"Blank Canvas"}),r.jsx("span",{className:"template-card__desc",children:"Start from scratch with your own agents and skills"})]})}),h==="deployed"&&r.jsx("section",{className:"template-picker__section",children:a.length===0?r.jsxs("div",{className:"template-picker__empty-state",children:[r.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),r.jsx("p",{className:"template-picker__empty-text",children:"No deployed workflows."}),r.jsx("p",{className:"template-picker__empty-hint",children:"Export a workflow to see it here."})]}):r.jsx("div",{className:"template-picker__recent-list",children:a.map(S=>{const w=b===S.slug;return r.jsxs("div",{className:`template-picker__recent-item${w?" template-picker__recent-item--confirming":""}`,children:[r.jsxs("div",{className:"template-picker__recent-link template-picker__recent-link--static",children:[r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-primary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),r.jsxs("div",{className:"template-picker__recent-info",children:[r.jsx("span",{className:"template-picker__recent-name",children:S.name}),S.description&&r.jsx("span",{className:"template-picker__recent-meta",children:S.description}),r.jsxs("span",{className:"template-picker__recent-dir",children:["~/.claude/skills/",S.slug]})]})]}),w?r.jsxs("div",{ref:y,className:"template-picker__confirm-delete",children:[r.jsx("span",{className:"template-picker__confirm-msg",children:"Remove from Claude?"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--yes",onClick:()=>_(S.slug),type:"button",children:"Remove"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--no",onClick:()=>m(null),type:"button",children:"Cancel"})]}):r.jsx("button",{className:"template-picker__recent-delete",onClick:()=>m(S.slug),"aria-label":"Remove deployed workflow",type:"button",children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},S.slug)})})}),h==="workflows"&&r.jsx("section",{className:"template-picker__section",children:n.length===0?r.jsxs("div",{className:"template-picker__empty-state",children:[r.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"}),r.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),r.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),r.jsx("p",{className:"template-picker__empty-text",children:"No workflows yet."}),r.jsx("p",{className:"template-picker__empty-hint",children:"Create a new workflow to get started."})]}):r.jsx("div",{className:"template-picker__recent-list",children:n.map(S=>{const w=E2(S.path).replace(/\/[^/]*\.cwc$/,""),E=v===S.path;return r.jsxs("div",{className:`template-picker__recent-item${E?" template-picker__recent-item--confirming":""}`,children:[r.jsxs("button",{className:"template-picker__recent-link",onClick:()=>{t(S.path).catch(()=>{l(M=>M.filter(R=>R.path!==S.path)),c("That workflow was deleted or moved.")})},type:"button",children:[r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"})]}),r.jsxs("div",{className:"template-picker__recent-info",children:[r.jsx("span",{className:"template-picker__recent-name",children:S.name}),r.jsxs("span",{className:"template-picker__recent-meta",children:[S.nodeCount," agent",S.nodeCount!==1?"s":""," · ",S2(S.updated)]}),r.jsx("span",{className:"template-picker__recent-dir",children:w})]})]}),E?r.jsxs("div",{ref:y,className:"template-picker__confirm-delete",children:[r.jsx("span",{className:"template-picker__confirm-msg",children:"Delete?"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--yes",onClick:()=>p(S.path),type:"button",children:"Delete"}),r.jsx("button",{className:"template-picker__confirm-btn template-picker__confirm-btn--no",onClick:()=>x(null),type:"button",children:"Cancel"})]}):r.jsx("button",{className:"template-picker__recent-delete",onClick:()=>x(S.path),"aria-label":"Delete workflow",type:"button",children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},S.path)})})})]})}let ms;const j2=new Uint8Array(16);function C2(){if(!ms&&(ms=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ms))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ms(j2)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function M2(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const T2=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_h={randomUUID:T2};function bh(e,t,n){if(_h.randomUUID&&!e)return _h.randomUUID();e=e||{};const l=e.random||(e.rng||C2)();return l[6]=l[6]&15|64,l[8]=l[8]&63|128,M2(l)}function A2(e,t){const n=new Date().toISOString();switch(t.type){case"LOAD":return t.payload;case"SET_META":return{...e,meta:{...e.meta,...t.payload,updated:n}};case"ADD_NODE":{const l={id:`node-${bh().slice(0,8)}`,position:t.payload.position,exportedSlug:null,agent:t.payload.agent,agentRef:t.payload.agentRef};return{...e,nodes:[...e.nodes,l],meta:{...e.meta,updated:n}}}case"UPDATE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,agent:{...l.agent,...t.payload.agent},startTrigger:t.payload.startTrigger??l.startTrigger}:l)};case"MOVE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,position:t.payload.position}:l)};case"REMOVE_NODE":return{...e,meta:{...e.meta,updated:n},nodes:e.nodes.filter(l=>l.id!==t.payload.nodeId),edges:e.edges.filter(l=>l.from!==t.payload.nodeId&&l.to!==t.payload.nodeId)};case"ADD_EDGE":return{...e,meta:{...e.meta,updated:n},edges:[...e.edges,{id:`edge-${bh().slice(0,8)}`,...t.payload}]};case"UPDATE_EDGE":{const{edgeId:l,...a}=t.payload;return{...e,meta:{...e.meta,updated:n},edges:e.edges.map(i=>i.id===l?{...i,...a}:i)}}case"REMOVE_EDGE":return{...e,meta:{...e.meta,updated:n},edges:e.edges.filter(l=>l.id!==t.payload.edgeId)};case"UPDATE_EXPORTED_SLUG":return{...e,nodes:e.nodes.map(l=>l.id===t.payload.nodeId?{...l,exportedSlug:t.payload.slug}:l)};default:return e}}function z2(){const e=new Date().toISOString();return{meta:{id:"",name:"Untitled Workflow",description:"",version:1,created:e,updated:e},nodes:[],edges:[]}}function D2(e){const[t,n]=T.useReducer(A2,e??z2());return{workflow:t,dispatch:n}}function k2(e,t,n){const l=T.useRef(null),a=T.useRef(""),i=T.useRef(n==null?void 0:n.onError),s=T.useRef(n==null?void 0:n.onSuccess),o=T.useRef(e),u=T.useRef(t),[c,h]=T.useState(!1),[d,f]=T.useState(!1);T.useEffect(()=>{i.current=n==null?void 0:n.onError,s.current=n==null?void 0:n.onSuccess,o.current=e,u.current=t});const g=T.useCallback(async()=>{var y,p;const x=u.current,b=o.current;if(!x)return;h(!0);let m=!1;try{await Me.workflows.save(x,b),m=!0}catch(_){throw(y=i.current)==null||y.call(i,_),_}finally{h(!1),f(!1)}m&&((p=s.current)==null||p.call(s))},[]),v=T.useCallback(async()=>{l.current&&(clearTimeout(l.current),l.current=null),await g()},[g]);return T.useEffect(()=>{if(!t)return;const x=JSON.stringify(e);if(x!==a.current)return a.current=x,l.current&&clearTimeout(l.current),f(!0),l.current=setTimeout(()=>{l.current=null,g().catch(()=>{})},500),()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[e,t,g]),{isSaving:c,isDirty:d||c,flush:v}}function _f(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function O2(e){var a;const t=[],n=[];if(e.nodes.length===0)return{errors:t,warnings:n,canExport:!1};const l=new Map;for(const i of e.nodes)if(!i.agent.name.trim())t.push({type:"missing-name",nodeId:i.id,message:"Agent needs a name before export"});else{!i.agentRef&&!((a=i.agent.completionCriteria)!=null&&a.trim())&&n.push({type:"missing-completion-criteria",nodeId:i.id,message:"Add completion criteria so the agent knows when to stop"});const s=i.agentRef??_f(i.agent.name),o=l.get(s)??[];l.set(s,[...o,i.id])}for(const[,i]of l)i.length>1&&i.forEach(s=>n.push({type:"duplicate-slug",nodeId:s,message:"Two agents produce the same filename — rename one"}));if(e.edges.length>0){const i=new Set(e.edges.filter(u=>u.to).map(u=>u.to)),s=new Set(e.edges.map(u=>u.from)),o=new Set(e.edges.filter(u=>u.to===null).map(u=>u.from));for(const u of e.nodes){const c=i.has(u.id),h=s.has(u.id),d=o.has(u.id);!c&&!h?n.push({type:"disconnected-node",nodeId:u.id,message:"This agent isn't connected to the workflow"}):!h&&!d&&n.push({type:"no-handoff",nodeId:u.id,message:"This agent has no handoff — add an arrow or mark it as a workflow end"})}}return{errors:t,warnings:n,canExport:t.length===0}}function He(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,l;n<e.length;n++)(l=He(e[n]))!==""&&(t+=(t&&" ")+l);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var H2={value:()=>{}};function Fo(){for(var e=0,t=arguments.length,n={},l;e<t;++e){if(!(l=arguments[e]+"")||l in n||/[\s.]/.test(l))throw new Error("illegal type: "+l);n[l]=[]}return new Ys(n)}function Ys(e){this._=e}function R2(e,t){return e.trim().split(/^|\s+/).map(function(n){var l="",a=n.indexOf(".");if(a>=0&&(l=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:l}})}Ys.prototype=Fo.prototype={constructor:Ys,on:function(e,t){var n=this._,l=R2(e+"",n),a,i=-1,s=l.length;if(arguments.length<2){for(;++i<s;)if((a=(e=l[i]).type)&&(a=L2(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=l[i]).type)n[a]=wh(n[a],e.name,t);else if(t==null)for(a in n)n[a]=wh(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ys(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),l=0,a,i;l<a;++l)n[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],l=0,a=i.length;l<a;++l)i[l].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var l=this._[e],a=0,i=l.length;a<i;++a)l[a].value.apply(t,n)}};function L2(e,t){for(var n=0,l=e.length,a;n<l;++n)if((a=e[n]).name===t)return a.value}function wh(e,t,n){for(var l=0,a=e.length;l<a;++l)if(e[l].name===t){e[l]=H2,e=e.slice(0,l).concat(e.slice(l+1));break}return n!=null&&e.push({name:t,value:n}),e}var lc="http://www.w3.org/1999/xhtml";const Sh={svg:"http://www.w3.org/2000/svg",xhtml:lc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Io(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Sh.hasOwnProperty(t)?{space:Sh[t],local:e}:e}function B2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lc&&t.documentElement.namespaceURI===lc?t.createElement(e):t.createElementNS(n,e)}}function U2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function z0(e){var t=Io(e);return(t.local?U2:B2)(t)}function Y2(){}function bf(e){return e==null?Y2:function(){return this.querySelector(e)}}function V2(e){typeof e!="function"&&(e=bf(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=new Array(s),u,c,h=0;h<s;++h)(u=i[h])&&(c=e.call(u,u.__data__,h,i))&&("__data__"in u&&(c.__data__=u.__data__),o[h]=c);return new yt(l,this._parents)}function X2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function q2(){return[]}function D0(e){return e==null?q2:function(){return this.querySelectorAll(e)}}function G2(e){return function(){return X2(e.apply(this,arguments))}}function $2(e){typeof e=="function"?e=G2(e):e=D0(e);for(var t=this._groups,n=t.length,l=[],a=[],i=0;i<n;++i)for(var s=t[i],o=s.length,u,c=0;c<o;++c)(u=s[c])&&(l.push(e.call(u,u.__data__,c,s)),a.push(u));return new yt(l,a)}function k0(e){return function(){return this.matches(e)}}function O0(e){return function(t){return t.matches(e)}}var Q2=Array.prototype.find;function Z2(e){return function(){return Q2.call(this.children,e)}}function K2(){return this.firstElementChild}function J2(e){return this.select(e==null?K2:Z2(typeof e=="function"?e:O0(e)))}var W2=Array.prototype.filter;function F2(){return Array.from(this.children)}function I2(e){return function(){return W2.call(this.children,e)}}function P2(e){return this.selectAll(e==null?F2:I2(typeof e=="function"?e:O0(e)))}function eb(e){typeof e!="function"&&(e=k0(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=[],u,c=0;c<s;++c)(u=i[c])&&e.call(u,u.__data__,c,i)&&o.push(u);return new yt(l,this._parents)}function H0(e){return new Array(e.length)}function tb(){return new yt(this._enter||this._groups.map(H0),this._parents)}function bo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bo.prototype={constructor:bo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function nb(e){return function(){return e}}function lb(e,t,n,l,a,i){for(var s=0,o,u=t.length,c=i.length;s<c;++s)(o=t[s])?(o.__data__=i[s],l[s]=o):n[s]=new bo(e,i[s]);for(;s<u;++s)(o=t[s])&&(a[s]=o)}function ab(e,t,n,l,a,i,s){var o,u,c=new Map,h=t.length,d=i.length,f=new Array(h),g;for(o=0;o<h;++o)(u=t[o])&&(f[o]=g=s.call(u,u.__data__,o,t)+"",c.has(g)?a[o]=u:c.set(g,u));for(o=0;o<d;++o)g=s.call(e,i[o],o,i)+"",(u=c.get(g))?(l[o]=u,u.__data__=i[o],c.delete(g)):n[o]=new bo(e,i[o]);for(o=0;o<h;++o)(u=t[o])&&c.get(f[o])===u&&(a[o]=u)}function ib(e){return e.__data__}function sb(e,t){if(!arguments.length)return Array.from(this,ib);var n=t?ab:lb,l=this._parents,a=this._groups;typeof e!="function"&&(e=nb(e));for(var i=a.length,s=new Array(i),o=new Array(i),u=new Array(i),c=0;c<i;++c){var h=l[c],d=a[c],f=d.length,g=ob(e.call(h,h&&h.__data__,c,l)),v=g.length,x=o[c]=new Array(v),b=s[c]=new Array(v),m=u[c]=new Array(f);n(h,d,x,b,m,g,t);for(var y=0,p=0,_,j;y<v;++y)if(_=x[y]){for(y>=p&&(p=y+1);!(j=b[p])&&++p<v;);_._next=j||null}}return s=new yt(s,l),s._enter=o,s._exit=u,s}function ob(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ub(){return new yt(this._exit||this._groups.map(H0),this._parents)}function rb(e,t,n){var l=this.enter(),a=this,i=this.exit();return typeof e=="function"?(l=e(l),l&&(l=l.selection())):l=l.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),l&&a?l.merge(a).order():a}function cb(e){for(var t=e.selection?e.selection():e,n=this._groups,l=t._groups,a=n.length,i=l.length,s=Math.min(a,i),o=new Array(a),u=0;u<s;++u)for(var c=n[u],h=l[u],d=c.length,f=o[u]=new Array(d),g,v=0;v<d;++v)(g=c[v]||h[v])&&(f[v]=g);for(;u<a;++u)o[u]=n[u];return new yt(o,this._parents)}function fb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var l=e[t],a=l.length-1,i=l[a],s;--a>=0;)(s=l[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function db(e){e||(e=hb);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,l=n.length,a=new Array(l),i=0;i<l;++i){for(var s=n[i],o=s.length,u=a[i]=new Array(o),c,h=0;h<o;++h)(c=s[h])&&(u[h]=c);u.sort(t)}return new yt(a,this._parents).order()}function hb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mb(){return Array.from(this)}function pb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var l=e[t],a=0,i=l.length;a<i;++a){var s=l[a];if(s)return s}return null}function yb(){let e=0;for(const t of this)++e;return e}function vb(){return!this.node()}function xb(e){for(var t=this._groups,n=0,l=t.length;n<l;++n)for(var a=t[n],i=0,s=a.length,o;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this}function _b(e){return function(){this.removeAttribute(e)}}function bb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wb(e,t){return function(){this.setAttribute(e,t)}}function Sb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Eb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Nb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jb(e,t){var n=Io(e);if(arguments.length<2){var l=this.node();return n.local?l.getAttributeNS(n.space,n.local):l.getAttribute(n)}return this.each((t==null?n.local?bb:_b:typeof t=="function"?n.local?Nb:Eb:n.local?Sb:wb)(n,t))}function R0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Cb(e){return function(){this.style.removeProperty(e)}}function Mb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Tb(e,t,n){return function(){var l=t.apply(this,arguments);l==null?this.style.removeProperty(e):this.style.setProperty(e,l,n)}}function Ab(e,t,n){return arguments.length>1?this.each((t==null?Cb:typeof t=="function"?Tb:Mb)(e,t,n??"")):fa(this.node(),e)}function fa(e,t){return e.style.getPropertyValue(t)||R0(e).getComputedStyle(e,null).getPropertyValue(t)}function zb(e){return function(){delete this[e]}}function Db(e,t){return function(){this[e]=t}}function kb(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ob(e,t){return arguments.length>1?this.each((t==null?zb:typeof t=="function"?kb:Db)(e,t)):this.node()[e]}function L0(e){return e.trim().split(/^|\s+/)}function wf(e){return e.classList||new B0(e)}function B0(e){this._node=e,this._names=L0(e.getAttribute("class")||"")}B0.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function U0(e,t){for(var n=wf(e),l=-1,a=t.length;++l<a;)n.add(t[l])}function Y0(e,t){for(var n=wf(e),l=-1,a=t.length;++l<a;)n.remove(t[l])}function Hb(e){return function(){U0(this,e)}}function Rb(e){return function(){Y0(this,e)}}function Lb(e,t){return function(){(t.apply(this,arguments)?U0:Y0)(this,e)}}function Bb(e,t){var n=L0(e+"");if(arguments.length<2){for(var l=wf(this.node()),a=-1,i=n.length;++a<i;)if(!l.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Lb:t?Hb:Rb)(n,t))}function Ub(){this.textContent=""}function Yb(e){return function(){this.textContent=e}}function Vb(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Xb(e){return arguments.length?this.each(e==null?Ub:(typeof e=="function"?Vb:Yb)(e)):this.node().textContent}function qb(){this.innerHTML=""}function Gb(e){return function(){this.innerHTML=e}}function $b(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qb(e){return arguments.length?this.each(e==null?qb:(typeof e=="function"?$b:Gb)(e)):this.node().innerHTML}function Zb(){this.nextSibling&&this.parentNode.appendChild(this)}function Kb(){return this.each(Zb)}function Jb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wb(){return this.each(Jb)}function Fb(e){var t=typeof e=="function"?e:z0(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ib(){return null}function Pb(e,t){var n=typeof e=="function"?e:z0(e),l=t==null?Ib:typeof t=="function"?t:bf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),l.apply(this,arguments)||null)})}function ew(){var e=this.parentNode;e&&e.removeChild(this)}function tw(){return this.each(ew)}function nw(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function aw(e){return this.select(e?lw:nw)}function iw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sw(e){return function(t){e.call(this,t,this.__data__)}}function ow(e){return e.trim().split(/^|\s+/).map(function(t){var n="",l=t.indexOf(".");return l>=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function uw(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++l]=i;++l?t.length=l:delete this.__on}}}function rw(e,t,n){return function(){var l=this.__on,a,i=sw(t);if(l){for(var s=0,o=l.length;s<o;++s)if((a=l[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},l?l.push(a):this.__on=[a]}}function cw(e,t,n){var l=ow(e+""),a,i=l.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,c=o.length,h;u<c;++u)for(a=0,h=o[u];a<i;++a)if((s=l[a]).type===h.type&&s.name===h.name)return h.value}return}for(o=t?rw:uw,a=0;a<i;++a)this.each(o(l[a],t,n));return this}function V0(e,t,n){var l=R0(e),a=l.CustomEvent;typeof a=="function"?a=new a(t,n):(a=l.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function fw(e,t){return function(){return V0(this,e,t)}}function dw(e,t){return function(){return V0(this,e,t.apply(this,arguments))}}function hw(e,t){return this.each((typeof t=="function"?dw:fw)(e,t))}function*gw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var l=e[t],a=0,i=l.length,s;a<i;++a)(s=l[a])&&(yield s)}var X0=[null];function yt(e,t){this._groups=e,this._parents=t}function $i(){return new yt([[document.documentElement]],X0)}function mw(){return this}yt.prototype=$i.prototype={constructor:yt,select:V2,selectAll:$2,selectChild:J2,selectChildren:P2,filter:eb,data:sb,enter:tb,exit:ub,join:rb,merge:cb,selection:mw,order:fb,sort:db,call:gb,nodes:mb,node:pb,size:yb,empty:vb,each:xb,attr:jb,style:Ab,property:Ob,classed:Bb,text:Xb,html:Qb,raise:Kb,lower:Wb,append:Fb,insert:Pb,remove:tw,clone:aw,datum:iw,on:cw,dispatch:hw,[Symbol.iterator]:gw};function rt(e){return typeof e=="string"?new yt([[document.querySelector(e)]],[document.documentElement]):new yt([[e]],X0)}function pw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function At(e,t){if(e=pw(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var l=n.createSVGPoint();return l.x=e.clientX,l.y=e.clientY,l=l.matrixTransform(t.getScreenCTM().inverse()),[l.x,l.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const yw={passive:!1},Ei={capture:!0,passive:!1};function Fu(e){e.stopImmediatePropagation()}function Il(e){e.preventDefault(),e.stopImmediatePropagation()}function q0(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",Il,Ei);"onselectstart"in t?n.on("selectstart.drag",Il,Ei):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function G0(e,t){var n=e.document.documentElement,l=rt(e).on("dragstart.drag",null);t&&(l.on("click.drag",Il,Ei),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in n?l.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ps=e=>()=>e;function ac(e,{sourceEvent:t,subject:n,target:l,identifier:a,active:i,x:s,y:o,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:l,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}ac.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vw(e){return!e.ctrlKey&&!e.button}function xw(){return this.parentNode}function _w(e,t){return t??{x:e.x,y:e.y}}function bw(){return navigator.maxTouchPoints||"ontouchstart"in this}function $0(){var e=vw,t=xw,n=_w,l=bw,a={},i=Fo("start","drag","end"),s=0,o,u,c,h,d=0;function f(_){_.on("mousedown.drag",g).filter(l).on("touchstart.drag",b).on("touchmove.drag",m,yw).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(_,j){if(!(h||!e.call(this,_,j))){var S=p(this,t.call(this,_,j),_,j,"mouse");S&&(rt(_.view).on("mousemove.drag",v,Ei).on("mouseup.drag",x,Ei),q0(_.view),Fu(_),c=!1,o=_.clientX,u=_.clientY,S("start",_))}}function v(_){if(Il(_),!c){var j=_.clientX-o,S=_.clientY-u;c=j*j+S*S>d}a.mouse("drag",_)}function x(_){rt(_.view).on("mousemove.drag mouseup.drag",null),G0(_.view,c),Il(_),a.mouse("end",_)}function b(_,j){if(e.call(this,_,j)){var S=_.changedTouches,w=t.call(this,_,j),E=S.length,M,R;for(M=0;M<E;++M)(R=p(this,w,_,j,S[M].identifier,S[M]))&&(Fu(_),R("start",_,S[M]))}}function m(_){var j=_.changedTouches,S=j.length,w,E;for(w=0;w<S;++w)(E=a[j[w].identifier])&&(Il(_),E("drag",_,j[w]))}function y(_){var j=_.changedTouches,S=j.length,w,E;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),w=0;w<S;++w)(E=a[j[w].identifier])&&(Fu(_),E("end",_,j[w]))}function p(_,j,S,w,E,M){var R=i.copy(),k=At(M||S,j),O,Y,C;if((C=n.call(_,new ac("beforestart",{sourceEvent:S,target:f,identifier:E,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:R}),w))!=null)return O=C.x-k[0]||0,Y=C.y-k[1]||0,function H(N,z,A){var D=k,B;switch(N){case"start":a[E]=H,B=s++;break;case"end":delete a[E],--s;case"drag":k=At(A||z,j),B=s;break}R.call(N,_,new ac(N,{sourceEvent:z,subject:C,target:f,identifier:E,active:B,x:k[0]+O,y:k[1]+Y,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:R}),w)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ps(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:ps(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:ps(_),f):n},f.touchable=function(_){return arguments.length?(l=typeof _=="function"?_:ps(!!_),f):l},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Sf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Q0(e,t){var n=Object.create(e.prototype);for(var l in t)n[l]=t[l];return n}function Qi(){}var Ni=.7,wo=1/Ni,Pl="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ww=/^#([0-9a-f]{3,8})$/,Sw=new RegExp(`^rgb\\(${Pl},${Pl},${Pl}\\)$`),Ew=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),Nw=new RegExp(`^rgba\\(${Pl},${Pl},${Pl},${ji}\\)$`),jw=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${ji}\\)$`),Cw=new RegExp(`^hsl\\(${ji},${Vt},${Vt}\\)$`),Mw=new RegExp(`^hsla\\(${ji},${Vt},${Vt},${ji}\\)$`),Eh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sf(Qi,ml,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nh,formatHex:Nh,formatHex8:Tw,formatHsl:Aw,formatRgb:jh,toString:jh});function Nh(){return this.rgb().formatHex()}function Tw(){return this.rgb().formatHex8()}function Aw(){return Z0(this).formatHsl()}function jh(){return this.rgb().formatRgb()}function ml(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ww.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ch(t):n===3?new nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ys(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ys(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Sw.exec(e))?new nt(t[1],t[2],t[3],1):(t=Ew.exec(e))?new nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nw.exec(e))?ys(t[1],t[2],t[3],t[4]):(t=jw.exec(e))?ys(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Cw.exec(e))?Ah(t[1],t[2]/100,t[3]/100,1):(t=Mw.exec(e))?Ah(t[1],t[2]/100,t[3]/100,t[4]):Eh.hasOwnProperty(e)?Ch(Eh[e]):e==="transparent"?new nt(NaN,NaN,NaN,0):null}function Ch(e){return new nt(e>>16&255,e>>8&255,e&255,1)}function ys(e,t,n,l){return l<=0&&(e=t=n=NaN),new nt(e,t,n,l)}function zw(e){return e instanceof Qi||(e=ml(e)),e?(e=e.rgb(),new nt(e.r,e.g,e.b,e.opacity)):new nt}function ic(e,t,n,l){return arguments.length===1?zw(e):new nt(e,t,n,l??1)}function nt(e,t,n,l){this.r=+e,this.g=+t,this.b=+n,this.opacity=+l}Sf(nt,ic,Q0(Qi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nt(ul(this.r),ul(this.g),ul(this.b),So(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:Mh,formatHex:Mh,formatHex8:Dw,formatRgb:Th,toString:Th}));function Mh(){return`#${nl(this.r)}${nl(this.g)}${nl(this.b)}`}function Dw(){return`#${nl(this.r)}${nl(this.g)}${nl(this.b)}${nl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Th(){const e=So(this.opacity);return`${e===1?"rgb(":"rgba("}${ul(this.r)}, ${ul(this.g)}, ${ul(this.b)}${e===1?")":`, ${e})`}`}function So(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ul(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nl(e){return e=ul(e),(e<16?"0":"")+e.toString(16)}function Ah(e,t,n,l){return l<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zt(e,t,n,l)}function Z0(e){if(e instanceof zt)return new zt(e.h,e.s,e.l,e.opacity);if(e instanceof Qi||(e=ml(e)),!e)return new zt;if(e instanceof zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,l=e.b/255,a=Math.min(t,n,l),i=Math.max(t,n,l),s=NaN,o=i-a,u=(i+a)/2;return o?(t===i?s=(n-l)/o+(n<l)*6:n===i?s=(l-t)/o+2:s=(t-n)/o+4,o/=u<.5?i+a:2-i-a,s*=60):o=u>0&&u<1?0:s,new zt(s,o,u,e.opacity)}function kw(e,t,n,l){return arguments.length===1?Z0(e):new zt(e,t,n,l??1)}function zt(e,t,n,l){this.h=+e,this.s=+t,this.l=+n,this.opacity=+l}Sf(zt,kw,Q0(Qi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new zt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,l=n+(n<.5?n:1-n)*t,a=2*n-l;return new nt(Iu(e>=240?e-240:e+120,a,l),Iu(e,a,l),Iu(e<120?e+240:e-120,a,l),this.opacity)},clamp(){return new zt(zh(this.h),vs(this.s),vs(this.l),So(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=So(this.opacity);return`${e===1?"hsl(":"hsla("}${zh(this.h)}, ${vs(this.s)*100}%, ${vs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zh(e){return e=(e||0)%360,e<0?e+360:e}function vs(e){return Math.max(0,Math.min(1,e||0))}function Iu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ef=e=>()=>e;function Ow(e,t){return function(n){return e+n*t}}function Hw(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(l){return Math.pow(e+l*t,n)}}function Rw(e){return(e=+e)==1?K0:function(t,n){return n-t?Hw(t,n,e):Ef(isNaN(t)?n:t)}}function K0(e,t){var n=t-e;return n?Ow(e,n):Ef(isNaN(e)?t:e)}const Eo=function e(t){var n=Rw(t);function l(a,i){var s=n((a=ic(a)).r,(i=ic(i)).r),o=n(a.g,i.g),u=n(a.b,i.b),c=K0(a.opacity,i.opacity);return function(h){return a.r=s(h),a.g=o(h),a.b=u(h),a.opacity=c(h),a+""}}return l.gamma=e,l}(1);function Lw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,l=t.slice(),a;return function(i){for(a=0;a<n;++a)l[a]=e[a]*(1-i)+t[a]*i;return l}}function Bw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uw(e,t){var n=t?t.length:0,l=e?Math.min(n,e.length):0,a=new Array(l),i=new Array(n),s;for(s=0;s<l;++s)a[s]=ui(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(o){for(s=0;s<l;++s)i[s]=a[s](o);return i}}function Yw(e,t){var n=new Date;return e=+e,t=+t,function(l){return n.setTime(e*(1-l)+t*l),n}}function Rt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vw(e,t){var n={},l={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=ui(e[a],t[a]):l[a]=t[a];return function(i){for(a in n)l[a]=n[a](i);return l}}var sc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pu=new RegExp(sc.source,"g");function Xw(e){return function(){return e}}function qw(e){return function(t){return e(t)+""}}function J0(e,t){var n=sc.lastIndex=Pu.lastIndex=0,l,a,i,s=-1,o=[],u=[];for(e=e+"",t=t+"";(l=sc.exec(e))&&(a=Pu.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),o[s]?o[s]+=i:o[++s]=i),(l=l[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,u.push({i:s,x:Rt(l,a)})),n=Pu.lastIndex;return n<t.length&&(i=t.slice(n),o[s]?o[s]+=i:o[++s]=i),o.length<2?u[0]?qw(u[0].x):Xw(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)o[(d=u[h]).i]=d.x(c);return o.join("")})}function ui(e,t){var n=typeof t,l;return t==null||n==="boolean"?Ef(t):(n==="number"?Rt:n==="string"?(l=ml(t))?(t=l,Eo):J0:t instanceof ml?Eo:t instanceof Date?Yw:Bw(t)?Lw:Array.isArray(t)?Uw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vw:Rt)(e,t)}var Dh=180/Math.PI,oc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function W0(e,t,n,l,a,i){var s,o,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*l)&&(n-=e*u,l-=t*u),(o=Math.sqrt(n*n+l*l))&&(n/=o,l/=o,u/=o),e*l<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*Dh,skewX:Math.atan(u)*Dh,scaleX:s,scaleY:o}}var xs;function Gw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oc:W0(t.a,t.b,t.c,t.d,t.e,t.f)}function $w(e){return e==null||(xs||(xs=document.createElementNS("http://www.w3.org/2000/svg","g")),xs.setAttribute("transform",e),!(e=xs.transform.baseVal.consolidate()))?oc:(e=e.matrix,W0(e.a,e.b,e.c,e.d,e.e,e.f))}function F0(e,t,n,l){function a(c){return c.length?c.pop()+" ":""}function i(c,h,d,f,g,v){if(c!==d||h!==f){var x=g.push("translate(",null,t,null,n);v.push({i:x-4,x:Rt(c,d)},{i:x-2,x:Rt(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(a(d)+"rotate(",null,l)-2,x:Rt(c,h)})):h&&d.push(a(d)+"rotate("+h+l)}function o(c,h,d,f){c!==h?f.push({i:d.push(a(d)+"skewX(",null,l)-2,x:Rt(c,h)}):h&&d.push(a(d)+"skewX("+h+l)}function u(c,h,d,f,g,v){if(c!==d||h!==f){var x=g.push(a(g)+"scale(",null,",",null,")");v.push({i:x-4,x:Rt(c,d)},{i:x-2,x:Rt(h,f)})}else(d!==1||f!==1)&&g.push(a(g)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),i(c.translateX,c.translateY,h.translateX,h.translateY,d,f),s(c.rotate,h.rotate,d,f),o(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(g){for(var v=-1,x=f.length,b;++v<x;)d[(b=f[v]).i]=b.x(g);return d.join("")}}}var Qw=F0(Gw,"px, ","px)","deg)"),Zw=F0($w,", ",")",")"),Kw=1e-12;function kh(e){return((e=Math.exp(e))+1/e)/2}function Jw(e){return((e=Math.exp(e))-1/e)/2}function Ww(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vs=function e(t,n,l){function a(i,s){var o=i[0],u=i[1],c=i[2],h=s[0],d=s[1],f=s[2],g=h-o,v=d-u,x=g*g+v*v,b,m;if(x<Kw)m=Math.log(f/c)/t,b=function(w){return[o+w*g,u+w*v,c*Math.exp(t*w*m)]};else{var y=Math.sqrt(x),p=(f*f-c*c+l*x)/(2*c*n*y),_=(f*f-c*c-l*x)/(2*f*n*y),j=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(_*_+1)-_);m=(S-j)/t,b=function(w){var E=w*m,M=kh(j),R=c/(n*y)*(M*Ww(t*E+j)-Jw(j));return[o+R*g,u+R*v,c*M/kh(t*E+j)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return a.rho=function(i){var s=Math.max(.001,+i),o=s*s,u=o*o;return e(s,o,u)},a}(Math.SQRT2,2,4);var da=0,Qa=0,Ua=0,I0=1e3,No,Za,jo=0,pl=0,Po=0,Ci=typeof performance=="object"&&performance.now?performance:Date,P0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nf(){return pl||(P0(Fw),pl=Ci.now()+Po)}function Fw(){pl=0}function Co(){this._call=this._time=this._next=null}Co.prototype=ey.prototype={constructor:Co,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nf():+n)+(t==null?0:+t),!this._next&&Za!==this&&(Za?Za._next=this:No=this,Za=this),this._call=e,this._time=n,uc()},stop:function(){this._call&&(this._call=null,this._time=1/0,uc())}};function ey(e,t,n){var l=new Co;return l.restart(e,t,n),l}function Iw(){Nf(),++da;for(var e=No,t;e;)(t=pl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--da}function Oh(){pl=(jo=Ci.now())+Po,da=Qa=0;try{Iw()}finally{da=0,eS(),pl=0}}function Pw(){var e=Ci.now(),t=e-jo;t>I0&&(Po-=t,jo=e)}function eS(){for(var e,t=No,n,l=1/0;t;)t._call?(l>t._time&&(l=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:No=n);Za=e,uc(l)}function uc(e){if(!da){Qa&&(Qa=clearTimeout(Qa));var t=e-pl;t>24?(e<1/0&&(Qa=setTimeout(Oh,e-Ci.now()-Po)),Ua&&(Ua=clearInterval(Ua))):(Ua||(jo=Ci.now(),Ua=setInterval(Pw,I0)),da=1,P0(Oh))}}function Hh(e,t,n){var l=new Co;return t=t==null?0:+t,l.restart(a=>{l.stop(),e(a+t)},t,n),l}var tS=Fo("start","end","cancel","interrupt"),nS=[],ty=0,Rh=1,rc=2,Xs=3,Lh=4,cc=5,qs=6;function eu(e,t,n,l,a,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;lS(e,n,{name:t,index:l,group:a,on:tS,tween:nS,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ty})}function jf(e,t){var n=Ht(e,t);if(n.state>ty)throw new Error("too late; already scheduled");return n}function $t(e,t){var n=Ht(e,t);if(n.state>Xs)throw new Error("too late; already running");return n}function Ht(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lS(e,t,n){var l=e.__transition,a;l[t]=n,n.timer=ey(i,0,n.time);function i(c){n.state=Rh,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var h,d,f,g;if(n.state!==Rh)return u();for(h in l)if(g=l[h],g.name===n.name){if(g.state===Xs)return Hh(s);g.state===Lh?(g.state=qs,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete l[h]):+h<t&&(g.state=qs,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete l[h])}if(Hh(function(){n.state===Xs&&(n.state=Lh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=rc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===rc){for(n.state=Xs,a=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=g);a.length=d+1}}function o(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=cc,1),d=-1,f=a.length;++d<f;)a[d].call(e,h);n.state===cc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=qs,n.timer.stop(),delete l[t];for(var c in l)return;delete e.__transition}}function Gs(e,t){var n=e.__transition,l,a,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((l=n[s]).name!==t){i=!1;continue}a=l.state>rc&&l.state<cc,l.state=qs,l.timer.stop(),l.on.call(a?"interrupt":"cancel",e,e.__data__,l.index,l.group),delete n[s]}i&&delete e.__transition}}function aS(e){return this.each(function(){Gs(this,e)})}function iS(e,t){var n,l;return function(){var a=$t(this,e),i=a.tween;if(i!==n){l=n=i;for(var s=0,o=l.length;s<o;++s)if(l[s].name===t){l=l.slice(),l.splice(s,1);break}}a.tween=l}}function sS(e,t,n){var l,a;if(typeof n!="function")throw new Error;return function(){var i=$t(this,e),s=i.tween;if(s!==l){a=(l=s).slice();for(var o={name:t,value:n},u=0,c=a.length;u<c;++u)if(a[u].name===t){a[u]=o;break}u===c&&a.push(o)}i.tween=a}}function oS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var l=Ht(this.node(),n).tween,a=0,i=l.length,s;a<i;++a)if((s=l[a]).name===e)return s.value;return null}return this.each((t==null?iS:sS)(n,e,t))}function Cf(e,t,n){var l=e._id;return e.each(function(){var a=$t(this,l);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Ht(a,l).value[t]}}function ny(e,t){var n;return(typeof t=="number"?Rt:t instanceof ml?Eo:(n=ml(t))?(t=n,Eo):J0)(e,t)}function uS(e){return function(){this.removeAttribute(e)}}function rS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cS(e,t,n){var l,a=n+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===l?i:i=t(l=s,n)}}function fS(e,t,n){var l,a=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===l?i:i=t(l=s,n)}}function dS(e,t,n){var l,a,i;return function(){var s,o=n(this),u;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=o+"",s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o)))}}function hS(e,t,n){var l,a,i;return function(){var s,o=n(this),u;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=o+"",s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o)))}}function gS(e,t){var n=Io(e),l=n==="transform"?Zw:ny;return this.attrTween(e,typeof t=="function"?(n.local?hS:dS)(n,l,Cf(this,"attr."+e,t)):t==null?(n.local?rS:uS)(n):(n.local?fS:cS)(n,l,t))}function mS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yS(e,t){var n,l;function a(){var i=t.apply(this,arguments);return i!==l&&(n=(l=i)&&pS(e,i)),n}return a._value=t,a}function vS(e,t){var n,l;function a(){var i=t.apply(this,arguments);return i!==l&&(n=(l=i)&&mS(e,i)),n}return a._value=t,a}function xS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var l=Io(e);return this.tween(n,(l.local?yS:vS)(l,t))}function _S(e,t){return function(){jf(this,e).delay=+t.apply(this,arguments)}}function bS(e,t){return t=+t,function(){jf(this,e).delay=t}}function wS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_S:bS)(t,e)):Ht(this.node(),t).delay}function SS(e,t){return function(){$t(this,e).duration=+t.apply(this,arguments)}}function ES(e,t){return t=+t,function(){$t(this,e).duration=t}}function NS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?SS:ES)(t,e)):Ht(this.node(),t).duration}function jS(e,t){if(typeof t!="function")throw new Error;return function(){$t(this,e).ease=t}}function CS(e){var t=this._id;return arguments.length?this.each(jS(t,e)):Ht(this.node(),t).ease}function MS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$t(this,e).ease=n}}function TS(e){if(typeof e!="function")throw new Error;return this.each(MS(this._id,e))}function AS(e){typeof e!="function"&&(e=k0(e));for(var t=this._groups,n=t.length,l=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,o=l[a]=[],u,c=0;c<s;++c)(u=i[c])&&e.call(u,u.__data__,c,i)&&o.push(u);return new gn(l,this._parents,this._name,this._id)}function zS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,l=t.length,a=n.length,i=Math.min(l,a),s=new Array(l),o=0;o<i;++o)for(var u=t[o],c=n[o],h=u.length,d=s[o]=new Array(h),f,g=0;g<h;++g)(f=u[g]||c[g])&&(d[g]=f);for(;o<l;++o)s[o]=t[o];return new gn(s,this._parents,this._name,this._id)}function DS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function kS(e,t,n){var l,a,i=DS(t)?jf:$t;return function(){var s=i(this,e),o=s.on;o!==l&&(a=(l=o).copy()).on(t,n),s.on=a}}function OS(e,t){var n=this._id;return arguments.length<2?Ht(this.node(),n).on.on(e):this.each(kS(n,e,t))}function HS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RS(){return this.on("end.remove",HS(this._id))}function LS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bf(e));for(var l=this._groups,a=l.length,i=new Array(a),s=0;s<a;++s)for(var o=l[s],u=o.length,c=i[s]=new Array(u),h,d,f=0;f<u;++f)(h=o[f])&&(d=e.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,eu(c[f],t,n,f,c,Ht(h,n)));return new gn(i,this._parents,t,n)}function BS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=D0(e));for(var l=this._groups,a=l.length,i=[],s=[],o=0;o<a;++o)for(var u=l[o],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),g,v=Ht(h,n),x=0,b=f.length;x<b;++x)(g=f[x])&&eu(g,t,n,x,f,v);i.push(f),s.push(h)}return new gn(i,s,t,n)}var US=$i.prototype.constructor;function YS(){return new US(this._groups,this._parents)}function VS(e,t){var n,l,a;return function(){var i=fa(this,e),s=(this.style.removeProperty(e),fa(this,e));return i===s?null:i===n&&s===l?a:a=t(n=i,l=s)}}function ly(e){return function(){this.style.removeProperty(e)}}function XS(e,t,n){var l,a=n+"",i;return function(){var s=fa(this,e);return s===a?null:s===l?i:i=t(l=s,n)}}function qS(e,t,n){var l,a,i;return function(){var s=fa(this,e),o=n(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(e),fa(this,e))),s===u?null:s===l&&u===a?i:(a=u,i=t(l=s,o))}}function GS(e,t){var n,l,a,i="style."+t,s="end."+i,o;return function(){var u=$t(this,e),c=u.on,h=u.value[i]==null?o||(o=ly(t)):void 0;(c!==n||a!==h)&&(l=(n=c).copy()).on(s,a=h),u.on=l}}function $S(e,t,n){var l=(e+="")=="transform"?Qw:ny;return t==null?this.styleTween(e,VS(e,l)).on("end.style."+e,ly(e)):typeof t=="function"?this.styleTween(e,qS(e,l,Cf(this,"style."+e,t))).each(GS(this._id,e)):this.styleTween(e,XS(e,l,t),n).on("end.style."+e,null)}function QS(e,t,n){return function(l){this.style.setProperty(e,t.call(this,l),n)}}function ZS(e,t,n){var l,a;function i(){var s=t.apply(this,arguments);return s!==a&&(l=(a=s)&&QS(e,s,n)),l}return i._value=t,i}function KS(e,t,n){var l="style."+(e+="");if(arguments.length<2)return(l=this.tween(l))&&l._value;if(t==null)return this.tween(l,null);if(typeof t!="function")throw new Error;return this.tween(l,ZS(e,t,n??""))}function JS(e){return function(){this.textContent=e}}function WS(e){return function(){var t=e(this);this.textContent=t??""}}function FS(e){return this.tween("text",typeof e=="function"?WS(Cf(this,"text",e)):JS(e==null?"":e+""))}function IS(e){return function(t){this.textContent=e.call(this,t)}}function PS(e){var t,n;function l(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&IS(a)),t}return l._value=e,l}function eE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,PS(e))}function tE(){for(var e=this._name,t=this._id,n=ay(),l=this._groups,a=l.length,i=0;i<a;++i)for(var s=l[i],o=s.length,u,c=0;c<o;++c)if(u=s[c]){var h=Ht(u,t);eu(u,e,n,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gn(l,this._parents,e,n)}function nE(){var e,t,n=this,l=n._id,a=n.size();return new Promise(function(i,s){var o={value:s},u={value:function(){--a===0&&i()}};n.each(function(){var c=$t(this,l),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(u)),c.on=t}),a===0&&i()})}var lE=0;function gn(e,t,n,l){this._groups=e,this._parents=t,this._name=n,this._id=l}function ay(){return++lE}var Ft=$i.prototype;gn.prototype={constructor:gn,select:LS,selectAll:BS,selectChild:Ft.selectChild,selectChildren:Ft.selectChildren,filter:AS,merge:zS,selection:YS,transition:tE,call:Ft.call,nodes:Ft.nodes,node:Ft.node,size:Ft.size,empty:Ft.empty,each:Ft.each,on:OS,attr:gS,attrTween:xS,style:$S,styleTween:KS,text:FS,textTween:eE,remove:RS,tween:oS,delay:wS,duration:NS,ease:CS,easeVarying:TS,end:nE,[Symbol.iterator]:Ft[Symbol.iterator]};function aE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var iE={time:null,delay:0,duration:250,ease:aE};function sE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function oE(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=ay(),(n=iE).time=Nf(),e=e==null?null:e+"");for(var l=this._groups,a=l.length,i=0;i<a;++i)for(var s=l[i],o=s.length,u,c=0;c<o;++c)(u=s[c])&&eu(u,e,t,c,s,n||sE(u,t));return new gn(l,this._parents,e,t)}$i.prototype.interrupt=aS;$i.prototype.transition=oE;const _s=e=>()=>e;function uE(e,{sourceEvent:t,target:n,transform:l,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:l,enumerable:!0,configurable:!0},_:{value:a}})}function an(e,t,n){this.k=e,this.x=t,this.y=n}an.prototype={constructor:an,scale:function(e){return e===1?this:new an(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new an(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tu=new an(1,0,0);iy.prototype=an.prototype;function iy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tu;return e.__zoom}function er(e){e.stopImmediatePropagation()}function Ya(e){e.preventDefault(),e.stopImmediatePropagation()}function rE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function cE(){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 Bh(){return this.__zoom||tu}function fE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dE(){return navigator.maxTouchPoints||"ontouchstart"in this}function hE(e,t,n){var l=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(a>l?(l+a)/2:Math.min(0,l)||Math.max(0,a),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function sy(){var e=rE,t=cE,n=hE,l=fE,a=dE,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],o=250,u=Vs,c=Fo("start","zoom","end"),h,d,f,g=500,v=150,x=0,b=10;function m(C){C.property("__zoom",Bh).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",R).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(C,H,N,z){var A=C.selection?C.selection():C;A.property("__zoom",Bh),C!==A?j(C,H,N,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(C,H,N,z){m.scaleTo(C,function(){var A=this.__zoom.k,D=typeof H=="function"?H.apply(this,arguments):H;return A*D},N,z)},m.scaleTo=function(C,H,N,z){m.transform(C,function(){var A=t.apply(this,arguments),D=this.__zoom,B=N==null?_(A):typeof N=="function"?N.apply(this,arguments):N,L=D.invert(B),U=typeof H=="function"?H.apply(this,arguments):H;return n(p(y(D,U),B,L),A,s)},N,z)},m.translateBy=function(C,H,N,z){m.transform(C,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,z)},m.translateTo=function(C,H,N,z,A){m.transform(C,function(){var D=t.apply(this,arguments),B=this.__zoom,L=z==null?_(D):typeof z=="function"?z.apply(this,arguments):z;return n(tu.translate(L[0],L[1]).scale(B.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof N=="function"?-N.apply(this,arguments):-N),D,s)},z,A)};function y(C,H){return H=Math.max(i[0],Math.min(i[1],H)),H===C.k?C:new an(H,C.x,C.y)}function p(C,H,N){var z=H[0]-N[0]*C.k,A=H[1]-N[1]*C.k;return z===C.x&&A===C.y?C:new an(C.k,z,A)}function _(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function j(C,H,N,z){C.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,D=arguments,B=S(A,D).event(z),L=t.apply(A,D),U=N==null?_(L):typeof N=="function"?N.apply(A,D):N,G=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),q=A.__zoom,$=typeof H=="function"?H.apply(A,D):H,W=u(q.invert(U).concat(G/q.k),$.invert(U).concat(G/$.k));return function(K){if(K===1)K=$;else{var X=W(K),Z=G/X[2];K=new an(Z,U[0]-X[0]*Z,U[1]-X[1]*Z)}B.zoom(null,K)}})}function S(C,H,N){return!N&&C.__zooming||new w(C,H)}function w(C,H){this.that=C,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,H),this.taps=0}w.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,H){return this.mouse&&C!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var H=rt(this.that).datum();c.call(C,this.that,new uE(C,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),H)}};function E(C,...H){if(!e.apply(this,arguments))return;var N=S(this,H).event(C),z=this.__zoom,A=Math.max(i[0],Math.min(i[1],z.k*Math.pow(2,l.apply(this,arguments)))),D=At(C);if(N.wheel)(N.mouse[0][0]!==D[0]||N.mouse[0][1]!==D[1])&&(N.mouse[1]=z.invert(N.mouse[0]=D)),clearTimeout(N.wheel);else{if(z.k===A)return;N.mouse=[D,z.invert(D)],Gs(this),N.start()}Ya(C),N.wheel=setTimeout(B,v),N.zoom("mouse",n(p(y(z,A),N.mouse[0],N.mouse[1]),N.extent,s));function B(){N.wheel=null,N.end()}}function M(C,...H){if(f||!e.apply(this,arguments))return;var N=C.currentTarget,z=S(this,H,!0).event(C),A=rt(C.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),D=At(C,N),B=C.clientX,L=C.clientY;q0(C.view),er(C),z.mouse=[D,this.__zoom.invert(D)],Gs(this),z.start();function U(q){if(Ya(q),!z.moved){var $=q.clientX-B,W=q.clientY-L;z.moved=$*$+W*W>x}z.event(q).zoom("mouse",n(p(z.that.__zoom,z.mouse[0]=At(q,N),z.mouse[1]),z.extent,s))}function G(q){A.on("mousemove.zoom mouseup.zoom",null),G0(q.view,z.moved),Ya(q),z.event(q).end()}}function R(C,...H){if(e.apply(this,arguments)){var N=this.__zoom,z=At(C.changedTouches?C.changedTouches[0]:C,this),A=N.invert(z),D=N.k*(C.shiftKey?.5:2),B=n(p(y(N,D),z,A),t.apply(this,H),s);Ya(C),o>0?rt(this).transition().duration(o).call(j,B,z,C):rt(this).call(m.transform,B,z,C)}}function k(C,...H){if(e.apply(this,arguments)){var N=C.touches,z=N.length,A=S(this,H,C.changedTouches.length===z).event(C),D,B,L,U;for(er(C),B=0;B<z;++B)L=N[B],U=At(L,this),U=[U,this.__zoom.invert(U),L.identifier],A.touch0?!A.touch1&&A.touch0[2]!==U[2]&&(A.touch1=U,A.taps=0):(A.touch0=U,D=!0,A.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(A.taps<2&&(d=U[0],h=setTimeout(function(){h=null},g)),Gs(this),A.start())}}function O(C,...H){if(this.__zooming){var N=S(this,H).event(C),z=C.changedTouches,A=z.length,D,B,L,U;for(Ya(C),D=0;D<A;++D)B=z[D],L=At(B,this),N.touch0&&N.touch0[2]===B.identifier?N.touch0[0]=L:N.touch1&&N.touch1[2]===B.identifier&&(N.touch1[0]=L);if(B=N.that.__zoom,N.touch1){var G=N.touch0[0],q=N.touch0[1],$=N.touch1[0],W=N.touch1[1],K=(K=$[0]-G[0])*K+(K=$[1]-G[1])*K,X=(X=W[0]-q[0])*X+(X=W[1]-q[1])*X;B=y(B,Math.sqrt(K/X)),L=[(G[0]+$[0])/2,(G[1]+$[1])/2],U=[(q[0]+W[0])/2,(q[1]+W[1])/2]}else if(N.touch0)L=N.touch0[0],U=N.touch0[1];else return;N.zoom("touch",n(p(B,L,U),N.extent,s))}}function Y(C,...H){if(this.__zooming){var N=S(this,H).event(C),z=C.changedTouches,A=z.length,D,B;for(er(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),D=0;D<A;++D)B=z[D],N.touch0&&N.touch0[2]===B.identifier?delete N.touch0:N.touch1&&N.touch1[2]===B.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(B=At(B,this),Math.hypot(d[0]-B[0],d[1]-B[1])<b)){var L=rt(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(C){return arguments.length?(l=typeof C=="function"?C:_s(+C),m):l},m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:_s(!!C),m):e},m.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:_s(!!C),m):a},m.extent=function(C){return arguments.length?(t=typeof C=="function"?C:_s([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),m):t},m.scaleExtent=function(C){return arguments.length?(i[0]=+C[0],i[1]=+C[1],m):[i[0],i[1]]},m.translateExtent=function(C){return arguments.length?(s[0][0]=+C[0][0],s[1][0]=+C[1][0],s[0][1]=+C[0][1],s[1][1]=+C[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(C){return arguments.length?(n=C,m):n},m.duration=function(C){return arguments.length?(o=+C,m):o},m.interpolate=function(C){return arguments.length?(u=C,m):u},m.on=function(){var C=c.on.apply(c,arguments);return C===c?m:C},m.clickDistance=function(C){return arguments.length?(x=(C=+C)*C,m):Math.sqrt(x)},m.tapDistance=function(C){return arguments.length?(b=+C,m):b},m}const Xt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:l})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:l}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Mi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],oy=["Enter"," ","Escape"],uy={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ha;(function(e){e.Strict="strict",e.Loose="loose"})(ha||(ha={}));var rl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rl||(rl={}));var Ti;(function(e){e.Partial="partial",e.Full="full"})(Ti||(Ti={}));const ry={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Cn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Cn||(Cn={}));var Mo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Mo||(Mo={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Uh={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function cy(e){return e===null?null:e?"valid":"invalid"}const fy=e=>"id"in e&&"source"in e&&"target"in e,gE=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zi=(e,t=[0,0])=>{const{width:n,height:l}=pn(e),a=e.origin??t,i=n*a[0],s=l*a[1];return{x:e.position.x-i,y:e.position.y-s}},mE=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((l,a)=>{const i=typeof a=="string";let s=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(a):Mf(a)?a:t.nodeLookup.get(a.id));const o=s?To(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return nu(l,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return lu(n)},Ki=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},l=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=nu(n,To(a)),l=!0)}),l?lu(n):{x:0,y:0,width:0,height:0}},Tf=(e,t,[n,l,a]=[0,0,1],i=!1,s=!1)=>{const o={...Wi(t,[n,l,a]),width:t.width/a,height:t.height/a},u=[];for(const c of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=c;if(s&&!d||f)continue;const g=h.width??c.width??c.initialWidth??null,v=h.height??c.height??c.initialHeight??null,x=Ai(o,ma(c)),b=(g??0)*(v??0),m=i&&x>0;(!c.internals.handleBounds||m||x>=b||c.dragging)&&u.push(c)}return u},pE=(e,t)=>{const n=new Set;return e.forEach(l=>{n.add(l.id)}),t.filter(l=>n.has(l.source)||n.has(l.target))};function yE(e,t){const n=new Map,l=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!l||l.has(a.id))&&n.set(a.id,a)}),n}async function vE({nodes:e,width:t,height:n,panZoom:l,minZoom:a,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const o=yE(e,s),u=Ki(o),c=Af(u,t,n,(s==null?void 0:s.minZoom)??a,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await l.setViewport(c,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function dy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:l=[0,0],nodeExtent:a,onError:i}){const s=n.get(e),o=s.parentId?n.get(s.parentId):void 0,{x:u,y:c}=o?o.internals.positionAbsolute:{x:0,y:0},h=s.origin??l;let d=s.extent||a;if(s.extent==="parent"&&!s.expandParent)if(!o)i==null||i("005",Xt.error005());else{const g=o.measured.width,v=o.measured.height;g&&v&&(d=[[u,c],[u+g,c+v]])}else o&&pa(s.extent)&&(d=[[s.extent[0][0]+u,s.extent[0][1]+c],[s.extent[1][0]+u,s.extent[1][1]+c]]);const f=pa(d)?yl(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Xt.error015())),{position:{x:f.x-u+(s.measured.width??0)*h[0],y:f.y-c+(s.measured.height??0)*h[1]},positionAbsolute:f}}async function xE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:l,onBeforeDelete:a}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),v=!g&&f.parentId&&s.find(x=>x.id===f.parentId);(g||v)&&s.push(f)}const o=new Set(t.map(f=>f.id)),u=l.filter(f=>f.deletable!==!1),h=pE(s,u);for(const f of u)o.has(f.id)&&!h.find(v=>v.id===f.id)&&h.push(f);if(!a)return{edges:h,nodes:s};const d=await a({nodes:s,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:s}:{edges:[],nodes:[]}:d}const ga=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),yl=(e={x:0,y:0},t,n)=>({x:ga(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ga(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function hy(e,t,n){const{width:l,height:a}=pn(n),{x:i,y:s}=n.internals.positionAbsolute;return yl(e,[[i,s],[i+l,s+a]],t)}const Yh=(e,t,n)=>e<t?ga(Math.abs(e-t),1,t)/t:e>n?-ga(Math.abs(e-n),1,t)/t:0,gy=(e,t,n=15,l=40)=>{const a=Yh(e.x,l,t.width-l)*n,i=Yh(e.y,l,t.height-l)*n;return[a,i]},nu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),fc=({x:e,y:t,width:n,height:l})=>({x:e,y:t,x2:e+n,y2:t+l}),lu=({x:e,y:t,x2:n,y2:l})=>({x:e,y:t,width:n-e,height:l-t}),ma=(e,t=[0,0])=>{var a,i;const{x:n,y:l}=Mf(e)?e.internals.positionAbsolute:Zi(e,t);return{x:n,y:l,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},To=(e,t=[0,0])=>{var a,i;const{x:n,y:l}=Mf(e)?e.internals.positionAbsolute:Zi(e,t);return{x:n,y:l,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:l+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},my=(e,t)=>lu(nu(fc(e),fc(t))),Ai=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),l=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*l)},Vh=e=>Dt(e.width)&&Dt(e.height)&&Dt(e.x)&&Dt(e.y),Dt=e=>!isNaN(e)&&isFinite(e),_E=(e,t)=>{},Ji=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Wi=({x:e,y:t},[n,l,a],i=!1,s=[1,1])=>{const o={x:(e-n)/a,y:(t-l)/a};return i?Ji(o,s):o},Ao=({x:e,y:t},[n,l,a])=>({x:e*a+n,y:t*a+l});function Cl(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function bE(e,t,n){if(typeof e=="string"||typeof e=="number"){const l=Cl(e,n),a=Cl(e,t);return{top:l,right:a,bottom:l,left:a,x:a*2,y:l*2}}if(typeof e=="object"){const l=Cl(e.top??e.y??0,n),a=Cl(e.bottom??e.y??0,n),i=Cl(e.left??e.x??0,t),s=Cl(e.right??e.x??0,t);return{top:l,right:s,bottom:a,left:i,x:i+s,y:l+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function wE(e,t,n,l,a,i){const{x:s,y:o}=Ao(e,[t,n,l]),{x:u,y:c}=Ao({x:e.x+e.width,y:e.y+e.height},[t,n,l]),h=a-u,d=i-c;return{left:Math.floor(s),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(d)}}const Af=(e,t,n,l,a,i)=>{const s=bE(i,t,n),o=(t-s.x)/e.width,u=(n-s.y)/e.height,c=Math.min(o,u),h=ga(c,l,a),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*h,v=n/2-f*h,x=wE(e,g,v,h,t,n),b={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:g-b.left+b.right,y:v-b.top+b.bottom,zoom:h}},zi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function pa(e){return e!=null&&e!=="parent"}function pn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function py(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function yy(e,t={width:0,height:0},n,l,a){const i={...e},s=l.get(n);if(s){const o=s.origin||a;i.x+=s.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function Xh(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function SE(){let e,t;return{promise:new Promise((l,a)=>{e=l,t=a}),resolve:e,reject:t}}function EE(e){return{...uy,...e||{}}}function ri(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:l,containerBounds:a}){const{x:i,y:s}=kt(e),o=Wi({x:i-((a==null?void 0:a.left)??0),y:s-((a==null?void 0:a.top)??0)},l),{x:u,y:c}=n?Ji(o,t):o;return{xSnapped:u,ySnapped:c,...o}}const zf=e=>({width:e.offsetWidth,height:e.offsetHeight}),vy=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},NE=["INPUT","SELECT","TEXTAREA"];function xy(e){var l,a;const t=((a=(l=e.composedPath)==null?void 0:l.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:NE.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _y=e=>"clientX"in e,kt=(e,t)=>{var i,s;const n=_y(e),l=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:l-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},qh=(e,t,n,l,a)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const o=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:a,position:s.getAttribute("data-handlepos"),x:(o.left-n.left)/l,y:(o.top-n.top)/l,...zf(s)}})};function by({sourceX:e,sourceY:t,targetX:n,targetY:l,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:o}){const u=e*.125+a*.375+s*.375+n*.125,c=t*.125+i*.375+o*.375+l*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function bs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gh({pos:e,x1:t,y1:n,x2:l,y2:a,c:i}){switch(e){case Q.Left:return[t-bs(t-l,i),n];case Q.Right:return[t+bs(l-t,i),n];case Q.Top:return[t,n-bs(n-a,i)];case Q.Bottom:return[t,n+bs(a-n,i)]}}function wy({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:l,targetY:a,targetPosition:i=Q.Top,curvature:s=.25}){const[o,u]=Gh({pos:n,x1:e,y1:t,x2:l,y2:a,c:s}),[c,h]=Gh({pos:i,x1:l,y1:a,x2:e,y2:t,c:s}),[d,f,g,v]=by({sourceX:e,sourceY:t,targetX:l,targetY:a,sourceControlX:o,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${o},${u} ${c},${h} ${l},${a}`,d,f,g,v]}function Sy({sourceX:e,sourceY:t,targetX:n,targetY:l}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,s=Math.abs(l-t)/2,o=l<t?l+s:l-s;return[i,o,a,s]}function jE({sourceNode:e,targetNode:t,selected:n=!1,zIndex:l=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return l;const s=a&&n?l+1e3:l,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return s+o}function CE({sourceNode:e,targetNode:t,width:n,height:l,transform:a}){const i=nu(To(e),To(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:l/a[2]};return Ai(s,lu(i))>0}const ME=({source:e,sourceHandle:t,target:n,targetHandle:l})=>`xy-edge__${e}${t||""}-${n}${l||""}`,TE=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),AE=(e,t,n={})=>{if(!e.source||!e.target)return t;const l=n.getEdgeId||ME;let a;return fy(e)?a={...e}:a={...e,id:l(e)},TE(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function Ey({sourceX:e,sourceY:t,targetX:n,targetY:l}){const[a,i,s,o]=Sy({sourceX:e,sourceY:t,targetX:n,targetY:l});return[`M ${e},${t}L ${n},${l}`,a,i,s,o]}const $h={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},zE=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Qh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function DE({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:l=Q.Top,center:a,offset:i,stepPosition:s}){const o=$h[t],u=$h[l],c={x:e.x+o.x*i,y:e.y+o.y*i},h={x:n.x+u.x*i,y:n.y+u.y*i},d=zE({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",g=d[f];let v=[],x,b;const m={x:0,y:0},y={x:0,y:0},[,,p,_]=Sy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[f]*u[f]===-1){f==="x"?(x=a.x??c.x+(h.x-c.x)*s,b=a.y??(c.y+h.y)/2):(x=a.x??(c.x+h.x)/2,b=a.y??c.y+(h.y-c.y)*s);const E=[{x,y:c.y},{x,y:h.y}],M=[{x:c.x,y:b},{x:h.x,y:b}];o[f]===g?v=f==="x"?E:M:v=f==="x"?M:E}else{const E=[{x:c.x,y:h.y}],M=[{x:h.x,y:c.y}];if(f==="x"?v=o.x===g?M:E:v=o.y===g?E:M,t===l){const C=Math.abs(e[f]-n[f]);if(C<=i){const H=Math.min(i-1,i-C);o[f]===g?m[f]=(c[f]>e[f]?-1:1)*H:y[f]=(h[f]>n[f]?-1:1)*H}}if(t!==l){const C=f==="x"?"y":"x",H=o[f]===u[C],N=c[C]>h[C],z=c[C]<h[C];(o[f]===1&&(!H&&N||H&&z)||o[f]!==1&&(!H&&z||H&&N))&&(v=f==="x"?E:M)}const R={x:c.x+m.x,y:c.y+m.y},k={x:h.x+y.x,y:h.y+y.y},O=Math.max(Math.abs(R.x-v[0].x),Math.abs(k.x-v[0].x)),Y=Math.max(Math.abs(R.y-v[0].y),Math.abs(k.y-v[0].y));O>=Y?(x=(R.x+k.x)/2,b=v[0].y):(x=v[0].x,b=(R.y+k.y)/2)}const j={x:c.x+m.x,y:c.y+m.y},S={x:h.x+y.x,y:h.y+y.y};return[[e,...j.x!==v[0].x||j.y!==v[0].y?[j]:[],...v,...S.x!==v[v.length-1].x||S.y!==v[v.length-1].y?[S]:[],n],x,b,p,_]}function kE(e,t,n,l){const a=Math.min(Qh(e,t)/2,Qh(t,n)/2,l),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+a*c},${s}Q ${i},${s} ${i},${s+a*h}`}const o=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${s+a*u}Q ${i},${s} ${i+a*o},${s}`}function dc({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:l,targetY:a,targetPosition:i=Q.Top,borderRadius:s=5,centerX:o,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,g,v,x]=DE({source:{x:e,y:t},sourcePosition:n,target:{x:l,y:a},targetPosition:i,center:{x:o,y:u},offset:c,stepPosition:h});let b=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)b+=kE(d[m-1],d[m],d[m+1],s);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,f,g,v,x]}function Zh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function OE(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Zh(t)||!Zh(n))return null;const l=t.internals.handleBounds||Kh(t.handles),a=n.internals.handleBounds||Kh(n.handles),i=Jh((l==null?void 0:l.source)??[],e.sourceHandle),s=Jh(e.connectionMode===ha.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Xt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(i==null?void 0:i.position)||Q.Bottom,u=(s==null?void 0:s.position)||Q.Top,c=vl(t,i,o),h=vl(n,s,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:o,targetPosition:u}}function Kh(e){if(!e)return null;const t=[],n=[];for(const l of e)l.width=l.width??1,l.height=l.height??1,l.type==="source"?t.push(l):l.type==="target"&&n.push(l);return{source:t,target:n}}function vl(e,t,n=Q.Left,l=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:o}=t??pn(e);if(l)return{x:a+s/2,y:i+o/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:a+s/2,y:i};case Q.Right:return{x:a+s,y:i+o/2};case Q.Bottom:return{x:a+s/2,y:i+o};case Q.Left:return{x:a,y:i+o/2}}}function Jh(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(l=>`${l}=${e[l]}`).join("&")}`:""}function HE(e,{id:t,defaultColor:n,defaultMarkerStart:l,defaultMarkerEnd:a}){const i=new Set;return e.reduce((s,o)=>([o.markerStart||l,o.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const c=hc(u,t);i.has(c)||(s.push({id:c,color:u.color||n,...u}),i.add(c))}}),s),[]).sort((s,o)=>s.id.localeCompare(o.id))}const Ny=1e3,RE=10,Df={nodeOrigin:[0,0],nodeExtent:Mi,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},LE={...Df,checkEquality:!0};function kf(e,t){const n={...e};for(const l in t)t[l]!==void 0&&(n[l]=t[l]);return n}function BE(e,t,n){const l=kf(Df,n);for(const a of e.values())if(a.parentId)Hf(a,e,t,l);else{const i=Zi(a,l.nodeOrigin),s=pa(a.extent)?a.extent:l.nodeExtent,o=yl(i,s,pn(a));a.internals.positionAbsolute=o}}function UE(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],l=[];for(const a of e.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&l.push(i)}return{source:n,target:l}}function Of(e){return e==="manual"}function gc(e,t,n,l={}){var h,d;const a=kf(LE,l),i={i:0},s=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Of(a.zIndexMode)?Ny:0;let u=e.length>0,c=!1;t.clear(),n.clear();for(const f of e){let g=s.get(f.id);if(a.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const v=Zi(f,a.nodeOrigin),x=pa(f.extent)?f.extent:a.nodeExtent,b=yl(v,x,pn(f));g={...a.defaults,...f,measured:{width:(h=f.measured)==null?void 0:h.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:UE(f,g),z:jy(f,o,a.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),f.parentId&&Hf(g,t,n,l,i),c||(c=f.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:c}}function YE(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Hf(e,t,n,l,a){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:o,zIndexMode:u}=kf(Df,l),c=e.parentId,h=t.get(c);if(!h){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}YE(e,n),a&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++a.i,h.internals.z=h.internals.z+a.i*RE),a&&h.internals.rootParentIndex!==void 0&&(a.i=h.internals.rootParentIndex);const d=i&&!Of(u)?Ny:0,{x:f,y:g,z:v}=VE(e,h,s,o,d,u),{positionAbsolute:x}=e.internals,b=f!==x.x||g!==x.y;(b||v!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:f,y:g}:x,z:v}})}function jy(e,t,n){const l=Dt(e.zIndex)?e.zIndex:0;return Of(n)?l:l+(e.selected?t:0)}function VE(e,t,n,l,a,i){const{x:s,y:o}=t.internals.positionAbsolute,u=pn(e),c=Zi(e,n),h=pa(e.extent)?yl(c,e.extent,u):c;let d=yl({x:s+h.x,y:o+h.y},l,u);e.extent==="parent"&&(d=hy(d,u,t));const f=jy(e,a,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function Rf(e,t,n,l=[0,0]){var s;const a=[],i=new Map;for(const o of e){const u=t.get(o.parentId);if(!u)continue;const c=((s=i.get(o.parentId))==null?void 0:s.expandedRect)??ma(u),h=my(c,o.rect);i.set(o.parentId,{expandedRect:h,parent:u})}return i.size>0&&i.forEach(({expandedRect:o,parent:u},c)=>{var p;const h=u.internals.positionAbsolute,d=pn(u),f=u.origin??l,g=o.x<h.x?Math.round(Math.abs(h.x-o.x)):0,v=o.y<h.y?Math.round(Math.abs(h.y-o.y)):0,x=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),m=(x-d.width)*f[0],y=(b-d.height)*f[1];(g>0||v>0||m||y)&&(a.push({id:c,type:"position",position:{x:u.position.x-g+m,y:u.position.y-v+y}}),(p=n.get(c))==null||p.forEach(_=>{e.some(j=>j.id===_.id)||a.push({id:_.id,type:"position",position:{x:_.position.x+g,y:_.position.y+v}})})),(d.width<o.width||d.height<o.height||g||v)&&a.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(g?f[0]*g-m:0),height:b+(v?f[1]*v-y:0)}})}),a}function XE(e,t,n,l,a,i,s){const o=l==null?void 0:l.querySelector(".xyflow__viewport");let u=!1;if(!o)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const g of e.values()){const v=t.get(g.id);if(!v)continue;if(v.hidden){t.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),u=!0;continue}const x=zf(g.nodeElement),b=v.measured.width!==x.width||v.measured.height!==x.height;if(!!(x.width&&x.height&&(b||!v.internals.handleBounds||g.force))){const y=g.nodeElement.getBoundingClientRect(),p=pa(v.extent)?v.extent:i;let{positionAbsolute:_}=v.internals;v.parentId&&v.extent==="parent"?_=hy(_,x,t.get(v.parentId)):p&&(_=yl(_,p,x));const j={...v,measured:x,internals:{...v.internals,positionAbsolute:_,handleBounds:{source:qh("source",g.nodeElement,y,d,v.id),target:qh("target",g.nodeElement,y,d,v.id)}}};t.set(v.id,j),v.parentId&&Hf(j,t,n,{nodeOrigin:a,zIndexMode:s}),u=!0,b&&(c.push({id:v.id,type:"dimensions",dimensions:x}),v.expandParent&&v.parentId&&f.push({id:v.id,parentId:v.parentId,rect:ma(j,a)}))}}if(f.length>0){const g=Rf(f,t,n,a);c.push(...g)}return{changes:c,updatedInternals:u}}async function qE({delta:e,panZoom:t,transform:n,translateExtent:l,width:a,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,i]],l),o=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(o)}function Wh(e,t,n,l,a,i){let s=a;const o=l.get(s)||new Map;l.set(s,o.set(n,t)),s=`${a}-${e}`;const u=l.get(s)||new Map;if(l.set(s,u.set(n,t)),i){s=`${a}-${e}-${i}`;const c=l.get(s)||new Map;l.set(s,c.set(n,t))}}function Cy(e,t,n){e.clear(),t.clear();for(const l of n){const{source:a,target:i,sourceHandle:s=null,targetHandle:o=null}=l,u={edgeId:l.id,source:a,target:i,sourceHandle:s,targetHandle:o},c=`${a}-${s}--${i}-${o}`,h=`${i}-${o}--${a}-${s}`;Wh("source",u,h,e,a,s),Wh("target",u,c,e,i,o),t.set(l.id,l)}}function My(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:My(n,t):!1}function Fh(e,t,n){var a;let l=e;do{if((a=l==null?void 0:l.matches)!=null&&a.call(l,t))return!0;if(l===n)return!1;l=l==null?void 0:l.parentElement}while(l);return!1}function GE(e,t,n,l){const a=new Map;for(const[i,s]of e)if((s.selected||s.id===l)&&(!s.parentId||!My(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const o=e.get(i);o&&a.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function tr({nodeId:e,dragItems:t,nodeLookup:n,dragging:l=!0}){var s,o,u;const a=[];for(const[c,h]of t){const d=(s=n.get(c))==null?void 0:s.internals.userNode;d&&a.push({...d,position:h.position,dragging:l})}if(!e)return[a[0],a];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:l}:a[0],a]}function $E({dragItems:e,snapGrid:t,x:n,y:l}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:l-a.distance.y},s=Ji(i,t);return{x:s.x-i.x,y:s.y-i.y}}function QE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:l,onDragStop:a}){let i={x:null,y:null},s=0,o=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,g=!1,v=!1,x=null;function b({noDragClassName:y,handleSelector:p,domNode:_,isSelectable:j,nodeId:S,nodeClickDistance:w=0}){f=rt(_);function E({x:O,y:Y}){const{nodeLookup:C,nodeExtent:H,snapGrid:N,snapToGrid:z,nodeOrigin:A,onNodeDrag:D,onSelectionDrag:B,onError:L,updateNodePositions:U}=t();i={x:O,y:Y};let G=!1;const q=o.size>1,$=q&&H?fc(Ki(o)):null,W=q&&z?$E({dragItems:o,snapGrid:N,x:O,y:Y}):null;for(const[K,X]of o){if(!C.has(K))continue;let Z={x:O-X.distance.x,y:Y-X.distance.y};z&&(Z=W?{x:Math.round(Z.x+W.x),y:Math.round(Z.y+W.y)}:Ji(Z,N));let ne=null;if(q&&H&&!X.extent&&$){const{positionAbsolute:J}=X.internals,re=J.x-$.x+H[0][0],ve=J.x+X.measured.width-$.x2+H[1][0],ue=J.y-$.y+H[0][1],Ke=J.y+X.measured.height-$.y2+H[1][1];ne=[[re,ue],[ve,Ke]]}const{position:P,positionAbsolute:F}=dy({nodeId:K,nextPosition:Z,nodeLookup:C,nodeExtent:ne||H,nodeOrigin:A,onError:L});G=G||X.position.x!==P.x||X.position.y!==P.y,X.position=P,X.internals.positionAbsolute=F}if(v=v||G,!!G&&(U(o,!0),x&&(l||D||!S&&B))){const[K,X]=tr({nodeId:S,dragItems:o,nodeLookup:C});l==null||l(x,o,K,X),D==null||D(x,K,X),S||B==null||B(x,X)}}async function M(){if(!h)return;const{transform:O,panBy:Y,autoPanSpeed:C,autoPanOnNodeDrag:H}=t();if(!H){u=!1,cancelAnimationFrame(s);return}const[N,z]=gy(c,h,C);(N!==0||z!==0)&&(i.x=(i.x??0)-N/O[2],i.y=(i.y??0)-z/O[2],await Y({x:N,y:z})&&E(i)),s=requestAnimationFrame(M)}function R(O){var q;const{nodeLookup:Y,multiSelectionActive:C,nodesDraggable:H,transform:N,snapGrid:z,snapToGrid:A,selectNodesOnDrag:D,onNodeDragStart:B,onSelectionDragStart:L,unselectNodesAndEdges:U}=t();d=!0,(!D||!j)&&!C&&S&&((q=Y.get(S))!=null&&q.selected||U()),j&&D&&S&&(e==null||e(S));const G=ri(O.sourceEvent,{transform:N,snapGrid:z,snapToGrid:A,containerBounds:h});if(i=G,o=GE(Y,H,G,S),o.size>0&&(n||B||!S&&L)){const[$,W]=tr({nodeId:S,dragItems:o,nodeLookup:Y});n==null||n(O.sourceEvent,o,$,W),B==null||B(O.sourceEvent,$,W),S||L==null||L(O.sourceEvent,W)}}const k=$0().clickDistance(w).on("start",O=>{const{domNode:Y,nodeDragThreshold:C,transform:H,snapGrid:N,snapToGrid:z}=t();h=(Y==null?void 0:Y.getBoundingClientRect())||null,g=!1,v=!1,x=O.sourceEvent,C===0&&R(O),i=ri(O.sourceEvent,{transform:H,snapGrid:N,snapToGrid:z,containerBounds:h}),c=kt(O.sourceEvent,h)}).on("drag",O=>{const{autoPanOnNodeDrag:Y,transform:C,snapGrid:H,snapToGrid:N,nodeDragThreshold:z,nodeLookup:A}=t(),D=ri(O.sourceEvent,{transform:C,snapGrid:H,snapToGrid:N,containerBounds:h});if(x=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||S&&!A.has(S))&&(g=!0),!g){if(!u&&Y&&d&&(u=!0,M()),!d){const B=kt(O.sourceEvent,h),L=B.x-c.x,U=B.y-c.y;Math.sqrt(L*L+U*U)>z&&R(O)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&o&&d&&(c=kt(O.sourceEvent,h),E(D))}}).on("end",O=>{if(!(!d||g)&&(u=!1,d=!1,cancelAnimationFrame(s),o.size>0)){const{nodeLookup:Y,updateNodePositions:C,onNodeDragStop:H,onSelectionDragStop:N}=t();if(v&&(C(o,!1),v=!1),a||H||!S&&N){const[z,A]=tr({nodeId:S,dragItems:o,nodeLookup:Y,dragging:!1});a==null||a(O.sourceEvent,o,z,A),H==null||H(O.sourceEvent,z,A),S||N==null||N(O.sourceEvent,A)}}}).filter(O=>{const Y=O.target;return!O.button&&(!y||!Fh(Y,`.${y}`,_))&&(!p||Fh(Y,p,_))});f.call(k)}function m(){f==null||f.on(".drag",null)}return{update:b,destroy:m}}function ZE(e,t,n){const l=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Ai(a,ma(i))>0&&l.push(i);return l}const KE=250;function JE(e,t,n,l){var o,u;let a=[],i=1/0;const s=ZE(e,n,t+KE);for(const c of s){const h=[...((o=c.internals.handleBounds)==null?void 0:o.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of h){if(l.nodeId===d.nodeId&&l.type===d.type&&l.id===d.id)continue;const{x:f,y:g}=vl(c,d,d.position,!0),v=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));v>t||(v<i?(a=[{...d,x:f,y:g}],i=v):v===i&&a.push({...d,x:f,y:g}))}}if(!a.length)return null;if(a.length>1){const c=l.type==="source"?"target":"source";return a.find(h=>h.type===c)??a[0]}return a[0]}function Ty(e,t,n,l,a,i=!1){var c,h,d;const s=l.get(e);if(!s)return null;const o=a==="strict"?(c=s.internals.handleBounds)==null?void 0:c[t]:[...((h=s.internals.handleBounds)==null?void 0:h.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?o==null?void 0:o.find(f=>f.id===n):o==null?void 0:o[0])??null;return u&&i?{...u,...vl(s,u,u.position,!0)}:u}function Ay(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const zy=()=>!0;function FE(e,{connectionMode:t,connectionRadius:n,handleId:l,nodeId:a,edgeUpdaterType:i,isTarget:s,domNode:o,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:x,onConnectEnd:b,isValidConnection:m=zy,onReconnectEnd:y,updateConnection:p,getTransform:_,getFromHandle:j,autoPanSpeed:S,dragThreshold:w=1,handleDomNode:E}){const M=vy(e.target);let R=0,k;const{x:O,y:Y}=kt(e),C=Ay(i,E),H=o==null?void 0:o.getBoundingClientRect();let N=!1;if(!H||!C)return;const z=Ty(a,C,l,u,t);if(!z)return;let A=kt(e,H),D=!1,B=null,L=!1,U=null;function G(){if(!h||!H)return;const[P,F]=gy(A,H,S);f({x:P,y:F}),R=requestAnimationFrame(G)}const q={...z,nodeId:a,type:C,position:z.position},$=u.get(a);let K={inProgress:!0,isValid:null,from:vl($,q,Q.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:$,to:A,toHandle:null,toPosition:Uh[q.position],toNode:null,pointer:A};function X(){N=!0,p(K),v==null||v(e,{nodeId:a,handleId:l,handleType:C})}w===0&&X();function Z(P){if(!N){const{x:Ke,y:yn}=kt(P),Qt=Ke-O,Jn=yn-Y;if(!(Qt*Qt+Jn*Jn>w*w))return;X()}if(!j()||!q){ne(P);return}const F=_();A=kt(P,H),k=JE(Wi(A,F,!1,[1,1]),n,u,q),D||(G(),D=!0);const J=Dy(P,{handle:k,connectionMode:t,fromNodeId:a,fromHandleId:l,fromType:s?"target":"source",isValidConnection:m,doc:M,lib:c,flowId:d,nodeLookup:u});U=J.handleDomNode,B=J.connection,L=WE(!!k,J.isValid);const re=u.get(a),ve=re?vl(re,q,Q.Left,!0):K.from,ue={...K,from:ve,isValid:L,to:J.toHandle&&L?Ao({x:J.toHandle.x,y:J.toHandle.y},F):A,toHandle:J.toHandle,toPosition:L&&J.toHandle?J.toHandle.position:Uh[q.position],toNode:J.toHandle?u.get(J.toHandle.nodeId):null,pointer:A};p(ue),K=ue}function ne(P){if(!("touches"in P&&P.touches.length>0)){if(N){(k||U)&&B&&L&&(x==null||x(B));const{inProgress:F,...J}=K,re={...J,toPosition:K.toHandle?K.toPosition:null};b==null||b(P,re),i&&(y==null||y(P,re))}g(),cancelAnimationFrame(R),D=!1,L=!1,B=null,U=null,M.removeEventListener("mousemove",Z),M.removeEventListener("mouseup",ne),M.removeEventListener("touchmove",Z),M.removeEventListener("touchend",ne)}}M.addEventListener("mousemove",Z),M.addEventListener("mouseup",ne),M.addEventListener("touchmove",Z),M.addEventListener("touchend",ne)}function Dy(e,{handle:t,connectionMode:n,fromNodeId:l,fromHandleId:a,fromType:i,doc:s,lib:o,flowId:u,isValidConnection:c=zy,nodeLookup:h}){const d=i==="target",f=t?s.querySelector(`.${o}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:v}=kt(e),x=s.elementFromPoint(g,v),b=x!=null&&x.classList.contains(`${o}-flow__handle`)?x:f,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=Ay(void 0,b),p=b.getAttribute("data-nodeid"),_=b.getAttribute("data-handleid"),j=b.classList.contains("connectable"),S=b.classList.contains("connectableend");if(!p||!y)return m;const w={source:d?p:l,sourceHandle:d?_:a,target:d?l:p,targetHandle:d?a:_};m.connection=w;const M=j&&S&&(n===ha.Strict?d&&y==="source"||!d&&y==="target":p!==l||_!==a);m.isValid=M&&c(w),m.toHandle=Ty(p,y,_,h,n,!0)}return m}const mc={onPointerDown:FE,isValid:Dy};function IE({domNode:e,panZoom:t,getTransform:n,getViewScale:l}){const a=rt(e);function i({translateExtent:o,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const v=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const _=n(),j=p.sourceEvent.ctrlKey&&zi()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*h,w=_[2]*Math.pow(2,S*j);t.scaleTo(w)};let x=[0,0];const b=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(x=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const _=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const j=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[j[0]-x[0],j[1]-x[1]];x=j;const w=l()*Math.max(_[2],Math.log(_[2]))*(g?-1:1),E={x:_[0]-S[0]*w,y:_[1]-S[1]*w},M=[[0,0],[u,c]];t.setViewportConstrained({x:E.x,y:E.y,zoom:_[2]},M,o)},y=sy().on("start",b).on("zoom",d?m:null).on("zoom.wheel",f?v:null);a.call(y,{})}function s(){a.on("zoom",null)}return{update:i,destroy:s,pointer:At}}const au=e=>({x:e.x,y:e.y,zoom:e.k}),nr=({x:e,y:t,zoom:n})=>tu.translate(e,t).scale(n),ql=(e,t)=>e.target.closest(`.${t}`),ky=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),PE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,lr=(e,t=0,n=PE,l=()=>{})=>{const a=typeof t=="number"&&t>0;return a||l(),a?e.transition().duration(t).ease(n).on("end",l):e},Oy=e=>{const t=e.ctrlKey&&zi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function eN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:l,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:o,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(ql(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&s){const b=At(h),m=Oy(h),y=d*Math.pow(2,m);l.scaleTo(n,y,b,h);return}const f=h.deltaMode===1?20:1;let g=a===rl.Vertical?0:h.deltaX*f,v=a===rl.Horizontal?0:h.deltaY*f;!zi()&&h.shiftKey&&a!==rl.Vertical&&(g=h.deltaY*f,v=0),l.translateBy(n,-(g/d)*i,-(v/d)*i,{internal:!0});const x=au(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,x))}}function tN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(l,a){const i=l.type==="wheel",s=!t&&i&&!l.ctrlKey,o=ql(l,e);if(l.ctrlKey&&i&&o&&l.preventDefault(),s||o)return null;l.preventDefault(),n.call(this,l,a)}}function nN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return l=>{var i,s,o;if((i=l.sourceEvent)!=null&&i.internal)return;const a=au(l.transform);e.mouseButton=((s=l.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=l.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(l.sourceEvent,a))}}function lN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:l,onPanZoom:a}){return i=>{var s,o;e.usedRightMouseButton=!!(n&&ky(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||l([i.transform.x,i.transform.y,i.transform.k]),a&&!((o=i.sourceEvent)!=null&&o.internal)&&(a==null||a(i.sourceEvent,au(i.transform)))}}function aN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:l,onPanZoomEnd:a,onPaneContextMenu:i}){return s=>{var o;if(!((o=s.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&ky(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,l(!1),a)){const u=au(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(s.sourceEvent,u)},n?150:0)}}}function iN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:l,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:o,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var b;const f=e||t,g=n&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ql(d,`${c}-flow__node`)||ql(d,`${c}-flow__edge`)))return!0;if(!l&&!f&&!a&&!i&&!n||s||h&&!v||ql(d,o)&&v||ql(d,u)&&(!v||a&&v&&!e)||!n&&d.ctrlKey&&v)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!f&&!a&&!g&&v||!l&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(l)&&!l.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(l)&&l.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v)&&x}}function sN({domNode:e,minZoom:t,maxZoom:n,translateExtent:l,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:o,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=sy().scaleExtent([t,n]).translateExtent(l),f=rt(e).call(d);y({x:a.x,y:a.y,zoom:ga(a.zoom,t,n)},[[0,0],[h.width,h.height]],l);const g=f.on("wheel.zoom"),v=f.on("dblclick.zoom");d.wheelDelta(Oy);function x(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).transform(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function b({noWheelClassName:k,noPanClassName:O,onPaneContextMenu:Y,userSelectionActive:C,panOnScroll:H,panOnDrag:N,panOnScrollMode:z,panOnScrollSpeed:A,preventScrolling:D,zoomOnPinch:B,zoomOnScroll:L,zoomOnDoubleClick:U,zoomActivationKeyPressed:G,lib:q,onTransformChange:$,connectionInProgress:W,paneClickDistance:K,selectionOnDrag:X}){C&&!c.isZoomingOrPanning&&m();const Z=H&&!G&&!C;d.clickDistance(X?1/0:!Dt(K)||K<0?0:K);const ne=Z?eN({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:A,zoomOnPinch:B,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:o}):tN({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:g});if(f.on("wheel.zoom",ne,{passive:!1}),!C){const F=nN({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:s});d.on("start",F);const J=lN({zoomPanValues:c,panOnDrag:N,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:$});d.on("zoom",J);const re=aN({zoomPanValues:c,panOnDrag:N,panOnScroll:H,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:u});d.on("end",re)}const P=iN({zoomActivationKeyPressed:G,panOnDrag:N,zoomOnScroll:L,panOnScroll:H,zoomOnDoubleClick:U,zoomOnPinch:B,userSelectionActive:C,noPanClassName:O,noWheelClassName:k,lib:q,connectionInProgress:W});d.filter(P),U?f.on("dblclick.zoom",v):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function y(k,O,Y){const C=nr(k),H=d==null?void 0:d.constrain()(C,O,Y);return H&&await x(H),new Promise(N=>N(H))}async function p(k,O){const Y=nr(k);return await x(Y,O),new Promise(C=>C(Y))}function _(k){if(f){const O=nr(k),Y=f.property("__zoom");(Y.k!==k.zoom||Y.x!==k.x||Y.y!==k.y)&&(d==null||d.transform(f,O,null,{sync:!0}))}}function j(){const k=f?iy(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function S(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).scaleTo(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function w(k,O){return f?new Promise(Y=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?ui:Vs).scaleBy(lr(f,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>Y(!0)),k)}):Promise.resolve(!1)}function E(k){d==null||d.scaleExtent(k)}function M(k){d==null||d.translateExtent(k)}function R(k){const O=!Dt(k)||k<0?0:k;d==null||d.clickDistance(O)}return{update:b,destroy:m,setViewport:p,setViewportConstrained:y,getViewport:j,scaleTo:S,scaleBy:w,setScaleExtent:E,setTranslateExtent:M,syncViewport:_,setClickDistance:R}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function oN({width:e,prevWidth:t,height:n,prevHeight:l,affectsX:a,affectsY:i}){const s=e-t,o=n-l,u=[s>0?1:s<0?-1:0,o>0?1:o<0?-1:0];return s&&a&&(u[0]=u[0]*-1),o&&i&&(u[1]=u[1]*-1),u}function Ih(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),l=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:l,affectsY:a}}function xn(e,t){return Math.max(0,t-e)}function _n(e,t){return Math.max(0,e-t)}function ws(e,t,n){return Math.max(0,t-e,e-n)}function Ph(e,t){return e?!t:t}function uN(e,t,n,l,a,i,s,o){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:g,ySnapped:v}=n,{minWidth:x,maxWidth:b,minHeight:m,maxHeight:y}=l,{x:p,y:_,width:j,height:S,aspectRatio:w}=e;let E=Math.floor(h?g-e.pointerX:0),M=Math.floor(d?v-e.pointerY:0);const R=j+(u?-E:E),k=S+(c?-M:M),O=-i[0]*j,Y=-i[1]*S;let C=ws(R,x,b),H=ws(k,m,y);if(s){let A=0,D=0;u&&E<0?A=xn(p+E+O,s[0][0]):!u&&E>0&&(A=_n(p+R+O,s[1][0])),c&&M<0?D=xn(_+M+Y,s[0][1]):!c&&M>0&&(D=_n(_+k+Y,s[1][1])),C=Math.max(C,A),H=Math.max(H,D)}if(o){let A=0,D=0;u&&E>0?A=_n(p+E,o[0][0]):!u&&E<0&&(A=xn(p+R,o[1][0])),c&&M>0?D=_n(_+M,o[0][1]):!c&&M<0&&(D=xn(_+k,o[1][1])),C=Math.max(C,A),H=Math.max(H,D)}if(a){if(h){const A=ws(R/w,m,y)*w;if(C=Math.max(C,A),s){let D=0;!u&&!c||u&&!c&&f?D=_n(_+Y+R/w,s[1][1])*w:D=xn(_+Y+(u?E:-E)/w,s[0][1])*w,C=Math.max(C,D)}if(o){let D=0;!u&&!c||u&&!c&&f?D=xn(_+R/w,o[1][1])*w:D=_n(_+(u?E:-E)/w,o[0][1])*w,C=Math.max(C,D)}}if(d){const A=ws(k*w,x,b)/w;if(H=Math.max(H,A),s){let D=0;!u&&!c||c&&!u&&f?D=_n(p+k*w+O,s[1][0])/w:D=xn(p+(c?M:-M)*w+O,s[0][0])/w,H=Math.max(H,D)}if(o){let D=0;!u&&!c||c&&!u&&f?D=xn(p+k*w,o[1][0])/w:D=_n(p+(c?M:-M)*w,o[0][0])/w,H=Math.max(H,D)}}}M=M+(M<0?H:-H),E=E+(E<0?C:-C),a&&(f?R>k*w?M=(Ph(u,c)?-E:E)/w:E=(Ph(u,c)?-M:M)*w:h?(M=E/w,c=u):(E=M*w,u=c));const N=u?p+E:p,z=c?_+M:_;return{width:j+(u?-E:E),height:S+(c?-M:M),x:i[0]*E*(u?-1:1)+N,y:i[1]*M*(c?-1:1)+z}}const Hy={width:0,height:0,x:0,y:0},rN={...Hy,pointerX:0,pointerY:0,aspectRatio:1};function cN(e){return[[0,0],[e.measured.width,e.measured.height]]}function fN(e,t,n){const l=t.position.x+e.position.x,a=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,o=n[0]*i,u=n[1]*s;return[[l-o,a-u],[l+i-o,a+s-u]]}function dN({domNode:e,nodeId:t,getStoreItems:n,onChange:l,onEnd:a}){const i=rt(e);let s={controlDirection:Ih("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:v,onResizeEnd:x,shouldResize:b}){let m={...Hy},y={...rN};s={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Ih(c)};let p,_=null,j=[],S,w,E,M=!1;const R=$0().on("start",k=>{const{nodeLookup:O,transform:Y,snapGrid:C,snapToGrid:H,nodeOrigin:N,paneDomNode:z}=n();if(p=O.get(t),!p)return;_=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:D}=ri(k.sourceEvent,{transform:Y,snapGrid:C,snapToGrid:H,containerBounds:_});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},y={...m,pointerX:A,pointerY:D,aspectRatio:m.width/m.height},S=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=O.get(p.parentId),w=S&&p.extent==="parent"?cN(S):void 0),j=[],E=void 0;for(const[B,L]of O)if(L.parentId===t&&(j.push({id:B,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const U=fN(L,p,L.origin??N);E?E=[[Math.min(U[0][0],E[0][0]),Math.min(U[0][1],E[0][1])],[Math.max(U[1][0],E[1][0]),Math.max(U[1][1],E[1][1])]]:E=U}g==null||g(k,{...m})}).on("drag",k=>{const{transform:O,snapGrid:Y,snapToGrid:C,nodeOrigin:H}=n(),N=ri(k.sourceEvent,{transform:O,snapGrid:Y,snapToGrid:C,containerBounds:_}),z=[];if(!p)return;const{x:A,y:D,width:B,height:L}=m,U={},G=p.origin??H,{width:q,height:$,x:W,y:K}=uN(y,s.controlDirection,N,s.boundaries,s.keepAspectRatio,G,w,E),X=q!==B,Z=$!==L,ne=W!==A&&X,P=K!==D&&Z;if(!ne&&!P&&!X&&!Z)return;if((ne||P||G[0]===1||G[1]===1)&&(U.x=ne?W:m.x,U.y=P?K:m.y,m.x=U.x,m.y=U.y,j.length>0)){const ve=W-A,ue=K-D;for(const Ke of j)Ke.position={x:Ke.position.x-ve+G[0]*(q-B),y:Ke.position.y-ue+G[1]*($-L)},z.push(Ke)}if((X||Z)&&(U.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?q:m.width,U.height=Z&&(!s.resizeDirection||s.resizeDirection==="vertical")?$:m.height,m.width=U.width,m.height=U.height),S&&p.expandParent){const ve=G[0]*(U.width??0);U.x&&U.x<ve&&(m.x=ve,y.x=y.x-(U.x-ve));const ue=G[1]*(U.height??0);U.y&&U.y<ue&&(m.y=ue,y.y=y.y-(U.y-ue))}const F=oN({width:m.width,prevWidth:B,height:m.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),J={...m,direction:F};(b==null?void 0:b(k,J))!==!1&&(M=!0,v==null||v(k,J),l(U,z))}).on("end",k=>{M&&(x==null||x(k,{...m}),a==null||a({...m}),M=!1)});i.call(R)}function u(){i.on(".drag",null)}return{update:o,destroy:u}}var Ry={exports:{}},Ly={},By={exports:{}},Uy={};/**
50
50
  * @license React
51
51
  * use-sync-external-store-shim.production.js
52
52
  *