From 624612ceed4b6aa1d837d424a9207655596a4ed6 Mon Sep 17 00:00:00 2001 From: Roberto Nobrega Date: Tue, 8 Oct 2024 09:40:17 -0300 Subject: [PATCH] Updates --- assets/index-XPM7KKRI.js | 498 --------------------------------------- assets/index-t6e7nzZ9.js | 498 +++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 3 files changed, 499 insertions(+), 499 deletions(-) delete mode 100644 assets/index-XPM7KKRI.js create mode 100644 assets/index-t6e7nzZ9.js diff --git a/assets/index-XPM7KKRI.js b/assets/index-XPM7KKRI.js deleted file mode 100644 index d0c5a84..0000000 --- a/assets/index-XPM7KKRI.js +++ /dev/null @@ -1,498 +0,0 @@ -function Uj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ts(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var EN={exports:{}},Rm={},SN={exports:{}},et={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qf=Symbol.for("react.element"),Wj=Symbol.for("react.portal"),Gj=Symbol.for("react.fragment"),Kj=Symbol.for("react.strict_mode"),qj=Symbol.for("react.profiler"),Yj=Symbol.for("react.provider"),Xj=Symbol.for("react.context"),Qj=Symbol.for("react.forward_ref"),Zj=Symbol.for("react.suspense"),Jj=Symbol.for("react.memo"),e6=Symbol.for("react.lazy"),pC=Symbol.iterator;function t6(e){return e===null||typeof e!="object"?null:(e=pC&&e[pC]||e["@@iterator"],typeof e=="function"?e:null)}var CN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},IN=Object.assign,AN={};function Au(e,t,n){this.props=e,this.context=t,this.refs=AN,this.updater=n||CN}Au.prototype.isReactComponent={};Au.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Au.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function TN(){}TN.prototype=Au.prototype;function q_(e,t,n){this.props=e,this.context=t,this.refs=AN,this.updater=n||CN}var Y_=q_.prototype=new TN;Y_.constructor=q_;IN(Y_,Au.prototype);Y_.isPureReactComponent=!0;var hC=Array.isArray,kN=Object.prototype.hasOwnProperty,X_={current:null},NN={key:!0,ref:!0,__self:!0,__source:!0};function ON(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)kN.call(t,r)&&!NN.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,te=V[Z];if(0>>1;Zi(re,N))oei(pe,re)?(V[Z]=pe,V[oe]=N,Z=oe):(V[Z]=re,V[ee]=N,Z=ee);else if(oei(pe,N))V[Z]=pe,V[oe]=N,Z=oe;else break e}}return H}function i(V,H){var N=V.sortIndex-H.sortIndex;return N!==0?N:V.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],d=1,p=null,h=3,m=!1,v=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(V){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=V)r(c),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(c)}}function C(V){if(x=!1,E(V),!v)if(n(u)!==null)v=!0,j(T);else{var H=n(c);H!==null&&X(C,H.startTime-V)}}function T(V,H){v=!1,x&&(x=!1,y(M),M=-1),m=!0;var N=h;try{for(E(H),p=n(u);p!==null&&(!(p.expirationTime>H)||V&&!F());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,h=p.priorityLevel;var te=Z(p.expirationTime<=H);H=e.unstable_now(),typeof te=="function"?p.callback=te:p===n(u)&&r(u),E(H)}else r(u);p=n(u)}if(p!==null)var R=!0;else{var ee=n(c);ee!==null&&X(C,ee.startTime-H),R=!1}return R}finally{p=null,h=N,m=!1}}var I=!1,O=null,M=-1,z=5,U=-1;function F(){return!(e.unstable_now()-UV||125Z?(V.sortIndex=N,t(c,V),n(u)===null&&V===n(c)&&(x?(y(M),M=-1):x=!0,X(C,N-Z))):(V.sortIndex=te,t(u,V),v||m||(v=!0,j(T))),V},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(V){var H=h;return function(){var N=h;h=H;try{return V.apply(this,arguments)}finally{h=N}}}})(MN);PN.exports=MN;var d6=PN.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var p6=A,Fr=d6;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q0=Object.prototype.hasOwnProperty,h6=/^[: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]*$/,gC={},yC={};function m6(e){return Q0.call(yC,e)?!0:Q0.call(gC,e)?!1:h6.test(e)?yC[e]=!0:(gC[e]=!0,!1)}function g6(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function y6(e,t,n,r){if(t===null||typeof t>"u"||g6(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var bn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bn[e]=new Qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bn[t]=new Qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bn[e]=new Qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bn[e]=new Qn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){bn[e]=new Qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bn[e]=new Qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bn[e]=new Qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bn[e]=new Qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bn[e]=new Qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Z_=/[\-:]([a-z])/g;function J_(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Z_,J_);bn[t]=new Qn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Z_,J_);bn[t]=new Qn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Z_,J_);bn[t]=new Qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bn[e]=new Qn(e,1,!1,e.toLowerCase(),null,!1,!1)});bn.xlinkHref=new Qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bn[e]=new Qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ew(e,t,n,r){var i=bn.hasOwnProperty(t)?bn[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var u=` -`+i[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{xv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pc(e):""}function v6(e){switch(e.tag){case 5:return Pc(e.type);case 16:return Pc("Lazy");case 13:return Pc("Suspense");case 19:return Pc("SuspenseList");case 0:case 2:case 15:return e=_v(e.type,!1),e;case 11:return e=_v(e.type.render,!1),e;case 1:return e=_v(e.type,!0),e;default:return""}}function tx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kl:return"Fragment";case Tl:return"Portal";case Z0:return"Profiler";case tw:return"StrictMode";case J0:return"Suspense";case ex:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case BN:return(e.displayName||"Context")+".Consumer";case FN:return(e._context.displayName||"Context")+".Provider";case nw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rw:return t=e.displayName||null,t!==null?t:tx(e.type)||"Memo";case Yo:t=e._payload,e=e._init;try{return tx(e(t))}catch{}}return null}function x6(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tx(t);case 8:return t===tw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Es(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _6(e){var t=zN(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dp(e){e._valueTracker||(e._valueTracker=_6(e))}function jN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zN(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nx(e,t){var n=t.checked;return $t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xC(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Es(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function VN(e,t){t=t.checked,t!=null&&ew(e,"checked",t,!1)}function rx(e,t){VN(e,t);var n=Es(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ix(e,t.type,n):t.hasOwnProperty("defaultValue")&&ix(e,t.type,Es(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _C(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ix(e,t,n){(t!=="number"||Ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mc=Array.isArray;function Vl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=pp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function df(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},w6=["Webkit","ms","Moz","O"];Object.keys(qc).forEach(function(e){w6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qc[t]=qc[e]})});function KN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qc.hasOwnProperty(e)&&qc[e]?(""+t).trim():t+"px"}function qN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=KN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var b6=$t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ax(e,t){if(t){if(b6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function lx(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ux=null;function iw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cx=null,Ul=null,Wl=null;function EC(e){if(e=Qf(e)){if(typeof cx!="function")throw Error(me(280));var t=e.stateNode;t&&(t=$m(t),cx(e.stateNode,e.type,t))}}function YN(e){Ul?Wl?Wl.push(e):Wl=[e]:Ul=e}function XN(){if(Ul){var e=Ul,t=Wl;if(Wl=Ul=null,EC(e),t)for(e=0;e>>=0,e===0?32:31-(D6(e)/L6|0)|0}var hp=64,mp=4194304;function $c(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=$c(a):(o&=s,o!==0&&(r=$c(o)))}else s=n&~i,s!==0?r=$c(s):o!==0&&(r=$c(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Oi(t),e[t]=n}function F6(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Xc),RC=" ",DC=!1;function g2(e,t){switch(e){case"keyup":return d8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nl=!1;function h8(e,t){switch(e){case"compositionend":return y2(t);case"keypress":return t.which!==32?null:(DC=!0,RC);case"textInput":return e=t.data,e===RC&&DC?null:e;default:return null}}function m8(e,t){if(Nl)return e==="compositionend"||!dw&&g2(e,t)?(e=h2(),rh=uw=os=null,Nl=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$C(n)}}function w2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?w2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b2(){for(var e=window,t=Ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ch(e.document)}return t}function pw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function S8(e){var t=b2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&w2(n.ownerDocument.documentElement,n)){if(r!==null&&pw(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=FC(n,o);var s=FC(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ol=null,gx=null,Zc=null,yx=!1;function BC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yx||Ol==null||Ol!==Ch(r)||(r=Ol,"selectionStart"in r&&pw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zc&&vf(Zc,r)||(Zc=r,r=Rh(gx,"onSelect"),0Ll||(e.current=Ex[Ll],Ex[Ll]=null,Ll--)}function bt(e,t){Ll++,Ex[Ll]=e.current,e.current=t}var Ss={},Nn=Ns(Ss),gr=Ns(!1),ba=Ss;function iu(e,t){var n=e.type.contextTypes;if(!n)return Ss;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yr(e){return e=e.childContextTypes,e!=null}function Lh(){kt(gr),kt(Nn)}function GC(e,t,n){if(Nn.current!==Ss)throw Error(me(168));bt(Nn,t),bt(gr,n)}function O2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(me(108,x6(e)||"Unknown",i));return $t({},n,r)}function Ph(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ss,ba=Nn.current,bt(Nn,e),bt(gr,gr.current),!0}function KC(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=O2(e,t,ba),r.__reactInternalMemoizedMergedChildContext=e,kt(gr),kt(Nn),bt(Nn,e)):kt(gr),bt(gr,n)}var po=null,Fm=!1,Lv=!1;function R2(e){po===null?po=[e]:po.push(e)}function M8(e){Fm=!0,R2(e)}function Os(){if(!Lv&&po!==null){Lv=!0;var e=0,t=pt;try{var n=po;for(pt=1;e>=s,i-=s,go=1<<32-Oi(t)+i|n<M?(z=O,O=null):z=O.sibling;var U=h(y,O,E[M],C);if(U===null){O===null&&(O=z);break}e&&O&&U.alternate===null&&t(y,O),_=o(U,_,M),I===null?T=U:I.sibling=U,I=U,O=z}if(M===E.length)return n(y,O),Rt&&Zs(y,M),T;if(O===null){for(;MM?(z=O,O=null):z=O.sibling;var F=h(y,O,U.value,C);if(F===null){O===null&&(O=z);break}e&&O&&F.alternate===null&&t(y,O),_=o(F,_,M),I===null?T=F:I.sibling=F,I=F,O=z}if(U.done)return n(y,O),Rt&&Zs(y,M),T;if(O===null){for(;!U.done;M++,U=E.next())U=p(y,U.value,C),U!==null&&(_=o(U,_,M),I===null?T=U:I.sibling=U,I=U);return Rt&&Zs(y,M),T}for(O=r(y,O);!U.done;M++,U=E.next())U=m(O,y,M,U.value,C),U!==null&&(e&&U.alternate!==null&&O.delete(U.key===null?M:U.key),_=o(U,_,M),I===null?T=U:I.sibling=U,I=U);return e&&O.forEach(function(W){return t(y,W)}),Rt&&Zs(y,M),T}function b(y,_,E,C){if(typeof E=="object"&&E!==null&&E.type===kl&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case fp:e:{for(var T=E.key,I=_;I!==null;){if(I.key===T){if(T=E.type,T===kl){if(I.tag===7){n(y,I.sibling),_=i(I,E.props.children),_.return=y,y=_;break e}}else if(I.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Yo&&XC(T)===I.type){n(y,I.sibling),_=i(I,E.props),_.ref=mc(y,I,E),_.return=y,y=_;break e}n(y,I);break}else t(y,I);I=I.sibling}E.type===kl?(_=ma(E.props.children,y.mode,C,E.key),_.return=y,y=_):(C=fh(E.type,E.key,E.props,null,y.mode,C),C.ref=mc(y,_,E),C.return=y,y=C)}return s(y);case Tl:e:{for(I=E.key;_!==null;){if(_.key===I)if(_.tag===4&&_.stateNode.containerInfo===E.containerInfo&&_.stateNode.implementation===E.implementation){n(y,_.sibling),_=i(_,E.children||[]),_.return=y,y=_;break e}else{n(y,_);break}else t(y,_);_=_.sibling}_=jv(E,y.mode,C),_.return=y,y=_}return s(y);case Yo:return I=E._init,b(y,_,I(E._payload),C)}if(Mc(E))return v(y,_,E,C);if(cc(E))return x(y,_,E,C);bp(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,_!==null&&_.tag===6?(n(y,_.sibling),_=i(_,E),_.return=y,y=_):(n(y,_),_=zv(E,y.mode,C),_.return=y,y=_),s(y)):n(y,_)}return b}var su=M2(!0),$2=M2(!1),Fh=Ns(null),Bh=null,$l=null,yw=null;function vw(){yw=$l=Bh=null}function xw(e){var t=Fh.current;kt(Fh),e._currentValue=t}function Ix(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Kl(e,t){Bh=e,yw=$l=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(hr=!0),e.firstContext=null)}function pi(e){var t=e._currentValue;if(yw!==e)if(e={context:e,memoizedValue:t,next:null},$l===null){if(Bh===null)throw Error(me(308));$l=e,Bh.dependencies={lanes:0,firstContext:e}}else $l=$l.next=e;return t}var sa=null;function _w(e){sa===null?sa=[e]:sa.push(e)}function F2(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_w(t)):(n.next=i.next,i.next=n),t.interleaved=n,Co(e,r)}function Co(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Xo=!1;function ww(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ot&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Co(e,n)}return i=r.interleaved,i===null?(t.next=t,_w(r)):(t.next=i.next,i.next=t),r.interleaved=t,Co(e,n)}function oh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sw(e,n)}}function QC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hh(e,t,n,r){var i=e.updateQueue;Xo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,s===null?o=c:s.next=c,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=u))}if(o!==null){var p=i.baseState;s=0,d=c=u=null,a=o;do{var h=a.lane,m=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,x=a;switch(h=t,m=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=$t({},p,h);break e;case 2:Xo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,u=p):d=d.next=m,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(u=p),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ca|=s,e.lanes=s,e.memoizedState=p}}function ZC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Mv.transition;Mv.transition={};try{e(!1),t()}finally{pt=n,Mv.transition=r}}function nO(){return hi().memoizedState}function H8(e,t,n){var r=gs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rO(e))iO(t,n);else if(n=F2(e,t,n,r),n!==null){var i=Wn();Ri(n,e,r,i),oO(n,t,r)}}function z8(e,t,n){var r=gs(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rO(e))iO(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Pi(a,s)){var u=t.interleaved;u===null?(i.next=i,_w(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=F2(e,t,i,r),n!==null&&(i=Wn(),Ri(n,e,r,i),oO(n,t,r))}}function rO(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function iO(e,t){Jc=jh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sw(e,n)}}var Vh={readContext:pi,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},j8={readContext:pi,useCallback:function(e,t){return Vi().memoizedState=[e,t===void 0?null:t],e},useContext:pi,useEffect:eI,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ah(4194308,4,Q2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ah(4194308,4,e,t)},useInsertionEffect:function(e,t){return ah(4,2,e,t)},useMemo:function(e,t){var n=Vi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=H8.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=Vi();return e={current:e},t.memoizedState=e},useState:JC,useDebugValue:kw,useDeferredValue:function(e){return Vi().memoizedState=e},useTransition:function(){var e=JC(!1),t=e[0];return e=B8.bind(null,e[1]),Vi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,i=Vi();if(Rt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),cn===null)throw Error(me(349));Sa&30||V2(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,eI(W2.bind(null,r,o,e),[e]),r.flags|=2048,If(9,U2.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vi(),t=cn.identifierPrefix;if(Rt){var n=yo,r=go;n=(r&~(1<<32-Oi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Gi]=t,e[wf]=r,mO(e,t,!1,!1),t.stateNode=e;e:{switch(s=lx(n,r),n){case"dialog":At("cancel",e),At("close",e),i=r;break;case"iframe":case"object":case"embed":At("load",e),i=r;break;case"video":case"audio":for(i=0;iuu&&(t.flags|=128,r=!0,gc(o,!1),t.lanes=4194304)}else{if(!r)if(e=zh(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Rt)return An(t),null}else 2*Kt()-o.renderingStartTime>uu&&n!==1073741824&&(t.flags|=128,r=!0,gc(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Kt(),t.sibling=null,n=Lt.current,bt(Lt,r?n&1|2:n&1),t):(An(t),null);case 22:case 23:return Pw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nr&1073741824&&(An(t),t.subtreeFlags&6&&(t.flags|=8192)):An(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function X8(e,t){switch(mw(t),t.tag){case 1:return yr(t.type)&&Lh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return au(),kt(gr),kt(Nn),Sw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ew(t),null;case 13:if(kt(Lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(Lt),null;case 4:return au(),null;case 10:return xw(t.type._context),null;case 22:case 23:return Pw(),null;case 24:return null;default:return null}}var Sp=!1,kn=!1,Q8=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Fl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function Px(e,t,n){try{n()}catch(r){zt(e,t,r)}}var fI=!1;function Z8(e,t){if(vx=Nh,e=b2(),pw(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,c=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(a=s+i),p!==o||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++c===i&&(a=s),h===o&&++d===r&&(u=s),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(xx={focusedElem:e,selectionRange:n},Nh=!1,Ce=t;Ce!==null;)if(t=Ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ce=e;else for(;Ce!==null;){t=Ce;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,b=v.memoizedState,y=t.stateNode,_=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ci(t.type,x),b);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(C){zt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Ce=e;break}Ce=t.return}return v=fI,fI=!1,v}function ef(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Px(t,n,o)}i=i.next}while(i!==r)}}function zm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mx(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vO(e){var t=e.alternate;t!==null&&(e.alternate=null,vO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gi],delete t[wf],delete t[bx],delete t[L8],delete t[P8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xO(e){return e.tag===5||e.tag===3||e.tag===4}function dI(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $x(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dh));else if(r!==4&&(e=e.child,e!==null))for($x(e,t,n),e=e.sibling;e!==null;)$x(e,t,n),e=e.sibling}function Fx(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fx(e,t,n),e=e.sibling;e!==null;)Fx(e,t,n),e=e.sibling}var vn=null,Ii=!1;function Wo(e,t,n){for(n=n.child;n!==null;)_O(e,t,n),n=n.sibling}function _O(e,t,n){if(qi&&typeof qi.onCommitFiberUnmount=="function")try{qi.onCommitFiberUnmount(Dm,n)}catch{}switch(n.tag){case 5:kn||Fl(n,t);case 6:var r=vn,i=Ii;vn=null,Wo(e,t,n),vn=r,Ii=i,vn!==null&&(Ii?(e=vn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):vn.removeChild(n.stateNode));break;case 18:vn!==null&&(Ii?(e=vn,n=n.stateNode,e.nodeType===8?Dv(e.parentNode,n):e.nodeType===1&&Dv(e,n),gf(e)):Dv(vn,n.stateNode));break;case 4:r=vn,i=Ii,vn=n.stateNode.containerInfo,Ii=!0,Wo(e,t,n),vn=r,Ii=i;break;case 0:case 11:case 14:case 15:if(!kn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Px(n,t,s),i=i.next}while(i!==r)}Wo(e,t,n);break;case 1:if(!kn&&(Fl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){zt(n,t,a)}Wo(e,t,n);break;case 21:Wo(e,t,n);break;case 22:n.mode&1?(kn=(r=kn)||n.memoizedState!==null,Wo(e,t,n),kn=r):Wo(e,t,n);break;default:Wo(e,t,n)}}function pI(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Q8),t.forEach(function(r){var i=a9.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Si(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*e9(r/1960))-r,10e?16:e,ss===null)var r=!1;else{if(e=ss,ss=null,Gh=0,ot&6)throw Error(me(331));var i=ot;for(ot|=4,Ce=e.current;Ce!==null;){var o=Ce,s=o.child;if(Ce.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uKt()-Dw?ha(e,0):Rw|=n),vr(e,t)}function TO(e,t){t===0&&(e.mode&1?(t=mp,mp<<=1,!(mp&130023424)&&(mp=4194304)):t=1);var n=Wn();e=Co(e,t),e!==null&&(Yf(e,t,n),vr(e,n))}function s9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),TO(e,n)}function a9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),TO(e,n)}var kO;kO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)hr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return hr=!1,q8(e,t,n);hr=!!(e.flags&131072)}else hr=!1,Rt&&t.flags&1048576&&D2(t,$h,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lh(e,t),e=t.pendingProps;var i=iu(t,Nn.current);Kl(t,n),i=Iw(null,t,r,e,i,n);var o=Aw();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yr(r)?(o=!0,Ph(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ww(t),i.updater=Hm,t.stateNode=i,i._reactInternals=t,Tx(t,r,e,n),t=Ox(null,t,r,!0,o,n)):(t.tag=0,Rt&&o&&hw(t),Vn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lh(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=u9(r),e=Ci(r,e),i){case 0:t=Nx(null,t,r,e,n);break e;case 1:t=lI(null,t,r,e,n);break e;case 11:t=sI(null,t,r,e,n);break e;case 14:t=aI(null,t,r,Ci(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ci(r,i),Nx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ci(r,i),lI(e,t,r,i,n);case 3:e:{if(dO(t),e===null)throw Error(me(387));r=t.pendingProps,o=t.memoizedState,i=o.element,B2(e,t),Hh(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=lu(Error(me(423)),t),t=uI(e,t,r,n,i);break e}else if(r!==i){i=lu(Error(me(424)),t),t=uI(e,t,r,n,i);break e}else for(Rr=ps(t.stateNode.containerInfo.firstChild),Pr=t,Rt=!0,Ai=null,n=$2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ou(),r===i){t=Io(e,t,n);break e}Vn(e,t,r,n)}t=t.child}return t;case 5:return H2(t),e===null&&Cx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,_x(r,i)?s=null:o!==null&&_x(r,o)&&(t.flags|=32),fO(e,t),Vn(e,t,s,n),t.child;case 6:return e===null&&Cx(t),null;case 13:return pO(e,t,n);case 4:return bw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=su(t,null,r,n):Vn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ci(r,i),sI(e,t,r,i,n);case 7:return Vn(e,t,t.pendingProps,n),t.child;case 8:return Vn(e,t,t.pendingProps.children,n),t.child;case 12:return Vn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,bt(Fh,r._currentValue),r._currentValue=s,o!==null)if(Pi(o.value,s)){if(o.children===i.children&&!gr.current){t=Io(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=xo(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ix(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(me(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ix(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Vn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Kl(t,n),i=pi(i),r=r(i),t.flags|=1,Vn(e,t,r,n),t.child;case 14:return r=t.type,i=Ci(r,t.pendingProps),i=Ci(r.type,i),aI(e,t,r,i,n);case 15:return uO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ci(r,i),lh(e,t),t.tag=1,yr(r)?(e=!0,Ph(t)):e=!1,Kl(t,n),sO(t,r,i),Tx(t,r,i,n),Ox(null,t,r,!0,e,n);case 19:return hO(e,t,n);case 22:return cO(e,t,n)}throw Error(me(156,t.tag))};function NO(e,t){return r2(e,t)}function l9(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new l9(e,t,n,r)}function $w(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u9(e){if(typeof e=="function")return $w(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nw)return 11;if(e===rw)return 14}return 2}function ys(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fh(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")$w(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case kl:return ma(n.children,i,o,t);case tw:s=8,i|=8;break;case Z0:return e=ai(12,n,t,i|2),e.elementType=Z0,e.lanes=o,e;case J0:return e=ai(13,n,t,i),e.elementType=J0,e.lanes=o,e;case ex:return e=ai(19,n,t,i),e.elementType=ex,e.lanes=o,e;case HN:return Vm(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FN:s=10;break e;case BN:s=9;break e;case nw:s=11;break e;case rw:s=14;break e;case Yo:s=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=ai(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ma(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function Vm(e,t,n,r){return e=ai(22,e,r,t),e.elementType=HN,e.lanes=n,e.stateNode={isHidden:!1},e}function zv(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function jv(e,t,n){return t=ai(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c9(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bv(0),this.expirationTimes=bv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bv(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Fw(e,t,n,r,i,o,s,a,u){return e=new c9(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ai(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ww(o),e}function f9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(LO)}catch(e){console.error(e)}}LO(),LN.exports=Vr;var qm=LN.exports;const la=Ts(qm);var PO,wI=qm;PO=wI.createRoot,wI.hydrateRoot;var MO={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s{o!=null&&(typeof o=="object"?t.forEach(s=>{const a=o[s];if(a!=null){const u=s!==n?`-${s}`:"";r.push(`${i}${u}-${a}`)}}):r.push(`${i}-${o}`))}),r}const $a=A.forwardRef(({as:e="div",bsPrefix:t,className:n,direction:r,gap:i,...o},s)=>{t=Be(t,r==="horizontal"?"hstack":"vstack");const a=jw(),u=Vw();return S.jsx(e,{...o,ref:s,className:Te(n,t,...b9({gap:i},a,u))})});$a.displayName="Stack";const{createElement:cu,createContext:E9,createRef:$he,forwardRef:VO,useCallback:ar,useContext:UO,useEffect:ga,useImperativeHandle:WO,useLayoutEffect:S9,useMemo:C9,useRef:ur,useState:Yl}=Sh,bI=Sh[`useId${Math.random()}`.slice(0,5)],I9=S9,Xm=E9(null);Xm.displayName="PanelGroupContext";const ya=I9,A9=typeof bI=="function"?bI:()=>null;let T9=0;function Uw(e=null){const t=A9(),n=ur(e||t||null);return n.current===null&&(n.current=""+T9++),e??n.current}function GO({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:u,onCollapse:c,onExpand:d,onResize:p,order:h,style:m,tagName:v="div",...x}){const b=UO(Xm);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:_,getPanelSize:E,getPanelStyle:C,groupId:T,isPanelCollapsed:I,reevaluatePanelConstraints:O,registerPanel:M,resizePanel:z,unregisterPanel:U}=b,F=Uw(s),W=ur({callbacks:{onCollapse:c,onExpand:d,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:u},id:F,idIsFromProps:s!==void 0,order:h});ur({didLogMissingDefaultSizeWarning:!1}),ya(()=>{const{callbacks:L,constraints:B}=W.current,j={...B};W.current.id=F,W.current.idIsFromProps=s!==void 0,W.current.order=h,L.onCollapse=c,L.onExpand=d,L.onResize=p,B.collapsedSize=n,B.collapsible=r,B.defaultSize=i,B.maxSize=a,B.minSize=u,(j.collapsedSize!==B.collapsedSize||j.collapsible!==B.collapsible||j.maxSize!==B.maxSize||j.minSize!==B.minSize)&&O(W.current,j)}),ya(()=>{const L=W.current;return M(L),()=>{U(L)}},[h,F,M,U]),WO(o,()=>({collapse:()=>{y(W.current)},expand:L=>{_(W.current,L)},getId(){return F},getSize(){return E(W.current)},isCollapsed(){return I(W.current)},isExpanded(){return!I(W.current)},resize:L=>{z(W.current,L)}}),[y,_,E,I,F,z]);const Y=C(W.current,i);return cu(v,{...x,children:e,className:t,id:s,style:{...Y,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":T,"data-panel-id":F,"data-panel-size":parseFloat(""+Y.flexGrow).toFixed(1)})}const Bc=VO((e,t)=>cu(GO,{...e,forwardedRef:t}));GO.displayName="Panel";Bc.displayName="forwardRef(Panel)";let Vx=null,ua=null;function k9(e,t){if(t){const n=(t&QO)!==0,r=(t&ZO)!==0,i=(t&JO)!==0,o=(t&eR)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function N9(){ua!==null&&(document.head.removeChild(ua),Vx=null,ua=null)}function Vv(e,t){const n=k9(e,t);Vx!==n&&(Vx=n,ua===null&&(ua=document.createElement("style"),document.head.appendChild(ua)),ua.innerHTML=`*{cursor: ${n}!important;}`)}function KO(e){return e.type==="keydown"}function qO(e){return e.type.startsWith("pointer")}function YO(e){return e.type.startsWith("mouse")}function Qm(e){if(qO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(YO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function O9(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function R9(e,t,n){return e.xt.x&&e.yt.y}function D9(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:CI(e),b:CI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ye(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:SI(EI(n.a)),b:SI(EI(n.b))};if(i.a===i.b){const o=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=o.length;for(;a--;){const u=o[a];if(u===s.a)return 1;if(u===s.b)return-1}}return Math.sign(i.a-i.b)}const L9=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function P9(e){var t;const n=getComputedStyle((t=XO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function M9(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||P9(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||L9.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function EI(e){let t=e.length;for(;t--;){const n=e[t];if(Ye(n,"Missing node"),M9(n))return n}return null}function SI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function CI(e){const t=[];for(;e;)t.push(e),e=XO(e);return t}function XO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const QO=1,ZO=2,JO=4,eR=8,$9=O9()==="coarse";let Di=[],Xl=!1,rs=new Map,Zm=new Map;const Tf=new Set;function F9(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},u=(o=rs.get(s))!==null&&o!==void 0?o:0;return rs.set(s,u+1),Tf.add(a),Yh(),function(){var d;Zm.delete(e),Tf.delete(a);const p=(d=rs.get(s))!==null&&d!==void 0?d:1;if(rs.set(s,p-1),Yh(),p===1&&rs.delete(s),Di.includes(a)){const h=Di.indexOf(a);h>=0&&Di.splice(h,1),Gw(),i("up",!0,null)}}}function II(e){const{target:t}=e,{x:n,y:r}=Qm(e);Xl=!0,Ww({target:t,x:n,y:r}),Yh(),Di.length>0&&(Xh("down",e),e.preventDefault(),e.stopPropagation())}function vc(e){const{x:t,y:n}=Qm(e);if(Xl&&e.buttons===0&&(Xl=!1,Xh("up",e)),!Xl){const{target:r}=e;Ww({target:r,x:t,y:n})}Xh("move",e),Gw(),Di.length>0&&e.preventDefault()}function dl(e){const{target:t}=e,{x:n,y:r}=Qm(e);Zm.clear(),Xl=!1,Di.length>0&&e.preventDefault(),Xh("up",e),Ww({target:t,x:n,y:r}),Gw(),Yh()}function Ww({target:e,x:t,y:n}){Di.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Tf.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:u,left:c,right:d,top:p}=a,h=$9?s.coarse:s.fine;if(t>=c-h&&t<=d+h&&n>=p-h&&n<=u+h){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&D9(r,o)>0){let v=r,x=!1;for(;v&&!v.contains(o);){if(R9(v.getBoundingClientRect(),a)){x=!0;break}v=v.parentElement}if(x)return}Di.push(i)}})}function Uv(e,t){Zm.set(e,t)}function Gw(){let e=!1,t=!1;Di.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;Zm.forEach(r=>{n|=r}),e&&t?Vv("intersection",n):e?Vv("horizontal",n):t?Vv("vertical",n):N9()}function Yh(){rs.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",dl),n.removeEventListener("pointerdown",II),n.removeEventListener("pointerleave",vc),n.removeEventListener("pointermove",vc)}),window.removeEventListener("pointerup",dl),window.removeEventListener("pointercancel",dl),Tf.size>0&&(Xl?(Di.length>0&&rs.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",dl),n.addEventListener("pointerleave",vc),n.addEventListener("pointermove",vc))}),window.addEventListener("pointerup",dl),window.addEventListener("pointercancel",dl)):rs.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",II,{capture:!0}),n.addEventListener("pointermove",vc))}))}function Xh(e,t){Tf.forEach(n=>{const{setResizeHandlerState:r}=n,i=Di.includes(n);r(e,i,t)})}function B9(){const[e,t]=Yl(0);return ar(()=>t(n=>n+1),[])}function Ye(e,t){if(!e)throw console.error(t),Error(t)}const Kw=10;function Aa(e,t,n=Kw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ho(e,t,n=Kw){return Aa(e,t,n)===0}function Or(e,t,n){return Aa(e,t,n)===0}function H9(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-y:y)}}}{const p=e<0?a:u,h=n[p];Ye(h,`No panel constraints found for index ${p}`);const{collapsedSize:m=0,collapsible:v,minSize:x=0}=h;if(v){const b=t[p];if(Ye(b!=null,`Previous layout not found for panel index ${p}`),Or(b,x)){const y=b-m;Aa(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const p=e<0?1:-1;let h=e<0?u:a,m=0;for(;;){const x=t[h];Ye(x!=null,`Previous layout not found for panel index ${h}`);const y=Hl({panelConstraints:n,panelIndex:h,size:100})-x;if(m+=y,h+=p,h<0||h>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-v:v}{let h=e<0?a:u;for(;h>=0&&h=0))break;e<0?h--:h++}}if(H9(i,s))return i;{const p=e<0?u:a,h=t[p];Ye(h!=null,`Previous layout not found for panel index ${p}`);const m=h+c,v=Hl({panelConstraints:n,panelIndex:p,size:m});if(s[p]=v,!Or(v,m)){let x=m-v,y=e<0?u:a;for(;y>=0&&y0?y--:y++}}}const d=s.reduce((p,h)=>h+p,0);return Or(d,100)?s:i}function z9({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];Ye(a!=null,"No pivot index found"),t.forEach((p,h)=>{const{constraints:m}=p,{maxSize:v=100,minSize:x=0}=m;h===a?(r=x,i=v):(o+=x,s+=v)});const u=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:u,valueMin:c,valueNow:d}}function kf(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function tR(e,t,n=document){const i=kf(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function nR(e,t,n){const r=tR(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function rR(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Jm(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function j9(e,t,n,r=document){var i,o,s,a;const u=Jm(t,r),c=kf(e,r),d=u?c.indexOf(u):-1,p=(i=(o=n[d])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,h=(s=(a=n[d+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[p,h]}function V9({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){ur({didWarnAboutMissingResizeHandle:!1}),ya(()=>{if(!o)return;const a=kf(n,o);for(let u=0;u{a.forEach((u,c)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,i,o]),ga(()=>{if(!o)return;const a=t.current;Ye(a,"Eager values not found");const{panelDataArray:u}=a,c=rR(n,o);Ye(c!=null,`No group found for id "${n}"`);const d=kf(n,o);Ye(d,`No resize handles found for group id "${n}"`);const p=d.map(h=>{const m=h.getAttribute("data-panel-resize-handle-id");Ye(m,"Resize handle element has no handle id attribute");const[v,x]=j9(n,m,u,o);if(v==null||x==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const _=u.findIndex(E=>E.id===v);if(_>=0){const E=u[_];Ye(E,`No panel data found for index ${_}`);const C=r[_],{collapsedSize:T=0,collapsible:I,minSize:O=0}=E.constraints;if(C!=null&&I){const M=Hc({delta:Or(C,T)?O-T:T-C,initialLayout:r,panelConstraints:u.map(z=>z.constraints),pivotIndices:nR(n,m,o),prevLayout:r,trigger:"keyboard"});r!==M&&s(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{p.forEach(h=>h())}},[o,e,t,n,r,i,s])}function AI(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,i=100;for(let o=0;o{const o=e[i];Ye(o,`Panel data not found for index ${i}`);const{callbacks:s,constraints:a,id:u}=o,{collapsedSize:c=0,collapsible:d}=a,p=n[u];if(p==null||r!==p){n[u]=r;const{onCollapse:h,onExpand:m,onResize:v}=s;v&&v(r,p),d&&(h||m)&&(m&&(p==null||ho(p,c))&&!ho(r,c)&&m(),h&&(p==null||!ho(p,c))&&ho(r,c)&&h())}})}function Ap(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function TI(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function oR(e){return`react-resizable-panels:${e}`}function sR(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function aR(e,t){try{const n=oR(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Y9(e,t,n){var r,i;const o=(r=aR(e,n))!==null&&r!==void 0?r:{},s=sR(t);return(i=o[s])!==null&&i!==void 0?i:null}function X9(e,t,n,r,i){var o;const s=oR(e),a=sR(t),u=(o=aR(e,i))!==null&&o!==void 0?o:{};u[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(u))}catch(c){console.error(c)}}function kI({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Or(r,100)&&n.length>0)for(let o=0;o(TI(zc),zc.getItem(e)),setItem:(e,t)=>{TI(zc),zc.setItem(e,t)}},NI={};function lR({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:u=zc,style:c,tagName:d="div",...p}){const h=Uw(o),m=ur(null),[v,x]=Yl(null),[b,y]=Yl([]),_=B9(),E=ur({}),C=ur(new Map),T=ur(0),I=ur({autoSaveId:e,direction:r,dragState:v,id:h,keyboardResizeBy:a,onLayout:s,storage:u}),O=ur({layout:b,panelDataArray:[],panelDataArrayChanged:!1});ur({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),WO(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:R}=O.current;return R},setLayout:R=>{const{onLayout:ee}=I.current,{layout:re,panelDataArray:oe}=O.current,pe=kI({layout:R,panelConstraints:oe.map(ye=>ye.constraints)});AI(re,pe)||(y(pe),O.current.layout=pe,ee&&ee(pe),pl(oe,pe,E.current))}}),[]),ya(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=v,I.current.id=h,I.current.onLayout=s,I.current.storage=u}),V9({committedValuesRef:I,eagerValuesRef:O,groupId:h,layout:b,panelDataArray:O.current.panelDataArray,setLayout:y,panelGroupElement:m.current}),ga(()=>{const{panelDataArray:R}=O.current;if(e){if(b.length===0||b.length!==R.length)return;let ee=NI[e];ee==null&&(ee=q9(X9,Q9),NI[e]=ee);const re=[...R],oe=new Map(C.current);ee(e,re,oe,b,u)}},[e,b,u]),ga(()=>{});const M=ar(R=>{const{onLayout:ee}=I.current,{layout:re,panelDataArray:oe}=O.current;if(R.constraints.collapsible){const pe=oe.map(We=>We.constraints),{collapsedSize:ye=0,panelSize:_e,pivotIndices:Se}=Xs(oe,R,re);if(Ye(_e!=null,`Panel size not found for panel "${R.id}"`),!ho(_e,ye)){C.current.set(R.id,_e);const Re=El(oe,R)===oe.length-1?_e-ye:ye-_e,De=Hc({delta:Re,initialLayout:re,panelConstraints:pe,pivotIndices:Se,prevLayout:re,trigger:"imperative-api"});Ap(re,De)||(y(De),O.current.layout=De,ee&&ee(De),pl(oe,De,E.current))}}},[]),z=ar((R,ee)=>{const{onLayout:re}=I.current,{layout:oe,panelDataArray:pe}=O.current;if(R.constraints.collapsible){const ye=pe.map(He=>He.constraints),{collapsedSize:_e=0,panelSize:Se=0,minSize:We=0,pivotIndices:Re}=Xs(pe,R,oe),De=ee??We;if(ho(Se,_e)){const He=C.current.get(R.id),Ie=He!=null&&He>=De?He:De,Pe=El(pe,R)===pe.length-1?Se-Ie:Ie-Se,we=Hc({delta:Pe,initialLayout:oe,panelConstraints:ye,pivotIndices:Re,prevLayout:oe,trigger:"imperative-api"});Ap(oe,we)||(y(we),O.current.layout=we,re&&re(we),pl(pe,we,E.current))}}},[]),U=ar(R=>{const{layout:ee,panelDataArray:re}=O.current,{panelSize:oe}=Xs(re,R,ee);return Ye(oe!=null,`Panel size not found for panel "${R.id}"`),oe},[]),F=ar((R,ee)=>{const{panelDataArray:re}=O.current,oe=El(re,R);return K9({defaultSize:ee,dragState:v,layout:b,panelData:re,panelIndex:oe})},[v,b]),W=ar(R=>{const{layout:ee,panelDataArray:re}=O.current,{collapsedSize:oe=0,collapsible:pe,panelSize:ye}=Xs(re,R,ee);return Ye(ye!=null,`Panel size not found for panel "${R.id}"`),pe===!0&&ho(ye,oe)},[]),Y=ar(R=>{const{layout:ee,panelDataArray:re}=O.current,{collapsedSize:oe=0,collapsible:pe,panelSize:ye}=Xs(re,R,ee);return Ye(ye!=null,`Panel size not found for panel "${R.id}"`),!pe||Aa(ye,oe)>0},[]),L=ar(R=>{const{panelDataArray:ee}=O.current;ee.push(R),ee.sort((re,oe)=>{const pe=re.order,ye=oe.order;return pe==null&&ye==null?0:pe==null?-1:ye==null?1:pe-ye}),O.current.panelDataArrayChanged=!0,_()},[_]);ya(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:ee,storage:re}=I.current,{layout:oe,panelDataArray:pe}=O.current;let ye=null;if(R){const Se=Y9(R,pe,re);Se&&(C.current=new Map(Object.entries(Se.expandToSizes)),ye=Se.layout)}ye==null&&(ye=G9({panelDataArray:pe}));const _e=kI({layout:ye,panelConstraints:pe.map(Se=>Se.constraints)});AI(oe,_e)||(y(_e),O.current.layout=_e,ee&&ee(_e),pl(pe,_e,E.current))}}),ya(()=>{const R=O.current;return()=>{R.layout=[]}},[]);const B=ar(R=>function(re){re.preventDefault();const oe=m.current;if(!oe)return()=>null;const{direction:pe,dragState:ye,id:_e,keyboardResizeBy:Se,onLayout:We}=I.current,{layout:Re,panelDataArray:De}=O.current,{initialLayout:He}=ye??{},Ie=nR(_e,R,oe);let rt=W9(re,R,pe,ye,Se,oe);const Pe=pe==="horizontal";document.dir==="rtl"&&Pe&&(rt=-rt);const we=De.map(yt=>yt.constraints),mt=Hc({delta:rt,initialLayout:He??Re,panelConstraints:we,pivotIndices:Ie,prevLayout:Re,trigger:KO(re)?"keyboard":"mouse-or-touch"}),gt=!Ap(Re,mt);(qO(re)||YO(re))&&T.current!=rt&&(T.current=rt,!gt&&rt!==0?Pe?Uv(R,rt<0?QO:ZO):Uv(R,rt<0?JO:eR):Uv(R,0)),gt&&(y(mt),O.current.layout=mt,We&&We(mt),pl(De,mt,E.current))},[]),j=ar((R,ee)=>{const{onLayout:re}=I.current,{layout:oe,panelDataArray:pe}=O.current,ye=pe.map(He=>He.constraints),{panelSize:_e,pivotIndices:Se}=Xs(pe,R,oe);Ye(_e!=null,`Panel size not found for panel "${R.id}"`);const Re=El(pe,R)===pe.length-1?_e-ee:ee-_e,De=Hc({delta:Re,initialLayout:oe,panelConstraints:ye,pivotIndices:Se,prevLayout:oe,trigger:"imperative-api"});Ap(oe,De)||(y(De),O.current.layout=De,re&&re(De),pl(pe,De,E.current))},[]),X=ar((R,ee)=>{const{layout:re,panelDataArray:oe}=O.current,{collapsedSize:pe=0,collapsible:ye}=ee,{collapsedSize:_e=0,collapsible:Se,maxSize:We=100,minSize:Re=0}=R.constraints,{panelSize:De}=Xs(oe,R,re);De!=null&&(ye&&Se&&ho(De,pe)?ho(pe,_e)||j(R,_e):DeWe&&j(R,We))},[j]),V=ar((R,ee)=>{const{direction:re}=I.current,{layout:oe}=O.current;if(!m.current)return;const pe=Jm(R,m.current);Ye(pe,`Drag handle element not found for id "${R}"`);const ye=iR(re,ee);x({dragHandleId:R,dragHandleRect:pe.getBoundingClientRect(),initialCursorPosition:ye,initialLayout:oe})},[]),H=ar(()=>{x(null)},[]),N=ar(R=>{const{panelDataArray:ee}=O.current,re=El(ee,R);re>=0&&(ee.splice(re,1),delete E.current[R.id],O.current.panelDataArrayChanged=!0,_())},[_]),Z=C9(()=>({collapsePanel:M,direction:r,dragState:v,expandPanel:z,getPanelSize:U,getPanelStyle:F,groupId:h,isPanelCollapsed:W,isPanelExpanded:Y,reevaluatePanelConstraints:X,registerPanel:L,registerResizeHandle:B,resizePanel:j,startDragging:V,stopDragging:H,unregisterPanel:N,panelGroupElement:m.current}),[M,v,r,z,U,F,h,W,Y,X,L,B,j,V,H,N]),te={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return cu(Xm.Provider,{value:Z},cu(d,{...p,children:t,className:n,id:o,ref:m,style:{...te,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const Ux=VO((e,t)=>cu(lR,{...e,forwardedRef:t}));lR.displayName="PanelGroup";Ux.displayName="forwardRef(PanelGroup)";function El(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xs(e,t,n){const r=El(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function Z9({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){ga(()=>{if(e||n==null||r==null)return;const i=Jm(t,r);if(i==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=i.getAttribute("data-panel-group-id");Ye(a,`No group element found for id "${a}"`);const u=kf(a,r),c=tR(a,t,r);Ye(c!==null,`No resize element found for id "${t}"`);const d=s.shiftKey?c>0?c-1:u.length-1:c+1{i.removeEventListener("keydown",o)}},[r,e,t,n])}function Wx({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onDragging:s,onFocus:a,style:u={},tabIndex:c=0,tagName:d="div",...p}){var h,m;const v=ur(null),x=ur({onDragging:s});ga(()=>{x.current.onDragging=s});const b=UO(Xm);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:_,registerResizeHandle:E,startDragging:C,stopDragging:T,panelGroupElement:I}=b,O=Uw(i),[M,z]=Yl("inactive"),[U,F]=Yl(!1),[W,Y]=Yl(null),L=ur({state:M});ya(()=>{L.current.state=M}),ga(()=>{if(n)Y(null);else{const V=E(O);Y(()=>V)}},[n,O,E]);const B=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,j=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return ga(()=>{if(n||W==null)return;const V=v.current;return Ye(V,"Element ref not attached"),F9(O,V,y,{coarse:B,fine:j},(N,Z,te)=>{if(Z)switch(N){case"down":{z("drag"),Ye(te,'Expected event to be defined for "down" action'),C(O,te);const{onDragging:R}=x.current;R&&R(!0);break}case"move":{const{state:R}=L.current;R!=="drag"&&z("hover"),Ye(te,'Expected event to be defined for "move" action'),W(te);break}case"up":{z("hover"),T();const{onDragging:R}=x.current;R&&R(!1);break}}else z("inactive")})},[B,y,n,j,E,O,W,C,T]),Z9({disabled:n,handleId:O,resizeHandler:W,panelGroupElement:I}),cu(d,{...p,children:e,className:t,id:i,onBlur:()=>{F(!1),o==null||o()},onFocus:()=>{F(!0),a==null||a()},ref:v,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...u},tabIndex:c,"data-panel-group-direction":y,"data-panel-group-id":_,"data-resize-handle":"","data-resize-handle-active":M==="drag"?"pointer":U?"keyboard":void 0,"data-resize-handle-state":M,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":O})}Wx.displayName="PanelResizeHandle";function Zn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s7:o7;dR.useSyncExternalStore=fu.useSyncExternalStore!==void 0?fu.useSyncExternalStore:a7;fR.exports=dR;var l7=fR.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var eg=A,u7=l7;function c7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f7=typeof Object.is=="function"?Object.is:c7,d7=u7.useSyncExternalStore,p7=eg.useRef,h7=eg.useEffect,m7=eg.useMemo,g7=eg.useDebugValue;cR.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=p7(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=m7(function(){function u(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return p=v}return p=m}if(v=p,f7(d,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(d=m,p=x)}var c=!1,d,p,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var a=d7(e,o[0],o[1]);return h7(function(){s.hasValue=!0,s.value=a},[a]),g7(a),a};uR.exports=cR;var y7=uR.exports;const pR=Ts(y7),v7={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},OI=e=>{let t;const n=new Set,r=(d,p)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=p??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(v=>v(t,m))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(v7?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,u);return u},hR=e=>e?OI(e):OI,{useDebugValue:x7}=Q,{useSyncExternalStoreWithSelector:_7}=pR,w7=e=>e;function mR(e,t=w7,n){const r=_7(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return x7(r),r}const RI=(e,t)=>{const n=hR(e),r=(i,o=t)=>mR(n,i,o);return Object.assign(r,n),r},b7=(e,t)=>e?RI(e,t):RI;function On(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var E7={value:()=>{}};function tg(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}dh.prototype=tg.prototype={constructor:dh,on:function(e,t){var n=this._,r=S7(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),LI.hasOwnProperty(t)?{space:LI[t],local:e}:e}function I7(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Gx&&t.documentElement.namespaceURI===Gx?t.createElement(e):t.createElementNS(n,e)}}function A7(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gR(e){var t=ng(e);return(t.local?A7:I7)(t)}function T7(){}function qw(e){return e==null?T7:function(){return this.querySelector(e)}}function k7(e){typeof e!="function"&&(e=qw(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=E&&(E=_+1);!(T=b[E])&&++E=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function eV(e){e||(e=tV);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function nV(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function rV(){return Array.from(this)}function iV(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?mV:typeof t=="function"?yV:gV)(e,t,n??"")):du(this.node(),e)}function du(e,t){return e.style.getPropertyValue(t)||wR(e).getComputedStyle(e,null).getPropertyValue(t)}function xV(e){return function(){delete this[e]}}function _V(e,t){return function(){this[e]=t}}function wV(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function bV(e,t){return arguments.length>1?this.each((t==null?xV:typeof t=="function"?wV:_V)(e,t)):this.node()[e]}function bR(e){return e.trim().split(/^|\s+/)}function Yw(e){return e.classList||new ER(e)}function ER(e){this._node=e,this._names=bR(e.getAttribute("class")||"")}ER.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 SR(e,t){for(var n=Yw(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function XV(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n()=>e;function Kx(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:u,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Kx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function sU(e){return!e.ctrlKey&&!e.button}function aU(){return this.parentNode}function lU(e,t){return t??{x:e.x,y:e.y}}function uU(){return navigator.maxTouchPoints||"ontouchstart"in this}function cU(){var e=sU,t=aU,n=lU,r=uU,i={},o=tg("start","drag","end"),s=0,a,u,c,d,p=0;function h(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,oU).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,T){if(!(d||!e.call(this,C,T))){var I=E(this,t.call(this,C,T),C,T,"mouse");I&&(Ti(C.view).on("mousemove.drag",v,Nf).on("mouseup.drag",x,Nf),TR(C.view),Gv(C),c=!1,a=C.clientX,u=C.clientY,I("start",C))}}function v(C){if(Ql(C),!c){var T=C.clientX-a,I=C.clientY-u;c=T*T+I*I>p}i.mouse("drag",C)}function x(C){Ti(C.view).on("mousemove.drag mouseup.drag",null),kR(C.view,c),Ql(C),i.mouse("end",C)}function b(C,T){if(e.call(this,C,T)){var I=C.changedTouches,O=t.call(this,C,T),M=I.length,z,U;for(z=0;z>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kp(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=dU.exec(e))?new mr(t[1],t[2],t[3],1):(t=pU.exec(e))?new mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hU.exec(e))?kp(t[1],t[2],t[3],t[4]):(t=mU.exec(e))?kp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gU.exec(e))?zI(t[1],t[2]/100,t[3]/100,1):(t=yU.exec(e))?zI(t[1],t[2]/100,t[3]/100,t[4]):PI.hasOwnProperty(e)?FI(PI[e]):e==="transparent"?new mr(NaN,NaN,NaN,0):null}function FI(e){return new mr(e>>16&255,e>>8&255,e&255,1)}function kp(e,t,n,r){return r<=0&&(e=t=n=NaN),new mr(e,t,n,r)}function _U(e){return e instanceof ed||(e=Df(e)),e?(e=e.rgb(),new mr(e.r,e.g,e.b,e.opacity)):new mr}function qx(e,t,n,r){return arguments.length===1?_U(e):new mr(e,t,n,r??1)}function mr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xw(mr,qx,NR(ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Of:Math.pow(Of,e),new mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mr(va(this.r),va(this.g),va(this.b),Jh(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:BI,formatHex:BI,formatHex8:wU,formatRgb:HI,toString:HI}));function BI(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}`}function wU(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}${ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function HI(){const e=Jh(this.opacity);return`${e===1?"rgb(":"rgba("}${va(this.r)}, ${va(this.g)}, ${va(this.b)}${e===1?")":`, ${e})`}`}function Jh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function va(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ca(e){return e=va(e),(e<16?"0":"")+e.toString(16)}function zI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ki(e,t,n,r)}function OR(e){if(e instanceof ki)return new ki(e.h,e.s,e.l,e.opacity);if(e instanceof ed||(e=Df(e)),!e)return new ki;if(e instanceof ki)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,u=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&u<1?0:s,new ki(s,a,u,e.opacity)}function bU(e,t,n,r){return arguments.length===1?OR(e):new ki(e,t,n,r??1)}function ki(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xw(ki,bU,NR(ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new ki(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Of:Math.pow(Of,e),new ki(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new mr(Kv(e>=240?e-240:e+120,i,r),Kv(e,i,r),Kv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ki(jI(this.h),Np(this.s),Np(this.l),Jh(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=Jh(this.opacity);return`${e===1?"hsl(":"hsla("}${jI(this.h)}, ${Np(this.s)*100}%, ${Np(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jI(e){return e=(e||0)%360,e<0?e+360:e}function Np(e){return Math.max(0,Math.min(1,e||0))}function Kv(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 RR=e=>()=>e;function EU(e,t){return function(n){return e+n*t}}function SU(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function CU(e){return(e=+e)==1?DR:function(t,n){return n-t?SU(t,n,e):RR(isNaN(t)?n:t)}}function DR(e,t){var n=t-e;return n?EU(e,n):RR(isNaN(e)?t:e)}const VI=function e(t){var n=CU(t);function r(i,o){var s=n((i=qx(i)).r,(o=qx(o)).r),a=n(i.g,o.g),u=n(i.b,o.b),c=DR(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=a(d),i.b=u(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function Qo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Yx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qv=new RegExp(Yx.source,"g");function IU(e){return function(){return e}}function AU(e){return function(t){return e(t)+""}}function TU(e,t){var n=Yx.lastIndex=qv.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Yx.exec(e))&&(i=qv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:Qo(r,i)})),n=qv.lastIndex;return n180?d+=360:d-c>180&&(c+=360),h.push({i:p.push(i(p)+"rotate(",null,r)-2,x:Qo(c,d)})):d&&p.push(i(p)+"rotate("+d+r)}function a(c,d,p,h){c!==d?h.push({i:p.push(i(p)+"skewX(",null,r)-2,x:Qo(c,d)}):d&&p.push(i(p)+"skewX("+d+r)}function u(c,d,p,h,m,v){if(c!==p||d!==h){var x=m.push(i(m)+"scale(",null,",",null,")");v.push({i:x-4,x:Qo(c,p)},{i:x-2,x:Qo(d,h)})}else(p!==1||h!==1)&&m.push(i(m)+"scale("+p+","+h+")")}return function(c,d){var p=[],h=[];return c=e(c),d=e(d),o(c.translateX,c.translateY,d.translateX,d.translateY,p,h),s(c.rotate,d.rotate,p,h),a(c.skewX,d.skewX,p,h),u(c.scaleX,c.scaleY,d.scaleX,d.scaleY,p,h),c=d=null,function(m){for(var v=-1,x=h.length,b;++v=0&&e._call.call(void 0,t),e=e._next;--pu}function GI(){Ta=(tm=Lf.now())+rg,pu=jc=0;try{FU()}finally{pu=0,HU(),Ta=0}}function BU(){var e=Lf.now(),t=e-tm;t>MR&&(rg-=t,tm=e)}function HU(){for(var e,t=em,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:em=n);Vc=e,Qx(r)}function Qx(e){if(!pu){jc&&(jc=clearTimeout(jc));var t=e-Ta;t>24?(e<1/0&&(jc=setTimeout(GI,e-Lf.now()-rg)),xc&&(xc=clearInterval(xc))):(xc||(tm=Lf.now(),xc=setInterval(BU,MR)),pu=1,$R(GI))}}function KI(e,t,n){var r=new nm;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var zU=tg("start","end","cancel","interrupt"),jU=[],BR=0,qI=1,Zx=2,ph=3,YI=4,Jx=5,hh=6;function ig(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;VU(e,n,{name:t,index:r,group:i,on:zU,tween:jU,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:BR})}function Zw(e,t){var n=Mi(e,t);if(n.state>BR)throw new Error("too late; already scheduled");return n}function Ji(e,t){var n=Mi(e,t);if(n.state>ph)throw new Error("too late; already running");return n}function Mi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function VU(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=FR(o,0,n.time);function o(c){n.state=qI,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,p,h,m;if(n.state!==qI)return u();for(d in r)if(m=r[d],m.name===n.name){if(m.state===ph)return KI(s);m.state===YI?(m.state=hh,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+dZx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function xW(e,t,n){var r,i,o=vW(t)?Zw:Ji;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function _W(e,t){var n=this._id;return arguments.length<2?Mi(this.node(),n).on.on(e):this.each(xW(n,e,t))}function wW(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bW(){return this.on("end.remove",wW(this._id))}function EW(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qw(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s()=>e;function qW(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function vo(e,t,n){this.k=e,this.x=t,this.y=n}vo.prototype={constructor:vo,scale:function(e){return e===1?this:new vo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vo(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 vs=new vo(1,0,0);vo.prototype;function Yv(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}function YW(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function XW(){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 XI(){return this.__zoom||vs}function QW(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ZW(){return navigator.maxTouchPoints||"ontouchstart"in this}function JW(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function eG(){var e=YW,t=XW,n=JW,r=QW,i=ZW,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=MU,c=tg("start","zoom","end"),d,p,h,m=500,v=150,x=0,b=10;function y(L){L.property("__zoom",XI).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",U).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,B,j,X){var V=L.selection?L.selection():L;V.property("__zoom",XI),L!==V?T(L,B,j,X):V.interrupt().each(function(){I(this,arguments).event(X).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},y.scaleBy=function(L,B,j,X){y.scaleTo(L,function(){var V=this.__zoom.k,H=typeof B=="function"?B.apply(this,arguments):B;return V*H},j,X)},y.scaleTo=function(L,B,j,X){y.transform(L,function(){var V=t.apply(this,arguments),H=this.__zoom,N=j==null?C(V):typeof j=="function"?j.apply(this,arguments):j,Z=H.invert(N),te=typeof B=="function"?B.apply(this,arguments):B;return n(E(_(H,te),N,Z),V,s)},j,X)},y.translateBy=function(L,B,j,X){y.transform(L,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof j=="function"?j.apply(this,arguments):j),t.apply(this,arguments),s)},null,X)},y.translateTo=function(L,B,j,X,V){y.transform(L,function(){var H=t.apply(this,arguments),N=this.__zoom,Z=X==null?C(H):typeof X=="function"?X.apply(this,arguments):X;return n(vs.translate(Z[0],Z[1]).scale(N.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof j=="function"?-j.apply(this,arguments):-j),H,s)},X,V)};function _(L,B){return B=Math.max(o[0],Math.min(o[1],B)),B===L.k?L:new vo(B,L.x,L.y)}function E(L,B,j){var X=B[0]-j[0]*L.k,V=B[1]-j[1]*L.k;return X===L.x&&V===L.y?L:new vo(L.k,X,V)}function C(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function T(L,B,j,X){L.on("start.zoom",function(){I(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(X).end()}).tween("zoom",function(){var V=this,H=arguments,N=I(V,H).event(X),Z=t.apply(V,H),te=j==null?C(Z):typeof j=="function"?j.apply(V,H):j,R=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),ee=V.__zoom,re=typeof B=="function"?B.apply(V,H):B,oe=u(ee.invert(te).concat(R/ee.k),re.invert(te).concat(R/re.k));return function(pe){if(pe===1)pe=re;else{var ye=oe(pe),_e=R/ye[2];pe=new vo(_e,te[0]-ye[0]*_e,te[1]-ye[1]*_e)}N.zoom(null,pe)}})}function I(L,B,j){return!j&&L.__zooming||new O(L,B)}function O(L,B){this.that=L,this.args=B,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,B),this.taps=0}O.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,B){return this.mouse&&L!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var B=Ti(this.that).datum();c.call(L,this.that,new qW(L,{sourceEvent:this.sourceEvent,target:y,type:L,transform:this.that.__zoom,dispatch:c}),B)}};function M(L,...B){if(!e.apply(this,arguments))return;var j=I(this,B).event(L),X=this.__zoom,V=Math.max(o[0],Math.min(o[1],X.k*Math.pow(2,r.apply(this,arguments)))),H=Wi(L);if(j.wheel)(j.mouse[0][0]!==H[0]||j.mouse[0][1]!==H[1])&&(j.mouse[1]=X.invert(j.mouse[0]=H)),clearTimeout(j.wheel);else{if(X.k===V)return;j.mouse=[H,X.invert(H)],mh(this),j.start()}_c(L),j.wheel=setTimeout(N,v),j.zoom("mouse",n(E(_(X,V),j.mouse[0],j.mouse[1]),j.extent,s));function N(){j.wheel=null,j.end()}}function z(L,...B){if(h||!e.apply(this,arguments))return;var j=L.currentTarget,X=I(this,B,!0).event(L),V=Ti(L.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",R,!0),H=Wi(L,j),N=L.clientX,Z=L.clientY;TR(L.view),Yv(L),X.mouse=[H,this.__zoom.invert(H)],mh(this),X.start();function te(ee){if(_c(ee),!X.moved){var re=ee.clientX-N,oe=ee.clientY-Z;X.moved=re*re+oe*oe>x}X.event(ee).zoom("mouse",n(E(X.that.__zoom,X.mouse[0]=Wi(ee,j),X.mouse[1]),X.extent,s))}function R(ee){V.on("mousemove.zoom mouseup.zoom",null),kR(ee.view,X.moved),_c(ee),X.event(ee).end()}}function U(L,...B){if(e.apply(this,arguments)){var j=this.__zoom,X=Wi(L.changedTouches?L.changedTouches[0]:L,this),V=j.invert(X),H=j.k*(L.shiftKey?.5:2),N=n(E(_(j,H),X,V),t.apply(this,B),s);_c(L),a>0?Ti(this).transition().duration(a).call(T,N,X,L):Ti(this).call(y.transform,N,X,L)}}function F(L,...B){if(e.apply(this,arguments)){var j=L.touches,X=j.length,V=I(this,B,L.changedTouches.length===X).event(L),H,N,Z,te;for(Yv(L),N=0;N"[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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,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.`},VR=To.error001();function Ft(e,t){const n=A.useContext(og);if(n===null)throw new Error(VR);return mR(n,e,t)}const on=()=>{const e=A.useContext(og);if(e===null)throw new Error(VR);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},nG=e=>e.userSelectionActive?"none":"all";function UR({position:e,children:t,className:n,style:r,...i}){const o=Ft(nG),s=`${e}`.split("-");return Q.createElement("div",{className:Zn(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i},t)}function rG({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:Q.createElement(UR,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},Q.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const iG=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...d})=>{const p=A.useRef(null),[h,m]=A.useState({x:0,y:0,width:0,height:0}),v=Zn(["react-flow__edge-textwrapper",c]);return A.useEffect(()=>{if(p.current){const x=p.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:Q.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...d},i&&Q.createElement("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),Q.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},n),u)};var oG=A.memo(iG);const e1=e=>({width:e.offsetWidth,height:e.offsetHeight}),hu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),t1=(e={x:0,y:0},t)=>({x:hu(e.x,t[0][0],t[1][0]),y:hu(e.y,t[0][1],t[1][1])}),QI=(e,t,n)=>en?-hu(Math.abs(e-n),1,50)/50:0,WR=(e,t)=>{const n=QI(e.x,35,t.width-35)*20,r=QI(e.y,35,t.height-35)*20;return[n,r]},GR=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},sG=(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)}),n1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),aG=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ZI=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),e_=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},lG=e=>li(e.width)&&li(e.height)&&li(e.x)&&li(e.y),li=e=>!isNaN(e)&&isFinite(e),jt=Symbol.for("internals"),KR=["Enter"," ","Escape"],uG=(e,t)=>{},cG=e=>"nativeEvent"in e;function t_(e){var i,o;const t=cG(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const qR=e=>"clientX"in e,xs=(e,t)=>{var o,s;const n=qR(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},rm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},td=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m=20})=>Q.createElement(Q.Fragment,null,Q.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:h}),m&&Q.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),i&&li(n)&&li(r)?Q.createElement(oG,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c}):null);td.displayName="BaseEdge";function wc(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function YR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n{const[b,y,_]=QR({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return Q.createElement(td,{path:b,labelX:y,labelY:_,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:x})});r1.displayName="SimpleBezierEdge";const eA={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},fG=({source:e,sourcePosition:t=J.Bottom,target:n})=>t===J.Left||t===J.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dG({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:i,offset:o}){const s=eA[t],a=eA[r],u={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},d=fG({source:u,sourcePosition:t,target:c}),p=d.x!==0?"x":"y",h=d[p];let m=[],v,x;const b={x:0,y:0},y={x:0,y:0},[_,E,C,T]=YR({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[p]*a[p]===-1){v=i.x??_,x=i.y??E;const O=[{x:v,y:u.y},{x:v,y:c.y}],M=[{x:u.x,y:x},{x:c.x,y:x}];s[p]===h?m=p==="x"?O:M:m=p==="x"?M:O}else{const O=[{x:u.x,y:c.y}],M=[{x:c.x,y:u.y}];if(p==="x"?m=s.x===h?M:O:m=s.y===h?O:M,t===r){const Y=Math.abs(e[p]-n[p]);if(Y<=o){const L=Math.min(o-1,o-Y);s[p]===h?b[p]=(u[p]>e[p]?-1:1)*L:y[p]=(c[p]>n[p]?-1:1)*L}}if(t!==r){const Y=p==="x"?"y":"x",L=s[p]===a[Y],B=u[Y]>c[Y],j=u[Y]=W?(v=(z.x+U.x)/2,x=m[0].y):(v=m[0].x,x=(z.y+U.y)/2)}return[[e,{x:u.x+b.x,y:u.y+b.y},...m,{x:c.x+y.x,y:c.y+y.y},n],v,x,C,T]}function pG(e,t,n,r){const i=Math.min(tA(e,t)/2,tA(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x{let E="";return _>0&&_{const[y,_,E]=n_({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:h,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset});return Q.createElement(td,{path:y,labelX:_,labelY:E,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:v,interactionWidth:b})});sg.displayName="SmoothStepEdge";const i1=A.memo(e=>{var t;return Q.createElement(sg,{...e,pathOptions:A.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});i1.displayName="StepEdge";function hG({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=YR({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const o1=A.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m})=>{const[v,x,b]=hG({sourceX:e,sourceY:t,targetX:n,targetY:r});return Q.createElement(td,{path:v,labelX:x,labelY:b,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m})});o1.displayName="StraightEdge";function Dp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function nA({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case J.Left:return[t-Dp(t-r,o),n];case J.Right:return[t+Dp(r-t,o),n];case J.Top:return[t,n-Dp(n-i,o)];case J.Bottom:return[t,n+Dp(i-n,o)]}}function ZR({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:o=J.Top,curvature:s=.25}){const[a,u]=nA({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,d]=nA({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[p,h,m,v]=XR({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${u} ${c},${d} ${r},${i}`,p,h,m,v]}const om=A.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=J.Bottom,targetPosition:o=J.Top,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,pathOptions:x,interactionWidth:b})=>{const[y,_,E]=ZR({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:x==null?void 0:x.curvature});return Q.createElement(td,{path:y,labelX:_,labelY:E,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:b})});om.displayName="BezierEdge";const s1=A.createContext(null),mG=s1.Provider;s1.Consumer;const gG=()=>A.useContext(s1),yG=e=>"id"in e&&"source"in e&&"target"in e,vG=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,r_=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,xG=(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)),JR=(e,t)=>{if(!e.source||!e.target)return t;let n;return yG(e)?n={...e}:n={...e,id:vG(e)},xG(n,t)?t:t.concat(n)},i_=({x:e,y:t},[n,r,i],o,[s,a])=>{const u={x:(e-n)/i,y:(t-r)/i};return o?{x:s*Math.round(u.x/s),y:a*Math.round(u.y/a)}:u},eD=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Jl=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},a1=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:s}=Jl(i,t).positionAbsolute;return sG(r,n1({x:o,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return aG(n)},tD=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const u={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},c=[];return e.forEach(d=>{const{width:p,height:h,selectable:m=!0,hidden:v=!1}=d;if(s&&!m||v)return!1;const{positionAbsolute:x}=Jl(d,a),b={x:x.x,y:x.y,width:p||0,height:h||0},y=e_(u,b),_=typeof p>"u"||typeof h>"u"||p===null||h===null,E=o&&y>0,C=(p||0)*(h||0);(_||E||y>=C||d.dragging)&&c.push(d)}),c},nD=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},rD=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),u=Math.min(s,a),c=hu(u,r,i),d=e.x+e.width/2,p=e.y+e.height/2,h=t/2-d*c,m=n/2-p*c;return{x:h,y:m,zoom:c}},ea=(e,t=0)=>e.transition().duration(t);function rA(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var s,a;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+o.x+o.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+o.y+o.height/2}),i},[])}function _G(e,t,n,r,i,o){const{x:s,y:a}=xs(e),c=t.elementsFromPoint(s,a).find(v=>v.classList.contains("react-flow__handle"));if(c){const v=c.getAttribute("data-nodeid");if(v){const x=l1(void 0,c),b=c.getAttribute("data-handleid"),y=o({nodeId:v,id:b,type:x});if(y){const _=i.find(E=>E.nodeId===v&&E.type===x&&E.id===b);return{handle:{id:b,type:x,nodeId:v,x:(_==null?void 0:_.x)||n.x,y:(_==null?void 0:_.y)||n.y},validHandleResult:y}}}}let d=[],p=1/0;if(i.forEach(v=>{const x=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(x<=r){const b=o(v);x<=p&&(xv.isValid),m=d.some(({handle:v})=>v.type==="target");return d.find(({handle:v,validHandleResult:x})=>m?v.type==="target":h?x.isValid:!0)||d[0]}const wG={source:null,target:null,sourceHandle:null,targetHandle:null},iD=()=>({handleDomNode:null,isValid:!1,connection:wG,endHandle:null});function oD(e,t,n,r,i,o,s){const a=i==="target",u=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...iD(),handleDomNode:u};if(u){const d=l1(void 0,u),p=u.getAttribute("data-nodeid"),h=u.getAttribute("data-handleid"),m=u.classList.contains("connectable"),v=u.classList.contains("connectableend"),x={source:a?p:n,sourceHandle:a?h:r,target:a?n:p,targetHandle:a?r:h};c.connection=x,m&&v&&(t===ka.Strict?a&&d==="source"||!a&&d==="target":p!==n||h!==r)&&(c.endHandle={nodeId:p,handleId:h,type:d},c.isValid=o(x))}return c}function bG({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[jt]){const{handleBounds:s}=o[jt];let a=[],u=[];s&&(a=rA(o,s,"source",`${t}-${n}-${r}`),u=rA(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...u)}return i},[])}function l1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Xv(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function EG(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function sD({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:u,onReconnectEnd:c}){const d=GR(e.target),{connectionMode:p,domNode:h,autoPanOnConnect:m,connectionRadius:v,onConnectStart:x,panBy:b,getNodes:y,cancelConnection:_}=o();let E=0,C;const{x:T,y:I}=xs(e),O=d==null?void 0:d.elementFromPoint(T,I),M=l1(u,O),z=h==null?void 0:h.getBoundingClientRect();if(!z||!M)return;let U,F=xs(e,z),W=!1,Y=null,L=!1,B=null;const j=bG({nodes:y(),nodeId:n,handleId:t,handleType:M}),X=()=>{if(!m)return;const[N,Z]=WR(F,z);b({x:N,y:Z}),E=requestAnimationFrame(X)};s({connectionPosition:F,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:M,connectionStartHandle:{nodeId:n,handleId:t,type:M},connectionEndHandle:null}),x==null||x(e,{nodeId:n,handleId:t,handleType:M});function V(N){const{transform:Z}=o();F=xs(N,z);const{handle:te,validHandleResult:R}=_G(N,d,i_(F,Z,!1,[1,1]),v,j,ee=>oD(ee,p,n,t,i?"target":"source",a,d));if(C=te,W||(X(),W=!0),B=R.handleDomNode,Y=R.connection,L=R.isValid,s({connectionPosition:C&&L?eD({x:C.x,y:C.y},Z):F,connectionStatus:EG(!!C,L),connectionEndHandle:R.endHandle}),!C&&!L&&!B)return Xv(U);Y.source!==Y.target&&B&&(Xv(U),U=B,B.classList.add("connecting","react-flow__handle-connecting"),B.classList.toggle("valid",L),B.classList.toggle("react-flow__handle-valid",L))}function H(N){var Z,te;(C||B)&&Y&&L&&(r==null||r(Y)),(te=(Z=o()).onConnectEnd)==null||te.call(Z,N),u&&(c==null||c(N)),Xv(U),_(),cancelAnimationFrame(E),W=!1,L=!1,Y=null,B=null,d.removeEventListener("mousemove",V),d.removeEventListener("mouseup",H),d.removeEventListener("touchmove",V),d.removeEventListener("touchend",H)}d.addEventListener("mousemove",V),d.addEventListener("mouseup",H),d.addEventListener("touchmove",V),d.addEventListener("touchend",H)}const iA=()=>!0,SG=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),CG=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:s}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},aD=A.forwardRef(({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:u,className:c,onMouseDown:d,onTouchStart:p,...h},m)=>{var z,U;const v=s||null,x=e==="target",b=on(),y=gG(),{connectOnClick:_,noPanClassName:E}=Ft(SG,On),{connecting:C,clickConnecting:T}=Ft(CG(y,v,e),On);y||(U=(z=b.getState()).onError)==null||U.call(z,"010",To.error010());const I=F=>{const{defaultEdgeOptions:W,onConnect:Y,hasDefaultEdges:L}=b.getState(),B={...W,...F};if(L){const{edges:j,setEdges:X}=b.getState();X(JR(B,j))}Y==null||Y(B),a==null||a(B)},O=F=>{if(!y)return;const W=qR(F);i&&(W&&F.button===0||!W)&&sD({event:F,handleId:v,nodeId:y,onConnect:I,isTarget:x,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||iA}),W?d==null||d(F):p==null||p(F)},M=F=>{const{onClickConnectStart:W,onClickConnectEnd:Y,connectionClickStartHandle:L,connectionMode:B,isValidConnection:j}=b.getState();if(!y||!L&&!i)return;if(!L){W==null||W(F,{nodeId:y,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:y,type:e,handleId:v}});return}const X=GR(F.target),V=n||j||iA,{connection:H,isValid:N}=oD({nodeId:y,id:v,type:e},B,L.nodeId,L.handleId||null,L.type,V,X);N&&I(H),Y==null||Y(F),b.setState({connectionClickStartHandle:null})};return Q.createElement("div",{"data-handleid":v,"data-nodeid":y,"data-handlepos":t,"data-id":`${y}-${v}-${e}`,className:Zn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,c,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,connecting:T,connectionindicator:r&&(i&&!C||o&&C)}]),onMouseDown:O,onTouchStart:O,onClick:_?M:void 0,ref:m,...h},u)});aD.displayName="Handle";var Na=A.memo(aD);const lD=({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:r=J.Bottom})=>Q.createElement(Q.Fragment,null,Q.createElement(Na,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,Q.createElement(Na,{type:"source",position:r,isConnectable:t}));lD.displayName="DefaultNode";var o_=A.memo(lD);const uD=({data:e,isConnectable:t,sourcePosition:n=J.Bottom})=>Q.createElement(Q.Fragment,null,e==null?void 0:e.label,Q.createElement(Na,{type:"source",position:n,isConnectable:t}));uD.displayName="InputNode";var cD=A.memo(uD);const fD=({data:e,isConnectable:t,targetPosition:n=J.Top})=>Q.createElement(Q.Fragment,null,Q.createElement(Na,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);fD.displayName="OutputNode";var dD=A.memo(fD);const u1=()=>null;u1.displayName="GroupNode";const IG=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Lp=e=>e.id;function AG(e,t){return On(e.selectedNodes.map(Lp),t.selectedNodes.map(Lp))&&On(e.selectedEdges.map(Lp),t.selectedEdges.map(Lp))}const pD=A.memo(({onSelectionChange:e})=>{const t=on(),{selectedNodes:n,selectedEdges:r}=Ft(IG,AG);return A.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});pD.displayName="SelectionListener";const TG=e=>!!e.onSelectionChange;function kG({onSelectionChange:e}){const t=Ft(TG);return e||t?Q.createElement(pD,{onSelectionChange:e}):null}const NG=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function hl(e,t){A.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ze(e,t,n){A.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const OG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:u,nodesDraggable:c,nodesConnectable:d,nodesFocusable:p,edgesFocusable:h,edgesUpdatable:m,elevateNodesOnSelect:v,minZoom:x,maxZoom:b,nodeExtent:y,onNodesChange:_,onEdgesChange:E,elementsSelectable:C,connectionMode:T,snapGrid:I,snapToGrid:O,translateExtent:M,connectOnClick:z,defaultEdgeOptions:U,fitView:F,fitViewOptions:W,onNodesDelete:Y,onEdgesDelete:L,onNodeDrag:B,onNodeDragStart:j,onNodeDragStop:X,onSelectionDrag:V,onSelectionDragStart:H,onSelectionDragStop:N,noPanClassName:Z,nodeOrigin:te,rfId:R,autoPanOnConnect:ee,autoPanOnNodeDrag:re,onError:oe,connectionRadius:pe,isValidConnection:ye,nodeDragThreshold:_e})=>{const{setNodes:Se,setEdges:We,setDefaultNodesAndEdges:Re,setMinZoom:De,setMaxZoom:He,setTranslateExtent:Ie,setNodeExtent:rt,reset:Pe}=Ft(NG,On),we=on();return A.useEffect(()=>{const mt=r==null?void 0:r.map(gt=>({...gt,...U}));return Re(n,mt),()=>{Pe()}},[]),Ze("defaultEdgeOptions",U,we.setState),Ze("connectionMode",T,we.setState),Ze("onConnect",i,we.setState),Ze("onConnectStart",o,we.setState),Ze("onConnectEnd",s,we.setState),Ze("onClickConnectStart",a,we.setState),Ze("onClickConnectEnd",u,we.setState),Ze("nodesDraggable",c,we.setState),Ze("nodesConnectable",d,we.setState),Ze("nodesFocusable",p,we.setState),Ze("edgesFocusable",h,we.setState),Ze("edgesUpdatable",m,we.setState),Ze("elementsSelectable",C,we.setState),Ze("elevateNodesOnSelect",v,we.setState),Ze("snapToGrid",O,we.setState),Ze("snapGrid",I,we.setState),Ze("onNodesChange",_,we.setState),Ze("onEdgesChange",E,we.setState),Ze("connectOnClick",z,we.setState),Ze("fitViewOnInit",F,we.setState),Ze("fitViewOnInitOptions",W,we.setState),Ze("onNodesDelete",Y,we.setState),Ze("onEdgesDelete",L,we.setState),Ze("onNodeDrag",B,we.setState),Ze("onNodeDragStart",j,we.setState),Ze("onNodeDragStop",X,we.setState),Ze("onSelectionDrag",V,we.setState),Ze("onSelectionDragStart",H,we.setState),Ze("onSelectionDragStop",N,we.setState),Ze("noPanClassName",Z,we.setState),Ze("nodeOrigin",te,we.setState),Ze("rfId",R,we.setState),Ze("autoPanOnConnect",ee,we.setState),Ze("autoPanOnNodeDrag",re,we.setState),Ze("onError",oe,we.setState),Ze("connectionRadius",pe,we.setState),Ze("isValidConnection",ye,we.setState),Ze("nodeDragThreshold",_e,we.setState),hl(e,Se),hl(t,We),hl(x,De),hl(b,He),hl(M,Ie),hl(y,rt),null},oA={display:"none"},RG={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},hD="react-flow__node-desc",mD="react-flow__edge-desc",DG="react-flow__aria-live",LG=e=>e.ariaLiveMessage;function PG({rfId:e}){const t=Ft(LG);return Q.createElement("div",{id:`${DG}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:RG},t)}function MG({rfId:e,disableKeyboardA11y:t}){return Q.createElement(Q.Fragment,null,Q.createElement("div",{id:`${hD}-${e}`,style:oA},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),Q.createElement("div",{id:`${mD}-${e}`,style:oA},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&Q.createElement(PG,{rfId:e}))}var Mf=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=A.useState(!1),i=A.useRef(!1),o=A.useRef(new Set([])),[s,a]=A.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),d=c.reduce((p,h)=>p.concat(...h),[]);return[c,d]}return[[],[]]},[e]);return A.useEffect(()=>{const u=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||u;if(e!==null){const d=m=>{if(i.current=m.ctrlKey||m.metaKey||m.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&t_(m))return!1;const x=aA(m.code,a);o.current.add(m[x]),sA(s,o.current,!1)&&(m.preventDefault(),r(!0))},p=m=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&t_(m))return!1;const x=aA(m.code,a);sA(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(m[x]),m.key==="Meta"&&o.current.clear(),i.current=!1},h=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",p),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",p),window.removeEventListener("blur",h)}}},[e,r]),n};function sA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function aA(e,t){return t.includes(e)?"code":"key"}function gD(e,t,n,r){var a,u;const i=e.parentNode||e.parentId;if(!i)return n;const o=t.get(i),s=Jl(o,r);return gD(o,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(((a=o[jt])==null?void 0:a.z)??0)>(n.z??0)?((u=o[jt])==null?void 0:u.z)??0:n.z??0},r)}function yD(e,t,n){e.forEach(r=>{var o;const i=r.parentNode||r.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||n!=null&&n[r.id]){const{x:s,y:a,z:u}=gD(r,e,{...r.position,z:((o=r[jt])==null?void 0:o.z)??0},t);r.positionAbsolute={x:s,y:a},r[jt].z=u,n!=null&&n[r.id]&&(r[jt].isParent=!0)}})}function Qv(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var m;const u=(li(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},p=a.parentNode||a.parentId;p&&(o[p]=!0);const h=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,jt,{enumerable:!1,value:{handleBounds:h||(m=c==null?void 0:c[jt])==null?void 0:m.handleBounds,z:u}}),i.set(a.id,d)}),yD(i,n,o),i}function vD(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:u,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:p}=e(),h=t.initial&&!c&&d;if(a&&u&&(h||!t.initial)){const v=n().filter(b=>{var _;const y=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(_=t.nodes)!=null&&_.length?y&&t.nodes.some(E=>E.id===b.id):y}),x=v.every(b=>b.width&&b.height);if(v.length>0&&x){const b=a1(v,p),{x:y,y:_,zoom:E}=rD(b,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),C=vs.translate(y,_).scale(E);return typeof t.duration=="number"&&t.duration>0?a.transform(ea(u,t.duration),C):a.transform(u,C),!0}}return!1}function $G(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[jt]:r[jt],selected:n.selected})}),new Map(t)}function FG(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Pp({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:u,hasDefaultEdges:c}=n();e!=null&&e.length&&(u&&r({nodeInternals:$G(e,i)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:FG(t,o)}),a==null||a(t))}const ml=()=>{},BG={zoomIn:ml,zoomOut:ml,zoomTo:ml,getZoom:()=>1,setViewport:ml,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ml,fitBounds:ml,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},HG=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),zG=()=>{const e=on(),{d3Zoom:t,d3Selection:n}=Ft(HG,On);return A.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(ea(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(ea(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(ea(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,u]=e.getState().transform,c=vs.translate(i.x??s,i.y??a).scale(i.zoom??u);t.transform(ea(n,o==null?void 0:o.duration),c)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>vD(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:u,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,p=a/2-i*d,h=u/2-o*d,m=vs.translate(p,h).scale(d);t.transform(ea(n,s==null?void 0:s.duration),m)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:u,maxZoom:c}=e.getState(),{x:d,y:p,zoom:h}=rD(i,s,a,u,c,(o==null?void 0:o.padding)??.1),m=vs.translate(d,p).scale(h);t.transform(ea(n,o==null?void 0:o.duration),m)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),i_(i,o,s,a)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:s,snapGrid:a,domNode:u}=e.getState();if(!u)return i;const{x:c,y:d}=u.getBoundingClientRect(),p={x:i.x-c,y:i.y-d};return i_(p,o,s,a)},flowToScreenPosition:i=>{const{transform:o,domNode:s}=e.getState();if(!s)return i;const{x:a,y:u}=s.getBoundingClientRect(),c=eD(i,o);return{x:c.x+a,y:c.y+u}},viewportInitialized:!0}:BG,[t,n])};function Fa(){const e=zG(),t=on(),n=A.useCallback(()=>t.getState().getNodes().map(x=>({...x})),[]),r=A.useCallback(x=>t.getState().nodeInternals.get(x),[]),i=A.useCallback(()=>{const{edges:x=[]}=t.getState();return x.map(b=>({...b}))},[]),o=A.useCallback(x=>{const{edges:b=[]}=t.getState();return b.find(y=>y.id===x)},[]),s=A.useCallback(x=>{const{getNodes:b,setNodes:y,hasDefaultNodes:_,onNodesChange:E}=t.getState(),C=b(),T=typeof x=="function"?x(C):x;if(_)y(T);else if(E){const I=T.length===0?C.map(O=>({type:"remove",id:O.id})):T.map(O=>({item:O,type:"reset"}));E(I)}},[]),a=A.useCallback(x=>{const{edges:b=[],setEdges:y,hasDefaultEdges:_,onEdgesChange:E}=t.getState(),C=typeof x=="function"?x(b):x;if(_)y(C);else if(E){const T=C.length===0?b.map(I=>({type:"remove",id:I.id})):C.map(I=>({item:I,type:"reset"}));E(T)}},[]),u=A.useCallback(x=>{const b=Array.isArray(x)?x:[x],{getNodes:y,setNodes:_,hasDefaultNodes:E,onNodesChange:C}=t.getState();if(E){const I=[...y(),...b];_(I)}else if(C){const T=b.map(I=>({item:I,type:"add"}));C(T)}},[]),c=A.useCallback(x=>{const b=Array.isArray(x)?x:[x],{edges:y=[],setEdges:_,hasDefaultEdges:E,onEdgesChange:C}=t.getState();if(E)_([...y,...b]);else if(C){const T=b.map(I=>({item:I,type:"add"}));C(T)}},[]),d=A.useCallback(()=>{const{getNodes:x,edges:b=[],transform:y}=t.getState(),[_,E,C]=y;return{nodes:x().map(T=>({...T})),edges:b.map(T=>({...T})),viewport:{x:_,y:E,zoom:C}}},[]),p=A.useCallback(({nodes:x,edges:b})=>{const{nodeInternals:y,getNodes:_,edges:E,hasDefaultNodes:C,hasDefaultEdges:T,onNodesDelete:I,onEdgesDelete:O,onNodesChange:M,onEdgesChange:z}=t.getState(),U=(x||[]).map(B=>B.id),F=(b||[]).map(B=>B.id),W=_().reduce((B,j)=>{const X=j.parentNode||j.parentId,V=!U.includes(j.id)&&X&&B.find(N=>N.id===X);return(typeof j.deletable=="boolean"?j.deletable:!0)&&(U.includes(j.id)||V)&&B.push(j),B},[]),Y=E.filter(B=>typeof B.deletable=="boolean"?B.deletable:!0),L=Y.filter(B=>F.includes(B.id));if(W||L){const B=nD(W,Y),j=[...L,...B],X=j.reduce((V,H)=>(V.includes(H.id)||V.push(H.id),V),[]);if((T||C)&&(T&&t.setState({edges:E.filter(V=>!X.includes(V.id))}),C&&(W.forEach(V=>{y.delete(V.id)}),t.setState({nodeInternals:new Map(y)}))),X.length>0&&(O==null||O(j),z&&z(X.map(V=>({id:V,type:"remove"})))),W.length>0&&(I==null||I(W),M)){const V=W.map(H=>({id:H.id,type:"remove"}));M(V)}}},[]),h=A.useCallback(x=>{const b=lG(x),y=b?null:t.getState().nodeInternals.get(x.id);return!b&&!y?[null,null,b]:[b?x:ZI(y),y,b]},[]),m=A.useCallback((x,b=!0,y)=>{const[_,E,C]=h(x);return _?(y||t.getState().getNodes()).filter(T=>{if(!C&&(T.id===E.id||!T.positionAbsolute))return!1;const I=ZI(T),O=e_(I,_);return b&&O>0||O>=_.width*_.height}):[]},[]),v=A.useCallback((x,b,y=!0)=>{const[_]=h(x);if(!_)return!1;const E=e_(_,b);return y&&E>0||E>=_.width*_.height},[]);return A.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:u,addEdges:c,toObject:d,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:v}),[e,n,r,i,o,s,a,u,c,d,p,m,v])}const jG={actInsideInputWithModifier:!1};var VG=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=on(),{deleteElements:r}=Fa(),i=Mf(e,jG),o=Mf(t);A.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),u=a().filter(d=>d.selected),c=s.filter(d=>d.selected);r({nodes:u,edges:c}),n.setState({nodesSelectionActive:!1})}},[i]),A.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function UG(e){const t=on();A.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=e1(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",To.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const c1={position:"absolute",width:"100%",height:"100%",top:0,left:0},WG=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Mp=e=>({x:e.x,y:e.y,zoom:e.k}),gl=(e,t)=>e.target.closest(`.${t}`),lA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),uA=e=>{const t=e.ctrlKey&&rm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},GG=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),KG=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:u=fa.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:p=!0,defaultViewport:h,translateExtent:m,minZoom:v,maxZoom:x,zoomActivationKeyCode:b,preventScrolling:y=!0,children:_,noWheelClassName:E,noPanClassName:C})=>{const T=A.useRef(),I=on(),O=A.useRef(!1),M=A.useRef(!1),z=A.useRef(null),U=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:W,d3ZoomHandler:Y,userSelectionActive:L}=Ft(GG,On),B=Mf(b),j=A.useRef(0),X=A.useRef(!1),V=A.useRef();return UG(z),A.useEffect(()=>{if(z.current){const H=z.current.getBoundingClientRect(),N=eG().scaleExtent([v,x]).translateExtent(m),Z=Ti(z.current).call(N),te=vs.translate(h.x,h.y).scale(hu(h.zoom,v,x)),R=[[0,0],[H.width,H.height]],ee=N.constrain()(te,R,m);N.transform(Z,ee),N.wheelDelta(uA),I.setState({d3Zoom:N,d3Selection:Z,d3ZoomHandler:Z.on("wheel.zoom"),transform:[ee.x,ee.y,ee.k],domNode:z.current.closest(".react-flow")})}},[]),A.useEffect(()=>{W&&F&&(s&&!B&&!L?W.on("wheel.zoom",H=>{if(gl(H,E))return!1;H.preventDefault(),H.stopImmediatePropagation();const N=W.property("__zoom").k||1;if(H.ctrlKey&&o){const ye=Wi(H),_e=uA(H),Se=N*Math.pow(2,_e);F.scaleTo(W,Se,ye,H);return}const Z=H.deltaMode===1?20:1;let te=u===fa.Vertical?0:H.deltaX*Z,R=u===fa.Horizontal?0:H.deltaY*Z;!rm()&&H.shiftKey&&u!==fa.Vertical&&(te=H.deltaY*Z,R=0),F.translateBy(W,-(te/N)*a,-(R/N)*a,{internal:!0});const ee=Mp(W.property("__zoom")),{onViewportChangeStart:re,onViewportChange:oe,onViewportChangeEnd:pe}=I.getState();clearTimeout(V.current),X.current||(X.current=!0,t==null||t(H,ee),re==null||re(ee)),X.current&&(e==null||e(H,ee),oe==null||oe(ee),V.current=setTimeout(()=>{n==null||n(H,ee),pe==null||pe(ee),X.current=!1},150))},{passive:!1}):typeof Y<"u"&&W.on("wheel.zoom",function(H,N){if(!y&&H.type==="wheel"&&!H.ctrlKey||gl(H,E))return null;H.preventDefault(),Y.call(this,H,N)},{passive:!1}))},[L,s,u,W,F,Y,B,o,y,E,t,e,n]),A.useEffect(()=>{F&&F.on("start",H=>{var te,R;if(!H.sourceEvent||H.sourceEvent.internal)return null;j.current=(te=H.sourceEvent)==null?void 0:te.button;const{onViewportChangeStart:N}=I.getState(),Z=Mp(H.transform);O.current=!0,U.current=Z,((R=H.sourceEvent)==null?void 0:R.type)==="mousedown"&&I.setState({paneDragging:!0}),N==null||N(Z),t==null||t(H.sourceEvent,Z)})},[F,t]),A.useEffect(()=>{F&&(L&&!O.current?F.on("zoom",null):L||F.on("zoom",H=>{var Z;const{onViewportChange:N}=I.getState();if(I.setState({transform:[H.transform.x,H.transform.y,H.transform.k]}),M.current=!!(r&&lA(p,j.current??0)),(e||N)&&!((Z=H.sourceEvent)!=null&&Z.internal)){const te=Mp(H.transform);N==null||N(te),e==null||e(H.sourceEvent,te)}}))},[L,F,e,p,r]),A.useEffect(()=>{F&&F.on("end",H=>{if(!H.sourceEvent||H.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=I.getState();if(O.current=!1,I.setState({paneDragging:!1}),r&&lA(p,j.current??0)&&!M.current&&r(H.sourceEvent),M.current=!1,(n||N)&&WG(U.current,H.transform)){const Z=Mp(H.transform);U.current=Z,clearTimeout(T.current),T.current=setTimeout(()=>{N==null||N(Z),n==null||n(H.sourceEvent,Z)},s?150:0)}})},[F,s,p,n,r]),A.useEffect(()=>{F&&F.filter(H=>{const N=B||i,Z=o&&H.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&H.button===1&&H.type==="mousedown"&&(gl(H,"react-flow__node")||gl(H,"react-flow__edge")))return!0;if(!p&&!N&&!s&&!c&&!o||L||!c&&H.type==="dblclick"||gl(H,E)&&H.type==="wheel"||gl(H,C)&&(H.type!=="wheel"||s&&H.type==="wheel"&&!B)||!o&&H.ctrlKey&&H.type==="wheel"||!N&&!s&&!Z&&H.type==="wheel"||!p&&(H.type==="mousedown"||H.type==="touchstart")||Array.isArray(p)&&!p.includes(H.button)&&H.type==="mousedown")return!1;const te=Array.isArray(p)&&p.includes(H.button)||!H.button||H.button<=1;return(!H.ctrlKey||H.type==="wheel")&&te})},[L,F,i,o,s,c,p,d,B]),Q.createElement("div",{className:"react-flow__renderer",ref:z,style:c1},_)},qG=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YG(){const{userSelectionActive:e,userSelectionRect:t}=Ft(qG,On);return e&&t?Q.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function cA(e,t){const n=t.parentNode||t.parentId,r=e.find(i=>i.id===n);if(r){const i=t.position.x+t.width-r.width,o=t.position.y+t.height-r.height;if(i>0||o>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,i>0&&(r.style.width+=i),o>0&&(r.style.height+=o),t.position.x<0){const s=Math.abs(t.position.x);r.position.x=r.position.x-s,r.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);r.position.y=r.position.y-s,r.style.height+=s,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function xD(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(a=>a.id===i.id);if(o.length===0)return r.push(i),r;const s={...i};for(const a of o)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&cA(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&cA(r,s);break}case"remove":return r}return r.push(s),r},n)}function _D(e,t){return xD(e,t)}function XG(e,t){return xD(e,t)}const Zo=(e,t)=>({id:e,type:"select",selected:t});function zl(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Zo(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Zo(r.id,!1))),n},[])}const Zv=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},QG=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),wD=A.memo(({isSelecting:e,selectionMode:t=Pf.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:u,onPaneMouseMove:c,onPaneMouseLeave:d,children:p})=>{const h=A.useRef(null),m=on(),v=A.useRef(0),x=A.useRef(0),b=A.useRef(),{userSelectionActive:y,elementsSelectable:_,dragging:E}=Ft(QG,On),C=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,x.current=0},T=Y=>{o==null||o(Y),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},I=Y=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){Y.preventDefault();return}s==null||s(Y)},O=a?Y=>a(Y):void 0,M=Y=>{const{resetSelectedElements:L,domNode:B}=m.getState();if(b.current=B==null?void 0:B.getBoundingClientRect(),!_||!e||Y.button!==0||Y.target!==h.current||!b.current)return;const{x:j,y:X}=xs(Y,b.current);L(),m.setState({userSelectionRect:{width:0,height:0,startX:j,startY:X,x:j,y:X}}),r==null||r(Y)},z=Y=>{const{userSelectionRect:L,nodeInternals:B,edges:j,transform:X,onNodesChange:V,onEdgesChange:H,nodeOrigin:N,getNodes:Z}=m.getState();if(!e||!b.current||!L)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const te=xs(Y,b.current),R=L.startX??0,ee=L.startY??0,re={...L,x:te.xSe.id),_e=pe.map(Se=>Se.id);if(v.current!==_e.length){v.current=_e.length;const Se=zl(oe,_e);Se.length&&(V==null||V(Se))}if(x.current!==ye.length){x.current=ye.length;const Se=zl(j,ye);Se.length&&(H==null||H(Se))}m.setState({userSelectionRect:re})},U=Y=>{if(Y.button!==0)return;const{userSelectionRect:L}=m.getState();!y&&L&&Y.target===h.current&&(T==null||T(Y)),m.setState({nodesSelectionActive:v.current>0}),C(),i==null||i(Y)},F=Y=>{y&&(m.setState({nodesSelectionActive:v.current>0}),i==null||i(Y)),C()},W=_&&(e||y);return Q.createElement("div",{className:Zn(["react-flow__pane",{dragging:E,selection:e}]),onClick:W?void 0:Zv(T,h),onContextMenu:Zv(I,h),onWheel:Zv(O,h),onMouseEnter:W?void 0:u,onMouseDown:W?M:void 0,onMouseMove:W?z:c,onMouseUp:W?U:void 0,onMouseLeave:W?F:d,ref:h,style:c1},p,Q.createElement(YG,null))});wD.displayName="Pane";function bD(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:bD(r,t):!1}function fA(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function ZG(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||i.parentId||!bD(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function JG(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ED(e,t,n,r,i=[0,0],o){const s=JG(e,e.extent||r);let a=s;const u=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(u&&e.width&&e.height){const p=n.get(u),{x:h,y:m}=Jl(p,i).positionAbsolute;a=p&&li(h)&&li(m)&&li(p.width)&&li(p.height)?[[h+e.width*i[0],m+e.height*i[1]],[h+p.width-e.width+e.width*i[0],m+p.height-e.height+e.height*i[1]]]:a}else o==null||o("005",To.error005()),a=s;else if(e.extent&&u&&e.extent!=="parent"){const p=n.get(u),{x:h,y:m}=Jl(p,i).positionAbsolute;a=[[e.extent[0][0]+h,e.extent[0][1]+m],[e.extent[1][0]+h,e.extent[1][1]+m]]}let c={x:0,y:0};if(u){const p=n.get(u);c=Jl(p,i).positionAbsolute}const d=a&&a!=="parent"?t1(t,a):t;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function Jv({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const dA=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),position:u.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...e1(u)}})};function bc(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function s_({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",To.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function eK(){const e=on();return A.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,u={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(u.x/i[0]):u.x,ySnapped:o?i[1]*Math.round(u.y/i[1]):u.y,...u}},[])}function e0(e){return(t,n,r)=>e==null?void 0:e(t,r)}function SD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=on(),[u,c]=A.useState(!1),d=A.useRef([]),p=A.useRef({x:null,y:null}),h=A.useRef(0),m=A.useRef(null),v=A.useRef({x:0,y:0}),x=A.useRef(null),b=A.useRef(!1),y=A.useRef(!1),_=A.useRef(!1),E=eK();return A.useEffect(()=>{if(e!=null&&e.current){const C=Ti(e.current),T=({x:M,y:z})=>{const{nodeInternals:U,onNodeDrag:F,onSelectionDrag:W,updateNodePositions:Y,nodeExtent:L,snapGrid:B,snapToGrid:j,nodeOrigin:X,onError:V}=a.getState();p.current={x:M,y:z};let H=!1,N={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&L){const te=a1(d.current,X);N=n1(te)}if(d.current=d.current.map(te=>{const R={x:M-te.distance.x,y:z-te.distance.y};j&&(R.x=B[0]*Math.round(R.x/B[0]),R.y=B[1]*Math.round(R.y/B[1]));const ee=[[L[0][0],L[0][1]],[L[1][0],L[1][1]]];d.current.length>1&&L&&!te.extent&&(ee[0][0]=te.positionAbsolute.x-N.x+L[0][0],ee[1][0]=te.positionAbsolute.x+(te.width??0)-N.x2+L[1][0],ee[0][1]=te.positionAbsolute.y-N.y+L[0][1],ee[1][1]=te.positionAbsolute.y+(te.height??0)-N.y2+L[1][1]);const re=ED(te,R,U,ee,X,V);return H=H||te.position.x!==re.position.x||te.position.y!==re.position.y,te.position=re.position,te.positionAbsolute=re.positionAbsolute,te}),!H)return;Y(d.current,!0,!0),c(!0);const Z=i?F:e0(W);if(Z&&x.current){const[te,R]=Jv({nodeId:i,dragItems:d.current,nodeInternals:U});Z(x.current,te,R)}},I=()=>{if(!m.current)return;const[M,z]=WR(v.current,m.current);if(M!==0||z!==0){const{transform:U,panBy:F}=a.getState();p.current.x=(p.current.x??0)-M/U[2],p.current.y=(p.current.y??0)-z/U[2],F({x:M,y:z})&&T(p.current)}h.current=requestAnimationFrame(I)},O=M=>{var X;const{nodeInternals:z,multiSelectionActive:U,nodesDraggable:F,unselectNodesAndEdges:W,onNodeDragStart:Y,onSelectionDragStart:L}=a.getState();y.current=!0;const B=i?Y:e0(L);(!s||!o)&&!U&&i&&((X=z.get(i))!=null&&X.selected||W()),i&&o&&s&&s_({id:i,store:a,nodeRef:e});const j=E(M);if(p.current=j,d.current=ZG(z,F,j,i),B&&d.current){const[V,H]=Jv({nodeId:i,dragItems:d.current,nodeInternals:z});B(M.sourceEvent,V,H)}};if(t)C.on(".drag",null);else{const M=cU().on("start",z=>{const{domNode:U,nodeDragThreshold:F}=a.getState();F===0&&O(z),_.current=!1;const W=E(z);p.current=W,m.current=(U==null?void 0:U.getBoundingClientRect())||null,v.current=xs(z.sourceEvent,m.current)}).on("drag",z=>{var Y,L;const U=E(z),{autoPanOnNodeDrag:F,nodeDragThreshold:W}=a.getState();if(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1&&(_.current=!0),!_.current){if(!b.current&&y.current&&F&&(b.current=!0,I()),!y.current){const B=U.xSnapped-(((Y=p==null?void 0:p.current)==null?void 0:Y.x)??0),j=U.ySnapped-(((L=p==null?void 0:p.current)==null?void 0:L.y)??0);Math.sqrt(B*B+j*j)>W&&O(z)}(p.current.x!==U.xSnapped||p.current.y!==U.ySnapped)&&d.current&&y.current&&(x.current=z.sourceEvent,v.current=xs(z.sourceEvent,m.current),T(U))}}).on("end",z=>{if(!(!y.current||_.current)&&(c(!1),b.current=!1,y.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:U,nodeInternals:F,onNodeDragStop:W,onSelectionDragStop:Y}=a.getState(),L=i?W:e0(Y);if(U(d.current,!1,!1),L){const[B,j]=Jv({nodeId:i,dragItems:d.current,nodeInternals:F});L(z.sourceEvent,B,j)}}}).filter(z=>{const U=z.target;return!z.button&&(!n||!fA(U,`.${n}`,e))&&(!r||fA(U,r,e))});return C.call(M),()=>{C.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,E]),u}function CD(){const e=on();return A.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:u,onError:c,nodesDraggable:d}=e.getState(),p=s().filter(_=>_.selected&&(_.draggable||d&&typeof _.draggable>"u")),h=a?u[0]:5,m=a?u[1]:5,v=n.isShiftPressed?4:1,x=n.x*h*v,b=n.y*m*v,y=p.map(_=>{if(_.positionAbsolute){const E={x:_.positionAbsolute.x+x,y:_.positionAbsolute.y+b};a&&(E.x=u[0]*Math.round(E.x/u[0]),E.y=u[1]*Math.round(E.y/u[1]));const{positionAbsolute:C,position:T}=ED(_,E,r,i,void 0,c);_.position=T,_.positionAbsolute=C}return _});o(y,!0,!1)},[])}const eu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ec=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:u,selected:c,onClick:d,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:v,onDoubleClick:x,style:b,className:y,isDraggable:_,isSelectable:E,isConnectable:C,isFocusable:T,selectNodesOnDrag:I,sourcePosition:O,targetPosition:M,hidden:z,resizeObserver:U,dragHandle:F,zIndex:W,isParent:Y,noDragClassName:L,noPanClassName:B,initialized:j,disableKeyboardA11y:X,ariaLabel:V,rfId:H,hasHandleBounds:N})=>{const Z=on(),te=A.useRef(null),R=A.useRef(null),ee=A.useRef(O),re=A.useRef(M),oe=A.useRef(r),pe=E||_||d||p||h||m,ye=CD(),_e=bc(n,Z.getState,p),Se=bc(n,Z.getState,h),We=bc(n,Z.getState,m),Re=bc(n,Z.getState,v),De=bc(n,Z.getState,x),He=Pe=>{const{nodeDragThreshold:we}=Z.getState();if(E&&(!I||!_||we>0)&&s_({id:n,store:Z,nodeRef:te}),d){const mt=Z.getState().nodeInternals.get(n);mt&&d(Pe,{...mt})}},Ie=Pe=>{if(!t_(Pe)&&!X)if(KR.includes(Pe.key)&&E){const we=Pe.key==="Escape";s_({id:n,store:Z,unselect:we,nodeRef:te})}else _&&c&&Object.prototype.hasOwnProperty.call(eu,Pe.key)&&(Z.setState({ariaLiveMessage:`Moved selected node ${Pe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),ye({x:eu[Pe.key].x,y:eu[Pe.key].y,isShiftPressed:Pe.shiftKey}))};A.useEffect(()=>()=>{R.current&&(U==null||U.unobserve(R.current),R.current=null)},[]),A.useEffect(()=>{if(te.current&&!z){const Pe=te.current;(!j||!N||R.current!==Pe)&&(R.current&&(U==null||U.unobserve(R.current)),U==null||U.observe(Pe),R.current=Pe)}},[z,j,N]),A.useEffect(()=>{const Pe=oe.current!==r,we=ee.current!==O,mt=re.current!==M;te.current&&(Pe||we||mt)&&(Pe&&(oe.current=r),we&&(ee.current=O),mt&&(re.current=M),Z.getState().updateNodeDimensions([{id:n,nodeElement:te.current,forceUpdate:!0}]))},[n,r,O,M]);const rt=SD({nodeRef:te,disabled:z||!_,noDragClassName:L,handleSelector:F,nodeId:n,isSelectable:E,selectNodesOnDrag:I});return z?null:Q.createElement("div",{className:Zn(["react-flow__node",`react-flow__node-${r}`,{[B]:_},y,{selected:c,selectable:E,parent:Y,dragging:rt}]),ref:te,style:{zIndex:W,transform:`translate(${a}px,${u}px)`,pointerEvents:pe?"all":"none",visibility:j?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:_e,onMouseMove:Se,onMouseLeave:We,onContextMenu:Re,onClick:He,onDoubleClick:De,onKeyDown:T?Ie:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":X?void 0:`${hD}-${H}`,"aria-label":V},Q.createElement(mG,{value:n},Q.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:c,isConnectable:C,sourcePosition:O,targetPosition:M,dragging:rt,dragHandle:F,zIndex:W})))};return t.displayName="NodeWrapper",A.memo(t)};const tK=e=>{const t=e.getNodes().filter(n=>n.selected);return{...a1(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function nK({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=on(),{width:i,height:o,x:s,y:a,transformString:u,userSelectionActive:c}=Ft(tK,On),d=CD(),p=A.useRef(null);if(A.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]),SD({nodeRef:p}),c||!i||!o)return null;const h=e?v=>{const x=r.getState().getNodes().filter(b=>b.selected);e(v,x)}:void 0,m=v=>{Object.prototype.hasOwnProperty.call(eu,v.key)&&d({x:eu[v.key].x,y:eu[v.key].y,isShiftPressed:v.shiftKey})};return Q.createElement("div",{className:Zn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u}},Q.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:i,height:o,top:a,left:s}}))}var rK=A.memo(nK);const iK=e=>e.nodesSelectionActive,ID=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:u,onMoveStart:c,onMoveEnd:d,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:y,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:M,zoomOnDoubleClick:z,panOnDrag:U,defaultViewport:F,translateExtent:W,minZoom:Y,maxZoom:L,preventScrolling:B,onSelectionContextMenu:j,noWheelClassName:X,noPanClassName:V,disableKeyboardA11y:H})=>{const N=Ft(iK),Z=Mf(p),te=Mf(y),R=te||U,ee=te||I,re=Z||h&&R!==!0;return VG({deleteKeyCode:a,multiSelectionKeyCode:b}),Q.createElement(KG,{onMove:u,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:o,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:ee,panOnScrollSpeed:O,panOnScrollMode:M,zoomOnDoubleClick:z,panOnDrag:!Z&&R,defaultViewport:F,translateExtent:W,minZoom:Y,maxZoom:L,zoomActivationKeyCode:_,preventScrolling:B,noWheelClassName:X,noPanClassName:V},Q.createElement(wD,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:R,isSelecting:!!re,selectionMode:m},e,N&&Q.createElement(rK,{onSelectionContextMenu:j,noPanClassName:V,disableKeyboardA11y:H})))};ID.displayName="FlowRenderer";var oK=A.memo(ID);function sK(e){return Ft(A.useCallback(n=>e?tD(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function aK(e){const t={input:Ec(e.input||cD),default:Ec(e.default||o_),output:Ec(e.output||dD),group:Ec(e.group||u1)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Ec(e[o]||o_),i),n);return{...t,...r}}const lK=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},uK=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),AD=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=Ft(uK,On),a=sK(e.onlyRenderVisibleElements),u=A.useRef(),c=A.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(p=>{const h=p.map(m=>({id:m.target.getAttribute("data-id"),nodeElement:m.target,forceUpdate:!0}));o(h)});return u.current=d,d},[]);return A.useEffect(()=>()=>{var d;(d=u==null?void 0:u.current)==null||d.disconnect()},[]),Q.createElement("div",{className:"react-flow__nodes",style:c1},a.map(d=>{var T,I,O;let p=d.type||"default";e.nodeTypes[p]||(s==null||s("003",To.error003(p)),p="default");const h=e.nodeTypes[p]||e.nodeTypes.default,m=!!(d.draggable||t&&typeof d.draggable>"u"),v=!!(d.selectable||i&&typeof d.selectable>"u"),x=!!(d.connectable||n&&typeof d.connectable>"u"),b=!!(d.focusable||r&&typeof d.focusable>"u"),y=e.nodeExtent?t1(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,_=(y==null?void 0:y.x)??0,E=(y==null?void 0:y.y)??0,C=lK({x:_,y:E,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return Q.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:p,data:d.data,sourcePosition:d.sourcePosition||J.Bottom,targetPosition:d.targetPosition||J.Top,hidden:d.hidden,xPos:_,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:m,isSelectable:v,isConnectable:x,isFocusable:b,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((T=d[jt])==null?void 0:T.z)??0,isParent:!!((I=d[jt])!=null&&I.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((O=d[jt])!=null&&O.handleBounds)})}))};AD.displayName="NodeRenderer";var cK=A.memo(AD);const fK=(e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,dK=(e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,pA="react-flow__edgeupdater",hA=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>Q.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Zn([pA,`${pA}-${a}`]),cx:fK(t,r,e),cy:dK(n,r,e),r,stroke:"transparent",fill:"transparent"}),pK=()=>!0;var yl=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:u,animated:c,label:d,labelStyle:p,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:x,style:b,source:y,target:_,sourceX:E,sourceY:C,targetX:T,targetY:I,sourcePosition:O,targetPosition:M,elementsSelectable:z,hidden:U,sourceHandleId:F,targetHandleId:W,onContextMenu:Y,onMouseEnter:L,onMouseMove:B,onMouseLeave:j,reconnectRadius:X,onReconnect:V,onReconnectStart:H,onReconnectEnd:N,markerEnd:Z,markerStart:te,rfId:R,ariaLabel:ee,isFocusable:re,isReconnectable:oe,pathOptions:pe,interactionWidth:ye,disableKeyboardA11y:_e})=>{const Se=A.useRef(null),[We,Re]=A.useState(!1),[De,He]=A.useState(!1),Ie=on(),rt=A.useMemo(()=>`url('#${r_(te,R)}')`,[te,R]),Pe=A.useMemo(()=>`url('#${r_(Z,R)}')`,[Z,R]);if(U)return null;const we=vt=>{var Nt;const{edges:St,addSelectedEdges:hn,unselectNodesAndEdges:mn,multiSelectionActive:Ct}=Ie.getState(),Yt=St.find(Fs=>Fs.id===n);Yt&&(z&&(Ie.setState({nodesSelectionActive:!1}),Yt.selected&&Ct?(mn({nodes:[],edges:[Yt]}),(Nt=Se.current)==null||Nt.blur()):hn([n])),s&&s(vt,Yt))},mt=wc(n,Ie.getState,a),gt=wc(n,Ie.getState,Y),yt=wc(n,Ie.getState,L),Zt=wc(n,Ie.getState,B),an=wc(n,Ie.getState,j),qt=(vt,St)=>{if(vt.button!==0)return;const{edges:hn,isValidConnection:mn}=Ie.getState(),Ct=St?_:y,Yt=(St?W:F)||null,Nt=St?"target":"source",Fs=mn||pK,Vu=St,Bs=hn.find(eo=>eo.id===n);He(!0),H==null||H(vt,Bs,Nt);const Ya=eo=>{He(!1),N==null||N(eo,Bs,Nt)};sD({event:vt,handleId:Yt,nodeId:Ct,onConnect:eo=>V==null?void 0:V(Bs,eo),isTarget:Vu,getState:Ie.getState,setState:Ie.setState,isValidConnection:Fs,edgeUpdaterType:Nt,onReconnectEnd:Ya})},ie=vt=>qt(vt,!0),ae=vt=>qt(vt,!1),be=()=>Re(!0),Oe=()=>Re(!1),Xe=!z&&!s,Ut=vt=>{var St;if(!_e&&KR.includes(vt.key)&&z){const{unselectNodesAndEdges:hn,addSelectedEdges:mn,edges:Ct}=Ie.getState();vt.key==="Escape"?((St=Se.current)==null||St.blur(),hn({edges:[Ct.find(Nt=>Nt.id===n)]})):mn([n])}};return Q.createElement("g",{className:Zn(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:u,animated:c,inactive:Xe,updating:We}]),onClick:we,onDoubleClick:mt,onContextMenu:gt,onMouseEnter:yt,onMouseMove:Zt,onMouseLeave:an,onKeyDown:re?Ut:void 0,tabIndex:re?0:void 0,role:re?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":ee===null?void 0:ee||`Edge from ${y} to ${_}`,"aria-describedby":re?`${mD}-${R}`:void 0,ref:Se},!De&&Q.createElement(e,{id:n,source:y,target:_,selected:u,animated:c,label:d,labelStyle:p,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:x,data:o,style:b,sourceX:E,sourceY:C,targetX:T,targetY:I,sourcePosition:O,targetPosition:M,sourceHandleId:F,targetHandleId:W,markerStart:rt,markerEnd:Pe,pathOptions:pe,interactionWidth:ye}),oe&&Q.createElement(Q.Fragment,null,(oe==="source"||oe===!0)&&Q.createElement(hA,{position:O,centerX:E,centerY:C,radius:X,onMouseDown:ie,onMouseEnter:be,onMouseOut:Oe,type:"source"}),(oe==="target"||oe===!0)&&Q.createElement(hA,{position:M,centerX:T,centerY:I,radius:X,onMouseDown:ae,onMouseEnter:be,onMouseOut:Oe,type:"target"})))};return t.displayName="EdgeWrapper",A.memo(t)};function hK(e){const t={default:yl(e.default||om),straight:yl(e.bezier||o1),step:yl(e.step||i1),smoothstep:yl(e.step||sg),simplebezier:yl(e.simplebezier||r1)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=yl(e[o]||om),i),n);return{...t,...r}}function mA(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case J.Top:return{x:r+o/2,y:i};case J.Right:return{x:r+o,y:i+s/2};case J.Bottom:return{x:r+o/2,y:i+s};case J.Left:return{x:r,y:i+s/2}}}function gA(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const mK=(e,t,n,r,i,o)=>{const s=mA(n,e,t),a=mA(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function gK({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:s,height:a,transform:u}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=n1({x:(0-u[0])/u[2],y:(0-u[1])/u[2],width:s/u[2],height:a/u[2]}),p=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(p*h)>0}function yA(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[jt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const yK=[{level:0,isMaxLevel:!0,edges:[]}];function vK(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var d,p;const u=li(a.zIndex);let c=u?a.zIndex:0;if(n){const h=t.get(a.target),m=t.get(a.source),v=a.selected||(h==null?void 0:h.selected)||(m==null?void 0:m.selected),x=Math.max(((d=m==null?void 0:m[jt])==null?void 0:d.z)||0,((p=h==null?void 0:h[jt])==null?void 0:p.z)||0,1e3);c=(u?a.zIndex:0)+(v?x:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),o=Object.entries(i).map(([s,a])=>{const u=+s;return{edges:a,level:u,isMaxLevel:u===r}});return o.length===0?yK:o}function xK(e,t,n){const r=Ft(A.useCallback(i=>e?i.edges.filter(o=>{const s=t.get(o.source),a=t.get(o.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&gK({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return vK(r,t,n)}const _K=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),wK=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),vA={[im.Arrow]:_K,[im.ArrowClosed]:wK};function bK(e){const t=on();return A.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(vA,e)?vA[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",To.error009(e)),null)},[e])}const EK=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const u=bK(t);return u?Q.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0"},Q.createElement(u,{color:n,strokeWidth:s})):null},SK=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=r_(s,t);r.includes(a)||(i.push({id:a,color:s.color||e,...s}),r.push(a))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},TD=({defaultColor:e,rfId:t})=>{const n=Ft(A.useCallback(SK({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return Q.createElement("defs",null,n.map(r=>Q.createElement(EK,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};TD.displayName="MarkerDefinitions";var CK=A.memo(TD);const IK=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),kD=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:x,children:b,disableKeyboardA11y:y})=>{const{edgesFocusable:_,edgesUpdatable:E,elementsSelectable:C,width:T,height:I,connectionMode:O,nodeInternals:M,onError:z}=Ft(IK,On),U=xK(t,M,n);return T?Q.createElement(Q.Fragment,null,U.map(({level:F,edges:W,isMaxLevel:Y})=>Q.createElement("svg",{key:F,style:{zIndex:F},width:T,height:I,className:"react-flow__edges react-flow__container"},Y&&Q.createElement(CK,{defaultColor:e,rfId:r}),Q.createElement("g",null,W.map(L=>{const[B,j,X]=yA(M.get(L.source)),[V,H,N]=yA(M.get(L.target));if(!X||!N)return null;let Z=L.type||"default";i[Z]||(z==null||z("011",To.error011(Z)),Z="default");const te=i[Z]||i.default,R=O===ka.Strict?H.target:(H.target??[]).concat(H.source??[]),ee=gA(j.source,L.sourceHandle),re=gA(R,L.targetHandle),oe=(ee==null?void 0:ee.position)||J.Bottom,pe=(re==null?void 0:re.position)||J.Top,ye=!!(L.focusable||_&&typeof L.focusable>"u"),_e=L.reconnectable||L.updatable,Se=typeof h<"u"&&(_e||E&&typeof _e>"u");if(!ee||!re)return z==null||z("008",To.error008(ee,L)),null;const{sourceX:We,sourceY:Re,targetX:De,targetY:He}=mK(B,ee,oe,V,re,pe);return Q.createElement(te,{key:L.id,id:L.id,className:Zn([L.className,o]),type:Z,data:L.data,selected:!!L.selected,animated:!!L.animated,hidden:!!L.hidden,label:L.label,labelStyle:L.labelStyle,labelShowBg:L.labelShowBg,labelBgStyle:L.labelBgStyle,labelBgPadding:L.labelBgPadding,labelBgBorderRadius:L.labelBgBorderRadius,style:L.style,source:L.source,target:L.target,sourceHandleId:L.sourceHandle,targetHandleId:L.targetHandle,markerEnd:L.markerEnd,markerStart:L.markerStart,sourceX:We,sourceY:Re,targetX:De,targetY:He,sourcePosition:oe,targetPosition:pe,elementsSelectable:C,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:d,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:x,rfId:r,ariaLabel:L.ariaLabel,isFocusable:ye,isReconnectable:Se,pathOptions:"pathOptions"in L?L.pathOptions:void 0,interactionWidth:L.interactionWidth,disableKeyboardA11y:y})})))),b):null};kD.displayName="EdgeRenderer";var AK=A.memo(kD);const TK=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function kK({children:e}){const t=Ft(TK);return Q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function NK(e){const t=Fa(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const OK={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top},ND=({nodeId:e,handleType:t,style:n,type:r=is.Bezier,CustomComponent:i,connectionStatus:o})=>{var I,O,M;const{fromNode:s,handleId:a,toX:u,toY:c,connectionMode:d}=Ft(A.useCallback(z=>({fromNode:z.nodeInternals.get(e),handleId:z.connectionHandleId,toX:(z.connectionPosition.x-z.transform[0])/z.transform[2],toY:(z.connectionPosition.y-z.transform[1])/z.transform[2],connectionMode:z.connectionMode}),[e]),On),p=(I=s==null?void 0:s[jt])==null?void 0:I.handleBounds;let h=p==null?void 0:p[t];if(d===ka.Loose&&(h=h||(p==null?void 0:p[t==="source"?"target":"source"])),!s||!h)return null;const m=a?h.find(z=>z.id===a):h[0],v=m?m.x+m.width/2:(s.width??0)/2,x=m?m.y+m.height/2:s.height??0,b=(((O=s.positionAbsolute)==null?void 0:O.x)??0)+v,y=(((M=s.positionAbsolute)==null?void 0:M.y)??0)+x,_=m==null?void 0:m.position,E=_?OK[_]:null;if(!_||!E)return null;if(i)return Q.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:m,fromX:b,fromY:y,toX:u,toY:c,fromPosition:_,toPosition:E,connectionStatus:o});let C="";const T={sourceX:b,sourceY:y,sourcePosition:_,targetX:u,targetY:c,targetPosition:E};return r===is.Bezier?[C]=ZR(T):r===is.Step?[C]=n_({...T,borderRadius:0}):r===is.SmoothStep?[C]=n_(T):r===is.SimpleBezier?[C]=QR(T):C=`M${b},${y} ${u},${c}`,Q.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:n})};ND.displayName="ConnectionLine";const RK=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function DK({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:u,connectionStatus:c}=Ft(RK,On);return!(i&&o&&a&&s)?null:Q.createElement("svg",{style:e,width:a,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},Q.createElement("g",{className:Zn(["react-flow__connection",c])},Q.createElement(ND,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function xA(e,t){return A.useRef(null),on(),A.useMemo(()=>t(e),[e])}const OD=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:v,onSelectionStart:x,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:_,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:T,selectionOnDrag:I,selectionMode:O,multiSelectionKeyCode:M,panActivationKeyCode:z,zoomActivationKeyCode:U,deleteKeyCode:F,onlyRenderVisibleElements:W,elementsSelectable:Y,selectNodesOnDrag:L,defaultViewport:B,translateExtent:j,minZoom:X,maxZoom:V,preventScrolling:H,defaultMarkerColor:N,zoomOnScroll:Z,zoomOnPinch:te,panOnScroll:R,panOnScrollSpeed:ee,panOnScrollMode:re,zoomOnDoubleClick:oe,panOnDrag:pe,onPaneClick:ye,onPaneMouseEnter:_e,onPaneMouseMove:Se,onPaneMouseLeave:We,onPaneScroll:Re,onPaneContextMenu:De,onEdgeContextMenu:He,onEdgeMouseEnter:Ie,onEdgeMouseMove:rt,onEdgeMouseLeave:Pe,onReconnect:we,onReconnectStart:mt,onReconnectEnd:gt,reconnectRadius:yt,noDragClassName:Zt,noWheelClassName:an,noPanClassName:qt,elevateEdgesOnSelect:ie,disableKeyboardA11y:ae,nodeOrigin:be,nodeExtent:Oe,rfId:Xe})=>{const Ut=xA(e,aK),vt=xA(t,hK);return NK(o),Q.createElement(oK,{onPaneClick:ye,onPaneMouseEnter:_e,onPaneMouseMove:Se,onPaneMouseLeave:We,onPaneContextMenu:De,onPaneScroll:Re,deleteKeyCode:F,selectionKeyCode:T,selectionOnDrag:I,selectionMode:O,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:M,panActivationKeyCode:z,zoomActivationKeyCode:U,elementsSelectable:Y,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:Z,zoomOnPinch:te,zoomOnDoubleClick:oe,panOnScroll:R,panOnScrollSpeed:ee,panOnScrollMode:re,panOnDrag:pe,defaultViewport:B,translateExtent:j,minZoom:X,maxZoom:V,onSelectionContextMenu:v,preventScrolling:H,noDragClassName:Zt,noWheelClassName:an,noPanClassName:qt,disableKeyboardA11y:ae},Q.createElement(kK,null,Q.createElement(AK,{edgeTypes:vt,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:W,onEdgeContextMenu:He,onEdgeMouseEnter:Ie,onEdgeMouseMove:rt,onEdgeMouseLeave:Pe,onReconnect:we,onReconnectStart:mt,onReconnectEnd:gt,reconnectRadius:yt,defaultMarkerColor:N,noPanClassName:qt,elevateEdgesOnSelect:!!ie,disableKeyboardA11y:ae,rfId:Xe},Q.createElement(DK,{style:_,type:y,component:E,containerStyle:C})),Q.createElement("div",{className:"react-flow__edgelabel-renderer"}),Q.createElement(cK,{nodeTypes:Ut,onNodeClick:s,onNodeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:L,onlyRenderVisibleElements:W,noPanClassName:qt,noDragClassName:Zt,disableKeyboardA11y:ae,nodeOrigin:be,nodeExtent:Oe,rfId:Xe})))};OD.displayName="GraphView";var LK=A.memo(OD);const a_=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Go={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:a_,nodeExtent:a_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ka.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uG,isValidConnection:void 0},PK=()=>b7((e,t)=>({...Go,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:Qv(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",s=i?Qv(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:u,nodeOrigin:c}=t(),d=u==null?void 0:u.querySelector(".react-flow__viewport");if(!d)return;const p=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(p.transform),m=n.reduce((x,b)=>{const y=i.get(b.id);if(y!=null&&y.hidden)i.set(y.id,{...y,[jt]:{...y[jt],handleBounds:void 0}});else if(y){const _=e1(b.nodeElement);!!(_.width&&_.height&&(y.width!==_.width||y.height!==_.height||b.forceUpdate))&&(i.set(y.id,{...y,[jt]:{...y[jt],handleBounds:{source:dA(".source",b.nodeElement,h,c),target:dA(".target",b.nodeElement,h,c)}},..._}),x.push({id:y.id,type:"dimensions",dimensions:_}))}return x},[]);yD(i,c);const v=s||o&&!s&&vD(t,{initial:!0,...a});e({nodeInternals:new Map(i),fitViewOnInitDone:v}),(m==null?void 0:m.length)>0&&(r==null||r(m))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),s=n.map(a=>{const u={id:a.id,type:"position",dragging:i};return r&&(u.positionAbsolute=a.positionAbsolute,u.position=a.position),u});o(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:u}=t();if(n!=null&&n.length){if(o){const c=_D(n,a()),d=Qv(c,i,s,u);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(u=>Zo(u,!0)):(s=zl(o(),n),a=zl(i,[])),Pp({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(u=>Zo(u,!0)):(s=zl(i,n),a=zl(o(),[])),Pp({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),s=n||o(),a=r||i,u=s.map(d=>(d.selected=!1,Zo(d.id,!1))),c=a.map(d=>Zo(d.id,!1));Pp({changedNodes:u,changedEdges:c,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(a=>a.selected).map(a=>Zo(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Zo(a.id,!1));Pp({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=t1(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:u}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=vs.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[i,o]],p=s==null?void 0:s.constrain()(c,d,u);return s.transform(a,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:Go.connectionNodeId,connectionHandleId:Go.connectionHandleId,connectionHandleType:Go.connectionHandleType,connectionStatus:Go.connectionStatus,connectionStartHandle:Go.connectionStartHandle,connectionEndHandle:Go.connectionEndHandle}),reset:()=>e({...Go})}),Object.is),f1=({children:e})=>{const t=A.useRef(null);return t.current||(t.current=PK()),Q.createElement(tG,{value:t.current},e)};f1.displayName="ReactFlowProvider";const RD=({children:e})=>A.useContext(og)?Q.createElement(Q.Fragment,null,e):Q.createElement(f1,null,e);RD.displayName="ReactFlowWrapper";const MK={input:cD,default:o_,output:dD,group:u1},$K={default:om,straight:o1,step:i1,smoothstep:sg,simplebezier:r1},FK=[0,0],BK=[15,15],HK={x:0,y:0,zoom:1},zK={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},DD=A.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=MK,edgeTypes:s=$K,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:d,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:y,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:I,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:z,onNodesDelete:U,onEdgesDelete:F,onSelectionChange:W,onSelectionDragStart:Y,onSelectionDrag:L,onSelectionDragStop:B,onSelectionContextMenu:j,onSelectionStart:X,onSelectionEnd:V,connectionMode:H=ka.Strict,connectionLineType:N=is.Bezier,connectionLineStyle:Z,connectionLineComponent:te,connectionLineContainerStyle:R,deleteKeyCode:ee="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:oe=!1,selectionMode:pe=Pf.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:_e=rm()?"Meta":"Control",zoomActivationKeyCode:Se=rm()?"Meta":"Control",snapToGrid:We=!1,snapGrid:Re=BK,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:He=!0,nodesDraggable:Ie,nodesConnectable:rt,nodesFocusable:Pe,nodeOrigin:we=FK,edgesFocusable:mt,edgesUpdatable:gt,elementsSelectable:yt,defaultViewport:Zt=HK,minZoom:an=.5,maxZoom:qt=2,translateExtent:ie=a_,preventScrolling:ae=!0,nodeExtent:be,defaultMarkerColor:Oe="#b1b1b7",zoomOnScroll:Xe=!0,zoomOnPinch:Ut=!0,panOnScroll:vt=!1,panOnScrollSpeed:St=.5,panOnScrollMode:hn=fa.Free,zoomOnDoubleClick:mn=!0,panOnDrag:Ct=!0,onPaneClick:Yt,onPaneMouseEnter:Nt,onPaneMouseMove:Fs,onPaneMouseLeave:Vu,onPaneScroll:Bs,onPaneContextMenu:Ya,children:Uu,onEdgeContextMenu:eo,onEdgeDoubleClick:Pg,onEdgeMouseEnter:Mg,onEdgeMouseMove:$g,onEdgeMouseLeave:xd,onEdgeUpdate:Fg,onEdgeUpdateStart:Bg,onEdgeUpdateEnd:Hg,onReconnect:Wu,onReconnectStart:zg,onReconnectEnd:Gu,reconnectRadius:jg=10,edgeUpdaterRadius:Vg=10,onNodesChange:Ug,onEdgesChange:Wg,noDragClassName:Gg="nodrag",noWheelClassName:Kg="nowheel",noPanClassName:_d="nopan",fitView:qg=!1,fitViewOptions:wd,connectOnClick:Yg=!0,attributionPosition:Xg,proOptions:Qg,defaultEdgeOptions:Zg,elevateNodesOnSelect:Jg=!0,elevateEdgesOnSelect:ey=!1,disableKeyboardA11y:Hs=!1,autoPanOnConnect:ty=!0,autoPanOnNodeDrag:Xa=!0,connectionRadius:ny=20,isValidConnection:ry,onError:iy,style:bd,id:Ku,nodeDragThreshold:Ed,...oy},sy)=>{const qu=Ku||"1";return Q.createElement("div",{...oy,style:{...bd,...zK},ref:sy,className:Zn(["react-flow",i]),"data-testid":"rf__wrapper",id:Ku},Q.createElement(RD,null,Q.createElement(LK,{onInit:c,onMove:d,onMoveStart:p,onMoveEnd:h,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:I,nodeTypes:o,edgeTypes:s,connectionLineType:N,connectionLineStyle:Z,connectionLineComponent:te,connectionLineContainerStyle:R,selectionKeyCode:re,selectionOnDrag:oe,selectionMode:pe,deleteKeyCode:ee,multiSelectionKeyCode:_e,panActivationKeyCode:ye,zoomActivationKeyCode:Se,onlyRenderVisibleElements:De,selectNodesOnDrag:He,defaultViewport:Zt,translateExtent:ie,minZoom:an,maxZoom:qt,preventScrolling:ae,zoomOnScroll:Xe,zoomOnPinch:Ut,zoomOnDoubleClick:mn,panOnScroll:vt,panOnScrollSpeed:St,panOnScrollMode:hn,panOnDrag:Ct,onPaneClick:Yt,onPaneMouseEnter:Nt,onPaneMouseMove:Fs,onPaneMouseLeave:Vu,onPaneScroll:Bs,onPaneContextMenu:Ya,onSelectionContextMenu:j,onSelectionStart:X,onSelectionEnd:V,onEdgeContextMenu:eo,onEdgeDoubleClick:Pg,onEdgeMouseEnter:Mg,onEdgeMouseMove:$g,onEdgeMouseLeave:xd,onReconnect:Wu??Fg,onReconnectStart:zg??Bg,onReconnectEnd:Gu??Hg,reconnectRadius:jg??Vg,defaultMarkerColor:Oe,noDragClassName:Gg,noWheelClassName:Kg,noPanClassName:_d,elevateEdgesOnSelect:ey,rfId:qu,disableKeyboardA11y:Hs,nodeOrigin:we,nodeExtent:be}),Q.createElement(OG,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:y,nodesDraggable:Ie,nodesConnectable:rt,nodesFocusable:Pe,edgesFocusable:mt,edgesUpdatable:gt,elementsSelectable:yt,elevateNodesOnSelect:Jg,minZoom:an,maxZoom:qt,nodeExtent:be,onNodesChange:Ug,onEdgesChange:Wg,snapToGrid:We,snapGrid:Re,connectionMode:H,translateExtent:ie,connectOnClick:Yg,defaultEdgeOptions:Zg,fitView:qg,fitViewOptions:wd,onNodesDelete:U,onEdgesDelete:F,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:z,onSelectionDrag:L,onSelectionDragStart:Y,onSelectionDragStop:B,noPanClassName:_d,nodeOrigin:we,rfId:qu,autoPanOnConnect:ty,autoPanOnNodeDrag:Xa,onError:iy,connectionRadius:ny,isValidConnection:ry,nodeDragThreshold:Ed}),Q.createElement(kG,{onSelectionChange:W}),Uu,Q.createElement(rG,{proOptions:Qg,position:Xg}),Q.createElement(MG,{rfId:qu,disableKeyboardA11y:Hs})))});DD.displayName="ReactFlow";function jK(){const e=on();return A.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const u=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return u&&s.push({id:a,nodeElement:u,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(o))},[])}function VK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Q.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function UK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Q.createElement("path",{d:"M0 0h32v4.2H0z"}))}function WK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Q.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function GK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function KK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Uc=({children:e,className:t,...n})=>Q.createElement("button",{type:"button",className:Zn(["react-flow__controls-button",t]),...n},e);Uc.displayName="ControlButton";const qK=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),LD=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:u,className:c,children:d,position:p="bottom-left"})=>{const h=on(),[m,v]=A.useState(!1),{isInteractive:x,minZoomReached:b,maxZoomReached:y}=Ft(qK,On),{zoomIn:_,zoomOut:E,fitView:C}=Fa();if(A.useEffect(()=>{v(!0)},[]),!m)return null;const T=()=>{_(),o==null||o()},I=()=>{E(),s==null||s()},O=()=>{C(i),a==null||a()},M=()=>{h.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)};return Q.createElement(UR,{className:Zn(["react-flow__controls",c]),position:p,style:e,"data-testid":"rf__controls"},t&&Q.createElement(Q.Fragment,null,Q.createElement(Uc,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:y},Q.createElement(VK,null)),Q.createElement(Uc,{onClick:I,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},Q.createElement(UK,null))),n&&Q.createElement(Uc,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view"},Q.createElement(WK,null)),r&&Q.createElement(Uc,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity"},x?Q.createElement(KK,null):Q.createElement(GK,null)),d)};LD.displayName="Controls";var YK=A.memo(LD),Li;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Li||(Li={}));function XK({color:e,dimensions:t,lineWidth:n}){return Q.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function QK({color:e,radius:t}){return Q.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const ZK={[Li.Dots]:"#91919a",[Li.Lines]:"#eee",[Li.Cross]:"#e2e2e2"},JK={[Li.Dots]:1,[Li.Lines]:1,[Li.Cross]:6},eq=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function PD({id:e,variant:t=Li.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=2,color:s,style:a,className:u}){const c=A.useRef(null),{transform:d,patternId:p}=Ft(eq,On),h=s||ZK[t],m=r||JK[t],v=t===Li.Dots,x=t===Li.Cross,b=Array.isArray(n)?n:[n,n],y=[b[0]*d[2]||1,b[1]*d[2]||1],_=m*d[2],E=x?[_,_]:y,C=v?[_/o,_/o]:[E[0]/o,E[1]/o];return Q.createElement("svg",{className:Zn(["react-flow__background",u]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},Q.createElement("pattern",{id:p+e,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},v?Q.createElement(QK,{color:h,radius:_/o}):Q.createElement(XK,{dimensions:E,color:h,lineWidth:i})),Q.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}PD.displayName="Background";var tq=A.memo(PD);const Tt={blue:"#0d6efd",indigo:"#6610f2",purple:"#6f42c1",pink:"#d63384",red:"#dc3545",orange:"#fd7e14",yellow:"#ffc107",green:"#198754",teal:"#20c997",cyan:"#0dcaf0",gray100:"#f8f9fa",gray200:"#e9ecef",gray300:"#dee2e6",gray400:"#ced4da",gray500:"#adb5bd",gray600:"#6c757d",gray700:"#495057",gray800:"#343a40",gray900:"#212529"};var sm={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",p=1,h=2,m=4,v=1,x=2,b=1,y=2,_=4,E=8,C=16,T=32,I=64,O=128,M=256,z=512,U=30,F="...",W=800,Y=16,L=1,B=2,j=3,X=1/0,V=9007199254740991,H=17976931348623157e292,N=NaN,Z=4294967295,te=Z-1,R=Z>>>1,ee=[["ary",O],["bind",b],["bindKey",y],["curry",E],["curryRight",C],["flip",z],["partial",T],["partialRight",I],["rearg",M]],re="[object Arguments]",oe="[object Array]",pe="[object AsyncFunction]",ye="[object Boolean]",_e="[object Date]",Se="[object DOMException]",We="[object Error]",Re="[object Function]",De="[object GeneratorFunction]",He="[object Map]",Ie="[object Number]",rt="[object Null]",Pe="[object Object]",we="[object Promise]",mt="[object Proxy]",gt="[object RegExp]",yt="[object Set]",Zt="[object String]",an="[object Symbol]",qt="[object Undefined]",ie="[object WeakMap]",ae="[object WeakSet]",be="[object ArrayBuffer]",Oe="[object DataView]",Xe="[object Float32Array]",Ut="[object Float64Array]",vt="[object Int8Array]",St="[object Int16Array]",hn="[object Int32Array]",mn="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Yt="[object Uint16Array]",Nt="[object Uint32Array]",Fs=/\b__p \+= '';/g,Vu=/\b(__p \+=) '' \+/g,Bs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ya=/&(?:amp|lt|gt|quot|#39);/g,Uu=/[&<>"']/g,eo=RegExp(Ya.source),Pg=RegExp(Uu.source),Mg=/<%-([\s\S]+?)%>/g,$g=/<%([\s\S]+?)%>/g,xd=/<%=([\s\S]+?)%>/g,Fg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bg=/^\w*$/,Hg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wu=/[\\^$.*+?()[\]{}|]/g,zg=RegExp(Wu.source),Gu=/^\s+/,jg=/\s/,Vg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ug=/\{\n\/\* \[wrapped with (.+)\] \*/,Wg=/,? & /,Gg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kg=/[()=,{}\[\]\/\s]/,_d=/\\(\\)?/g,qg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wd=/\w*$/,Yg=/^[-+]0x[0-9a-f]+$/i,Xg=/^0b[01]+$/i,Qg=/^\[object .+?Constructor\]$/,Zg=/^0o[0-7]+$/i,Jg=/^(?:0|[1-9]\d*)$/,ey=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hs=/($^)/,ty=/['\n\r\u2028\u2029\\]/g,Xa="\\ud800-\\udfff",ny="\\u0300-\\u036f",ry="\\ufe20-\\ufe2f",iy="\\u20d0-\\u20ff",bd=ny+ry+iy,Ku="\\u2700-\\u27bf",Ed="a-z\\xdf-\\xf6\\xf8-\\xff",oy="\\xac\\xb1\\xd7\\xf7",sy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qu="\\u2000-\\u206f",V3=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wb="A-Z\\xc0-\\xd6\\xd8-\\xde",Gb="\\ufe0e\\ufe0f",Kb=oy+sy+qu+V3,ay="['’]",U3="["+Xa+"]",qb="["+Kb+"]",Sd="["+bd+"]",Yb="\\d+",W3="["+Ku+"]",Xb="["+Ed+"]",Qb="[^"+Xa+Kb+Yb+Ku+Ed+Wb+"]",ly="\\ud83c[\\udffb-\\udfff]",G3="(?:"+Sd+"|"+ly+")",Zb="[^"+Xa+"]",uy="(?:\\ud83c[\\udde6-\\uddff]){2}",cy="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="["+Wb+"]",Jb="\\u200d",eE="(?:"+Xb+"|"+Qb+")",K3="(?:"+Qa+"|"+Qb+")",tE="(?:"+ay+"(?:d|ll|m|re|s|t|ve))?",nE="(?:"+ay+"(?:D|LL|M|RE|S|T|VE))?",rE=G3+"?",iE="["+Gb+"]?",q3="(?:"+Jb+"(?:"+[Zb,uy,cy].join("|")+")"+iE+rE+")*",Y3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",X3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",oE=iE+rE+q3,Q3="(?:"+[W3,uy,cy].join("|")+")"+oE,Z3="(?:"+[Zb+Sd+"?",Sd,uy,cy,U3].join("|")+")",J3=RegExp(ay,"g"),eF=RegExp(Sd,"g"),fy=RegExp(ly+"(?="+ly+")|"+Z3+oE,"g"),tF=RegExp([Qa+"?"+Xb+"+"+tE+"(?="+[qb,Qa,"$"].join("|")+")",K3+"+"+nE+"(?="+[qb,Qa+eE,"$"].join("|")+")",Qa+"?"+eE+"+"+tE,Qa+"+"+nE,X3,Y3,Yb,Q3].join("|"),"g"),nF=RegExp("["+Jb+Xa+bd+Gb+"]"),rF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,iF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oF=-1,It={};It[Xe]=It[Ut]=It[vt]=It[St]=It[hn]=It[mn]=It[Ct]=It[Yt]=It[Nt]=!0,It[re]=It[oe]=It[be]=It[ye]=It[Oe]=It[_e]=It[We]=It[Re]=It[He]=It[Ie]=It[Pe]=It[gt]=It[yt]=It[Zt]=It[ie]=!1;var _t={};_t[re]=_t[oe]=_t[be]=_t[Oe]=_t[ye]=_t[_e]=_t[Xe]=_t[Ut]=_t[vt]=_t[St]=_t[hn]=_t[He]=_t[Ie]=_t[Pe]=_t[gt]=_t[yt]=_t[Zt]=_t[an]=_t[mn]=_t[Ct]=_t[Yt]=_t[Nt]=!0,_t[We]=_t[Re]=_t[ie]=!1;var sF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},aF={"&":"&","<":"<",">":">",'"':""","'":"'"},lF={"&":"&","<":"<",">":">",""":'"',"'":"'"},uF={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},cF=parseFloat,fF=parseInt,sE=typeof ra=="object"&&ra&&ra.Object===Object&&ra,dF=typeof self=="object"&&self&&self.Object===Object&&self,gn=sE||dF||Function("return this")(),dy=t&&!t.nodeType&&t,zs=dy&&!0&&e&&!e.nodeType&&e,aE=zs&&zs.exports===dy,py=aE&&sE.process,Kr=function(){try{var K=zs&&zs.require&&zs.require("util").types;return K||py&&py.binding&&py.binding("util")}catch{}}(),lE=Kr&&Kr.isArrayBuffer,uE=Kr&&Kr.isDate,cE=Kr&&Kr.isMap,fE=Kr&&Kr.isRegExp,dE=Kr&&Kr.isSet,pE=Kr&&Kr.isTypedArray;function Er(K,se,ne){switch(ne.length){case 0:return K.call(se);case 1:return K.call(se,ne[0]);case 2:return K.call(se,ne[0],ne[1]);case 3:return K.call(se,ne[0],ne[1],ne[2])}return K.apply(se,ne)}function pF(K,se,ne,Ee){for(var je=-1,st=K==null?0:K.length;++je-1}function hy(K,se,ne){for(var Ee=-1,je=K==null?0:K.length;++Ee-1;);return ne}function wE(K,se){for(var ne=K.length;ne--&&Za(se,K[ne],0)>-1;);return ne}function bF(K,se){for(var ne=K.length,Ee=0;ne--;)K[ne]===se&&++Ee;return Ee}var EF=vy(sF),SF=vy(aF);function CF(K){return"\\"+uF[K]}function IF(K,se){return K==null?n:K[se]}function Ja(K){return nF.test(K)}function AF(K){return rF.test(K)}function TF(K){for(var se,ne=[];!(se=K.next()).done;)ne.push(se.value);return ne}function by(K){var se=-1,ne=Array(K.size);return K.forEach(function(Ee,je){ne[++se]=[je,Ee]}),ne}function bE(K,se){return function(ne){return K(se(ne))}}function Fo(K,se){for(var ne=-1,Ee=K.length,je=0,st=[];++ne-1}function mB(l,f){var g=this.__data__,w=jd(g,l);return w<0?(++this.size,g.push([l,f])):g[w][1]=f,this}to.prototype.clear=fB,to.prototype.delete=dB,to.prototype.get=pB,to.prototype.has=hB,to.prototype.set=mB;function no(l){var f=-1,g=l==null?0:l.length;for(this.clear();++f=f?l:f)),l}function Qr(l,f,g,w,k,P){var $,G=f&p,q=f&h,le=f&m;if(g&&($=k?g(l,w,k,P):g(l)),$!==n)return $;if(!Dt(l))return l;var ue=Ve(l);if(ue){if($=x4(l),!G)return rr(l,$)}else{var fe=Cn(l),xe=fe==Re||fe==De;if(Uo(l))return iS(l,G);if(fe==Pe||fe==re||xe&&!k){if($=q||xe?{}:ES(l),!G)return q?l4(l,OB($,l)):a4(l,LE($,l))}else{if(!_t[fe])return k?l:{};$=_4(l,fe,G)}}P||(P=new wi);var Ae=P.get(l);if(Ae)return Ae;P.set(l,$),ZS(l)?l.forEach(function(Fe){$.add(Qr(Fe,f,g,Fe,l,P))}):XS(l)&&l.forEach(function(Fe,Je){$.set(Je,Qr(Fe,f,g,Je,l,P))});var $e=le?q?qy:Ky:q?or:ln,qe=ue?n:$e(l);return qr(qe||l,function(Fe,Je){qe&&(Je=Fe,Fe=l[Je]),tc($,Je,Qr(Fe,f,g,Je,l,P))}),$}function RB(l){var f=ln(l);return function(g){return PE(g,l,f)}}function PE(l,f,g){var w=g.length;if(l==null)return!w;for(l=xt(l);w--;){var k=g[w],P=f[k],$=l[k];if($===n&&!(k in l)||!P($))return!1}return!0}function ME(l,f,g){if(typeof l!="function")throw new Yr(s);return lc(function(){l.apply(n,g)},f)}function nc(l,f,g,w){var k=-1,P=Cd,$=!0,G=l.length,q=[],le=f.length;if(!G)return q;g&&(f=Ot(f,Sr(g))),w?(P=hy,$=!1):f.length>=i&&(P=Yu,$=!1,f=new Us(f));e:for(;++kk?0:k+g),w=w===n||w>k?k:Ke(w),w<0&&(w+=k),w=g>w?0:eC(w);g0&&g(G)?f>1?yn(G,f-1,g,w,k):$o(k,G):w||(k[k.length]=G)}return k}var ky=cS(),BE=cS(!0);function Bi(l,f){return l&&ky(l,f,ln)}function Ny(l,f){return l&&BE(l,f,ln)}function Ud(l,f){return Mo(f,function(g){return ao(l[g])})}function Gs(l,f){f=jo(f,l);for(var g=0,w=f.length;l!=null&&gf}function PB(l,f){return l!=null&&dt.call(l,f)}function MB(l,f){return l!=null&&f in xt(l)}function $B(l,f,g){return l>=Sn(f,g)&&l=120&&ue.length>=120)?new Us($&&ue):n}ue=l[0];var fe=-1,xe=G[0];e:for(;++fe-1;)G!==l&&Pd.call(G,q,1),Pd.call(l,q,1);return l}function XE(l,f){for(var g=l?f.length:0,w=g-1;g--;){var k=f[g];if(g==w||k!==P){var P=k;so(k)?Pd.call(l,k,1):Hy(l,k)}}return l}function $y(l,f){return l+Fd(NE()*(f-l+1))}function XB(l,f,g,w){for(var k=-1,P=en($d((f-l)/(g||1)),0),$=ne(P);P--;)$[w?P:++k]=l,l+=g;return $}function Fy(l,f){var g="";if(!l||f<1||f>V)return g;do f%2&&(g+=l),f=Fd(f/2),f&&(l+=l);while(f);return g}function Qe(l,f){return tv(IS(l,f,sr),l+"")}function QB(l){return DE(cl(l))}function ZB(l,f){var g=cl(l);return tp(g,Ws(f,0,g.length))}function oc(l,f,g,w){if(!Dt(l))return l;f=jo(f,l);for(var k=-1,P=f.length,$=P-1,G=l;G!=null&&++kk?0:k+f),g=g>k?k:g,g<0&&(g+=k),k=f>g?0:g-f>>>0,f>>>=0;for(var P=ne(k);++w>>1,$=l[P];$!==null&&!Ir($)&&(g?$<=f:$=i){var le=f?null:d4(l);if(le)return Ad(le);$=!1,k=Yu,q=new Us}else q=f?[]:G;e:for(;++w=w?l:Zr(l,f,g)}var rS=VF||function(l){return gn.clearTimeout(l)};function iS(l,f){if(f)return l.slice();var g=l.length,w=CE?CE(g):new l.constructor(g);return l.copy(w),w}function Uy(l){var f=new l.constructor(l.byteLength);return new Dd(f).set(new Dd(l)),f}function r4(l,f){var g=f?Uy(l.buffer):l.buffer;return new l.constructor(g,l.byteOffset,l.byteLength)}function i4(l){var f=new l.constructor(l.source,wd.exec(l));return f.lastIndex=l.lastIndex,f}function o4(l){return ec?xt(ec.call(l)):{}}function oS(l,f){var g=f?Uy(l.buffer):l.buffer;return new l.constructor(g,l.byteOffset,l.length)}function sS(l,f){if(l!==f){var g=l!==n,w=l===null,k=l===l,P=Ir(l),$=f!==n,G=f===null,q=f===f,le=Ir(f);if(!G&&!le&&!P&&l>f||P&&$&&q&&!G&&!le||w&&$&&q||!g&&q||!k)return 1;if(!w&&!P&&!le&&l=G)return q;var le=g[w];return q*(le=="desc"?-1:1)}}return l.index-f.index}function aS(l,f,g,w){for(var k=-1,P=l.length,$=g.length,G=-1,q=f.length,le=en(P-$,0),ue=ne(q+le),fe=!w;++G1?g[k-1]:n,$=k>2?g[2]:n;for(P=l.length>3&&typeof P=="function"?(k--,P):n,$&&Bn(g[0],g[1],$)&&(P=k<3?n:P,k=1),f=xt(f);++w-1?k[P?f[$]:$]:n}}function pS(l){return oo(function(f){var g=f.length,w=g,k=Xr.prototype.thru;for(l&&f.reverse();w--;){var P=f[w];if(typeof P!="function")throw new Yr(s);if(k&&!$&&Jd(P)=="wrapper")var $=new Xr([],!0)}for(w=$?w:g;++w1&&nt.reverse(),ue&&qG))return!1;var le=P.get(l),ue=P.get(f);if(le&&ue)return le==f&&ue==l;var fe=-1,xe=!0,Ae=g&x?new Us:n;for(P.set(l,f),P.set(f,l);++fe1?"& ":"")+f[w],f=f.join(g>2?", ":" "),l.replace(Vg,`{ -/* [wrapped with `+f+`] */ -`)}function b4(l){return Ve(l)||Ys(l)||!!(TE&&l&&l[TE])}function so(l,f){var g=typeof l;return f=f??V,!!f&&(g=="number"||g!="symbol"&&Jg.test(l))&&l>-1&&l%1==0&&l0){if(++f>=W)return arguments[0]}else f=0;return l.apply(n,arguments)}}function tp(l,f){var g=-1,w=l.length,k=w-1;for(f=f===n?w:f;++g1?l[f-1]:n;return g=typeof g=="function"?(l.pop(),g):n,FS(l,g)});function BS(l){var f=D(l);return f.__chain__=!0,f}function D5(l,f){return f(l),l}function np(l,f){return f(l)}var L5=oo(function(l){var f=l.length,g=f?l[0]:0,w=this.__wrapped__,k=function(P){return Ty(P,l)};return f>1||this.__actions__.length||!(w instanceof tt)||!so(g)?this.thru(k):(w=w.slice(g,+g+(f?1:0)),w.__actions__.push({func:np,args:[k],thisArg:n}),new Xr(w,this.__chain__).thru(function(P){return f&&!P.length&&P.push(n),P}))});function P5(){return BS(this)}function M5(){return new Xr(this.value(),this.__chain__)}function $5(){this.__values__===n&&(this.__values__=JS(this.value()));var l=this.__index__>=this.__values__.length,f=l?n:this.__values__[this.__index__++];return{done:l,value:f}}function F5(){return this}function B5(l){for(var f,g=this;g instanceof zd;){var w=RS(g);w.__index__=0,w.__values__=n,f?k.__wrapped__=w:f=w;var k=w;g=g.__wrapped__}return k.__wrapped__=l,f}function H5(){var l=this.__wrapped__;if(l instanceof tt){var f=l;return this.__actions__.length&&(f=new tt(this)),f=f.reverse(),f.__actions__.push({func:np,args:[nv],thisArg:n}),new Xr(f,this.__chain__)}return this.thru(nv)}function z5(){return tS(this.__wrapped__,this.__actions__)}var j5=qd(function(l,f,g){dt.call(l,g)?++l[g]:ro(l,g,1)});function V5(l,f,g){var w=Ve(l)?hE:DB;return g&&Bn(l,f,g)&&(f=n),w(l,Me(f,3))}function U5(l,f){var g=Ve(l)?Mo:FE;return g(l,Me(f,3))}var W5=dS(DS),G5=dS(LS);function K5(l,f){return yn(rp(l,f),1)}function q5(l,f){return yn(rp(l,f),X)}function Y5(l,f,g){return g=g===n?1:Ke(g),yn(rp(l,f),g)}function HS(l,f){var g=Ve(l)?qr:Ho;return g(l,Me(f,3))}function zS(l,f){var g=Ve(l)?hF:$E;return g(l,Me(f,3))}var X5=qd(function(l,f,g){dt.call(l,g)?l[g].push(f):ro(l,g,[f])});function Q5(l,f,g,w){l=ir(l)?l:cl(l),g=g&&!w?Ke(g):0;var k=l.length;return g<0&&(g=en(k+g,0)),lp(l)?g<=k&&l.indexOf(f,g)>-1:!!k&&Za(l,f,g)>-1}var Z5=Qe(function(l,f,g){var w=-1,k=typeof f=="function",P=ir(l)?ne(l.length):[];return Ho(l,function($){P[++w]=k?Er(f,$,g):rc($,f,g)}),P}),J5=qd(function(l,f,g){ro(l,g,f)});function rp(l,f){var g=Ve(l)?Ot:UE;return g(l,Me(f,3))}function eH(l,f,g,w){return l==null?[]:(Ve(f)||(f=f==null?[]:[f]),g=w?n:g,Ve(g)||(g=g==null?[]:[g]),qE(l,f,g))}var tH=qd(function(l,f,g){l[g?0:1].push(f)},function(){return[[],[]]});function nH(l,f,g){var w=Ve(l)?my:vE,k=arguments.length<3;return w(l,Me(f,4),g,k,Ho)}function rH(l,f,g){var w=Ve(l)?mF:vE,k=arguments.length<3;return w(l,Me(f,4),g,k,$E)}function iH(l,f){var g=Ve(l)?Mo:FE;return g(l,sp(Me(f,3)))}function oH(l){var f=Ve(l)?DE:QB;return f(l)}function sH(l,f,g){(g?Bn(l,f,g):f===n)?f=1:f=Ke(f);var w=Ve(l)?TB:ZB;return w(l,f)}function aH(l){var f=Ve(l)?kB:e4;return f(l)}function lH(l){if(l==null)return 0;if(ir(l))return lp(l)?el(l):l.length;var f=Cn(l);return f==He||f==yt?l.size:Ly(l).length}function uH(l,f,g){var w=Ve(l)?gy:t4;return g&&Bn(l,f,g)&&(f=n),w(l,Me(f,3))}var cH=Qe(function(l,f){if(l==null)return[];var g=f.length;return g>1&&Bn(l,f[0],f[1])?f=[]:g>2&&Bn(f[0],f[1],f[2])&&(f=[f[0]]),qE(l,yn(f,1),[])}),ip=UF||function(){return gn.Date.now()};function fH(l,f){if(typeof f!="function")throw new Yr(s);return l=Ke(l),function(){if(--l<1)return f.apply(this,arguments)}}function jS(l,f,g){return f=g?n:f,f=l&&f==null?l.length:f,io(l,O,n,n,n,n,f)}function VS(l,f){var g;if(typeof f!="function")throw new Yr(s);return l=Ke(l),function(){return--l>0&&(g=f.apply(this,arguments)),l<=1&&(f=n),g}}var iv=Qe(function(l,f,g){var w=b;if(g.length){var k=Fo(g,ll(iv));w|=T}return io(l,w,f,g,k)}),US=Qe(function(l,f,g){var w=b|y;if(g.length){var k=Fo(g,ll(US));w|=T}return io(f,w,l,g,k)});function WS(l,f,g){f=g?n:f;var w=io(l,E,n,n,n,n,n,f);return w.placeholder=WS.placeholder,w}function GS(l,f,g){f=g?n:f;var w=io(l,C,n,n,n,n,n,f);return w.placeholder=GS.placeholder,w}function KS(l,f,g){var w,k,P,$,G,q,le=0,ue=!1,fe=!1,xe=!0;if(typeof l!="function")throw new Yr(s);f=ei(f)||0,Dt(g)&&(ue=!!g.leading,fe="maxWait"in g,P=fe?en(ei(g.maxWait)||0,f):P,xe="trailing"in g?!!g.trailing:xe);function Ae(Gt){var Ei=w,uo=k;return w=k=n,le=Gt,$=l.apply(uo,Ei),$}function $e(Gt){return le=Gt,G=lc(Je,f),ue?Ae(Gt):$}function qe(Gt){var Ei=Gt-q,uo=Gt-le,dC=f-Ei;return fe?Sn(dC,P-uo):dC}function Fe(Gt){var Ei=Gt-q,uo=Gt-le;return q===n||Ei>=f||Ei<0||fe&&uo>=P}function Je(){var Gt=ip();if(Fe(Gt))return nt(Gt);G=lc(Je,qe(Gt))}function nt(Gt){return G=n,xe&&w?Ae(Gt):(w=k=n,$)}function Ar(){G!==n&&rS(G),le=0,w=q=k=G=n}function Hn(){return G===n?$:nt(ip())}function Tr(){var Gt=ip(),Ei=Fe(Gt);if(w=arguments,k=this,q=Gt,Ei){if(G===n)return $e(q);if(fe)return rS(G),G=lc(Je,f),Ae(q)}return G===n&&(G=lc(Je,f)),$}return Tr.cancel=Ar,Tr.flush=Hn,Tr}var dH=Qe(function(l,f){return ME(l,1,f)}),pH=Qe(function(l,f,g){return ME(l,ei(f)||0,g)});function hH(l){return io(l,z)}function op(l,f){if(typeof l!="function"||f!=null&&typeof f!="function")throw new Yr(s);var g=function(){var w=arguments,k=f?f.apply(this,w):w[0],P=g.cache;if(P.has(k))return P.get(k);var $=l.apply(this,w);return g.cache=P.set(k,$)||P,$};return g.cache=new(op.Cache||no),g}op.Cache=no;function sp(l){if(typeof l!="function")throw new Yr(s);return function(){var f=arguments;switch(f.length){case 0:return!l.call(this);case 1:return!l.call(this,f[0]);case 2:return!l.call(this,f[0],f[1]);case 3:return!l.call(this,f[0],f[1],f[2])}return!l.apply(this,f)}}function mH(l){return VS(2,l)}var gH=n4(function(l,f){f=f.length==1&&Ve(f[0])?Ot(f[0],Sr(Me())):Ot(yn(f,1),Sr(Me()));var g=f.length;return Qe(function(w){for(var k=-1,P=Sn(w.length,g);++k=f}),Ys=zE(function(){return arguments}())?zE:function(l){return Bt(l)&&dt.call(l,"callee")&&!AE.call(l,"callee")},Ve=ne.isArray,OH=lE?Sr(lE):BB;function ir(l){return l!=null&&ap(l.length)&&!ao(l)}function Wt(l){return Bt(l)&&ir(l)}function RH(l){return l===!0||l===!1||Bt(l)&&Fn(l)==ye}var Uo=GF||gv,DH=uE?Sr(uE):HB;function LH(l){return Bt(l)&&l.nodeType===1&&!uc(l)}function PH(l){if(l==null)return!0;if(ir(l)&&(Ve(l)||typeof l=="string"||typeof l.splice=="function"||Uo(l)||ul(l)||Ys(l)))return!l.length;var f=Cn(l);if(f==He||f==yt)return!l.size;if(ac(l))return!Ly(l).length;for(var g in l)if(dt.call(l,g))return!1;return!0}function MH(l,f){return ic(l,f)}function $H(l,f,g){g=typeof g=="function"?g:n;var w=g?g(l,f):n;return w===n?ic(l,f,n,g):!!w}function sv(l){if(!Bt(l))return!1;var f=Fn(l);return f==We||f==Se||typeof l.message=="string"&&typeof l.name=="string"&&!uc(l)}function FH(l){return typeof l=="number"&&kE(l)}function ao(l){if(!Dt(l))return!1;var f=Fn(l);return f==Re||f==De||f==pe||f==mt}function YS(l){return typeof l=="number"&&l==Ke(l)}function ap(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=V}function Dt(l){var f=typeof l;return l!=null&&(f=="object"||f=="function")}function Bt(l){return l!=null&&typeof l=="object"}var XS=cE?Sr(cE):jB;function BH(l,f){return l===f||Dy(l,f,Xy(f))}function HH(l,f,g){return g=typeof g=="function"?g:n,Dy(l,f,Xy(f),g)}function zH(l){return QS(l)&&l!=+l}function jH(l){if(C4(l))throw new je(o);return jE(l)}function VH(l){return l===null}function UH(l){return l==null}function QS(l){return typeof l=="number"||Bt(l)&&Fn(l)==Ie}function uc(l){if(!Bt(l)||Fn(l)!=Pe)return!1;var f=Ld(l);if(f===null)return!0;var g=dt.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&Nd.call(g)==HF}var av=fE?Sr(fE):VB;function WH(l){return YS(l)&&l>=-V&&l<=V}var ZS=dE?Sr(dE):UB;function lp(l){return typeof l=="string"||!Ve(l)&&Bt(l)&&Fn(l)==Zt}function Ir(l){return typeof l=="symbol"||Bt(l)&&Fn(l)==an}var ul=pE?Sr(pE):WB;function GH(l){return l===n}function KH(l){return Bt(l)&&Cn(l)==ie}function qH(l){return Bt(l)&&Fn(l)==ae}var YH=Zd(Py),XH=Zd(function(l,f){return l<=f});function JS(l){if(!l)return[];if(ir(l))return lp(l)?_i(l):rr(l);if(Xu&&l[Xu])return TF(l[Xu]());var f=Cn(l),g=f==He?by:f==yt?Ad:cl;return g(l)}function lo(l){if(!l)return l===0?l:0;if(l=ei(l),l===X||l===-X){var f=l<0?-1:1;return f*H}return l===l?l:0}function Ke(l){var f=lo(l),g=f%1;return f===f?g?f-g:f:0}function eC(l){return l?Ws(Ke(l),0,Z):0}function ei(l){if(typeof l=="number")return l;if(Ir(l))return N;if(Dt(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=Dt(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=xE(l);var g=Xg.test(l);return g||Zg.test(l)?fF(l.slice(2),g?2:8):Yg.test(l)?N:+l}function tC(l){return Hi(l,or(l))}function QH(l){return l?Ws(Ke(l),-V,V):l===0?l:0}function lt(l){return l==null?"":Cr(l)}var ZH=sl(function(l,f){if(ac(f)||ir(f)){Hi(f,ln(f),l);return}for(var g in f)dt.call(f,g)&&tc(l,g,f[g])}),nC=sl(function(l,f){Hi(f,or(f),l)}),up=sl(function(l,f,g,w){Hi(f,or(f),l,w)}),JH=sl(function(l,f,g,w){Hi(f,ln(f),l,w)}),ez=oo(Ty);function tz(l,f){var g=ol(l);return f==null?g:LE(g,f)}var nz=Qe(function(l,f){l=xt(l);var g=-1,w=f.length,k=w>2?f[2]:n;for(k&&Bn(f[0],f[1],k)&&(w=1);++g1),P}),Hi(l,qy(l),g),w&&(g=Qr(g,p|h|m,p4));for(var k=f.length;k--;)Hy(g,f[k]);return g});function _z(l,f){return iC(l,sp(Me(f)))}var wz=oo(function(l,f){return l==null?{}:qB(l,f)});function iC(l,f){if(l==null)return{};var g=Ot(qy(l),function(w){return[w]});return f=Me(f),YE(l,g,function(w,k){return f(w,k[0])})}function bz(l,f,g){f=jo(f,l);var w=-1,k=f.length;for(k||(k=1,l=n);++wf){var w=l;l=f,f=w}if(g||l%1||f%1){var k=NE();return Sn(l+k*(f-l+cF("1e-"+((k+"").length-1))),f)}return $y(l,f)}var Dz=al(function(l,f,g){return f=f.toLowerCase(),l+(g?aC(f):f)});function aC(l){return cv(lt(l).toLowerCase())}function lC(l){return l=lt(l),l&&l.replace(ey,EF).replace(eF,"")}function Lz(l,f,g){l=lt(l),f=Cr(f);var w=l.length;g=g===n?w:Ws(Ke(g),0,w);var k=g;return g-=f.length,g>=0&&l.slice(g,k)==f}function Pz(l){return l=lt(l),l&&Pg.test(l)?l.replace(Uu,SF):l}function Mz(l){return l=lt(l),l&&zg.test(l)?l.replace(Wu,"\\$&"):l}var $z=al(function(l,f,g){return l+(g?"-":"")+f.toLowerCase()}),Fz=al(function(l,f,g){return l+(g?" ":"")+f.toLowerCase()}),Bz=fS("toLowerCase");function Hz(l,f,g){l=lt(l),f=Ke(f);var w=f?el(l):0;if(!f||w>=f)return l;var k=(f-w)/2;return Qd(Fd(k),g)+l+Qd($d(k),g)}function zz(l,f,g){l=lt(l),f=Ke(f);var w=f?el(l):0;return f&&w>>0,g?(l=lt(l),l&&(typeof f=="string"||f!=null&&!av(f))&&(f=Cr(f),!f&&Ja(l))?Vo(_i(l),0,g):l.split(f,g)):[]}var qz=al(function(l,f,g){return l+(g?" ":"")+cv(f)});function Yz(l,f,g){return l=lt(l),g=g==null?0:Ws(Ke(g),0,l.length),f=Cr(f),l.slice(g,g+f.length)==f}function Xz(l,f,g){var w=D.templateSettings;g&&Bn(l,f,g)&&(f=n),l=lt(l),f=up({},f,w,vS);var k=up({},f.imports,w.imports,vS),P=ln(k),$=wy(k,P),G,q,le=0,ue=f.interpolate||Hs,fe="__p += '",xe=Ey((f.escape||Hs).source+"|"+ue.source+"|"+(ue===xd?qg:Hs).source+"|"+(f.evaluate||Hs).source+"|$","g"),Ae="//# sourceURL="+(dt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oF+"]")+` -`;l.replace(xe,function(Fe,Je,nt,Ar,Hn,Tr){return nt||(nt=Ar),fe+=l.slice(le,Tr).replace(ty,CF),Je&&(G=!0,fe+=`' + -__e(`+Je+`) + -'`),Hn&&(q=!0,fe+=`'; -`+Hn+`; -__p += '`),nt&&(fe+=`' + -((__t = (`+nt+`)) == null ? '' : __t) + -'`),le=Tr+Fe.length,Fe}),fe+=`'; -`;var $e=dt.call(f,"variable")&&f.variable;if(!$e)fe=`with (obj) { -`+fe+` -} -`;else if(Kg.test($e))throw new je(a);fe=(q?fe.replace(Fs,""):fe).replace(Vu,"$1").replace(Bs,"$1;"),fe="function("+($e||"obj")+`) { -`+($e?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(G?", __e = _.escape":"")+(q?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+fe+`return __p -}`;var qe=cC(function(){return st(P,Ae+"return "+fe).apply(n,$)});if(qe.source=fe,sv(qe))throw qe;return qe}function Qz(l){return lt(l).toLowerCase()}function Zz(l){return lt(l).toUpperCase()}function Jz(l,f,g){if(l=lt(l),l&&(g||f===n))return xE(l);if(!l||!(f=Cr(f)))return l;var w=_i(l),k=_i(f),P=_E(w,k),$=wE(w,k)+1;return Vo(w,P,$).join("")}function ej(l,f,g){if(l=lt(l),l&&(g||f===n))return l.slice(0,EE(l)+1);if(!l||!(f=Cr(f)))return l;var w=_i(l),k=wE(w,_i(f))+1;return Vo(w,0,k).join("")}function tj(l,f,g){if(l=lt(l),l&&(g||f===n))return l.replace(Gu,"");if(!l||!(f=Cr(f)))return l;var w=_i(l),k=_E(w,_i(f));return Vo(w,k).join("")}function nj(l,f){var g=U,w=F;if(Dt(f)){var k="separator"in f?f.separator:k;g="length"in f?Ke(f.length):g,w="omission"in f?Cr(f.omission):w}l=lt(l);var P=l.length;if(Ja(l)){var $=_i(l);P=$.length}if(g>=P)return l;var G=g-el(w);if(G<1)return w;var q=$?Vo($,0,G).join(""):l.slice(0,G);if(k===n)return q+w;if($&&(G+=q.length-G),av(k)){if(l.slice(G).search(k)){var le,ue=q;for(k.global||(k=Ey(k.source,lt(wd.exec(k))+"g")),k.lastIndex=0;le=k.exec(ue);)var fe=le.index;q=q.slice(0,fe===n?G:fe)}}else if(l.indexOf(Cr(k),G)!=G){var xe=q.lastIndexOf(k);xe>-1&&(q=q.slice(0,xe))}return q+w}function rj(l){return l=lt(l),l&&eo.test(l)?l.replace(Ya,RF):l}var ij=al(function(l,f,g){return l+(g?" ":"")+f.toUpperCase()}),cv=fS("toUpperCase");function uC(l,f,g){return l=lt(l),f=g?n:f,f===n?AF(l)?PF(l):vF(l):l.match(f)||[]}var cC=Qe(function(l,f){try{return Er(l,n,f)}catch(g){return sv(g)?g:new je(g)}}),oj=oo(function(l,f){return qr(f,function(g){g=zi(g),ro(l,g,iv(l[g],l))}),l});function sj(l){var f=l==null?0:l.length,g=Me();return l=f?Ot(l,function(w){if(typeof w[1]!="function")throw new Yr(s);return[g(w[0]),w[1]]}):[],Qe(function(w){for(var k=-1;++kV)return[];var g=Z,w=Sn(l,Z);f=Me(f),l-=Z;for(var k=_y(w,f);++g0||f<0)?new tt(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),f!==n&&(f=Ke(f),g=f<0?g.dropRight(-f):g.take(f-l)),g)},tt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},tt.prototype.toArray=function(){return this.take(Z)},Bi(tt.prototype,function(l,f){var g=/^(?:filter|find|map|reject)|While$/.test(f),w=/^(?:head|last)$/.test(f),k=D[w?"take"+(f=="last"?"Right":""):f],P=w||/^find/.test(f);k&&(D.prototype[f]=function(){var $=this.__wrapped__,G=w?[1]:arguments,q=$ instanceof tt,le=G[0],ue=q||Ve($),fe=function(Je){var nt=k.apply(D,$o([Je],G));return w&&xe?nt[0]:nt};ue&&g&&typeof le=="function"&&le.length!=1&&(q=ue=!1);var xe=this.__chain__,Ae=!!this.__actions__.length,$e=P&&!xe,qe=q&&!Ae;if(!P&&ue){$=qe?$:new tt(this);var Fe=l.apply($,G);return Fe.__actions__.push({func:np,args:[fe],thisArg:n}),new Xr(Fe,xe)}return $e&&qe?l.apply(this,G):(Fe=this.thru(fe),$e?w?Fe.value()[0]:Fe.value():Fe)})}),qr(["pop","push","shift","sort","splice","unshift"],function(l){var f=Td[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",w=/^(?:pop|shift)$/.test(l);D.prototype[l]=function(){var k=arguments;if(w&&!this.__chain__){var P=this.value();return f.apply(Ve(P)?P:[],k)}return this[g](function($){return f.apply(Ve($)?$:[],k)})}}),Bi(tt.prototype,function(l,f){var g=D[f];if(g){var w=g.name+"";dt.call(il,w)||(il[w]=[]),il[w].push({name:f,func:g})}}),il[Yd(n,y).name]=[{name:"wrapper",func:n}],tt.prototype.clone=rB,tt.prototype.reverse=iB,tt.prototype.value=oB,D.prototype.at=L5,D.prototype.chain=P5,D.prototype.commit=M5,D.prototype.next=$5,D.prototype.plant=B5,D.prototype.reverse=H5,D.prototype.toJSON=D.prototype.valueOf=D.prototype.value=z5,D.prototype.first=D.prototype.head,Xu&&(D.prototype[Xu]=F5),D},tl=MF();zs?((zs.exports=tl)._=tl,dy._=tl):gn._=tl}).call(ra)})(sm,sm.exports);var nq=sm.exports;const ce=Ts(nq),rq=["as","disabled"];function iq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function oq(e){return!e||e.trim()==="#"}function d1({tagName:e,disabled:t,href:n,target:r,rel:i,role:o,onClick:s,tabIndex:a=0,type:u}){e||(n!=null||r!=null||i!=null?e="a":e="button");const c={tagName:e};if(e==="button")return[{type:u||"button",disabled:t},c];const d=h=>{if((t||e==="a"&&oq(n))&&h.preventDefault(),t){h.stopPropagation();return}s==null||s(h)},p=h=>{h.key===" "&&(h.preventDefault(),d(h))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:a,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?i:void 0,onClick:d,onKeyDown:p},c]}const MD=A.forwardRef((e,t)=>{let{as:n,disabled:r}=e,i=iq(e,rq);const[o,{tagName:s}]=d1(Object.assign({tagName:n,disabled:r},i));return S.jsx(s,Object.assign({},i,o,{ref:t}))});MD.displayName="Button";const Rn=A.forwardRef(({as:e,bsPrefix:t,variant:n="primary",size:r,active:i=!1,disabled:o=!1,className:s,...a},u)=>{const c=Be(t,"btn"),[d,{tagName:p}]=d1({tagName:e,disabled:o,...a}),h=p;return S.jsx(h,{...d,...a,ref:u,disabled:o,className:Te(s,c,i&&"active",n&&`${c}-${n}`,r&&`${c}-${r}`,a.href&&o&&"disabled")})});Rn.displayName="Button";const $D=A.forwardRef(({bsPrefix:e,size:t,vertical:n=!1,className:r,role:i="group",as:o="div",...s},a)=>{const u=Be(e,"btn-group");let c=u;return n&&(c=`${u}-vertical`),S.jsx(o,{...s,ref:a,role:i,className:Te(r,c,t&&`${u}-${t}`)})});$D.displayName="ButtonGroup";var Gn="top",Hr="bottom",zr="right",Kn="left",ag="auto",Nu=[Gn,Hr,zr,Kn],Oa="start",mu="end",FD="clippingParents",p1="viewport",Sl="popper",BD="reference",l_=Nu.reduce(function(e,t){return e.concat([t+"-"+Oa,t+"-"+mu])},[]),h1=[].concat(Nu,[ag]).reduce(function(e,t){return e.concat([t,t+"-"+Oa,t+"-"+mu])},[]),HD="beforeRead",zD="read",jD="afterRead",VD="beforeMain",UD="main",WD="afterMain",GD="beforeWrite",KD="write",qD="afterWrite",YD=[HD,zD,jD,VD,UD,WD,GD,KD,qD];function Zi(e){return e?(e.nodeName||"").toLowerCase():null}function jr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ra(e){var t=jr(e).Element;return e instanceof t||e instanceof Element}function fi(e){var t=jr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function m1(e){if(typeof ShadowRoot>"u")return!1;var t=jr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function sq(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!fi(o)||!Zi(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function aq(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(u,c){return u[c]="",u},{});!fi(i)||!Zi(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const g1={name:"applyStyles",enabled:!0,phase:"write",fn:sq,effect:aq,requires:["computeStyles"]};function Qi(e){return e.split("-")[0]}var xa=Math.max,am=Math.min,gu=Math.round;function u_(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function XD(){return!/^((?!chrome|android).)*safari/i.test(u_())}function yu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&fi(e)&&(i=e.offsetWidth>0&&gu(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&gu(r.height)/e.offsetHeight||1);var s=Ra(e)?jr(e):window,a=s.visualViewport,u=!XD()&&n,c=(r.left+(u&&a?a.offsetLeft:0))/i,d=(r.top+(u&&a?a.offsetTop:0))/o,p=r.width/i,h=r.height/o;return{width:p,height:h,top:d,right:c+p,bottom:d+h,left:c,x:c,y:d}}function y1(e){var t=yu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function QD(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&m1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ko(e){return jr(e).getComputedStyle(e)}function lq(e){return["table","td","th"].indexOf(Zi(e))>=0}function Rs(e){return((Ra(e)?e.ownerDocument:e.document)||window.document).documentElement}function lg(e){return Zi(e)==="html"?e:e.assignedSlot||e.parentNode||(m1(e)?e.host:null)||Rs(e)}function _A(e){return!fi(e)||ko(e).position==="fixed"?null:e.offsetParent}function uq(e){var t=/firefox/i.test(u_()),n=/Trident/i.test(u_());if(n&&fi(e)){var r=ko(e);if(r.position==="fixed")return null}var i=lg(e);for(m1(i)&&(i=i.host);fi(i)&&["html","body"].indexOf(Zi(i))<0;){var o=ko(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function nd(e){for(var t=jr(e),n=_A(e);n&&lq(n)&&ko(n).position==="static";)n=_A(n);return n&&(Zi(n)==="html"||Zi(n)==="body"&&ko(n).position==="static")?t:n||uq(e)||t}function v1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function rf(e,t,n){return xa(e,am(t,n))}function cq(e,t,n){var r=rf(e,t,n);return r>n?n:r}function ZD(){return{top:0,right:0,bottom:0,left:0}}function JD(e){return Object.assign({},ZD(),e)}function eL(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var fq=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,JD(typeof t!="number"?t:eL(t,Nu))};function dq(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Qi(n.placement),u=v1(a),c=[Kn,zr].indexOf(a)>=0,d=c?"height":"width";if(!(!o||!s)){var p=fq(i.padding,n),h=y1(o),m=u==="y"?Gn:Kn,v=u==="y"?Hr:zr,x=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],b=s[u]-n.rects.reference[u],y=nd(o),_=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,E=x/2-b/2,C=p[m],T=_-h[d]-p[v],I=_/2-h[d]/2+E,O=rf(C,I,T),M=u;n.modifiersData[r]=(t={},t[M]=O,t.centerOffset=O-I,t)}}function pq(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||QD(t.elements.popper,i)&&(t.elements.arrow=i))}const x1={name:"arrow",enabled:!0,phase:"main",fn:dq,effect:pq,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vu(e){return e.split("-")[1]}var hq={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mq(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:gu(n*i)/i||0,y:gu(r*i)/i||0}}function wA(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=s.x,m=h===void 0?0:h,v=s.y,x=v===void 0?0:v,b=typeof d=="function"?d({x:m,y:x}):{x:m,y:x};m=b.x,x=b.y;var y=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),E=Kn,C=Gn,T=window;if(c){var I=nd(n),O="clientHeight",M="clientWidth";if(I===jr(n)&&(I=Rs(n),ko(I).position!=="static"&&a==="absolute"&&(O="scrollHeight",M="scrollWidth")),I=I,i===Gn||(i===Kn||i===zr)&&o===mu){C=Hr;var z=p&&I===T&&T.visualViewport?T.visualViewport.height:I[O];x-=z-r.height,x*=u?1:-1}if(i===Kn||(i===Gn||i===Hr)&&o===mu){E=zr;var U=p&&I===T&&T.visualViewport?T.visualViewport.width:I[M];m-=U-r.width,m*=u?1:-1}}var F=Object.assign({position:a},c&&hq),W=d===!0?mq({x:m,y:x},jr(n)):{x:m,y:x};if(m=W.x,x=W.y,u){var Y;return Object.assign({},F,(Y={},Y[C]=_?"0":"",Y[E]=y?"0":"",Y.transform=(T.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",Y))}return Object.assign({},F,(t={},t[C]=_?x+"px":"",t[E]=y?m+"px":"",t.transform="",t))}function gq(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,u=a===void 0?!0:a,c={placement:Qi(t.placement),variation:vu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wA(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wA(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ug={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gq,data:{}};var $p={passive:!0};function yq(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,u=jr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(d){d.addEventListener("scroll",n.update,$p)}),a&&u.addEventListener("resize",n.update,$p),function(){o&&c.forEach(function(d){d.removeEventListener("scroll",n.update,$p)}),a&&u.removeEventListener("resize",n.update,$p)}}const cg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yq,data:{}};var vq={left:"right",right:"left",bottom:"top",top:"bottom"};function gh(e){return e.replace(/left|right|bottom|top/g,function(t){return vq[t]})}var xq={start:"end",end:"start"};function bA(e){return e.replace(/start|end/g,function(t){return xq[t]})}function _1(e){var t=jr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function w1(e){return yu(Rs(e)).left+_1(e).scrollLeft}function _q(e,t){var n=jr(e),r=Rs(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;var c=XD();(c||!c&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a+w1(e),y:u}}function wq(e){var t,n=Rs(e),r=_1(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=xa(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=xa(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+w1(e),u=-r.scrollTop;return ko(i||n).direction==="rtl"&&(a+=xa(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:u}}function b1(e){var t=ko(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function tL(e){return["html","body","#document"].indexOf(Zi(e))>=0?e.ownerDocument.body:fi(e)&&b1(e)?e:tL(lg(e))}function of(e,t){var n;t===void 0&&(t=[]);var r=tL(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=jr(r),s=i?[o].concat(o.visualViewport||[],b1(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(of(lg(s)))}function c_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function bq(e,t){var n=yu(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function EA(e,t,n){return t===p1?c_(_q(e,n)):Ra(t)?bq(t,n):c_(wq(Rs(e)))}function Eq(e){var t=of(lg(e)),n=["absolute","fixed"].indexOf(ko(e).position)>=0,r=n&&fi(e)?nd(e):e;return Ra(r)?t.filter(function(i){return Ra(i)&&QD(i,r)&&Zi(i)!=="body"}):[]}function Sq(e,t,n,r){var i=t==="clippingParents"?Eq(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(u,c){var d=EA(e,c,r);return u.top=xa(d.top,u.top),u.right=am(d.right,u.right),u.bottom=am(d.bottom,u.bottom),u.left=xa(d.left,u.left),u},EA(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function nL(e){var t=e.reference,n=e.element,r=e.placement,i=r?Qi(r):null,o=r?vu(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,u;switch(i){case Gn:u={x:s,y:t.y-n.height};break;case Hr:u={x:s,y:t.y+t.height};break;case zr:u={x:t.x+t.width,y:a};break;case Kn:u={x:t.x-n.width,y:a};break;default:u={x:t.x,y:t.y}}var c=i?v1(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case Oa:u[c]=u[c]-(t[d]/2-n[d]/2);break;case mu:u[c]=u[c]+(t[d]/2-n[d]/2);break}}return u}function xu(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,u=a===void 0?FD:a,c=n.rootBoundary,d=c===void 0?p1:c,p=n.elementContext,h=p===void 0?Sl:p,m=n.altBoundary,v=m===void 0?!1:m,x=n.padding,b=x===void 0?0:x,y=JD(typeof b!="number"?b:eL(b,Nu)),_=h===Sl?BD:Sl,E=e.rects.popper,C=e.elements[v?_:h],T=Sq(Ra(C)?C:C.contextElement||Rs(e.elements.popper),u,d,s),I=yu(e.elements.reference),O=nL({reference:I,element:E,strategy:"absolute",placement:i}),M=c_(Object.assign({},E,O)),z=h===Sl?M:I,U={top:T.top-z.top+y.top,bottom:z.bottom-T.bottom+y.bottom,left:T.left-z.left+y.left,right:z.right-T.right+y.right},F=e.modifiersData.offset;if(h===Sl&&F){var W=F[i];Object.keys(U).forEach(function(Y){var L=[zr,Hr].indexOf(Y)>=0?1:-1,B=[Gn,Hr].indexOf(Y)>=0?"y":"x";U[Y]+=W[B]*L})}return U}function Cq(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?h1:u,d=vu(r),p=d?a?l_:l_.filter(function(v){return vu(v)===d}):Nu,h=p.filter(function(v){return c.indexOf(v)>=0});h.length===0&&(h=p);var m=h.reduce(function(v,x){return v[x]=xu(e,{placement:x,boundary:i,rootBoundary:o,padding:s})[Qi(x)],v},{});return Object.keys(m).sort(function(v,x){return m[v]-m[x]})}function Iq(e){if(Qi(e)===ag)return[];var t=gh(e);return[bA(e),t,bA(t)]}function Aq(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.flipVariations,v=m===void 0?!0:m,x=n.allowedAutoPlacements,b=t.options.placement,y=Qi(b),_=y===b,E=u||(_||!v?[gh(b)]:Iq(b)),C=[b].concat(E).reduce(function(ee,re){return ee.concat(Qi(re)===ag?Cq(t,{placement:re,boundary:d,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:x}):re)},[]),T=t.rects.reference,I=t.rects.popper,O=new Map,M=!0,z=C[0],U=0;U=0,B=L?"width":"height",j=xu(t,{placement:F,boundary:d,rootBoundary:p,altBoundary:h,padding:c}),X=L?Y?zr:Kn:Y?Hr:Gn;T[B]>I[B]&&(X=gh(X));var V=gh(X),H=[];if(o&&H.push(j[W]<=0),a&&H.push(j[X]<=0,j[V]<=0),H.every(function(ee){return ee})){z=F,M=!1;break}O.set(F,H)}if(M)for(var N=v?3:1,Z=function(re){var oe=C.find(function(pe){var ye=O.get(pe);if(ye)return ye.slice(0,re).every(function(_e){return _e})});if(oe)return z=oe,"break"},te=N;te>0;te--){var R=Z(te);if(R==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const E1={name:"flip",enabled:!0,phase:"main",fn:Aq,requiresIfExists:["offset"],data:{_skip:!1}};function SA(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function CA(e){return[Gn,zr,Hr,Kn].some(function(t){return e[t]>=0})}function Tq(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=xu(t,{elementContext:"reference"}),a=xu(t,{altBoundary:!0}),u=SA(s,r),c=SA(a,i,o),d=CA(u),p=CA(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const S1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Tq};function kq(e,t,n){var r=Qi(e),i=[Kn,Gn].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Kn,zr].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Nq(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=h1.reduce(function(d,p){return d[p]=kq(p,t.rects,o),d},{}),a=s[t.placement],u=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const C1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Nq};function Oq(e){var t=e.state,n=e.name;t.modifiersData[n]=nL({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const fg={name:"popperOffsets",enabled:!0,phase:"read",fn:Oq,data:{}};function Rq(e){return e==="x"?"y":"x"}function Dq(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,p=n.padding,h=n.tether,m=h===void 0?!0:h,v=n.tetherOffset,x=v===void 0?0:v,b=xu(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:d}),y=Qi(t.placement),_=vu(t.placement),E=!_,C=v1(y),T=Rq(C),I=t.modifiersData.popperOffsets,O=t.rects.reference,M=t.rects.popper,z=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,U=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(I){if(o){var Y,L=C==="y"?Gn:Kn,B=C==="y"?Hr:zr,j=C==="y"?"height":"width",X=I[C],V=X+b[L],H=X-b[B],N=m?-M[j]/2:0,Z=_===Oa?O[j]:M[j],te=_===Oa?-M[j]:-O[j],R=t.elements.arrow,ee=m&&R?y1(R):{width:0,height:0},re=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ZD(),oe=re[L],pe=re[B],ye=rf(0,O[j],ee[j]),_e=E?O[j]/2-N-ye-oe-U.mainAxis:Z-ye-oe-U.mainAxis,Se=E?-O[j]/2+N+ye+pe+U.mainAxis:te+ye+pe+U.mainAxis,We=t.elements.arrow&&nd(t.elements.arrow),Re=We?C==="y"?We.clientTop||0:We.clientLeft||0:0,De=(Y=F==null?void 0:F[C])!=null?Y:0,He=X+_e-De-Re,Ie=X+Se-De,rt=rf(m?am(V,He):V,X,m?xa(H,Ie):H);I[C]=rt,W[C]=rt-X}if(a){var Pe,we=C==="x"?Gn:Kn,mt=C==="x"?Hr:zr,gt=I[T],yt=T==="y"?"height":"width",Zt=gt+b[we],an=gt-b[mt],qt=[Gn,Kn].indexOf(y)!==-1,ie=(Pe=F==null?void 0:F[T])!=null?Pe:0,ae=qt?Zt:gt-O[yt]-M[yt]-ie+U.altAxis,be=qt?gt+O[yt]+M[yt]-ie-U.altAxis:an,Oe=m&&qt?cq(ae,gt,be):rf(m?ae:Zt,gt,m?be:an);I[T]=Oe,W[T]=Oe-gt}t.modifiersData[r]=W}}const I1={name:"preventOverflow",enabled:!0,phase:"main",fn:Dq,requiresIfExists:["offset"]};function Lq(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Pq(e){return e===jr(e)||!fi(e)?_1(e):Lq(e)}function Mq(e){var t=e.getBoundingClientRect(),n=gu(t.width)/e.offsetWidth||1,r=gu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function $q(e,t,n){n===void 0&&(n=!1);var r=fi(t),i=fi(t)&&Mq(t),o=Rs(t),s=yu(e,i,n),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Zi(t)!=="body"||b1(o))&&(a=Pq(t)),fi(t)?(u=yu(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=w1(o))),{x:s.left+a.scrollLeft-u.x,y:s.top+a.scrollTop-u.y,width:s.width,height:s.height}}function Fq(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var u=t.get(a);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Bq(e){var t=Fq(e);return YD.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Hq(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function zq(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var IA={placement:"bottom",modifiers:[],strategy:"absolute"};function AA(){for(var e=arguments.length,t=new Array(e),n=0;n(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(t,n)=>`#${CSS.escape(n)}`)),e),qq=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),Yq=e=>{do e+=Math.floor(Math.random()*Gq);while(document.getElementById(e));return e},Xq=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const r=Number.parseFloat(t),i=Number.parseFloat(n);return!r&&!i?0:(t=t.split(",")[0],n=n.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(n))*Kq)},oL=e=>{e.dispatchEvent(new Event(f_))},_o=e=>!e||typeof e!="object"?!1:(typeof e.jquery<"u"&&(e=e[0]),typeof e.nodeType<"u"),Cs=e=>_o(e)?e.jquery?e[0]:e:typeof e=="string"&&e.length>0?document.querySelector(iL(e)):null,Ou=e=>{if(!_o(e)||e.getClientRects().length===0)return!1;const t=getComputedStyle(e).getPropertyValue("visibility")==="visible",n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const r=e.closest("summary");if(r&&r.parentNode!==n||r===null)return!1}return t},Is=e=>!e||e.nodeType!==Node.ELEMENT_NODE||e.classList.contains("disabled")?!0:typeof e.disabled<"u"?e.disabled:e.hasAttribute("disabled")&&e.getAttribute("disabled")!=="false",sL=e=>{if(!document.documentElement.attachShadow)return null;if(typeof e.getRootNode=="function"){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?sL(e.parentNode):null},lm=()=>{},id=e=>{e.offsetHeight},aL=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,n0=[],Qq=e=>{document.readyState==="loading"?(n0.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of n0)t()}),n0.push(e)):e()},mi=()=>document.documentElement.dir==="rtl",vi=e=>{Qq(()=>{const t=aL();if(t){const n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}})},pr=(e,t=[],n=e)=>typeof e=="function"?e(...t):n,lL=(e,t,n=!0)=>{if(!n){pr(e);return}const i=Xq(t)+5;let o=!1;const s=({target:a})=>{a===t&&(o=!0,t.removeEventListener(f_,s),pr(e))};t.addEventListener(f_,s),setTimeout(()=>{o||oL(t)},i)},T1=(e,t,n,r)=>{const i=e.length;let o=e.indexOf(t);return o===-1?!n&&r?e[i-1]:e[0]:(o+=n?1:-1,r&&(o=(o+i)%i),e[Math.max(0,Math.min(o,i-1))])},Zq=/[^.]*(?=\..*)\.|.*/,Jq=/\..*/,eY=/::\d+$/,r0={};let TA=1;const uL={mouseenter:"mouseover",mouseleave:"mouseout"},tY=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function cL(e,t){return t&&`${t}::${TA++}`||e.uidEvent||TA++}function fL(e){const t=cL(e);return e.uidEvent=t,r0[t]=r0[t]||{},r0[t]}function nY(e,t){return function n(r){return k1(r,{delegateTarget:e}),n.oneOff&&de.off(e,r.type,t),t.apply(e,[r])}}function rY(e,t,n){return function r(i){const o=e.querySelectorAll(t);for(let{target:s}=i;s&&s!==this;s=s.parentNode)for(const a of o)if(a===s)return k1(i,{delegateTarget:s}),r.oneOff&&de.off(e,i.type,t,n),n.apply(s,[i])}}function dL(e,t,n=null){return Object.values(e).find(r=>r.callable===t&&r.delegationSelector===n)}function pL(e,t,n){const r=typeof t=="string",i=r?n:t||n;let o=hL(e);return tY.has(o)||(o=e),[r,i,o]}function kA(e,t,n,r,i){if(typeof t!="string"||!e)return;let[o,s,a]=pL(t,n,r);t in uL&&(s=(v=>function(x){if(!x.relatedTarget||x.relatedTarget!==x.delegateTarget&&!x.delegateTarget.contains(x.relatedTarget))return v.call(this,x)})(s));const u=fL(e),c=u[a]||(u[a]={}),d=dL(c,s,o?n:null);if(d){d.oneOff=d.oneOff&&i;return}const p=cL(s,t.replace(Zq,"")),h=o?rY(e,n,s):nY(e,s);h.delegationSelector=o?n:null,h.callable=s,h.oneOff=i,h.uidEvent=p,c[p]=h,e.addEventListener(a,h,o)}function d_(e,t,n,r,i){const o=dL(t[n],r,i);o&&(e.removeEventListener(n,o,!!i),delete t[n][o.uidEvent])}function iY(e,t,n,r){const i=t[n]||{};for(const[o,s]of Object.entries(i))o.includes(r)&&d_(e,t,n,s.callable,s.delegationSelector)}function hL(e){return e=e.replace(Jq,""),uL[e]||e}const de={on(e,t,n,r){kA(e,t,n,r,!1)},one(e,t,n,r){kA(e,t,n,r,!0)},off(e,t,n,r){if(typeof t!="string"||!e)return;const[i,o,s]=pL(t,n,r),a=s!==t,u=fL(e),c=u[s]||{},d=t.startsWith(".");if(typeof o<"u"){if(!Object.keys(c).length)return;d_(e,u,s,o,i?n:null);return}if(d)for(const p of Object.keys(u))iY(e,u,p,t.slice(1));for(const[p,h]of Object.entries(c)){const m=p.replace(eY,"");(!a||t.includes(m))&&d_(e,u,s,h.callable,h.delegationSelector)}},trigger(e,t,n){if(typeof t!="string"||!e)return null;const r=aL(),i=hL(t),o=t!==i;let s=null,a=!0,u=!0,c=!1;o&&r&&(s=r.Event(t,n),r(e).trigger(s),a=!s.isPropagationStopped(),u=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());const d=k1(new Event(t,{bubbles:a,cancelable:!0}),n);return c&&d.preventDefault(),u&&e.dispatchEvent(d),d.defaultPrevented&&s&&s.preventDefault(),d}};function k1(e,t={}){for(const[n,r]of Object.entries(t))try{e[n]=r}catch{Object.defineProperty(e,n,{configurable:!0,get(){return r}})}return e}function NA(e){if(e==="true")return!0;if(e==="false")return!1;if(e===Number(e).toString())return Number(e);if(e===""||e==="null")return null;if(typeof e!="string")return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function i0(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const wo={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${i0(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${i0(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of n){let i=r.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),t[i]=NA(e.dataset[r])}return t},getDataAttribute(e,t){return NA(e.getAttribute(`data-bs-${i0(t)}`))}};class od{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,n){const r=_o(n)?wo.getDataAttribute(n,"config"):{};return{...this.constructor.Default,...typeof r=="object"?r:{},..._o(n)?wo.getDataAttributes(n):{},...typeof t=="object"?t:{}}}_typeCheckConfig(t,n=this.constructor.DefaultType){for(const[r,i]of Object.entries(n)){const o=t[r],s=_o(o)?"element":qq(o);if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${i}".`)}}}const oY="5.3.3";class $i extends od{constructor(t,n){super(),t=Cs(t),t&&(this._element=t,this._config=this._getConfig(n),t0.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t0.remove(this._element,this.constructor.DATA_KEY),de.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,n,r=!0){lL(t,n,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return t0.get(Cs(t),this.DATA_KEY)}static getOrCreateInstance(t,n={}){return this.getInstance(t)||new this(t,typeof n=="object"?n:null)}static get VERSION(){return oY}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const o0=e=>{let t=e.getAttribute("data-bs-target");if(!t||t==="#"){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&n!=="#"?n.trim():null}return t?t.split(",").map(n=>iL(n)).join(","):null},Le={find(e,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e,t=document.documentElement){return Element.prototype.querySelector.call(t,e)},children(e,t){return[].concat(...e.children).filter(n=>n.matches(t))},parents(e,t){const n=[];let r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(n=>`${n}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(n=>!Is(n)&&Ou(n))},getSelectorFromElement(e){const t=o0(e);return t&&Le.findOne(t)?t:null},getElementFromSelector(e){const t=o0(e);return t?Le.findOne(t):null},getMultipleElementsFromSelector(e){const t=o0(e);return t?Le.find(t):[]}},dg=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;de.on(document,n,`[data-bs-dismiss="${r}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Is(this))return;const o=Le.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(o)[t]()})},sY="alert",aY="bs.alert",mL=`.${aY}`,lY=`close${mL}`,uY=`closed${mL}`,cY="fade",fY="show";let gL=class yL extends $i{static get NAME(){return sY}close(){if(de.trigger(this._element,lY).defaultPrevented)return;this._element.classList.remove(fY);const n=this._element.classList.contains(cY);this._queueCallback(()=>this._destroyElement(),this._element,n)}_destroyElement(){this._element.remove(),de.trigger(this._element,uY),this.dispose()}static jQueryInterface(t){return this.each(function(){const n=yL.getOrCreateInstance(this);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};dg(gL,"close");vi(gL);const dY="button",pY="bs.button",hY=`.${pY}`,mY=".data-api",gY="active",OA='[data-bs-toggle="button"]',yY=`click${hY}${mY}`;let vL=class xL extends $i{static get NAME(){return dY}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(gY))}static jQueryInterface(t){return this.each(function(){const n=xL.getOrCreateInstance(this);t==="toggle"&&n[t]()})}};de.on(document,yY,OA,e=>{e.preventDefault();const t=e.target.closest(OA);vL.getOrCreateInstance(t).toggle()});vi(vL);const vY="swipe",Ru=".bs.swipe",xY=`touchstart${Ru}`,_Y=`touchmove${Ru}`,wY=`touchend${Ru}`,bY=`pointerdown${Ru}`,EY=`pointerup${Ru}`,SY="touch",CY="pen",IY="pointer-event",AY=40,TY={endCallback:null,leftCallback:null,rightCallback:null},kY={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class um extends od{constructor(t,n){super(),this._element=t,!(!t||!um.isSupported())&&(this._config=this._getConfig(n),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return TY}static get DefaultType(){return kY}static get NAME(){return vY}dispose(){de.off(this._element,Ru)}_start(t){if(!this._supportPointerEvents){this._deltaX=t.touches[0].clientX;return}this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX)}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),pr(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=AY)return;const n=t/this._deltaX;this._deltaX=0,n&&pr(n>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(de.on(this._element,bY,t=>this._start(t)),de.on(this._element,EY,t=>this._end(t)),this._element.classList.add(IY)):(de.on(this._element,xY,t=>this._start(t)),de.on(this._element,_Y,t=>this._move(t)),de.on(this._element,wY,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&(t.pointerType===CY||t.pointerType===SY)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const NY="carousel",OY="bs.carousel",Ds=`.${OY}`,_L=".data-api",RY="ArrowLeft",DY="ArrowRight",LY=500,Sc="next",vl="prev",Cl="left",yh="right",PY=`slide${Ds}`,s0=`slid${Ds}`,MY=`keydown${Ds}`,$Y=`mouseenter${Ds}`,FY=`mouseleave${Ds}`,BY=`dragstart${Ds}`,HY=`load${Ds}${_L}`,zY=`click${Ds}${_L}`,wL="carousel",Fp="active",jY="slide",VY="carousel-item-end",UY="carousel-item-start",WY="carousel-item-next",GY="carousel-item-prev",bL=".active",EL=".carousel-item",KY=bL+EL,qY=".carousel-item img",YY=".carousel-indicators",XY="[data-bs-slide], [data-bs-slide-to]",QY='[data-bs-ride="carousel"]',ZY={[RY]:yh,[DY]:Cl},JY={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},eX={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class sd extends $i{constructor(t,n){super(t,n),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Le.findOne(YY,this._element),this._addEventListeners(),this._config.ride===wL&&this.cycle()}static get Default(){return JY}static get DefaultType(){return eX}static get NAME(){return NY}next(){this._slide(Sc)}nextWhenVisible(){!document.hidden&&Ou(this._element)&&this.next()}prev(){this._slide(vl)}pause(){this._isSliding&&oL(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){de.one(this._element,s0,()=>this.cycle());return}this.cycle()}}to(t){const n=this._getItems();if(t>n.length-1||t<0)return;if(this._isSliding){de.one(this._element,s0,()=>this.to(t));return}const r=this._getItemIndex(this._getActive());if(r===t)return;const i=t>r?Sc:vl;this._slide(i,n[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&de.on(this._element,MY,t=>this._keydown(t)),this._config.pause==="hover"&&(de.on(this._element,$Y,()=>this.pause()),de.on(this._element,FY,()=>this._maybeEnableCycle())),this._config.touch&&um.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of Le.find(qY,this._element))de.on(r,BY,i=>i.preventDefault());const n={leftCallback:()=>this._slide(this._directionToOrder(Cl)),rightCallback:()=>this._slide(this._directionToOrder(yh)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),LY+this._config.interval))}};this._swipeHelper=new um(this._element,n)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const n=ZY[t.key];n&&(t.preventDefault(),this._slide(this._directionToOrder(n)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const n=Le.findOne(bL,this._indicatorsElement);n.classList.remove(Fp),n.removeAttribute("aria-current");const r=Le.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);r&&(r.classList.add(Fp),r.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const n=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=n||this._config.defaultInterval}_slide(t,n=null){if(this._isSliding)return;const r=this._getActive(),i=t===Sc,o=n||T1(this._getItems(),r,i,this._config.wrap);if(o===r)return;const s=this._getItemIndex(o),a=m=>de.trigger(this._element,m,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(r),to:s});if(a(PY).defaultPrevented||!r||!o)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;const d=i?UY:VY,p=i?WY:GY;o.classList.add(p),id(o),r.classList.add(d),o.classList.add(d);const h=()=>{o.classList.remove(d,p),o.classList.add(Fp),r.classList.remove(Fp,p,d),this._isSliding=!1,a(s0)};this._queueCallback(h,r,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(jY)}_getActive(){return Le.findOne(KY,this._element)}_getItems(){return Le.find(EL,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return mi()?t===Cl?vl:Sc:t===Cl?Sc:vl}_orderToDirection(t){return mi()?t===vl?Cl:yh:t===vl?yh:Cl}static jQueryInterface(t){return this.each(function(){const n=sd.getOrCreateInstance(this,t);if(typeof t=="number"){n.to(t);return}if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(document,zY,XY,function(e){const t=Le.getElementFromSelector(this);if(!t||!t.classList.contains(wL))return;e.preventDefault();const n=sd.getOrCreateInstance(t),r=this.getAttribute("data-bs-slide-to");if(r){n.to(r),n._maybeEnableCycle();return}if(wo.getDataAttribute(this,"slide")==="next"){n.next(),n._maybeEnableCycle();return}n.prev(),n._maybeEnableCycle()});de.on(window,HY,()=>{const e=Le.find(QY);for(const t of e)sd.getOrCreateInstance(t)});vi(sd);const tX="collapse",nX="bs.collapse",ad=`.${nX}`,rX=".data-api",iX=`show${ad}`,oX=`shown${ad}`,sX=`hide${ad}`,aX=`hidden${ad}`,lX=`click${ad}${rX}`,a0="show",jl="collapse",Bp="collapsing",uX="collapsed",cX=`:scope .${jl} .${jl}`,fX="collapse-horizontal",dX="width",pX="height",hX=".collapse.show, .collapse.collapsing",p_='[data-bs-toggle="collapse"]',mX={parent:null,toggle:!0},gX={parent:"(null|element)",toggle:"boolean"};let SL=class h_ extends $i{constructor(t,n){super(t,n),this._isTransitioning=!1,this._triggerArray=[];const r=Le.find(p_);for(const i of r){const o=Le.getSelectorFromElement(i),s=Le.find(o).filter(a=>a===this._element);o!==null&&s.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return mX}static get DefaultType(){return gX}static get NAME(){return tX}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(hX).filter(a=>a!==this._element).map(a=>h_.getOrCreateInstance(a,{toggle:!1}))),t.length&&t[0]._isTransitioning||de.trigger(this._element,iX).defaultPrevented)return;for(const a of t)a.hide();const r=this._getDimension();this._element.classList.remove(jl),this._element.classList.add(Bp),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(Bp),this._element.classList.add(jl,a0),this._element.style[r]="",de.trigger(this._element,oX)},s=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(i,this._element,!0),this._element.style[r]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||de.trigger(this._element,sX).defaultPrevented)return;const n=this._getDimension();this._element.style[n]=`${this._element.getBoundingClientRect()[n]}px`,id(this._element),this._element.classList.add(Bp),this._element.classList.remove(jl,a0);for(const i of this._triggerArray){const o=Le.getElementFromSelector(i);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(Bp),this._element.classList.add(jl),de.trigger(this._element,aX)};this._element.style[n]="",this._queueCallback(r,this._element,!0)}_isShown(t=this._element){return t.classList.contains(a0)}_configAfterMerge(t){return t.toggle=!!t.toggle,t.parent=Cs(t.parent),t}_getDimension(){return this._element.classList.contains(fX)?dX:pX}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(p_);for(const n of t){const r=Le.getElementFromSelector(n);r&&this._addAriaAndCollapsedClass([n],this._isShown(r))}}_getFirstLevelChildren(t){const n=Le.find(cX,this._config.parent);return Le.find(t,this._config.parent).filter(r=>!n.includes(r))}_addAriaAndCollapsedClass(t,n){if(t.length)for(const r of t)r.classList.toggle(uX,!n),r.setAttribute("aria-expanded",n)}static jQueryInterface(t){const n={};return typeof t=="string"&&/show|hide/.test(t)&&(n.toggle=!1),this.each(function(){const r=h_.getOrCreateInstance(this,n);if(typeof t=="string"){if(typeof r[t]>"u")throw new TypeError(`No method named "${t}"`);r[t]()}})}};de.on(document,lX,p_,function(e){(e.target.tagName==="A"||e.delegateTarget&&e.delegateTarget.tagName==="A")&&e.preventDefault();for(const t of Le.getMultipleElementsFromSelector(this))SL.getOrCreateInstance(t,{toggle:!1}).toggle()});vi(SL);const RA="dropdown",yX="bs.dropdown",Ba=`.${yX}`,N1=".data-api",vX="Escape",DA="Tab",xX="ArrowUp",LA="ArrowDown",_X=2,wX=`hide${Ba}`,bX=`hidden${Ba}`,EX=`show${Ba}`,SX=`shown${Ba}`,CL=`click${Ba}${N1}`,IL=`keydown${Ba}${N1}`,CX=`keyup${Ba}${N1}`,Il="show",IX="dropup",AX="dropend",TX="dropstart",kX="dropup-center",NX="dropdown-center",da='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',OX=`${da}.${Il}`,vh=".dropdown-menu",RX=".navbar",DX=".navbar-nav",LX=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",PX=mi()?"top-end":"top-start",MX=mi()?"top-start":"top-end",$X=mi()?"bottom-end":"bottom-start",FX=mi()?"bottom-start":"bottom-end",BX=mi()?"left-start":"right-start",HX=mi()?"right-start":"left-start",zX="top",jX="bottom",VX={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},UX={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};let Du=class xh extends $i{constructor(t,n){super(t,n),this._popper=null,this._parent=this._element.parentNode,this._menu=Le.next(this._element,vh)[0]||Le.prev(this._element,vh)[0]||Le.findOne(vh,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return VX}static get DefaultType(){return UX}static get NAME(){return RA}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Is(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!de.trigger(this._element,EX,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(DX))for(const r of[].concat(...document.body.children))de.on(r,"mouseover",lm);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Il),this._element.classList.add(Il),de.trigger(this._element,SX,t)}}hide(){if(Is(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!de.trigger(this._element,wX,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))de.off(r,"mouseover",lm);this._popper&&this._popper.destroy(),this._menu.classList.remove(Il),this._element.classList.remove(Il),this._element.setAttribute("aria-expanded","false"),wo.removeDataAttribute(this._menu,"popper"),de.trigger(this._element,bX,t)}}_getConfig(t){if(t=super._getConfig(t),typeof t.reference=="object"&&!_o(t.reference)&&typeof t.reference.getBoundingClientRect!="function")throw new TypeError(`${RA.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(typeof rL>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;this._config.reference==="parent"?t=this._parent:_o(this._config.reference)?t=Cs(this._config.reference):typeof this._config.reference=="object"&&(t=this._config.reference);const n=this._getPopperConfig();this._popper=A1(t,this._menu,n)}_isShown(){return this._menu.classList.contains(Il)}_getPlacement(){const t=this._parent;if(t.classList.contains(AX))return BX;if(t.classList.contains(TX))return HX;if(t.classList.contains(kX))return zX;if(t.classList.contains(NX))return jX;const n=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return t.classList.contains(IX)?n?MX:PX:n?FX:$X}_detectNavbar(){return this._element.closest(RX)!==null}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(n=>Number.parseInt(n,10)):typeof t=="function"?n=>t(n,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(wo.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...pr(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:n}){const r=Le.find(LX,this._menu).filter(i=>Ou(i));r.length&&T1(r,n,t===LA,!r.includes(n)).focus()}static jQueryInterface(t){return this.each(function(){const n=xh.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}static clearMenus(t){if(t.button===_X||t.type==="keyup"&&t.key!==DA)return;const n=Le.find(OX);for(const r of n){const i=xh.getInstance(r);if(!i||i._config.autoClose===!1)continue;const o=t.composedPath(),s=o.includes(i._menu);if(o.includes(i._element)||i._config.autoClose==="inside"&&!s||i._config.autoClose==="outside"&&s||i._menu.contains(t.target)&&(t.type==="keyup"&&t.key===DA||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const a={relatedTarget:i._element};t.type==="click"&&(a.clickEvent=t),i._completeHide(a)}}static dataApiKeydownHandler(t){const n=/input|textarea/i.test(t.target.tagName),r=t.key===vX,i=[xX,LA].includes(t.key);if(!i&&!r||n&&!r)return;t.preventDefault();const o=this.matches(da)?this:Le.prev(this,da)[0]||Le.next(this,da)[0]||Le.findOne(da,t.delegateTarget.parentNode),s=xh.getOrCreateInstance(o);if(i){t.stopPropagation(),s.show(),s._selectMenuItem(t);return}s._isShown()&&(t.stopPropagation(),s.hide(),o.focus())}};de.on(document,IL,da,Du.dataApiKeydownHandler);de.on(document,IL,vh,Du.dataApiKeydownHandler);de.on(document,CL,Du.clearMenus);de.on(document,CX,Du.clearMenus);de.on(document,CL,da,function(e){e.preventDefault(),Du.getOrCreateInstance(this).toggle()});vi(Du);const AL="backdrop",WX="fade",PA="show",MA=`mousedown.bs.${AL}`,GX={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},KX={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class TL extends od{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return GX}static get DefaultType(){return KX}static get NAME(){return AL}show(t){if(!this._config.isVisible){pr(t);return}this._append();const n=this._getElement();this._config.isAnimated&&id(n),n.classList.add(PA),this._emulateAnimation(()=>{pr(t)})}hide(t){if(!this._config.isVisible){pr(t);return}this._getElement().classList.remove(PA),this._emulateAnimation(()=>{this.dispose(),pr(t)})}dispose(){this._isAppended&&(de.off(this._element,MA),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add(WX),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Cs(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),de.on(t,MA,()=>{pr(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){lL(t,this._getElement(),this._config.isAnimated)}}const qX="focustrap",YX="bs.focustrap",cm=`.${YX}`,XX=`focusin${cm}`,QX=`keydown.tab${cm}`,ZX="Tab",JX="forward",$A="backward",eQ={autofocus:!0,trapElement:null},tQ={autofocus:"boolean",trapElement:"element"};class kL extends od{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return eQ}static get DefaultType(){return tQ}static get NAME(){return qX}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),de.off(document,cm),de.on(document,XX,t=>this._handleFocusin(t)),de.on(document,QX,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,de.off(document,cm))}_handleFocusin(t){const{trapElement:n}=this._config;if(t.target===document||t.target===n||n.contains(t.target))return;const r=Le.focusableChildren(n);r.length===0?n.focus():this._lastTabNavDirection===$A?r[r.length-1].focus():r[0].focus()}_handleKeydown(t){t.key===ZX&&(this._lastTabNavDirection=t.shiftKey?$A:JX)}}const FA=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",BA=".sticky-top",Hp="padding-right",HA="margin-right";class m_{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Hp,n=>n+t),this._setElementAttributes(FA,Hp,n=>n+t),this._setElementAttributes(BA,HA,n=>n-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Hp),this._resetElementAttributes(FA,Hp),this._resetElementAttributes(BA,HA)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,n,r){const i=this.getWidth(),o=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+i)return;this._saveInitialAttribute(s,n);const a=window.getComputedStyle(s).getPropertyValue(n);s.style.setProperty(n,`${r(Number.parseFloat(a))}px`)};this._applyManipulationCallback(t,o)}_saveInitialAttribute(t,n){const r=t.style.getPropertyValue(n);r&&wo.setDataAttribute(t,n,r)}_resetElementAttributes(t,n){const r=i=>{const o=wo.getDataAttribute(i,n);if(o===null){i.style.removeProperty(n);return}wo.removeDataAttribute(i,n),i.style.setProperty(n,o)};this._applyManipulationCallback(t,r)}_applyManipulationCallback(t,n){if(_o(t)){n(t);return}for(const r of Le.find(t,this._element))n(r)}}const nQ="modal",rQ="bs.modal",gi=`.${rQ}`,iQ=".data-api",oQ="Escape",sQ=`hide${gi}`,aQ=`hidePrevented${gi}`,NL=`hidden${gi}`,OL=`show${gi}`,lQ=`shown${gi}`,uQ=`resize${gi}`,cQ=`click.dismiss${gi}`,fQ=`mousedown.dismiss${gi}`,dQ=`keydown.dismiss${gi}`,pQ=`click${gi}${iQ}`,zA="modal-open",hQ="fade",jA="show",l0="modal-static",mQ=".modal.show",gQ=".modal-dialog",yQ=".modal-body",vQ='[data-bs-toggle="modal"]',xQ={backdrop:!0,focus:!0,keyboard:!0},_Q={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};let fm=class RL extends $i{constructor(t,n){super(t,n),this._dialog=Le.findOne(gQ,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new m_,this._addEventListeners()}static get Default(){return xQ}static get DefaultType(){return _Q}static get NAME(){return nQ}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||de.trigger(this._element,OL,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(zA),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){!this._isShown||this._isTransitioning||de.trigger(this._element,sQ).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(jA),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){de.off(window,gi),de.off(this._dialog,gi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new TL({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new kL({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const n=Le.findOne(yQ,this._dialog);n&&(n.scrollTop=0),id(this._element),this._element.classList.add(jA);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,de.trigger(this._element,lQ,{relatedTarget:t})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){de.on(this._element,dQ,t=>{if(t.key===oQ){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),de.on(window,uQ,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),de.on(this._element,fQ,t=>{de.one(this._element,cQ,n=>{if(!(this._element!==t.target||this._element!==n.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(zA),this._resetAdjustments(),this._scrollBar.reset(),de.trigger(this._element,NL)})}_isAnimated(){return this._element.classList.contains(hQ)}_triggerBackdropTransition(){if(de.trigger(this._element,aQ).defaultPrevented)return;const n=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(l0)||(n||(this._element.style.overflowY="hidden"),this._element.classList.add(l0),this._queueCallback(()=>{this._element.classList.remove(l0),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._scrollBar.getWidth(),r=n>0;if(r&&!t){const i=mi()?"paddingLeft":"paddingRight";this._element.style[i]=`${n}px`}if(!r&&t){const i=mi()?"paddingRight":"paddingLeft";this._element.style[i]=`${n}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,n){return this.each(function(){const r=RL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof r[t]>"u")throw new TypeError(`No method named "${t}"`);r[t](n)}})}};de.on(document,pQ,vQ,function(e){const t=Le.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),de.one(t,OL,i=>{i.defaultPrevented||de.one(t,NL,()=>{Ou(this)&&this.focus()})});const n=Le.findOne(mQ);n&&fm.getInstance(n).hide(),fm.getOrCreateInstance(t).toggle(this)});dg(fm);vi(fm);const wQ="offcanvas",bQ="bs.offcanvas",Do=`.${bQ}`,DL=".data-api",EQ=`load${Do}${DL}`,SQ="Escape",VA="show",UA="showing",WA="hiding",CQ="offcanvas-backdrop",LL=".offcanvas.show",IQ=`show${Do}`,AQ=`shown${Do}`,TQ=`hide${Do}`,GA=`hidePrevented${Do}`,PL=`hidden${Do}`,kQ=`resize${Do}`,NQ=`click${Do}${DL}`,OQ=`keydown.dismiss${Do}`,RQ='[data-bs-toggle="offcanvas"]',DQ={backdrop:!0,keyboard:!0,scroll:!1},LQ={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};let _u=class ML extends $i{constructor(t,n){super(t,n),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return DQ}static get DefaultType(){return LQ}static get NAME(){return wQ}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||de.trigger(this._element,IQ,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new m_().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(UA);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(VA),this._element.classList.remove(UA),de.trigger(this._element,AQ,{relatedTarget:t})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||de.trigger(this._element,TQ).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(WA),this._backdrop.hide();const n=()=>{this._element.classList.remove(VA,WA),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new m_().reset(),de.trigger(this._element,PL)};this._queueCallback(n,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=()=>{if(this._config.backdrop==="static"){de.trigger(this._element,GA);return}this.hide()},n=!!this._config.backdrop;return new TL({className:CQ,isVisible:n,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:n?t:null})}_initializeFocusTrap(){return new kL({trapElement:this._element})}_addEventListeners(){de.on(this._element,OQ,t=>{if(t.key===SQ){if(this._config.keyboard){this.hide();return}de.trigger(this._element,GA)}})}static jQueryInterface(t){return this.each(function(){const n=ML.getOrCreateInstance(this,t);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};de.on(document,NQ,RQ,function(e){const t=Le.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),Is(this))return;de.one(t,PL,()=>{Ou(this)&&this.focus()});const n=Le.findOne(LL);n&&n!==t&&_u.getInstance(n).hide(),_u.getOrCreateInstance(t).toggle(this)});de.on(window,EQ,()=>{for(const e of Le.find(LL))_u.getOrCreateInstance(e).show()});de.on(window,kQ,()=>{for(const e of Le.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(e).position!=="fixed"&&_u.getOrCreateInstance(e).hide()});dg(_u);vi(_u);const PQ=/^aria-[\w-]*$/i,$L={"*":["class","dir","id","lang","role",PQ],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},MQ=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),$Q=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,FQ=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?MQ.has(n)?!!$Q.test(e.nodeValue):!0:t.filter(r=>r instanceof RegExp).some(r=>r.test(n))};function BQ(e,t,n){if(!e.length)return e;if(n&&typeof n=="function")return n(e);const i=new window.DOMParser().parseFromString(e,"text/html"),o=[].concat(...i.body.querySelectorAll("*"));for(const s of o){const a=s.nodeName.toLowerCase();if(!Object.keys(t).includes(a)){s.remove();continue}const u=[].concat(...s.attributes),c=[].concat(t["*"]||[],t[a]||[]);for(const d of u)FQ(d,c)||s.removeAttribute(d.nodeName)}return i.body.innerHTML}const HQ="TemplateFactory",zQ={allowList:$L,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},jQ={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},VQ={entry:"(string|element|function|null)",selector:"(string|element)"};class UQ extends od{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return zQ}static get DefaultType(){return jQ}static get NAME(){return HQ}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[i,o]of Object.entries(this._config.content))this._setContent(t,o,i);const n=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&n.classList.add(...r.split(" ")),n}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[n,r]of Object.entries(t))super._typeCheckConfig({selector:n,entry:r},VQ)}_setContent(t,n,r){const i=Le.findOne(r,t);if(i){if(n=this._resolvePossibleFunction(n),!n){i.remove();return}if(_o(n)){this._putElementInTemplate(Cs(n),i);return}if(this._config.html){i.innerHTML=this._maybeSanitize(n);return}i.textContent=n}}_maybeSanitize(t){return this._config.sanitize?BQ(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return pr(t,[this])}_putElementInTemplate(t,n){if(this._config.html){n.innerHTML="",n.append(t);return}n.textContent=t.textContent}}const WQ="tooltip",GQ=new Set(["sanitize","allowList","sanitizeFn"]),u0="fade",KQ="modal",zp="show",qQ=".tooltip-inner",KA=`.${KQ}`,qA="hide.bs.modal",Cc="hover",c0="focus",YQ="click",XQ="manual",QQ="hide",ZQ="hidden",JQ="show",eZ="shown",tZ="inserted",nZ="click",rZ="focusin",iZ="focusout",oZ="mouseenter",sZ="mouseleave",aZ={AUTO:"auto",TOP:"top",RIGHT:mi()?"left":"right",BOTTOM:"bottom",LEFT:mi()?"right":"left"},lZ={allowList:$L,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},uZ={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};let ld=class FL extends $i{constructor(t,n){if(typeof rL>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,n),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return lZ}static get DefaultType(){return uZ}static get NAME(){return WQ}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),de.off(this._element.closest(KA),qA,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const t=de.trigger(this._element,this.constructor.eventName(JQ)),r=(sL(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!r)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(i),de.trigger(this._element,this.constructor.eventName(tZ))),this._popper=this._createPopper(i),i.classList.add(zp),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))de.on(a,"mouseover",lm);const s=()=>{de.trigger(this._element,this.constructor.eventName(eZ)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||de.trigger(this._element,this.constructor.eventName(QQ)).defaultPrevented)return;if(this._getTipElement().classList.remove(zp),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))de.off(i,"mouseover",lm);this._activeTrigger[YQ]=!1,this._activeTrigger[c0]=!1,this._activeTrigger[Cc]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),de.trigger(this._element,this.constructor.eventName(ZQ)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const n=this._getTemplateFactory(t).toHtml();if(!n)return null;n.classList.remove(u0,zp),n.classList.add(`bs-${this.constructor.NAME}-auto`);const r=Yq(this.constructor.NAME).toString();return n.setAttribute("id",r),this._isAnimated()&&n.classList.add(u0),n}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new UQ({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[qQ]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(u0)}_isShown(){return this.tip&&this.tip.classList.contains(zp)}_createPopper(t){const n=pr(this._config.placement,[this,t,this._element]),r=aZ[n.toUpperCase()];return A1(this._element,t,this._getPopperConfig(r))}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(n=>Number.parseInt(n,10)):typeof t=="function"?n=>t(n,this._element):t}_resolvePossibleFunction(t){return pr(t,[this._element])}_getPopperConfig(t){const n={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...n,...pr(this._config.popperConfig,[n])}}_setListeners(){const t=this._config.trigger.split(" ");for(const n of t)if(n==="click")de.on(this._element,this.constructor.eventName(nZ),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(n!==XQ){const r=n===Cc?this.constructor.eventName(oZ):this.constructor.eventName(rZ),i=n===Cc?this.constructor.eventName(sZ):this.constructor.eventName(iZ);de.on(this._element,r,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusin"?c0:Cc]=!0,s._enter()}),de.on(this._element,i,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusout"?c0:Cc]=s._element.contains(o.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},de.on(this._element.closest(KA),qA,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,n){clearTimeout(this._timeout),this._timeout=setTimeout(t,n)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const n=wo.getDataAttributes(this._element);for(const r of Object.keys(n))GQ.has(r)&&delete n[r];return t={...n,...typeof t=="object"&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=t.container===!1?document.body:Cs(t.container),typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),typeof t.title=="number"&&(t.title=t.title.toString()),typeof t.content=="number"&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[n,r]of Object.entries(this._config))this.constructor.Default[n]!==r&&(t[n]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const n=FL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}};vi(ld);const cZ="popover",fZ=".popover-header",dZ=".popover-body",pZ={...ld.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},hZ={...ld.DefaultType,content:"(null|string|element|function)"};class O1 extends ld{static get Default(){return pZ}static get DefaultType(){return hZ}static get NAME(){return cZ}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[fZ]:this._getTitle(),[dZ]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const n=O1.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}}vi(O1);const mZ="scrollspy",gZ="bs.scrollspy",R1=`.${gZ}`,yZ=".data-api",vZ=`activate${R1}`,YA=`click${R1}`,xZ=`load${R1}${yZ}`,_Z="dropdown-item",xl="active",wZ='[data-bs-spy="scroll"]',f0="[href]",bZ=".nav, .list-group",XA=".nav-link",EZ=".nav-item",SZ=".list-group-item",CZ=`${XA}, ${EZ} > ${XA}, ${SZ}`,IZ=".dropdown",AZ=".dropdown-toggle",TZ={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},kZ={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class pg extends $i{constructor(t,n){super(t,n),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return TZ}static get DefaultType(){return kZ}static get NAME(){return mZ}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Cs(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,typeof t.threshold=="string"&&(t.threshold=t.threshold.split(",").map(n=>Number.parseFloat(n))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(de.off(this._config.target,YA),de.on(this._config.target,YA,f0,t=>{const n=this._observableSections.get(t.target.hash);if(n){t.preventDefault();const r=this._rootElement||window,i=n.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:i,behavior:"smooth"});return}r.scrollTop=i}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(n=>this._observerCallback(n),t)}_observerCallback(t){const n=s=>this._targetLinks.get(`#${s.target.id}`),r=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(n(s))},i=(this._rootElement||document.documentElement).scrollTop,o=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(n(s));continue}const a=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(r(s),!i)return;continue}!o&&!a&&r(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=Le.find(f0,this._config.target);for(const n of t){if(!n.hash||Is(n))continue;const r=Le.findOne(decodeURI(n.hash),this._element);Ou(r)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,r))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(xl),this._activateParents(t),de.trigger(this._element,vZ,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains(_Z)){Le.findOne(AZ,t.closest(IZ)).classList.add(xl);return}for(const n of Le.parents(t,bZ))for(const r of Le.prev(n,CZ))r.classList.add(xl)}_clearActiveClass(t){t.classList.remove(xl);const n=Le.find(`${f0}.${xl}`,t);for(const r of n)r.classList.remove(xl)}static jQueryInterface(t){return this.each(function(){const n=pg.getOrCreateInstance(this,t);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(window,xZ,()=>{for(const e of Le.find(wZ))pg.getOrCreateInstance(e)});vi(pg);const NZ="tab",OZ="bs.tab",Ha=`.${OZ}`,RZ=`hide${Ha}`,DZ=`hidden${Ha}`,LZ=`show${Ha}`,PZ=`shown${Ha}`,MZ=`click${Ha}`,$Z=`keydown${Ha}`,FZ=`load${Ha}`,BZ="ArrowLeft",QA="ArrowRight",HZ="ArrowUp",ZA="ArrowDown",d0="Home",JA="End",pa="active",eT="fade",p0="show",zZ="dropdown",BL=".dropdown-toggle",jZ=".dropdown-menu",h0=`:not(${BL})`,VZ='.list-group, .nav, [role="tablist"]',UZ=".nav-item, .list-group-item",WZ=`.nav-link${h0}, .list-group-item${h0}, [role="tab"]${h0}`,HL='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',m0=`${WZ}, ${HL}`,GZ=`.${pa}[data-bs-toggle="tab"], .${pa}[data-bs-toggle="pill"], .${pa}[data-bs-toggle="list"]`;class wu extends $i{constructor(t){super(t),this._parent=this._element.closest(VZ),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),de.on(this._element,$Z,n=>this._keydown(n)))}static get NAME(){return NZ}show(){const t=this._element;if(this._elemIsActive(t))return;const n=this._getActiveElem(),r=n?de.trigger(n,RZ,{relatedTarget:t}):null;de.trigger(t,LZ,{relatedTarget:n}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(n,t),this._activate(t,n))}_activate(t,n){if(!t)return;t.classList.add(pa),this._activate(Le.getElementFromSelector(t));const r=()=>{if(t.getAttribute("role")!=="tab"){t.classList.add(p0);return}t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),de.trigger(t,PZ,{relatedTarget:n})};this._queueCallback(r,t,t.classList.contains(eT))}_deactivate(t,n){if(!t)return;t.classList.remove(pa),t.blur(),this._deactivate(Le.getElementFromSelector(t));const r=()=>{if(t.getAttribute("role")!=="tab"){t.classList.remove(p0);return}t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),de.trigger(t,DZ,{relatedTarget:n})};this._queueCallback(r,t,t.classList.contains(eT))}_keydown(t){if(![BZ,QA,HZ,ZA,d0,JA].includes(t.key))return;t.stopPropagation(),t.preventDefault();const n=this._getChildren().filter(i=>!Is(i));let r;if([d0,JA].includes(t.key))r=n[t.key===d0?0:n.length-1];else{const i=[QA,ZA].includes(t.key);r=T1(n,t.target,i,!0)}r&&(r.focus({preventScroll:!0}),wu.getOrCreateInstance(r).show())}_getChildren(){return Le.find(m0,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,n){this._setAttributeIfNotExists(t,"role","tablist");for(const r of n)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const n=this._elemIsActive(t),r=this._getOuterElement(t);t.setAttribute("aria-selected",n),r!==t&&this._setAttributeIfNotExists(r,"role","presentation"),n||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const n=Le.getElementFromSelector(t);n&&(this._setAttributeIfNotExists(n,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(n,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,n){const r=this._getOuterElement(t);if(!r.classList.contains(zZ))return;const i=(o,s)=>{const a=Le.findOne(o,r);a&&a.classList.toggle(s,n)};i(BL,pa),i(jZ,p0),r.setAttribute("aria-expanded",n)}_setAttributeIfNotExists(t,n,r){t.hasAttribute(n)||t.setAttribute(n,r)}_elemIsActive(t){return t.classList.contains(pa)}_getInnerElement(t){return t.matches(m0)?t:Le.findOne(m0,t)}_getOuterElement(t){return t.closest(UZ)||t}static jQueryInterface(t){return this.each(function(){const n=wu.getOrCreateInstance(this);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(document,MZ,HL,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),!Is(this)&&wu.getOrCreateInstance(this).show()});de.on(window,FZ,()=>{for(const e of Le.find(GZ))wu.getOrCreateInstance(e)});vi(wu);const KZ="toast",qZ="bs.toast",Ls=`.${qZ}`,YZ=`mouseover${Ls}`,XZ=`mouseout${Ls}`,QZ=`focusin${Ls}`,ZZ=`focusout${Ls}`,JZ=`hide${Ls}`,eJ=`hidden${Ls}`,tJ=`show${Ls}`,nJ=`shown${Ls}`,rJ="fade",tT="hide",jp="show",Vp="showing",iJ={animation:"boolean",autohide:"boolean",delay:"number"},oJ={animation:!0,autohide:!0,delay:5e3};let zL=class jL extends $i{constructor(t,n){super(t,n),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return oJ}static get DefaultType(){return iJ}static get NAME(){return KZ}show(){if(de.trigger(this._element,tJ).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(rJ);const n=()=>{this._element.classList.remove(Vp),de.trigger(this._element,nJ),this._maybeScheduleHide()};this._element.classList.remove(tT),id(this._element),this._element.classList.add(jp,Vp),this._queueCallback(n,this._element,this._config.animation)}hide(){if(!this.isShown()||de.trigger(this._element,JZ).defaultPrevented)return;const n=()=>{this._element.classList.add(tT),this._element.classList.remove(Vp,jp),de.trigger(this._element,eJ)};this._element.classList.add(Vp),this._queueCallback(n,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(jp),super.dispose()}isShown(){return this._element.classList.contains(jp)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,n){switch(t.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=n;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=n;break}}if(n){this._clearTimeout();return}const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){de.on(this._element,YZ,t=>this._onInteraction(t,!0)),de.on(this._element,XZ,t=>this._onInteraction(t,!1)),de.on(this._element,QZ,t=>this._onInteraction(t,!0)),de.on(this._element,ZZ,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const n=jL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};dg(zL);vi(zL);function Lu({children:e,text:t}){const n=A.useRef("");return A.useEffect(()=>{const r=new ld(n.current,{title:t,placement:"bottom",trigger:"hover"});return()=>r.dispose()},[t]),Q.cloneElement(e,{ref:n})}const VL=[{actionId:"reset",hotkey:"F6",description:"PlayButton_Reset",icon:"bi-arrow-clockwise",enabledStatuses:["exception","halted","running","waiting"]},{actionId:"stepBack",hotkey:"F7",description:"PlayButton_StepBack",icon:"bi-skip-start-fill",enabledStatuses:["exception","halted","running","waiting"]},{actionId:"nextStep",hotkey:"F8",description:"PlayButton_NextStep",icon:"bi-skip-end-fill",enabledStatuses:["ready","running"]}],UL={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:sJ}=Q,{useSyncExternalStoreWithSelector:aJ}=pR;let nT=!1;const lJ=e=>e;function uJ(e,t=lJ,n){(UL?"production":void 0)!=="production"&&n&&!nT&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nT=!0);const r=aJ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return sJ(r),r}const cJ=e=>{(UL?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?hR(e):e,n=(r,i)=>uJ(t,r,i);return Object.assign(n,t),n},hg=e=>cJ;function D1(e){const t=e.getRightmostFailures();let n="";for(let r=0;r0&&(n+=", ");const i=t[r];i.type==="description"?n+=i.text.replace(/end of input/g,"[[Syntax_EndOfInput]]"):n+=`\`${i.text}\``}return n}function Jn(e){const t=e||"";return function(){throw new Error("this method "+t+" is abstract! (it has no implementation in class "+this.constructor.name+")")}}function Ps(e,t){if(!e)throw new Error(t||"Assertion failed")}function g_(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||(r=n.call(this)),r}})}function fJ(e){return e&&Object.assign({},e)}function WL(e,t){const n=[];for(;t-- >0;)n.push(e());return n}function GL(e,t){return new Array(t+1).join(e)}function mg(e,t){return WL(()=>e,t)}function y_(e){const t=[];for(let n=0;n{t.indexOf(n)<0&&t.push(n)}),t}function _a(e){const t=e[0];return t===t.toUpperCase()}function qL(e){return!_a(e)}function YL(e,t,n){const r=n||" ";return e.lengthString.fromCodePoint(parseInt(e,16));function XL(e){if(e.charAt(0)==="\\")switch(e.charAt(1)){case"b":return"\b";case"f":return"\f";case"n":return` -`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"x":return g0(e.slice(2,4));case"u":return e.charAt(2)==="{"?g0(e.slice(3,-1)):g0(e.slice(2,6));default:return e.charAt(1)}else return e}function QL(e){if(e==null)return String(e);const t=Object.prototype.toString.call(e);try{let n;return e.constructor&&e.constructor.name?n=e.constructor.name:t.indexOf("[object ")===0?n=t.slice(8,-1):n=typeof e,n+": "+JSON.stringify(String(e))}catch{return t}}const dJ=Object.freeze(Object.defineProperty({__proto__:null,StringBuffer:za,abstract:Jn,assert:Ps,clone:fJ,copyWithoutDuplicates:KL,defineLazyProperty:g_,getDuplicates:y_,isLexical:qL,isSyntactic:_a,padLeft:YL,repeat:mg,repeatFn:WL,repeatStr:GL,unescapeCodePoint:XL,unexpectedObjToString:QL},Symbol.toStringTag,{value:"Module"})),pJ={Lu:new RegExp("\\p{Lu}","u"),Ll:new RegExp("\\p{Ll}","u"),Lt:new RegExp("\\p{Lt}","u"),Lm:new RegExp("\\p{Lm}","u"),Lo:new RegExp("\\p{Lo}","u"),Nl:new RegExp("\\p{Nl}","u"),Nd:new RegExp("\\p{Nd}","u"),Mn:new RegExp("\\p{Mn}","u"),Mc:new RegExp("\\p{Mc}","u"),Pc:new RegExp("\\p{Pc}","u"),Zs:new RegExp("\\p{Zs}","u"),L:new RegExp("\\p{Letter}","u"),Ltmo:new RegExp("\\p{Lt}|\\p{Lm}|\\p{Lo}","u")};class Ue{constructor(){if(this.constructor===Ue)throw new Error("PExpr cannot be instantiated -- it's abstract")}withSource(t){return t&&(this.source=t.trimmed()),this}}const Dn=Object.create(Ue.prototype),Ln=Object.create(Ue.prototype);class En extends Ue{constructor(t){super(),this.obj=t}}class Pn extends Ue{constructor(t,n){super(),this.from=t,this.to=n,this.matchCodePoint=t.length>1||n.length>1}}class Mn extends Ue{constructor(t){super(),this.index=t}}class rn extends Ue{constructor(t){super(),this.terms=t}}class gg extends rn{constructor(t,n,r){const i=t.rules[n].body;super([r,i]),this.superGrammar=t,this.name=n,this.body=r}}class yg extends rn{constructor(t,n,r,i){const o=t.rules[n].body;super([...r,o,...i]),this.superGrammar=t,this.ruleName=n,this.expansionPos=r.length}}class dn extends Ue{constructor(t){super(),this.factors=t}}class er extends Ue{constructor(t){super(),this.expr=t}}class ja extends er{}class Pu extends er{}class Lo extends er{}ja.prototype.operator="*";Pu.prototype.operator="+";Lo.prototype.operator="?";ja.prototype.minNumMatches=0;Pu.prototype.minNumMatches=1;Lo.prototype.minNumMatches=0;ja.prototype.maxNumMatches=Number.POSITIVE_INFINITY;Pu.prototype.maxNumMatches=Number.POSITIVE_INFINITY;Lo.prototype.maxNumMatches=1;class tr extends Ue{constructor(t){super(),this.expr=t}}class nr extends Ue{constructor(t){super(),this.expr=t}}class wr extends Ue{constructor(t){super(),this.expr=t}}class ht extends Ue{constructor(t,n=[]){super(),this.ruleName=t,this.args=n}isSyntactic(){return _a(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,"_memoKey",{value:this.toString()}),this._memoKey}}class wn extends Ue{constructor(t){super(),this.category=t,this.pattern=pJ[t]}}function Vt(e,t){let n;return t?(n=new Error(t.getLineAndColumnMessage()+e),n.shortMessage=e,n.interval=t):n=new Error(e),n}function v_(){return Vt("Interval sources don't match")}function hJ(e){const t=new Error;return Object.defineProperty(t,"message",{enumerable:!0,get(){return e.message}}),Object.defineProperty(t,"shortMessage",{enumerable:!0,get(){return"Expected "+e.getExpectedText()}}),t.interval=e.getInterval(),t}function mJ(e,t,n){const r=t?`Grammar ${e} is not declared in namespace '${t}'`:"Undeclared grammar "+e;return Vt(r,n)}function gJ(e,t){return Vt("Grammar "+e.name+" is already declared in this namespace")}function yJ(e){return Vt(`Grammar '${e.name}' does not support incremental parsing`)}function ZL(e,t,n){return Vt("Rule "+e+" is not declared in grammar "+t,n)}function vJ(e,t,n){return Vt("Cannot override rule "+e+" because it is not declared in "+t,n)}function xJ(e,t,n){return Vt("Cannot extend rule "+e+" because it is not declared in "+t,n)}function rT(e,t,n,r){let i="Duplicate declaration for rule '"+e+"' in grammar '"+t+"'";return t!==n&&(i+=" (originally declared in '"+n+"')"),Vt(i,r)}function JL(e,t,n,r){return Vt("Wrong number of parameters for rule "+e+" (expected "+t+", got "+n+")",r)}function _J(e,t,n,r){return Vt("Wrong number of arguments for rule "+e+" (expected "+t+", got "+n+")",r)}function iT(e,t,n){return Vt("Duplicate parameter names in rule "+e+": "+t.join(", "),n)}function wJ(e,t){return Vt("Invalid parameter to rule "+e+": "+t+" has arity "+t.getArity()+", but parameter expressions must have arity 1",t.source)}const bJ="NOTE: A _syntactic rule_ is a rule whose name begins with a capital letter. See https://ohmjs.org/d/svl for more details.";function EJ(e,t){return Vt("Cannot apply syntactic rule "+e+" from here (inside a lexical context)",t.source)}function SJ(e){const{ruleName:t}=e;return Vt(`applySyntactic is for syntactic rules, but '${t}' is a lexical rule. `+bJ,e.source)}function CJ(e){return Vt("applySyntactic is not required here (in a syntactic context)",e.source)}function oT(e,t){return Vt("Incorrect argument type: expected "+e,t.source)}function IJ(e){return Vt("'...' can appear at most once in a rule body",e.source)}function AJ(e){const t=e._node;Ps(t&&t.isNonterminal()&&t.ctorName==="escapeChar_unicodeCodePoint");const n=e.children.slice(1,-1).map(i=>i.source),r=n[0].coverageWith(...n.slice(1));return Vt(`U+${r.contents} is not a valid Unicode code point`,r)}function eP(e,t){const n=t.length>0?t[t.length-1].args:[];let i="Nullable expression "+e.expr.substituteParams(n)+" is not allowed inside '"+e.operator+"' (possible infinite loop)";if(t.length>0){const o=t.map(s=>new ht(s.ruleName,s.args)).join(` -`);i+=` -Application stack (most recent application last): -`+o}return Vt(i,e.expr.source)}function tP(e,t,n,r){return Vt("Rule "+e+" involves an alternation which has inconsistent arity (expected "+t+", got "+n+")",r.source)}function TJ(e){const t=e.map(n=>n.message);return Vt(["Errors:"].concat(t).join(` -- `),e[0].interval)}function kJ(e,t,n,r){let i=r.slice(0,-1).map(u=>{const c=" "+u[0].name+" > "+u[1];return u.length===3?c+" for '"+u[2]+"'":c}).join(` -`);i+=` - `+t+" > "+e;let o="";e==="_iter"&&(o=[` -NOTE: as of Ohm v16, there is no default action for iteration nodes — see `," https://ohmjs.org/d/dsa for details."].join(` -`));const s=[`Missing semantic action for '${e}' in ${n} '${t}'.${o}`,"Action stack (most recent call last):",i].join(` -`),a=Vt(s);return a.name="missingSemanticAction",a}function NJ(e){if(e.length===1)throw e[0];if(e.length>1)throw TJ(e)}function OJ(e){let t=0;return e.map(r=>{const i=r.toString();return t=Math.max(t,i.length),i}).map(r=>YL(r,t))}function sT(e,t,n){const r=e.length,i=e.slice(0,n),o=e.slice(n+t.length);return(i+t+o).substr(0,r)}function RJ(...e){const t=this,{offset:n}=t,{repeatStr:r}=dJ,i=new za;i.append("Line "+t.lineNum+", col "+t.colNum+`: -`);const o=OJ([t.prevLine==null?0:t.lineNum-1,t.lineNum,t.nextLine==null?0:t.lineNum+1]),s=(d,p,h)=>{i.append(h+o[d]+" | "+p+` -`)};t.prevLine!=null&&s(0,t.prevLine," "),s(1,t.line,"> ");const a=t.line.length;let u=r(" ",a+1);for(let d=0;d=0&&p<=h,"range start must be >= 0 and <= end");const m=n-t.colNum+1;p=Math.max(0,p-m),h=Math.min(h-m,a),u=sT(u,r("~",h-p),p)}const c=2+o[1].length+3;return i.append(r(" ",c)),u=sT(u,"^",t.colNum-1),i.append(u.replace(/ +$/,"")+` -`),t.nextLine!=null&&s(2,t.nextLine," "),i.contents()}let x_=[];function nP(e){x_.push(e)}function DJ(e){x_.forEach(t=>{t(e)}),x_=null}function L1(e,t){let n=1,r=1,i=0,o=0,s=null,a=null,u=-1;for(;i=0&&(a=e.slice(u,o).replace(/\r?\n$/,""));const d=e.slice(o,c).replace(/\r$/,"");return{offset:t,lineNum:n,colNum:r,line:d,prevLine:a,nextLine:s,toString:RJ}}function P1(e,t,...n){return L1(e,t).toString(...n)}const aT=(()=>{let e=0;return t=>""+t+e++})();class Tn{constructor(t,n,r){this.sourceString=t,this.startIdx=n,this.endIdx=r}get contents(){return this._contents===void 0&&(this._contents=this.sourceString.slice(this.startIdx,this.endIdx)),this._contents}get length(){return this.endIdx-this.startIdx}coverageWith(...t){return Tn.coverage(...t,this)}collapsedLeft(){return new Tn(this.sourceString,this.startIdx,this.startIdx)}collapsedRight(){return new Tn(this.sourceString,this.endIdx,this.endIdx)}getLineAndColumn(){return L1(this.sourceString,this.startIdx)}getLineAndColumnMessage(){const t=[this.startIdx,this.endIdx];return P1(this.sourceString,this.startIdx,t)}minus(t){if(this.sourceString!==t.sourceString)throw v_();return this.startIdx===t.startIdx&&this.endIdx===t.endIdx?[]:this.startIdx=t.startIdx&&this.endIdx<=t.endIdx,"other interval does not cover this one"),new Tn(this.sourceString,this.startIdx-t.startIdx,this.endIdx-t.startIdx)}trimmed(){const{contents:t}=this,n=this.startIdx+t.match(/^\s*/)[0].length,r=this.endIdx-t.match(/\s*$/)[0].length;return new Tn(this.sourceString,n,r)}subInterval(t,n){const r=this.startIdx+t;return new Tn(this.sourceString,r,r+n)}}Tn.coverage=function(e,...t){let{startIdx:n,endIdx:r}=e;for(const i of t){if(i.sourceString!==e.sourceString)throw v_();n=Math.min(n,i.startIdx),r=Math.max(r,i.endIdx)}return new Tn(e.sourceString,n,r)};const LJ=65535;class vg{constructor(t){this.source=t,this.pos=0,this.examinedLength=0}atEnd(){const t=this.pos>=this.source.length;return this.examinedLength=Math.max(this.examinedLength,this.pos+1),t}next(){const t=this.source[this.pos++];return this.examinedLength=Math.max(this.examinedLength,this.pos),t}nextCharCode(){const t=this.next();return t&&t.charCodeAt(0)}nextCodePoint(){const t=this.source.slice(this.pos++).codePointAt(0);return t>LJ&&(this.pos+=1),this.examinedLength=Math.max(this.examinedLength,this.pos),t}matchString(t,n){let r;if(n){for(r=0;r!r.isFluffy());for(let r=0;r0&&(r===n.length-1?t.append(n.length>2?", or ":" or "):t.append(", ")),t.append(n[r].toString());return t.contents()}getInterval(){const t=this.getRightmostFailurePosition();return new Tn(this.input,t,t)}}class PJ{constructor(){this.applicationMemoKeyStack=[],this.memo={},this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,this.currentLeftRecursion=void 0}isActive(t){return this.applicationMemoKeyStack.indexOf(t.toMemoKey())>=0}enter(t){this.applicationMemoKeyStack.push(t.toMemoKey())}exit(){this.applicationMemoKeyStack.pop()}startLeftRecursion(t,n){n.isLeftRecursion=!0,n.headApplication=t,n.nextLeftRecursion=this.currentLeftRecursion,this.currentLeftRecursion=n;const{applicationMemoKeyStack:r}=this,i=r.indexOf(t.toMemoKey())+1,o=r.slice(i);n.isInvolved=function(s){return o.indexOf(s)>=0},n.updateInvolvedApplicationMemoKeys=function(){for(let s=i;s{const o=r[i];t+o.examinedLength>n?delete r[i]:(this.maxExaminedLength=Math.max(this.maxExaminedLength,o.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,o.rightmostFailureOffset))})}}const MJ="✗",$J="✓",FJ="⋅",BJ="⇒",HJ="␉",zJ="␊",jJ="␍",__={succeeded:1,isRootNode:2,isImplicitSpaces:4,isMemoized:8,isHeadOfLeftRecursion:16,terminatesLR:32};function VJ(e){return mg(" ",e).join("")}function UJ(e,t,n){const r=iP(e.slice(t,t+n));return r.length{i(c,o,a+1)}),r.exit&&r.exit.call(n,o,s,a))}this.isRootNode?this.children.forEach(o=>{i(o,null,0)}):i(this,null,0)}toString(){const t=new za;return this.walk((n,r,i)=>{if(!n)return this.SKIP;if(n.expr.constructor.name!=="Alt"){if(t.append(UJ(n.input,n.pos,10)+VJ(i*2+1)),t.append((n.succeeded?$J:MJ)+" "+n.displayString),n.isHeadOfLeftRecursion&&t.append(" (LR)"),n.succeeded){const s=iP(n.source.contents);t.append(" "+BJ+" "),t.append(typeof s=="string"?'"'+s+'"':s)}t.append(` -`)}}),t.contents()}}_s.prototype.SKIP={};Object.keys(__).forEach(e=>{const t=__[e];Object.defineProperty(_s.prototype,e,{get(){return(this._flags&t)!==0},set(n){n?this._flags|=t:this._flags&=~t}})});Ue.prototype.allowsSkippingPrecedingSpace=Jn("allowsSkippingPrecedingSpace");Dn.allowsSkippingPrecedingSpace=Ln.allowsSkippingPrecedingSpace=ht.prototype.allowsSkippingPrecedingSpace=En.prototype.allowsSkippingPrecedingSpace=Pn.prototype.allowsSkippingPrecedingSpace=wn.prototype.allowsSkippingPrecedingSpace=function(){return!0};rn.prototype.allowsSkippingPrecedingSpace=er.prototype.allowsSkippingPrecedingSpace=wr.prototype.allowsSkippingPrecedingSpace=nr.prototype.allowsSkippingPrecedingSpace=tr.prototype.allowsSkippingPrecedingSpace=Mn.prototype.allowsSkippingPrecedingSpace=dn.prototype.allowsSkippingPrecedingSpace=function(){return!1};let Wc;nP(e=>{Wc=e});let dm;Ue.prototype.assertAllApplicationsAreValid=function(e,t){dm=0,this._assertAllApplicationsAreValid(e,t)};Ue.prototype._assertAllApplicationsAreValid=Jn("_assertAllApplicationsAreValid");Dn._assertAllApplicationsAreValid=Ln._assertAllApplicationsAreValid=En.prototype._assertAllApplicationsAreValid=Pn.prototype._assertAllApplicationsAreValid=Mn.prototype._assertAllApplicationsAreValid=wn.prototype._assertAllApplicationsAreValid=function(e,t){};wr.prototype._assertAllApplicationsAreValid=function(e,t){dm++,this.expr._assertAllApplicationsAreValid(e,t),dm--};rn.prototype._assertAllApplicationsAreValid=function(e,t){for(let n=0;n{if(c._assertAllApplicationsAreValid(e,t,a),c.getArity()!==1)throw wJ(this.ruleName,c)})};Ue.prototype.assertChoicesHaveUniformArity=Jn("assertChoicesHaveUniformArity");Dn.assertChoicesHaveUniformArity=Ln.assertChoicesHaveUniformArity=En.prototype.assertChoicesHaveUniformArity=Pn.prototype.assertChoicesHaveUniformArity=Mn.prototype.assertChoicesHaveUniformArity=wr.prototype.assertChoicesHaveUniformArity=wn.prototype.assertChoicesHaveUniformArity=function(e){};rn.prototype.assertChoicesHaveUniformArity=function(e){if(this.terms.length===0)return;const t=this.terms[0].getArity();for(let n=0;n{t.assertIteratedExprsAreNotNullable(e)})};let M1=class{constructor(t){this.matchLength=t}get ctorName(){throw new Error("subclass responsibility")}numChildren(){return this.children?this.children.length:0}childAt(t){if(this.children)return this.children[t]}indexOfChild(t){return this.children.indexOf(t)}hasChildren(){return this.numChildren()>0}hasNoChildren(){return!this.hasChildren()}onlyChild(){if(this.numChildren()!==1)throw new Error("cannot get only child of a node of type "+this.ctorName+" (it has "+this.numChildren()+" children)");return this.firstChild()}firstChild(){if(this.hasNoChildren())throw new Error("cannot get first child of a "+this.ctorName+" node, which has no children");return this.childAt(0)}lastChild(){if(this.hasNoChildren())throw new Error("cannot get last child of a "+this.ctorName+" node, which has no children");return this.childAt(this.numChildren()-1)}childBefore(t){const n=this.indexOfChild(t);if(n<0)throw new Error("Node.childBefore() called w/ an argument that is not a child");if(n===0)throw new Error("cannot get child before first child");return this.childAt(n-1)}childAfter(t){const n=this.indexOfChild(t);if(n<0)throw new Error("Node.childAfter() called w/ an argument that is not a child");if(n===this.numChildren()-1)throw new Error("cannot get child after last child");return this.childAt(n+1)}isTerminal(){return!1}isNonterminal(){return!1}isIteration(){return!1}isOptional(){return!1}};class Va extends M1{get ctorName(){return"_terminal"}isTerminal(){return!0}get primitiveValue(){throw new Error("The `primitiveValue` property was removed in Ohm v17.")}}class WJ extends M1{constructor(t,n,r,i){super(i),this.ruleName=t,this.children=n,this.childOffsets=r}get ctorName(){return this.ruleName}isNonterminal(){return!0}isLexical(){return qL(this.ctorName)}isSyntactic(){return _a(this.ctorName)}}class oP extends M1{constructor(t,n,r,i){super(r),this.children=t,this.childOffsets=n,this.optional=i}get ctorName(){return"_iter"}isIteration(){return!0}isOptional(){return this.optional}}Ue.prototype.eval=Jn("eval");Dn.eval=function(e){const{inputStream:t}=e,n=t.pos,r=t.nextCodePoint();return r!==void 0?(e.pushBinding(new Va(String.fromCodePoint(r).length),n),!0):(e.processFailure(n,this),!1)};Ln.eval=function(e){const{inputStream:t}=e,n=t.pos;return t.atEnd()?(e.pushBinding(new Va(0),n),!0):(e.processFailure(n,this),!1)};En.prototype.eval=function(e){const{inputStream:t}=e,n=t.pos;return t.matchString(this.obj)?(e.pushBinding(new Va(this.obj.length),n),!0):(e.processFailure(n,this),!1)};Pn.prototype.eval=function(e){const{inputStream:t}=e,n=t.pos,r=this.matchCodePoint?t.nextCodePoint():t.nextCharCode();return r!==void 0&&this.from.codePointAt(0)<=r&&r<=this.to.codePointAt(0)?(e.pushBinding(new Va(String.fromCodePoint(r).length),n),!0):(e.processFailure(n,this),!1)};Mn.prototype.eval=function(e){return e.eval(e.currentApplication().args[this.index])};wr.prototype.eval=function(e){e.enterLexifiedContext();const t=e.eval(this.expr);return e.exitLexifiedContext(),t};rn.prototype.eval=function(e){for(let t=0;t0){const h=i[r-1],m=o[r-1],v=m[m.length-1]+h[h.length-1].matchLength;c=o[0][0],d=v-c}const p=this instanceof Lo;for(u=0;un.outputRecipe(e,t)))};gg.prototype.outputRecipe=function(e,t){return this.terms[0].outputRecipe(e,t)};yg.prototype.outputRecipe=function(e,t){const n=this.terms.slice(0,this.expansionPos),r=this.terms.slice(this.expansionPos+1);return["splice",Fi(this,t),n.map(i=>i.outputRecipe(e,t)),r.map(i=>i.outputRecipe(e,t))]};dn.prototype.outputRecipe=function(e,t){return["seq",Fi(this,t)].concat(this.factors.map(n=>n.outputRecipe(e,t)))};ja.prototype.outputRecipe=Pu.prototype.outputRecipe=Lo.prototype.outputRecipe=tr.prototype.outputRecipe=nr.prototype.outputRecipe=wr.prototype.outputRecipe=function(e,t){return[this.constructor.name.toLowerCase(),Fi(this,t),this.expr.outputRecipe(e,t)]};ht.prototype.outputRecipe=function(e,t){return["app",Fi(this,t),this.ruleName,this.args.map(n=>n.outputRecipe(e,t))]};wn.prototype.outputRecipe=function(e,t){return["unicodeChar",Fi(this,t),this.category]};Ue.prototype.introduceParams=Jn("introduceParams");Dn.introduceParams=Ln.introduceParams=En.prototype.introduceParams=Pn.prototype.introduceParams=Mn.prototype.introduceParams=wn.prototype.introduceParams=function(e){return this};rn.prototype.introduceParams=function(e){return this.terms.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this};dn.prototype.introduceParams=function(e){return this.factors.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this};er.prototype.introduceParams=tr.prototype.introduceParams=nr.prototype.introduceParams=wr.prototype.introduceParams=function(e){return this.expr=this.expr.introduceParams(e),this};ht.prototype.introduceParams=function(e){const t=e.indexOf(this.ruleName);if(t>=0){if(this.args.length>0)throw new Error("Parameterized rules cannot be passed as arguments to another rule.");return new Mn(t).withSource(this.source)}else return this.args.forEach((n,r,i)=>{i[r]=n.introduceParams(e)}),this};Ue.prototype.isNullable=function(e){return this._isNullable(e,Object.create(null))};Ue.prototype._isNullable=Jn("_isNullable");Dn._isNullable=Pn.prototype._isNullable=Mn.prototype._isNullable=Pu.prototype._isNullable=wn.prototype._isNullable=function(e,t){return!1};Ln._isNullable=function(e,t){return!0};En.prototype._isNullable=function(e,t){return typeof this.obj=="string"?this.obj==="":!1};rn.prototype._isNullable=function(e,t){return this.terms.length===0||this.terms.some(n=>n._isNullable(e,t))};dn.prototype._isNullable=function(e,t){return this.factors.every(n=>n._isNullable(e,t))};ja.prototype._isNullable=Lo.prototype._isNullable=tr.prototype._isNullable=nr.prototype._isNullable=function(e,t){return!0};wr.prototype._isNullable=function(e,t){return this.expr._isNullable(e,t)};ht.prototype._isNullable=function(e,t){const n=this.toMemoKey();if(!Object.prototype.hasOwnProperty.call(t,n)){const{body:r}=e.rules[this.ruleName],i=r.substituteParams(this.args);t[n]=!1,t[n]=i._isNullable(e,t)}return t[n]};Ue.prototype.substituteParams=Jn("substituteParams");Dn.substituteParams=Ln.substituteParams=En.prototype.substituteParams=Pn.prototype.substituteParams=wn.prototype.substituteParams=function(e){return this};Mn.prototype.substituteParams=function(e){return e[this.index]};rn.prototype.substituteParams=function(e){return new rn(this.terms.map(t=>t.substituteParams(e)))};dn.prototype.substituteParams=function(e){return new dn(this.factors.map(t=>t.substituteParams(e)))};er.prototype.substituteParams=tr.prototype.substituteParams=nr.prototype.substituteParams=wr.prototype.substituteParams=function(e){return new this.constructor(this.expr.substituteParams(e))};ht.prototype.substituteParams=function(e){if(this.args.length===0)return this;{const t=this.args.map(n=>n.substituteParams(e));return new ht(this.ruleName,t)}};function lT(e){return/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)}function $1(e){const t=Object.create(null);e.forEach(n=>{t[n]=(t[n]||0)+1}),Object.keys(t).forEach(n=>{if(t[n]<=1)return;let r=1;e.forEach((i,o)=>{i===n&&(e[o]=i+"_"+r++)})})}Ue.prototype.toArgumentNameList=Jn("toArgumentNameList");Dn.toArgumentNameList=function(e,t){return["any"]};Ln.toArgumentNameList=function(e,t){return["end"]};En.prototype.toArgumentNameList=function(e,t){return typeof this.obj=="string"&&/^[_a-zA-Z0-9]+$/.test(this.obj)?["_"+this.obj]:["$"+e]};Pn.prototype.toArgumentNameList=function(e,t){let n=this.from+"_to_"+this.to;return lT(n)||(n="_"+n),lT(n)||(n="$"+e),[n]};rn.prototype.toArgumentNameList=function(e,t){const n=this.terms.map(o=>o.toArgumentNameList(e,!0)),r=[],i=n[0].length;for(let o=0;o{const i=r.toArgumentNameList(e,!0);n=n.concat(i),e+=i.length}),t||$1(n),n};er.prototype.toArgumentNameList=function(e,t){const n=this.expr.toArgumentNameList(e,t).map(r=>r[r.length-1]==="s"?r+"es":r+"s");return t||$1(n),n};Lo.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t).map(n=>"opt"+n[0].toUpperCase()+n.slice(1))};tr.prototype.toArgumentNameList=function(e,t){return[]};nr.prototype.toArgumentNameList=wr.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t)};ht.prototype.toArgumentNameList=function(e,t){return[this.ruleName]};wn.prototype.toArgumentNameList=function(e,t){return["$"+e]};Mn.prototype.toArgumentNameList=function(e,t){return["param"+this.index]};Ue.prototype.toDisplayString=Jn("toDisplayString");rn.prototype.toDisplayString=dn.prototype.toDisplayString=function(){return this.source?this.source.trimmed().contents:"["+this.constructor.name+"]"};Dn.toDisplayString=Ln.toDisplayString=er.prototype.toDisplayString=tr.prototype.toDisplayString=nr.prototype.toDisplayString=wr.prototype.toDisplayString=En.prototype.toDisplayString=Pn.prototype.toDisplayString=Mn.prototype.toDisplayString=function(){return this.toString()};ht.prototype.toDisplayString=function(){if(this.args.length>0){const e=this.args.map(t=>t.toDisplayString());return this.ruleName+"<"+e.join(",")+">"}else return this.ruleName};wn.prototype.toDisplayString=function(){return"Unicode ["+this.category+"] character"};function GJ(e){return e==="description"||e==="string"||e==="code"}class br{constructor(t,n,r){if(!GJ(r))throw new Error("invalid Failure type: "+r);this.pexpr=t,this.text=n,this.type=r,this.fluffy=!1}getPExpr(){return this.pexpr}getText(){return this.text}getType(){return this.type}isDescription(){return this.type==="description"}isStringTerminal(){return this.type==="string"}isCode(){return this.type==="code"}isFluffy(){return this.fluffy}makeFluffy(){this.fluffy=!0}clearFluffy(){this.fluffy=!1}subsumes(t){return this.getText()===t.getText()&&this.type===t.type&&(!this.isFluffy()||this.isFluffy()&&t.isFluffy())}toString(){return this.type==="string"?JSON.stringify(this.getText()):this.getText()}clone(){const t=new br(this.pexpr,this.text,this.type);return this.isFluffy()&&t.makeFluffy(),t}toKey(){return this.toString()+"#"+this.type}}Ue.prototype.toFailure=Jn("toFailure");Dn.toFailure=function(e){return new br(this,"any object","description")};Ln.toFailure=function(e){return new br(this,"end of input","description")};En.prototype.toFailure=function(e){return new br(this,this.obj,"string")};Pn.prototype.toFailure=function(e){return new br(this,JSON.stringify(this.from)+".."+JSON.stringify(this.to),"code")};tr.prototype.toFailure=function(e){const t=this.expr===Dn?"nothing":"not "+this.expr.toFailure(e);return new br(this,t,"description")};nr.prototype.toFailure=function(e){return this.expr.toFailure(e)};ht.prototype.toFailure=function(e){let{description:t}=e.rules[this.ruleName];return t||(t=(/^[aeiouAEIOU]/.test(this.ruleName)?"an":"a")+" "+this.ruleName),new br(this,t,"description")};wn.prototype.toFailure=function(e){return new br(this,"a Unicode ["+this.category+"] character","description")};rn.prototype.toFailure=function(e){const n="("+this.terms.map(r=>r.toFailure(e)).join(" or ")+")";return new br(this,n,"description")};dn.prototype.toFailure=function(e){const n="("+this.factors.map(r=>r.toFailure(e)).join(" ")+")";return new br(this,n,"description")};er.prototype.toFailure=function(e){const t="("+this.expr.toFailure(e)+this.operator+")";return new br(this,t,"description")};Ue.prototype.toString=Jn("toString");Dn.toString=function(){return"any"};Ln.toString=function(){return"end"};En.prototype.toString=function(){return JSON.stringify(this.obj)};Pn.prototype.toString=function(){return JSON.stringify(this.from)+".."+JSON.stringify(this.to)};Mn.prototype.toString=function(){return"$"+this.index};wr.prototype.toString=function(){return"#("+this.expr.toString()+")"};rn.prototype.toString=function(){return this.terms.length===1?this.terms[0].toString():"("+this.terms.map(e=>e.toString()).join(" | ")+")"};dn.prototype.toString=function(){return this.factors.length===1?this.factors[0].toString():"("+this.factors.map(e=>e.toString()).join(" ")+")"};er.prototype.toString=function(){return this.expr+this.operator};tr.prototype.toString=function(){return"~"+this.expr};nr.prototype.toString=function(){return"&"+this.expr};ht.prototype.toString=function(){if(this.args.length>0){const e=this.args.map(t=>t.toString());return this.ruleName+"<"+e.join(",")+">"}else return this.ruleName};wn.prototype.toString=function(){return"\\p{"+this.category+"}"};class F1 extends Ue{constructor(t){super(),this.obj=t}_getString(t){const n=t.currentApplication().args[this.obj.index];return Ps(n instanceof En,"expected a Terminal expression"),n.obj}allowsSkippingPrecedingSpace(){return!0}eval(t){const{inputStream:n}=t,r=n.pos,i=this._getString(t);return n.matchString(i,!0)?(t.pushBinding(new Va(i.length),r),!0):(t.processFailure(r,this),!1)}getArity(){return 1}substituteParams(t){return new F1(this.obj.substituteParams(t))}toDisplayString(){return this.obj.toDisplayString()+" (case-insensitive)"}toFailure(t){return new br(this,this.obj.toFailure(t)+" (case-insensitive)","description")}_isNullable(t,n){return this.obj._isNullable(t,n)}}let sP;nP(e=>{sP=e.rules.applySyntactic.body});const y0=new ht("spaces");class KJ{constructor(t,n,r){this.matcher=t,this.startExpr=n,this.grammar=t.grammar,this.input=t.getInput(),this.inputStream=new vg(this.input),this.memoTable=t._memoTable,this.userData=void 0,this.doNotMemoize=!1,this._bindings=[],this._bindingOffsets=[],this._applicationStack=[],this._posStack=[0],this.inLexifiedContextStack=[!1],this.rightmostFailurePosition=-1,this._rightmostFailurePositionStack=[],this._recordedFailuresStack=[],r!==void 0&&(this.positionToRecordFailures=r,this.recordedFailures=Object.create(null))}posToOffset(t){return t-this._posStack[this._posStack.length-1]}enterApplication(t,n){this._posStack.push(this.inputStream.pos),this._applicationStack.push(n),this.inLexifiedContextStack.push(!1),t.enter(n),this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this.rightmostFailurePosition=-1}exitApplication(t,n){const r=this._posStack.pop();this._applicationStack.pop(),this.inLexifiedContextStack.pop(),t.exit(),this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,this._rightmostFailurePositionStack.pop()),n&&this.pushBinding(n,r)}enterLexifiedContext(){this.inLexifiedContextStack.push(!0)}exitLexifiedContext(){this.inLexifiedContextStack.pop()}currentApplication(){return this._applicationStack[this._applicationStack.length-1]}inSyntacticContext(){const t=this.currentApplication();return t?t.isSyntactic()&&!this.inLexifiedContext():this.startExpr.factors[0].isSyntactic()}inLexifiedContext(){return this.inLexifiedContextStack[this.inLexifiedContextStack.length-1]}skipSpaces(){return this.pushFailuresInfo(),this.eval(y0),this.popBinding(),this.popFailuresInfo(),this.inputStream.pos}skipSpacesIfInSyntacticContext(){return this.inSyntacticContext()?this.skipSpaces():this.inputStream.pos}maybeSkipSpacesBefore(t){return t.allowsSkippingPrecedingSpace()&&t!==y0?this.skipSpacesIfInSyntacticContext():this.inputStream.pos}pushBinding(t,n){this._bindings.push(t),this._bindingOffsets.push(this.posToOffset(n))}popBinding(){this._bindings.pop(),this._bindingOffsets.pop()}numBindings(){return this._bindings.length}truncateBindings(t){for(;this._bindings.length>t;)this.popBinding()}getCurrentPosInfo(){return this.getPosInfo(this.inputStream.pos)}getPosInfo(t){let n=this.memoTable[t];return n||(n=this.memoTable[t]=new PJ),n}processFailure(t,n){if(this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,t),this.recordedFailures&&t===this.positionToRecordFailures){const r=this.currentApplication();r&&(n=n.substituteParams(r.args)),this.recordFailure(n.toFailure(this.grammar),!1)}}recordFailure(t,n){const r=t.toKey();this.recordedFailures[r]?this.recordedFailures[r].isFluffy()&&!t.isFluffy()&&this.recordedFailures[r].clearFluffy():this.recordedFailures[r]=n?t.clone():t}recordFailures(t,n){Object.keys(t).forEach(r=>{this.recordFailure(t[r],n)})}cloneRecordedFailures(){if(!this.recordedFailures)return;const t=Object.create(null);return Object.keys(this.recordedFailures).forEach(n=>{t[n]=this.recordedFailures[n].clone()}),t}getRightmostFailurePosition(){return this.rightmostFailurePosition}_getRightmostFailureOffset(){return this.rightmostFailurePosition>=0?this.posToOffset(this.rightmostFailurePosition):-1}getMemoizedTraceEntry(t,n){const r=this.memoTable[t];if(r&&n instanceof ht){const i=r.memo[n.toMemoKey()];if(i&&i.traceEntry){const o=i.traceEntry.cloneWithExpr(n);return o.isMemoized=!0,o}}return null}getTraceEntry(t,n,r,i){if(n instanceof ht){const o=this.currentApplication(),s=o?o.args:[];n=n.substituteParams(s)}return this.getMemoizedTraceEntry(t,n)||new _s(this.input,t,this.inputStream.pos,n,r,i,this.trace)}isTracing(){return!!this.trace}hasNecessaryInfo(t){return this.trace&&!t.traceEntry?!1:this.recordedFailures&&this.inputStream.pos+t.rightmostFailureOffset===this.positionToRecordFailures?!!t.failuresAtRightmostPosition:!0}useMemoizedResult(t,n){this.trace&&this.trace.push(n.traceEntry);const r=this.inputStream.pos+n.rightmostFailureOffset;return this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,r),this.recordedFailures&&this.positionToRecordFailures===r&&n.failuresAtRightmostPosition&&this.recordFailures(n.failuresAtRightmostPosition,!0),this.inputStream.examinedLength=Math.max(this.inputStream.examinedLength,n.examinedLength+t),n.value?(this.inputStream.pos+=n.matchLength,this.pushBinding(n.value,t),!0):!1}eval(t){const{inputStream:n}=this,r=this._bindings.length,i=this.userData;let o;this.recordedFailures&&(o=this.recordedFailures,this.recordedFailures=Object.create(null));const s=n.pos,a=this.maybeSkipSpacesBefore(t);let u;this.trace&&(u=this.trace,this.trace=[]);const c=t.eval(this);if(this.trace){const d=this._bindings.slice(r),p=this.getTraceEntry(a,t,c,d);p.isImplicitSpaces=t===y0,p.isRootNode=t===this.startExpr,u.push(p),this.trace=u}return c?this.recordedFailures&&n.pos===this.positionToRecordFailures&&Object.keys(this.recordedFailures).forEach(d=>{this.recordedFailures[d].makeFluffy()}):(n.pos=s,this.truncateBindings(r),this.userData=i),this.recordedFailures&&this.recordFailures(o,!1),t===sP&&this.skipSpaces(),c}getMatchResult(){this.grammar._setUpMatchState(this),this.eval(this.startExpr);let t;this.recordedFailures&&(t=Object.keys(this.recordedFailures).map(r=>this.recordedFailures[r]));const n=this._bindings[0];return n&&(n.grammar=this.grammar),new rP(this.matcher,this.input,this.startExpr,n,this._bindingOffsets[0],this.rightmostFailurePosition,t)}getTrace(){this.trace=[];const t=this.getMatchResult(),n=this.trace[this.trace.length-1];return n.result=t,n}pushFailuresInfo(){this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this._recordedFailuresStack.push(this.recordedFailures)}popFailuresInfo(){this.rightmostFailurePosition=this._rightmostFailurePositionStack.pop(),this.recordedFailures=this._recordedFailuresStack.pop()}}class qJ{constructor(t){this.grammar=t,this._memoTable=[],this._input="",this._isMemoTableStale=!1}_resetMemoTable(){this._memoTable=[],this._isMemoTableStale=!1}getInput(){return this._input}setInput(t){return this._input!==t&&this.replaceInputRange(0,this._input.length,t),this}replaceInputRange(t,n,r){const i=this._input,o=this._memoTable;if(t<0||t>i.length||n<0||n>i.length||t>n)throw new Error("Invalid indices: "+t+" and "+n);this._input=i.slice(0,t)+r+i.slice(n),this._input!==i&&o.length>0&&(this._isMemoTableStale=!0);const s=o.slice(n);o.length=t;for(let a=0;aObject.prototype.hasOwnProperty.call(e,t);class uT{constructor(t,n,r){this._node=t,this.source=n,this._baseInterval=r,t.isNonterminal()&&Ps(n===r),this._childWrappers=[]}_forgetMemoizedResultFor(t){delete this._node[this._semantics.attributeKeys[t]],this.children.forEach(n=>{n._forgetMemoizedResultFor(t)})}child(t){if(!(0<=t&&ts._node),i=new oP(r,[],-1,!1),o=this._semantics.wrap(i,null,null);return o._childWrappers=n,o}get children(){return this._children()}get ctorName(){return this._node.ctorName}get numChildren(){return this._node.numChildren()}get sourceString(){return this.source.contents}}class xr{constructor(t,n){const r=this;if(this.grammar=t,this.checkedActionDicts=!1,this.Wrapper=class extends(n?n.Wrapper:uT){constructor(i,o,s){super(i,o,s),r.checkActionDictsIfHaventAlready(),this._semantics=r}toString(){return"[semantics wrapper for "+r.grammar.name+"]"}},this.super=n,n){if(!(t.equals(this.super.grammar)||t._inheritsFrom(this.super.grammar)))throw new Error("Cannot extend a semantics for grammar '"+this.super.grammar.name+"' for use with grammar '"+t.name+"' (not a sub-grammar)");this.operations=Object.create(this.super.operations),this.attributes=Object.create(this.super.attributes),this.attributeKeys=Object.create(null);for(const i in this.attributes)Object.defineProperty(this.attributeKeys,i,{value:aT(i)})}else this.operations=Object.create(null),this.attributes=Object.create(null),this.attributeKeys=Object.create(null)}toString(){return"[semantics for "+this.grammar.name+"]"}checkActionDictsIfHaventAlready(){this.checkedActionDicts||(this.checkActionDicts(),this.checkedActionDicts=!0)}checkActionDicts(){let t;for(t in this.operations)this.operations[t].checkActionDict(this.grammar);for(t in this.attributes)this.attributes[t].checkActionDict(this.grammar)}toRecipe(t){function n(i){return i.super!==xr.BuiltInSemantics._getSemantics()}let r=`(function(g) { -`;if(n(this)){r+=" var semantics = "+this.super.toRecipe(!0)+"(g";const i=this.super.grammar;let o=this.grammar;for(;o!==i;)r+=".superGrammar",o=o.superGrammar;r+=`); -`,r+=" return g.extendSemantics(semantics)"}else r+=" return g.createSemantics()";return["Operation","Attribute"].forEach(i=>{const o=this[i.toLowerCase()+"s"];Object.keys(o).forEach(s=>{const{actionDict:a,formals:u,builtInDefault:c}=o[s];let d=s;u.length>0&&(d+="("+u.join(", ")+")");let p;n(this)&&this.super[i.toLowerCase()+"s"][s]?p="extend"+i:p="add"+i,r+=` - .`+p+"("+JSON.stringify(d)+", {";const h=[];Object.keys(a).forEach(m=>{if(a[m]!==c){let v=a[m].toString().trim();v=v.replace(/^.*\(/,"function("),h.push(` - `+JSON.stringify(m)+": "+v)}}),r+=h.join(",")+` - })`})}),r+=`; - })`,t||(r=`(function() { - var grammar = this.fromRecipe(`+this.grammar.toRecipe()+`); - var semantics = `+r+`(grammar); - return semantics; -}); -`),r}addOperationOrAttribute(t,n,r){const i=t+"s",o=cT(n,t),{name:s}=o,{formals:a}=o;this.assertNewName(s,t);const u=YJ(t,s,p),c={_default:u};Object.keys(r).forEach(h=>{c[h]=r[h]});const d=t==="operation"?new $f(s,a,c,u):new b_(s,c,u);d.checkActionDict(this.grammar),this[i][s]=d;function p(...h){const m=this._semantics[i][s];if(arguments.length!==m.formals.length)throw new Error("Invalid number of arguments passed to "+s+" "+t+" (expected "+m.formals.length+", got "+arguments.length+")");const v=Object.create(null);for(const[y,_]of Object.entries(h)){const E=m.formals[y];v[E]=_}const x=this.args;this.args=v;const b=m.execute(this._semantics,this);return this.args=x,b}t==="operation"?(this.Wrapper.prototype[s]=p,this.Wrapper.prototype[s].toString=function(){return"["+s+" operation]"}):(Object.defineProperty(this.Wrapper.prototype,s,{get:p,configurable:!0}),Object.defineProperty(this.attributeKeys,s,{value:aT(s)}))}extendOperationOrAttribute(t,n,r){const i=t+"s";if(cT(n,"attribute"),!(this.super&&n in this.super[i]))throw new Error("Cannot extend "+t+" '"+n+"': did not inherit an "+t+" with that name");if(w_(this[i],n))throw new Error("Cannot extend "+t+" '"+n+"' again");const o=this[i][n].formals,s=this[i][n].actionDict,a=Object.create(s);Object.keys(r).forEach(u=>{a[u]=r[u]}),this[i][n]=t==="operation"?new $f(n,o,a):new b_(n,a),this[i][n].checkActionDict(this.grammar)}assertNewName(t,n){if(w_(uT.prototype,t))throw new Error("Cannot add "+n+" '"+t+"': that's a reserved name");if(t in this.operations)throw new Error("Cannot add "+n+" '"+t+"': an operation with that name already exists");if(t in this.attributes)throw new Error("Cannot add "+n+" '"+t+"': an attribute with that name already exists")}wrap(t,n,r){const i=r||n;return t instanceof this.Wrapper?t:new this.Wrapper(t,n,i)}}function cT(e,t){if(!xr.prototypeGrammar)return Ps(e.indexOf("(")===-1),{name:e,formals:[]};const n=xr.prototypeGrammar.match(e,t==="operation"?"OperationSignature":"AttributeSignature");if(n.failed())throw new Error(n.message);return xr.prototypeGrammarSemantics(n).parse()}function YJ(e,t,n){return function(...r){const o=(this._semantics.operations[t]||this._semantics.attributes[t]).formals.map(s=>this.args[s]);if(!this.isIteration()&&r.length===1)return n.apply(r[0],o);throw kJ(this.ctorName,t,e,Gc)}}xr.createSemantics=function(e,t){const n=new xr(e,t!==void 0?t:xr.BuiltInSemantics._getSemantics()),r=function(o){if(!(o instanceof rP))throw new TypeError("Semantics expected a MatchResult, but got "+QL(o));if(o.failed())throw new TypeError("cannot apply Semantics to "+o.toString());const s=o._cst;if(s.grammar!==e)throw new Error("Cannot use a MatchResult from grammar '"+s.grammar.name+"' with a semantics for '"+e.name+"'");const a=new vg(o.input);return n.wrap(s,a.interval(o._cstOffset,o.input.length))};return r.addOperation=function(i,o){return n.addOperationOrAttribute("operation",i,o),r},r.extendOperation=function(i,o){return n.extendOperationOrAttribute("operation",i,o),r},r.addAttribute=function(i,o){return n.addOperationOrAttribute("attribute",i,o),r},r.extendAttribute=function(i,o){return n.extendOperationOrAttribute("attribute",i,o),r},r._getActionDict=function(i){const o=n.operations[i]||n.attributes[i];if(!o)throw new Error('"'+i+'" is not a valid operation or attribute name in this semantics for "'+e.name+'"');return o.actionDict},r._remove=function(i){let o;return i in n.operations?(o=n.operations[i],delete n.operations[i]):i in n.attributes&&(o=n.attributes[i],delete n.attributes[i]),delete n.Wrapper.prototype[i],o},r.getOperationNames=function(){return Object.keys(n.operations)},r.getAttributeNames=function(){return Object.keys(n.attributes)},r.getGrammar=function(){return n.grammar},r.toRecipe=function(i){return n.toRecipe(i)},r.toString=n.toString.bind(n),r._getSemantics=function(){return n},r};class $f{constructor(t,n,r,i){this.name=t,this.formals=n,this.actionDict=r,this.builtInDefault=i}checkActionDict(t){t._checkTopDownActionDict(this.typeName,this.name,this.actionDict)}execute(t,n){try{const{ctorName:r}=n._node;let i=this.actionDict[r];return i?(Gc.push([this,r]),i.apply(n,n._children())):n.isNonterminal()&&(i=this.actionDict._nonterminal,i)?(Gc.push([this,"_nonterminal",r]),i.apply(n,n._children())):(Gc.push([this,"default action",r]),this.actionDict._default.apply(n,n._children()))}finally{Gc.pop()}}}$f.prototype.typeName="operation";class b_ extends $f{constructor(t,n,r){super(t,[],n,r)}execute(t,n){const r=n._node,i=t.attributeKeys[this.name];return w_(r,i)||(r[i]=$f.prototype.execute.call(this,t,n)),r[i]}}b_.prototype.typeName="attribute";const fT=["_iter","_terminal","_nonterminal","_default"];function dT(e){return Object.keys(e.rules).sort().map(t=>e.rules[t])}const XJ=e=>e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");let aP,lP;class qn{constructor(t,n,r,i){if(this.name=t,this.superGrammar=n,this.rules=r,i){if(!(i in r))throw new Error("Invalid start rule: '"+i+"' is not a rule in grammar '"+t+"'");this.defaultStartRule=i}this._matchStateInitializer=void 0,this.supportsIncrementalParsing=!0}matcher(){return new qJ(this)}isBuiltIn(){return this===qn.ProtoBuiltInRules||this===qn.BuiltInRules}equals(t){if(this===t)return!0;if(t==null||this.name!==t.name||this.defaultStartRule!==t.defaultStartRule||!(this.superGrammar===t.superGrammar||this.superGrammar.equals(t.superGrammar)))return!1;const n=dT(this),r=dT(t);return n.length===r.length&&n.every((i,o)=>i.description===r[o].description&&i.formals.join(",")===r[o].formals.join(",")&&i.body.toString()===r[o].body.toString())}match(t,n){const r=this.matcher();return r.replaceInputRange(0,0,t),r.match(n)}trace(t,n){const r=this.matcher();return r.replaceInputRange(0,0,t),r.trace(n)}createSemantics(){return xr.createSemantics(this)}extendSemantics(t){return xr.createSemantics(this,t._getSemantics())}_checkTopDownActionDict(t,n,r){const i=[];for(const o in r){const s=r[o];if(!fT.includes(o)&&!(o in this.rules)){i.push(`'${o}' is not a valid semantic action for '${this.name}'`);continue}if(typeof s!="function"){i.push(`'${o}' must be a function in an action dictionary for '${this.name}'`);continue}const u=s.length,c=this._topDownActionArity(o);if(u!==c){let d;o==="_iter"||o==="_nonterminal"?d=`it should use a rest parameter, e.g. \`${o}(...children) {}\`. NOTE: this is new in Ohm v16 — see https://ohmjs.org/d/ati for details.`:d=`expected ${c}, got ${u}`,i.push(`Semantic action '${o}' has the wrong arity: ${d}`)}}if(i.length>0){const o=i.map(a=>"- "+a),s=new Error([`Found errors in the action dictionary of the '${n}' ${t}:`,...o].join(` -`));throw s.problems=i,s}}_topDownActionArity(t){return fT.includes(t)?0:this.rules[t].body.getArity()}_inheritsFrom(t){let n=this.superGrammar;for(;n;){if(n.equals(t,!0))return!0;n=n.superGrammar}return!1}toRecipe(t=void 0){const n={};this.source&&(n.source=this.source.contents);let r=null;this.defaultStartRule&&(r=this.defaultStartRule);const i={};Object.keys(this.rules).forEach(a=>{const u=this.rules[a],{body:c}=u,d=!this.superGrammar||!this.superGrammar.rules[a];let p;d?p="define":p=c instanceof gg?"extend":"override";const h={};if(u.source&&this.source){const x=u.source.relativeTo(this.source);h.sourceInterval=[x.startIdx,x.endIdx]}const m=d?u.description:null,v=c.outputRecipe(u.formals,this.source);i[a]=[p,h,m,u.formals,v]});let o="null";t?o=t:this.superGrammar&&!this.superGrammar.isBuiltIn()&&(o=this.superGrammar.toRecipe());const s=[...["grammar",n,this.name].map(JSON.stringify),o,...[r,i].map(JSON.stringify)];return XJ(`[${s.join(",")}]`)}toOperationActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}toAttributeActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}_toOperationOrAttributeActionDictionaryTemplate(){const t=new za;t.append("{");let n=!0;for(const r in this.rules){const{body:i}=this.rules[r];n?n=!1:t.append(","),t.append(` -`),t.append(" "),this.addSemanticActionTemplate(r,i,t)}return t.append(` -}`),t.contents()}addSemanticActionTemplate(t,n,r){r.append(t),r.append(": function(");const i=this._topDownActionArity(t);r.append(mg("_",i).join(", ")),r.append(`) { -`),r.append(" }")}parseApplication(t){let n;if(t.indexOf("<")===-1)n=new ht(t);else{const i=aP.match(t,"Base_application");n=lP(i,{})}if(!(n.ruleName in this.rules))throw ZL(n.ruleName,this.name);const{formals:r}=this.rules[n.ruleName];if(r.length!==n.args.length){const{source:i}=this.rules[n.ruleName];throw JL(n.ruleName,r.length,n.args.length,i)}return n}_setUpMatchState(t){this._matchStateInitializer&&this._matchStateInitializer(t)}}qn.ProtoBuiltInRules=new qn("ProtoBuiltInRules",void 0,{any:{body:Dn,formals:[],description:"any character",primitive:!0},end:{body:Ln,formals:[],description:"end of input",primitive:!0},caseInsensitive:{body:new F1(new Mn(0)),formals:["str"],primitive:!0},lower:{body:new wn("Ll"),formals:[],description:"a lowercase letter",primitive:!0},upper:{body:new wn("Lu"),formals:[],description:"an uppercase letter",primitive:!0},unicodeLtmo:{body:new wn("Ltmo"),formals:[],description:"a Unicode character in Lt, Lm, or Lo",primitive:!0},spaces:{body:new ja(new ht("space")),formals:[]},space:{body:new Pn("\0"," "),formals:[],description:"a space"}});qn.initApplicationParser=function(e,t){aP=e,lP=t};class pT{constructor(t){this.name=t}sourceInterval(t,n){return this.source.subInterval(t,n-t)}ensureSuperGrammar(){return this.superGrammar||this.withSuperGrammar(this.name==="BuiltInRules"?qn.ProtoBuiltInRules:qn.BuiltInRules),this.superGrammar}ensureSuperGrammarRuleForOverriding(t,n){const r=this.ensureSuperGrammar().rules[t];if(!r)throw vJ(t,this.superGrammar.name,n);return r}installOverriddenOrExtendedRule(t,n,r,i){const o=y_(n);if(o.length>0)throw iT(t,o,i);const s=this.ensureSuperGrammar().rules[t],a=s.formals,u=a?a.length:0;if(n.length!==u)throw JL(t,u,n.length,i);return this.install(t,n,r,s.description,i)}install(t,n,r,i,o,s=!1){return this.rules[t]={body:r.introduceParams(n),formals:n,description:i,source:o,primitive:s},this}withSuperGrammar(t){if(this.superGrammar)throw new Error("the super grammar of a GrammarDecl cannot be set more than once");return this.superGrammar=t,this.rules=Object.create(t.rules),t.isBuiltIn()||(this.defaultStartRule=t.defaultStartRule),this}withDefaultStartRule(t){return this.defaultStartRule=t,this}withSource(t){return this.source=new vg(t).interval(0,t.length),this}build(){const t=new qn(this.name,this.ensureSuperGrammar(),this.rules,this.defaultStartRule);t._matchStateInitializer=t.superGrammar._matchStateInitializer,t.supportsIncrementalParsing=t.superGrammar.supportsIncrementalParsing;const n=[];let r=!1;return Object.keys(t.rules).forEach(i=>{const{body:o}=t.rules[i];try{o.assertChoicesHaveUniformArity(i)}catch(s){n.push(s)}try{o.assertAllApplicationsAreValid(i,t)}catch(s){n.push(s),r=!0}}),r||Object.keys(t.rules).forEach(i=>{const{body:o}=t.rules[i];try{o.assertIteratedExprsAreNotNullable(t,[])}catch(s){n.push(s)}}),n.length>0&&NJ(n),this.source&&(t.source=this.source),t}define(t,n,r,i,o,s){if(this.ensureSuperGrammar(),this.superGrammar.rules[t])throw rT(t,this.name,this.superGrammar.name,o);if(this.rules[t])throw rT(t,this.name,this.name,o);const a=y_(n);if(a.length>0)throw iT(t,a,o);return this.install(t,n,r,i,o,s)}override(t,n,r,i,o){return this.ensureSuperGrammarRuleForOverriding(t,o),this.installOverriddenOrExtendedRule(t,n,r,o),this}extend(t,n,r,i,o){if(!this.ensureSuperGrammar().rules[t])throw xJ(t,this.superGrammar.name,o);const a=new gg(this.superGrammar,t,r);return a.source=r.source,this.installOverriddenOrExtendedRule(t,n,a,o),this}}class pm{constructor(){this.currentDecl=null,this.currentRuleName=null}newGrammar(t){return new pT(t)}grammar(t,n,r,i,o){const s=new pT(n);return r&&s.withSuperGrammar(r instanceof qn?r:this.fromRecipe(r)),i&&s.withDefaultStartRule(i),t&&t.source&&s.withSource(t.source),this.currentDecl=s,Object.keys(o).forEach(a=>{this.currentRuleName=a;const u=o[a],c=u[0],d=u[1],p=u[2],h=u[3],m=this.fromRecipe(u[4]);let v;s.source&&d&&d.sourceInterval&&(v=s.source.subInterval(d.sourceInterval[0],d.sourceInterval[1]-d.sourceInterval[0])),s[c](a,h,m,p,v)}),this.currentRuleName=this.currentDecl=null,s.build()}terminal(t){return new En(t)}range(t,n){return new Pn(t,n)}param(t){return new Mn(t)}alt(...t){let n=[];for(let r of t)r instanceof Ue||(r=this.fromRecipe(r)),r instanceof rn?n=n.concat(r.terms):n.push(r);return n.length===1?n[0]:new rn(n)}seq(...t){let n=[];for(let r of t)r instanceof Ue||(r=this.fromRecipe(r)),r instanceof dn?n=n.concat(r.factors):n.push(r);return n.length===1?n[0]:new dn(n)}star(t){return t instanceof Ue||(t=this.fromRecipe(t)),new ja(t)}plus(t){return t instanceof Ue||(t=this.fromRecipe(t)),new Pu(t)}opt(t){return t instanceof Ue||(t=this.fromRecipe(t)),new Lo(t)}not(t){return t instanceof Ue||(t=this.fromRecipe(t)),new tr(t)}lookahead(t){return t instanceof Ue||(t=this.fromRecipe(t)),new nr(t)}lex(t){return t instanceof Ue||(t=this.fromRecipe(t)),new wr(t)}app(t,n){return n&&n.length>0&&(n=n.map(function(r){return r instanceof Ue?r:this.fromRecipe(r)},this)),new ht(t,n)}splice(t,n){return new yg(this.currentDecl.superGrammar,this.currentRuleName,t.map(r=>this.fromRecipe(r)),n.map(r=>this.fromRecipe(r)))}fromRecipe(t){const n=t[0]==="grammar"?t.slice(1):t.slice(2),r=this[t[0]](...n),i=t[1];return i&&i.sourceInterval&&this.currentDecl&&r.withSource(this.currentDecl.sourceInterval(...i.sourceInterval)),r}}function B1(e){return typeof e=="function"?e.call(new pm):(typeof e=="string"&&(e=JSON.parse(e)),new pm().fromRecipe(e))}const H1=B1(["grammar",{source:`BuiltInRules { - - alnum (an alpha-numeric character) - = letter - | digit - - letter (a letter) - = lower - | upper - | unicodeLtmo - - digit (a digit) - = "0".."9" - - hexDigit (a hexadecimal digit) - = digit - | "a".."f" - | "A".."F" - - ListOf - = NonemptyListOf - | EmptyListOf - - NonemptyListOf - = elem (sep elem)* - - EmptyListOf - = /* nothing */ - - listOf - = nonemptyListOf - | emptyListOf - - nonemptyListOf - = elem (sep elem)* - - emptyListOf - = /* nothing */ - - // Allows a syntactic rule application within a lexical context. - applySyntactic = app -}`},"BuiltInRules",null,null,{alnum:["define",{sourceInterval:[18,78]},"an alpha-numeric character",[],["alt",{sourceInterval:[60,78]},["app",{sourceInterval:[60,66]},"letter",[]],["app",{sourceInterval:[73,78]},"digit",[]]]],letter:["define",{sourceInterval:[82,142]},"a letter",[],["alt",{sourceInterval:[107,142]},["app",{sourceInterval:[107,112]},"lower",[]],["app",{sourceInterval:[119,124]},"upper",[]],["app",{sourceInterval:[131,142]},"unicodeLtmo",[]]]],digit:["define",{sourceInterval:[146,177]},"a digit",[],["range",{sourceInterval:[169,177]},"0","9"]],hexDigit:["define",{sourceInterval:[181,254]},"a hexadecimal digit",[],["alt",{sourceInterval:[219,254]},["app",{sourceInterval:[219,224]},"digit",[]],["range",{sourceInterval:[231,239]},"a","f"],["range",{sourceInterval:[246,254]},"A","F"]]],ListOf:["define",{sourceInterval:[258,336]},null,["elem","sep"],["alt",{sourceInterval:[282,336]},["app",{sourceInterval:[282,307]},"NonemptyListOf",[["param",{sourceInterval:[297,301]},0],["param",{sourceInterval:[303,306]},1]]],["app",{sourceInterval:[314,336]},"EmptyListOf",[["param",{sourceInterval:[326,330]},0],["param",{sourceInterval:[332,335]},1]]]]],NonemptyListOf:["define",{sourceInterval:[340,388]},null,["elem","sep"],["seq",{sourceInterval:[372,388]},["param",{sourceInterval:[372,376]},0],["star",{sourceInterval:[377,388]},["seq",{sourceInterval:[378,386]},["param",{sourceInterval:[378,381]},1],["param",{sourceInterval:[382,386]},0]]]]],EmptyListOf:["define",{sourceInterval:[392,434]},null,["elem","sep"],["seq",{sourceInterval:[438,438]}]],listOf:["define",{sourceInterval:[438,516]},null,["elem","sep"],["alt",{sourceInterval:[462,516]},["app",{sourceInterval:[462,487]},"nonemptyListOf",[["param",{sourceInterval:[477,481]},0],["param",{sourceInterval:[483,486]},1]]],["app",{sourceInterval:[494,516]},"emptyListOf",[["param",{sourceInterval:[506,510]},0],["param",{sourceInterval:[512,515]},1]]]]],nonemptyListOf:["define",{sourceInterval:[520,568]},null,["elem","sep"],["seq",{sourceInterval:[552,568]},["param",{sourceInterval:[552,556]},0],["star",{sourceInterval:[557,568]},["seq",{sourceInterval:[558,566]},["param",{sourceInterval:[558,561]},1],["param",{sourceInterval:[562,566]},0]]]]],emptyListOf:["define",{sourceInterval:[572,682]},null,["elem","sep"],["seq",{sourceInterval:[685,685]}]],applySyntactic:["define",{sourceInterval:[685,710]},null,["app"],["param",{sourceInterval:[707,710]},0]]}]);qn.BuiltInRules=H1;DJ(qn.BuiltInRules);const z1=B1(["grammar",{source:`Ohm { - - Grammars - = Grammar* - - Grammar - = ident SuperGrammar? "{" Rule* "}" - - SuperGrammar - = "<:" ident - - Rule - = ident Formals? ruleDescr? "=" RuleBody -- define - | ident Formals? ":=" OverrideRuleBody -- override - | ident Formals? "+=" RuleBody -- extend - - RuleBody - = "|"? NonemptyListOf - - TopLevelTerm - = Seq caseName -- inline - | Seq - - OverrideRuleBody - = "|"? NonemptyListOf - - OverrideTopLevelTerm - = "..." -- superSplice - | TopLevelTerm - - Formals - = "<" ListOf ">" - - Params - = "<" ListOf ">" - - Alt - = NonemptyListOf - - Seq - = Iter* - - Iter - = Pred "*" -- star - | Pred "+" -- plus - | Pred "?" -- opt - | Pred - - Pred - = "~" Lex -- not - | "&" Lex -- lookahead - | Lex - - Lex - = "#" Base -- lex - | Base - - Base - = ident Params? ~(ruleDescr? "=" | ":=" | "+=") -- application - | oneCharTerminal ".." oneCharTerminal -- range - | terminal -- terminal - | "(" Alt ")" -- paren - - ruleDescr (a rule description) - = "(" ruleDescrText ")" - - ruleDescrText - = (~")" any)* - - caseName - = "--" (~"\\n" space)* name (~"\\n" space)* ("\\n" | &"}") - - name (a name) - = nameFirst nameRest* - - nameFirst - = "_" - | letter - - nameRest - = "_" - | alnum - - ident (an identifier) - = name - - terminal - = "\\"" terminalChar* "\\"" - - oneCharTerminal - = "\\"" terminalChar "\\"" - - terminalChar - = escapeChar - | ~"\\\\" ~"\\"" ~"\\n" "\\u{0}".."\\u{10FFFF}" - - escapeChar (an escape sequence) - = "\\\\\\\\" -- backslash - | "\\\\\\"" -- doubleQuote - | "\\\\\\'" -- singleQuote - | "\\\\b" -- backspace - | "\\\\n" -- lineFeed - | "\\\\r" -- carriageReturn - | "\\\\t" -- tab - | "\\\\u{" hexDigit hexDigit? hexDigit? - hexDigit? hexDigit? hexDigit? "}" -- unicodeCodePoint - | "\\\\u" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape - | "\\\\x" hexDigit hexDigit -- hexEscape - - space - += comment - - comment - = "//" (~"\\n" any)* &("\\n" | end) -- singleLine - | "/*" (~"*/" any)* "*/" -- multiLine - - tokens = token* - - token = caseName | comment | ident | operator | punctuation | terminal | any - - operator = "<:" | "=" | ":=" | "+=" | "*" | "+" | "?" | "~" | "&" - - punctuation = "<" | ">" | "," | "--" -}`},"Ohm",null,"Grammars",{Grammars:["define",{sourceInterval:[9,32]},null,[],["star",{sourceInterval:[24,32]},["app",{sourceInterval:[24,31]},"Grammar",[]]]],Grammar:["define",{sourceInterval:[36,83]},null,[],["seq",{sourceInterval:[50,83]},["app",{sourceInterval:[50,55]},"ident",[]],["opt",{sourceInterval:[56,69]},["app",{sourceInterval:[56,68]},"SuperGrammar",[]]],["terminal",{sourceInterval:[70,73]},"{"],["star",{sourceInterval:[74,79]},["app",{sourceInterval:[74,78]},"Rule",[]]],["terminal",{sourceInterval:[80,83]},"}"]]],SuperGrammar:["define",{sourceInterval:[87,116]},null,[],["seq",{sourceInterval:[106,116]},["terminal",{sourceInterval:[106,110]},"<:"],["app",{sourceInterval:[111,116]},"ident",[]]]],Rule_define:["define",{sourceInterval:[131,181]},null,[],["seq",{sourceInterval:[131,170]},["app",{sourceInterval:[131,136]},"ident",[]],["opt",{sourceInterval:[137,145]},["app",{sourceInterval:[137,144]},"Formals",[]]],["opt",{sourceInterval:[146,156]},["app",{sourceInterval:[146,155]},"ruleDescr",[]]],["terminal",{sourceInterval:[157,160]},"="],["app",{sourceInterval:[162,170]},"RuleBody",[]]]],Rule_override:["define",{sourceInterval:[188,248]},null,[],["seq",{sourceInterval:[188,235]},["app",{sourceInterval:[188,193]},"ident",[]],["opt",{sourceInterval:[194,202]},["app",{sourceInterval:[194,201]},"Formals",[]]],["terminal",{sourceInterval:[214,218]},":="],["app",{sourceInterval:[219,235]},"OverrideRuleBody",[]]]],Rule_extend:["define",{sourceInterval:[255,305]},null,[],["seq",{sourceInterval:[255,294]},["app",{sourceInterval:[255,260]},"ident",[]],["opt",{sourceInterval:[261,269]},["app",{sourceInterval:[261,268]},"Formals",[]]],["terminal",{sourceInterval:[281,285]},"+="],["app",{sourceInterval:[286,294]},"RuleBody",[]]]],Rule:["define",{sourceInterval:[120,305]},null,[],["alt",{sourceInterval:[131,305]},["app",{sourceInterval:[131,170]},"Rule_define",[]],["app",{sourceInterval:[188,235]},"Rule_override",[]],["app",{sourceInterval:[255,294]},"Rule_extend",[]]]],RuleBody:["define",{sourceInterval:[309,362]},null,[],["seq",{sourceInterval:[324,362]},["opt",{sourceInterval:[324,328]},["terminal",{sourceInterval:[324,327]},"|"]],["app",{sourceInterval:[329,362]},"NonemptyListOf",[["app",{sourceInterval:[344,356]},"TopLevelTerm",[]],["terminal",{sourceInterval:[358,361]},"|"]]]]],TopLevelTerm_inline:["define",{sourceInterval:[385,408]},null,[],["seq",{sourceInterval:[385,397]},["app",{sourceInterval:[385,388]},"Seq",[]],["app",{sourceInterval:[389,397]},"caseName",[]]]],TopLevelTerm:["define",{sourceInterval:[366,418]},null,[],["alt",{sourceInterval:[385,418]},["app",{sourceInterval:[385,397]},"TopLevelTerm_inline",[]],["app",{sourceInterval:[415,418]},"Seq",[]]]],OverrideRuleBody:["define",{sourceInterval:[422,491]},null,[],["seq",{sourceInterval:[445,491]},["opt",{sourceInterval:[445,449]},["terminal",{sourceInterval:[445,448]},"|"]],["app",{sourceInterval:[450,491]},"NonemptyListOf",[["app",{sourceInterval:[465,485]},"OverrideTopLevelTerm",[]],["terminal",{sourceInterval:[487,490]},"|"]]]]],OverrideTopLevelTerm_superSplice:["define",{sourceInterval:[522,543]},null,[],["terminal",{sourceInterval:[522,527]},"..."]],OverrideTopLevelTerm:["define",{sourceInterval:[495,562]},null,[],["alt",{sourceInterval:[522,562]},["app",{sourceInterval:[522,527]},"OverrideTopLevelTerm_superSplice",[]],["app",{sourceInterval:[550,562]},"TopLevelTerm",[]]]],Formals:["define",{sourceInterval:[566,606]},null,[],["seq",{sourceInterval:[580,606]},["terminal",{sourceInterval:[580,583]},"<"],["app",{sourceInterval:[584,602]},"ListOf",[["app",{sourceInterval:[591,596]},"ident",[]],["terminal",{sourceInterval:[598,601]},","]]],["terminal",{sourceInterval:[603,606]},">"]]],Params:["define",{sourceInterval:[610,647]},null,[],["seq",{sourceInterval:[623,647]},["terminal",{sourceInterval:[623,626]},"<"],["app",{sourceInterval:[627,643]},"ListOf",[["app",{sourceInterval:[634,637]},"Seq",[]],["terminal",{sourceInterval:[639,642]},","]]],["terminal",{sourceInterval:[644,647]},">"]]],Alt:["define",{sourceInterval:[651,685]},null,[],["app",{sourceInterval:[661,685]},"NonemptyListOf",[["app",{sourceInterval:[676,679]},"Seq",[]],["terminal",{sourceInterval:[681,684]},"|"]]]],Seq:["define",{sourceInterval:[689,704]},null,[],["star",{sourceInterval:[699,704]},["app",{sourceInterval:[699,703]},"Iter",[]]]],Iter_star:["define",{sourceInterval:[719,736]},null,[],["seq",{sourceInterval:[719,727]},["app",{sourceInterval:[719,723]},"Pred",[]],["terminal",{sourceInterval:[724,727]},"*"]]],Iter_plus:["define",{sourceInterval:[743,760]},null,[],["seq",{sourceInterval:[743,751]},["app",{sourceInterval:[743,747]},"Pred",[]],["terminal",{sourceInterval:[748,751]},"+"]]],Iter_opt:["define",{sourceInterval:[767,783]},null,[],["seq",{sourceInterval:[767,775]},["app",{sourceInterval:[767,771]},"Pred",[]],["terminal",{sourceInterval:[772,775]},"?"]]],Iter:["define",{sourceInterval:[708,794]},null,[],["alt",{sourceInterval:[719,794]},["app",{sourceInterval:[719,727]},"Iter_star",[]],["app",{sourceInterval:[743,751]},"Iter_plus",[]],["app",{sourceInterval:[767,775]},"Iter_opt",[]],["app",{sourceInterval:[790,794]},"Pred",[]]]],Pred_not:["define",{sourceInterval:[809,824]},null,[],["seq",{sourceInterval:[809,816]},["terminal",{sourceInterval:[809,812]},"~"],["app",{sourceInterval:[813,816]},"Lex",[]]]],Pred_lookahead:["define",{sourceInterval:[831,852]},null,[],["seq",{sourceInterval:[831,838]},["terminal",{sourceInterval:[831,834]},"&"],["app",{sourceInterval:[835,838]},"Lex",[]]]],Pred:["define",{sourceInterval:[798,862]},null,[],["alt",{sourceInterval:[809,862]},["app",{sourceInterval:[809,816]},"Pred_not",[]],["app",{sourceInterval:[831,838]},"Pred_lookahead",[]],["app",{sourceInterval:[859,862]},"Lex",[]]]],Lex_lex:["define",{sourceInterval:[876,892]},null,[],["seq",{sourceInterval:[876,884]},["terminal",{sourceInterval:[876,879]},"#"],["app",{sourceInterval:[880,884]},"Base",[]]]],Lex:["define",{sourceInterval:[866,903]},null,[],["alt",{sourceInterval:[876,903]},["app",{sourceInterval:[876,884]},"Lex_lex",[]],["app",{sourceInterval:[899,903]},"Base",[]]]],Base_application:["define",{sourceInterval:[918,979]},null,[],["seq",{sourceInterval:[918,963]},["app",{sourceInterval:[918,923]},"ident",[]],["opt",{sourceInterval:[924,931]},["app",{sourceInterval:[924,930]},"Params",[]]],["not",{sourceInterval:[932,963]},["alt",{sourceInterval:[934,962]},["seq",{sourceInterval:[934,948]},["opt",{sourceInterval:[934,944]},["app",{sourceInterval:[934,943]},"ruleDescr",[]]],["terminal",{sourceInterval:[945,948]},"="]],["terminal",{sourceInterval:[951,955]},":="],["terminal",{sourceInterval:[958,962]},"+="]]]]],Base_range:["define",{sourceInterval:[986,1041]},null,[],["seq",{sourceInterval:[986,1022]},["app",{sourceInterval:[986,1001]},"oneCharTerminal",[]],["terminal",{sourceInterval:[1002,1006]},".."],["app",{sourceInterval:[1007,1022]},"oneCharTerminal",[]]]],Base_terminal:["define",{sourceInterval:[1048,1106]},null,[],["app",{sourceInterval:[1048,1056]},"terminal",[]]],Base_paren:["define",{sourceInterval:[1113,1168]},null,[],["seq",{sourceInterval:[1113,1124]},["terminal",{sourceInterval:[1113,1116]},"("],["app",{sourceInterval:[1117,1120]},"Alt",[]],["terminal",{sourceInterval:[1121,1124]},")"]]],Base:["define",{sourceInterval:[907,1168]},null,[],["alt",{sourceInterval:[918,1168]},["app",{sourceInterval:[918,963]},"Base_application",[]],["app",{sourceInterval:[986,1022]},"Base_range",[]],["app",{sourceInterval:[1048,1056]},"Base_terminal",[]],["app",{sourceInterval:[1113,1124]},"Base_paren",[]]]],ruleDescr:["define",{sourceInterval:[1172,1231]},"a rule description",[],["seq",{sourceInterval:[1210,1231]},["terminal",{sourceInterval:[1210,1213]},"("],["app",{sourceInterval:[1214,1227]},"ruleDescrText",[]],["terminal",{sourceInterval:[1228,1231]},")"]]],ruleDescrText:["define",{sourceInterval:[1235,1266]},null,[],["star",{sourceInterval:[1255,1266]},["seq",{sourceInterval:[1256,1264]},["not",{sourceInterval:[1256,1260]},["terminal",{sourceInterval:[1257,1260]},")"]],["app",{sourceInterval:[1261,1264]},"any",[]]]]],caseName:["define",{sourceInterval:[1270,1338]},null,[],["seq",{sourceInterval:[1285,1338]},["terminal",{sourceInterval:[1285,1289]},"--"],["star",{sourceInterval:[1290,1304]},["seq",{sourceInterval:[1291,1302]},["not",{sourceInterval:[1291,1296]},["terminal",{sourceInterval:[1292,1296]},` -`]],["app",{sourceInterval:[1297,1302]},"space",[]]]],["app",{sourceInterval:[1305,1309]},"name",[]],["star",{sourceInterval:[1310,1324]},["seq",{sourceInterval:[1311,1322]},["not",{sourceInterval:[1311,1316]},["terminal",{sourceInterval:[1312,1316]},` -`]],["app",{sourceInterval:[1317,1322]},"space",[]]]],["alt",{sourceInterval:[1326,1337]},["terminal",{sourceInterval:[1326,1330]},` -`],["lookahead",{sourceInterval:[1333,1337]},["terminal",{sourceInterval:[1334,1337]},"}"]]]]],name:["define",{sourceInterval:[1342,1382]},"a name",[],["seq",{sourceInterval:[1363,1382]},["app",{sourceInterval:[1363,1372]},"nameFirst",[]],["star",{sourceInterval:[1373,1382]},["app",{sourceInterval:[1373,1381]},"nameRest",[]]]]],nameFirst:["define",{sourceInterval:[1386,1418]},null,[],["alt",{sourceInterval:[1402,1418]},["terminal",{sourceInterval:[1402,1405]},"_"],["app",{sourceInterval:[1412,1418]},"letter",[]]]],nameRest:["define",{sourceInterval:[1422,1452]},null,[],["alt",{sourceInterval:[1437,1452]},["terminal",{sourceInterval:[1437,1440]},"_"],["app",{sourceInterval:[1447,1452]},"alnum",[]]]],ident:["define",{sourceInterval:[1456,1489]},"an identifier",[],["app",{sourceInterval:[1485,1489]},"name",[]]],terminal:["define",{sourceInterval:[1493,1531]},null,[],["seq",{sourceInterval:[1508,1531]},["terminal",{sourceInterval:[1508,1512]},'"'],["star",{sourceInterval:[1513,1526]},["app",{sourceInterval:[1513,1525]},"terminalChar",[]]],["terminal",{sourceInterval:[1527,1531]},'"']]],oneCharTerminal:["define",{sourceInterval:[1535,1579]},null,[],["seq",{sourceInterval:[1557,1579]},["terminal",{sourceInterval:[1557,1561]},'"'],["app",{sourceInterval:[1562,1574]},"terminalChar",[]],["terminal",{sourceInterval:[1575,1579]},'"']]],terminalChar:["define",{sourceInterval:[1583,1660]},null,[],["alt",{sourceInterval:[1602,1660]},["app",{sourceInterval:[1602,1612]},"escapeChar",[]],["seq",{sourceInterval:[1621,1660]},["not",{sourceInterval:[1621,1626]},["terminal",{sourceInterval:[1622,1626]},"\\"]],["not",{sourceInterval:[1627,1632]},["terminal",{sourceInterval:[1628,1632]},'"']],["not",{sourceInterval:[1633,1638]},["terminal",{sourceInterval:[1634,1638]},` -`]],["range",{sourceInterval:[1639,1660]},"\0","􏿿"]]]],escapeChar_backslash:["define",{sourceInterval:[1703,1758]},null,[],["terminal",{sourceInterval:[1703,1709]},"\\\\"]],escapeChar_doubleQuote:["define",{sourceInterval:[1765,1822]},null,[],["terminal",{sourceInterval:[1765,1771]},'\\"']],escapeChar_singleQuote:["define",{sourceInterval:[1829,1886]},null,[],["terminal",{sourceInterval:[1829,1835]},"\\'"]],escapeChar_backspace:["define",{sourceInterval:[1893,1948]},null,[],["terminal",{sourceInterval:[1893,1898]},"\\b"]],escapeChar_lineFeed:["define",{sourceInterval:[1955,2009]},null,[],["terminal",{sourceInterval:[1955,1960]},"\\n"]],escapeChar_carriageReturn:["define",{sourceInterval:[2016,2076]},null,[],["terminal",{sourceInterval:[2016,2021]},"\\r"]],escapeChar_tab:["define",{sourceInterval:[2083,2132]},null,[],["terminal",{sourceInterval:[2083,2088]},"\\t"]],escapeChar_unicodeCodePoint:["define",{sourceInterval:[2139,2243]},null,[],["seq",{sourceInterval:[2139,2221]},["terminal",{sourceInterval:[2139,2145]},"\\u{"],["app",{sourceInterval:[2146,2154]},"hexDigit",[]],["opt",{sourceInterval:[2155,2164]},["app",{sourceInterval:[2155,2163]},"hexDigit",[]]],["opt",{sourceInterval:[2165,2174]},["app",{sourceInterval:[2165,2173]},"hexDigit",[]]],["opt",{sourceInterval:[2188,2197]},["app",{sourceInterval:[2188,2196]},"hexDigit",[]]],["opt",{sourceInterval:[2198,2207]},["app",{sourceInterval:[2198,2206]},"hexDigit",[]]],["opt",{sourceInterval:[2208,2217]},["app",{sourceInterval:[2208,2216]},"hexDigit",[]]],["terminal",{sourceInterval:[2218,2221]},"}"]]],escapeChar_unicodeEscape:["define",{sourceInterval:[2250,2309]},null,[],["seq",{sourceInterval:[2250,2291]},["terminal",{sourceInterval:[2250,2255]},"\\u"],["app",{sourceInterval:[2256,2264]},"hexDigit",[]],["app",{sourceInterval:[2265,2273]},"hexDigit",[]],["app",{sourceInterval:[2274,2282]},"hexDigit",[]],["app",{sourceInterval:[2283,2291]},"hexDigit",[]]]],escapeChar_hexEscape:["define",{sourceInterval:[2316,2371]},null,[],["seq",{sourceInterval:[2316,2339]},["terminal",{sourceInterval:[2316,2321]},"\\x"],["app",{sourceInterval:[2322,2330]},"hexDigit",[]],["app",{sourceInterval:[2331,2339]},"hexDigit",[]]]],escapeChar:["define",{sourceInterval:[1664,2371]},"an escape sequence",[],["alt",{sourceInterval:[1703,2371]},["app",{sourceInterval:[1703,1709]},"escapeChar_backslash",[]],["app",{sourceInterval:[1765,1771]},"escapeChar_doubleQuote",[]],["app",{sourceInterval:[1829,1835]},"escapeChar_singleQuote",[]],["app",{sourceInterval:[1893,1898]},"escapeChar_backspace",[]],["app",{sourceInterval:[1955,1960]},"escapeChar_lineFeed",[]],["app",{sourceInterval:[2016,2021]},"escapeChar_carriageReturn",[]],["app",{sourceInterval:[2083,2088]},"escapeChar_tab",[]],["app",{sourceInterval:[2139,2221]},"escapeChar_unicodeCodePoint",[]],["app",{sourceInterval:[2250,2291]},"escapeChar_unicodeEscape",[]],["app",{sourceInterval:[2316,2339]},"escapeChar_hexEscape",[]]]],space:["extend",{sourceInterval:[2375,2394]},null,[],["app",{sourceInterval:[2387,2394]},"comment",[]]],comment_singleLine:["define",{sourceInterval:[2412,2458]},null,[],["seq",{sourceInterval:[2412,2443]},["terminal",{sourceInterval:[2412,2416]},"//"],["star",{sourceInterval:[2417,2429]},["seq",{sourceInterval:[2418,2427]},["not",{sourceInterval:[2418,2423]},["terminal",{sourceInterval:[2419,2423]},` -`]],["app",{sourceInterval:[2424,2427]},"any",[]]]],["lookahead",{sourceInterval:[2430,2443]},["alt",{sourceInterval:[2432,2442]},["terminal",{sourceInterval:[2432,2436]},` -`],["app",{sourceInterval:[2439,2442]},"end",[]]]]]],comment_multiLine:["define",{sourceInterval:[2465,2501]},null,[],["seq",{sourceInterval:[2465,2487]},["terminal",{sourceInterval:[2465,2469]},"/*"],["star",{sourceInterval:[2470,2482]},["seq",{sourceInterval:[2471,2480]},["not",{sourceInterval:[2471,2476]},["terminal",{sourceInterval:[2472,2476]},"*/"]],["app",{sourceInterval:[2477,2480]},"any",[]]]],["terminal",{sourceInterval:[2483,2487]},"*/"]]],comment:["define",{sourceInterval:[2398,2501]},null,[],["alt",{sourceInterval:[2412,2501]},["app",{sourceInterval:[2412,2443]},"comment_singleLine",[]],["app",{sourceInterval:[2465,2487]},"comment_multiLine",[]]]],tokens:["define",{sourceInterval:[2505,2520]},null,[],["star",{sourceInterval:[2514,2520]},["app",{sourceInterval:[2514,2519]},"token",[]]]],token:["define",{sourceInterval:[2524,2600]},null,[],["alt",{sourceInterval:[2532,2600]},["app",{sourceInterval:[2532,2540]},"caseName",[]],["app",{sourceInterval:[2543,2550]},"comment",[]],["app",{sourceInterval:[2553,2558]},"ident",[]],["app",{sourceInterval:[2561,2569]},"operator",[]],["app",{sourceInterval:[2572,2583]},"punctuation",[]],["app",{sourceInterval:[2586,2594]},"terminal",[]],["app",{sourceInterval:[2597,2600]},"any",[]]]],operator:["define",{sourceInterval:[2604,2669]},null,[],["alt",{sourceInterval:[2615,2669]},["terminal",{sourceInterval:[2615,2619]},"<:"],["terminal",{sourceInterval:[2622,2625]},"="],["terminal",{sourceInterval:[2628,2632]},":="],["terminal",{sourceInterval:[2635,2639]},"+="],["terminal",{sourceInterval:[2642,2645]},"*"],["terminal",{sourceInterval:[2648,2651]},"+"],["terminal",{sourceInterval:[2654,2657]},"?"],["terminal",{sourceInterval:[2660,2663]},"~"],["terminal",{sourceInterval:[2666,2669]},"&"]]],punctuation:["define",{sourceInterval:[2673,2709]},null,[],["alt",{sourceInterval:[2687,2709]},["terminal",{sourceInterval:[2687,2690]},"<"],["terminal",{sourceInterval:[2693,2696]},">"],["terminal",{sourceInterval:[2699,2702]},","],["terminal",{sourceInterval:[2705,2709]},"--"]]]}]),v0=Object.create(Ue.prototype);function hT(e,t){for(const n in e)if(n===t)return!0;return!1}function uP(e,t,n){const r=new pm;let i,o,s,a=!1;return(n||z1).createSemantics().addOperation("visit",{Grammars(d){return d.children.map(p=>p.visit())},Grammar(d,p,h,m,v){const x=d.visit();i=r.newGrammar(x),p.child(0)&&p.child(0).visit(),m.children.map(y=>y.visit());const b=i.build();if(b.source=this.source.trimmed(),hT(t,x))throw gJ(b);return t[x]=b,b},SuperGrammar(d,p){const h=p.visit();if(h==="null")i.withSuperGrammar(null);else{if(!t||!hT(t,h))throw mJ(h,t,p.source);i.withSuperGrammar(t[h])}},Rule_define(d,p,h,m,v){o=d.visit(),s=p.children.map(_=>_.visit())[0]||[],!i.defaultStartRule&&i.ensureSuperGrammar()!==qn.ProtoBuiltInRules&&i.withDefaultStartRule(o);const x=v.visit(),b=h.children.map(_=>_.visit())[0],y=this.source.trimmed();return i.define(o,s,x,b,y)},Rule_override(d,p,h,m){o=d.visit(),s=p.children.map(b=>b.visit())[0]||[];const v=this.source.trimmed();i.ensureSuperGrammarRuleForOverriding(o,v),a=!0;const x=m.visit();return a=!1,i.override(o,s,x,null,v)},Rule_extend(d,p,h,m){o=d.visit(),s=p.children.map(b=>b.visit())[0]||[];const v=m.visit(),x=this.source.trimmed();return i.extend(o,s,v,null,x)},RuleBody(d,p){return r.alt(...p.visit()).withSource(this.source)},OverrideRuleBody(d,p){const h=p.visit(),m=h.indexOf(v0);if(m>=0){const v=h.slice(0,m),x=h.slice(m+1);return x.forEach(b=>{if(b===v0)throw IJ(b)}),new yg(i.superGrammar,o,v,x).withSource(this.source)}else return r.alt(...h).withSource(this.source)},Formals(d,p,h){return p.visit()},Params(d,p,h){return p.visit()},Alt(d){return r.alt(...d.visit()).withSource(this.source)},TopLevelTerm_inline(d,p){const h=o+"_"+p.visit(),m=d.visit(),v=this.source.trimmed(),x=!(i.superGrammar&&i.superGrammar.rules[h]);a&&!x?i.override(h,s,m,null,v):i.define(h,s,m,null,v);const b=s.map(y=>r.app(y));return r.app(h,b).withSource(m.source)},OverrideTopLevelTerm_superSplice(d){return v0},Seq(d){return r.seq(...d.children.map(p=>p.visit())).withSource(this.source)},Iter_star(d,p){return r.star(d.visit()).withSource(this.source)},Iter_plus(d,p){return r.plus(d.visit()).withSource(this.source)},Iter_opt(d,p){return r.opt(d.visit()).withSource(this.source)},Pred_not(d,p){return r.not(p.visit()).withSource(this.source)},Pred_lookahead(d,p){return r.lookahead(p.visit()).withSource(this.source)},Lex_lex(d,p){return r.lex(p.visit()).withSource(this.source)},Base_application(d,p){const h=p.children.map(m=>m.visit())[0]||[];return r.app(d.visit(),h).withSource(this.source)},Base_range(d,p,h){return r.range(d.visit(),h.visit()).withSource(this.source)},Base_terminal(d){return r.terminal(d.visit()).withSource(this.source)},Base_paren(d,p,h){return p.visit()},ruleDescr(d,p,h){return p.visit()},ruleDescrText(d){return this.sourceString.trim()},caseName(d,p,h,m,v){return h.visit()},name(d,p){return this.sourceString},nameFirst(d){},nameRest(d){},terminal(d,p,h){return p.children.map(m=>m.visit()).join("")},oneCharTerminal(d,p,h){return p.visit()},escapeChar(d){try{return XL(this.sourceString)}catch(p){throw p instanceof RangeError&&p.message.startsWith("Invalid code point ")?AJ(d):p}},NonemptyListOf(d,p,h){return[d.visit()].concat(h.children.map(m=>m.visit()))},EmptyListOf(){return[]},_terminal(){return this.sourceString}})(e).visit()}const QJ=B1(["grammar",{source:`OperationsAndAttributes { - - AttributeSignature = - name - - OperationSignature = - name Formals? - - Formals - = "(" ListOf ")" - - name (a name) - = nameFirst nameRest* - - nameFirst - = "_" - | letter - - nameRest - = "_" - | alnum - -}`},"OperationsAndAttributes",null,"AttributeSignature",{AttributeSignature:["define",{sourceInterval:[29,58]},null,[],["app",{sourceInterval:[54,58]},"name",[]]],OperationSignature:["define",{sourceInterval:[62,100]},null,[],["seq",{sourceInterval:[87,100]},["app",{sourceInterval:[87,91]},"name",[]],["opt",{sourceInterval:[92,100]},["app",{sourceInterval:[92,99]},"Formals",[]]]]],Formals:["define",{sourceInterval:[104,143]},null,[],["seq",{sourceInterval:[118,143]},["terminal",{sourceInterval:[118,121]},"("],["app",{sourceInterval:[122,139]},"ListOf",[["app",{sourceInterval:[129,133]},"name",[]],["terminal",{sourceInterval:[135,138]},","]]],["terminal",{sourceInterval:[140,143]},")"]]],name:["define",{sourceInterval:[147,187]},"a name",[],["seq",{sourceInterval:[168,187]},["app",{sourceInterval:[168,177]},"nameFirst",[]],["star",{sourceInterval:[178,187]},["app",{sourceInterval:[178,186]},"nameRest",[]]]]],nameFirst:["define",{sourceInterval:[191,223]},null,[],["alt",{sourceInterval:[207,223]},["terminal",{sourceInterval:[207,210]},"_"],["app",{sourceInterval:[217,223]},"letter",[]]]],nameRest:["define",{sourceInterval:[227,257]},null,[],["alt",{sourceInterval:[242,257]},["terminal",{sourceInterval:[242,245]},"_"],["app",{sourceInterval:[252,257]},"alnum",[]]]]}]);ZJ(qn.BuiltInRules);JJ(QJ);function ZJ(e){const t={empty(){return this.iteration()},nonEmpty(n,r,i){return this.iteration([n].concat(i.children))}};xr.BuiltInSemantics=xr.createSemantics(e,null).addOperation("asIteration",{emptyListOf:t.empty,nonemptyListOf:t.nonEmpty,EmptyListOf:t.empty,NonemptyListOf:t.nonEmpty})}function JJ(e){xr.prototypeGrammarSemantics=e.createSemantics().addOperation("parse",{AttributeSignature(t){return{name:t.parse(),formals:[]}},OperationSignature(t,n){return{name:t.parse(),formals:n.children.map(r=>r.parse())[0]||[]}},Formals(t,n,r){return n.asIteration().children.map(i=>i.parse())},name(t,n){return this.sourceString}}),xr.prototypeGrammar=e}function eee(e){let t=0;const n=[0],r=()=>n[n.length-1],i={},o=/( *).*(?:$|\r?\n|\r)/g;let s;for(;(s=o.exec(e))!=null;){const[a,u]=s;if(a.length===0)break;const c=u.length,d=r(),p=t+c;if(c>d)n.push(c),i[p]=1;else if(c1&&(i[t]=1-n.length),i}const cP="an indented block",fP="a dedent",mT=1114112;class tee extends vg{constructor(t){super(t.input),this.state=t}_indentationAt(t){return this.state.userData[t]||0}atEnd(){return super.atEnd()&&this._indentationAt(this.pos)===0}next(){if(this._indentationAt(this.pos)!==0){this.examinedLength=Math.max(this.examinedLength,this.pos);return}return super.next()}nextCharCode(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),mT):super.nextCharCode()}nextCodePoint(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),mT):super.nextCodePoint()}}class gT extends Ue{constructor(t=!0){super(),this.isIndent=t}allowsSkippingPrecedingSpace(){return!0}eval(t){const{inputStream:n}=t,r=t.userData;t.doNotMemoize=!0;const i=n.pos,o=this.isIndent?1:-1;return(r[i]||0)*o>0?(t.userData=Object.create(r),t.userData[i]-=o,t.pushBinding(new Va(0),i),!0):(t.processFailure(i,this),!1)}getArity(){return 1}_assertAllApplicationsAreValid(t,n){}_isNullable(t,n){return!1}assertChoicesHaveUniformArity(t){}assertIteratedExprsAreNotNullable(t){}introduceParams(t){return this}substituteParams(t){return this}toString(){return this.isIndent?"indent":"dedent"}toDisplayString(){return this.toString()}toFailure(t){const n=this.isIndent?cP:fP;return new br(this,n,"description")}}const nee=new ht("indent"),ree=new ht("dedent"),iee=new yg(H1,"any",[nee,ree],[]),oee=new pm().newGrammar("IndentationSensitive").withSuperGrammar(H1).define("indent",[],new gT(!0),cP,void 0,!0).define("dedent",[],new gT(!1),fP,void 0,!0).extend("any",[],iee,"any character",void 0).build();Object.assign(oee,{_matchStateInitializer(e){e.userData=eee(e.input),e.inputStream=new tee(e)},supportsIncrementalParsing:!1});qn.initApplicationParser(z1,uP);function see(e,t){const n=z1.match(e,"Grammars");if(n.failed())throw hJ(n);return uP(n,t)}function aee(e,t){const n=lee(e),r=Object.keys(n);if(r.length===0)throw new Error("Missing grammar definition");if(r.length>1){const o=n[r[1]].source;throw new Error(P1(o.sourceString,o.startIdx)+"Found more than one grammar definition -- use ohm.grammars() instead.")}return n[r[0]]}function lee(e,t){const n=Object.create({});return see(e,n),n}const uee=`Language { - Command - = var Identifier --var - | start --start - | read NonemptyListOf --read - | write NonemptyListOf --write - | assign Identifier "=" Expression --assign - | conditional Expression --conditional - - Expression - = Expression "||" Expression0 --binary - | Expression0 - - Expression0 - = Expression0 "&&" Expression1 --binary - | Expression1 - - Expression1 - = Expression2 ("<=" | "<" | ">=" | ">" | "==" | "!=") Expression2 --binary - | Expression2 - - Expression2 - = Expression2 ("+" | "-") Expression3 --binary - | Expression3 - - Expression3 - = Expression3 ("*" | "/" | div | mod) Expression4 --binary - | Expression4 - - Expression4 ([[Syntax_Expression]]) - = ("+" | "-" | "!") Expression4 --unary - | Primary - - FunctionCall (([[Syntax_FunctionCall]]) - = identifier "(" ListOf ")" - - Parentheses ([[Syntax_Parentheses]]) - = "(" Expression ")" - - Identifier ([[Syntax_Identifier]]) - = identifier - - Primary - = stringLiteral --stringLiteral - | numberLiteral --numberLiteral - | booleanLiteral --booleanLiteral - | FunctionCall - | Identifier - | Parentheses - - var = "var" ~alnum - start = "start" ~alnum - read = "read" ~alnum - write = "write" ~alnum - assign = "assign" ~alnum - conditional = "conditional" ~alnum - true = "true" ~alnum - false = "false" ~alnum - div = "div" ~alnum - mod = "mod" ~alnum - - keyword ([[Syntax_Keyword]]) - = true | false | div | mod - | var | start | read | write | assign | conditional - - identifier ([[Syntax_Identifier]]) - = ~keyword (letter | "_") (alnum | "_")* - - stringLiteral ([[Syntax_StringLiteral]]) - = "\\"" ("\\\\\\"" | ~"\\"" ~"\\n" any)* "\\"" - - numberLiteral ([[Syntax_NumberLiteral]]) - = digit+ ("." digit+)? (("E" | "e") ("+" | "-")? digit+)? - - booleanLiteral ([[Syntax_BooleanLiteral]]) - = true | false -} -`,ud=aee(uee);var Yn=(e=>(e.Number="number",e.Boolean="boolean",e.String="string",e))(Yn||{});const cee={number:{stringIsValid(e){return/^-?\d+(\.\d+)?(e[+-]?\d+)?$/.test(e)},read:e=>parseFloat(e),write:e=>{const t=e.toPrecision(6);if(t.includes("e")){const[n,r,i]=t.split(/e([+-])/);return n.replace(/0+$/,"").replace(/\.$/,"")+"e"+r+i.padStart(2,"0")}return t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}},boolean:{stringIsValid(e){return e==="true"||e==="false"},read:e=>e==="true",write:e=>e?"true":"false"},string:{stringIsValid(e){return!0},read:e=>e,write:e=>e}};function dP(e){return cee[e]}const pP=2147483647,fee=16807,dee=e=>fee*e%pP,hP=e=>e/pP,pee=(e,t,n)=>Math.floor((t-e+1)*hP(n)+e),hm={rand:hP,randInt:pee,getNext:dee},{Number:he,Boolean:Ht,String:Up}=Yn,j1=[{id:"+",operandType:he,resultType:he,work:e=>e},{id:"-",operandType:he,resultType:he,work:e=>-e},{id:"!",operandType:Ht,resultType:Ht,work:e=>!e}],V1=[{id:"||",leftType:Ht,rightType:Ht,resultType:Ht,work:(e,t)=>e||t},{id:"&&",leftType:Ht,rightType:Ht,resultType:Ht,work:(e,t)=>e&&t},{id:"<=",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e<=t},{id:"<",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e=",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e>=t},{id:">",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e>t},{id:"==",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e===t},{id:"==",leftType:Ht,rightType:Ht,resultType:Ht,work:(e,t)=>e===t},{id:"==",leftType:Up,rightType:Up,resultType:Ht,work:(e,t)=>e===t},{id:"!=",leftType:he,rightType:he,resultType:Ht,work:(e,t)=>e!==t},{id:"!=",leftType:Ht,rightType:Ht,resultType:Ht,work:(e,t)=>e!==t},{id:"!=",leftType:Up,rightType:Up,resultType:Ht,work:(e,t)=>e!==t},{id:"+",leftType:he,rightType:he,resultType:he,work:(e,t)=>e+t},{id:"-",leftType:he,rightType:he,resultType:he,work:(e,t)=>e-t},{id:"*",leftType:he,rightType:he,resultType:he,work:(e,t)=>e*t},{id:"/",leftType:he,rightType:he,resultType:he,work:(e,t)=>e/t},{id:"div",leftType:he,rightType:he,resultType:he,work:(e,t)=>Math.floor(e/t)},{id:"mod",leftType:he,rightType:he,resultType:he,work:(e,t)=>e%t}],Ua=[{id:"pow",parameterTypes:[he,he],returnType:he,work:Math.pow},{id:"sqrt",parameterTypes:[he],returnType:he,work:Math.sqrt},{id:"log",parameterTypes:[he],returnType:he,work:Math.log},{id:"log10",parameterTypes:[he],returnType:he,work:Math.log10},{id:"log2",parameterTypes:[he],returnType:he,work:Math.log2},{id:"exp",parameterTypes:[he],returnType:he,work:Math.exp},{id:"sin",parameterTypes:[he],returnType:he,work:Math.sin},{id:"cos",parameterTypes:[he],returnType:he,work:Math.cos},{id:"tan",parameterTypes:[he],returnType:he,work:Math.tan},{id:"asin",parameterTypes:[he],returnType:he,work:Math.asin},{id:"acos",parameterTypes:[he],returnType:he,work:Math.acos},{id:"atan",parameterTypes:[he],returnType:he,work:Math.atan},{id:"sinh",parameterTypes:[he],returnType:he,work:Math.sinh},{id:"cosh",parameterTypes:[he],returnType:he,work:Math.cosh},{id:"tanh",parameterTypes:[he],returnType:he,work:Math.tanh},{id:"asinh",parameterTypes:[he],returnType:he,work:Math.asinh},{id:"acosh",parameterTypes:[he],returnType:he,work:Math.acosh},{id:"atanh",parameterTypes:[he],returnType:he,work:Math.atanh},{id:"sign",parameterTypes:[he],returnType:he,work:Math.sign},{id:"abs",parameterTypes:[he],returnType:he,work:Math.abs},{id:"round",parameterTypes:[he],returnType:he,work:Math.round},{id:"floor",parameterTypes:[he],returnType:he,work:Math.floor},{id:"ceil",parameterTypes:[he],returnType:he,work:Math.ceil},{id:"min",parameterTypes:[he,he],returnType:he,work:Math.min},{id:"max",parameterTypes:[he,he],returnType:he,work:Math.max},{id:"rand",parameterTypes:[],returnType:he,work:hm.rand,tags:["random"]},{id:"rand_int",parameterTypes:[he,he],returnType:he,work:hm.randInt,tags:["random"]}],Mu=[{id:"pi",type:he,value:Math.PI},{id:"tau",type:he,value:2*Math.PI}];function hee(e){const t=e.sourceString;if(ce.find(Ua,{id:t})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:t}};const n=[...Mu,...this.args.variables];return ce.find(n,{id:t})===void 0?{message:"CheckError_VariableNotFound",payload:{id:t}}:null}function mee(e,t,n){return t.check(this.args.variables)}function Ic(e,t,n){const r=e.check(this.args.variables);if(r!==null)return r;const i=n.check(this.args.variables);if(i!==null)return i;const o=e.getType(this.args.variables),s=t.sourceString,a=n.getType(this.args.variables);return ce.find(V1,{id:s,leftType:o,rightType:a})===void 0?{message:"CheckError_BinaryOperatorTypeMismatch",payload:{id:s,leftType:o,rightType:a}}:null}function gee(e,t){const n=t.check(this.args.variables);if(n!==null)return n;const r=e.sourceString,i=t.getType(this.args.variables);return ce.find(j1,{id:r,operandType:i})===void 0?{message:"CheckError_UnaryOperatorTypeMismatch",payload:{id:r,operandType:i}}:null}function yee(e,t,n,r){for(const d of n.asIteration().children){const p=d.check(this.args.variables);if(p!==null)return p}const i=e.sourceString,o=ce.find(Ua,{id:i});if(o===void 0)return{message:"CheckError_FunctionDoesNotExist",payload:{id:i}};const{parameterTypes:s}=o,a=s.length,u=n.asIteration().children.length;if(a!==u)return{message:`CheckError_FunctionArityMismatch_${a<=2?a:"n"}`,payload:{id:i,arity:a,count:u}};const c=ce.map(n.asIteration().children,d=>d.getType(this.args.variables));return ce.isEqual(c,s)?null:{message:"CheckError_FunctionArgumentTypeMismatch",payload:{id:i,count:a,parameterTypes:s}}}function vee(e,t){const n=t.sourceString;return ce.find(this.args.variables,{id:n})!==void 0?{message:"IdentifierError_Duplicate"}:ce.find(Mu,{id:n})!==void 0?{message:"IdentifierError_Constant"}:ce.find(Ua,{id:n})!==void 0?{message:"IdentifierError_Function"}:null}function xee(e){return null}function _ee(e,t){for(const n of t.asIteration().children){const r=n.sourceString;if(ce.find(Mu,{id:r})!==void 0)return{message:"CheckError_VariableExpectedFoundConstant",payload:{id:r}};if(ce.find(Ua,{id:r})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:r}};const i=n.check(this.args.variables);if(i!==null)return i}return null}function wee(e,t){for(const n of t.asIteration().children){const r=n.check(this.args.variables);if(r!==null)return r}return null}function bee(e,t,n,r){const i=t.sourceString;if(ce.find(Mu,{id:i})!==void 0)return{message:"CheckError_VariableExpectedFoundConstant",payload:{id:i}};if(ce.find(Ua,{id:i})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:i}};const o=t.check(this.args.variables);if(o!==null)return o;const s=r.check(this.args.variables);if(s!==null)return s;const a=t.getType(this.args.variables),u=r.getType(this.args.variables);return a!==u?{message:"CheckError_AssignmentTypeMismatch",payload:{id:i,leftType:a,rightType:u}}:null}function Eee(e,t){const n=t.check(this.args.variables);if(n!==null)return n;const r=t.getType(this.args.variables);return r!=="boolean"?{message:"CheckError_ConditionNotBoolean",payload:{conditionType:r}}:null}function yi(e){if(!e)throw new Error("Assertion failed")}function See(e,t){const n=e.sourceString,r=t.eval(this.args.state),i=ce.find(j1,{id:n});return yi(i!==void 0),i.work(r)}function Ac(e,t,n){const r=e.eval(this.args.state),i=t.sourceString,o=n.eval(this.args.state),s=ce.find(V1,{id:i});return yi(s!==void 0),s.work(r,o)}function Cee(e,t,n,r){const i=e.sourceString,o=ce.find(Ua,{id:i});yi(o!==void 0);const s=ce.map(n.asIteration().children,a=>a.eval(this.args.state));return ce.includes(o.tags,"random")&&(this.args.state.rand=hm.getNext(this.args.state.rand),s.push(this.args.state.rand)),o.work(...s)}function Iee(e){const t=e.sourceString,n=ce.find(Mu,{id:t});if(n!==void 0)return n.value;const{value:r}=this.args.state.memory[t];if(r===null)throw{message:"RuntimeError_VariableNotInitialized",payload:{id:t}};return r}function Aee(e,t,n){return t.eval(this.args.state)}function Tee(e){const t=this.args.state;t.outPort="out"}function kee(e,t){const n=this.args.state;yi(n.input!==null);const r=n.input.split(/\s+/),i=t.asIteration().children;if(i.length!==r.length)throw{message:"RuntimeError_InvalidNumberOfTokens",payload:{count:r.length,expected:i.length}};for(const[o,s]of ce.zip(i,r)){yi(o!==void 0&&s!==void 0);const a=o.sourceString,{type:u}=n.memory[a],c=dP(u);if(!c.stringIsValid(s))throw{message:"RuntimeError_InvalidInput",payload:{input:s,type:u}};n.memory[a].value=c.read(s)}n.interaction.push({direction:"in",text:n.input}),n.input=null,n.outPort="out"}function Nee(e,t){const n=this.args.state;let r="";for(const i of t.asIteration().children){const o=i.eval(n),a=dP(typeof o);r+=a.write(o)}n.interaction.push({direction:"out",text:r}),n.outPort="out"}function Oee(e,t,n,r){const i=this.args.state,o=t.sourceString,s=r.eval(i);i.memory[o].value=s,i.outPort="out"}function Ree(e,t){const n=this.args.state,r=t.eval(n);n.outPort=r?"true":"false"}function Dee(e){const t=[...Mu,...this.args.variables],n=ce.find(t,{id:e.sourceString});return n!==void 0?n.type:null}function Lee(e,t,n){return t.getType(this.args.variables)}function Tc(e,t,n){const r=e.getType(this.args.variables),i=t.sourceString,o=n.getType(this.args.variables),s=ce.find(V1,{id:i,leftType:r,rightType:o});return s!==void 0?s.resultType:null}function Pee(e,t){const n=e.sourceString,r=t.getType(this.args.variables),i=ce.find(j1,{id:n,operandType:r});return i!==void 0?i.resultType:null}function Mee(e,t,n,r){const i=e.sourceString,o=ce.map(n.asIteration().children,a=>a.getType(this.args.variables)),s=ce.find(Ua,{id:i,parameterTypes:o});return s!==void 0?s.returnType:null}const Wa=ud.createSemantics();Wa.addOperation("getType(variables)",{Primary_stringLiteral:e=>Yn.String,Primary_numberLiteral:e=>Yn.Number,Primary_booleanLiteral:e=>Yn.Boolean,Identifier:Dee,Parentheses:Lee,Expression_binary:Tc,Expression0_binary:Tc,Expression1_binary:Tc,Expression2_binary:Tc,Expression3_binary:Tc,Expression4_unary:Pee,FunctionCall:Mee});Wa.addOperation("check(variables)",{Primary_stringLiteral:e=>null,Primary_numberLiteral:e=>null,Primary_booleanLiteral:e=>null,Identifier:hee,Parentheses:mee,Expression_binary:Ic,Expression0_binary:Ic,Expression1_binary:Ic,Expression2_binary:Ic,Expression3_binary:Ic,Expression4_unary:gee,FunctionCall:yee,Command_var:vee,Command_start:xee,Command_read:_ee,Command_write:wee,Command_assign:bee,Command_conditional:Eee});Wa.addOperation("eval(state)",{Primary_stringLiteral:e=>JSON.parse(e.sourceString),Primary_numberLiteral:e=>JSON.parse(e.sourceString),Primary_booleanLiteral:e=>JSON.parse(e.sourceString),Identifier:Iee,Parentheses:Aee,Expression_binary:Ac,Expression0_binary:Ac,Expression1_binary:Ac,Expression2_binary:Ac,Expression3_binary:Ac,Expression4_unary:See,FunctionCall:Cee});Wa.addOperation("exec(state)",{Command_start:Tee,Command_read:kee,Command_write:Nee,Command_assign:Oee,Command_conditional:Ree});/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var E_=function(){return E_=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?Math.round(c):c});return s}var Hee=/rgba?|\(|\)|\/|,|\s/gi,zee=[255,255,255,1],jee={"%":100};function Vee(e){var t=vP(e,Hee,zee,jee),n=t[0],r=t[1],i=t[2],o=t[3],s=o===void 0?1:o;return{r:n,g:r,b:i,a:s}}var Uee=/hsla?|\(|\)|\/|,|\s/gi,Wee=[360,1,1,1],Gee={"%":100,deg:360,rad:2*Math.PI,turn:1};function Kee(e){var t=vP(e,Uee,Wee,Gee),n=t[0],r=t[1],i=t[2],o=t[3],s=o===void 0?1:o;return yP({h:n,s:r,l:i,a:s})}function qee(e){var t=e.substring(1),n=t.length;if(n===3||n===4){var r=[0,1,2].map(function(c){return parseInt(""+t[c]+t[c],16)}),i=r[0],o=r[1],s=r[2],a=t.length===3?1:parseInt(""+t[3]+t[3],16)/255;return{r:i,g:o,b:s,a}}if(n===6||n===8){var u=[0,2,4].map(function(m){return parseInt(t.substring(m,m+2),16)}),i=u[0],o=u[1],s=u[2],a=t.length===6?1:parseInt(t.substring(6,8),16)/255;return{r:i,g:o,b:s,a}}throw new Error("Unable to parse "+e)}function Yee(e){var t=mP.get(e)||0;return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}function Xee(e){var t=gP.get(e)||0;return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}var Qee=/^rgba?\([^()]+\)$/,Zee=/^hsla?\([^()]+\)$/,Jee=/^#[0-9a-f]+$/i;function ete(e){var t=e.trim().toLowerCase();if(t.match(Qee))return Vee(t);if(t.match(Zee))return Kee(t);if(t.match(Jee))return qee(t);if(mP.has(t))return Yee(t);if(gP.has(t))return Xee(t);if(e==="transparent")return{r:0,g:0,b:0,a:0};throw new Error("Unable to parse "+e)}function tte(e){return typeof e=="string"?ete(e):Object.prototype.hasOwnProperty.call(e,"r")?E_({},e):yP(e)}function xP(e,t,n){n===void 0&&(n=function(i){return i});var r=n(tte(e));switch(t){case"rgb":return r;case"hsl":return yT(r);case"css-rgb":return $ee(r);case"css-hex":return Fee(r);case"css-hsl":return Bee(yT(r));default:throw new Error("Unsupported outputType '"+t+"'")}}function _P(e){var t=e===void 0?{}:e,n=t.contrast,r=n===void 0?1:n,i=t.brightness,o=i===void 0?0:i,s=function(a){return Math.min(255,Math.max(0,r*(a-128)+128+o))};return function(a){return{r:s(a.r),g:s(a.g),b:s(a.b),a:a.a===void 0?1:a.a}}}function nte(e,t=32){return xP(e,"css-hex",_P({brightness:t}))}function rte(e,t=32){return xP(e,"css-hex",_P({brightness:-t}))}const ii={brighter:nte,darker:rte};var Ne=(e=>(e.Start="start",e.Read="read",e.Write="write",e.Assign="assign",e.Conditional="conditional",e.End="end",e))(Ne||{});const ite={start:{backgroundColor:ii.brighter(Tt.purple),textColor:"white",borderRadius:"15px"},read:{backgroundColor:ii.brighter(Tt.blue),textColor:"white",clipPath:"polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%)",clipPathBorder:"polygon(20px 0, calc(100% + 1px) 0, calc(100% - 21px) 100%, -1px calc(100% - 1px))"},write:{backgroundColor:ii.brighter(Tt.green),textColor:"white",clipPath:"polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%)",clipPathBorder:"polygon(20px 0, calc(100% + 1px) 0, calc(100% - 21px) 100%, -1px calc(100% - 1px))"},assign:{backgroundColor:ii.brighter(Tt.orange),textColor:"white"},conditional:{backgroundColor:ii.brighter(Tt.red),textColor:"white",clipPath:"polygon(20px 0, 0 50%, 20px 100%, calc(100% - 20px) 100%, 100% 50%, calc(100% - 20px) 0)"},end:{backgroundColor:ii.brighter(Tt.purple),textColor:"white",borderRadius:"15px"}};function wP(e){return ite[e]}const ote={start:[{id:"out",position:J.Bottom}],read:[{id:"out",position:J.Bottom}],write:[{id:"out",position:J.Bottom}],assign:[{id:"out",position:J.Bottom}],conditional:[{id:"true",position:J.Bottom,label:"T"},{id:"false",position:J.Right,label:"F"}],end:[]};function xg(e){return ote[e]}function ste(e){const t=[];t.push(...ate(e));for(const n of e.nodes)n.data.role!==Ne.End&&t.push(...lte(e,n));return t}function ate(e){const{nodes:t,edges:n}=e,r=[],i=ce.filter(t,{data:{role:Ne.Start}});i.length===0&&r.push({type:"check",message:"CheckError_NoStart",nodeId:null}),i.length>1&&r.push({type:"check",message:"CheckError_MultipleStart",nodeId:null});for(const o of t){const s=xg(o.data.role);for(const a of s)if(ce.filter(n,{source:o.id,sourceHandle:a.id}).length===0){const c=a.label??"out";r.push({type:"check",message:c==="out"?"CheckError_NoOutgoing_Default":"CheckError_NoOutgoing_Handle",nodeId:o.id,payload:{output:c}})}}return r}function lte(e,t){const{variables:n}=e,r=[],i=t.data.role,o=ud.match(`${i} ${t.data.payload}`,"Command");if(o.failed())r.push({type:"syntax",message:"SyntaxError",nodeId:t.id,payload:{pos:o.getInterval().startIdx-i.length-1,expected:D1(o)}});else{const s=Wa(o).check(n);s&&r.push({type:"check",message:s.message,nodeId:t.id,payload:s.payload})}return r}function vT(e,t){const n=ce.find(e.nodes,{id:t});return yi(n!==void 0),n}function ute(e){const t=ce.find(e.nodes,{data:{role:Ne.Start}});return yi(t!==void 0),t}function cte(e,t,n){const r=ce.find(n.edges,{source:e,sourceHandle:t});return yi(r!==void 0),r.target}function bP(e,t){t=ce.cloneDeep(t);const n=t.curNodeId===null?ute(e):vT(e,t.curNodeId);try{const i=n.data.role,o=ud.match(`${i} ${n.data.payload}`,"Command");Wa(o).exec(t),t.status="running",t.timeSlot+=1}catch(i){return t.status="exception",t.errors=[{type:"runtime",nodeId:n.id,message:i.message,payload:i.payload}],t}yi(t.outPort!==null),t.curNodeId=cte(n.id,t.outPort,e);const r=vT(e,t.curNodeId);return r.data.role===Ne.End&&t.status==="running"?t.status="halted":r.data.role===Ne.Read&&t.status==="running"&&(t.status="waiting"),t}const xT=()=>({curNodeId:null,timeSlot:0,memory:{},input:null,outPort:null,rand:0,interaction:[],status:"invalid",errors:[]}),Ms=hg()((e,t)=>({flowchart:null,seed:hm.getNext(Math.floor(Date.now())),machineState:xT(),stateHistory:[],resetMachine:n=>{const r=xT(),i=ste(n);r.status=i.length>0?"invalid":"ready",r.errors=i,r.memory={};for(const{id:o,type:s}of n.variables)r.memory[o]={type:s,value:null};r.rand=t().seed,e({machineState:r,flowchart:n})},executeAction:n=>{const{flowchart:r,stateHistory:i,machineState:o,resetMachine:s}=t();switch(yi(r!==null),n){case"reset":{s(r);break}case"stepBack":{const a=i.pop();e({machineState:a,stateHistory:i});break}case"nextStep":{i.push(o);const a=bP(r,o);e({machineState:a,stateHistory:i});break}}}})),fte={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function dte(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=u=>u===null?null:JSON.parse(u,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Ff=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ff(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ff(r)(n)}}}},pte=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...t},s=!1;const a=new Set,u=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...b)},r,i);const d=Ff(o.serialize),p=()=>{const b=o.partialize({...r()});let y;const _=d({state:b,version:o.version}).then(E=>c.setItem(o.name,E)).catch(E=>{y=E});if(y)throw y;return _},h=i.setState;i.setState=(b,y)=>{h(b,y),p()};const m=e((...b)=>{n(...b),p()},r,i);let v;const x=()=>{var b;if(!c)return;s=!1,a.forEach(_=>_(r()));const y=((b=o.onRehydrateStorage)==null?void 0:b.call(o,r()))||void 0;return Ff(c.getItem.bind(c))(o.name).then(_=>{if(_)return o.deserialize(_)}).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return o.migrate(_.state,_.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return _.state}).then(_=>{var E;return v=o.merge(_,(E=r())!=null?E:m),n(v,!0),p()}).then(()=>{y==null||y(v,void 0),s=!0,u.forEach(_=>_(v))}).catch(_=>{y==null||y(void 0,_)})};return i.persist={setOptions:b=>{o={...o,...b},b.getStorage&&(c=b.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(u.add(b),()=>{u.delete(b)})},x(),v||m},hte=(e,t)=>(n,r,i)=>{let o={storage:dte(()=>localStorage),partialize:x=>x,version:0,merge:(x,b)=>({...b,...x}),...t},s=!1;const a=new Set,u=new Set;let c=o.storage;if(!c)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,i);const d=()=>{const x=o.partialize({...r()});return c.setItem(o.name,{state:x,version:o.version})},p=i.setState;i.setState=(x,b)=>{p(x,b),d()};const h=e((...x)=>{n(...x),d()},r,i);i.getInitialState=()=>h;let m;const v=()=>{var x,b;if(!c)return;s=!1,a.forEach(_=>{var E;return _((E=r())!=null?E:h)});const y=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(x=r())!=null?x:h))||void 0;return Ff(c.getItem.bind(c))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var E;const[C,T]=_;if(m=o.merge(T,(E=r())!=null?E:h),n(m,!0),C)return d()}).then(()=>{y==null||y(m,void 0),m=r(),s=!0,u.forEach(_=>_(m))}).catch(_=>{y==null||y(void 0,_)})};return i.persist={setOptions:x=>{o={...o,...x},x.storage&&(c=x.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:x=>(a.add(x),()=>{a.delete(x)}),onFinishHydration:x=>(u.add(x),()=>{u.delete(x)})},o.skipHydration||v(),m||h},mte=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((fte?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),pte(e,t)):hte(e,t),EP=mte,gte={Block_Empty:"(empty)",BlockHelpText_assign:"Enter an assignment expression",BlockHelpText_conditional:"Enter a logical expression",BlockHelpText_read:"Enter variable identifiers separated by commas",BlockHelpText_write:"Enter expressions separated by commas",BlockLabel_assign:"",BlockLabel_conditional:"",BlockLabel_end:"End",BlockLabel_read:"Read",BlockLabel_start:"Start",BlockLabel_write:"Write",BlockTitle_assign:"Assignment",BlockTitle_conditional:"Conditional",BlockTitle_end:"End",BlockTitle_read:"Input",BlockTitle_start:"Start",BlockTitle_write:"Output",Button_Cancel:"Cancel",Button_Clear:"Clear",Button_Close:"Close",Button_Rename:"Rename",Button_Save:"Save changes",CheckError_AssignmentTypeMismatch:"Cannot assign an expression of type `[[DataType_{{rightType}}]]` to variable `{{id}}` of type `[[DataType_{{leftType}}]]`.",CheckError_BinaryOperatorTypeMismatch:"Cannot apply operator `{{id}}` to operands of types `{{leftType}}` and `{{rightType}}`.",CheckError_ConditionNotBoolean:"The condition must yield a boolean value.",CheckError_FunctionArgumentTypeMismatch:"Function `{{id}}` expects [[an argument|arguments]] of type `({{[[DataType_@parameterTypes@]]}})`.",CheckError_FunctionArityMismatch_0:"Function `{{id}}` does not require arguments ({{count}} provided).",CheckError_FunctionArityMismatch_1:"Function `{{id}}` requires exactly one argument ({{count}} provided).",CheckError_FunctionArityMismatch_2:"Function `{{id}}` requires exactly two arguments ({{count}} provided).",CheckError_FunctionArityMismatch_n:"Function `{{id}}` requires exactly {{arity}} arguments ({{count}} provided).",CheckError_FunctionDoesNotExist:"Function `{{id}}` does not exist.",CheckError_MultipleStart:"There are more than one start block.",CheckError_NoOutgoing_Default:"Block has no outgoing edge.",CheckError_NoOutgoing_Handle:"Block has no outgoing edge for output `{{output}}`.",CheckError_NoStart:"There must be a start block.",CheckError_UnaryOperatorTypeMismatch:"Cannot apply operator `{{id}}` to an operand of type `{{operandType}}`.",CheckError_VariableExpectedFoundConstant:"Identifier `{{id}}` is a constant and not a variable.",CheckError_VariableExpectedFoundFunction:"Identifier `{{id}}` is a function and not a variable.",CheckError_VariableNotFound:"Variable `{{id}}` does not exist.",DataType_boolean:"boolean",DataType_number:"number",DataType_string:"string",ExampleDescription_factorial:"Computes the factorial of a number.",ExampleDescription_overtime:"Calculates the overtime pay of a worker.",ExampleDescription_secret:"Guess the secret number drawn from 1 to 100.",ExampleDescription_sign:"Determines if a number is positive, negative or zero.",ExampleTitle_factorial:"Factorial",ExampleTitle_overtime:"Overtime",ExampleTitle_secret:"Secret number",ExampleTitle_sign:"Sign of a number",FlowchartTitle_Placeholder:"Untitled flowchart",IdentifierError_Constant:"A constant with the same name already exists.",IdentifierError_Duplicate:"Identifier already exists.",IdentifierError_Empty:"Identifier cannot be empty.",IdentifierError_Function:"A function with the same name already exists.",IdentifierError_Invalid:"Invalid identifier.",Interaction_Title:"Input / Output",MenuFlowchart_Clear:"Clear...",MenuFlowchart_CopyLink:"Copy link",MenuFlowchart_Tooltip:"Flowchart",MenuHelp_About:"About...",MenuHelp_Examples:"Examples...",MenuHelp_Help:"Help...",MenuHelp_Tooltip:"Help",MenuLanguage_Tooltip:"Language",ModalAbout_Body1:"**FluxoLab** is a web application designed to teach algorithm and programming fundamentals using flowcharts.",ModalAbout_Body2:"The source code is available on {{GitHub}}, under the {{GPL3}} license.",ModalAbout_Title:"About FluxoLab",ModalClear_Body:"Are you sure you want to clear the flowchart?",ModalClear_Title:"Clear flowchart",ModalExamples_Body:"Select an example below to load.",ModalExamples_Title:"Examples",ModalHelp_AbsoluteValue:"Absolute value",ModalHelp_Addition:"Addition",ModalHelp_ArcCosine:"Arc cosine",ModalHelp_ArcCosineHyperbolic:"Arc hyperbolic cosine",ModalHelp_ArcSine:"Arc sine",ModalHelp_ArcSineHyperbolic:"Arc hyperbolic sine",ModalHelp_ArcTangent:"Arc tangent",ModalHelp_ArcTangentHyperbolic:"Arc hyperbolic tangent",ModalHelp_Assignment:"Assignment",ModalHelp_BinaryLogarithm:"Logarithm to the base 2",ModalHelp_Ceil:"Round up",ModalHelp_CommonLogarithm:"Logarithm to the base 10",ModalHelp_Conjunction:"Conjunction (and)",ModalHelp_Cosine:"Cosine",ModalHelp_Disjunction:"Disjunction (or)",ModalHelp_Equal:"Equal",ModalHelp_Exponential:"Exponential",ModalHelp_Floor:"Round down",ModalHelp_Greater:"Greater",ModalHelp_GreaterOrEqual:"Greater or equal",ModalHelp_HyperbolicCosine:"Hyperbolic cosine",ModalHelp_HyperbolicSine:"Hyperbolic sine",ModalHelp_HyperbolicTangent:"Hyperbolic tangent",ModalHelp_IntegerDivision:"Integer division",ModalHelp_Less:"Less",ModalHelp_LessOrEqual:"Less or equal",ModalHelp_Maximum:"Maximum",ModalHelp_Minimum:"Minimum",ModalHelp_Modulus:"Remainder of division",ModalHelp_Multiplication:"Multiplication",ModalHelp_NaturalLogarithm:"Natural logarithm",ModalHelp_Negation:"Negation (not)",ModalHelp_Negative:"Negative",ModalHelp_NotEqual:"Not equal",ModalHelp_Positive:"Positive",ModalHelp_Power:"Power (x raised to y)",ModalHelp_Rand:"Random fractional number between 0 and 1",ModalHelp_RandInt:"Random integer number between a and b (inclusive)",ModalHelp_RealDivision:"Real division",ModalHelp_Round:"Round to the nearest integer",ModalHelp_Sign:"Sign",ModalHelp_Sine:"Sine",ModalHelp_SquareRoot:"Square root",ModalHelp_SubtitleArithmetic:"Arithmetic operators",ModalHelp_SubtitleAssignment:"Assignment operator",ModalHelp_SubtitleComparison:"Comparison operators",ModalHelp_SubtitleConstants:"Numerical constants",ModalHelp_SubtitleFunctions:"Mathematical functions",ModalHelp_SubtitleLogical:"Logical operators",ModalHelp_Subtraction:"Subtraction",ModalHelp_Tangent:"Tangent",ModalHelp_Title:"Help",ModalRenameVariable_HelpText:"Enter a valid identifier",ModalRenameVariable_Title:"Rename variable",PlayButton_NextStep:"Next step",PlayButton_Reset:"Reset execution",PlayButton_StepBack:"Step back",RuntimeError_InvalidInput:"Input `{{input}}` is invalid for type `{{type}}`.",RuntimeError_InvalidNumberOfTokens:"Input has {{count}} [[token|tokens]] (expected {{expected}}).",RuntimeError_VariableNotInitialized:"Variable `{{id}}` was not initialized.",Status_CompileErrors:"There [[is|are]] {{count}} compile [[error|errors]].",Status_Halted:"Execution completed.",Status_MultipleErrors:"Multiple errors:",Status_Ready:"Ready to start execution.",Status_Running:"Step {{step}} executed.",Status_Waiting:"Waiting for input.",Syntax_BooleanLiteral:"a boolean",Syntax_EndOfInput:"end-of-input",Syntax_Expression:"an expression",Syntax_FunctionCall:"a function call",Syntax_Identifier:"an identifier",Syntax_Keyword:"a keyword",Syntax_NumberLiteral:"a number",Syntax_Parentheses:"a parenthesized expression",Syntax_StringLiteral:"a string",SyntaxError:"Position {{pos}}: Expected {{expected}}.",ToastMessage_CopyLink:"Link copied to clipboard.",ToastMessage_ExampleLoaded:"Example loaded successfully.",ToastMessage_FlowchartCleared:"Flowchart cleared successfully.",ToastMessage_ImportError:"Error importing flowchart.",ToastMessage_ImportSuccess:"Flowchart imported successfully.",ToastMessage_LanguageChanged:"Language changed to {{language}}.",VariableList_Add:"Add variable",VariableList_Remove:"Remove variable",VariableList_Title:"Variables"},yte={en:gte,"pt-BR":{Block_Empty:"(vazio)",BlockHelpText_assign:"Digite uma expressão de atribuição",BlockHelpText_conditional:"Digite uma expressão lógica",BlockHelpText_read:"Digite identificadores de variáveis separados por vírgula",BlockHelpText_write:"Digite expressões separadas por vírgula",BlockLabel_assign:"",BlockLabel_conditional:"",BlockLabel_end:"Fim",BlockLabel_read:"Leia",BlockLabel_start:"Início",BlockLabel_write:"Escreva",BlockTitle_assign:"Atribuição",BlockTitle_conditional:"Condicional",BlockTitle_end:"Fim",BlockTitle_read:"Entrada",BlockTitle_start:"Início",BlockTitle_write:"Saída",Button_Cancel:"Cancelar",Button_Clear:"Limpar",Button_Close:"Fechar",Button_Rename:"Renomear",Button_Save:"Salvar alterações",CheckError_AssignmentTypeMismatch:"Não é possível atribuir uma expressão do tipo `[[DataType_{{rightType}}]]` à variável `{{id}}` do tipo `[[DataType_{{leftType}}]]`.",CheckError_BinaryOperatorTypeMismatch:"Não é possível aplicar o operador `{{id}}` a operandos dos tipos `[[DataType_{{leftType}}]]` e `[[DataType_{{rightType}}]]`.",CheckError_ConditionNotBoolean:"A condição deve resultar em um valor booleano.",CheckError_FunctionArgumentTypeMismatch:"Função `{{id}}` espera [[um argumento|argumentos]] do tipo `({{[[DataType_@parameterTypes@]]}})`.",CheckError_FunctionArityMismatch_0:"Função `{{id}}` não requer argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_1:"Função `{{id}}` requer exatamente um argumento ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_2:"Função `{{id}}` requer exatamente dois argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_n:"Função `{{id}}` requer exatamente {{arity}} argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionDoesNotExist:"Função `{{id}}` não existe.",CheckError_MultipleStart:"Há mais de um bloco de início.",CheckError_NoOutgoing_Default:"Bloco não tem ramo de saída.",CheckError_NoOutgoing_Handle:"Bloco não tem ramo na saída `{{output}}`.",CheckError_NoStart:"Deve haver um bloco de início.",CheckError_UnaryOperatorTypeMismatch:"Não é possível aplicar o operador `{{id}}` a um operando do tipo `[[DataType_{{operandType}}]]`.",CheckError_VariableExpectedFoundConstant:"Identificador `{{id}}` é uma constante e não uma variável.",CheckError_VariableExpectedFoundFunction:"Identificador `{{id}}` é uma função e não uma variável.",CheckError_VariableNotFound:"Variável `{{id}}` não existe.",DataType_boolean:"booleano",DataType_number:"número",DataType_string:"string",ExampleDescription_factorial:"Calcula o fatorial de um número.",ExampleDescription_overtime:"Calcula o valor da hora extra de um trabalhador.",ExampleDescription_secret:"Adivinhe o número secreto sorteado de 1 a 100.",ExampleDescription_sign:"Determina se um número é positivo, negativo ou zero.",ExampleTitle_factorial:"Fatorial",ExampleTitle_overtime:"Hora extra",ExampleTitle_secret:"Número secreto",ExampleTitle_sign:"Sinal de um número",FlowchartTitle_Placeholder:"Fluxograma sem título",IdentifierError_Constant:"Já existe uma constante com esse nome.",IdentifierError_Duplicate:"Identificador já existe.",IdentifierError_Empty:"Identificador não pode ser vazio.",IdentifierError_Function:"Já existe uma função com o mesmo nome.",IdentifierError_Invalid:"Identificador inválido.",Interaction_Title:"Entrada / Saída",MenuFlowchart_Clear:"Limpar...",MenuFlowchart_CopyLink:"Copiar link",MenuFlowchart_Tooltip:"Fluxograma",MenuHelp_About:"Sobre...",MenuHelp_Examples:"Exemplos...",MenuHelp_Help:"Ajuda...",MenuHelp_Tooltip:"Ajuda",MenuLanguage_Tooltip:"Idioma",ModalAbout_Body1:"**FluxoLab** é uma aplicação web projetada para ensinar fundamentos de algoritmos e programação usando fluxogramas.",ModalAbout_Body2:"O código fonte está disponível no {{GitHub}}, sob a licença {{GPL3}}.",ModalAbout_Title:"Sobre o FluxoLab",ModalClear_Body:"Você tem certeza que deseja limpar o fluxograma?",ModalClear_Title:"Limpar fluxograma",ModalExamples_Body:"Selecione um exemplo abaixo para carregar.",ModalExamples_Title:"Exemplos",ModalHelp_AbsoluteValue:"Valor absoluto",ModalHelp_Addition:"Adição",ModalHelp_ArcCosine:"Arco cosseno",ModalHelp_ArcCosineHyperbolic:"Arco cosseno hiperbólico",ModalHelp_ArcSine:"Arco seno",ModalHelp_ArcSineHyperbolic:"Arco seno hiperbólico",ModalHelp_ArcTangent:"Arco tangente",ModalHelp_ArcTangentHyperbolic:"Arco tangente hiperbólico",ModalHelp_Assignment:"Atribuição",ModalHelp_BinaryLogarithm:"Logaritmo na base 2",ModalHelp_Ceil:"Arredondamento para cima",ModalHelp_CommonLogarithm:"Logaritmo na base 10",ModalHelp_Conjunction:"Conjunção (e)",ModalHelp_Cosine:"Cosseno",ModalHelp_Disjunction:"Disjunção (ou)",ModalHelp_Equal:"Igual",ModalHelp_Exponential:"Exponencial",ModalHelp_Floor:"Arredondamento para baixo",ModalHelp_Greater:"Maior",ModalHelp_GreaterOrEqual:"Maior ou igual",ModalHelp_HyperbolicCosine:"Cosseno hiperbólico",ModalHelp_HyperbolicSine:"Seno hiperbólico",ModalHelp_HyperbolicTangent:"Tangente hiperbólica",ModalHelp_IntegerDivision:"Divisão inteira",ModalHelp_Less:"Menor",ModalHelp_LessOrEqual:"Menor ou igual",ModalHelp_Maximum:"Máximo",ModalHelp_Minimum:"Mínimo",ModalHelp_Modulus:"Resto da divisão",ModalHelp_Multiplication:"Multiplicação",ModalHelp_NaturalLogarithm:"Logaritmo natural",ModalHelp_Negation:"Negação (não)",ModalHelp_Negative:"Negativo",ModalHelp_NotEqual:"Diferente",ModalHelp_Positive:"Positivo",ModalHelp_Power:"Potência (x elevado a y)",ModalHelp_Rand:"Número fracionário aleatório entre 0 e 1",ModalHelp_RandInt:"Número inteiro aleatório entre a e b (inclusive)",ModalHelp_RealDivision:"Divisão real",ModalHelp_Round:"Arredondamento para o inteiro mais próximo",ModalHelp_Sign:"Sinal",ModalHelp_Sine:"Seno",ModalHelp_SquareRoot:"Raiz quadrada",ModalHelp_SubtitleArithmetic:"Operadores aritméticos",ModalHelp_SubtitleAssignment:"Operador de atribuição",ModalHelp_SubtitleComparison:"Operadores de comparação",ModalHelp_SubtitleConstants:"Constantes numéricas",ModalHelp_SubtitleFunctions:"Funções matemáticas",ModalHelp_SubtitleLogical:"Operadores lógicos",ModalHelp_Subtraction:"Subtração",ModalHelp_Tangent:"Tangente",ModalHelp_Title:"Ajuda",ModalRenameVariable_HelpText:"Digite um identificador válido",ModalRenameVariable_Title:"Renomear variável",PlayButton_NextStep:"Executar próximo passo",PlayButton_Reset:"Encerrar execução",PlayButton_StepBack:"Voltar um passo",RuntimeError_InvalidInput:"Entrada `{{input}}` é inválida para o tipo `[[DataType_{{type}}]]`.",RuntimeError_InvalidNumberOfTokens:"Entrada tem {{count}} [[token|tokens]] (esperado {{expected}}).",RuntimeError_VariableNotInitialized:"Variável `{{id}}` não foi inicializada.",Status_CompileErrors:"Há {{count}} [[erro|erros]] de compilação.",Status_Halted:"Execução concluída.",Status_MultipleErrors:"Múltiplos erros:",Status_Ready:"Pronto para iniciar a execução.",Status_Running:"Executado passo {{step}}.",Status_Waiting:"Aguardando entrada.",Syntax_BooleanLiteral:"um booleano",Syntax_EndOfInput:"fim-de-entrada",Syntax_Expression:"uma expressão",Syntax_FunctionCall:"uma chamada de função",Syntax_Identifier:"um identificador",Syntax_Keyword:"uma palavra-chave",Syntax_NumberLiteral:"um número",Syntax_Parentheses:"uma expressão entre parênteses",Syntax_StringLiteral:"uma string",SyntaxError:"Posição {{pos}}: Esperado {{expected}}.",ToastMessage_CopyLink:"Link copiado para a área de transferência.",ToastMessage_ExampleLoaded:"Exemplo carregado com sucesso.",ToastMessage_FlowchartCleared:"Fluxograma limpo com sucesso.",ToastMessage_ImportError:"Erro ao importar fluxograma.",ToastMessage_ImportSuccess:"Fluxograma importado com sucesso.",ToastMessage_LanguageChanged:"Idioma alterado para {{language}}.",VariableList_Add:"Adicionar variável",VariableList_Remove:"Remover variável",VariableList_Title:"Variáveis"}},_T=yte,sn=hg()(EP((e,t)=>({language:navigator.language,setLanguage:n=>e({language:n}),getString:(n,r={})=>{let o=(_T[t().language]??_T.en)[n]??n;for(const[a,u]of ce.toPairs(r)){const c=ce.isArray(u)?u.join(", "):String(u);o=o.replace(new RegExp(`{{${a}}}`,"g"),c)}const s=/{{(.*?)@(.*?)@(.*?)}}/g;for(o=o.replace(s,(a,u,c,d)=>{const p=r[c];return!p||!ce.isArray(p)?a:p.map(h=>`${u}${h}${d}`).join(", ")});;){const a=o.match(/\[\[(.*?)\|(.*?)\]\]/);if(a===null)break;const[u,c,d]=a;o=o.replace(u,r.count===1?c:d)}for(;;){const a=o.match(/\[\[(.*?)\]\]/);if(a===null)break;const[u,c]=a;o=o.replace(u,t().getString(c,r))}return o}}),{name:"fluxolab_strings",version:1}));function vte(){const{machineState:e,executeAction:t}=Ms(),{getString:n}=sn(),r=i=>{t(i)};return S.jsx($D,{style:{zIndex:10},children:ce.map(VL,({actionId:i,description:o,hotkey:s,icon:a,enabledStatuses:u})=>{const c=!u.includes(e.status),d=c?"":`${n(o)} (${s})`;return S.jsx(Lu,{text:d,children:S.jsx(Rn,{disabled:c,onClick:()=>r(i),children:S.jsx("i",{className:`bi ${a}`})})},i)})})}function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?d-1:0),h=1;h{t.current=e},[e]),t}function Pt(e){const t=Ete(e);return A.useCallback(function(...n){return t.current&&t.current(...n)},[t])}const W1=e=>A.forwardRef((t,n)=>S.jsx("div",{...t,ref:n,className:Te(t.className,e)})),CP=W1("h4");CP.displayName="DivStyledAsH4";const IP=A.forwardRef(({className:e,bsPrefix:t,as:n=CP,...r},i)=>(t=Be(t,"alert-heading"),S.jsx(n,{ref:i,className:Te(e,t),...r})));IP.displayName="AlertHeading";function AP(){return A.useState(null)}function Ste(e,t,n,r=!1){const i=Pt(n);A.useEffect(()=>{const o=typeof e=="function"?e():e;return o.addEventListener(t,i,r),()=>o.removeEventListener(t,i,r)},[e])}function G1(){const e=A.useRef(!0),t=A.useRef(()=>e.current);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function TP(e){const t=A.useRef(null);return A.useEffect(()=>{t.current=e}),t.current}const Cte=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",Ite=typeof document<"u",mm=Ite||Cte?A.useLayoutEffect:A.useEffect,Ate=["onKeyDown"];function Tte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kte(e){return!e||e.trim()==="#"}const K1=A.forwardRef((e,t)=>{let{onKeyDown:n}=e,r=Tte(e,Ate);const[i]=d1(Object.assign({tagName:"a"},r)),o=Pt(s=>{i.onKeyDown(s),n==null||n(s)});return kte(r.href)||r.role==="button"?S.jsx("a",Object.assign({ref:t},r,i,{onKeyDown:o})):S.jsx("a",Object.assign({ref:t},r,{onKeyDown:n}))});K1.displayName="Anchor";const kP=A.forwardRef(({className:e,bsPrefix:t,as:n=K1,...r},i)=>(t=Be(t,"alert-link"),S.jsx(n,{ref:i,className:Te(e,t),...r})));kP.displayName="AlertLink";const bT={disabled:!1},NP=Q.createContext(null);var Nte=function(t){return t.scrollTop},Kc="unmounted",Jo="exited",oi="entering",mo="entered",bu="exiting",Po=function(e){bte(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,u;return o.appearStatus=null,r.in?a?(u=Jo,o.appearStatus=oi):u=mo:r.unmountOnExit||r.mountOnEnter?u=Kc:u=Jo,o.state={status:u},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===Kc?{status:Jo}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==oi&&s!==mo&&(o=oi):(s===oi||s===mo)&&(o=bu)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===oi){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:la.findDOMNode(this);s&&Nte(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jo&&this.setState({status:Kc})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,u=this.props.nodeRef?[a]:[la.findDOMNode(this),a],c=u[0],d=u[1],p=this.getTimeouts(),h=a?p.appear:p.enter;if(!i&&!s||bT.disabled){this.safeSetState({status:mo},function(){o.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:oi},function(){o.props.onEntering(c,d),o.onTransitionEnd(h,function(){o.safeSetState({status:mo},function(){o.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:la.findDOMNode(this);if(!o||bT.disabled){this.safeSetState({status:Jo},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:bu},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Jo},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:la.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=u[0],d=u[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Kc)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=SP(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Q.createElement(NP.Provider,{value:null},typeof s=="function"?s(i,a):Q.cloneElement(Q.Children.only(s),a))},t}(Q.Component);Po.contextType=NP;Po.propTypes={};function _l(){}Po.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_l,onEntering:_l,onEntered:_l,onExit:_l,onExiting:_l,onExited:_l};Po.UNMOUNTED=Kc;Po.EXITED=Jo;Po.ENTERING=oi;Po.ENTERED=mo;Po.EXITING=bu;function cd(e){return e&&e.ownerDocument||document}function Ote(e){var t=cd(e);return t&&t.defaultView||window}function Rte(e,t){return Ote(e).getComputedStyle(e,t)}var Dte=/([A-Z])/g;function Lte(e){return e.replace(Dte,"-$1").toLowerCase()}var Pte=/^ms-/;function Wp(e){return Lte(e).replace(Pte,"-ms-")}var Mte=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function $te(e){return!!(e&&Mte.test(e))}function bo(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Wp(t))||Rte(e).getPropertyValue(Wp(t));Object.keys(t).forEach(function(i){var o=t[i];!o&&o!==0?e.style.removeProperty(Wp(i)):$te(i)?r+=i+"("+o+") ":n+=Wp(i)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}const $u=!!(typeof window<"u"&&window.document&&window.document.createElement);var C_=!1,I_=!1;try{var x0={get passive(){return C_=!0},get once(){return I_=C_=!0}};$u&&(window.addEventListener("test",x0,x0),window.removeEventListener("test",x0,!0))}catch{}function q1(e,t,n,r){if(r&&typeof r!="boolean"&&!I_){var i=r.once,o=r.capture,s=n;!I_&&i&&(s=n.__once||function a(u){this.removeEventListener(t,a,o),n.call(this,u)},n.__once=s),e.addEventListener(t,s,C_?r:o)}e.addEventListener(t,n,r)}function A_(e,t,n,r){var i=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}function as(e,t,n,r){return q1(e,t,n,r),function(){A_(e,t,n,r)}}function Fte(e,t,n,r){if(r===void 0&&(r=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent(t,n,r),e.dispatchEvent(i)}}function Bte(e){var t=bo(e,"transitionDuration")||"",n=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*n}function Hte(e,t,n){n===void 0&&(n=5);var r=!1,i=setTimeout(function(){r||Fte(e,"transitionend",!0)},t+n),o=as(e,"transitionend",function(){r=!0},{once:!0});return function(){clearTimeout(i),o()}}function OP(e,t,n,r){n==null&&(n=Bte(e)||0);var i=Hte(e,n,r),o=as(e,"transitionend",t);return function(){i(),o()}}function ET(e,t){const n=bo(e,t)||"",r=n.indexOf("ms")===-1?1e3:1;return parseFloat(n)*r}function Y1(e,t){const n=ET(e,"transitionDuration"),r=ET(e,"transitionDelay"),i=OP(e,o=>{o.target===e&&(i(),t(o))},n+r)}function RP(e){e.offsetHeight}const ST=e=>!e||typeof e=="function"?e:t=>{e.current=t};function zte(e,t){const n=ST(e),r=ST(t);return i=>{n&&n(i),r&&r(i)}}function Ga(e,t){return A.useMemo(()=>zte(e,t),[e,t])}function jte(e){return e&&"setState"in e?la.findDOMNode(e):e??null}const X1=Q.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,onExited:o,addEndListener:s,children:a,childRef:u,...c},d)=>{const p=A.useRef(null),h=Ga(p,u),m=I=>{h(jte(I))},v=I=>O=>{I&&p.current&&I(p.current,O)},x=A.useCallback(v(e),[e]),b=A.useCallback(v(t),[t]),y=A.useCallback(v(n),[n]),_=A.useCallback(v(r),[r]),E=A.useCallback(v(i),[i]),C=A.useCallback(v(o),[o]),T=A.useCallback(v(s),[s]);return S.jsx(Po,{ref:d,...c,onEnter:x,onEntered:y,onEntering:b,onExit:_,onExited:C,onExiting:E,addEndListener:T,nodeRef:p,children:typeof a=="function"?(I,O)=>a(I,{...O,ref:m}):Q.cloneElement(a,{ref:m})})}),Vte={[oi]:"show",[mo]:"show"},Da=A.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...i},o)=>{const s={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...i},a=A.useCallback((u,c)=>{RP(u),r==null||r(u,c)},[r]);return S.jsx(X1,{ref:o,addEndListener:Y1,...s,onEnter:a,childRef:t.ref,children:(u,c)=>A.cloneElement(t,{...c,className:Te("fade",e,t.props.className,Vte[u],n[u])})})});Da.displayName="Fade";const Ute={"aria-label":dr.string,onClick:dr.func,variant:dr.oneOf(["white"])},fd=A.forwardRef(({className:e,variant:t,"aria-label":n="Close",...r},i)=>S.jsx("button",{ref:i,type:"button",className:Te("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));fd.displayName="CloseButton";fd.propTypes=Ute;const DP=A.forwardRef((e,t)=>{const{bsPrefix:n,show:r=!0,closeLabel:i="Close alert",closeVariant:o,className:s,children:a,variant:u="primary",onClose:c,dismissible:d,transition:p=Da,...h}=U1(e,{show:"onClose"}),m=Be(n,"alert"),v=Pt(y=>{c&&c(!1,y)}),x=p===!0?Da:p,b=S.jsxs("div",{role:"alert",...x?void 0:h,ref:t,className:Te(s,m,u&&`${m}-${u}`,d&&`${m}-dismissible`),children:[d&&S.jsx(fd,{onClick:v,"aria-label":i,variant:o}),a]});return x?S.jsx(x,{unmountOnExit:!0,...h,ref:void 0,in:r,children:b}):r?b:null});DP.displayName="Alert";const Wte=Object.assign(DP,{Link:kP,Heading:IP});function Gte(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Kte=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qte=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yte={};function CT(e,t){return(Yte.jsx?qte:Kte).test(e)}const Xte=/[ \t\n\f\r]/g;function Qte(e){return typeof e=="object"?e.type==="text"?IT(e.value):!1:IT(e)}function IT(e){return e.replace(Xte,"")===""}class dd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}dd.prototype.property={};dd.prototype.normal={};dd.prototype.space=null;function LP(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&nne.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(TT,sne);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!TT.test(o)){let s=o.replace(rne,one);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Q1}return new i(r,t)}function one(e){return"-"+e.toLowerCase()}function sne(e){return e.charAt(1).toUpperCase()}const ane={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},lne=LP([$P,MP,HP,zP,ene],"html"),Z1=LP([$P,MP,HP,zP,tne],"svg");function une(e){return e.join(" ").trim()}var jP={},kT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cne=/\n/g,fne=/^\s*/,dne=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pne=/^:\s*/,hne=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mne=/^[;\s]*/,gne=/^\s+|\s+$/g,yne=` -`,NT="/",OT="*",ia="",vne="comment",xne="declaration",_ne=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var x=v.match(cne);x&&(n+=x.length);var b=v.lastIndexOf(yne);r=~b?v.length-b:r+v.length}function o(){var v={line:n,column:r};return function(x){return x.position=new s(v),c(),x}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var x=new Error(t.source+":"+n+":"+r+": "+v);if(x.reason=v,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(v){var x=v.exec(e);if(x){var b=x[0];return i(b),e=e.slice(b.length),x}}function c(){u(fne)}function d(v){var x;for(v=v||[];x=p();)x!==!1&&v.push(x);return v}function p(){var v=o();if(!(NT!=e.charAt(0)||OT!=e.charAt(1))){for(var x=2;ia!=e.charAt(x)&&(OT!=e.charAt(x)||NT!=e.charAt(x+1));)++x;if(x+=2,ia===e.charAt(x-1))return a("End of comment missing");var b=e.slice(2,x-2);return r+=2,i(b),e=e.slice(x),r+=2,v({type:vne,comment:b})}}function h(){var v=o(),x=u(dne);if(x){if(p(),!u(pne))return a("property missing ':'");var b=u(hne),y=v({type:xne,property:RT(x[0].replace(kT,ia)),value:b?RT(b[0].replace(kT,ia)):ia});return u(mne),y}}function m(){var v=[];d(v);for(var x;x=h();)x!==!1&&(v.push(x),d(v));return v}return c(),m()};function RT(e){return e?e.replace(gne,ia):ia}var wne=ra&&ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jP,"__esModule",{value:!0});var bne=wne(_ne);function Ene(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,bne.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var DT=jP.default=Ene;const Sne=DT.default||DT,VP=UP("end"),J1=UP("start");function UP(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Cne(e){const t=J1(e),n=VP(e);if(t&&n)return{start:t,end:n}}function sf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?LT(e.position):"start"in e||"end"in e?LT(e):"line"in e||"column"in e?N_(e):""}function N_(e){return PT(e&&e.line)+":"+PT(e&&e.column)}function LT(e){return N_(e&&e.start)+"-"+N_(e&&e.end)}function PT(e){return e&&typeof e=="number"?e:1}class $n extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=sf(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}$n.prototype.file="";$n.prototype.name="";$n.prototype.reason="";$n.prototype.message="";$n.prototype.stack="";$n.prototype.column=void 0;$n.prototype.line=void 0;$n.prototype.ancestors=void 0;$n.prototype.cause=void 0;$n.prototype.fatal=void 0;$n.prototype.place=void 0;$n.prototype.ruleId=void 0;$n.prototype.source=void 0;const eb={}.hasOwnProperty,Ine=new Map,Ane=/[A-Z]/g,Tne=/-([a-z])/g,kne=new Set(["table","tbody","thead","tfoot","tr"]),Nne=new Set(["td","th"]),WP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function One(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Bne(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Fne(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Z1:lne,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=GP(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function GP(e,t,n){if(t.type==="element")return Rne(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Dne(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pne(e,t,n);if(t.type==="mdxjsEsm")return Lne(e,t);if(t.type==="root")return Mne(e,t,n);if(t.type==="text")return $ne(e,t)}function Rne(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Z1,e.schema=i),e.ancestors.push(t);const o=qP(e,t.tagName,!1),s=Hne(e,t);let a=nb(e,t);return kne.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Qte(u):!0})),KP(e,s,o,t),tb(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Dne(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Hf(e,t.position)}function Lne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hf(e,t.position)}function Pne(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Z1,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:qP(e,t.name,!0),s=zne(e,t),a=nb(e,t);return KP(e,s,o,t),tb(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Mne(e,t,n){const r={};return tb(r,nb(e,t)),e.create(t,e.Fragment,r,n)}function $ne(e,t){return t.value}function KP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fne(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function Bne(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=J1(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Hne(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&eb.call(t.properties,i)){const o=jne(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Nne.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zne(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Hf(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Hf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function nb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Ine;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(No(e,e.length,0,t),e):t}const FT={}.hasOwnProperty;function Qne(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function nu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ki=$s(/[A-Za-z]/),Dr=$s(/[\dA-Za-z]/),ere=$s(/[#-'*+\--9=?A-Z^-~]/);function O_(e){return e!==null&&(e<32||e===127)}const R_=$s(/\d/),tre=$s(/[\dA-Fa-f]/),nre=$s(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function _r(e){return e!==null&&(e<0||e===32)}function at(e){return e===-2||e===-1||e===32}const rre=$s(new RegExp("\\p{P}|\\p{S}","u")),ire=$s(/\s/);function $s(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bu(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Et(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return at(u)?(e.enter(n),a(u)):t(u)}function a(u){return at(u)&&o++s))return;const O=t.events.length;let M=O,z,U;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(z){U=t.events[M][1].end;break}z=!0}for(y(r),I=O;IE;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=E}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ure(e,t,n){return Et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function HT(e){if(e===null||_r(e)||ire(e))return 1;if(rre(e))return 2}function ib(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);zT(p,-u),zT(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=si(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=si(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=si(c,ib(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=si(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=si(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,No(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&at(I)?Et(e,_,"linePrefix",o+1)(I):_(I)}function _(I){return I===null||ze(I)?e.check(jT,x,C)(I):(e.enter("codeFlowValue"),E(I))}function E(I){return I===null||ze(I)?(e.exit("codeFlowValue"),_(I)):(e.consume(I),E)}function C(I){return e.exit("codeFenced"),t(I)}function T(I,O,M){let z=0;return U;function U(B){return I.enter("lineEnding"),I.consume(B),I.exit("lineEnding"),F}function F(B){return I.enter("codeFencedFence"),at(B)?Et(I,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):W(B)}function W(B){return B===a?(I.enter("codeFencedFenceSequence"),Y(B)):M(B)}function Y(B){return B===a?(z++,I.consume(B),Y):z>=s?(I.exit("codeFencedFenceSequence"),at(B)?Et(I,L,"whitespace")(B):L(B)):M(B)}function L(B){return B===null||ze(B)?(I.exit("codeFencedFence"),O(B)):M(B)}}}function wre(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const b0={name:"codeIndented",tokenize:Ere},bre={tokenize:Sre,partial:!0};function Ere(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Et(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):ze(c)?e.attempt(bre,s,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ze(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function Sre(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Et(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ze(s)?i(s):n(s)}}const Cre={name:"codeText",tokenize:Tre,resolve:Ire,previous:Are};function Ire(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&kc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function tM(e,t,n,r,i,o,s,a,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||O_(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||ze(y)?n(y):(e.consume(y),y===92?v:m)}function v(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!d&&(y===null||y===41||_r(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):d999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===null||m===91||m===93||ze(m)||a++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!at(m)),m===92?h:p)}function h(m){return m===91||m===92||m===93?(e.consume(m),a++,p):p(m)}}function rM(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),u(s)):h===null?n(h):ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Et(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||ze(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?p:d)}function p(h){return h===s||h===92?(e.consume(h),d):d(h)}}function af(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):at(i)?Et(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Mre={name:"definition",tokenize:Fre},$re={tokenize:Bre,partial:!0};function Fre(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),s(m)}function s(m){return nM.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=nu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return _r(m)?af(e,c)(m):c(m)}function c(m){return tM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt($re,p,p)(m)}function p(m){return at(m)?Et(e,h,"whitespace")(m):h(m)}function h(m){return m===null||ze(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Bre(e,t,n){return r;function r(a){return _r(a)?af(e,i)(a):n(a)}function i(a){return rM(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return at(a)?Et(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ze(a)?t(a):n(a)}}const Hre={name:"hardBreakEscape",tokenize:zre};function zre(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const jre={name:"headingAtx",tokenize:Ure,resolve:Vre};function Vre(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},No(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ure(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||_r(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||ze(d)?(e.exit("atxHeading"),t(d)):at(d)?Et(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||_r(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Wre=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],UT=["pre","script","style","textarea"],Gre={name:"htmlFlow",tokenize:Xre,resolveTo:Yre,concrete:!0},Kre={tokenize:Zre,partial:!0},qre={tokenize:Qre,partial:!0};function Yre(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Xre(e,t,n){const r=this;let i,o,s,a,u;return c;function c(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),p}function p(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),o=!0,x):R===63?(e.consume(R),i=3,r.interrupt?t:N):Ki(R)?(e.consume(R),s=String.fromCharCode(R),b):n(R)}function h(R){return R===45?(e.consume(R),i=2,m):R===91?(e.consume(R),i=5,a=0,v):Ki(R)?(e.consume(R),i=4,r.interrupt?t:N):n(R)}function m(R){return R===45?(e.consume(R),r.interrupt?t:N):n(R)}function v(R){const ee="CDATA[";return R===ee.charCodeAt(a++)?(e.consume(R),a===ee.length?r.interrupt?t:W:v):n(R)}function x(R){return Ki(R)?(e.consume(R),s=String.fromCharCode(R),b):n(R)}function b(R){if(R===null||R===47||R===62||_r(R)){const ee=R===47,re=s.toLowerCase();return!ee&&!o&&UT.includes(re)?(i=1,r.interrupt?t(R):W(R)):Wre.includes(s.toLowerCase())?(i=6,ee?(e.consume(R),y):r.interrupt?t(R):W(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?_(R):E(R))}return R===45||Dr(R)?(e.consume(R),s+=String.fromCharCode(R),b):n(R)}function y(R){return R===62?(e.consume(R),r.interrupt?t:W):n(R)}function _(R){return at(R)?(e.consume(R),_):U(R)}function E(R){return R===47?(e.consume(R),U):R===58||R===95||Ki(R)?(e.consume(R),C):at(R)?(e.consume(R),E):U(R)}function C(R){return R===45||R===46||R===58||R===95||Dr(R)?(e.consume(R),C):T(R)}function T(R){return R===61?(e.consume(R),I):at(R)?(e.consume(R),T):E(R)}function I(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),u=R,O):at(R)?(e.consume(R),I):M(R)}function O(R){return R===u?(e.consume(R),u=null,z):R===null||ze(R)?n(R):(e.consume(R),O)}function M(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||_r(R)?T(R):(e.consume(R),M)}function z(R){return R===47||R===62||at(R)?E(R):n(R)}function U(R){return R===62?(e.consume(R),F):n(R)}function F(R){return R===null||ze(R)?W(R):at(R)?(e.consume(R),F):n(R)}function W(R){return R===45&&i===2?(e.consume(R),j):R===60&&i===1?(e.consume(R),X):R===62&&i===4?(e.consume(R),Z):R===63&&i===3?(e.consume(R),N):R===93&&i===5?(e.consume(R),H):ze(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Kre,te,Y)(R)):R===null||ze(R)?(e.exit("htmlFlowData"),Y(R)):(e.consume(R),W)}function Y(R){return e.check(qre,L,te)(R)}function L(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),B}function B(R){return R===null||ze(R)?Y(R):(e.enter("htmlFlowData"),W(R))}function j(R){return R===45?(e.consume(R),N):W(R)}function X(R){return R===47?(e.consume(R),s="",V):W(R)}function V(R){if(R===62){const ee=s.toLowerCase();return UT.includes(ee)?(e.consume(R),Z):W(R)}return Ki(R)&&s.length<8?(e.consume(R),s+=String.fromCharCode(R),V):W(R)}function H(R){return R===93?(e.consume(R),N):W(R)}function N(R){return R===62?(e.consume(R),Z):R===45&&i===2?(e.consume(R),N):W(R)}function Z(R){return R===null||ze(R)?(e.exit("htmlFlowData"),te(R)):(e.consume(R),Z)}function te(R){return e.exit("htmlFlow"),t(R)}}function Qre(e,t,n){const r=this;return i;function i(s){return ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Zre(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_g,t,n)}}const Jre={name:"htmlText",tokenize:eie};function eie(e,t,n){const r=this;let i,o,s;return a;function a(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),T):N===63?(e.consume(N),E):Ki(N)?(e.consume(N),M):n(N)}function c(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),o=0,v):Ki(N)?(e.consume(N),_):n(N)}function d(N){return N===45?(e.consume(N),m):n(N)}function p(N){return N===null?n(N):N===45?(e.consume(N),h):ze(N)?(s=p,X(N)):(e.consume(N),p)}function h(N){return N===45?(e.consume(N),m):p(N)}function m(N){return N===62?j(N):N===45?h(N):p(N)}function v(N){const Z="CDATA[";return N===Z.charCodeAt(o++)?(e.consume(N),o===Z.length?x:v):n(N)}function x(N){return N===null?n(N):N===93?(e.consume(N),b):ze(N)?(s=x,X(N)):(e.consume(N),x)}function b(N){return N===93?(e.consume(N),y):x(N)}function y(N){return N===62?j(N):N===93?(e.consume(N),y):x(N)}function _(N){return N===null||N===62?j(N):ze(N)?(s=_,X(N)):(e.consume(N),_)}function E(N){return N===null?n(N):N===63?(e.consume(N),C):ze(N)?(s=E,X(N)):(e.consume(N),E)}function C(N){return N===62?j(N):E(N)}function T(N){return Ki(N)?(e.consume(N),I):n(N)}function I(N){return N===45||Dr(N)?(e.consume(N),I):O(N)}function O(N){return ze(N)?(s=O,X(N)):at(N)?(e.consume(N),O):j(N)}function M(N){return N===45||Dr(N)?(e.consume(N),M):N===47||N===62||_r(N)?z(N):n(N)}function z(N){return N===47?(e.consume(N),j):N===58||N===95||Ki(N)?(e.consume(N),U):ze(N)?(s=z,X(N)):at(N)?(e.consume(N),z):j(N)}function U(N){return N===45||N===46||N===58||N===95||Dr(N)?(e.consume(N),U):F(N)}function F(N){return N===61?(e.consume(N),W):ze(N)?(s=F,X(N)):at(N)?(e.consume(N),F):z(N)}function W(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,Y):ze(N)?(s=W,X(N)):at(N)?(e.consume(N),W):(e.consume(N),L)}function Y(N){return N===i?(e.consume(N),i=void 0,B):N===null?n(N):ze(N)?(s=Y,X(N)):(e.consume(N),Y)}function L(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||_r(N)?z(N):(e.consume(N),L)}function B(N){return N===47||N===62||_r(N)?z(N):n(N)}function j(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function X(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),V}function V(N){return at(N)?Et(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):H(N)}function H(N){return e.enter("htmlTextData"),s(N)}}const ob={name:"labelEnd",tokenize:sie,resolveTo:oie,resolveAll:iie},tie={tokenize:aie},nie={tokenize:lie},rie={tokenize:uie};function iie(e){let t=-1;for(;++t=3&&(c===null||ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),at(c)?Et(e,a,"whitespace")(c):a(c))}}const lr={name:"list",tokenize:vie,continuation:{tokenize:xie},exit:wie},gie={tokenize:bie,partial:!0},yie={tokenize:_ie,partial:!0};function vie(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(m){const v=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:R_(m)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(_h,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return R_(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(_g,r.interrupt?n:d,e.attempt(gie,h,p))}function d(m){return r.containerState.initialBlankLine=!0,o++,h(m)}function p(m){return at(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function xie(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_g,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Et(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!at(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yie,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Et(e,e.attempt(lr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function _ie(e,t,n){const r=this;return Et(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wie(e){e.exit(this.containerState.type)}function bie(e,t,n){const r=this;return Et(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!at(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const WT={name:"setextUnderline",tokenize:Sie,resolveTo:Eie};function Eie(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Sie(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),at(c)?Et(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Cie={tokenize:Iie};function Iie(e){const t=this,n=e.attempt(_g,r,e.attempt(this.parser.constructs.flowInitial,i,Et(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ore,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Aie={resolveAll:oM()},Tie=iM("string"),kie=iM("text");function iM(e){return{tokenize:t,resolveAll:oM(e==="text"?Nie:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let h=-1;if(p)for(;++h-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Die(e,t){let n=-1;const r=[];let i;for(;++n0){const Ut=be.tokenStack[be.tokenStack.length-1];(Ut[1]||KT).call(be,void 0,Ut[0])}for(ae.position={start:qo(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:qo(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function soe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aoe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function loe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lM(e,t);const i={src:Bu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uoe(e,t){const n={src:Bu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function coe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function foe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lM(e,t);const i={href:Bu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function doe(e,t){const n={href:Bu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function poe(e,t,n){const r=e.all(t),i=n?hoe(n):uM(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function moe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=J1(t.children[1]),u=VP(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function _oe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(XT(t.slice(i),i>0,!1)),o.join("")}function XT(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===qT||o===YT;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===qT||o===YT;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eoe(e,t){const n={type:"text",value:boe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Soe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Coe={blockquote:eoe,break:toe,code:noe,delete:roe,emphasis:ioe,footnoteReference:ooe,heading:soe,html:aoe,imageReference:loe,image:uoe,inlineCode:coe,linkReference:foe,link:doe,listItem:poe,list:moe,paragraph:goe,root:yoe,strong:voe,table:xoe,tableCell:woe,tableRow:_oe,text:Eoe,thematicBreak:Soe,toml:Gp,yaml:Gp,definition:Gp,footnoteDefinition:Gp};function Gp(){}const cM=-1,wg=0,gm=1,ym=2,sb=3,ab=4,lb=5,ub=6,fM=7,dM=8,QT=typeof self=="object"?self:globalThis,Ioe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case wg:case cM:return n(s,i);case gm:{const a=n([],i);for(const u of s)a.push(r(u));return a}case ym:{const a=n({},i);for(const[u,c]of s)a[r(u)]=r(c);return a}case sb:return n(new Date(s),i);case ab:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case lb:{const a=n(new Map,i);for(const[u,c]of s)a.set(r(u),r(c));return a}case ub:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case fM:{const{name:a,message:u}=s;return n(new QT[a](u),i)}case dM:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new QT[o](s),i)};return r},ZT=e=>Ioe(new Map,e)(0),wl="",{toString:Aoe}={},{keys:Toe}=Object,Nc=e=>{const t=typeof e;if(t!=="object"||!e)return[wg,t];const n=Aoe.call(e).slice(8,-1);switch(n){case"Array":return[gm,wl];case"Object":return[ym,wl];case"Date":return[sb,wl];case"RegExp":return[ab,wl];case"Map":return[lb,wl];case"Set":return[ub,wl]}return n.includes("Array")?[gm,n]:n.includes("Error")?[fM,n]:[ym,n]},Kp=([e,t])=>e===wg&&(t==="function"||t==="symbol"),koe=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=Nc(s);switch(a){case wg:{let d=s;switch(u){case"bigint":a=dM,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([cM],s)}return i([a,d],s)}case gm:{if(u)return i([u,[...s]],s);const d=[],p=i([a,d],s);for(const h of s)d.push(o(h));return p}case ym:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],p=i([a,d],s);for(const h of Toe(s))(e||!Kp(Nc(s[h])))&&d.push([o(h),o(s[h])]);return p}case sb:return i([a,s.toISOString()],s);case ab:{const{source:d,flags:p}=s;return i([a,{source:d,flags:p}],s)}case lb:{const d=[],p=i([a,d],s);for(const[h,m]of s)(e||!(Kp(Nc(h))||Kp(Nc(m))))&&d.push([o(h),o(m)]);return p}case ub:{const d=[],p=i([a,d],s);for(const h of s)(e||!Kp(Nc(h)))&&d.push(o(h));return p}}const{message:c}=s;return i([a,{name:u,message:c}],s)};return o},JT=(e,{json:t,lossy:n}={})=>{const r=[];return koe(!(t||n),!!t,new Map,r)(e),r},vm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ZT(JT(e,t)):structuredClone(e):(e,t)=>ZT(JT(e,t));function Noe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ooe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Roe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Noe,r=e.options.footnoteBackLabel||Ooe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,m);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const _=b.children[b.children.length-1];_&&_.type==="text"?_.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...v)}else d.push(...v);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vm(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` -`}]}}const pM=function(e){if(e==null)return Moe;if(typeof e=="function")return bg(e);if(typeof e=="object")return Array.isArray(e)?Doe(e):Loe(e);if(typeof e=="string")return Poe(e);throw new Error("Expected function, string, or object as test")};function Doe(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=hM,v,x,b;if((!t||o(u,c,d[d.length-1]||void 0))&&(m=zoe(n(u,d)),m[0]===ek))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==Boe)for(x=(r?y.children.length:-1)+s,b=d.concat(y);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function tk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nk(e,t){const n=Voe(e,t),r=n.one(e,void 0),i=Roe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function qoe(e,t){return e&&"run"in e?async function(n,r){const i=nk(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nk(n,{file:r,...t||e})}}function rk(e){if(e)throw e}var wh=Object.prototype.hasOwnProperty,gM=Object.prototype.toString,ik=Object.defineProperty,ok=Object.getOwnPropertyDescriptor,sk=function(t){return typeof Array.isArray=="function"?Array.isArray(t):gM.call(t)==="[object Array]"},ak=function(t){if(!t||gM.call(t)!=="[object Object]")return!1;var n=wh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wh.call(t,i)},lk=function(t,n){ik&&n.name==="__proto__"?ik(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},uk=function(t,n){if(n==="__proto__")if(wh.call(t,n)){if(ok)return ok(t,n).value}else return;return t[n]},Yoe=function e(){var t,n,r,i,o,s,a=arguments[0],u=1,c=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});us.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(c){const d=c;if(a&&n)throw d;return i(d)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ui={basename:Zoe,dirname:Joe,extname:ese,join:tse,sep:"/"};function Zoe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pd(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Joe(e){if(pd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ese(e){pd(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tse(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rse(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function pd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ise={cwd:ose};function ose(){return"/"}function M_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function sse(e){if(typeof e=="string")e=new URL(e);else if(!M_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ase(e)}function ase(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...v]=d;const x=r[h][1];P_(x)&&P_(m)&&(m=S0(!0,x,m)),r[h]=[c,m,...v]}}}}const fse=new cb().freeze();function T0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function k0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function N0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fk(e){if(!P_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qp(e){return dse(e)?e:new yM(e)}function dse(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pse(e){return typeof e=="string"||hse(e)}function hse(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pk=[],hk={allowDangerousHtml:!0},gse=/^(https?|ircs?|mailto|xmpp)$/i,yse=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vse(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||pk,u=e.remarkPlugins||pk,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hk}:hk,d=e.skipHtml,p=e.unwrapDisallowed,h=e.urlTransform||xse,m=fse().use(Jie).use(u).use(qoe,c).use(a),v=new yM;typeof r=="string"&&(v.value=r);for(const _ of yse)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mse+_.id,void 0);const x=m.parse(v);let b=m.runSync(x,v);return i&&(b={type:"element",tagName:"div",properties:{className:i},children:b.type==="root"?b.children:[b]}),mM(b,y),One(b,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(_,E,C){if(_.type==="raw"&&C&&typeof E=="number")return d?C.children.splice(E,1):C.children[E]={type:"text",value:_.value},E;if(_.type==="element"){let T;for(T in w0)if(Object.hasOwn(w0,T)&&Object.hasOwn(_.properties,T)){const I=_.properties[T],O=w0[T];(O===null||O.includes(_.tagName))&&(_.properties[T]=h(String(I||""),T,_))}}if(_.type==="element"){let T=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!T&&n&&typeof E=="number"&&(T=!n(_,E,C)),T&&C&&typeof E=="number")return p&&_.children?C.children.splice(E,1,..._.children):C.children.splice(E,1),E}}}function xse(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||gse.test(e.slice(0,t))?e:""}const _se={lineHeight:"1.2"},wse={backgroundColor:"rgba(0, 0, 0, 0.10)",paddingLeft:"4px",paddingRight:"4px",paddingTop:"2px",paddingBottom:"2px",marginLeft:"2px",marginRight:"2px",borderRadius:"2px",whiteSpace:"nowrap",overflow:"auto",lineHeight:"1.2"};function Eu({className:e="",source:t=""}){return S.jsx(vse,{className:e,components:{p:({children:n})=>S.jsx("span",{style:_se,children:n}),code:({children:n})=>S.jsx("span",{className:"font-monospace",style:wse,children:n})},children:t})}const Wr=hg()((e,t)=>({isDraggingNode:!1,setIsDraggingNode:n=>e({isDraggingNode:n}),connectionSource:null,setConnectionSource:n=>e({connectionSource:n}),connectionSourceHandle:null,setConnectionSourceHandle:n=>e({connectionSourceHandle:n}),mouseOverNodeId:null,setMouseOverNodeId:n=>e({mouseOverNodeId:n}),toasts:[],triggerToast:n=>{e({toasts:[...t().toasts,n]}),setTimeout(()=>e({toasts:t().toasts.slice(1)}),5e3)},refInput:{current:null},setRefInput:n=>e({refInput:n})}));function bse(){const{isDraggingNode:e,connectionSource:t,mouseOverNodeId:n}=Wr(),{machineState:r}=Ms(),{getString:i}=sn();if(e||t!==null)return S.jsx(S.Fragment,{});function o(){const{status:d,errors:p,timeSlot:h}=r;switch(d){case"ready":return{backgroundColor:Tt.purple,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Ready")};case"running":return{backgroundColor:Tt.green,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Running",{step:h})};case"waiting":return{backgroundColor:Tt.blue,statusIcon:"bi-hourglass-split",mainStatus:i("Status_Waiting")};case"halted":return{backgroundColor:Tt.purple,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Halted")};case"exception":return{backgroundColor:Tt.red,statusIcon:"bi-exclamation-circle-fill",mainStatus:i(p[0].message,p[0].payload)};case"invalid":{const m=ce.filter(p,{nodeId:n}),v=ce.filter(p,{nodeId:null});let x="",b=[];if(m.length===0)if(v.length>0){const y=v[0];x=i(y.message,y.payload)}else{const y=p.length;x=i("Status_CompileErrors",{count:y})}else if(m.length===1){const y=m[0];x=i(y.message,y.payload)}else x=i("Status_MultipleErrors"),b=ce.map(m,y=>i(y.message,y.payload));return{backgroundColor:Tt.red,statusIcon:"bi-exclamation-triangle-fill",mainStatus:x,smallStatus:b}}}}const{backgroundColor:s,statusIcon:a,mainStatus:u,smallStatus:c}=o();return S.jsx(Wte,{className:"m-0 border-0 text-white",style:{backgroundColor:s,padding:"6px 12px",zIndex:10},children:S.jsxs($a,{direction:"horizontal",className:"align-items-start",children:[S.jsx("i",{className:`bi ${a}`}),S.jsxs("span",{className:"ms-2",style:{whiteSpace:"pre-wrap"},children:[S.jsx(Eu,{source:u}),S.jsx(Eu,{className:"small",source:c==null?void 0:c.join(` -`)})]})]})})}function Ese(e){const t=ce.map(e,r=>parseInt(r.id));let n=0;for(;ce.includes(t,n);)n++;return n.toString()}function Sse(e){const t="var";let n=1;for(;;){const r=`${t}${n}`,i=ce.map(e,"id");if(!ce.includes(i,r))return r;n++}}function mk(){return{title:"",variables:[],nodes:[],edges:[]}}const Gr=hg()(EP((e,t)=>({flowchart:mk(),savedViewport:{x:0,y:0,zoom:1},clearFlowchart:()=>{e({flowchart:mk()}),e({savedViewport:{x:0,y:0,zoom:1}})},importSimpleFlowchart:n=>{const{title:r,variables:i,nodes:o,edges:s}=n,a=ce.map(s,({source:c,target:d,sourceHandle:p})=>({id:`${c}-${d}-${p}`,source:c,target:d,sourceHandle:p})),u=ce.map(o,({id:c,role:d,position:p,payload:h,handlePositions:m})=>({id:c,type:"MyNode",position:p,data:{payload:h,role:d,handlePositions:m}}));e({flowchart:{title:r,variables:i,nodes:u,edges:a}})},setTitle:n=>{const{flowchart:r}=t();r.title=n,e({flowchart:r})},onNodesChange:n=>{const{flowchart:r}=t();r.nodes=_D(n,r.nodes),e({flowchart:r})},onEdgesChange:n=>{const{flowchart:r}=t();r.edges=XG(n,r.edges),e({flowchart:r})},addNode:(n,r)=>{const{flowchart:i}=t(),o=xg(n),s={id:Ese(i.nodes),type:"MyNode",position:r,data:{payload:"",role:n,handlePositions:ce.fromPairs(ce.map(o,({id:a,position:u})=>[a,u]))}};i.nodes=[...i.nodes,s],e({flowchart:i})},deleteNode:n=>{const{flowchart:r}=t();r.nodes=ce.filter(r.nodes,i=>i.id!==n),r.edges=ce.filter(r.edges,i=>i.source!==n&&i.target!==n),e({flowchart:r})},changeNodePayload:(n,r)=>{const{flowchart:i}=t(),o=ce.find(i.nodes,{id:n});yi(o!==void 0),o.data.payload=r,e({flowchart:i})},addEdge:n=>{const{flowchart:r}=t();r.edges=ce.reject(r.edges,i=>i.source===n.source&&i.sourceHandle===n.sourceHandle),r.edges=JR(n,r.edges),e({flowchart:r})},moveHandle:n=>{const{flowchart:r}=t(),i=n.source,o=n.sourceHandle,s=n.targetHandle,a=ce.find(r.nodes,{id:i});yi(a!==void 0),a.data.handlePositions[o]=s,e({flowchart:r})},addVariable:()=>{const{flowchart:n}=t(),r=Sse(n.variables);n.variables=[...n.variables,{id:r,type:Yn.Number}],e({flowchart:n})},removeVariable:n=>{const{flowchart:r}=t();r.variables=ce.reject(r.variables,{id:n}),e({flowchart:r})},renameVariable:(n,r)=>{const{flowchart:i}=t();i.variables=ce.map(i.variables,o=>(o.id===n&&(o.id=r),o)),e({flowchart:i})},changeVariableType:(n,r)=>{const{flowchart:i}=t();i.variables=ce.map(i.variables,o=>(o.id===n&&(o.type=r),o)),e({flowchart:i})},reorderVariables:(n,r)=>{if(r===void 0||n===r)return;const{flowchart:i}=t(),o=i.variables[n];i.variables.splice(n,1),i.variables.splice(r,0,o),e({flowchart:i})},setSavedViewport:n=>e({savedViewport:n})}),{name:"fluxolab_flow",version:8}));function Cse({svgPathString:e,selected:t,animated:n,targetX:r,targetY:i,targetPosition:o}){const[s,a]=A.useState(!1),u=ii.darker(t?Tt.blue:Tt.gray500,s?48:0);return S.jsxs("g",{fill:"none",children:[S.jsx("path",{d:e,stroke:"white",strokeWidth:2}),S.jsx("path",{d:e,stroke:u,strokeWidth:2,markerEnd:"url(#arrowhead)",strokeDasharray:n?5:0,style:{animation:n?"dashdraw 0.5s linear infinite":"none"}}),S.jsx("path",{d:Ise(r,i,o),stroke:u,fill:u}),S.jsx("path",{d:e,stroke:"transparent",strokeWidth:16,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)})]})}function Ise(e,t,n){switch(n){case J.Top:return`M ${e} ${t} l 3.5 -9 l -7 0 z`;case J.Bottom:return`M ${e} ${t} l 3.5 9 l -7 0 z`;case J.Left:return`M ${e} ${t} l -9 3.5 l 0 -7 z`;case J.Right:return`M ${e} ${t} l 9 3.5 l 0 -7 z`}}function gk(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ase(e,t,n,r){const i=Math.min(gk(e,t)/2,gk(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x({x:i,y:o}));return n.reduce((i,o,s)=>{let a="";return s>0&&sp?C=(u+p)/2:a=y?C=Math.min(u,h)-s:C=Math.max(a,p)+s,E=[[x,b],[x,b+s],[C,b+s],[C,_-s],[y,_-s],[y,_]];break}case J.Left:{if(d<=m&&xv?(C=Math.min(u,h)-s,T=Math.max(d,v)+s):d[-I,O])}case J.Bottom:{if(b<=_)if(xp){const C=Math.max(_,b)+s;E=[[x,b],[x,C],[y,C],[y,_]]}else{const C=x<=y?h-s:p+s,T=(d+m)/2;E=[[x,b],[x,T],[C,T],[C,_+s],[y,_+s],[y,_]]}else{if(ay)return[[x,b],[x,b+s],[y,b+s],[y,_]];{const C=x<=y?a+s:u-s,T=(v+c)/2;return[[x,b],[x,b+s],[C,b+s],[C,T],[y,T],[y,_]]}}return E}}break}case J.Right:{switch(t){case J.Top:{const C={x:n.x,y:-n.y},T={x:r.x,y:-r.y};return ce.reverse(ce.map(Al(J.Bottom,J.Right,T,C,o,i),([I,O])=>[I,-O]))}case J.Left:{if(av||dr.y?(C=h-s,T=m-s):(C=h-s,T=v+s),E=[[x,b],[x+s,b],[x+s,T],[C,T],[C,_],[y,_]];break}case J.Right:{if(d<=m||c>=v){const C=Math.max(a,p)+s;E=[[x,b],[C,b],[C,_],[y,_]]}else if(a[-O,M])}case J.Top:{const C={x:n.x,y:-n.y},T={x:r.x,y:-r.y},I={[J.Top]:J.Bottom,[J.Bottom]:J.Top,[J.Left]:J.Left,[J.Right]:J.Right}[t];return ce.map(Al(J.Bottom,I,C,T,i,o),([O,M])=>[O,-M])}}return Nse(E)}function Nse(e){const t=[e[0]];for(let n=1;ne.length-1,yk=e=>{let t=0;for(let n=1;nAl(n||J.Bottom,p,e.position,t.position,i,o)),u=(ce.max(ce.map(s,yk))??0)+1,c=ce.minBy(s,p=>u*Ose(p)+yk(p))??s[0],d=ce.indexOf(s,c);return[c,r[d]]}function Dse({source:e,target:t,sourceHandleId:n,selected:r}){const[i,o]=A.useState(!1),{flowchart:s}=Gr(),{machineState:a}=Ms();A.useEffect(()=>{if(u===void 0||c===void 0)o(!1);else if(a.status==="ready"&&u.data.role===Ne.Start)o(!0);else if(a.status==="waiting"&&u.data.role===Ne.Read)o(a.curNodeId===e);else if(a.status==="running"){const b=bP(s,a);o(a.curNodeId===e&&b.curNodeId===t&&b.outPort===n)}else o(!1)},[e,t,n,a.curNodeId,a.status]);const u=ce.find(s.nodes,{id:e}),c=ce.find(s.nodes,{id:t});if(u===void 0||c===void 0||n===null||n===void 0)return S.jsx(S.Fragment,{});const d=u.data.handlePositions[n],[p,h]=Rse(u,c,d);ce.includes([Ne.Read,Ne.Write],c.data.role)&&(h==="left"?p[p.length-1][0]+=10:h==="right"&&(p[p.length-1][0]-=10));const m=Tse(p,10),[v,x]=p[p.length-1];return S.jsx(Cse,{svgPathString:m,selected:r??!1,animated:i,targetX:v,targetY:x,targetPosition:h})}const Lse=({fromX:e,fromY:t,toX:n,toY:r})=>{const{connectionSource:i,mouseOverNodeId:o}=Wr();return S.jsxs("g",{children:[i!==o&&S.jsx("path",{d:`M ${e} ${t} L ${n} ${r}`,fill:"none",stroke:o!==null?"green":"gray",strokeWidth:4}),S.jsx("circle",{cx:e,cy:t,r:6,fill:"white",stroke:"gray",strokeWidth:1}),S.jsx("circle",{cx:n,cy:r,r:6,fill:"white",stroke:"gray",strokeWidth:1})]})};function Pse({as:e,bsPrefix:t,className:n,...r}){t=Be(t,"col");const i=jw(),o=Vw(),s=[],a=[];return i.forEach(u=>{const c=r[u];delete r[u];let d,p,h;typeof c=="object"&&c!=null?{span:d,offset:p,order:h}=c:d=c;const m=u!==o?`-${u}`:"";d&&s.push(d===!0?`${t}${m}`:`${t}${m}-${d}`),h!=null&&a.push(`order${m}-${h}`),p!=null&&a.push(`offset${m}-${p}`)}),[{...r,className:Te(n,...s,...a)},{as:e,bsPrefix:t,spans:s}]}const fb=A.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:s}]=Pse(e);return S.jsx(i,{...r,ref:t,className:Te(n,!s.length&&o)})});fb.displayName="Col";const Mse={type:dr.string,tooltip:dr.bool,as:dr.elementType},Eg=A.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...i},o)=>S.jsx(e,{...i,ref:o,className:Te(t,`${n}-${r?"tooltip":"feedback"}`)}));Eg.displayName="Feedback";Eg.propTypes=Mse;const Oo=A.createContext({}),hd=A.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:o=!1,as:s="input",...a},u)=>{const{controlId:c}=A.useContext(Oo);return t=Be(t,"form-check-input"),S.jsx(s,{...a,ref:u,type:r,id:e||c,className:Te(n,t,i&&"is-valid",o&&"is-invalid")})});hd.displayName="FormCheckInput";const xm=A.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{const{controlId:o}=A.useContext(Oo);return e=Be(e,"form-check-label"),S.jsx("label",{...r,ref:i,htmlFor:n||o,className:Te(t,e)})});xm.displayName="FormCheckLabel";function $se(e,t){return A.Children.toArray(e).some(n=>A.isValidElement(n)&&n.type===t)}const vM=A.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:i=!1,disabled:o=!1,isValid:s=!1,isInvalid:a=!1,feedbackTooltip:u=!1,feedback:c,feedbackType:d,className:p,style:h,title:m="",type:v="checkbox",label:x,children:b,as:y="input",..._},E)=>{t=Be(t,"form-check"),n=Be(n,"form-switch");const{controlId:C}=A.useContext(Oo),T=A.useMemo(()=>({controlId:e||C}),[C,e]),I=!b&&x!=null&&x!==!1||$se(b,xm),O=S.jsx(hd,{..._,type:v==="switch"?"checkbox":v,ref:E,isValid:s,isInvalid:a,disabled:o,as:y});return S.jsx(Oo.Provider,{value:T,children:S.jsx("div",{style:h,className:Te(p,I&&t,r&&`${t}-inline`,i&&`${t}-reverse`,v==="switch"&&n),children:b||S.jsxs(S.Fragment,{children:[O,I&&S.jsx(xm,{title:m,children:x}),c&&S.jsx(Eg,{type:d,tooltip:u,children:c})]})})})});vM.displayName="FormCheck";const _m=Object.assign(vM,{Input:hd,Label:xm});var Fse=function(){},Bse=Fse;const Hse=Ts(Bse),xM=A.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:o,isValid:s=!1,isInvalid:a=!1,plaintext:u,readOnly:c,as:d="input",...p},h)=>{const{controlId:m}=A.useContext(Oo);return e=Be(e,"form-control"),S.jsx(d,{...p,type:t,size:r,ref:h,readOnly:c,id:i||m,className:Te(o,u?`${e}-plaintext`:e,n&&`${e}-${n}`,t==="color"&&`${e}-color`,s&&"is-valid",a&&"is-invalid")})});xM.displayName="FormControl";const zse=Object.assign(xM,{Feedback:Eg}),_M=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Be(t,"form-floating"),S.jsx(n,{ref:i,className:Te(e,t),...r})));_M.displayName="FormFloating";const db=A.forwardRef(({controlId:e,as:t="div",...n},r)=>{const i=A.useMemo(()=>({controlId:e}),[e]);return S.jsx(Oo.Provider,{value:i,children:S.jsx(t,{...n,ref:r})})});db.displayName="FormGroup";const wM=A.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:i,htmlFor:o,...s},a)=>{const{controlId:u}=A.useContext(Oo);t=Be(t,"form-label");let c="col-form-label";typeof n=="string"&&(c=`${c} ${c}-${n}`);const d=Te(i,t,r&&"visually-hidden",n&&c);return o=o||u,n?S.jsx(fb,{ref:a,as:"label",className:d,htmlFor:o,...s}):S.jsx(e,{ref:a,className:d,htmlFor:o,...s})});wM.displayName="FormLabel";const bM=A.forwardRef(({bsPrefix:e,className:t,id:n,...r},i)=>{const{controlId:o}=A.useContext(Oo);return e=Be(e,"form-range"),S.jsx("input",{...r,type:"range",ref:i,className:Te(t,e),id:n||o})});bM.displayName="FormRange";const EM=A.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:i=!1,isInvalid:o=!1,id:s,...a},u)=>{const{controlId:c}=A.useContext(Oo);return e=Be(e,"form-select"),S.jsx("select",{...a,size:n,ref:u,className:Te(r,e,t&&`${e}-${t}`,i&&"is-valid",o&&"is-invalid"),id:s||c})});EM.displayName="FormSelect";const SM=A.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...i},o)=>(e=Be(e,"form-text"),S.jsx(n,{...i,ref:o,className:Te(t,e,r&&"text-muted")})));SM.displayName="FormText";const CM=A.forwardRef((e,t)=>S.jsx(_m,{...e,ref:t,type:"switch"}));CM.displayName="Switch";const jse=Object.assign(CM,{Input:_m.Input,Label:_m.Label}),IM=A.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:i,...o},s)=>(e=Be(e,"form-floating"),S.jsxs(db,{ref:s,className:Te(t,e),controlId:r,...o,children:[n,S.jsx("label",{htmlFor:r,children:i})]})));IM.displayName="FloatingLabel";const Vse={_ref:dr.any,validated:dr.bool,as:dr.elementType},pb=A.forwardRef(({className:e,validated:t,as:n="form",...r},i)=>S.jsx(n,{...r,ref:i,className:Te(e,t&&"was-validated")}));pb.displayName="Form";pb.propTypes=Vse;const wa=Object.assign(pb,{Group:db,Control:zse,Floating:_M,Check:_m,Switch:jse,Label:wM,Text:SM,Range:bM,Select:EM,FloatingLabel:IM});var Yp;function vk(e){if((!Yp&&Yp!==0||e)&&$u){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Yp=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Yp}function Use(e){const t=A.useRef(e);return t.current=e,t}function hb(e){const t=Use(e);A.useEffect(()=>()=>t.current(),[])}function O0(e){e===void 0&&(e=cd());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function wm(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}const Wse="data-rr-ui-";function mb(e){return`${Wse}${e}`}function Gse(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const xk=mb("modal-open");class gb{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return Gse(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",i=this.getElement();t.style={overflow:i.style.overflow,[r]:i.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(bo(i,r)||"0",10)+t.scrollBarWidth}px`),i.setAttribute(xk,""),bo(i,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(xk),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const AM=A.createContext($u?window:void 0);AM.Provider;function Sg(){return A.useContext(AM)}const R0=(e,t)=>$u?e==null?(t||cd()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function Kse(e,t){const n=Sg(),[r,i]=A.useState(()=>R0(e,n==null?void 0:n.document));if(!r){const o=R0(e);o&&i(o)}return A.useEffect(()=>{},[t,r]),A.useEffect(()=>{const o=R0(e);o!==r&&i(o)},[e,r]),r}function qse({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:i}){const o=A.useRef(null),s=A.useRef(t),a=Pt(n);A.useEffect(()=>{t?s.current=!0:a(o.current)},[t,a]);const u=Ga(o,e.ref),c=A.cloneElement(e,{ref:u});return t?c:i||!s.current&&r?null:c}function Yse(e){return e.code==="Escape"||e.keyCode===27}function Xse(){const e=A.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}const Qse=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function Zse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jse(e){let{onEnter:t,onEntering:n,onEntered:r,onExit:i,onExiting:o,onExited:s,addEndListener:a,children:u}=e,c=Zse(e,Qse);const{major:d}=Xse(),p=d>=19?u.props.ref:u.ref,h=A.useRef(null),m=Ga(h,typeof u=="function"?null:p),v=I=>O=>{I&&h.current&&I(h.current,O)},x=A.useCallback(v(t),[t]),b=A.useCallback(v(n),[n]),y=A.useCallback(v(r),[r]),_=A.useCallback(v(i),[i]),E=A.useCallback(v(o),[o]),C=A.useCallback(v(s),[s]),T=A.useCallback(v(a),[a]);return Object.assign({},c,{nodeRef:h},t&&{onEnter:x},n&&{onEntering:b},r&&{onEntered:y},i&&{onExit:_},o&&{onExiting:E},s&&{onExited:C},a&&{addEndListener:T},{children:typeof u=="function"?(I,O)=>u(I,Object.assign({},O,{ref:m})):A.cloneElement(u,{ref:m})})}const eae=["component"];function tae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const nae=A.forwardRef((e,t)=>{let{component:n}=e,r=tae(e,eae);const i=Jse(r);return S.jsx(n,Object.assign({ref:t},i))});function rae({in:e,onTransition:t}){const n=A.useRef(null),r=A.useRef(!0),i=Pt(t);return mm(()=>{if(!n.current)return;let o=!1;return i({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,i]),mm(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function iae({children:e,in:t,onExited:n,onEntered:r,transition:i}){const[o,s]=A.useState(!t);t&&o&&s(!1);const a=rae({in:!!t,onTransition:c=>{const d=()=>{c.isStale()||(c.in?r==null||r(c.element,c.initial):(s(!0),n==null||n(c.element)))};Promise.resolve(i(c)).then(d,p=>{throw c.in||s(!0),p})}}),u=Ga(a,e.ref);return o&&!t?null:A.cloneElement(e,{ref:u})}function _k(e,t,n){return e?S.jsx(nae,Object.assign({},n,{component:e})):t?S.jsx(iae,Object.assign({},n,{transition:t})):S.jsx(qse,Object.assign({},n))}const oae=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function sae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}let D0;function aae(e){return D0||(D0=new gb({ownerDocument:e==null?void 0:e.document})),D0}function lae(e){const t=Sg(),n=e||aae(t),r=A.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:A.useCallback(i=>{r.current.dialog=i},[]),setBackdropRef:A.useCallback(i=>{r.current.backdrop=i},[])})}const TM=A.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:i,style:o,children:s,backdrop:a=!0,keyboard:u=!0,onBackdropClick:c,onEscapeKeyDown:d,transition:p,runTransition:h,backdropTransition:m,runBackdropTransition:v,autoFocus:x=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:_,renderDialog:E,renderBackdrop:C=Ie=>S.jsx("div",Object.assign({},Ie)),manager:T,container:I,onShow:O,onHide:M=()=>{},onExit:z,onExited:U,onExiting:F,onEnter:W,onEntering:Y,onEntered:L}=e,B=sae(e,oae);const j=Sg(),X=Kse(I),V=lae(T),H=G1(),N=TP(n),[Z,te]=A.useState(!n),R=A.useRef(null);A.useImperativeHandle(t,()=>V,[V]),$u&&!N&&n&&(R.current=O0(j==null?void 0:j.document)),n&&Z&&te(!1);const ee=Pt(()=>{if(V.add(),Se.current=as(document,"keydown",ye),_e.current=as(document,"focus",()=>setTimeout(oe),!0),O&&O(),x){var Ie,rt;const Pe=O0((Ie=(rt=V.dialog)==null?void 0:rt.ownerDocument)!=null?Ie:j==null?void 0:j.document);V.dialog&&Pe&&!wm(V.dialog,Pe)&&(R.current=Pe,V.dialog.focus())}}),re=Pt(()=>{if(V.remove(),Se.current==null||Se.current(),_e.current==null||_e.current(),y){var Ie;(Ie=R.current)==null||Ie.focus==null||Ie.focus(_),R.current=null}});A.useEffect(()=>{!n||!X||ee()},[n,X,ee]),A.useEffect(()=>{Z&&re()},[Z,re]),hb(()=>{re()});const oe=Pt(()=>{if(!b||!H()||!V.isTopModal())return;const Ie=O0(j==null?void 0:j.document);V.dialog&&Ie&&!wm(V.dialog,Ie)&&V.dialog.focus()}),pe=Pt(Ie=>{Ie.target===Ie.currentTarget&&(c==null||c(Ie),a===!0&&M())}),ye=Pt(Ie=>{u&&Yse(Ie)&&V.isTopModal()&&(d==null||d(Ie),Ie.defaultPrevented||M())}),_e=A.useRef(),Se=A.useRef(),We=(...Ie)=>{te(!0),U==null||U(...Ie)};if(!X)return null;const Re=Object.assign({role:r,ref:V.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},B,{style:o,className:i,tabIndex:-1});let De=E?E(Re):S.jsx("div",Object.assign({},Re,{children:A.cloneElement(s,{role:"document"})}));De=_k(p,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:z,onExiting:F,onExited:We,onEnter:W,onEntering:Y,onEntered:L,children:De});let He=null;return a&&(He=C({ref:V.setBackdropRef,onClick:pe}),He=_k(m,v,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:He})),S.jsx(S.Fragment,{children:la.createPortal(S.jsxs(S.Fragment,{children:[He,De]}),X)})});TM.displayName="Modal";const kM=Object.assign(TM,{Manager:gb});function uae(e,t){return e.classList?e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function cae(e,t){e.classList?e.classList.add(t):uae(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var fae=Function.prototype.bind.call(Function.prototype.call,[].slice);function es(e,t){return fae(e.querySelectorAll(t))}function wk(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function dae(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wk(e.className,t):e.setAttribute("class",wk(e.className&&e.className.baseVal||"",t))}const bl={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class NM extends gb{adjustAndStore(t,n,r){const i=n.style[t];n.dataset[t]=i,bo(n,{[t]:`${parseFloat(bo(n,t))+r}px`})}restore(t,n){const r=n.dataset[t];r!==void 0&&(delete n.dataset[t],bo(n,{[t]:r}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(cae(n,"modal-open"),!t.scrollBarWidth)return;const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";es(n,bl.FIXED_CONTENT).forEach(o=>this.adjustAndStore(r,o,t.scrollBarWidth)),es(n,bl.STICKY_CONTENT).forEach(o=>this.adjustAndStore(i,o,-t.scrollBarWidth)),es(n,bl.NAVBAR_TOGGLER).forEach(o=>this.adjustAndStore(i,o,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();dae(n,"modal-open");const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";es(n,bl.FIXED_CONTENT).forEach(o=>this.restore(r,o)),es(n,bl.STICKY_CONTENT).forEach(o=>this.restore(i,o)),es(n,bl.NAVBAR_TOGGLER).forEach(o=>this.restore(i,o))}}let L0;function OM(e){return L0||(L0=new NM(e)),L0}const RM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Be(t,"modal-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));RM.displayName="ModalBody";const yb=A.createContext({onHide(){}}),vb=A.forwardRef(({bsPrefix:e,className:t,contentClassName:n,centered:r,size:i,fullscreen:o,children:s,scrollable:a,...u},c)=>{e=Be(e,"modal");const d=`${e}-dialog`,p=typeof o=="string"?`${e}-fullscreen-${o}`:`${e}-fullscreen`;return S.jsx("div",{...u,ref:c,className:Te(d,t,i&&`${e}-${i}`,r&&`${d}-centered`,a&&`${d}-scrollable`,o&&p),children:S.jsx("div",{className:Te(`${e}-content`,n),children:s})})});vb.displayName="ModalDialog";const DM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Be(t,"modal-footer"),S.jsx(n,{ref:i,className:Te(e,t),...r})));DM.displayName="ModalFooter";const LM=A.forwardRef(({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:i,...o},s)=>{const a=A.useContext(yb),u=Pt(()=>{a==null||a.onHide(),r==null||r()});return S.jsxs("div",{ref:s,...o,children:[i,n&&S.jsx(fd,{"aria-label":e,variant:t,onClick:u})]})}),PM=A.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...i},o)=>(e=Be(e,"modal-header"),S.jsx(LM,{ref:o,...i,className:Te(t,e),closeLabel:n,closeButton:r})));PM.displayName="ModalHeader";const pae=W1("h4"),MM=A.forwardRef(({className:e,bsPrefix:t,as:n=pae,...r},i)=>(t=Be(t,"modal-title"),S.jsx(n,{ref:i,className:Te(e,t),...r})));MM.displayName="ModalTitle";function hae(e){return S.jsx(Da,{...e,timeout:null})}function mae(e){return S.jsx(Da,{...e,timeout:null})}const $M=A.forwardRef(({bsPrefix:e,className:t,style:n,dialogClassName:r,contentClassName:i,children:o,dialogAs:s=vb,"data-bs-theme":a,"aria-labelledby":u,"aria-describedby":c,"aria-label":d,show:p=!1,animation:h=!0,backdrop:m=!0,keyboard:v=!0,onEscapeKeyDown:x,onShow:b,onHide:y,container:_,autoFocus:E=!0,enforceFocus:C=!0,restoreFocus:T=!0,restoreFocusOptions:I,onEntered:O,onExit:M,onExiting:z,onEnter:U,onEntering:F,onExited:W,backdropClassName:Y,manager:L,...B},j)=>{const[X,V]=A.useState({}),[H,N]=A.useState(!1),Z=A.useRef(!1),te=A.useRef(!1),R=A.useRef(null),[ee,re]=AP(),oe=Ga(j,re),pe=Pt(y),ye=BO();e=Be(e,"modal");const _e=A.useMemo(()=>({onHide:pe}),[pe]);function Se(){return L||OM({isRTL:ye})}function We(ae){if(!$u)return;const be=Se().getScrollbarWidth()>0,Oe=ae.scrollHeight>cd(ae).documentElement.clientHeight;V({paddingRight:be&&!Oe?vk():void 0,paddingLeft:!be&&Oe?vk():void 0})}const Re=Pt(()=>{ee&&We(ee.dialog)});hb(()=>{A_(window,"resize",Re),R.current==null||R.current()});const De=()=>{Z.current=!0},He=ae=>{Z.current&&ee&&ae.target===ee.dialog&&(te.current=!0),Z.current=!1},Ie=()=>{N(!0),R.current=OP(ee.dialog,()=>{N(!1)})},rt=ae=>{ae.target===ae.currentTarget&&Ie()},Pe=ae=>{if(m==="static"){rt(ae);return}if(te.current||ae.target!==ae.currentTarget){te.current=!1;return}y==null||y()},we=ae=>{v?x==null||x(ae):(ae.preventDefault(),m==="static"&&Ie())},mt=(ae,be)=>{ae&&We(ae),U==null||U(ae,be)},gt=ae=>{R.current==null||R.current(),M==null||M(ae)},yt=(ae,be)=>{F==null||F(ae,be),q1(window,"resize",Re)},Zt=ae=>{ae&&(ae.style.display=""),W==null||W(ae),A_(window,"resize",Re)},an=A.useCallback(ae=>S.jsx("div",{...ae,className:Te(`${e}-backdrop`,Y,!h&&"show")}),[h,Y,e]),qt={...n,...X};qt.display="block";const ie=ae=>S.jsx("div",{role:"dialog",...ae,style:qt,className:Te(t,e,H&&`${e}-static`,!h&&"show"),onClick:m?Pe:void 0,onMouseUp:He,"data-bs-theme":a,"aria-label":d,"aria-labelledby":u,"aria-describedby":c,children:S.jsx(s,{...B,onMouseDown:De,className:r,contentClassName:i,children:o})});return S.jsx(yb.Provider,{value:_e,children:S.jsx(kM,{show:p,ref:oe,backdrop:m,container:_,keyboard:!0,autoFocus:E,enforceFocus:C,restoreFocus:T,restoreFocusOptions:I,onEscapeKeyDown:we,onShow:b,onHide:y,onEnter:mt,onEntering:yt,onEntered:O,onExit:gt,onExiting:z,onExited:Zt,manager:Se(),transition:h?hae:void 0,backdropTransition:h?mae:void 0,renderBackdrop:an,renderDialog:ie})})});$M.displayName="Modal";const ct=Object.assign($M,{Body:RM,Header:PM,Title:MM,Footer:DM,Dialog:vb,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),FM=A.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=Be(e,"row"),s=jw(),a=Vw(),u=`${o}-cols`,c=[];return s.forEach(d=>{const p=r[d];delete r[d];let h;p!=null&&typeof p=="object"?{cols:h}=p:h=p;const m=d!==a?`-${d}`:"";h!=null&&c.push(`${u}${m}-${h}`)}),S.jsx(n,{ref:i,...r,className:Te(t,o,...c)})});FM.displayName="Row";const Cg=A.createContext(null);Cg.displayName="InputGroupContext";const Ig=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Be(t,"input-group-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));Ig.displayName="InputGroupText";const gae=e=>S.jsx(Ig,{children:S.jsx(hd,{type:"checkbox",...e})}),yae=e=>S.jsx(Ig,{children:S.jsx(hd,{type:"radio",...e})}),BM=A.forwardRef(({bsPrefix:e,size:t,hasValidation:n,className:r,as:i="div",...o},s)=>{e=Be(e,"input-group");const a=A.useMemo(()=>({}),[]);return S.jsx(Cg.Provider,{value:a,children:S.jsx(i,{ref:s,...o,className:Te(r,e,t&&`${e}-${t}`,n&&"has-validation")})})});BM.displayName="InputGroup";const bk=Object.assign(BM,{Text:Ig,Radio:yae,Checkbox:gae});function HM({helpText:e,value:t,setValue:n,problem:r=""}){return S.jsxs(S.Fragment,{children:[S.jsxs(bk,{children:[S.jsx(wa.Control,{type:"text",className:`font-monospace ${r===""?"":"is-invalid"}`,autoFocus:!0,autoComplete:"off",value:t,onChange:i=>n(i.target.value),onFocus:i=>i.target.select()}),S.jsx(Lu,{text:e,children:S.jsx(bk.Text,{children:S.jsx("i",{className:"bi bi-question-circle"})})})]}),S.jsx(Eu,{className:"pt-2 small text-danger",source:r===""?" ":r})]})}function vae({id:e,data:t,showModal:n,setShowModal:r}){const[i,o]=A.useState(""),[s,a]=A.useState(""),{changeNodePayload:u}=Gr(),{language:c,getString:d}=sn();A.useEffect(()=>{n&&o(t.payload)},[n]),A.useEffect(()=>{const m=t.role,v=ud.match(`${m} ${i}`,"Command");if(v.failed()){const x=d("SyntaxError",{pos:v.getInterval().startIdx-m.length-1,expected:D1(v)});a(x)}else a("")},[i,c]);const p=m=>{m.preventDefault(),u(e,i.trim()),r(!1)},h=d(`BlockLabel_${t.role}`);return S.jsx(ct,{show:n,onHide:()=>r(!1),children:S.jsxs(wa,{onSubmit:p,children:[S.jsx(ct.Header,{closeButton:!0,children:S.jsx(ct.Title,{children:d(`BlockTitle_${t.role}`)})}),S.jsx(ct.Body,{children:S.jsxs(wa.Group,{as:FM,children:[h!==""&&S.jsx(wa.Label,{column:!0,className:"fw-bold fst-italic",md:"auto",children:h}),S.jsx(fb,{children:S.jsx(HM,{helpText:d(`BlockHelpText_${t.role}`),value:i,setValue:o,problem:s})})]})}),S.jsxs(ct.Footer,{children:[S.jsx(Rn,{variant:"secondary",onClick:()=>r(!1),children:d("Button_Cancel")}),S.jsx(Rn,{variant:"primary",type:"submit",children:d("Button_Save")})]})]})})}function xae({boxStyle:e,boxFilter:t,isSelected:n,isMouseHover:r,children:i}){function o(a){const u=ii.darker(a);return`repeating-linear-gradient( - 45deg, - ${a}, - ${a} 10px, - ${u} 10px, - ${u} 20px - )`}function s(){const a=e.backgroundColor,u=ii.darker(a);return n&&r?o(u):n?o(a):r?u:a}return S.jsx("div",{className:"text-center small fw-bold",style:{filter:t},children:S.jsx("div",{style:{lineHeight:"40px",color:e.textColor,background:s(),borderRadius:e.borderRadius,clipPath:e.clipPath},children:i})})}function Ek({variant:e,top:t,right:n,bottom:r,left:i,icon:o,visible:s,onClick:a}){return S.jsx(Rn,{variant:e,size:"sm",onClick:s?a:void 0,style:{position:"absolute",top:t,right:n,bottom:r,left:i,width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",opacity:s?1:0,transition:"visibility 0s, opacity 0.2s linear"},children:S.jsx("i",{className:`bi ${o}`})})}function _ae({nodeId:e,position:t}){const[,n]=A.useState(!1),{connectionSource:r,mouseOverNodeId:i}=Wr(),o=i===e&&r===e;return S.jsx(Na,{id:t,type:"target",position:t,isConnectableStart:!1,style:{display:"flex",width:"20px",height:"20px",borderRadius:"50%",border:0,backgroundColor:o?"rgba(0, 0, 0, 0.3)":"transparent"},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1)})}function wae({data:e}){const{getString:t}=sn(),{role:n,payload:r}=e,i=t(`BlockLabel_${n}`);switch(n){case Ne.Read:case Ne.Write:return S.jsxs("span",{children:[S.jsx("i",{children:i}),"  ",S.jsx("span",{className:`font-monospace ${r?"":"fst-italic"}`,children:r||t("Block_Empty")})]});case Ne.Start:case Ne.End:return S.jsx("span",{style:{position:"relative",top:"-2.5px"},children:S.jsx("i",{children:i})});case Ne.Assign:case Ne.Conditional:return S.jsx("span",{className:`font-monospace ${r?"":"fst-italic"}`,children:r||t("Block_Empty")})}}function bae({id:e,position:t,label:n,boxStyle:r}){const[i,o]=A.useState(!1);return S.jsx(Na,{id:e,type:"source",position:t,style:{display:"flex",width:"15px",height:"15px",lineHeight:"15px",fontSize:"10px",fontWeight:"bold",textAlign:"center",justifyContent:"center",alignItems:"center",color:r.textColor,borderColor:ii.darker(r.backgroundColor),backgroundColor:i?ii.darker(r.backgroundColor):r.backgroundColor},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:n})}function Eae({id:e}){return S.jsx(Na,{id:e,type:"target",position:J.Top,isConnectableStart:!1,isConnectable:!1,style:{backgroundColor:"transparent",borderColor:"transparent"}})}function Sae({id:e,data:t,selected:n}){const r=A.useRef(null),[i,o]=A.useState(0),[s,a]=A.useState(""),[u,c]=A.useState(!1),{isDraggingNode:d,connectionSource:p,connectionSourceHandle:h,mouseOverNodeId:m,setMouseOverNodeId:v}=Wr(),{deleteNode:x,addEdge:b}=Gr(),{machineState:y}=Ms(),{language:_}=sn(),{getZoom:E}=Fa();A.useEffect(()=>{if(r.current!==null){const B=E(),j=r.current.getBoundingClientRect().width/B,X=Math.min(40+20*Math.ceil(j/20),480);o((X-j)/2)}},[_]);function C(B){return`drop-shadow(+1px 0 1px ${B}) - drop-shadow(-1px 0 1px ${B}) - drop-shadow(0 +1px 1px ${B}) - drop-shadow(0 -1px 1px ${B})`}A.useEffect(()=>{a(()=>m===e&&p!==null&&p!==e?C(Tt.green):ce.some(y.errors,{nodeId:e})?C(Tt.red):y.status==="ready"&&t.role===Ne.Start||e===y.curNodeId?C(Tt.gray800):"")},[y,m,p]);function T(){x(e),v(null)}function I(){v(null),c(!0)}function O(){v(e)}function M(){v(null)}function z(){p!==null&&p!==e&&b({source:p,target:e,sourceHandle:h,targetHandle:"in"})}const U=wP(t.role),F=xg(t.role),W=m===e,Y=W&&!d&&p===null,L=Y&&!ce.includes([Ne.Start,Ne.End],t.role);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{onMouseEnter:O,onMouseLeave:M,onMouseUp:z,style:{cursor:d?"grabbing":"grab"},children:[S.jsx(xae,{boxStyle:U,boxFilter:s,isSelected:n,isMouseHover:W,children:S.jsx(S.Fragment,{children:S.jsx("span",{className:"d-block text-truncate",ref:r,style:{minWidth:"40px",maxWidth:"392px",marginLeft:`${i}px`,marginRight:`${i}px`},children:S.jsx(wae,{data:t})})})}),S.jsx(Ek,{variant:"danger",top:-8,right:-8,icon:"bi-trash-fill",visible:Y,onClick:T}),S.jsx(Ek,{variant:"primary",bottom:-8,right:-8,icon:"bi-pencil-fill",visible:L,onClick:I}),S.jsx(Eae,{id:"in"}),ce.map(F,({id:B,label:j},X)=>S.jsx(bae,{id:B,position:t.handlePositions[B],label:j,boxStyle:U},X)),ce.map(ce.difference(ce.values(J),ce.values(t.handlePositions)),(B,j)=>S.jsx(_ae,{nodeId:e,position:B},j))]}),S.jsx(vae,{id:e,data:t,showModal:u,setShowModal:c})]})}function Cae(){const{flowchart:e,onNodesChange:t,onEdgesChange:n,addNode:r,moveHandle:i,savedViewport:o,setSavedViewport:s}=Gr(),{connectionSource:a,setIsDraggingNode:u,setConnectionSource:c,setConnectionSourceHandle:d}=Wr(),{getViewport:p,screenToFlowPosition:h}=Fa(),m=jK(),v=T=>T.source===T.target,x=T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},b=T=>{T.preventDefault();const I=T.dataTransfer.getData("application/text"),O=h({x:T.clientX,y:T.clientY});ce.includes(Ne,I)&&r(I,O)},y=(T,{nodeId:I,handleId:O})=>{d(O),c(I)},_=()=>{a!==null&&m(a),c(null),d(null)},E=A.useMemo(()=>({MyNode:Sae}),[]),C=A.useMemo(()=>({MyEdge:Dse}),[]);return S.jsxs(DD,{nodes:e.nodes,edges:e.edges,nodeTypes:E,edgeTypes:C,onNodesChange:t,onEdgesChange:n,defaultEdgeOptions:{type:"MyEdge"},isValidConnection:v,connectionLineComponent:Lse,onConnect:i,onConnectStart:y,onConnectEnd:_,onDragOver:x,onDrop:b,onMoveEnd:()=>s(p()),onNodeDragStart:()=>u(!0),onNodeDragStop:()=>u(!1),defaultViewport:o,multiSelectionKeyCode:"Control",selectionKeyCode:"Shift",deleteKeyCode:"Delete",disableKeyboardA11y:!0,snapToGrid:!0,snapGrid:[20,20],nodeOrigin:[.5,.5],children:[S.jsx("div",{className:"position-relative m-3",children:S.jsxs($a,{direction:"horizontal",gap:3,className:"justify-content-between align-items-start",children:[S.jsx(vte,{}),S.jsx(bse,{})]})}),S.jsx(YK,{onZoomIn:()=>s(p()),onZoomOut:()=>s(p()),onFitView:()=>s(p())}),S.jsx(tq,{gap:20})]})}function $_(){return $_=Object.assign?Object.assign.bind():function(e){for(var t=1;t'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var Dae=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,s=n.mod,a=n.shift,u=n.ctrl,c=n.keys,d=t.key,p=t.code,h=t.ctrlKey,m=t.metaKey,v=t.shiftKey,x=t.altKey,b=ls(p),y=d.toLowerCase();if(!(c!=null&&c.includes(b))&&!(c!=null&&c.includes(y))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(b))return!1;if(!r){if(i===!x&&y!=="alt"||a===!v&&y!=="shift")return!1;if(s){if(!m&&!h)return!1}else if(o===!m&&y!=="meta"&&y!=="os"||u===!h&&y!=="ctrl"&&y!=="control")return!1}return c&&c.length===1&&(c.includes(y)||c.includes(b))?!0:c?Tae(c):!c},Lae=A.createContext(void 0),Pae=function(){return A.useContext(Lae)};function WM(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&WM(e[r],t[r])},!0):e===t}var Mae=A.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),$ae=function(){return A.useContext(Mae)};function Fae(e){var t=A.useRef(void 0);return WM(t.current,e)||(t.current=e),t.current}var Sk=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Bae=typeof window<"u"?A.useLayoutEffect:A.useEffect;function Hae(e,t,n,r){var i=A.useState(null),o=i[0],s=i[1],a=A.useRef(!1),u=n instanceof Array?r instanceof Array?void 0:r:n,c=xb(e)?e.join(u==null?void 0:u.splitKey):e,d=n instanceof Array?n:r instanceof Array?r:void 0,p=A.useCallback(t,d??[]),h=A.useRef(p);d?h.current=p:h.current=t;var m=Fae(u),v=$ae(),x=v.enabledScopes,b=Pae();return Bae(function(){if(!((m==null?void 0:m.enabled)===!1||!Rae(x,m==null?void 0:m.scopes))){var y=function(I,O){var M;if(O===void 0&&(O=!1),!(Oae(I)&&!UM(I,m==null?void 0:m.enableOnFormTags))){if(o!==null){var z=o.getRootNode();if((z instanceof Document||z instanceof ShadowRoot)&&z.activeElement!==o&&!o.contains(z.activeElement)){Sk(I);return}}(M=I.target)!=null&&M.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||P0(c,m==null?void 0:m.splitKey).forEach(function(U){var F,W=M0(U,m==null?void 0:m.combinationKey);if(Dae(I,W,m==null?void 0:m.ignoreModifiers)||(F=W.keys)!=null&&F.includes("*")){if(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I)||O&&a.current)return;if(kae(I,W,m==null?void 0:m.preventDefault),!Nae(I,W,m==null?void 0:m.enabled)){Sk(I);return}h.current(I,W),O||(a.current=!0)}})}},_=function(I){I.key!==void 0&&(jM(ls(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&y(I))},E=function(I){I.key!==void 0&&(VM(ls(I.code)),a.current=!1,m!=null&&m.keyup&&y(I,!0))},C=o||(u==null?void 0:u.document)||document;return C.addEventListener("keyup",E),C.addEventListener("keydown",_),b&&P0(c,m==null?void 0:m.splitKey).forEach(function(T){return b.addHotkey(M0(T,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){C.removeEventListener("keyup",E),C.removeEventListener("keydown",_),b&&P0(c,m==null?void 0:m.splitKey).forEach(function(T){return b.removeHotkey(M0(T,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[o,c,m,x]),s}function zae(){const{refInput:e}=Wr(),{machineState:t,executeAction:n}=Ms();for(const{actionId:r,hotkey:i,enabledStatuses:o}of VL)Hae(i,()=>{var s;i==="F8"&&((s=e.current)==null||s.focus()),o.includes(t.status)&&n(r)},{enableOnFormTags:["INPUT","TEXTAREA"],preventDefault:!0});return S.jsx(S.Fragment,{})}const bm=A.createContext(null),Ck=(e,t=null)=>e!=null?String(e):t||null,GM=A.forwardRef(({bsPrefix:e,className:t,as:n,...r},i)=>{e=Be(e,"navbar-brand");const o=n||(r.href?"a":"span");return S.jsx(o,{...r,ref:i,className:Te(t,e)})});GM.displayName="NavbarBrand";function Oc(...e){return e.filter(t=>t!=null).reduce((t,n)=>{if(typeof n!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?n:function(...i){t.apply(this,i),n.apply(this,i)}},null)}const jae={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Vae(e,t){const n=`offset${e[0].toUpperCase()}${e.slice(1)}`,r=t[n],i=jae[e];return r+parseInt(bo(t,i[0]),10)+parseInt(bo(t,i[1]),10)}const Uae={[Jo]:"collapse",[bu]:"collapsing",[oi]:"collapsing",[mo]:"collapse show"},Wae=Q.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,className:o,children:s,dimension:a="height",in:u=!1,timeout:c=300,mountOnEnter:d=!1,unmountOnExit:p=!1,appear:h=!1,getDimensionValue:m=Vae,...v},x)=>{const b=typeof a=="function"?a():a,y=A.useMemo(()=>Oc(I=>{I.style[b]="0"},e),[b,e]),_=A.useMemo(()=>Oc(I=>{const O=`scroll${b[0].toUpperCase()}${b.slice(1)}`;I.style[b]=`${I[O]}px`},t),[b,t]),E=A.useMemo(()=>Oc(I=>{I.style[b]=null},n),[b,n]),C=A.useMemo(()=>Oc(I=>{I.style[b]=`${m(b,I)}px`,RP(I)},r),[r,m,b]),T=A.useMemo(()=>Oc(I=>{I.style[b]=null},i),[b,i]);return S.jsx(X1,{ref:x,addEndListener:Y1,...v,"aria-expanded":v.role?u:null,onEnter:y,onEntering:_,onEntered:E,onExit:C,onExiting:T,childRef:s.ref,in:u,timeout:c,mountOnEnter:d,unmountOnExit:p,appear:h,children:(I,O)=>Q.cloneElement(s,{...O,className:Te(o,s.props.className,Uae[I],b==="width"&&"collapse-horizontal")})})}),qa=A.createContext(null);qa.displayName="NavbarContext";const KM=A.forwardRef(({children:e,bsPrefix:t,...n},r)=>{t=Be(t,"navbar-collapse");const i=A.useContext(qa);return S.jsx(Wae,{in:!!(i&&i.expanded),...n,children:S.jsx("div",{ref:r,className:t,children:e})})});KM.displayName="NavbarCollapse";const qM=A.forwardRef(({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:i="button",onClick:o,...s},a)=>{e=Be(e,"navbar-toggler");const{onToggle:u,expanded:c}=A.useContext(qa)||{},d=Pt(p=>{o&&o(p),u&&u()});return i==="button"&&(s.type="button"),S.jsx(i,{...s,ref:a,onClick:d,"aria-label":r,className:Te(t,e,!c&&"collapsed"),children:n||S.jsx("span",{className:`${e}-icon`})})});qM.displayName="NavbarToggle";const F_=new WeakMap,Ik=(e,t)=>{if(!e||!t)return;const n=F_.get(t)||new Map;F_.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function Gae(e,t=typeof window>"u"?void 0:window){const n=Ik(e,t),[r,i]=A.useState(()=>n?n.matches:!1);return mm(()=>{let o=Ik(e,t);if(!o)return i(!1);let s=F_.get(t);const a=()=>{i(o.matches)};return o.refCount++,o.addListener(a),a(),()=>{o.removeListener(a),o.refCount--,o.refCount<=0&&(s==null||s.delete(o.media)),o=void 0}},[e]),r}function Kae(e){const t=Object.keys(e);function n(a,u){return a===u?u:a?`${a} and ${u}`:u}function r(a){return t[Math.min(t.indexOf(a)+1,t.length-1)]}function i(a){const u=r(a);let c=e[u];return typeof c=="number"?c=`${c-.2}px`:c=`calc(${c} - 0.2px)`,`(max-width: ${c})`}function o(a){let u=e[a];return typeof u=="number"&&(u=`${u}px`),`(min-width: ${u})`}function s(a,u,c){let d;typeof a=="object"?(d=a,c=u,u=!0):(u=u||!0,d={[a]:u});let p=A.useMemo(()=>Object.entries(d).reduce((h,[m,v])=>((v==="up"||v===!0)&&(h=n(h,o(m))),(v==="down"||v===!0)&&(h=n(h,i(m))),h),""),[JSON.stringify(d)]);return Gae(p,c)}return s}const qae=Kae({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),YM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Be(t,"offcanvas-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));YM.displayName="OffcanvasBody";const Yae={[oi]:"show",[mo]:"show"},XM=A.forwardRef(({bsPrefix:e,className:t,children:n,in:r=!1,mountOnEnter:i=!1,unmountOnExit:o=!1,appear:s=!1,...a},u)=>(e=Be(e,"offcanvas"),S.jsx(X1,{ref:u,addEndListener:Y1,in:r,mountOnEnter:i,unmountOnExit:o,appear:s,...a,childRef:n.ref,children:(c,d)=>A.cloneElement(n,{...d,className:Te(t,n.props.className,(c===oi||c===bu)&&`${e}-toggling`,Yae[c])})})));XM.displayName="OffcanvasToggling";const QM=A.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...i},o)=>(e=Be(e,"offcanvas-header"),S.jsx(LM,{ref:o,...i,className:Te(t,e),closeLabel:n,closeButton:r})));QM.displayName="OffcanvasHeader";const Xae=W1("h5"),ZM=A.forwardRef(({className:e,bsPrefix:t,as:n=Xae,...r},i)=>(t=Be(t,"offcanvas-title"),S.jsx(n,{ref:i,className:Te(e,t),...r})));ZM.displayName="OffcanvasTitle";function Qae(e){return S.jsx(XM,{...e})}function Zae(e){return S.jsx(Da,{...e})}const JM=A.forwardRef(({bsPrefix:e,className:t,children:n,"aria-labelledby":r,placement:i="start",responsive:o,show:s=!1,backdrop:a=!0,keyboard:u=!0,scroll:c=!1,onEscapeKeyDown:d,onShow:p,onHide:h,container:m,autoFocus:v=!0,enforceFocus:x=!0,restoreFocus:b=!0,restoreFocusOptions:y,onEntered:_,onExit:E,onExiting:C,onEnter:T,onEntering:I,onExited:O,backdropClassName:M,manager:z,renderStaticNode:U=!1,...F},W)=>{const Y=A.useRef();e=Be(e,"offcanvas");const{onToggle:L}=A.useContext(qa)||{},[B,j]=A.useState(!1),X=qae(o||"xs","up");A.useEffect(()=>{j(o?s&&!X:s)},[s,o,X]);const V=Pt(()=>{L==null||L(),h==null||h()}),H=A.useMemo(()=>({onHide:V}),[V]);function N(){return z||(c?(Y.current||(Y.current=new NM({handleContainerOverflow:!1})),Y.current):OM())}const Z=(re,...oe)=>{re&&(re.style.visibility="visible"),T==null||T(re,...oe)},te=(re,...oe)=>{re&&(re.style.visibility=""),O==null||O(...oe)},R=A.useCallback(re=>S.jsx("div",{...re,className:Te(`${e}-backdrop`,M)}),[M,e]),ee=re=>S.jsx("div",{...re,...F,className:Te(t,o?`${e}-${o}`:e,`${e}-${i}`),"aria-labelledby":r,children:n});return S.jsxs(S.Fragment,{children:[!B&&(o||U)&&ee({}),S.jsx(yb.Provider,{value:H,children:S.jsx(kM,{show:B,ref:W,backdrop:a,container:m,keyboard:u,autoFocus:v,enforceFocus:x&&!c,restoreFocus:b,restoreFocusOptions:y,onEscapeKeyDown:d,onShow:p,onHide:V,onEnter:Z,onEntering:I,onEntered:_,onExit:E,onExiting:C,onExited:te,manager:N(),transition:Qae,backdropTransition:Zae,renderBackdrop:R,renderDialog:ee})})]})});JM.displayName="Offcanvas";const Jae=Object.assign(JM,{Body:YM,Header:QM,Title:ZM}),e$=A.forwardRef((e,t)=>{const n=A.useContext(qa);return S.jsx(Jae,{ref:t,show:!!(n!=null&&n.expanded),...e,renderStaticNode:!0})});e$.displayName="NavbarOffcanvas";const t$=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Be(t,"navbar-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));t$.displayName="NavbarText";const n$=A.forwardRef((e,t)=>{const{bsPrefix:n,expand:r=!0,variant:i="light",bg:o,fixed:s,sticky:a,className:u,as:c="nav",expanded:d,onToggle:p,onSelect:h,collapseOnSelect:m=!1,...v}=U1(e,{expanded:"onToggle"}),x=Be(n,"navbar"),b=A.useCallback((...E)=>{h==null||h(...E),m&&d&&(p==null||p(!1))},[h,m,d,p]);v.role===void 0&&c!=="nav"&&(v.role="navigation");let y=`${x}-expand`;typeof r=="string"&&(y=`${y}-${r}`);const _=A.useMemo(()=>({onToggle:()=>p==null?void 0:p(!d),bsPrefix:x,expanded:!!d,expand:r}),[x,d,r,p]);return S.jsx(qa.Provider,{value:_,children:S.jsx(bm.Provider,{value:b,children:S.jsx(c,{ref:t,...v,className:Te(u,x,r&&y,i&&`${x}-${i}`,o&&`bg-${o}`,a&&`sticky-${a}`,s&&`fixed-${s}`)})})})});n$.displayName="Navbar";const r$=Object.assign(n$,{Brand:GM,Collapse:KM,Offcanvas:e$,Text:t$,Toggle:qM});dr.string,dr.bool,dr.bool,dr.bool,dr.bool;const _b=A.forwardRef(({bsPrefix:e,className:t,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...s},a)=>(e=Be(e,"img"),S.jsx("img",{ref:a,...s,className:Te(t,n&&`${e}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${e}-thumbnail`)})));_b.displayName="Image";const i$=""+new URL("../FluxoLab.svg",import.meta.url).href;function ele(){return S.jsxs($a,{direction:"horizontal",className:"flex-fill",gap:2,children:[S.jsx(_b,{src:i$,alt:"Logo",width:"24",height:"24"}),S.jsx(r$.Brand,{children:"FluxoLab"})]})}function tle(e,t,n){const r=A.useRef(e!==void 0),[i,o]=A.useState(t),s=e!==void 0,a=r.current;return r.current=s,!s&&a&&i!==t&&o(t),[s?e:i,A.useCallback((...u)=>{const[c,...d]=u;let p=n==null?void 0:n(c,...d);return o(c),p},[n])]}function nle(){const[,e]=A.useReducer(t=>!t,!1);return e}const Ag=A.createContext(null);var Ak=Object.prototype.hasOwnProperty;function Tk(e,t,n){for(n of e.keys())if(lf(n,t))return n}function lf(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&lf(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Tk(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Tk(t,i),!i)||!lf(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ak.call(e,n)&&++r&&!Ak.call(t,n)||!(n in t)||!lf(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function rle(e){const t=G1();return[e[0],A.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}const ile=rd({defaultModifiers:[S1,fg,ug,cg,C1,E1,I1,x1]}),ole=["enabled","placement","strategy","modifiers"];function sle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const ale={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},lle={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const r=(t.getAttribute("aria-describedby")||"").split(",").filter(i=>i.trim()!==n.id);r.length?t.setAttribute("aria-describedby",r.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,i=(t=n.getAttribute("role"))==null?void 0:t.toLowerCase();if(n.id&&i==="tooltip"&&"setAttribute"in r){const o=r.getAttribute("aria-describedby");if(o&&o.split(",").indexOf(n.id)!==-1)return;r.setAttribute("aria-describedby",o?`${o},${n.id}`:n.id)}}},ule=[];function cle(e,t,n={}){let{enabled:r=!0,placement:i="bottom",strategy:o="absolute",modifiers:s=ule}=n,a=sle(n,ole);const u=A.useRef(s),c=A.useRef(),d=A.useCallback(()=>{var b;(b=c.current)==null||b.update()},[]),p=A.useCallback(()=>{var b;(b=c.current)==null||b.forceUpdate()},[]),[h,m]=rle(A.useState({placement:i,update:d,forceUpdate:p,attributes:{},styles:{popper:{},arrow:{}}})),v=A.useMemo(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:b})=>{const y={},_={};Object.keys(b.elements).forEach(E=>{y[E]=b.styles[E],_[E]=b.attributes[E]}),m({state:b,styles:y,attributes:_,update:d,forceUpdate:p,placement:b.placement})}}),[d,p,m]),x=A.useMemo(()=>(lf(u.current,s)||(u.current=s),u.current),[s]);return A.useEffect(()=>{!c.current||!r||c.current.setOptions({placement:i,strategy:o,modifiers:[...x,v,ale]})},[o,i,v,r,x]),A.useEffect(()=>{if(!(!r||e==null||t==null))return c.current=ile(e,t,Object.assign({},a,{placement:i,strategy:o,modifiers:[...x,lle,v]})),()=>{c.current!=null&&(c.current.destroy(),c.current=void 0,m(b=>Object.assign({},b,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),h}const kk=()=>{};function fle(e){return e.button===0}function dle(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const $0=e=>e&&("current"in e?e.current:e),Nk={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function ple(e,t=kk,{disabled:n,clickTrigger:r="click"}={}){const i=A.useRef(!1),o=A.useRef(!1),s=A.useCallback(c=>{const d=$0(e);Hse(!!d,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),i.current=!d||dle(c)||!fle(c)||!!wm(d,c.target)||o.current,o.current=!1},[e]),a=Pt(c=>{const d=$0(e);d&&wm(d,c.target)&&(o.current=!0)}),u=Pt(c=>{i.current||t(c)});A.useEffect(()=>{var c,d;if(n||e==null)return;const p=cd($0(e)),h=p.defaultView||window;let m=(c=h.event)!=null?c:(d=h.parent)==null?void 0:d.event,v=null;Nk[r]&&(v=as(p,Nk[r],a,!0));const x=as(p,r,s,!0),b=as(p,r,_=>{if(_===m){m=void 0;return}u(_)});let y=[];return"ontouchstart"in p.documentElement&&(y=[].slice.call(p.body.children).map(_=>as(_,"mousemove",kk))),()=>{v==null||v(),x(),b(),y.forEach(_=>_())}},[e,n,r,s,a,u])}function hle(e){const t={};return Array.isArray(e)?(e==null||e.forEach(n=>{t[n.name]=n}),t):e||t}function mle(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}function gle({enabled:e,enableEvents:t,placement:n,flip:r,offset:i,fixed:o,containerPadding:s,arrowElement:a,popperConfig:u={}}){var c,d,p,h,m;const v=hle(u.modifiers);return Object.assign({},u,{placement:n,enabled:e,strategy:o?"fixed":u.strategy,modifiers:mle(Object.assign({},v,{eventListeners:{enabled:t,options:(c=v.eventListeners)==null?void 0:c.options},preventOverflow:Object.assign({},v.preventOverflow,{options:s?Object.assign({padding:s},(d=v.preventOverflow)==null?void 0:d.options):(p=v.preventOverflow)==null?void 0:p.options}),offset:{options:Object.assign({offset:i},(h=v.offset)==null?void 0:h.options)},arrow:Object.assign({},v.arrow,{enabled:!!a,options:Object.assign({},(m=v.arrow)==null?void 0:m.options,{element:a})}),flip:Object.assign({enabled:!!r},v.flip)}))})}const yle=["children","usePopper"];function vle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const xle=()=>{};function o$(e={}){const t=A.useContext(Ag),[n,r]=AP(),i=A.useRef(!1),{flip:o,offset:s,rootCloseEvent:a,fixed:u=!1,placement:c,popperConfig:d={},enableEventListeners:p=!0,usePopper:h=!!t}=e,m=(t==null?void 0:t.show)==null?!!e.show:t.show;m&&!i.current&&(i.current=!0);const v=I=>{t==null||t.toggle(!1,I)},{placement:x,setMenu:b,menuElement:y,toggleElement:_}=t||{},E=cle(_,y,gle({placement:c||x||"bottom-start",enabled:h,enableEvents:p??m,offset:s,flip:o,fixed:u,arrowElement:n,popperConfig:d})),C=Object.assign({ref:b||xle,"aria-labelledby":_==null?void 0:_.id},E.attributes.popper,{style:E.styles.popper}),T={show:m,placement:x,hasShown:i.current,toggle:t==null?void 0:t.toggle,popper:h?E:null,arrowProps:h?Object.assign({ref:r},E.attributes.arrow,{style:E.styles.arrow}):{}};return ple(y,v,{clickTrigger:a,disabled:!m}),[C,T]}function s$(e){let{children:t,usePopper:n=!0}=e,r=vle(e,yle);const[i,o]=o$(Object.assign({},r,{usePopper:n}));return S.jsx(S.Fragment,{children:t(i,o)})}s$.displayName="DropdownMenu";const Em={prefix:String(Math.round(Math.random()*1e10)),current:0},a$=Q.createContext(Em),_le=Q.createContext(!1);let wle=!!(typeof window<"u"&&window.document&&window.document.createElement),F0=new WeakMap;function ble(e=!1){let t=A.useContext(a$),n=A.useRef(null);if(n.current===null&&!e){var r,i;let o=(i=Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(o){let s=F0.get(o);s==null?F0.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==s.state&&(t.current=s.id,F0.delete(o))}n.current=++t.current}return n.current}function Ele(e){let t=A.useContext(a$);t===Em&&!wle&&console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=ble(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function Sle(e){let t=Q.useId(),[n]=A.useState(kle()),r=n?"react-aria":`react-aria${Em.prefix}`;return e||`${r}-${t}`}const Cle=typeof Q.useId=="function"?Sle:Ele;function Ile(){return!1}function Ale(){return!0}function Tle(e){return()=>{}}function kle(){return typeof Q.useSyncExternalStore=="function"?Q.useSyncExternalStore(Tle,Ile,Ale):A.useContext(_le)}const l$=e=>{var t;return((t=e.getAttribute("role"))==null?void 0:t.toLowerCase())==="menu"},Ok=()=>{};function u$(){const e=Cle(),{show:t=!1,toggle:n=Ok,setToggle:r,menuElement:i}=A.useContext(Ag)||{},o=A.useCallback(a=>{n(!t,a)},[t,n]),s={id:e,ref:r||Ok,onClick:o,"aria-expanded":!!t};return i&&l$(i)&&(s["aria-haspopup"]=!0),[s,{show:t,toggle:n}]}function c$({children:e}){const[t,n]=u$();return S.jsx(S.Fragment,{children:e(t,n)})}c$.displayName="DropdownToggle";const f$=A.createContext(null);f$.displayName="NavContext";const Nle=["eventKey","disabled","onClick","active","as"];function Ole(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function d$({key:e,href:t,active:n,disabled:r,onClick:i}){const o=A.useContext(bm),s=A.useContext(f$),{activeKey:a}=s||{},u=Ck(e,t),c=n==null&&e!=null?Ck(a)===u:n;return[{onClick:Pt(p=>{r||(i==null||i(p),o&&!p.isPropagationStopped()&&o(u,p))}),"aria-disabled":r||void 0,"aria-selected":c,[mb("dropdown-item")]:""},{isActive:c}]}const p$=A.forwardRef((e,t)=>{let{eventKey:n,disabled:r,onClick:i,active:o,as:s=MD}=e,a=Ole(e,Nle);const[u]=d$({key:n,href:a.href,disabled:r,onClick:i,active:o});return S.jsx(s,Object.assign({},a,{ref:t},u))});p$.displayName="DropdownItem";function Rk(){const e=nle(),t=A.useRef(null),n=A.useCallback(r=>{t.current=r,e()},[e]);return[t,n]}function md({defaultShow:e,show:t,onSelect:n,onToggle:r,itemSelector:i=`* [${mb("dropdown-item")}]`,focusFirstItemOnShow:o,placement:s="bottom-start",children:a}){const u=Sg(),[c,d]=tle(t,e,r),[p,h]=Rk(),m=p.current,[v,x]=Rk(),b=v.current,y=TP(c),_=A.useRef(null),E=A.useRef(!1),C=A.useContext(bm),T=A.useCallback((F,W,Y=W==null?void 0:W.type)=>{d(F,{originalEvent:W,source:Y})},[d]),I=Pt((F,W)=>{n==null||n(F,W),T(!1,W,"select"),W.isPropagationStopped()||C==null||C(F,W)}),O=A.useMemo(()=>({toggle:T,placement:s,show:c,menuElement:m,toggleElement:b,setMenu:h,setToggle:x}),[T,s,c,m,b,h,x]);m&&y&&!c&&(E.current=m.contains(m.ownerDocument.activeElement));const M=Pt(()=>{b&&b.focus&&b.focus()}),z=Pt(()=>{const F=_.current;let W=o;if(W==null&&(W=p.current&&l$(p.current)?"keyboard":!1),W===!1||W==="keyboard"&&!/^key.+$/.test(F))return;const Y=es(p.current,i)[0];Y&&Y.focus&&Y.focus()});A.useEffect(()=>{c?z():E.current&&(E.current=!1,M())},[c,E,M,z]),A.useEffect(()=>{_.current=null});const U=(F,W)=>{if(!p.current)return null;const Y=es(p.current,i);let L=Y.indexOf(F)+W;return L=Math.max(0,Math.min(L,Y.length)),Y[L]};return Ste(A.useCallback(()=>u.document,[u]),"keydown",F=>{var W,Y;const{key:L}=F,B=F.target,j=(W=p.current)==null?void 0:W.contains(B),X=(Y=v.current)==null?void 0:Y.contains(B);if(/input|textarea/i.test(B.tagName)&&(L===" "||L!=="Escape"&&j||L==="Escape"&&B.type==="search")||!j&&!X||L==="Tab"&&(!p.current||!c))return;_.current=F.type;const H={originalEvent:F,source:F.type};switch(L){case"ArrowUp":{const N=U(B,-1);N&&N.focus&&N.focus(),F.preventDefault();return}case"ArrowDown":if(F.preventDefault(),!c)d(!0,H);else{const N=U(B,1);N&&N.focus&&N.focus()}return;case"Tab":q1(B.ownerDocument,"keyup",N=>{var Z;(N.key==="Tab"&&!N.target||!((Z=p.current)!=null&&Z.contains(N.target)))&&d(!1,H)},{once:!0});break;case"Escape":L==="Escape"&&(F.preventDefault(),F.stopPropagation()),d(!1,H);break}}),S.jsx(bm.Provider,{value:I,children:S.jsx(Ag.Provider,{value:O,children:a})})}md.displayName="Dropdown";md.Menu=s$;md.Toggle=c$;md.Item=p$;const wb=A.createContext({});wb.displayName="DropdownContext";const h$=A.forwardRef(({className:e,bsPrefix:t,as:n="hr",role:r="separator",...i},o)=>(t=Be(t,"dropdown-divider"),S.jsx(n,{ref:o,className:Te(e,t),role:r,...i})));h$.displayName="DropdownDivider";const m$=A.forwardRef(({className:e,bsPrefix:t,as:n="div",role:r="heading",...i},o)=>(t=Be(t,"dropdown-header"),S.jsx(n,{ref:o,className:Te(e,t),role:r,...i})));m$.displayName="DropdownHeader";const g$=A.forwardRef(({bsPrefix:e,className:t,eventKey:n,disabled:r=!1,onClick:i,active:o,as:s=K1,...a},u)=>{const c=Be(e,"dropdown-item"),[d,p]=d$({key:n,href:a.href,disabled:r,onClick:i,active:o});return S.jsx(s,{...a,...d,ref:u,className:Te(t,c,p.isActive&&"active",r&&"disabled")})});g$.displayName="DropdownItem";const y$=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Be(t,"dropdown-item-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));y$.displayName="DropdownItemText";function v$(e,t){return e}function x$(e,t,n){const r=n?"top-end":"top-start",i=n?"top-start":"top-end",o=n?"bottom-end":"bottom-start",s=n?"bottom-start":"bottom-end",a=n?"right-start":"left-start",u=n?"right-end":"left-end",c=n?"left-start":"right-start",d=n?"left-end":"right-end";let p=e?s:o;return t==="up"?p=e?i:r:t==="end"?p=e?d:c:t==="start"?p=e?u:a:t==="down-centered"?p="bottom":t==="up-centered"&&(p="top"),p}const _$=A.forwardRef(({bsPrefix:e,className:t,align:n,rootCloseEvent:r,flip:i=!0,show:o,renderOnMount:s,as:a="div",popperConfig:u,variant:c,...d},p)=>{let h=!1;const m=A.useContext(qa),v=Be(e,"dropdown-menu"),{align:x,drop:b,isRTL:y}=A.useContext(wb);n=n||x;const _=A.useContext(Cg),E=[];if(n)if(typeof n=="object"){const F=Object.keys(n);if(F.length){const W=F[0],Y=n[W];h=Y==="start",E.push(`${v}-${W}-${Y}`)}}else n==="end"&&(h=!0);const C=x$(h,b,y),[T,{hasShown:I,popper:O,show:M,toggle:z}]=o$({flip:i,rootCloseEvent:r,show:o,usePopper:!m&&E.length===0,offset:[0,2],popperConfig:u,placement:C});if(T.ref=Ga(v$(p),T.ref),mm(()=>{M&&(O==null||O.update())},[M]),!I&&!s&&!_)return null;typeof a!="string"&&(T.show=M,T.close=()=>z==null?void 0:z(!1),T.align=n);let U=d.style;return O!=null&&O.placement&&(U={...d.style,...T.style},d["x-placement"]=O.placement),S.jsx(a,{...d,...T,style:U,...(E.length||m)&&{"data-bs-popper":"static"},className:Te(t,v,M&&"show",h&&`${v}-end`,c&&`${v}-${c}`,...E)})});_$.displayName="DropdownMenu";const w$=A.forwardRef(({bsPrefix:e,split:t,className:n,childBsPrefix:r,as:i=Rn,...o},s)=>{const a=Be(e,"dropdown-toggle"),u=A.useContext(Ag);r!==void 0&&(o.bsPrefix=r);const[c]=u$();return c.ref=Ga(c.ref,v$(s)),S.jsx(i,{className:Te(n,a,t&&`${a}-split`,(u==null?void 0:u.show)&&"show"),...c,...o})});w$.displayName="DropdownToggle";const b$=A.forwardRef((e,t)=>{const{bsPrefix:n,drop:r="down",show:i,className:o,align:s="start",onSelect:a,onToggle:u,focusFirstItemOnShow:c,as:d="div",navbar:p,autoClose:h=!0,...m}=U1(e,{show:"onToggle"}),v=A.useContext(Cg),x=Be(n,"dropdown"),b=BO(),y=O=>h===!1?O==="click":h==="inside"?O!=="rootClose":h==="outside"?O!=="select":!0,_=Pt((O,M)=>{var z;!((z=M.originalEvent)==null||(z=z.target)==null)&&z.classList.contains("dropdown-toggle")&&M.source==="mousedown"||(M.originalEvent.currentTarget===document&&(M.source!=="keydown"||M.originalEvent.key==="Escape")&&(M.source="rootClose"),y(M.source)&&(u==null||u(O,M)))}),C=x$(s==="end",r,b),T=A.useMemo(()=>({align:s,drop:r,isRTL:b}),[s,r,b]),I={down:x,"down-centered":`${x}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return S.jsx(wb.Provider,{value:T,children:S.jsx(md,{placement:C,show:i,onSelect:a,onToggle:_,focusFirstItemOnShow:c,itemSelector:`.${x}-item:not(.disabled):not(:disabled)`,children:v?m.children:S.jsx(d,{...m,ref:t,className:Te(o,i&&"show",I[r])})})})});b$.displayName="Dropdown";const Un=Object.assign(b$,{Toggle:w$,Menu:_$,Item:g$,ItemText:y$,Divider:h$,Header:m$});var bb={exports:{}};bb.exports;(function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function s(u,c){if(!o[u]){o[u]={};for(var d=0;d>>8,d[p*2+1]=m%256}return d},decompressFromUint8Array:function(u){if(u==null)return a.decompress(u);for(var c=new Array(u.length/2),d=0,p=c.length;d>1}else{for(h=1,p=0;p>1}_--,_==0&&(_=Math.pow(2,C),C++),delete v[y]}else for(h=m[y],p=0;p>1;_--,_==0&&(_=Math.pow(2,C),C++),m[b]=E++,y=String(x)}if(y!==""){if(Object.prototype.hasOwnProperty.call(v,y)){if(y.charCodeAt(0)<256){for(p=0;p>1}else{for(h=1,p=0;p>1}_--,_==0&&(_=Math.pow(2,C),C++),delete v[y]}else for(h=m[y],p=0;p>1;_--,_==0&&(_=Math.pow(2,C),C++)}for(h=2,p=0;p>1;for(;;)if(I=I<<1,O==c-1){T.push(d(I));break}else O++;return T.join("")},decompress:function(u){return u==null?"":u==""?null:a._decompress(u.length,32768,function(c){return u.charCodeAt(c)})},_decompress:function(u,c,d){var p=[],h=4,m=4,v=3,x="",b=[],y,_,E,C,T,I,O,M={val:d(0),position:c,index:1};for(y=0;y<3;y+=1)p[y]=y;for(E=0,T=Math.pow(2,2),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;switch(E){case 0:for(E=0,T=Math.pow(2,8),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;O=n(E);break;case 1:for(E=0,T=Math.pow(2,16),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;O=n(E);break;case 2:return""}for(p[3]=O,_=O,b.push(O);;){if(M.index>u)return"";for(E=0,T=Math.pow(2,v),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;switch(O=E){case 0:for(E=0,T=Math.pow(2,8),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;p[m++]=n(E),O=m-1,h--;break;case 1:for(E=0,T=Math.pow(2,16),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;p[m++]=n(E),O=m-1,h--;break;case 2:return b.join("")}if(h==0&&(h=Math.pow(2,v),v++),p[O])x=p[O];else if(O===m)x=_+_.charAt(0);else return null;b.push(x),p[m++]=_+x.charAt(0),h--,_=x,h==0&&(h=Math.pow(2,v),v++)}}};return a}();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(bb);var E$=bb.exports;const bh=["number","string","boolean","start","read","write","assign","conditional","end","in","out","true","false"],B0=ce.fromPairs(ce.map(bh,(e,t)=>[e,t]));function Rle(e){const{title:t,variables:n,nodes:r,edges:i}=e,o=ce.map(r,a=>({id:a.id,role:a.data.role,position:a.position,payload:a.data.payload,handlePositions:a.data.handlePositions})),s=ce.map(i,({source:a,target:u,sourceHandle:c})=>({source:a,target:u,sourceHandle:c}));return{title:t,variables:n,nodes:o,edges:s}}function Dle(e){const{title:t,variables:n,nodes:r,edges:i}=e;return[t,ce.map(n,o=>[o.id,B0[o.type]]),ce.map(r,o=>[parseInt(o.id),B0[o.role],o.position.x,o.position.y,o.payload,ce.values(o.handlePositions)]),ce.map(i,o=>[parseInt(o.source),B0[o.sourceHandle],parseInt(o.target)])]}function Lle(e){const[t,n,r,i]=e,o=ce.map(n,([s,a])=>({id:s,type:bh[a]}));return{title:t,variables:o,nodes:ce.map(r,([s,a,u,c,d,p])=>{const h=s.toString(),m=bh[a],v={x:u,y:c},x=xg(m),b=p===void 0,y=ce.fromPairs(ce.map(x,({id:_,position:E},C)=>[_,b?E:p[C]]));return{id:h,role:m,position:v,payload:d,handlePositions:y}}),edges:ce.map(i,([s,a,u])=>({source:s.toString(),sourceHandle:bh[a],target:u.toString()}))}}const Ple=ce.flow(Rle,Dle,JSON.stringify,E$.compressToEncodedURIComponent),Mle=ce.flow(E$.decompressFromEncodedURIComponent,JSON.parse,Lle);function $le({showModal:e,setShowModal:t}){const{clearFlowchart:n}=Gr(),{triggerToast:r}=Wr(),{getString:i}=sn(),{setViewport:o}=Fa(),s=()=>{t(!1)},a=()=>{n(),o({x:0,y:0,zoom:1}),t(!1),r({background:"success",icon:"bi-recycle",message:i("ToastMessage_FlowchartCleared")})};return S.jsxs(ct,{show:e,onHide:s,children:[S.jsx(ct.Header,{closeButton:!0,children:S.jsx(ct.Title,{children:i("ModalClear_Title")})}),S.jsx(ct.Body,{children:S.jsx("p",{children:i("ModalClear_Body")})}),S.jsxs(ct.Footer,{children:[S.jsx(Rn,{variant:"secondary",onClick:s,children:i("Button_Cancel")}),S.jsx(Rn,{variant:"primary",onClick:a,children:i("Button_Clear")})]})]})}function Fle(){const[e,t]=A.useState(!1),{flowchart:n}=Gr(),{triggerToast:r}=Wr(),{getString:i}=sn(),o=()=>{const s=Ple(n),a=window.location.href.split("?")[0];navigator.clipboard.writeText(`${a}?lzs=${s}`),r({message:i("ToastMessage_CopyLink"),icon:"bi-clipboard-check",background:"secondary"})};return S.jsxs(S.Fragment,{children:[S.jsxs(Un,{align:"end",children:[S.jsx(Lu,{text:i("MenuFlowchart_Tooltip"),children:S.jsx(Un.Toggle,{children:S.jsx("i",{className:"bi bi-bounding-box-circles"})})}),S.jsxs(Un.Menu,{children:[S.jsx(Un.Item,{onClick:()=>t(!0),children:i("MenuFlowchart_Clear")}),S.jsx(Un.Item,{onClick:o,children:i("MenuFlowchart_CopyLink")})]})]}),S.jsx($le,{showModal:e,setShowModal:t})]})}function Ble({showModal:e,setShowModal:t}){const{getString:n}=sn();return S.jsxs(ct,{show:e,onHide:()=>t(!1),children:[S.jsxs(ct.Header,{closeButton:!0,children:[S.jsx(_b,{src:i$,alt:"Logo",width:"32",height:"32",className:"me-3"}),S.jsx(ct.Title,{children:n("ModalAbout_Title")})]}),S.jsxs(ct.Body,{children:[S.jsx("p",{children:S.jsx(Eu,{source:n("ModalAbout_Body1")})}),S.jsx("p",{children:S.jsx(Eu,{source:n("ModalAbout_Body2",{GitHub:"[GitHub](https://github.com/rwnobrega/FluxoLab.app)",GPL3:"[GPL3](https://www.gnu.org/licenses/gpl-3.0.en.html)"})})})]}),S.jsx(ct.Footer,{children:S.jsx(Rn,{variant:"secondary",onClick:()=>t(!1),children:n("Button_Close")})})]})}const Hle={title:"factorial",variables:[{id:"n",type:Yn.Number},{id:"fat",type:Yn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:400,y:120},payload:"",handlePositions:{out:J.Bottom}},{id:"1",role:Ne.Assign,position:{x:400,y:280},payload:"fat = 1",handlePositions:{out:J.Bottom}},{id:"2",role:Ne.Read,position:{x:400,y:200},payload:"n",handlePositions:{out:J.Bottom}},{id:"3",role:Ne.Conditional,position:{x:400,y:360},payload:"n > 1",handlePositions:{true:J.Bottom,false:J.Right}},{id:"4",role:Ne.Assign,position:{x:400,y:440},payload:"fat = fat * n",handlePositions:{out:J.Bottom}},{id:"5",role:Ne.Assign,position:{x:400,y:520},payload:"n = n - 1",handlePositions:{out:J.Left}},{id:"6",role:Ne.Write,position:{x:580,y:360},payload:"fat",handlePositions:{out:J.Bottom}},{id:"7",role:Ne.End,position:{x:580,y:440},payload:"",handlePositions:{}}],edges:[{source:"2",sourceHandle:"out",target:"1"},{source:"3",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"3",sourceHandle:"false",target:"6"},{source:"6",sourceHandle:"out",target:"7"},{source:"1",sourceHandle:"out",target:"3"},{source:"5",sourceHandle:"out",target:"3"},{source:"0",sourceHandle:"out",target:"2"}]},zle={title:"overtime",variables:[{id:"hours",type:Yn.Number},{id:"pay",type:Yn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:400,y:80},payload:"",handlePositions:{out:J.Bottom}},{id:"1",role:Ne.Read,position:{x:400,y:160},payload:"hours",handlePositions:{out:J.Bottom}},{id:"2",role:Ne.Assign,position:{x:400,y:240},payload:"pay = 50 * hours",handlePositions:{out:J.Bottom}},{id:"3",role:Ne.Conditional,position:{x:400,y:320},payload:"hours > 8",handlePositions:{true:J.Bottom,false:J.Right}},{id:"4",role:Ne.Assign,position:{x:400,y:400},payload:"pay = pay + 25 * (hours - 8)",handlePositions:{out:J.Bottom}},{id:"5",role:Ne.Write,position:{x:400,y:480},payload:'"The payment is $", pay, "."',handlePositions:{out:J.Bottom}},{id:"6",role:Ne.End,position:{x:400,y:560},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"out",target:"3"},{source:"3",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"5",sourceHandle:"out",target:"6"},{source:"3",sourceHandle:"false",target:"5"}]},jle={title:"secret",variables:[{id:"secret",type:Yn.Number},{id:"guess",type:Yn.Number},{id:"tries",type:Yn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:480,y:-60},payload:"",handlePositions:{out:J.Bottom}},{id:"1",role:Ne.Assign,position:{x:480,y:20},payload:"secret = rand_int(1, 100)",handlePositions:{out:J.Bottom}},{id:"2",role:Ne.Assign,position:{x:480,y:100},payload:"tries = 0",handlePositions:{out:J.Bottom}},{id:"3",role:Ne.Read,position:{x:480,y:180},payload:"guess",handlePositions:{out:J.Bottom}},{id:"4",role:Ne.Assign,position:{x:480,y:260},payload:"tries = tries + 1",handlePositions:{out:J.Bottom}},{id:"5",role:Ne.Conditional,position:{x:480,y:340},payload:"secret > guess",handlePositions:{true:J.Right,false:J.Bottom}},{id:"6",role:Ne.Write,position:{x:720,y:340},payload:'"Secret is higher"',handlePositions:{out:J.Right}},{id:"7",role:Ne.Conditional,position:{x:480,y:420},payload:"secret < guess",handlePositions:{true:J.Right,false:J.Bottom}},{id:"8",role:Ne.Write,position:{x:720,y:420},payload:'"Secret is lower"',handlePositions:{out:J.Right}},{id:"9",role:Ne.Conditional,position:{x:480,y:500},payload:"secret != guess",handlePositions:{true:J.Left,false:J.Bottom}},{id:"10",role:Ne.Write,position:{x:480,y:580},payload:'"Congratulations! ", tries, " tries."',handlePositions:{out:J.Right}},{id:"11",role:Ne.End,position:{x:760,y:580},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"out",target:"3"},{source:"3",sourceHandle:"out",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"5",sourceHandle:"false",target:"7"},{source:"5",sourceHandle:"true",target:"6"},{source:"6",sourceHandle:"out",target:"9"},{source:"7",sourceHandle:"false",target:"9"},{source:"7",sourceHandle:"true",target:"8"},{source:"8",sourceHandle:"out",target:"9"},{source:"9",sourceHandle:"false",target:"10"},{source:"9",sourceHandle:"true",target:"3"},{source:"10",sourceHandle:"out",target:"11"}]},Vle={title:"sign",variables:[{id:"n",type:Yn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:300,y:140},payload:"",handlePositions:{out:J.Bottom}},{id:"1",role:Ne.Read,position:{x:300,y:220},payload:"n",handlePositions:{out:J.Bottom}},{id:"2",role:Ne.Conditional,position:{x:300,y:300},payload:"n > 0",handlePositions:{true:J.Bottom,false:J.Right}},{id:"3",role:Ne.Conditional,position:{x:520,y:300},payload:"n < 0",handlePositions:{true:J.Bottom,false:J.Right}},{id:"4",role:Ne.Write,position:{x:300,y:380},payload:'"Positive"',handlePositions:{out:J.Bottom}},{id:"5",role:Ne.Write,position:{x:520,y:380},payload:'"Negative"',handlePositions:{out:J.Bottom}},{id:"6",role:Ne.Write,position:{x:720,y:380},payload:'"Zero"',handlePositions:{out:J.Bottom}},{id:"7",role:Ne.End,position:{x:720,y:480},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"false",target:"3"},{source:"3",sourceHandle:"false",target:"6"},{source:"3",sourceHandle:"true",target:"5"},{source:"2",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"7"},{source:"5",sourceHandle:"out",target:"7"},{source:"6",sourceHandle:"out",target:"7"}]},Dk=[zle,Vle,Hle,jle];function Ule({showModal:e,setShowModal:t}){const{importSimpleFlowchart:n,setSavedViewport:r}=Gr(),{triggerToast:i}=Wr(),{getString:o}=sn(),{fitView:s,getViewport:a}=Fa(),u=c=>{const{variables:d,nodes:p,edges:h,title:m}=Dk[c],v=o(`ExampleTitle_${m}`);n({title:v,variables:d,nodes:p,edges:h}),setTimeout(()=>{s({minZoom:1,maxZoom:1}),r(a())},100),i({message:o("ToastMessage_ExampleLoaded"),icon:"bi-check-circle",background:"success"}),t(!1)};return S.jsxs(ct,{size:"lg",show:e,onHide:()=>t(!1),children:[S.jsx(ct.Header,{closeButton:!0,children:S.jsx(ct.Title,{children:o("ModalExamples_Title")})}),S.jsxs(ct.Body,{children:[S.jsx("p",{children:S.jsx(Eu,{source:o("ModalExamples_Body")})}),S.jsx("div",{className:"px-3",children:ce.map(Dk,({title:c},d)=>S.jsxs("p",{children:[S.jsx("b",{className:"text-primary",style:{cursor:"pointer"},onClick:()=>u(d),children:o(`ExampleTitle_${c}`)})," – ",S.jsx("i",{children:o(`ExampleDescription_${c}`)})]},d))})]}),S.jsx(ct.Footer,{children:S.jsx(Rn,{variant:"secondary",onClick:()=>t(!1),children:o("Button_Close")})})]})}const ta=A.forwardRef(({bsPrefix:e,className:t,striped:n,bordered:r,borderless:i,hover:o,size:s,variant:a,responsive:u,...c},d)=>{const p=Be(e,"table"),h=Te(t,p,a&&`${p}-${a}`,s&&`${p}-${s}`,n&&`${p}-${typeof n=="string"?`striped-${n}`:"striped"}`,r&&`${p}-bordered`,i&&`${p}-borderless`,o&&`${p}-hover`),m=S.jsx("table",{...c,className:h,ref:d});if(u){let v=`${p}-responsive`;return typeof u=="string"&&(v=`${v}-${u}`),S.jsx("div",{className:v,children:m})}return m});function Wle({showModal:e,setShowModal:t}){const{getString:n}=sn(),r="font-monospace col-3";return S.jsxs(ct,{size:"lg",show:e,onHide:()=>t(!1),children:[S.jsx(ct.Header,{closeButton:!0,children:S.jsx(ct.Title,{children:n("ModalHelp_Title")})}),S.jsxs(ct.Body,{style:{overflowY:"auto",maxHeight:"67vh"},children:[S.jsx("h5",{children:n("ModalHelp_SubtitleAssignment")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsx("tbody",{children:S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"var = expr"}),S.jsx("td",{children:n("ModalHelp_Assignment")})]})})}),S.jsx("h5",{children:n("ModalHelp_SubtitleArithmetic")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x + y"}),S.jsx("td",{children:n("ModalHelp_Addition")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x - y"}),S.jsx("td",{children:n("ModalHelp_Subtraction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x * y"}),S.jsx("td",{children:n("ModalHelp_Multiplication")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x / y"}),S.jsx("td",{children:n("ModalHelp_RealDivision")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a div b"}),S.jsx("td",{children:n("ModalHelp_IntegerDivision")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a mod b"}),S.jsx("td",{children:n("ModalHelp_Modulus")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"+x"}),S.jsx("td",{children:n("ModalHelp_Positive")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"-x"}),S.jsx("td",{children:n("ModalHelp_Negative")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleComparison")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x == y"}),S.jsx("td",{children:n("ModalHelp_Equal")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x != y"}),S.jsx("td",{children:n("ModalHelp_NotEqual")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x > y"}),S.jsx("td",{children:n("ModalHelp_Greater")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x >= y"}),S.jsx("td",{children:n("ModalHelp_GreaterOrEqual")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x < y"}),S.jsx("td",{children:n("ModalHelp_Less")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x <= y"}),S.jsx("td",{children:n("ModalHelp_LessOrEqual")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleLogical")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a || b"}),S.jsx("td",{children:n("ModalHelp_Disjunction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a && b"}),S.jsx("td",{children:n("ModalHelp_Conjunction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"!a"}),S.jsx("td",{children:n("ModalHelp_Negation")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleFunctions")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"pow(x, y)"}),S.jsx("td",{children:n("ModalHelp_Power")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sqrt(x)"}),S.jsx("td",{children:n("ModalHelp_SquareRoot")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log(x)"}),S.jsx("td",{children:n("ModalHelp_NaturalLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log10(x)"}),S.jsx("td",{children:n("ModalHelp_CommonLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log2(x)"}),S.jsx("td",{children:n("ModalHelp_BinaryLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"exp(x)"}),S.jsx("td",{children:n("ModalHelp_Exponential")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sin(x)"}),S.jsx("td",{children:n("ModalHelp_Sine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"cos(x)"}),S.jsx("td",{children:n("ModalHelp_Cosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tan(x)"}),S.jsx("td",{children:n("ModalHelp_Tangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"asin(x)"}),S.jsx("td",{children:n("ModalHelp_ArcSine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"acos(x)"}),S.jsx("td",{children:n("ModalHelp_ArcCosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"atan(x)"}),S.jsx("td",{children:n("ModalHelp_ArcTangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sinh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicSine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"cosh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicCosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tanh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicTangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"asinh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcSineHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"acosh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcCosineHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"atanh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcTangentHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sign(x)"}),S.jsx("td",{children:n("ModalHelp_Sign")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"abs(x)"}),S.jsx("td",{children:n("ModalHelp_AbsoluteValue")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"round(x)"}),S.jsx("td",{children:n("ModalHelp_Round")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"floor(x)"}),S.jsx("td",{children:n("ModalHelp_Floor")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"ceil(x)"}),S.jsx("td",{children:n("ModalHelp_Ceil")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"min(x, y)"}),S.jsx("td",{children:n("ModalHelp_Minimum")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"max(x, y)"}),S.jsx("td",{children:n("ModalHelp_Maximum")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"rand()"}),S.jsx("td",{children:n("ModalHelp_Rand")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"rand_int(a, b)"}),S.jsx("td",{children:n("ModalHelp_RandInt")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleConstants")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"pi"}),S.jsx("td",{children:"π ≅ 3.141592653589793"})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tau"}),S.jsx("td",{children:"τ = 2π ≅ 6.283185307179586"})]})]})})]}),S.jsx(ct.Footer,{children:S.jsx(Rn,{variant:"secondary",onClick:()=>t(!1),children:n("Button_Close")})})]})}function Gle(){const{getString:e}=sn(),[t,n]=A.useState(!1),[r,i]=A.useState(!1),[o,s]=A.useState(!1);return S.jsxs(S.Fragment,{children:[S.jsxs(Un,{align:"end",children:[S.jsx(Lu,{text:e("MenuHelp_Tooltip"),children:S.jsx(Un.Toggle,{children:S.jsx("i",{className:"bi bi-question-circle"})})}),S.jsxs(Un.Menu,{children:[S.jsx(Un.Item,{onClick:()=>n(!0),children:e("MenuHelp_Help")}),S.jsx(Un.Item,{onClick:()=>i(!0),children:e("MenuHelp_Examples")}),S.jsx(Un.Item,{onClick:()=>s(!0),children:e("MenuHelp_About")})]})]}),S.jsx(Wle,{showModal:t,setShowModal:n}),S.jsx(Ble,{showModal:o,setShowModal:s}),S.jsx(Ule,{showModal:r,setShowModal:i})]})}function Kle(){const{getString:e,language:t,setLanguage:n}=sn(),{triggerToast:r}=Wr(),i={en:"English","pt-BR":"Português (BR)"},o=s=>{n(s),r({message:e("ToastMessage_LanguageChanged",{language:i[s]}),icon:"bi-check2-circle",background:"success"})};return S.jsxs(Un,{align:"end",children:[S.jsx(Lu,{text:e("MenuLanguage_Tooltip"),children:S.jsx(Un.Toggle,{children:S.jsx("i",{className:"bi bi-globe"})})}),S.jsx(Un.Menu,{children:ce.map(i,(s,a)=>S.jsxs(Un.Item,{onClick:()=>o(a),children:[a===t?S.jsx("i",{className:"bi bi-check2"}):null," ",s]},a))})]})}function qle(){const[e,t]=A.useState(!1),{flowchart:n,setTitle:r}=Gr(),{getString:i}=sn(),o=c=>{c.target.select(),t(!0)},s=()=>{t(!1)},a=c=>{r(c.target.value)},u=c=>{(c.key==="Enter"||c.key==="Escape")&&(t(!1),c.currentTarget.blur())};return S.jsx("input",{type:"text",className:"form-control bg-dark text-white fs-4",placeholder:i("FlowchartTitle_Placeholder"),value:n.title,onFocus:o,onBlur:s,onChange:a,onKeyDown:u,style:{borderColor:e?"white":"black"}})}function Yle(){return S.jsx(r$,{variant:"dark",bg:"dark",expand:"lg",children:S.jsxs($a,{direction:"horizontal",gap:3,className:"flex-fill mx-3",children:[S.jsx(ele,{}),S.jsx(qle,{}),S.jsx(Fle,{}),S.jsx(Kle,{}),S.jsx(Gle,{})]})})}function Xle({role:e}){const{getString:t}=sn(),[n,r]=A.useState(!1),i=wP(e);function o(s){s.dataTransfer.setData("application/text",e),s.dataTransfer.effectAllowed="move"}return S.jsx("div",{className:"text-center fw-bold small",draggable:!0,onDragStart:o,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{cursor:"grab",lineHeight:"40px",width:120,color:i.textColor,background:n?ii.darker(i.backgroundColor):i.backgroundColor,borderRadius:i.borderRadius,clipPath:i.clipPath},children:S.jsx("span",{children:t(`BlockTitle_${e}`)})})}function Qle(){return S.jsx("div",{className:"vstack gap-3",children:ce.map(Ne,e=>S.jsx(Xle,{role:e},e))})}const Lk={common:"d-flex",in:"align-self-end",out:"align-self-start"},Zle={in:{transform:"translateX(8px)"},out:{transform:"translateX(-8px)"}},Pk={common:"badge font-monospace fw-normal p-2",in:"text-bg-primary",out:"text-bg-success"},Mk={common:{whiteSpace:"normal",wordBreak:"break-word"},in:{textAlign:"right"},out:{textAlign:"left"}},Xp={common:{width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent"},in:{borderTop:`8px solid ${Tt.blue}`,transform:"translateY(16px) translateX(-8px) rotate(45deg)"},out:{borderTop:`8px solid ${Tt.green}`,transform:"translateY(16px) translateX(8px) rotate(-45deg)"}};function Jle({direction:e,text:t}){return S.jsxs("div",{className:`${Lk.common} ${Lk[e]}`,style:Zle[e],children:[e==="out"&&S.jsx("div",{style:{...Xp.common,...Xp.out}}),S.jsx("span",{className:`${Pk.common} ${Pk[e]}`,style:{...Mk.common,...Mk[e]},children:t}),e==="in"&&S.jsx("div",{style:{...Xp.common,...Xp.in}})]})}function eue(){const e=A.useRef(null),t=A.useRef(null),[n,r]=A.useState(""),{setRefInput:i}=Wr(),{machineState:o,executeAction:s}=Ms(),{getString:a}=sn();A.useEffect(()=>{i(e)},[e]);const u=()=>{n.length>0&&(o.input=n,s("nextStep"),r(""))};return A.useEffect(()=>{var c;o.status==="waiting"&&((c=e.current)==null||c.focus())},[o.status]),A.useEffect(()=>{t.current!=null&&t.current.scrollIntoView({behavior:"smooth"})},[o.status,o.interaction]),S.jsxs("div",{className:"d-flex flex-column h-100",children:[S.jsx("p",{className:"fw-semibold",children:a("Interaction_Title")}),S.jsxs($a,{gap:2,className:"mb-3",style:{overflowY:"auto",overflowX:"clip"},children:[ce.map(o.interaction,({direction:c,text:d},p)=>S.jsx(Jle,{direction:c,text:d},p)),S.jsx("div",{ref:t})]}),S.jsx(wa.Control,{ref:e,size:"sm",value:n,disabled:o.status!=="waiting",onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&u()}})]})}function jn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var tue=typeof Symbol=="function"&&Symbol.observable||"@@observable",$k=tue,H0=()=>Math.random().toString(36).substring(7).split("").join("."),nue={INIT:`@@redux/INIT${H0()}`,REPLACE:`@@redux/REPLACE${H0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${H0()}`},Fk=nue;function rue(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function S$(e,t,n){if(typeof e!="function")throw new Error(jn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(jn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(jn(1));return n(S$)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,u=!1;function c(){s===o&&(s=new Map,o.forEach((b,y)=>{s.set(y,b)}))}function d(){if(u)throw new Error(jn(3));return i}function p(b){if(typeof b!="function")throw new Error(jn(4));if(u)throw new Error(jn(5));let y=!0;c();const _=a++;return s.set(_,b),function(){if(y){if(u)throw new Error(jn(6));y=!1,c(),s.delete(_),o=null}}}function h(b){if(!rue(b))throw new Error(jn(7));if(typeof b.type>"u")throw new Error(jn(8));if(typeof b.type!="string")throw new Error(jn(17));if(u)throw new Error(jn(9));try{u=!0,i=r(i,b)}finally{u=!1}return(o=s).forEach(_=>{_()}),b}function m(b){if(typeof b!="function")throw new Error(jn(10));r=b,h({type:Fk.REPLACE})}function v(){const b=p;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(jn(11));function _(){const C=y;C.next&&C.next(d())}return _(),{unsubscribe:b(_)}},[$k](){return this}}}return h({type:Fk.INIT}),{dispatch:h,subscribe:p,getState:d,replaceReducer:m,[$k]:v}}function Bk(e,t){return function(...n){return t(e.apply(this,n))}}function Hk(e,t){if(typeof e=="function")return Bk(e,t);if(typeof e!="object"||e===null)throw new Error(jn(16));const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=Bk(i,t))}return n}function C$(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function iue(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(jn(15))};const s={getState:i.getState,dispatch:(u,...c)=>o(u,...c)},a=e.map(u=>u(s));return o=C$(...a)(i.dispatch),{...i,dispatch:o}}}var oue={};/** - * @license React - * use-sync-external-store-with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gd=A;function sue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aue=typeof Object.is=="function"?Object.is:sue,lue=gd.useSyncExternalStore,uue=gd.useRef,cue=gd.useEffect,fue=gd.useMemo,due=gd.useDebugValue;oue.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=uue(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=fue(function(){function u(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return p=v}return p=m}if(v=p,aue(d,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(d=m,p=x)}var c=!1,d,p,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var a=lue(e,o[0],o[1]);return cue(function(){s.hasValue=!0,s.value=a},[a]),due(a),a};var ut="default"in Sh?Q:Sh,zk=Symbol.for("react-redux-context"),jk=typeof globalThis<"u"?globalThis:{};function pue(){if(!ut.createContext)return{};const e=jk[zk]??(jk[zk]=new Map);let t=e.get(ut.createContext);return t||(t=ut.createContext(null),e.set(ut.createContext,t)),t}var I$=pue(),hue=()=>{throw new Error("uSES not initialized!")},mue=Symbol.for("react.element"),gue=Symbol.for("react.portal"),yue=Symbol.for("react.fragment"),vue=Symbol.for("react.strict_mode"),xue=Symbol.for("react.profiler"),_ue=Symbol.for("react.provider"),wue=Symbol.for("react.context"),bue=Symbol.for("react.server_context"),A$=Symbol.for("react.forward_ref"),Eue=Symbol.for("react.suspense"),Sue=Symbol.for("react.suspense_list"),Eb=Symbol.for("react.memo"),Cue=Symbol.for("react.lazy"),Iue=A$,Aue=Eb;function Tue(e){if(typeof e=="object"&&e!==null){const t=e.$$typeof;switch(t){case mue:{const n=e.type;switch(n){case yue:case xue:case vue:case Eue:case Sue:return n;default:{const r=n&&n.$$typeof;switch(r){case bue:case wue:case A$:case Cue:case Eb:case _ue:return r;default:return t}}}}case gue:return t}}}function kue(e){return Tue(e)===Eb}function Nue(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:o,areStatePropsEqual:s}){let a=!1,u,c,d,p,h;function m(_,E){return u=_,c=E,d=e(u,c),p=t(r,c),h=n(d,p,c),a=!0,h}function v(){return d=e(u,c),t.dependsOnOwnProps&&(p=t(r,c)),h=n(d,p,c),h}function x(){return e.dependsOnOwnProps&&(d=e(u,c)),t.dependsOnOwnProps&&(p=t(r,c)),h=n(d,p,c),h}function b(){const _=e(u,c),E=!s(_,d);return d=_,E&&(h=n(d,p,c)),h}function y(_,E){const C=!o(E,c),T=!i(_,u,E,c);return u=_,c=E,C&&T?v():C?x():T?b():h}return function(E,C){return a?y(E,C):m(E,C)}}function Oue(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){const o=t(e,i),s=n(e,i),a=r(e,i);return Nue(o,s,a,e,i)}function Rue(e,t){const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=(...o)=>t(i(...o)))}return n}function B_(e){return function(n){const r=e(n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function Vk(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function T$(e,t){return function(r,{displayName:i}){const o=function(a,u){return o.dependsOnOwnProps?o.mapToProps(a,u):o.mapToProps(a,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(a,u){o.mapToProps=e,o.dependsOnOwnProps=Vk(e);let c=o(a,u);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=Vk(c),c=o(a,u)),c},o}}function Sb(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Due(e){return e&&typeof e=="object"?B_(t=>Rue(e,t)):e?typeof e=="function"?T$(e):Sb(e,"mapDispatchToProps"):B_(t=>({dispatch:t}))}function Lue(e){return e?typeof e=="function"?T$(e):Sb(e,"mapStateToProps"):B_(()=>({}))}function Pue(e,t,n){return{...n,...e,...t}}function Mue(e){return function(n,{displayName:r,areMergedPropsEqual:i}){let o=!1,s;return function(u,c,d){const p=e(u,c,d);return o?i(p,s)||(s=p):(o=!0,s=p),s}}}function $ue(e){return e?typeof e=="function"?Mue(e):Sb(e,"mergeProps"):()=>Pue}function Fue(e){e()}function Bue(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Fue(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Uk={notify(){},get:()=>[]};function k$(e,t){let n,r=Uk,i=0,o=!1;function s(x){d();const b=r.subscribe(x);let y=!1;return()=>{y||(y=!0,b(),p())}}function a(){r.notify()}function u(){v.onStateChange&&v.onStateChange()}function c(){return o}function d(){i++,n||(n=t?t.addNestedSub(u):e.subscribe(u),r=Bue())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Uk)}function h(){o||(o=!0,d())}function m(){o&&(o=!1,p())}const v={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:u,isSubscribed:c,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>r};return v}var Hue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zue=typeof navigator<"u"&&navigator.product==="ReactNative",Sm=Hue||zue?ut.useLayoutEffect:ut.useEffect;function Wk(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function z0(e,t){if(Wk(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i{O$=e},Que=[null,null];function Zue(e,t,n){Sm(()=>e(...t),n)}function Jue(e,t,n,r,i,o){e.current=r,n.current=!1,i.current&&(i.current=null,o())}function ece(e,t,n,r,i,o,s,a,u,c,d){if(!e)return()=>{};let p=!1,h=null;const m=()=>{if(p||!a.current)return;const x=t.getState();let b,y;try{b=r(x,i.current)}catch(_){y=_,h=_}y||(h=null),b===o.current?s.current||c():(o.current=b,u.current=b,s.current=!0,d())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(p=!0,n.tryUnsubscribe(),n.onStateChange=null,h)throw h}}function tce(e,t){return e===t}function nce(e,t,n,{pure:r,areStatesEqual:i=tce,areOwnPropsEqual:o=z0,areStatePropsEqual:s=z0,areMergedPropsEqual:a=z0,forwardRef:u=!1,context:c=I$}={}){const d=c,p=Lue(e),h=Due(t),m=$ue(n),v=!!e;return b=>{const y=b.displayName||b.name||"Component",_=`Connect(${y})`,E={shouldHandleStateChanges:v,displayName:_,wrappedComponentName:y,WrappedComponent:b,initMapStateToProps:p,initMapDispatchToProps:h,initMergeProps:m,areStatesEqual:i,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:a};function C(O){const[M,z,U]=ut.useMemo(()=>{const{reactReduxForwardedRef:Re,...De}=O;return[O.context,Re,De]},[O]),F=ut.useMemo(()=>{let Re=d;return M!=null&&M.Consumer,Re},[M,d]),W=ut.useContext(F),Y=!!O.store&&!!O.store.getState&&!!O.store.dispatch,L=!!W&&!!W.store,B=Y?O.store:W.store,j=L?W.getServerState:B.getState,X=ut.useMemo(()=>Oue(B.dispatch,E),[B]),[V,H]=ut.useMemo(()=>{if(!v)return Que;const Re=k$(B,Y?void 0:W.subscription),De=Re.notifyNestedSubs.bind(Re);return[Re,De]},[B,Y,W]),N=ut.useMemo(()=>Y?W:{...W,subscription:V},[Y,W,V]),Z=ut.useRef(void 0),te=ut.useRef(U),R=ut.useRef(void 0),ee=ut.useRef(!1),re=ut.useRef(!1),oe=ut.useRef(void 0);Sm(()=>(re.current=!0,()=>{re.current=!1}),[]);const pe=ut.useMemo(()=>()=>R.current&&U===te.current?R.current:X(B.getState(),U),[B,U]),ye=ut.useMemo(()=>De=>V?ece(v,B,V,X,te,Z,ee,re,R,H,De):()=>{},[V]);Zue(Jue,[te,Z,ee,U,R,H]);let _e;try{_e=O$(ye,pe,j?()=>X(j(),U):pe)}catch(Re){throw oe.current&&(Re.message+=` -The error may be correlated with this previous error: -${oe.current.stack} - -`),Re}Sm(()=>{oe.current=void 0,R.current=void 0,Z.current=_e});const Se=ut.useMemo(()=>ut.createElement(b,{..._e,ref:z}),[z,b,_e]);return ut.useMemo(()=>v?ut.createElement(F.Provider,{value:N},Se):Se,[F,Se,N])}const I=ut.memo(C);if(I.WrappedComponent=b,I.displayName=C.displayName=_,u){const M=ut.forwardRef(function(U,F){return ut.createElement(I,{...U,reactReduxForwardedRef:F})});return M.displayName=_,M.WrappedComponent=b,H_(M,b)}return H_(I,b)}}var R$=nce;function rce({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",identityFunctionCheck:o="once"}){const s=ut.useMemo(()=>{const c=k$(e);return{store:e,subscription:c,getServerState:r?()=>r:void 0,stabilityCheck:i,identityFunctionCheck:o}},[e,r,i,o]),a=ut.useMemo(()=>e.getState(),[e]);Sm(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,a]);const u=t||I$;return ut.createElement(u.Provider,{value:s},n)}var ice=rce;Xue(A.useSyncExternalStore);function oce(e,t){if(e.length!==t.length)return!1;for(var n=0;n{const o=pce(n,i.options);return e.addEventListener(i.eventName,i.fn,o),function(){e.removeEventListener(i.eventName,i.fn,o)}});return function(){r.forEach(o=>{o()})}}const hce="Invariant failed";class Am extends Error{}Am.prototype.toString=function(){return this.message};function ve(e,t){throw new Am(hce)}class mce extends Q.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=ws,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Am&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in ");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=ui(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Am){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const gce=` - Press space bar to start a drag. - When dragging you can use the arrow keys to move the item around and escape to cancel. - Some screen readers may require you to be in focus mode or to use your pass through key -`,Tm=e=>e+1,yce=e=>` - You have lifted an item in position ${Tm(e.source.index)} -`,$$=(e,t)=>{const n=e.droppableId===t.droppableId,r=Tm(e.index),i=Tm(t.index);return n?` - You have moved the item from position ${r} - to position ${i} - `:` - You have moved the item from position ${r} - in list ${e.droppableId} - to list ${t.droppableId} - in position ${i} - `},F$=(e,t,n)=>t.droppableId===n.droppableId?` - The item ${e} - has been combined with ${n.draggableId}`:` - The item ${e} - in list ${t.droppableId} - has been combined with ${n.draggableId} - in list ${n.droppableId} - `,vce=e=>{const t=e.destination;if(t)return $$(e.source,t);const n=e.combine;return n?F$(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Qk=e=>` - The item has returned to its starting position - of ${Tm(e.index)} -`,xce=e=>{if(e.reason==="CANCEL")return` - Movement cancelled. - ${Qk(e.source)} - `;const t=e.destination,n=e.combine;return t?` - You have dropped the item. - ${$$(e.source,t)} - `:n?` - You have dropped the item. - ${F$(e.draggableId,e.source,n)} - `:` - The item has been dropped while not over a drop area. - ${Qk(e.source)} - `},Eh={dragHandleUsageInstructions:gce,onDragStart:yce,onDragUpdate:vce,onDragEnd:xce},pn={x:0,y:0},xn=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Lr=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),bs=(e,t)=>e.x===t.x&&e.y===t.y,Hu=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),La=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},jf=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Zk=(e,t)=>Math.min(...t.map(n=>jf(e,n))),B$=e=>t=>({x:e(t.x),y:e(t.y)});var _ce=(e,t)=>{const n=Ni({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const yd=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Jk=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],wce={top:0,right:0,bottom:0,left:0},bce=(e,t)=>t?yd(e,t.scroll.diff.displacement):e,Ece=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Sce=(e,t)=>t&&t.shouldClipSubject?_ce(t.pageMarginBox,e):Ni(e);var Su=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=bce(e.marginBox,r),o=Ece(i,n,t),s=Sce(o,r);return{page:e,withPlaceholder:t,active:s}},Ab=(e,t)=>{e.frame||ve();const n=e.frame,r=Lr(t,n.scroll.initial),i=Hu(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},s=Su({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:s}};const H$=fn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),z$=fn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Tg=fn(e=>Object.values(e)),Cce=fn(e=>Object.values(e));var zu=fn((e,t)=>Cce(t).filter(r=>e===r.descriptor.droppableId).sort((r,i)=>r.descriptor.index-i.descriptor.index));function Tb(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function kg(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Ng=fn((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Ice=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled||!Tb(i))return null;function s(m){const v={type:"COMBINE",combine:{draggableId:m,droppableId:n.descriptor.id}};return{...i,at:v}}const a=i.displaced.all,u=a.length?a[0]:null;if(e)return u?s(u):null;const c=Ng(t,r);if(!u){if(!c.length)return null;const m=c[c.length-1];return s(m.descriptor.id)}const d=c.findIndex(m=>m.descriptor.id===u);d===-1&&ve();const p=d-1;if(p<0)return null;const h=c[p];return s(h.descriptor.id)},ju=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const j$={point:pn,value:0},Vf={invisible:{},visible:{},all:[]},Ace={displaced:Vf,displacedBy:j$,at:null};var di=(e,t)=>n=>e<=n&&n<=t,V$=e=>{const t=di(e.top,e.bottom),n=di(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(o&&s)return!0;const u=r.tope.bottom,c=r.lefte.right;return u&&c?!0:u&&s||c&&o}},Tce=e=>{const t=di(e.top,e.bottom),n=di(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const kb={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},U$={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var kce=e=>t=>{const n=di(t.top,t.bottom),r=di(t.left,t.right);return i=>e===kb?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)};const Nce=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:pn;return yd(e,n)},Oce=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,Rce=(e,t,n)=>n(t)(e),Nb=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?Nce(e,t):e;return Oce(o,t,i)&&Rce(o,n,i)},Dce=e=>Nb({...e,isVisibleThroughFrameFn:V$}),W$=e=>Nb({...e,isVisibleThroughFrameFn:Tce}),Lce=e=>Nb({...e,isVisibleThroughFrameFn:kce(e.destination.axis)}),Pce=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return o?o.shouldAnimate:!0};function Mce(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Ni(Cb(n,r))}function Uf({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,last:o}){return e.reduce(function(a,u){const c=Mce(u,n),d=u.descriptor.id;if(a.all.push(d),!Dce({target:c,destination:t,viewport:r,withDroppableDisplacement:!0}))return a.invisible[u.descriptor.id]=!0,a;const h=Pce(d,o,i),m={draggableId:d,shouldAnimate:h};return a.visible[d]=m,a},{all:[],visible:{},invisible:{}})}function $ce(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function eN({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const i=$ce(e,{inHomeList:t});return{displaced:Vf,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:i}}}}function km({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:i,last:o,index:s,forceShouldAnimate:a}){const u=ju(e,n);if(s==null)return eN({insideDestination:t,inHomeList:u,displacedBy:i,destination:n});const c=t.find(v=>v.descriptor.index===s);if(!c)return eN({insideDestination:t,inHomeList:u,displacedBy:i,destination:n});const d=Ng(e,t),p=t.indexOf(c),h=d.slice(p);return{displaced:Uf({afterDragging:h,destination:n,displacedBy:i,last:o,viewport:r.frame,forceShouldAnimate:a}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function As(e,t){return!!t.effected[e]}var Fce=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:i})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,a=n[o].descriptor.index;return As(o,i)?e?a:a-1:e?a+1:a},Bce=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const i=r.index,o=e?i+1:i-1,s=n[0].descriptor.index,a=n[n.length-1].descriptor.index,u=t?a:a+1;return ou?null:o},Hce=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:i,insideDestination:o,previousImpact:s,viewport:a,afterCritical:u})=>{const c=s.at;if(c||ve(),c.type==="REORDER"){const p=Bce({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:o});return p==null?null:km({draggable:n,insideDestination:o,destination:i,viewport:a,last:s.displaced,displacedBy:s.displacedBy,index:p})}const d=Fce({isMovingForward:e,destination:i,displaced:s.displaced,draggables:r,combine:c.combine,afterCritical:u});return d==null?null:km({draggable:n,insideDestination:o,destination:i,viewport:a,last:s.displaced,displacedBy:s.displacedBy,index:d})},zce=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const i=!!(e.visible[n]||e.invisible[n]);return As(n,t)?i?pn:Hu(r.point):i?r.point:pn},jce=({afterCritical:e,impact:t,draggables:n})=>{const r=kg(t);r||ve();const i=r.draggableId,o=n[i].page.borderBox.center,s=zce({displaced:t.displaced,afterCritical:e,combineWith:i,displacedBy:t.displacedBy});return xn(o,s)};const G$=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Vce=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,Ob=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,tN=({axis:e,moveRelativeTo:t,isMoving:n})=>La(e.line,t.marginBox[e.end]+G$(e,n),Ob(e,t.marginBox,n)),nN=({axis:e,moveRelativeTo:t,isMoving:n})=>La(e.line,t.marginBox[e.start]-Vce(e,n),Ob(e,t.marginBox,n)),Uce=({axis:e,moveInto:t,isMoving:n})=>La(e.line,t.contentBox[e.start]+G$(e,n),Ob(e,t.contentBox,n));var Wce=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:i})=>{const o=zu(r.descriptor.id,n),s=t.page,a=r.axis;if(!o.length)return Uce({axis:a,moveInto:r.page,isMoving:s});const{displaced:u,displacedBy:c}=e,d=u.all[0];if(d){const h=n[d];if(As(d,i))return nN({axis:a,moveRelativeTo:h.page,isMoving:s});const m=Cm(h.page,c.point);return nN({axis:a,moveRelativeTo:m,isMoving:s})}const p=o[o.length-1];if(p.descriptor.id===t.descriptor.id)return s.borderBox.center;if(As(p.descriptor.id,i)){const h=Cm(p.page,Hu(i.displacedBy.point));return tN({axis:a,moveRelativeTo:h,isMoving:s})}return tN({axis:a,moveRelativeTo:p.page,isMoving:s})},z_=(e,t)=>{const n=e.frame;return n?xn(t,n.scroll.diff.displacement):t};const Gce=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:i})=>{const o=t.page.borderBox.center,s=e.at;return!n||!s?o:s.type==="REORDER"?Wce({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i}):jce({impact:e,draggables:r,afterCritical:i})};var Og=e=>{const t=Gce(e),n=e.droppable;return n?z_(n,t):t},K$=(e,t)=>{const n=Lr(t,e.scroll.initial),r=Hu(n);return{frame:Ni({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function rN(e,t){return e.map(n=>t[n])}function Kce(e,t){for(let n=0;n{const o=K$(t,xn(t.scroll.current,i)),s=n.frame?Ab(n,xn(n.frame.scroll.current,i)):n,a=e.displaced,u=Uf({afterDragging:rN(a.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:a,forceShouldAnimate:!1}),c=Uf({afterDragging:rN(a.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:a,forceShouldAnimate:!1}),d={},p={},h=[a,u,c];return a.all.forEach(v=>{const x=Kce(v,h);if(x){p[v]=x;return}d[v]=!0}),{...e,displaced:{all:a.all,invisible:d,visible:p}}},Yce=(e,t)=>xn(e.scroll.diff.displacement,t),Rb=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Yce(n,e),i=Lr(r,t.page.borderBox.center);return xn(t.client.borderBox.center,i)},q$=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:i,onlyOnMainAxis:o=!1})=>{const s=Lr(n,e.page.borderBox.center),u={target:yd(e.page.borderBox,s),destination:t,withDroppableDisplacement:i,viewport:r};return o?Lce(u):W$(u)},Xce=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:i,viewport:o,previousPageBorderBoxCenter:s,previousClientSelection:a,afterCritical:u})=>{if(!n.isEnabled)return null;const c=zu(n.descriptor.id,r),d=ju(t,n),p=Ice({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:i})||Hce({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:i,viewport:o,afterCritical:u});if(!p)return null;const h=Og({impact:p,draggable:t,droppable:n,draggables:r,afterCritical:u});if(q$({draggable:t,destination:n,newPageBorderBoxCenter:h,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Rb({pageBorderBoxCenter:h,draggable:t,viewport:o}),impact:p,scrollJumpRequest:null};const v=Lr(h,s),x=qce({impact:p,viewport:o,destination:n,draggables:r,maxScrollChange:v});return{clientSelection:a,impact:x,scrollJumpRequest:v}};const zn=e=>{const t=e.subject.active;return t||ve(),t};var Qce=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:i})=>{const o=n.subject.active;if(!o)return null;const s=n.axis,a=di(o[s.start],o[s.end]),u=Tg(r).filter(d=>d!==n).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>V$(i.frame)(zn(d))).filter(d=>{const p=zn(d);return e?o[s.crossAxisEnd]{const p=zn(d),h=di(p[s.start],p[s.end]);return a(p[s.start])||a(p[s.end])||h(o[s.start])||h(o[s.end])}).sort((d,p)=>{const h=zn(d)[s.crossAxisStart],m=zn(p)[s.crossAxisStart];return e?h-m:m-h}).filter((d,p,h)=>zn(d)[s.crossAxisStart]===zn(h[0])[s.crossAxisStart]);if(!u.length)return null;if(u.length===1)return u[0];const c=u.filter(d=>di(zn(d)[s.start],zn(d)[s.end])(t[s.line]));return c.length===1?c[0]:c.length>1?c.sort((d,p)=>zn(d)[s.start]-zn(p)[s.start])[0]:u.sort((d,p)=>{const h=Zk(t,Jk(zn(d))),m=Zk(t,Jk(zn(p)));return h!==m?h-m:zn(d)[s.start]-zn(p)[s.start]})[0]};const iN=(e,t)=>{const n=e.page.borderBox.center;return As(e.descriptor.id,t)?Lr(n,t.displacedBy.point):n},Zce=(e,t)=>{const n=e.page.borderBox;return As(e.descriptor.id,t)?yd(n,Hu(t.displacedBy.point)):n};var Jce=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:i})=>r.filter(s=>W$({target:Zce(s,i),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,a)=>{const u=jf(e,z_(n,iN(s,i))),c=jf(e,z_(n,iN(a,i)));return u{const r=e.axis;if(e.descriptor.mode==="virtual")return La(r.line,t[r.line]);const i=e.subject.page.contentBox[r.size],u=zu(e.descriptor.id,n).reduce((c,d)=>c+d.client.marginBox[r.size],0)+t[r.line]-i;return u<=0?null:La(r.line,u)},Y$=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),X$=(e,t,n)=>{const r=e.frame;ju(t,e)&&ve(),e.subject.withPlaceholder&&ve();const i=vd(e.axis,t.displaceBy).point,o=efe(e,i,n),s={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const d=Su({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:d}}const a=o?xn(r.scroll.max,o):r.scroll.max,u=Y$(r,a),c=Su({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:u});return{...e,subject:c,frame:u}},tfe=e=>{const t=e.subject.withPlaceholder;t||ve();const n=e.frame;if(!n){const s=Su({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||ve();const i=Y$(n,r),o=Su({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return{...e,subject:o,frame:i}};var nfe=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:i,destination:o,viewport:s,afterCritical:a})=>{if(!t){if(n.length)return null;const p={displaced:Vf,displacedBy:j$,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},h=Og({impact:p,draggable:r,droppable:o,draggables:i,afterCritical:a}),m=ju(r,o)?o:X$(o,r,i);return q$({draggable:r,destination:m,newPageBorderBoxCenter:h,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?p:null}const u=e[o.axis.line]<=t.page.borderBox.center[o.axis.line],c=(()=>{const p=t.descriptor.index;return t.descriptor.id===r.descriptor.id||u?p:p+1})(),d=vd(o.axis,r.displaceBy);return km({draggable:r,insideDestination:n,destination:o,viewport:s,displacedBy:d,last:Vf,index:c})},rfe=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:i,droppables:o,viewport:s,afterCritical:a})=>{const u=Qce({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:s});if(!u)return null;const c=zu(u.descriptor.id,i),d=Jce({pageBorderBoxCenter:t,viewport:s,destination:u,insideDestination:c,afterCritical:a}),p=nfe({previousPageBorderBoxCenter:t,destination:u,draggable:n,draggables:i,moveRelativeTo:d,insideDestination:c,viewport:s,afterCritical:a});if(!p)return null;const h=Og({impact:p,draggable:n,droppable:u,draggables:i,afterCritical:a});return{clientSelection:Rb({pageBorderBoxCenter:h,draggable:n,viewport:s}),impact:p,scrollJumpRequest:null}},Mr=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const ife=(e,t)=>{const n=Mr(e);return n?t[n]:null};var ofe=({state:e,type:t})=>{const n=ife(e.impact,e.dimensions.droppables),r=!!n,i=e.dimensions.droppables[e.critical.droppable.id],o=n||i,s=o.axis.direction,a=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(a&&!r)return null;const u=t==="MOVE_DOWN"||t==="MOVE_RIGHT",c=e.dimensions.draggables[e.critical.draggable.id],d=e.current.page.borderBoxCenter,{draggables:p,droppables:h}=e.dimensions;return a?Xce({isMovingForward:u,previousPageBorderBoxCenter:d,draggable:c,destination:o,draggables:p,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):rfe({isMovingForward:u,previousPageBorderBoxCenter:d,draggable:c,isOver:o,draggables:p,droppables:h,viewport:e.viewport,afterCritical:e.afterCritical})};function na(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Q$(e){const t=di(e.top,e.bottom),n=di(e.left,e.right);return function(i){return t(i.y)&&n(i.x)}}function sfe(e,t){return e.leftt.left&&e.topt.top}function afe({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,i=n.map(o=>{const s=o.axis,a=La(o.axis.line,e.center[s.line],o.page.borderBox.center[s.crossAxisLine]);return{id:o.descriptor.id,distance:jf(r,a)}}).sort((o,s)=>s.distance-o.distance);return i[0]?i[0].id:null}function lfe({pageBorderBox:e,draggable:t,droppables:n}){const r=Tg(n).filter(i=>{if(!i.isEnabled)return!1;const o=i.subject.active;if(!o||!sfe(e,o))return!1;if(Q$(o)(e.center))return!0;const s=i.axis,a=o.center[s.crossAxisLine],u=e[s.crossAxisStart],c=e[s.crossAxisEnd],d=di(o[s.crossAxisStart],o[s.crossAxisEnd]),p=d(u),h=d(c);return!p&&!h?!0:p?ua});return r.length?r.length===1?r[0].descriptor.id:afe({pageBorderBox:e,draggable:t,candidates:r}):null}const Z$=(e,t)=>Ni(yd(e,t));var ufe=(e,t)=>{const n=e.frame;return n?Z$(t,n.scroll.diff.value):t};function J$({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function cfe({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var ffe=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:i,viewport:o,afterCritical:s})=>{const a=n.axis,u=vd(n.axis,t.displaceBy),c=u.value,d=e[a.start],p=e[a.end],m=Ng(t,r).find(x=>{const b=x.descriptor.id,y=x.page.borderBox.center[a.line],_=As(b,s),E=J$({displaced:i,id:b});return _?E?p<=y:d{if(!r.isCombineEnabled)return null;const s=r.axis,a=vd(r.axis,e.displaceBy),u=a.value,c=t[s.start],d=t[s.end],h=Ng(e,i).find(v=>{const x=v.descriptor.id,b=v.page.borderBox,_=b[s.size]/dfe,E=As(x,o),C=J$({displaced:n.displaced,id:x});return E?C?d>b[s.start]+_&&db[s.start]-u+_&&cb[s.start]+u+_&&db[s.start]+_&&c{const a=Z$(t.page.borderBox,e),u=lfe({pageBorderBox:a,draggable:t,droppables:r});if(!u)return Ace;const c=r[u],d=zu(c.descriptor.id,n),p=ufe(c,a);return pfe({pageBorderBoxWithDroppableScroll:p,draggable:t,previousImpact:i,destination:c,insideDestination:d,afterCritical:s})||ffe({pageBorderBoxWithDroppableScroll:p,draggable:t,destination:c,insideDestination:d,last:i.displaced,viewport:o,afterCritical:s})},Db=(e,t)=>({...e,[t.descriptor.id]:t});const hfe=({previousImpact:e,impact:t,droppables:n})=>{const r=Mr(e),i=Mr(t);if(!r||r===i)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const s=tfe(o);return Db(n,s)};var mfe=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:i})=>{const o=hfe({previousImpact:r,impact:i,droppables:n}),s=Mr(i);if(!s)return o;const a=n[s];if(ju(e,a)||a.subject.withPlaceholder)return o;const u=X$(a,e,t);return Db(o,u)},uf=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:i,scrollJumpRequest:o})=>{const s=r||e.viewport,a=n||e.dimensions,u=t||e.current.client.selection,c=Lr(u,e.initial.client.selection),d={offset:c,selection:u,borderBoxCenter:xn(e.initial.client.borderBoxCenter,c)},p={selection:xn(d.selection,s.scroll.current),borderBoxCenter:xn(d.borderBoxCenter,s.scroll.current),offset:xn(d.offset,s.scroll.diff.value)},h={client:d,page:p};if(e.phase==="COLLECTING")return{...e,dimensions:a,viewport:s,current:h};const m=a.draggables[e.critical.draggable.id],v=i||e3({pageOffset:p.offset,draggable:m,draggables:a.draggables,droppables:a.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),x=mfe({draggable:m,impact:v,previousImpact:e.impact,draggables:a.draggables,droppables:a.droppables});return{...e,current:h,dimensions:{draggables:a.draggables,droppables:x},impact:v,viewport:s,scrollJumpRequest:o||null,forceShouldAnimate:o?!1:null}};function gfe(e,t){return e.map(n=>t[n])}var t3=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:i})=>{const o=e.displaced,s=gfe(o.all,n),a=Uf({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:i,last:o});return{...e,displaced:a}},n3=({impact:e,draggable:t,droppable:n,draggables:r,viewport:i,afterCritical:o})=>{const s=Og({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return Rb({pageBorderBoxCenter:s,draggable:t,viewport:i})},r3=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&ve();const r=e.impact,i=n||e.viewport,o=t||e.dimensions,{draggables:s,droppables:a}=o,u=s[e.critical.draggable.id],c=Mr(r);c||ve();const d=a[c],p=t3({impact:r,viewport:i,destination:d,draggables:s}),h=n3({impact:p,draggable:u,droppable:d,draggables:s,viewport:i,afterCritical:e.afterCritical});return uf({impact:p,clientSelection:h,state:e,dimensions:o,viewport:i})},yfe=e=>({index:e.index,droppableId:e.droppableId}),i3=({draggable:e,home:t,draggables:n,viewport:r})=>{const i=vd(t.axis,e.displaceBy),o=zu(t.descriptor.id,n),s=o.indexOf(e);s===-1&&ve();const a=o.slice(s+1),u=a.reduce((h,m)=>(h[m.descriptor.id]=!0,h),{}),c={inVirtualList:t.descriptor.mode==="virtual",displacedBy:i,effected:u};return{impact:{displaced:Uf({afterDragging:a,destination:t,displacedBy:i,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:yfe(e.descriptor)}},afterCritical:c}},vfe=(e,t)=>({draggables:e.draggables,droppables:Db(e.droppables,t)}),xfe=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Cm(e.client,t),i=Im(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:i}},_fe=e=>{const t=e.frame;return t||ve(),t},wfe=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(i=>{const o=i.descriptor.droppableId,s=t[o],u=_fe(s).scroll.diff.value,c=xn(r,u);return xfe({draggable:i,offset:c,initialWindowScroll:n.scroll.initial})})},bfe=({state:e,published:t})=>{const n=t.modified.map(y=>{const _=e.dimensions.droppables[y.droppableId];return Ab(_,y.scroll)}),r={...e.dimensions.droppables,...H$(n)},i=z$(wfe({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o={...e.dimensions.draggables,...i};t.removals.forEach(y=>{delete o[y]});const s={droppables:r,draggables:o},a=Mr(e.impact),u=a?s.droppables[a]:null,c=s.draggables[e.critical.draggable.id],d=s.droppables[e.critical.droppable.id],{impact:p,afterCritical:h}=i3({draggable:c,home:d,draggables:o,viewport:e.viewport}),m=u&&u.isCombineEnabled?e.impact:p,v=e3({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:m,viewport:e.viewport,afterCritical:h}),x={...e,phase:"DRAGGING",impact:v,onLiftImpact:p,dimensions:s,afterCritical:h,forceShouldAnimate:!1};return e.phase==="COLLECTING"?x:{...x,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const j_=e=>e.movementMode==="SNAP",V0=(e,t,n)=>{const r=vfe(e.dimensions,t);return!j_(e)||n?uf({state:e,dimensions:r}):r3({state:e,dimensions:r})};function U0(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const oN={phase:"IDLE",completed:null,shouldFlush:!1};var Efe=(e=oN,t)=>{if(t.type==="FLUSH")return{...oN,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&ve();const{critical:n,clientSelection:r,viewport:i,dimensions:o,movementMode:s}=t.payload,a=o.draggables[n.draggable.id],u=o.droppables[n.droppable.id],c={selection:r,borderBoxCenter:a.client.borderBox.center,offset:pn},d={client:c,page:{selection:xn(c.selection,i.scroll.initial),borderBoxCenter:xn(c.selection,i.scroll.initial),offset:xn(c.selection,i.scroll.diff.value)}},p=Tg(o.droppables).every(x=>!x.isFixedOnPage),{impact:h,afterCritical:m}=i3({draggable:a,home:u,draggables:o.draggables,viewport:i});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:o,initial:d,current:d,isWindowScrollAllowed:p,impact:h,afterCritical:m,onLiftImpact:h,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&ve(),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||ve(),bfe({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{client:n}=t.payload;return bs(n,e.current.client.selection)?e:uf({state:e,clientSelection:n,impact:j_(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return U0(e);na(e)||ve();const{id:n,newScroll:r}=t.payload,i=e.dimensions.droppables[n];if(!i)return e;const o=Ab(i,r);return V0(e,o,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{id:n,isEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||ve(),i.isEnabled===r&&ve();const o={...i,isEnabled:r};return V0(e,o,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{id:n,isCombineEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||ve(),i.isCombineEnabled===r&&ve();const o={...i,isCombineEnabled:r};return V0(e,o,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;na(e)||ve(),e.isWindowScrollAllowed||ve();const n=t.payload.newScroll;if(bs(e.viewport.scroll.current,n))return U0(e);const r=K$(e.viewport,n);return j_(e)?r3({state:e,viewport:r}):uf({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!na(e))return e;const n=t.payload.maxScroll;if(bs(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&ve();const n=ofe({state:e,type:t.type});return n?uf({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&ve(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:i}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||ve(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:i,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function ft(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Sfe=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Cfe=e=>({type:"LIFT",payload:e}),Ife=e=>({type:"INITIAL_PUBLISH",payload:e}),Afe=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Tfe=()=>({type:"COLLECTION_STARTING",payload:null}),kfe=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Nfe=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Ofe=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),o3=e=>({type:"MOVE",payload:e}),Rfe=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),Dfe=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),Lfe=()=>({type:"MOVE_UP",payload:null}),Pfe=()=>({type:"MOVE_DOWN",payload:null}),Mfe=()=>({type:"MOVE_RIGHT",payload:null}),$fe=()=>({type:"MOVE_LEFT",payload:null}),Lb=()=>({type:"FLUSH",payload:null}),Ffe=e=>({type:"DROP_ANIMATE",payload:e}),Pb=e=>({type:"DROP_COMPLETE",payload:e}),s3=e=>({type:"DROP",payload:e}),Bfe=e=>({type:"DROP_PENDING",payload:e}),a3=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var Hfe=e=>({getState:t,dispatch:n})=>r=>i=>{if(!ft(i,"LIFT")){r(i);return}const{id:o,clientSelection:s,movementMode:a}=i.payload,u=t();u.phase==="DROP_ANIMATING"&&n(Pb({completed:u.completed})),t().phase!=="IDLE"&&ve(),n(Lb()),n(Sfe({draggableId:o,movementMode:a}));const d={draggableId:o,scrollOptions:{shouldPublishImmediately:a==="SNAP"}},{critical:p,dimensions:h,viewport:m}=e.startPublishing(d);n(Ife({critical:p,dimensions:h,clientSelection:s,movementMode:a,viewport:m}))},zfe=e=>()=>t=>n=>{ft(n,"INITIAL_PUBLISH")&&e.dragging(),ft(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(ft(n,"FLUSH")||ft(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Mb={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Wf={opacity:{drop:0,combining:.7},scale:{drop:.75}},l3={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Qs=`${l3.outOfTheWay}s ${Mb.outOfTheWay}`,cf={fluid:`opacity ${Qs}`,snap:`transform ${Qs}, opacity ${Qs}`,drop:e=>{const t=`${e}s ${Mb.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Qs}`,placeholder:`height ${Qs}, width ${Qs}, margin ${Qs}`},sN=e=>bs(e,pn)?void 0:`translate(${e.x}px, ${e.y}px)`,V_={moveTo:sN,drop:(e,t)=>{const n=sN(e);if(n)return t?`${n} scale(${Wf.scale.drop})`:n}},{minDropTime:U_,maxDropTime:u3}=l3,jfe=u3-U_,aN=1500,Vfe=.6;var Ufe=({current:e,destination:t,reason:n})=>{const r=jf(e,t);if(r<=0)return U_;if(r>=aN)return u3;const i=r/aN,o=U_+jfe*i,s=n==="CANCEL"?o*Vfe:o;return Number(s.toFixed(2))},Wfe=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:i})=>{const{draggables:o,droppables:s}=n,a=Mr(e),u=a?s[a]:null,c=s[t.descriptor.droppableId],d=n3({impact:e,draggable:t,draggables:o,afterCritical:i,droppable:u||c,viewport:r});return Lr(d,t.client.borderBox.center)},Gfe=({draggables:e,reason:t,lastImpact:n,home:r,viewport:i,onLiftImpact:o})=>!n.at||t!=="DROP"?{impact:t3({draggables:e,impact:o,destination:r,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:Vf},didDropInsideDroppable:!0};const Kfe=({getState:e,dispatch:t})=>n=>r=>{if(!ft(r,"DROP")){n(r);return}const i=e(),o=r.payload.reason;if(i.phase==="COLLECTING"){t(Bfe({reason:o}));return}if(i.phase==="IDLE")return;i.phase==="DROP_PENDING"&&i.isWaiting&&ve(),i.phase==="DRAGGING"||i.phase==="DROP_PENDING"||ve();const a=i.critical,u=i.dimensions,c=u.draggables[i.critical.draggable.id],{impact:d,didDropInsideDroppable:p}=Gfe({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),h=p?Tb(d):null,m=p?kg(d):null,v={index:a.draggable.index,droppableId:a.droppable.id},x={draggableId:c.descriptor.id,type:c.descriptor.type,source:v,reason:o,mode:i.movementMode,destination:h,combine:m},b=Wfe({impact:d,draggable:c,dimensions:u,viewport:i.viewport,afterCritical:i.afterCritical}),y={critical:i.critical,afterCritical:i.afterCritical,result:x,impact:d};if(!(!bs(i.current.client.offset,b)||!!x.combine)){t(Pb({completed:y}));return}const E=Ufe({current:i.current.client.offset,destination:b,reason:o});t(Ffe({newHomeClientOffset:b,dropDuration:E,completed:y}))};var c3=()=>({x:window.pageXOffset,y:window.pageYOffset});function qfe(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Yfe({onWindowScroll:e}){function t(){e(c3())}const n=zf(t),r=qfe(n);let i=ws;function o(){return i!==ws}function s(){o()&&ve(),i=ui(window,[r])}function a(){o()||ve(),n.cancel(),i(),i=ws}return{start:s,stop:a,isActive:o}}const Xfe=e=>ft(e,"DROP_COMPLETE")||ft(e,"DROP_ANIMATE")||ft(e,"FLUSH"),Qfe=e=>{const t=Yfe({onWindowScroll:n=>{e.dispatch(Rfe({newScroll:n}))}});return n=>r=>{!t.isActive()&&ft(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Xfe(r)&&t.stop(),n(r)}};var Zfe=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),i=o=>{t||n||(t=!0,e(o),clearTimeout(r))};return i.wasCalled=()=>t,i},Jfe=()=>{const e=[],t=i=>{const o=e.findIndex(a=>a.timerId===i);o===-1&&ve();const[s]=e.splice(o,1);s.callback()};return{add:i=>{const o=setTimeout(()=>t(o)),s={timerId:o,callback:i};e.push(s)},flush:()=>{if(!e.length)return;const i=[...e];e.length=0,i.forEach(o=>{clearTimeout(o.timerId),o.callback()})}}};const ede=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,tde=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,nde=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},Rc=(e,t)=>{t()},Qp=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function W0(e,t,n,r){if(!e){n(r(t));return}const i=Zfe(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}var rde=(e,t)=>{const n=Jfe();let r=null;const i=(p,h)=>{r&&ve(),Rc("onBeforeCapture",()=>{const m=e().onBeforeCapture;m&&m({draggableId:p,mode:h})})},o=(p,h)=>{r&&ve(),Rc("onBeforeDragStart",()=>{const m=e().onBeforeDragStart;m&&m(Qp(p,h))})},s=(p,h)=>{r&&ve();const m=Qp(p,h);r={mode:h,lastCritical:p,lastLocation:m.source,lastCombine:null},n.add(()=>{Rc("onDragStart",()=>W0(e().onDragStart,m,t,Eh.onDragStart))})},a=(p,h)=>{const m=Tb(h),v=kg(h);r||ve();const x=!nde(p,r.lastCritical);x&&(r.lastCritical=p);const b=!ede(r.lastLocation,m);b&&(r.lastLocation=m);const y=!tde(r.lastCombine,v);if(y&&(r.lastCombine=v),!x&&!b&&!y)return;const _={...Qp(p,r.mode),combine:v,destination:m};n.add(()=>{Rc("onDragUpdate",()=>W0(e().onDragUpdate,_,t,Eh.onDragUpdate))})},u=()=>{r||ve(),n.flush()},c=p=>{r||ve(),r=null,Rc("onDragEnd",()=>W0(e().onDragEnd,p,t,Eh.onDragEnd))};return{beforeCapture:i,beforeStart:o,start:s,update:a,flush:u,drop:c,abort:()=>{if(!r)return;const p={...Qp(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};c(p)}}},ide=(e,t)=>{const n=rde(e,t);return r=>i=>o=>{if(ft(o,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(ft(o,"INITIAL_PUBLISH")){const a=o.payload.critical;n.beforeStart(a,o.payload.movementMode),i(o),n.start(a,o.payload.movementMode);return}if(ft(o,"DROP_COMPLETE")){const a=o.payload.completed.result;n.flush(),i(o),n.drop(a);return}if(i(o),ft(o,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const ode=e=>t=>n=>{if(!ft(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&ve(),e.dispatch(Pb({completed:r.completed}))},sde=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return i=>o=>{if((ft(o,"FLUSH")||ft(o,"DROP_COMPLETE")||ft(o,"DROP_ANIMATION_FINISHED"))&&r(),i(o),!ft(o,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(a3())}};n=requestAnimationFrame(()=>{n=null,t=ui(window,[s])})}};var ade=e=>()=>t=>n=>{(ft(n,"DROP_COMPLETE")||ft(n,"FLUSH")||ft(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},lde=e=>{let t=!1;return()=>n=>r=>{if(ft(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(ft(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(ft(r,"DROP_COMPLETE")){t=!1;const i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const ude=e=>ft(e,"DROP_COMPLETE")||ft(e,"DROP_ANIMATE")||ft(e,"FLUSH");var cde=e=>t=>n=>r=>{if(ude(r)){e.stop(),n(r);return}if(ft(r,"INITIAL_PUBLISH")){n(r);const i=t.getState();i.phase!=="DRAGGING"&&ve(),e.start(i);return}n(r),e.scroll(t.getState())};const fde=e=>t=>n=>{if(t(n),!ft(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(s3({reason:r.reason})))},dde=C$;var pde=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:i,autoScroller:o})=>S$(Efe,dde(iue(zfe(n),ade(e),Hfe(e),Kfe,ode,sde,fde,cde(o),Qfe,lde(t),ide(r,i))));const G0=()=>({additions:{},removals:{},modified:{}});function hde({registry:e,callbacks:t}){let n=G0(),r=null;const i=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:u,removals:c,modified:d}=n,p=Object.keys(u).map(v=>e.draggable.getById(v).getDimension(pn)).sort((v,x)=>v.descriptor.index-x.descriptor.index),h=Object.keys(d).map(v=>{const b=e.droppable.getById(v).callbacks.getScrollWhileDragging();return{droppableId:v,scroll:b}}),m={additions:p,removals:Object.keys(c),modified:h};n=G0(),t.publish(m)}))};return{add:u=>{const c=u.descriptor.id;n.additions[c]=u,n.modified[u.descriptor.droppableId]=!0,n.removals[c]&&delete n.removals[c],i()},remove:u=>{const c=u.descriptor;n.removals[c.id]=!0,n.modified[c.droppableId]=!0,n.additions[c.id]&&delete n.additions[c.id],i()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=G0())}}}var f3=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const i=Lr({x:t,y:e},{x:r,y:n});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},d3=()=>{const e=document.documentElement;return e||ve(),e},p3=()=>{const e=d3();return f3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},mde=()=>{const e=c3(),t=p3(),n=e.y,r=e.x,i=d3(),o=i.clientWidth,s=i.clientHeight,a=r+o,u=n+s;return{frame:Ni({top:n,left:r,right:a,bottom:u}),scroll:{initial:e,current:e,max:t,diff:{value:pn,displacement:pn}}}},gde=({critical:e,scrollOptions:t,registry:n})=>{const r=mde(),i=r.scroll.current,o=e.droppable,s=n.droppable.getAllByType(o.type).map(d=>d.callbacks.getDimensionAndWatchScroll(i,t)),a=n.draggable.getAllByType(e.draggable.type).map(d=>d.getDimension(i));return{dimensions:{draggables:z$(a),droppables:H$(s)},critical:e,viewport:r}};function lN(e,t,n){return!(n.descriptor.id===t.id||n.descriptor.type!==t.type||e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var yde=(e,t)=>{let n=null;const r=hde({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=(h,m)=>{e.droppable.exists(h)||ve(),n&&t.updateDroppableIsEnabled({id:h,isEnabled:m})},o=(h,m)=>{n&&(e.droppable.exists(h)||ve(),t.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:m}))},s=(h,m)=>{n&&(e.droppable.exists(h)||ve(),t.updateDroppableScroll({id:h,newScroll:m}))},a=(h,m)=>{n&&e.droppable.getById(h).callbacks.scroll(m)},u=()=>{if(!n)return;r.stop();const h=n.critical.droppable;e.droppable.getAllByType(h.type).forEach(m=>m.callbacks.dragStopped()),n.unsubscribe(),n=null},c=h=>{n||ve();const m=n.critical.draggable;h.type==="ADDITION"&&lN(e,m,h.value)&&r.add(h.value),h.type==="REMOVAL"&&lN(e,m,h.value)&&r.remove(h.value)};return{updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:h=>{n&&ve();const m=e.draggable.getById(h.draggableId),v=e.droppable.getById(m.descriptor.droppableId),x={draggable:m.descriptor,droppable:v.descriptor},b=e.subscribe(c);return n={critical:x,unsubscribe:b},gde({critical:x,registry:e,scrollOptions:h.scrollOptions})},stopPublishing:u}},h3=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",vde=e=>{window.scrollBy(e.x,e.y)};const xde=fn(e=>Tg(e).filter(t=>!(!t.isEnabled||!t.frame))),_de=(e,t)=>xde(t).find(r=>(r.frame||ve(),Q$(r.frame.pageMarginBox)(e)))||null;var wde=({center:e,destination:t,droppables:n})=>{if(t){const i=n[t];return i.frame?i:null}return _de(e,n)};const Gf={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var bde=(e,t,n=()=>Gf)=>{const r=n(),i=e[t.size]*r.startFromPercentage,o=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:i,maxScrollValueAt:o}},m3=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?0:(n-e)/r},$b=1,Ede=(e,t,n=()=>Gf)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return $b;const o=1-m3({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(o);return Math.ceil(s)},Sde=(e,t,n)=>{const r=n(),i=r.durationDampening.accelerateAt,o=r.durationDampening.stopDampeningAt,s=t,a=o,c=Date.now()-s;if(c>=o)return e;if(c{const o=Ede(e,t,i);return o===0?0:r?Math.max(Sde(o,n,i),$b):o},cN=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=bde(e,r,o);return t[r.end]{const r=t.height>e.height,i=t.width>e.width;return!i&&!r?n:i&&r?null:{x:i?0:n.x,y:r?0:n.y}};const Ide=B$(e=>e===0?0:e);var g3=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},a=cN({container:t,distanceToEdges:s,dragStartTime:e,axis:kb,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),u=cN({container:t,distanceToEdges:s,dragStartTime:e,axis:U$,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),c=Ide({x:u,y:a});if(bs(c,pn))return null;const d=Cde({container:t,subject:n,proposedScroll:c});return d?bs(d,pn)?null:d:null};const Ade=B$(e=>e===0?0:e>0?1:-1),Fb=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const i=xn(t,r),o={x:e(i.x,n.x),y:e(i.y,n.y)};return bs(o,pn)?null:o}})(),y3=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},i=Ade(n),o=Fb({max:r,current:t,change:i});return!o||i.x!==0&&o.x===0||i.y!==0&&o.y===0},Bb=(e,t)=>y3({current:e.scroll.current,max:e.scroll.max,change:t}),Tde=(e,t)=>{if(!Bb(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Fb({current:r,max:n,change:t})},Hb=(e,t)=>{const n=e.frame;return n?y3({current:n.scroll.current,max:n.scroll.max,change:t}):!1},kde=(e,t)=>{const n=e.frame;return!n||!Hb(e,t)?null:Fb({current:n.scroll.current,max:n.scroll.max,change:t})};var Nde=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=g3({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o});return s&&Bb(e,s)?s:null},Ode=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=e.frame;if(!s)return null;const a=g3({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o});return a&&Hb(e,a)?a:null},fN=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:i,getAutoScrollerOptions:o})=>{const s=e.current.page.borderBoxCenter,u=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const p=e.viewport,h=Nde({dragStartTime:t,viewport:p,subject:u,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:o});if(h){r(h);return}}const c=wde({center:s,destination:Mr(e.impact),droppables:e.dimensions.droppables});if(!c)return;const d=Ode({dragStartTime:t,droppable:c,subject:u,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:o});d&&i(c.descriptor.id,d)},Rde=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Gf})=>{const r=zf(e),i=zf(t);let o=null;const s=c=>{o||ve();const{shouldUseTimeDampening:d,dragStartTime:p}=o;fN({state:c,scrollWindow:r,scrollDroppable:i,dragStartTime:p,shouldUseTimeDampening:d,getAutoScrollerOptions:n})};return{start:c=>{o&&ve();const d=Date.now();let p=!1;const h=()=>{p=!0};fN({state:c,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h,getAutoScrollerOptions:n}),o={dragStartTime:d,shouldUseTimeDampening:p},p&&s(c)},stop:()=>{o&&(r.cancel(),i.cancel(),o=null)},scroll:s}},Dde=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(a,u)=>{const c=xn(a.current.client.selection,u);e({client:c})},i=(a,u)=>{if(!Hb(a,u))return u;const c=kde(a,u);if(!c)return t(a.descriptor.id,u),null;const d=Lr(u,c);return t(a.descriptor.id,d),Lr(u,d)},o=(a,u,c)=>{if(!a||!Bb(u,c))return c;const d=Tde(u,c);if(!d)return n(c),null;const p=Lr(c,d);return n(p),Lr(c,p)};return a=>{const u=a.scrollJumpRequest;if(!u)return;const c=Mr(a.impact);c||ve();const d=i(a.dimensions.droppables[c],u);if(!d)return;const p=a.viewport,h=o(a.isWindowScrollAllowed,p,d);h&&r(a,h)}},Lde=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const i=Rde({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),o=Dde({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:u=>{if(!(r().disabled||u.phase!=="DRAGGING")){if(u.movementMode==="FLUID"){i.scroll(u);return}u.scrollJumpRequest&&o(u)}},start:i.start,stop:i.stop}};const Cu="data-rfd",Iu=(()=>{const e=`${Cu}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),W_=(()=>{const e=`${Cu}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Pde=(()=>{const e=`${Cu}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),dN={contextId:`${Cu}-scroll-container-context-id`},Mde=e=>t=>`[${t}="${e}"]`,Dc=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),$de="pointer-events: none;";var Fde=e=>{const t=Mde(e),n=(()=>{const a=` - cursor: -webkit-grab; - cursor: grab; - `;return{selector:t(Iu.contextId),styles:{always:` - -webkit-touch-callout: none; - -webkit-tap-highlight-color: rgba(0,0,0,0); - touch-action: manipulation; - `,resting:a,dragging:$de,dropAnimating:a}}})(),r=(()=>{const a=` - transition: ${cf.outOfTheWay}; - `;return{selector:t(W_.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),i={selector:t(Pde.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,i,{selector:"body",styles:{dragging:` - cursor: grabbing; - cursor: -webkit-grabbing; - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - overflow-anchor: none; - `}}];return{always:Dc(s,"always"),resting:Dc(s,"resting"),dragging:Dc(s,"dragging"),dropAnimating:Dc(s,"dropAnimating"),userCancel:Dc(s,"userCancel")}};const $r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?A.useLayoutEffect:A.useEffect,K0=()=>{const e=document.querySelector("head");return e||ve(),e},pN=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Bde(e,t){const n=it(()=>Fde(e),[e]),r=A.useRef(null),i=A.useRef(null),o=ke(fn(p=>{const h=i.current;h||ve(),h.textContent=p}),[]),s=ke(p=>{const h=r.current;h||ve(),h.textContent=p},[]);$r(()=>{!r.current&&!i.current||ve();const p=pN(t),h=pN(t);return r.current=p,i.current=h,p.setAttribute(`${Cu}-always`,e),h.setAttribute(`${Cu}-dynamic`,e),K0().appendChild(p),K0().appendChild(h),s(n.always),o(n.resting),()=>{const m=v=>{const x=v.current;x||ve(),K0().removeChild(x),v.current=null};m(r),m(i)}},[t,s,o,n.always,n.resting,e]);const a=ke(()=>o(n.dragging),[o,n.dragging]),u=ke(p=>{if(p==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),c=ke(()=>{i.current&&o(n.resting)},[o,n.resting]);return it(()=>({dragging:a,dropping:u,resting:c}),[a,u,c])}function v3(e,t){return Array.from(e.querySelectorAll(t))}var x3=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Rg(e){return e instanceof x3(e).HTMLElement}function Hde(e,t){const n=`[${Iu.contextId}="${e}"]`,r=v3(document,n);if(!r.length)return null;const i=r.find(o=>o.getAttribute(Iu.draggableId)===t);return!i||!Rg(i)?null:i}function zde(e){const t=A.useRef({}),n=A.useRef(null),r=A.useRef(null),i=A.useRef(!1),o=ke(function(h,m){const v={id:h,focus:m};return t.current[h]=v,function(){const b=t.current;b[h]!==v&&delete b[h]}},[]),s=ke(function(h){const m=Hde(e,h);m&&m!==document.activeElement&&m.focus()},[e]),a=ke(function(h,m){n.current===h&&(n.current=m)},[]),u=ke(function(){r.current||i.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const h=n.current;h&&s(h)}))},[s]),c=ke(function(h){n.current=null;const m=document.activeElement;m&&m.getAttribute(Iu.draggableId)===h&&(n.current=h)},[]);return $r(()=>(i.current=!0,function(){i.current=!1;const h=r.current;h&&cancelAnimationFrame(h)}),[]),it(()=>({register:o,tryRecordFocus:c,tryRestoreFocusRecorded:u,tryShiftRecord:a}),[o,c,u,a])}function jde(){const e={draggables:{},droppables:{}},t=[];function n(p){return t.push(p),function(){const m=t.indexOf(p);m!==-1&&t.splice(m,1)}}function r(p){t.length&&t.forEach(h=>h(p))}function i(p){return e.draggables[p]||null}function o(p){const h=i(p);return h||ve(),h}const s={register:p=>{e.draggables[p.descriptor.id]=p,r({type:"ADDITION",value:p})},update:(p,h)=>{const m=e.draggables[h.descriptor.id];m&&m.uniqueId===p.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:p=>{const h=p.descriptor.id,m=i(h);m&&p.uniqueId===m.uniqueId&&(delete e.draggables[h],e.droppables[p.descriptor.droppableId]&&r({type:"REMOVAL",value:p}))},getById:o,findById:i,exists:p=>!!i(p),getAllByType:p=>Object.values(e.draggables).filter(h=>h.descriptor.type===p)};function a(p){return e.droppables[p]||null}function u(p){const h=a(p);return h||ve(),h}const c={register:p=>{e.droppables[p.descriptor.id]=p},unregister:p=>{const h=a(p.descriptor.id);h&&p.uniqueId===h.uniqueId&&delete e.droppables[p.descriptor.id]},getById:u,findById:a,exists:p=>!!a(p),getAllByType:p=>Object.values(e.droppables).filter(h=>h.descriptor.type===p)};function d(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:c,subscribe:n,clean:d}}function Vde(){const e=it(jde,[]);return A.useEffect(()=>function(){e.clean()},[e]),e}var zb=Q.createContext(null),Nm=()=>{const e=document.body;return e||ve(),e};const Ude={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Wde=e=>`rfd-announcement-${e}`;function Gde(e){const t=it(()=>Wde(e),[e]),n=A.useRef(null);return A.useEffect(function(){const o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),Bf(o.style,Ude),Nm().appendChild(o),function(){setTimeout(function(){const u=Nm();u.contains(o)&&u.removeChild(o),o===n.current&&(n.current=null)})}},[t]),ke(i=>{const o=n.current;if(o){o.textContent=i;return}},[])}const Kde={separator:"::"};function jb(e,t=Kde){const n=Q.useId();return it(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function qde({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Yde({contextId:e,text:t}){const n=jb("hidden-text",{separator:"-"}),r=it(()=>qde({contextId:e,uniqueId:n}),[n,e]);return A.useEffect(function(){const o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",Nm().appendChild(o),function(){const a=Nm();a.contains(o)&&a.removeChild(o)}},[r,t]),r}var Dg=Q.createContext(null);function _3(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),t}function Xde(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&ve();const a={abandon:s};return e=a,a}function i(){e||ve(),e=null}function o(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:n,claim:r,release:i,tryAbandon:o}}function Kf(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Qde=9,Zde=13,Vb=27,w3=32,Jde=33,epe=34,tpe=35,npe=36,rpe=37,ipe=38,ope=39,spe=40,ape={[Zde]:!0,[Qde]:!0};var b3=e=>{ape[e.keyCode]&&e.preventDefault()};const Lg=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),E3=0,hN=5;function lpe(e,t){return Math.abs(t.x-e.x)>=hN||Math.abs(t.y-e.y)>=hN}const mN={type:"IDLE"};function upe({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:i=>{const{button:o,clientX:s,clientY:a}=i;if(o!==E3)return;const u={x:s,y:a},c=n();if(c.type==="DRAGGING"){i.preventDefault(),c.actions.move(u);return}c.type!=="PENDING"&&ve();const d=c.point;if(!lpe(d,u))return;i.preventDefault();const p=c.actions.fluidLift(u);r({type:"DRAGGING",actions:p})}},{eventName:"mouseup",fn:i=>{const o=n();if(o.type!=="DRAGGING"){e();return}i.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:i=>{n().type==="DRAGGING"&&i.preventDefault(),e()}},{eventName:"keydown",fn:i=>{if(n().type==="PENDING"){e();return}if(i.keyCode===Vb){i.preventDefault(),e();return}b3(i)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:i=>{const o=n();if(o.type==="IDLE"&&ve(),o.actions.shouldRespectForcePress()){e();return}i.preventDefault()}},{eventName:Lg,fn:e}]}function cpe(e){const t=A.useRef(mN),n=A.useRef(ws),r=it(()=>({eventName:"mousedown",fn:function(p){if(p.defaultPrevented||p.button!==E3||p.ctrlKey||p.metaKey||p.shiftKey||p.altKey)return;const h=e.findClosestDraggableId(p);if(!h)return;const m=e.tryGetLock(h,s,{sourceEvent:p});if(!m)return;p.preventDefault();const v={x:p.clientX,y:p.clientY};n.current(),c(m,v)}}),[e]),i=it(()=>({eventName:"webkitmouseforcewillbegin",fn:d=>{if(d.defaultPrevented)return;const p=e.findClosestDraggableId(d);if(!p)return;const h=e.findOptionsForDraggable(p);h&&(h.shouldRespectForcePress||e.canGetLock(p)&&d.preventDefault())}}),[e]),o=ke(function(){const p={passive:!1,capture:!0};n.current=ui(window,[i,r],p)},[i,r]),s=ke(()=>{t.current.type!=="IDLE"&&(t.current=mN,n.current(),o())},[o]),a=ke(()=>{const d=t.current;s(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[s]),u=ke(function(){const p={capture:!0,passive:!1},h=upe({cancel:a,completed:s,getPhase:()=>t.current,setPhase:m=>{t.current=m}});n.current=ui(window,h,p)},[a,s]),c=ke(function(p,h){t.current.type!=="IDLE"&&ve(),t.current={type:"PENDING",point:h,actions:p},u()},[u]);$r(function(){return o(),function(){n.current()}},[o])}function fpe(){}const dpe={[epe]:!0,[Jde]:!0,[npe]:!0,[tpe]:!0};function ppe(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:i=>{if(i.keyCode===Vb){i.preventDefault(),n();return}if(i.keyCode===w3){i.preventDefault(),r();return}if(i.keyCode===spe){i.preventDefault(),e.moveDown();return}if(i.keyCode===ipe){i.preventDefault(),e.moveUp();return}if(i.keyCode===ope){i.preventDefault(),e.moveRight();return}if(i.keyCode===rpe){i.preventDefault(),e.moveLeft();return}if(dpe[i.keyCode]){i.preventDefault();return}b3(i)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Lg,fn:n}]}function hpe(e){const t=A.useRef(fpe),n=it(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==w3)return;const s=e.findClosestDraggableId(o);if(!s)return;const a=e.tryGetLock(s,d,{sourceEvent:o});if(!a)return;o.preventDefault();let u=!0;const c=a.snapLift();t.current();function d(){u||ve(),u=!1,t.current(),r()}t.current=ui(window,ppe(c,d),{capture:!0,passive:!1})}}),[e]),r=ke(function(){const o={passive:!1,capture:!0};t.current=ui(window,[n],o)},[n]);$r(function(){return r(),function(){t.current()}},[r])}const q0={type:"IDLE"},mpe=120,gpe=.15;function ype({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Vb&&n.preventDefault(),e()}},{eventName:Lg,fn:e}]}function vpe({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const i=n();if(i.type!=="DRAGGING"){e();return}i.hasMoved=!0;const{clientX:o,clientY:s}=r.touches[0],a={x:o,y:s};r.preventDefault(),i.actions.move(a)}},{eventName:"touchend",fn:r=>{const i=n();if(i.type!=="DRAGGING"){e();return}r.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const i=n();i.type==="IDLE"&&ve();const o=r.touches[0];if(!o||!(o.force>=gpe))return;const a=i.actions.shouldRespectForcePress();if(i.type==="PENDING"){a&&e();return}if(a){if(i.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Lg,fn:e}]}function xpe(e){const t=A.useRef(q0),n=A.useRef(ws),r=ke(function(){return t.current},[]),i=ke(function(m){t.current=m},[]),o=it(()=>({eventName:"touchstart",fn:function(m){if(m.defaultPrevented)return;const v=e.findClosestDraggableId(m);if(!v)return;const x=e.tryGetLock(v,a,{sourceEvent:m});if(!x)return;const b=m.touches[0],{clientX:y,clientY:_}=b,E={x:y,y:_};n.current(),p(x,E)}}),[e]),s=ke(function(){const m={capture:!0,passive:!1};n.current=ui(window,[o],m)},[o]),a=ke(()=>{const h=t.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),i(q0),n.current(),s())},[s,i]),u=ke(()=>{const h=t.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),c=ke(function(){const m={capture:!0,passive:!1},v={cancel:u,completed:a,getPhase:r},x=ui(window,vpe(v),m),b=ui(window,ype(v),m);n.current=function(){x(),b()}},[u,r,a]),d=ke(function(){const m=r();m.type!=="PENDING"&&ve();const v=m.actions.fluidLift(m.point);i({type:"DRAGGING",actions:v,hasMoved:!1})},[r,i]),p=ke(function(m,v){r().type!=="IDLE"&&ve();const x=setTimeout(d,mpe);i({type:"PENDING",point:v,actions:m,longPressTimerId:x}),c()},[c,r,i,d]);$r(function(){return s(),function(){n.current();const v=r();v.type==="PENDING"&&(clearTimeout(v.longPressTimerId),i(q0))}},[r,s,i]),$r(function(){return ui(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const _pe=["input","button","textarea","select","option","optgroup","video","audio"];function S3(e,t){if(t==null)return!1;if(_pe.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:S3(e,t.parentElement)}function wpe(e,t){const n=t.target;return Rg(n)?S3(e,n):!1}var bpe=e=>Ni(e.getBoundingClientRect()).center;function Epe(e){return e instanceof x3(e).Element}const Spe=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function C3(e,t){return e==null?null:e[Spe](t)?e:C3(e.parentElement,t)}function Cpe(e,t){return e.closest?e.closest(t):C3(e,t)}function Ipe(e){return`[${Iu.contextId}="${e}"]`}function Ape(e,t){const n=t.target;if(!Epe(n))return null;const r=Ipe(e),i=Cpe(n,r);return!i||!Rg(i)?null:i}function Tpe(e,t){const n=Ape(e,t);return n?n.getAttribute(Iu.draggableId):null}function kpe(e,t){const n=`[${W_.contextId}="${e}"]`,i=v3(document,n).find(o=>o.getAttribute(W_.id)===t);return!i||!Rg(i)?null:i}function Npe(e){e.preventDefault()}function Zp({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function I3({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const i=n.draggable.findById(r);return!(!i||!i.options.isEnabled||!h3(t.getState(),r))}function Ope({lockAPI:e,contextId:t,store:n,registry:r,draggableId:i,forceSensorStop:o,sourceEvent:s}){if(!I3({lockAPI:e,store:n,registry:r,draggableId:i}))return null;const u=r.draggable.getById(i),c=kpe(t,u.descriptor.id);if(!c||s&&!u.options.canDragInteractiveElements&&wpe(c,s))return null;const d=e.claim(o||ws);let p="PRE_DRAG";function h(){return u.options.shouldRespectForcePress}function m(){return e.isActive(d)}function v(T,I){Zp({expected:T,phase:p,isLockActive:m,shouldWarn:!0})&&n.dispatch(I())}const x=v.bind(null,"DRAGGING");function b(T){function I(){e.release(),p="COMPLETED"}p!=="PRE_DRAG"&&(I(),ve()),n.dispatch(Cfe(T.liftActionArgs)),p="DRAGGING";function O(M,z={shouldBlockNextClick:!1}){if(T.cleanup(),z.shouldBlockNextClick){const U=ui(window,[{eventName:"click",fn:Npe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(U)}I(),n.dispatch(s3({reason:M}))}return{isActive:()=>Zp({expected:"DRAGGING",phase:p,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,drop:M=>O("DROP",M),cancel:M=>O("CANCEL",M),...T.actions}}function y(T){const I=zf(M=>{x(()=>o3({client:M}))});return{...b({liftActionArgs:{id:i,clientSelection:T,movementMode:"FLUID"},cleanup:()=>I.cancel(),actions:{move:I}}),move:I}}function _(){const T={moveUp:()=>x(Lfe),moveRight:()=>x(Mfe),moveDown:()=>x(Pfe),moveLeft:()=>x($fe)};return b({liftActionArgs:{id:i,clientSelection:bpe(c),movementMode:"SNAP"},cleanup:ws,actions:T})}function E(){Zp({expected:"PRE_DRAG",phase:p,isLockActive:m,shouldWarn:!0})&&e.release()}return{isActive:()=>Zp({expected:"PRE_DRAG",phase:p,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,fluidLift:y,snapLift:_,abort:E}}const Rpe=[cpe,hpe,xpe];function Dpe({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:i}){const o=[...i?Rpe:[],...r||[]],s=A.useState(()=>Xde())[0],a=ke(function(b,y){Kf(b)&&!Kf(y)&&s.tryAbandon()},[s]);$r(function(){let b=t.getState();return t.subscribe(()=>{const _=t.getState();a(b,_),b=_})},[s,t,a]),$r(()=>s.tryAbandon,[s.tryAbandon]);const u=ke(x=>I3({lockAPI:s,registry:n,store:t,draggableId:x}),[s,n,t]),c=ke((x,b,y)=>Ope({lockAPI:s,registry:n,contextId:e,store:t,draggableId:x,forceSensorStop:b||null,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null}),[e,s,n,t]),d=ke(x=>Tpe(e,x),[e]),p=ke(x=>{const b=n.draggable.findById(x);return b?b.options:null},[n.draggable]),h=ke(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Lb()))},[s,t]),m=ke(()=>s.isClaimed(),[s]),v=it(()=>({canGetLock:u,tryGetLock:c,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:m}),[u,c,d,p,h,m]);for(let x=0;x({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};qm.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),Ppe=e=>({...Gf,...e.autoScrollerOptions,durationDampening:{...Gf.durationDampening,...e.autoScrollerOptions}});function Lc(e){return e.current||ve(),e.current}function Mpe(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:i,dragHandleUsageInstructions:o}=e,s=A.useRef(null),a=_3(e),u=ke(()=>Lpe(a.current),[a]),c=ke(()=>Ppe(a.current),[a]),d=Gde(t),p=Yde({contextId:t,text:o}),h=Bde(t,i),m=ke(U=>{Lc(s).dispatch(U)},[]),v=it(()=>Hk({publishWhileDragging:Afe,updateDroppableScroll:kfe,updateDroppableIsEnabled:Nfe,updateDroppableIsCombineEnabled:Ofe,collectionStarting:Tfe},m),[m]),x=Vde(),b=it(()=>yde(x,v),[x,v]),y=it(()=>Lde({scrollWindow:vde,scrollDroppable:b.scrollDroppable,getAutoScrollerOptions:c,...Hk({move:o3},m)}),[b.scrollDroppable,m,c]),_=zde(t),E=it(()=>pde({announce:d,autoScroller:y,dimensionMarshal:b,focusMarshal:_,getResponders:u,styleMarshal:h}),[d,y,b,_,u,h]);s.current=E;const C=ke(()=>{const U=Lc(s);U.getState().phase!=="IDLE"&&U.dispatch(Lb())},[]),T=ke(()=>{const U=Lc(s).getState();return U.phase==="DROP_ANIMATING"?!0:U.phase==="IDLE"?!1:U.isDragging},[]),I=it(()=>({isDragging:T,tryAbort:C}),[T,C]);n(I);const O=ke(U=>h3(Lc(s).getState(),U),[]),M=ke(()=>na(Lc(s).getState()),[]),z=it(()=>({marshal:b,focus:_,contextId:t,canLift:O,isMovementAllowed:M,dragHandleUsageInstructionsId:p,registry:x}),[t,b,p,_,O,M,x]);return Dpe({contextId:t,store:E,registry:x,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),A.useEffect(()=>C,[C]),Q.createElement(Dg.Provider,{value:z},Q.createElement(ice,{context:zb,store:E},e.children))}function $pe(){return Q.useId()}function Fpe(e){const t=$pe(),n=e.dragHandleUsageInstructions||Eh.dragHandleUsageInstructions;return Q.createElement(mce,null,r=>Q.createElement(Mpe,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const gN={dragging:5e3,dropAnimating:4500},Bpe=(e,t)=>t?cf.drop(t.duration):e?cf.snap:cf.fluid,Hpe=(e,t)=>{if(e)return t?Wf.opacity.drop:Wf.opacity.combining},zpe=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function jpe(e){const n=e.dimension.client,{offset:r,combineWith:i,dropping:o}=e,s=!!i,a=zpe(e),u=!!o,c=u?V_.drop(r,s):V_.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Bpe(a,o),transform:c,opacity:Hpe(s,u),zIndex:u?gN.dropAnimating:gN.dragging,pointerEvents:"none"}}function Vpe(e){return{transform:V_.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Upe(e){return e.type==="DRAGGING"?jpe(e):Vpe(e)}function Wpe(e,t,n=pn){const r=window.getComputedStyle(t),i=t.getBoundingClientRect(),o=L$(i,r),s=Im(o,n),a={client:o,tagName:t.tagName.toLowerCase(),display:r.display},u={x:o.marginBox.width,y:o.marginBox.height};return{descriptor:e,placeholder:a,displaceBy:u,client:o,page:s}}function Gpe(e){const t=jb("draggable"),{descriptor:n,registry:r,getDraggableRef:i,canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}=e,u=it(()=>({canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}),[o,a,s]),c=ke(m=>{const v=i();return v||ve(),Wpe(n,v,m)},[n,i]),d=it(()=>({uniqueId:t,descriptor:n,options:u,getDimension:c}),[n,c,u,t]),p=A.useRef(d),h=A.useRef(!0);$r(()=>(r.draggable.register(p.current),()=>r.draggable.unregister(p.current)),[r.draggable]),$r(()=>{if(h.current){h.current=!1;return}const m=p.current;p.current=d,r.draggable.update(d,m)},[d,r.draggable])}var Ub=Q.createContext(null);function Om(e){const t=A.useContext(e);return t||ve(),t}function Kpe(e){e.preventDefault()}const qpe=e=>{const t=A.useRef(null),n=ke((I=null)=>{t.current=I},[]),r=ke(()=>t.current,[]),{contextId:i,dragHandleUsageInstructionsId:o,registry:s}=Om(Dg),{type:a,droppableId:u}=Om(Ub),c=it(()=>({id:e.draggableId,index:e.index,type:a,droppableId:u}),[e.draggableId,e.index,a,u]),{children:d,draggableId:p,isEnabled:h,shouldRespectForcePress:m,canDragInteractiveElements:v,isClone:x,mapped:b,dropAnimationFinished:y}=e;if(!x){const I=it(()=>({descriptor:c,registry:s,getDraggableRef:r,canDragInteractiveElements:v,shouldRespectForcePress:m,isEnabled:h}),[c,s,r,v,m,h]);Gpe(I)}const _=it(()=>h?{tabIndex:0,role:"button","aria-describedby":o,"data-rfd-drag-handle-draggable-id":p,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:Kpe}:null,[i,o,p,h]),E=ke(I=>{b.type==="DRAGGING"&&b.dropping&&I.propertyName==="transform"&&qm.flushSync(y)},[y,b]),C=it(()=>{const I=Upe(b),O=b.type==="DRAGGING"&&b.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":i,"data-rfd-draggable-id":p,style:I,onTransitionEnd:O},dragHandleProps:_}},[i,_,p,b,E,n]),T=it(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return Q.createElement(Q.Fragment,null,d(C,b.snapshot,T))};var A3=(e,t)=>e===t,T3=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Ype=e=>e.combine?e.combine.draggableId:null,Xpe=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Qpe(){const e=fn((i,o)=>({x:i,y:o})),t=fn((i,o,s=null,a=null,u=null)=>({isDragging:!0,isClone:o,isDropAnimating:!!u,dropAnimation:u,mode:i,draggingOver:s,combineWith:a,combineTargetFor:null})),n=fn((i,o,s,a,u=null,c=null,d=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:u,combineWith:c,mode:o,offset:i,dimension:s,forceShouldAnimate:d,snapshot:t(o,a,u,c,null)}}));return(i,o)=>{if(Kf(i)){if(i.critical.draggable.id!==o.draggableId)return null;const s=i.current.client.offset,a=i.dimensions.draggables[o.draggableId],u=Mr(i.impact),c=Xpe(i.impact),d=i.forceShouldAnimate;return n(e(s.x,s.y),i.movementMode,a,o.isClone,u,c,d)}if(i.phase==="DROP_ANIMATING"){const s=i.completed;if(s.result.draggableId!==o.draggableId)return null;const a=o.isClone,u=i.dimensions.draggables[o.draggableId],c=s.result,d=c.mode,p=T3(c),h=Ype(c),v={duration:i.dropDuration,curve:Mb.drop,moveTo:i.newHomeClientOffset,opacity:h?Wf.opacity.drop:null,scale:h?Wf.scale.drop:null};return{mapped:{type:"DRAGGING",offset:i.newHomeClientOffset,dimension:u,dropping:v,draggingOver:p,combineWith:h,mode:d,forceShouldAnimate:null,snapshot:t(d,a,p,h,v)}}}return null}}function k3(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Zpe={mapped:{type:"SECONDARY",offset:pn,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:k3(null)}};function Jpe(){const e=fn((s,a)=>({x:s,y:a})),t=fn(k3),n=fn((s,a=null,u)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:a,shouldAnimateDisplacement:u,snapshot:t(a)}})),r=s=>s?n(pn,s,!0):null,i=(s,a,u,c)=>{const d=u.displaced.visible[s],p=!!(c.inVirtualList&&c.effected[s]),h=kg(u),m=h&&h.draggableId===s?a:null;if(!d){if(!p)return r(m);if(u.displaced.invisible[s])return null;const b=Hu(c.displacedBy.point),y=e(b.x,b.y);return n(y,m,!0)}if(p)return r(m);const v=u.displacedBy.point,x=e(v.x,v.y);return n(x,m,d.shouldAnimate)};return(s,a)=>{if(Kf(s))return s.critical.draggable.id===a.draggableId?null:i(a.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const u=s.completed;return u.result.draggableId===a.draggableId?null:i(a.draggableId,u.result.draggableId,u.impact,u.afterCritical)}return null}}const ehe=()=>{const e=Qpe(),t=Jpe();return(r,i)=>e(r,i)||t(r,i)||Zpe},the={dropAnimationFinished:a3},nhe=R$(ehe,the,null,{context:zb,areStatePropsEqual:A3})(qpe);function N3(e){return Om(Ub).isUsingCloneFor===e.draggableId&&!e.isClone?null:Q.createElement(nhe,e)}function rhe(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return Q.createElement(N3,Bf({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const O3=e=>t=>e===t,ihe=O3("scroll"),ohe=O3("auto"),yN=(e,t)=>t(e.overflowX)||t(e.overflowY),she=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return yN(n,ihe)||yN(n,ohe)},ahe=()=>!1,R3=e=>e==null?null:e===document.body?ahe()?e:null:e===document.documentElement?null:she(e)?e:R3(e.parentElement);var G_=e=>({x:e.scrollLeft,y:e.scrollTop});const D3=e=>e?window.getComputedStyle(e).position==="fixed"?!0:D3(e.parentElement):!1;var lhe=e=>{const t=R3(e),n=D3(e);return{closestScrollable:t,isFixedOnPage:n}},uhe=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:i,client:o,page:s,closest:a})=>{const u=(()=>{if(!a)return null;const{scrollSize:h,client:m}=a,v=f3({scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:a.page.marginBox,frameClient:m,scrollSize:h,shouldClipSubject:a.shouldClipSubject,scroll:{initial:a.scroll,current:a.scroll,max:v,diff:{value:pn,displacement:pn}}}})(),c=i==="vertical"?kb:U$,d=Su({page:s,withPlaceholder:null,axis:c,frame:u});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:o,page:s,frame:u,subject:d}};const che=(e,t)=>{const n=P$(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,i=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,s=i+t.scrollWidth,u=Cb({top:r,right:s,bottom:o,left:i},n.border);return Ib({borderBox:u,margin:n.margin,border:n.border,padding:n.padding})};var fhe=({ref:e,descriptor:t,env:n,windowScroll:r,direction:i,isDropDisabled:o,isCombineEnabled:s,shouldClipSubject:a})=>{const u=n.closestScrollable,c=che(e,u),d=Im(c,r),p=(()=>{if(!u)return null;const m=P$(u),v={scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth};return{client:m,page:Im(m,r),scroll:G_(u),scrollSize:v,shouldClipSubject:a}})();return uhe({descriptor:t,isEnabled:!o,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:i,client:c,page:d,closest:p})};const dhe={passive:!1},phe={passive:!0};var vN=e=>e.shouldPublishImmediately?dhe:phe;const Jp=e=>e&&e.env.closestScrollable||null;function hhe(e){const t=A.useRef(null),n=Om(Dg),r=jb("droppable"),{registry:i,marshal:o}=n,s=_3(e),a=it(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),u=A.useRef(a),c=it(()=>fn((C,T)=>{t.current||ve();const I={x:C,y:T};o.updateDroppableScroll(a.id,I)}),[a.id,o]),d=ke(()=>{const C=t.current;return!C||!C.env.closestScrollable?pn:G_(C.env.closestScrollable)},[]),p=ke(()=>{const C=d();c(C.x,C.y)},[d,c]),h=it(()=>zf(p),[p]),m=ke(()=>{const C=t.current,T=Jp(C);if(C&&T||ve(),C.scrollOptions.shouldPublishImmediately){p();return}h()},[h,p]),v=ke((C,T)=>{t.current&&ve();const I=s.current,O=I.getDroppableRef();O||ve();const M=lhe(O),z={ref:O,descriptor:a,env:M,scrollOptions:T};t.current=z;const U=fhe({ref:O,descriptor:a,env:M,windowScroll:C,direction:I.direction,isDropDisabled:I.isDropDisabled,isCombineEnabled:I.isCombineEnabled,shouldClipSubject:!I.ignoreContainerClipping}),F=M.closestScrollable;return F&&(F.setAttribute(dN.contextId,n.contextId),F.addEventListener("scroll",m,vN(z.scrollOptions))),U},[n.contextId,a,m,s]),x=ke(()=>{const C=t.current,T=Jp(C);return C&&T||ve(),G_(T)},[]),b=ke(()=>{const C=t.current;C||ve();const T=Jp(C);t.current=null,T&&(h.cancel(),T.removeAttribute(dN.contextId),T.removeEventListener("scroll",m,vN(C.scrollOptions)))},[m,h]),y=ke(C=>{const T=t.current;T||ve();const I=Jp(T);I||ve(),I.scrollTop+=C.y,I.scrollLeft+=C.x},[]),_=it(()=>({getDimensionAndWatchScroll:v,getScrollWhileDragging:x,dragStopped:b,scroll:y}),[b,v,x,y]),E=it(()=>({uniqueId:r,descriptor:a,callbacks:_}),[_,a,r]);$r(()=>(u.current=E.descriptor,i.droppable.register(E),()=>{t.current&&b(),i.droppable.unregister(E)}),[_,a,b,E,o,i.droppable]),$r(()=>{t.current&&o.updateDroppableIsEnabled(u.current.id,!e.isDropDisabled)},[e.isDropDisabled,o]),$r(()=>{t.current&&o.updateDroppableIsCombineEnabled(u.current.id,e.isCombineEnabled)},[e.isCombineEnabled,o])}function Y0(){}const xN={width:0,height:0,margin:wce},mhe=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?xN:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},ghe=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=mhe({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?cf.placeholder:null}},yhe=e=>{const t=A.useRef(null),n=ke(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:i,onClose:o,contextId:s}=e,[a,u]=A.useState(e.animate==="open");A.useEffect(()=>a?r!=="open"?(n(),u(!1),Y0):t.current?Y0:(t.current=setTimeout(()=>{t.current=null,u(!1)}),n):Y0,[r,a,n]);const c=ke(p=>{p.propertyName==="height"&&(i(),r==="close"&&o())},[r,o,i]),d=ghe({isAnimatingOpenOnMount:a,animate:e.animate,placeholder:e.placeholder});return Q.createElement(e.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":s,onTransitionEnd:c,ref:e.innerRef})};var vhe=Q.memo(yhe);class xhe extends Q.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const _he=e=>{const t=A.useContext(Dg);t||ve();const{contextId:n,isMovementAllowed:r}=t,i=A.useRef(null),o=A.useRef(null),{children:s,droppableId:a,type:u,mode:c,direction:d,ignoreContainerClipping:p,isDropDisabled:h,isCombineEnabled:m,snapshot:v,useClone:x,updateViewportMaxScroll:b,getContainerForClone:y}=e,_=ke(()=>i.current,[]),E=ke((F=null)=>{i.current=F},[]);ke(()=>o.current,[]);const C=ke((F=null)=>{o.current=F},[]),T=ke(()=>{r()&&b({maxScroll:p3()})},[r,b]);hhe({droppableId:a,type:u,mode:c,direction:d,isDropDisabled:h,isCombineEnabled:m,ignoreContainerClipping:p,getDroppableRef:_});const I=it(()=>Q.createElement(xhe,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:F,data:W,animate:Y})=>Q.createElement(vhe,{placeholder:W,onClose:F,innerRef:C,animate:Y,contextId:n,onTransitionEnd:T})),[n,T,e.placeholder,e.shouldAnimatePlaceholder,C]),O=it(()=>({innerRef:E,placeholder:I,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":n}}),[n,a,I,E]),M=x?x.dragging.draggableId:null,z=it(()=>({droppableId:a,type:u,isUsingCloneFor:M}),[a,M,u]);function U(){if(!x)return null;const{dragging:F,render:W}=x,Y=Q.createElement(N3,{draggableId:F.draggableId,index:F.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(L,B)=>W(L,B,F));return la.createPortal(Y,y())}return Q.createElement(Ub.Provider,{value:z},s(O,v),U())};function whe(){return document.body||ve(),document.body}const _N={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:whe},L3=e=>{let t={...e},n;for(n in _N)e[n]===void 0&&(t={...t,[n]:_N[n]});return t},X0=(e,t)=>e===t.droppable.type,wN=(e,t)=>t.draggables[e.draggable.id],bhe=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=fn(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),r=fn((o,s,a,u,c,d)=>{const p=c.descriptor.id;if(c.descriptor.droppableId===o){const v=d?{render:d,dragging:n(c.descriptor)}:null,x={isDraggingOver:a,draggingOverWith:a?p:null,draggingFromThisWith:p,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:x,useClone:v}}if(!s)return t;if(!u)return e;const m={isDraggingOver:a,draggingOverWith:p,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:m,useClone:null}});return(o,s)=>{const a=L3(s),u=a.droppableId,c=a.type,d=!a.isDropDisabled,p=a.renderClone;if(Kf(o)){const h=o.critical;if(!X0(c,h))return t;const m=wN(h,o.dimensions),v=Mr(o.impact)===u;return r(u,d,v,v,m,p)}if(o.phase==="DROP_ANIMATING"){const h=o.completed;if(!X0(c,h.critical))return t;const m=wN(h.critical,o.dimensions);return r(u,d,T3(h.result)===u,Mr(h.impact)===u,m,p)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const h=o.completed;if(!X0(c,h.critical))return t;const m=Mr(h.impact)===u,v=!!(h.impact.at&&h.impact.at.type==="COMBINE"),x=h.critical.droppable.id===u;return m?v?e:t:x?e:t}return t}},Ehe={updateViewportMaxScroll:Dfe},She=R$(bhe,Ehe,(e,t,n)=>({...L3(n),...e,...t}),{context:zb,areStatePropsEqual:A3})(_he);var Che=She;const K_=2**31-1;function P3(e,t,n){const r=n-Date.now();e.current=r<=K_?setTimeout(t,r):setTimeout(()=>P3(e,t,n),K_)}function Ihe(){const e=G1(),t=A.useRef();return hb(()=>clearTimeout(t.current)),A.useMemo(()=>{const n=()=>clearTimeout(t.current);function r(i,o=0){e()&&(n(),o<=K_?t.current=setTimeout(i,o):P3(t,i,Date.now()+o))}return{set:r,clear:n,handleRef:t}},[])}const Ahe={[oi]:"showing",[bu]:"showing show"},M3=A.forwardRef((e,t)=>S.jsx(Da,{...e,ref:t,transitionClasses:Ahe}));M3.displayName="ToastFade";const $3=A.createContext({onClose(){}}),F3=A.forwardRef(({bsPrefix:e,closeLabel:t="Close",closeVariant:n,closeButton:r=!0,className:i,children:o,...s},a)=>{e=Be(e,"toast-header");const u=A.useContext($3),c=Pt(d=>{u==null||u.onClose==null||u.onClose(d)});return S.jsxs("div",{ref:a,...s,className:Te(e,i),children:[o,r&&S.jsx(fd,{"aria-label":t,variant:n,onClick:c,"data-dismiss":"toast"})]})});F3.displayName="ToastHeader";const B3=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Be(t,"toast-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));B3.displayName="ToastBody";const H3=A.forwardRef(({bsPrefix:e,className:t,transition:n=M3,show:r=!0,animation:i=!0,delay:o=5e3,autohide:s=!1,onClose:a,onEntered:u,onExit:c,onExiting:d,onEnter:p,onEntering:h,onExited:m,bg:v,...x},b)=>{e=Be(e,"toast");const y=A.useRef(o),_=A.useRef(a);A.useEffect(()=>{y.current=o,_.current=a},[o,a]);const E=Ihe(),C=!!(s&&r),T=A.useCallback(()=>{C&&(_.current==null||_.current())},[C]);A.useEffect(()=>{E.set(T,y.current)},[E,T]);const I=A.useMemo(()=>({onClose:a}),[a]),O=!!(n&&i),M=S.jsx("div",{...x,ref:b,className:Te(e,t,v&&`bg-${v}`,!O&&(r?"show":"hide")),role:"alert","aria-live":"assertive","aria-atomic":"true"});return S.jsx($3.Provider,{value:I,children:O&&n?S.jsx(n,{in:r,onEnter:p,onEntering:h,onEntered:u,onExit:c,onExiting:d,onExited:m,unmountOnExit:!0,children:M}):M})});H3.displayName="Toast";const bN=Object.assign(H3,{Body:B3,Header:F3}),The={"top-start":"top-0 start-0","top-center":"top-0 start-50 translate-middle-x","top-end":"top-0 end-0","middle-start":"top-50 start-0 translate-middle-y","middle-center":"top-50 start-50 translate-middle","middle-end":"top-50 end-0 translate-middle-y","bottom-start":"bottom-0 start-0","bottom-center":"bottom-0 start-50 translate-middle-x","bottom-end":"bottom-0 end-0"},z3=A.forwardRef(({bsPrefix:e,position:t,containerPosition:n,className:r,as:i="div",...o},s)=>(e=Be(e,"toast-container"),S.jsx(i,{ref:s,...o,className:Te(e,t&&The[t],n&&`position-${n}`,r)})));z3.displayName="ToastContainer";function khe({id:e,showModal:t,setShowModal:n}){const[r,i]=A.useState(e),[o,s]=A.useState(""),{flowchart:a,renameVariable:u}=Gr(),{getString:c}=sn();A.useEffect(()=>{i(e)},[t]),A.useEffect(()=>{const p="var",h=ud.match(`${p} ${r}`,"Command");if(h.failed()){const m=c("SyntaxError",{pos:h.getInterval().startIdx-p.length-1,expected:D1(h)});s(m)}else{const m=ce.reject(a.variables,{id:e}),v=Wa(h).check(m);s(v!==null?c(v.message,v.payload):"")}},[r]);const d=p=>{p.preventDefault(),setTimeout(()=>{u(e,r.trim())},200),n(!1)};return S.jsx(ct,{show:t,onHide:()=>n(!1),children:S.jsxs(wa,{onSubmit:d,children:[S.jsx(ct.Header,{closeButton:!0,children:S.jsx(ct.Title,{children:c("ModalRenameVariable_Title")})}),S.jsx(ct.Body,{children:S.jsx(HM,{helpText:c("ModalRenameVariable_HelpText"),value:r,setValue:i,problem:c(o)})}),S.jsxs(ct.Footer,{children:[S.jsx(Rn,{variant:"secondary",onClick:()=>n(!1),children:c("Button_Cancel")}),S.jsx(Rn,{variant:"primary",type:"submit",disabled:o!=="",children:c("Button_Rename")})]})]})})}function Nhe({id:e}){const[t,n]=A.useState(!1),{changeVariableType:r,removeVariable:i}=Gr(),{machineState:o}=Ms(),{getString:s}=sn();if(!ce.has(o.memory,e))return S.jsx(S.Fragment,{});const{type:a,value:u}=o.memory[e];return S.jsxs(S.Fragment,{children:[S.jsx(khe,{id:e,showModal:t,setShowModal:n}),S.jsx("td",{children:S.jsx(Rn,{variant:"secondary",size:"sm",className:"font-monospace",onClick:()=>n(!0),children:e})}),S.jsx("td",{children:S.jsx(wa.Select,{size:"sm",value:a,onChange:c=>r(e,c.target.value),className:"w-auto",children:ce.map(Yn,c=>S.jsx("option",{value:c,children:s(`DataType_${c}`)},c))})}),S.jsx("td",{className:"w-100",children:S.jsx("small",{className:"d-flex p-1 fw-bold font-monospace text-success bg-success bg-opacity-10 border border-success border-opacity-10 rounded-1",children:u===null?"?":JSON.stringify(u)})}),S.jsx("td",{children:S.jsx(Lu,{text:s("VariableList_Remove"),children:S.jsx(Rn,{variant:"danger",size:"sm",onClick:()=>i(e),children:S.jsx("i",{className:"bi bi-trash-fill"})})})})]})}function Ohe(){const{flowchart:e,addVariable:t,reorderVariables:n}=Gr(),{getString:r}=sn(),i=()=>{var s;(s=document.activeElement)==null||s.blur()},o=({source:s,destination:a})=>{n(s.index,a==null?void 0:a.index)};return S.jsxs("div",{className:"d-flex flex-column h-100",children:[S.jsxs("div",{className:"d-flex flex-row justify-content-between align-items-center mb-2 gap-3",children:[S.jsx("span",{className:"fw-semibold",children:r("VariableList_Title")}),S.jsx(Rn,{size:"sm",className:"fw-semibold text-nowrap",onClick:t,children:r("VariableList_Add")})]}),S.jsx("div",{style:{overflowY:"auto",overflowX:"clip"},children:S.jsx(ta,{size:"sm",variant:"borderless",className:"mb-0",children:S.jsx(Fpe,{onDragStart:i,onDragEnd:o,children:S.jsx(Che,{droppableId:"droppable",children:({innerRef:s,droppableProps:a,placeholder:u})=>S.jsxs("tbody",{ref:s,...a,children:[ce.map(e.variables,({id:c},d)=>S.jsx(rhe,{draggableId:`${d}`,index:d,children:({innerRef:p,draggableProps:h,dragHandleProps:m})=>S.jsx("tr",{ref:p,...h,...m,children:S.jsx(Nhe,{id:c})})},d)),u]})})})})})]})}function Rhe(){const{toasts:e}=Wr();return S.jsx(z3,{className:"position-fixed bottom-0 end-0 m-3",children:ce.map(e,(t,n)=>S.jsx(bN,{bg:t.background,className:"text-white",children:S.jsxs(bN.Body,{children:[S.jsx("i",{className:`bi ${t.icon} me-2`})," ",t.message]})},n))})}function Dhe(){const{flowchart:e}=Gr(),{resetMachine:t}=Ms(),n=JSON.stringify(ce.map(e.nodes,i=>ce.pick(i,["id","data"]))),r=JSON.stringify(ce.map(e.edges,i=>ce.pick(i,["source","sourceHandle","target"])));return A.useEffect(()=>{t(e)},[n,r,e.variables]),S.jsx(S.Fragment,{})}function Lhe(){const{importSimpleFlowchart:e}=Gr(),{triggerToast:t}=Wr(),{getString:n}=sn();return A.useEffect(()=>{const r=new URL(window.location.href),i=r.searchParams.get("lzs");if(i!==null)try{const o=Mle(i);e(o),r.searchParams.delete("lzs"),window.history.replaceState({},"",r.toString()),t({message:n("ToastMessage_ImportSuccess"),icon:"bi-check-circle",background:"success"})}catch{t({message:n("ToastMessage_ImportError"),icon:"bi-exclamation-triangle",background:"danger"})}},[]),S.jsx(S.Fragment,{})}function Phe(){const e={backgroundColor:Tt.gray300,background:`repeating-linear-gradient( - 45deg, - ${Tt.gray300}, - ${Tt.gray300} 2px, - ${Tt.gray100} 2px, - ${Tt.gray100} 4px - )`};return S.jsxs(f1,{children:[S.jsx(zae,{}),S.jsx(Dhe,{}),S.jsx(Lhe,{}),S.jsx(Rhe,{}),S.jsxs($a,{className:"vh-100 h-100",style:{userSelect:"none"},children:[S.jsx(Yle,{}),S.jsxs(Ux,{direction:"horizontal",autoSaveId:"fluxolab_main",children:[S.jsx("div",{className:"bg-light p-3",children:S.jsx(Qle,{})}),S.jsx(Bc,{defaultSize:70,minSize:50,children:S.jsx(Cae,{})}),S.jsx(Wx,{style:{width:"6px",...e}}),S.jsx(Bc,{defaultSize:30,minSize:24,children:S.jsxs(Ux,{direction:"vertical",autoSaveId:"fluxolab_right",className:"bg-light",children:[S.jsx(Bc,{defaultSize:40,minSize:24,className:"p-3",children:S.jsx(Ohe,{})}),S.jsx(Wx,{style:{height:"6px",...e}}),S.jsx(Bc,{defaultSize:60,className:"p-3",children:S.jsx(eue,{})})]})})]})]})]})}const j3=document.createElement("div"),Mhe=PO(j3);Mhe.render(S.jsx(Phe,{}));document.body.appendChild(j3); diff --git a/assets/index-t6e7nzZ9.js b/assets/index-t6e7nzZ9.js new file mode 100644 index 0000000..1838f62 --- /dev/null +++ b/assets/index-t6e7nzZ9.js @@ -0,0 +1,498 @@ +function Wj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var EN={exports:{}},Rm={},SN={exports:{}},et={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qf=Symbol.for("react.element"),Gj=Symbol.for("react.portal"),Kj=Symbol.for("react.fragment"),qj=Symbol.for("react.strict_mode"),Yj=Symbol.for("react.profiler"),Xj=Symbol.for("react.provider"),Qj=Symbol.for("react.context"),Zj=Symbol.for("react.forward_ref"),Jj=Symbol.for("react.suspense"),e6=Symbol.for("react.memo"),t6=Symbol.for("react.lazy"),pC=Symbol.iterator;function n6(e){return e===null||typeof e!="object"?null:(e=pC&&e[pC]||e["@@iterator"],typeof e=="function"?e:null)}var CN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},IN=Object.assign,AN={};function Iu(e,t,n){this.props=e,this.context=t,this.refs=AN,this.updater=n||CN}Iu.prototype.isReactComponent={};Iu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Iu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function TN(){}TN.prototype=Iu.prototype;function q_(e,t,n){this.props=e,this.context=t,this.refs=AN,this.updater=n||CN}var Y_=q_.prototype=new TN;Y_.constructor=q_;IN(Y_,Iu.prototype);Y_.isPureReactComponent=!0;var hC=Array.isArray,kN=Object.prototype.hasOwnProperty,X_={current:null},NN={key:!0,ref:!0,__self:!0,__source:!0};function ON(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)kN.call(t,r)&&!NN.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,ne=U[Z];if(0>>1;Zi(ie,N))sei(pe,ie)?(U[Z]=pe,U[se]=N,Z=se):(U[Z]=ie,U[ee]=N,Z=ee);else if(sei(pe,N))U[Z]=pe,U[se]=N,Z=se;else break e}}return H}function i(U,H){var N=U.sortIndex-H.sortIndex;return N!==0?N:U.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],d=1,p=null,h=3,m=!1,v=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(U){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=U)r(c),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(c)}}function C(U){if(x=!1,E(U),!v)if(n(u)!==null)v=!0,z(T);else{var H=n(c);H!==null&&X(C,H.startTime-U)}}function T(U,H){v=!1,x&&(x=!1,y(M),M=-1),m=!0;var N=h;try{for(E(H),p=n(u);p!==null&&(!(p.expirationTime>H)||U&&!F());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,h=p.priorityLevel;var ne=Z(p.expirationTime<=H);H=e.unstable_now(),typeof ne=="function"?p.callback=ne:p===n(u)&&r(u),E(H)}else r(u);p=n(u)}if(p!==null)var R=!0;else{var ee=n(c);ee!==null&&X(C,ee.startTime-H),R=!1}return R}finally{p=null,h=N,m=!1}}var I=!1,O=null,M=-1,j=5,V=-1;function F(){return!(e.unstable_now()-VU||125Z?(U.sortIndex=N,t(c,U),n(u)===null&&U===n(c)&&(x?(y(M),M=-1):x=!0,X(C,N-Z))):(U.sortIndex=ne,t(u,U),v||m||(v=!0,z(T))),U},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(U){var H=h;return function(){var N=h;h=H;try{return U.apply(this,arguments)}finally{h=N}}}})(MN);PN.exports=MN;var p6=PN.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var h6=A,Br=p6;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q0=Object.prototype.hasOwnProperty,m6=/^[: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]*$/,gC={},yC={};function g6(e){return Q0.call(yC,e)?!0:Q0.call(gC,e)?!1:m6.test(e)?yC[e]=!0:(gC[e]=!0,!1)}function y6(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function v6(e,t,n,r){if(t===null||typeof t>"u"||y6(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var En={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){En[e]=new Zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];En[t]=new Zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){En[e]=new Zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){En[e]=new Zn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){En[e]=new Zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){En[e]=new Zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){En[e]=new Zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){En[e]=new Zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){En[e]=new Zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Z_=/[\-:]([a-z])/g;function J_(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Z_,J_);En[t]=new Zn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Z_,J_);En[t]=new Zn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Z_,J_);En[t]=new Zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){En[e]=new Zn(e,1,!1,e.toLowerCase(),null,!1,!1)});En.xlinkHref=new Zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){En[e]=new Zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ew(e,t,n,r){var i=En.hasOwnProperty(t)?En[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var u=` +`+i[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{xv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pc(e):""}function x6(e){switch(e.tag){case 5:return Pc(e.type);case 16:return Pc("Lazy");case 13:return Pc("Suspense");case 19:return Pc("SuspenseList");case 0:case 2:case 15:return e=_v(e.type,!1),e;case 11:return e=_v(e.type.render,!1),e;case 1:return e=_v(e.type,!0),e;default:return""}}function tx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tl:return"Fragment";case Al:return"Portal";case Z0:return"Profiler";case tw:return"StrictMode";case J0:return"Suspense";case ex:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case BN:return(e.displayName||"Context")+".Consumer";case FN:return(e._context.displayName||"Context")+".Provider";case nw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rw:return t=e.displayName||null,t!==null?t:tx(e.type)||"Memo";case Xo:t=e._payload,e=e._init;try{return tx(e(t))}catch{}}return null}function _6(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tx(t);case 8:return t===tw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function w6(e){var t=zN(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dp(e){e._valueTracker||(e._valueTracker=w6(e))}function jN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zN(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nx(e,t){var n=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xC(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ss(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function VN(e,t){t=t.checked,t!=null&&ew(e,"checked",t,!1)}function rx(e,t){VN(e,t);var n=Ss(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ix(e,t.type,n):t.hasOwnProperty("defaultValue")&&ix(e,t.type,Ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _C(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ix(e,t,n){(t!=="number"||Ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mc=Array.isArray;function jl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=pp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function df(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},b6=["Webkit","ms","Moz","O"];Object.keys(qc).forEach(function(e){b6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qc[t]=qc[e]})});function KN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qc.hasOwnProperty(e)&&qc[e]?(""+t).trim():t+"px"}function qN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=KN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var E6=Mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ax(e,t){if(t){if(E6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function lx(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ux=null;function iw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cx=null,Vl=null,Ul=null;function EC(e){if(e=Qf(e)){if(typeof cx!="function")throw Error(me(280));var t=e.stateNode;t&&(t=$m(t),cx(e.stateNode,e.type,t))}}function YN(e){Vl?Ul?Ul.push(e):Ul=[e]:Vl=e}function XN(){if(Vl){var e=Vl,t=Ul;if(Ul=Vl=null,EC(e),t)for(e=0;e>>=0,e===0?32:31-(L6(e)/P6|0)|0}var hp=64,mp=4194304;function $c(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=$c(a):(o&=s,o!==0&&(r=$c(o)))}else s=n&~i,s!==0?r=$c(s):o!==0&&(r=$c(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ri(t),e[t]=n}function B6(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Xc),RC=" ",DC=!1;function g2(e,t){switch(e){case"keyup":return p8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function m8(e,t){switch(e){case"compositionend":return y2(t);case"keypress":return t.which!==32?null:(DC=!0,RC);case"textInput":return e=t.data,e===RC&&DC?null:e;default:return null}}function g8(e,t){if(kl)return e==="compositionend"||!dw&&g2(e,t)?(e=h2(),rh=uw=ss=null,kl=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$C(n)}}function w2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?w2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b2(){for(var e=window,t=Ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ch(e.document)}return t}function pw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function C8(e){var t=b2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&w2(n.ownerDocument.documentElement,n)){if(r!==null&&pw(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=FC(n,o);var s=FC(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Nl=null,gx=null,Zc=null,yx=!1;function BC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yx||Nl==null||Nl!==Ch(r)||(r=Nl,"selectionStart"in r&&pw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zc&&vf(Zc,r)||(Zc=r,r=Rh(gx,"onSelect"),0Dl||(e.current=Ex[Dl],Ex[Dl]=null,Dl--)}function Et(e,t){Dl++,Ex[Dl]=e.current,e.current=t}var Cs={},On=Os(Cs),yr=Os(!1),ba=Cs;function ru(e,t){var n=e.type.contextTypes;if(!n)return Cs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vr(e){return e=e.childContextTypes,e!=null}function Lh(){Tt(yr),Tt(On)}function GC(e,t,n){if(On.current!==Cs)throw Error(me(168));Et(On,t),Et(yr,n)}function O2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(me(108,_6(e)||"Unknown",i));return Mt({},n,r)}function Ph(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cs,ba=On.current,Et(On,e),Et(yr,yr.current),!0}function KC(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=O2(e,t,ba),r.__reactInternalMemoizedMergedChildContext=e,Tt(yr),Tt(On),Et(On,e)):Tt(yr),Et(yr,n)}var ho=null,Fm=!1,Lv=!1;function R2(e){ho===null?ho=[e]:ho.push(e)}function $8(e){Fm=!0,R2(e)}function Rs(){if(!Lv&&ho!==null){Lv=!0;var e=0,t=mt;try{var n=ho;for(mt=1;e>=s,i-=s,yo=1<<32-Ri(t)+i|n<M?(j=O,O=null):j=O.sibling;var V=h(y,O,E[M],C);if(V===null){O===null&&(O=j);break}e&&O&&V.alternate===null&&t(y,O),_=o(V,_,M),I===null?T=V:I.sibling=V,I=V,O=j}if(M===E.length)return n(y,O),Nt&&Zs(y,M),T;if(O===null){for(;MM?(j=O,O=null):j=O.sibling;var F=h(y,O,V.value,C);if(F===null){O===null&&(O=j);break}e&&O&&F.alternate===null&&t(y,O),_=o(F,_,M),I===null?T=F:I.sibling=F,I=F,O=j}if(V.done)return n(y,O),Nt&&Zs(y,M),T;if(O===null){for(;!V.done;M++,V=E.next())V=p(y,V.value,C),V!==null&&(_=o(V,_,M),I===null?T=V:I.sibling=V,I=V);return Nt&&Zs(y,M),T}for(O=r(y,O);!V.done;M++,V=E.next())V=m(O,y,M,V.value,C),V!==null&&(e&&V.alternate!==null&&O.delete(V.key===null?M:V.key),_=o(V,_,M),I===null?T=V:I.sibling=V,I=V);return e&&O.forEach(function(W){return t(y,W)}),Nt&&Zs(y,M),T}function b(y,_,E,C){if(typeof E=="object"&&E!==null&&E.type===Tl&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case fp:e:{for(var T=E.key,I=_;I!==null;){if(I.key===T){if(T=E.type,T===Tl){if(I.tag===7){n(y,I.sibling),_=i(I,E.props.children),_.return=y,y=_;break e}}else if(I.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Xo&&XC(T)===I.type){n(y,I.sibling),_=i(I,E.props),_.ref=mc(y,I,E),_.return=y,y=_;break e}n(y,I);break}else t(y,I);I=I.sibling}E.type===Tl?(_=ma(E.props.children,y.mode,C,E.key),_.return=y,y=_):(C=fh(E.type,E.key,E.props,null,y.mode,C),C.ref=mc(y,_,E),C.return=y,y=C)}return s(y);case Al:e:{for(I=E.key;_!==null;){if(_.key===I)if(_.tag===4&&_.stateNode.containerInfo===E.containerInfo&&_.stateNode.implementation===E.implementation){n(y,_.sibling),_=i(_,E.children||[]),_.return=y,y=_;break e}else{n(y,_);break}else t(y,_);_=_.sibling}_=jv(E,y.mode,C),_.return=y,y=_}return s(y);case Xo:return I=E._init,b(y,_,I(E._payload),C)}if(Mc(E))return v(y,_,E,C);if(cc(E))return x(y,_,E,C);bp(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,_!==null&&_.tag===6?(n(y,_.sibling),_=i(_,E),_.return=y,y=_):(n(y,_),_=zv(E,y.mode,C),_.return=y,y=_),s(y)):n(y,_)}return b}var ou=M2(!0),$2=M2(!1),Fh=Os(null),Bh=null,Ml=null,yw=null;function vw(){yw=Ml=Bh=null}function xw(e){var t=Fh.current;Tt(Fh),e._currentValue=t}function Ix(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Gl(e,t){Bh=e,yw=Ml=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mr=!0),e.firstContext=null)}function hi(e){var t=e._currentValue;if(yw!==e)if(e={context:e,memoizedValue:t,next:null},Ml===null){if(Bh===null)throw Error(me(308));Ml=e,Bh.dependencies={lanes:0,firstContext:e}}else Ml=Ml.next=e;return t}var sa=null;function _w(e){sa===null?sa=[e]:sa.push(e)}function F2(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_w(t)):(n.next=i.next,i.next=n),t.interleaved=n,Io(e,r)}function Io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qo=!1;function ww(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function _o(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ms(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ot&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Io(e,n)}return i=r.interleaved,i===null?(t.next=t,_w(r)):(t.next=i.next,i.next=t),r.interleaved=t,Io(e,n)}function oh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sw(e,n)}}function QC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hh(e,t,n,r){var i=e.updateQueue;Qo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,s===null?o=c:s.next=c,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=u))}if(o!==null){var p=i.baseState;s=0,d=c=u=null,a=o;do{var h=a.lane,m=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,x=a;switch(h=t,m=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=Mt({},p,h);break e;case 2:Qo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,u=p):d=d.next=m,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(u=p),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ca|=s,e.lanes=s,e.memoizedState=p}}function ZC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Mv.transition;Mv.transition={};try{e(!1),t()}finally{mt=n,Mv.transition=r}}function nO(){return mi().memoizedState}function z8(e,t,n){var r=ys(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rO(e))iO(t,n);else if(n=F2(e,t,n,r),n!==null){var i=Gn();Di(n,e,r,i),oO(n,t,r)}}function j8(e,t,n){var r=ys(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rO(e))iO(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Mi(a,s)){var u=t.interleaved;u===null?(i.next=i,_w(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=F2(e,t,i,r),n!==null&&(i=Gn(),Di(n,e,r,i),oO(n,t,r))}}function rO(e){var t=e.alternate;return e===Pt||t!==null&&t===Pt}function iO(e,t){Jc=jh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sw(e,n)}}var Vh={readContext:hi,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useInsertionEffect:An,useLayoutEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useMutableSource:An,useSyncExternalStore:An,useId:An,unstable_isNewReconciler:!1},V8={readContext:hi,useCallback:function(e,t){return Ui().memoizedState=[e,t===void 0?null:t],e},useContext:hi,useEffect:eI,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ah(4194308,4,Q2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ah(4194308,4,e,t)},useInsertionEffect:function(e,t){return ah(4,2,e,t)},useMemo:function(e,t){var n=Ui();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ui();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=z8.bind(null,Pt,e),[r.memoizedState,e]},useRef:function(e){var t=Ui();return e={current:e},t.memoizedState=e},useState:JC,useDebugValue:kw,useDeferredValue:function(e){return Ui().memoizedState=e},useTransition:function(){var e=JC(!1),t=e[0];return e=H8.bind(null,e[1]),Ui().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pt,i=Ui();if(Nt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),cn===null)throw Error(me(349));Sa&30||V2(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,eI(W2.bind(null,r,o,e),[e]),r.flags|=2048,If(9,U2.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ui(),t=cn.identifierPrefix;if(Nt){var n=vo,r=yo;n=(r&~(1<<32-Ri(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ki]=t,e[wf]=r,mO(e,t,!1,!1),t.stateNode=e;e:{switch(s=lx(n,r),n){case"dialog":It("cancel",e),It("close",e),i=r;break;case"iframe":case"object":case"embed":It("load",e),i=r;break;case"video":case"audio":for(i=0;ilu&&(t.flags|=128,r=!0,gc(o,!1),t.lanes=4194304)}else{if(!r)if(e=zh(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Nt)return Tn(t),null}else 2*Kt()-o.renderingStartTime>lu&&n!==1073741824&&(t.flags|=128,r=!0,gc(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Kt(),t.sibling=null,n=Lt.current,Et(Lt,r?n&1|2:n&1),t):(Tn(t),null);case 22:case 23:return Pw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Or&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function Q8(e,t){switch(mw(t),t.tag){case 1:return vr(t.type)&&Lh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return su(),Tt(yr),Tt(On),Sw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ew(t),null;case 13:if(Tt(Lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Tt(Lt),null;case 4:return su(),null;case 10:return xw(t.type._context),null;case 22:case 23:return Pw(),null;case 24:return null;default:return null}}var Sp=!1,Nn=!1,Z8=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function $l(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ht(e,t,r)}else n.current=null}function Px(e,t,n){try{n()}catch(r){Ht(e,t,r)}}var fI=!1;function J8(e,t){if(vx=Nh,e=b2(),pw(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,c=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(a=s+i),p!==o||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++c===i&&(a=s),h===o&&++d===r&&(u=s),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(xx={focusedElem:e,selectionRange:n},Nh=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){t=Ee;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,b=v.memoizedState,y=t.stateNode,_=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ii(t.type,x),b);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(C){Ht(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Ee=e;break}Ee=t.return}return v=fI,fI=!1,v}function ef(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Px(t,n,o)}i=i.next}while(i!==r)}}function zm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mx(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vO(e){var t=e.alternate;t!==null&&(e.alternate=null,vO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ki],delete t[wf],delete t[bx],delete t[P8],delete t[M8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xO(e){return e.tag===5||e.tag===3||e.tag===4}function dI(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $x(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dh));else if(r!==4&&(e=e.child,e!==null))for($x(e,t,n),e=e.sibling;e!==null;)$x(e,t,n),e=e.sibling}function Fx(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fx(e,t,n),e=e.sibling;e!==null;)Fx(e,t,n),e=e.sibling}var xn=null,Ai=!1;function Go(e,t,n){for(n=n.child;n!==null;)_O(e,t,n),n=n.sibling}function _O(e,t,n){if(Yi&&typeof Yi.onCommitFiberUnmount=="function")try{Yi.onCommitFiberUnmount(Dm,n)}catch{}switch(n.tag){case 5:Nn||$l(n,t);case 6:var r=xn,i=Ai;xn=null,Go(e,t,n),xn=r,Ai=i,xn!==null&&(Ai?(e=xn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xn.removeChild(n.stateNode));break;case 18:xn!==null&&(Ai?(e=xn,n=n.stateNode,e.nodeType===8?Dv(e.parentNode,n):e.nodeType===1&&Dv(e,n),gf(e)):Dv(xn,n.stateNode));break;case 4:r=xn,i=Ai,xn=n.stateNode.containerInfo,Ai=!0,Go(e,t,n),xn=r,Ai=i;break;case 0:case 11:case 14:case 15:if(!Nn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Px(n,t,s),i=i.next}while(i!==r)}Go(e,t,n);break;case 1:if(!Nn&&($l(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ht(n,t,a)}Go(e,t,n);break;case 21:Go(e,t,n);break;case 22:n.mode&1?(Nn=(r=Nn)||n.memoizedState!==null,Go(e,t,n),Nn=r):Go(e,t,n);break;default:Go(e,t,n)}}function pI(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Z8),t.forEach(function(r){var i=l9.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ci(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*t9(r/1960))-r,10e?16:e,as===null)var r=!1;else{if(e=as,as=null,Gh=0,ot&6)throw Error(me(331));var i=ot;for(ot|=4,Ee=e.current;Ee!==null;){var o=Ee,s=o.child;if(Ee.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uKt()-Dw?ha(e,0):Rw|=n),xr(e,t)}function TO(e,t){t===0&&(e.mode&1?(t=mp,mp<<=1,!(mp&130023424)&&(mp=4194304)):t=1);var n=Gn();e=Io(e,t),e!==null&&(Yf(e,t,n),xr(e,n))}function a9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),TO(e,n)}function l9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),TO(e,n)}var kO;kO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||yr.current)mr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return mr=!1,Y8(e,t,n);mr=!!(e.flags&131072)}else mr=!1,Nt&&t.flags&1048576&&D2(t,$h,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lh(e,t),e=t.pendingProps;var i=ru(t,On.current);Gl(t,n),i=Iw(null,t,r,e,i,n);var o=Aw();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vr(r)?(o=!0,Ph(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ww(t),i.updater=Hm,t.stateNode=i,i._reactInternals=t,Tx(t,r,e,n),t=Ox(null,t,r,!0,o,n)):(t.tag=0,Nt&&o&&hw(t),Un(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lh(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=c9(r),e=Ii(r,e),i){case 0:t=Nx(null,t,r,e,n);break e;case 1:t=lI(null,t,r,e,n);break e;case 11:t=sI(null,t,r,e,n);break e;case 14:t=aI(null,t,r,Ii(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ii(r,i),Nx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ii(r,i),lI(e,t,r,i,n);case 3:e:{if(dO(t),e===null)throw Error(me(387));r=t.pendingProps,o=t.memoizedState,i=o.element,B2(e,t),Hh(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=au(Error(me(423)),t),t=uI(e,t,r,n,i);break e}else if(r!==i){i=au(Error(me(424)),t),t=uI(e,t,r,n,i);break e}else for(Dr=hs(t.stateNode.containerInfo.firstChild),Mr=t,Nt=!0,Ti=null,n=$2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(iu(),r===i){t=Ao(e,t,n);break e}Un(e,t,r,n)}t=t.child}return t;case 5:return H2(t),e===null&&Cx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,_x(r,i)?s=null:o!==null&&_x(r,o)&&(t.flags|=32),fO(e,t),Un(e,t,s,n),t.child;case 6:return e===null&&Cx(t),null;case 13:return pO(e,t,n);case 4:return bw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ou(t,null,r,n):Un(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ii(r,i),sI(e,t,r,i,n);case 7:return Un(e,t,t.pendingProps,n),t.child;case 8:return Un(e,t,t.pendingProps.children,n),t.child;case 12:return Un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Et(Fh,r._currentValue),r._currentValue=s,o!==null)if(Mi(o.value,s)){if(o.children===i.children&&!yr.current){t=Ao(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=_o(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ix(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(me(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ix(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Un(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Gl(t,n),i=hi(i),r=r(i),t.flags|=1,Un(e,t,r,n),t.child;case 14:return r=t.type,i=Ii(r,t.pendingProps),i=Ii(r.type,i),aI(e,t,r,i,n);case 15:return uO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ii(r,i),lh(e,t),t.tag=1,vr(r)?(e=!0,Ph(t)):e=!1,Gl(t,n),sO(t,r,i),Tx(t,r,i,n),Ox(null,t,r,!0,e,n);case 19:return hO(e,t,n);case 22:return cO(e,t,n)}throw Error(me(156,t.tag))};function NO(e,t){return r2(e,t)}function u9(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new u9(e,t,n,r)}function $w(e){return e=e.prototype,!(!e||!e.isReactComponent)}function c9(e){if(typeof e=="function")return $w(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nw)return 11;if(e===rw)return 14}return 2}function vs(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fh(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")$w(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Tl:return ma(n.children,i,o,t);case tw:s=8,i|=8;break;case Z0:return e=li(12,n,t,i|2),e.elementType=Z0,e.lanes=o,e;case J0:return e=li(13,n,t,i),e.elementType=J0,e.lanes=o,e;case ex:return e=li(19,n,t,i),e.elementType=ex,e.lanes=o,e;case HN:return Vm(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FN:s=10;break e;case BN:s=9;break e;case nw:s=11;break e;case rw:s=14;break e;case Xo:s=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=li(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ma(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function Vm(e,t,n,r){return e=li(22,e,r,t),e.elementType=HN,e.lanes=n,e.stateNode={isHidden:!1},e}function zv(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function jv(e,t,n){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function f9(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bv(0),this.expirationTimes=bv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bv(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Fw(e,t,n,r,i,o,s,a,u){return e=new f9(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=li(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ww(o),e}function d9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(LO)}catch(e){console.error(e)}}LO(),LN.exports=Ur;var qm=LN.exports;const la=ks(qm);var PO,wI=qm;PO=wI.createRoot,wI.hydrateRoot;var MO={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s{o!=null&&(typeof o=="object"?t.forEach(s=>{const a=o[s];if(a!=null){const u=s!==n?`-${s}`:"";r.push(`${i}${u}-${a}`)}}):r.push(`${i}-${o}`))}),r}const $a=A.forwardRef(({as:e="div",bsPrefix:t,className:n,direction:r,gap:i,...o},s)=>{t=Fe(t,r==="horizontal"?"hstack":"vstack");const a=jw(),u=Vw();return S.jsx(e,{...o,ref:s,className:Te(n,t,...E9({gap:i},a,u))})});$a.displayName="Stack";const{createElement:uu,createContext:S9,createRef:$he,forwardRef:VO,useCallback:lr,useContext:UO,useEffect:ga,useImperativeHandle:WO,useLayoutEffect:C9,useMemo:I9,useRef:cr,useState:ql}=Sh,bI=Sh[`useId${Math.random()}`.slice(0,5)],A9=C9,Xm=S9(null);Xm.displayName="PanelGroupContext";const ya=A9,T9=typeof bI=="function"?bI:()=>null;let k9=0;function Uw(e=null){const t=T9(),n=cr(e||t||null);return n.current===null&&(n.current=""+k9++),e??n.current}function GO({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:u,onCollapse:c,onExpand:d,onResize:p,order:h,style:m,tagName:v="div",...x}){const b=UO(Xm);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:_,getPanelSize:E,getPanelStyle:C,groupId:T,isPanelCollapsed:I,reevaluatePanelConstraints:O,registerPanel:M,resizePanel:j,unregisterPanel:V}=b,F=Uw(s),W=cr({callbacks:{onCollapse:c,onExpand:d,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:u},id:F,idIsFromProps:s!==void 0,order:h});cr({didLogMissingDefaultSizeWarning:!1}),ya(()=>{const{callbacks:L,constraints:B}=W.current,z={...B};W.current.id=F,W.current.idIsFromProps=s!==void 0,W.current.order=h,L.onCollapse=c,L.onExpand=d,L.onResize=p,B.collapsedSize=n,B.collapsible=r,B.defaultSize=i,B.maxSize=a,B.minSize=u,(z.collapsedSize!==B.collapsedSize||z.collapsible!==B.collapsible||z.maxSize!==B.maxSize||z.minSize!==B.minSize)&&O(W.current,z)}),ya(()=>{const L=W.current;return M(L),()=>{V(L)}},[h,F,M,V]),WO(o,()=>({collapse:()=>{y(W.current)},expand:L=>{_(W.current,L)},getId(){return F},getSize(){return E(W.current)},isCollapsed(){return I(W.current)},isExpanded(){return!I(W.current)},resize:L=>{j(W.current,L)}}),[y,_,E,I,F,j]);const Y=C(W.current,i);return uu(v,{...x,children:e,className:t,id:s,style:{...Y,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":T,"data-panel-id":F,"data-panel-size":parseFloat(""+Y.flexGrow).toFixed(1)})}const Bc=VO((e,t)=>uu(GO,{...e,forwardedRef:t}));GO.displayName="Panel";Bc.displayName="forwardRef(Panel)";let Vx=null,ua=null;function N9(e,t){if(t){const n=(t&QO)!==0,r=(t&ZO)!==0,i=(t&JO)!==0,o=(t&eR)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function O9(){ua!==null&&(document.head.removeChild(ua),Vx=null,ua=null)}function Vv(e,t){const n=N9(e,t);Vx!==n&&(Vx=n,ua===null&&(ua=document.createElement("style"),document.head.appendChild(ua)),ua.innerHTML=`*{cursor: ${n}!important;}`)}function KO(e){return e.type==="keydown"}function qO(e){return e.type.startsWith("pointer")}function YO(e){return e.type.startsWith("mouse")}function Qm(e){if(qO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(YO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function R9(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function D9(e,t,n){return e.xt.x&&e.yt.y}function L9(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:CI(e),b:CI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ye(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:SI(EI(n.a)),b:SI(EI(n.b))};if(i.a===i.b){const o=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=o.length;for(;a--;){const u=o[a];if(u===s.a)return 1;if(u===s.b)return-1}}return Math.sign(i.a-i.b)}const P9=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function M9(e){var t;const n=getComputedStyle((t=XO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function $9(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||M9(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||P9.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function EI(e){let t=e.length;for(;t--;){const n=e[t];if(Ye(n,"Missing node"),$9(n))return n}return null}function SI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function CI(e){const t=[];for(;e;)t.push(e),e=XO(e);return t}function XO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const QO=1,ZO=2,JO=4,eR=8,F9=R9()==="coarse";let Li=[],Yl=!1,is=new Map,Zm=new Map;const Tf=new Set;function B9(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},u=(o=is.get(s))!==null&&o!==void 0?o:0;return is.set(s,u+1),Tf.add(a),Yh(),function(){var d;Zm.delete(e),Tf.delete(a);const p=(d=is.get(s))!==null&&d!==void 0?d:1;if(is.set(s,p-1),Yh(),p===1&&is.delete(s),Li.includes(a)){const h=Li.indexOf(a);h>=0&&Li.splice(h,1),Gw(),i("up",!0,null)}}}function II(e){const{target:t}=e,{x:n,y:r}=Qm(e);Yl=!0,Ww({target:t,x:n,y:r}),Yh(),Li.length>0&&(Xh("down",e),e.preventDefault(),e.stopPropagation())}function vc(e){const{x:t,y:n}=Qm(e);if(Yl&&e.buttons===0&&(Yl=!1,Xh("up",e)),!Yl){const{target:r}=e;Ww({target:r,x:t,y:n})}Xh("move",e),Gw(),Li.length>0&&e.preventDefault()}function fl(e){const{target:t}=e,{x:n,y:r}=Qm(e);Zm.clear(),Yl=!1,Li.length>0&&e.preventDefault(),Xh("up",e),Ww({target:t,x:n,y:r}),Gw(),Yh()}function Ww({target:e,x:t,y:n}){Li.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Tf.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:u,left:c,right:d,top:p}=a,h=F9?s.coarse:s.fine;if(t>=c-h&&t<=d+h&&n>=p-h&&n<=u+h){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&L9(r,o)>0){let v=r,x=!1;for(;v&&!v.contains(o);){if(D9(v.getBoundingClientRect(),a)){x=!0;break}v=v.parentElement}if(x)return}Li.push(i)}})}function Uv(e,t){Zm.set(e,t)}function Gw(){let e=!1,t=!1;Li.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;Zm.forEach(r=>{n|=r}),e&&t?Vv("intersection",n):e?Vv("horizontal",n):t?Vv("vertical",n):O9()}function Yh(){is.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",fl),n.removeEventListener("pointerdown",II),n.removeEventListener("pointerleave",vc),n.removeEventListener("pointermove",vc)}),window.removeEventListener("pointerup",fl),window.removeEventListener("pointercancel",fl),Tf.size>0&&(Yl?(Li.length>0&&is.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",fl),n.addEventListener("pointerleave",vc),n.addEventListener("pointermove",vc))}),window.addEventListener("pointerup",fl),window.addEventListener("pointercancel",fl)):is.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",II,{capture:!0}),n.addEventListener("pointermove",vc))}))}function Xh(e,t){Tf.forEach(n=>{const{setResizeHandlerState:r}=n,i=Li.includes(n);r(e,i,t)})}function H9(){const[e,t]=ql(0);return lr(()=>t(n=>n+1),[])}function Ye(e,t){if(!e)throw console.error(t),Error(t)}const Kw=10;function Aa(e,t,n=Kw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function mo(e,t,n=Kw){return Aa(e,t,n)===0}function Rr(e,t,n){return Aa(e,t,n)===0}function z9(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-y:y)}}}{const p=e<0?a:u,h=n[p];Ye(h,`No panel constraints found for index ${p}`);const{collapsedSize:m=0,collapsible:v,minSize:x=0}=h;if(v){const b=t[p];if(Ye(b!=null,`Previous layout not found for panel index ${p}`),Rr(b,x)){const y=b-m;Aa(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const p=e<0?1:-1;let h=e<0?u:a,m=0;for(;;){const x=t[h];Ye(x!=null,`Previous layout not found for panel index ${h}`);const y=Bl({panelConstraints:n,panelIndex:h,size:100})-x;if(m+=y,h+=p,h<0||h>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-v:v}{let h=e<0?a:u;for(;h>=0&&h=0))break;e<0?h--:h++}}if(z9(i,s))return i;{const p=e<0?u:a,h=t[p];Ye(h!=null,`Previous layout not found for panel index ${p}`);const m=h+c,v=Bl({panelConstraints:n,panelIndex:p,size:m});if(s[p]=v,!Rr(v,m)){let x=m-v,y=e<0?u:a;for(;y>=0&&y0?y--:y++}}}const d=s.reduce((p,h)=>h+p,0);return Rr(d,100)?s:i}function j9({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];Ye(a!=null,"No pivot index found"),t.forEach((p,h)=>{const{constraints:m}=p,{maxSize:v=100,minSize:x=0}=m;h===a?(r=x,i=v):(o+=x,s+=v)});const u=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:u,valueMin:c,valueNow:d}}function kf(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function tR(e,t,n=document){const i=kf(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function nR(e,t,n){const r=tR(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function rR(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Jm(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function V9(e,t,n,r=document){var i,o,s,a;const u=Jm(t,r),c=kf(e,r),d=u?c.indexOf(u):-1,p=(i=(o=n[d])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,h=(s=(a=n[d+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[p,h]}function U9({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){cr({didWarnAboutMissingResizeHandle:!1}),ya(()=>{if(!o)return;const a=kf(n,o);for(let u=0;u{a.forEach((u,c)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,i,o]),ga(()=>{if(!o)return;const a=t.current;Ye(a,"Eager values not found");const{panelDataArray:u}=a,c=rR(n,o);Ye(c!=null,`No group found for id "${n}"`);const d=kf(n,o);Ye(d,`No resize handles found for group id "${n}"`);const p=d.map(h=>{const m=h.getAttribute("data-panel-resize-handle-id");Ye(m,"Resize handle element has no handle id attribute");const[v,x]=V9(n,m,u,o);if(v==null||x==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const _=u.findIndex(E=>E.id===v);if(_>=0){const E=u[_];Ye(E,`No panel data found for index ${_}`);const C=r[_],{collapsedSize:T=0,collapsible:I,minSize:O=0}=E.constraints;if(C!=null&&I){const M=Hc({delta:Rr(C,T)?O-T:T-C,initialLayout:r,panelConstraints:u.map(j=>j.constraints),pivotIndices:nR(n,m,o),prevLayout:r,trigger:"keyboard"});r!==M&&s(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{p.forEach(h=>h())}},[o,e,t,n,r,i,s])}function AI(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,i=100;for(let o=0;o{const o=e[i];Ye(o,`Panel data not found for index ${i}`);const{callbacks:s,constraints:a,id:u}=o,{collapsedSize:c=0,collapsible:d}=a,p=n[u];if(p==null||r!==p){n[u]=r;const{onCollapse:h,onExpand:m,onResize:v}=s;v&&v(r,p),d&&(h||m)&&(m&&(p==null||mo(p,c))&&!mo(r,c)&&m(),h&&(p==null||!mo(p,c))&&mo(r,c)&&h())}})}function Ap(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function TI(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function oR(e){return`react-resizable-panels:${e}`}function sR(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function aR(e,t){try{const n=oR(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function X9(e,t,n){var r,i;const o=(r=aR(e,n))!==null&&r!==void 0?r:{},s=sR(t);return(i=o[s])!==null&&i!==void 0?i:null}function Q9(e,t,n,r,i){var o;const s=oR(e),a=sR(t),u=(o=aR(e,i))!==null&&o!==void 0?o:{};u[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(u))}catch(c){console.error(c)}}function kI({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Rr(r,100)&&n.length>0)for(let o=0;o(TI(zc),zc.getItem(e)),setItem:(e,t)=>{TI(zc),zc.setItem(e,t)}},NI={};function lR({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:u=zc,style:c,tagName:d="div",...p}){const h=Uw(o),m=cr(null),[v,x]=ql(null),[b,y]=ql([]),_=H9(),E=cr({}),C=cr(new Map),T=cr(0),I=cr({autoSaveId:e,direction:r,dragState:v,id:h,keyboardResizeBy:a,onLayout:s,storage:u}),O=cr({layout:b,panelDataArray:[],panelDataArrayChanged:!1});cr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),WO(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:R}=O.current;return R},setLayout:R=>{const{onLayout:ee}=I.current,{layout:ie,panelDataArray:se}=O.current,pe=kI({layout:R,panelConstraints:se.map(ye=>ye.constraints)});AI(ie,pe)||(y(pe),O.current.layout=pe,ee&&ee(pe),dl(se,pe,E.current))}}),[]),ya(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=v,I.current.id=h,I.current.onLayout=s,I.current.storage=u}),U9({committedValuesRef:I,eagerValuesRef:O,groupId:h,layout:b,panelDataArray:O.current.panelDataArray,setLayout:y,panelGroupElement:m.current}),ga(()=>{const{panelDataArray:R}=O.current;if(e){if(b.length===0||b.length!==R.length)return;let ee=NI[e];ee==null&&(ee=Y9(Q9,Z9),NI[e]=ee);const ie=[...R],se=new Map(C.current);ee(e,ie,se,b,u)}},[e,b,u]),ga(()=>{});const M=lr(R=>{const{onLayout:ee}=I.current,{layout:ie,panelDataArray:se}=O.current;if(R.constraints.collapsible){const pe=se.map(Ve=>Ve.constraints),{collapsedSize:ye=0,panelSize:_e,pivotIndices:Se}=Xs(se,R,ie);if(Ye(_e!=null,`Panel size not found for panel "${R.id}"`),!mo(_e,ye)){C.current.set(R.id,_e);const Oe=bl(se,R)===se.length-1?_e-ye:ye-_e,Re=Hc({delta:Oe,initialLayout:ie,panelConstraints:pe,pivotIndices:Se,prevLayout:ie,trigger:"imperative-api"});Ap(ie,Re)||(y(Re),O.current.layout=Re,ee&&ee(Re),dl(se,Re,E.current))}}},[]),j=lr((R,ee)=>{const{onLayout:ie}=I.current,{layout:se,panelDataArray:pe}=O.current;if(R.constraints.collapsible){const ye=pe.map(Be=>Be.constraints),{collapsedSize:_e=0,panelSize:Se=0,minSize:Ve=0,pivotIndices:Oe}=Xs(pe,R,se),Re=ee??Ve;if(mo(Se,_e)){const Be=C.current.get(R.id),Ie=Be!=null&&Be>=Re?Be:Re,Le=bl(pe,R)===pe.length-1?Se-Ie:Ie-Se,we=Hc({delta:Le,initialLayout:se,panelConstraints:ye,pivotIndices:Oe,prevLayout:se,trigger:"imperative-api"});Ap(se,we)||(y(we),O.current.layout=we,ie&&ie(we),dl(pe,we,E.current))}}},[]),V=lr(R=>{const{layout:ee,panelDataArray:ie}=O.current,{panelSize:se}=Xs(ie,R,ee);return Ye(se!=null,`Panel size not found for panel "${R.id}"`),se},[]),F=lr((R,ee)=>{const{panelDataArray:ie}=O.current,se=bl(ie,R);return q9({defaultSize:ee,dragState:v,layout:b,panelData:ie,panelIndex:se})},[v,b]),W=lr(R=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:se=0,collapsible:pe,panelSize:ye}=Xs(ie,R,ee);return Ye(ye!=null,`Panel size not found for panel "${R.id}"`),pe===!0&&mo(ye,se)},[]),Y=lr(R=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:se=0,collapsible:pe,panelSize:ye}=Xs(ie,R,ee);return Ye(ye!=null,`Panel size not found for panel "${R.id}"`),!pe||Aa(ye,se)>0},[]),L=lr(R=>{const{panelDataArray:ee}=O.current;ee.push(R),ee.sort((ie,se)=>{const pe=ie.order,ye=se.order;return pe==null&&ye==null?0:pe==null?-1:ye==null?1:pe-ye}),O.current.panelDataArrayChanged=!0,_()},[_]);ya(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:ee,storage:ie}=I.current,{layout:se,panelDataArray:pe}=O.current;let ye=null;if(R){const Se=X9(R,pe,ie);Se&&(C.current=new Map(Object.entries(Se.expandToSizes)),ye=Se.layout)}ye==null&&(ye=K9({panelDataArray:pe}));const _e=kI({layout:ye,panelConstraints:pe.map(Se=>Se.constraints)});AI(se,_e)||(y(_e),O.current.layout=_e,ee&&ee(_e),dl(pe,_e,E.current))}}),ya(()=>{const R=O.current;return()=>{R.layout=[]}},[]);const B=lr(R=>function(ie){ie.preventDefault();const se=m.current;if(!se)return()=>null;const{direction:pe,dragState:ye,id:_e,keyboardResizeBy:Se,onLayout:Ve}=I.current,{layout:Oe,panelDataArray:Re}=O.current,{initialLayout:Be}=ye??{},Ie=nR(_e,R,se);let rt=G9(ie,R,pe,ye,Se,se);const Le=pe==="horizontal";document.dir==="rtl"&&Le&&(rt=-rt);const we=Re.map(vt=>vt.constraints),yt=Hc({delta:rt,initialLayout:Be??Oe,panelConstraints:we,pivotIndices:Ie,prevLayout:Oe,trigger:KO(ie)?"keyboard":"mouse-or-touch"}),pt=!Ap(Oe,yt);(qO(ie)||YO(ie))&&T.current!=rt&&(T.current=rt,!pt&&rt!==0?Le?Uv(R,rt<0?QO:ZO):Uv(R,rt<0?JO:eR):Uv(R,0)),pt&&(y(yt),O.current.layout=yt,Ve&&Ve(yt),dl(Re,yt,E.current))},[]),z=lr((R,ee)=>{const{onLayout:ie}=I.current,{layout:se,panelDataArray:pe}=O.current,ye=pe.map(Be=>Be.constraints),{panelSize:_e,pivotIndices:Se}=Xs(pe,R,se);Ye(_e!=null,`Panel size not found for panel "${R.id}"`);const Oe=bl(pe,R)===pe.length-1?_e-ee:ee-_e,Re=Hc({delta:Oe,initialLayout:se,panelConstraints:ye,pivotIndices:Se,prevLayout:se,trigger:"imperative-api"});Ap(se,Re)||(y(Re),O.current.layout=Re,ie&&ie(Re),dl(pe,Re,E.current))},[]),X=lr((R,ee)=>{const{layout:ie,panelDataArray:se}=O.current,{collapsedSize:pe=0,collapsible:ye}=ee,{collapsedSize:_e=0,collapsible:Se,maxSize:Ve=100,minSize:Oe=0}=R.constraints,{panelSize:Re}=Xs(se,R,ie);Re!=null&&(ye&&Se&&mo(Re,pe)?mo(pe,_e)||z(R,_e):ReVe&&z(R,Ve))},[z]),U=lr((R,ee)=>{const{direction:ie}=I.current,{layout:se}=O.current;if(!m.current)return;const pe=Jm(R,m.current);Ye(pe,`Drag handle element not found for id "${R}"`);const ye=iR(ie,ee);x({dragHandleId:R,dragHandleRect:pe.getBoundingClientRect(),initialCursorPosition:ye,initialLayout:se})},[]),H=lr(()=>{x(null)},[]),N=lr(R=>{const{panelDataArray:ee}=O.current,ie=bl(ee,R);ie>=0&&(ee.splice(ie,1),delete E.current[R.id],O.current.panelDataArrayChanged=!0,_())},[_]),Z=I9(()=>({collapsePanel:M,direction:r,dragState:v,expandPanel:j,getPanelSize:V,getPanelStyle:F,groupId:h,isPanelCollapsed:W,isPanelExpanded:Y,reevaluatePanelConstraints:X,registerPanel:L,registerResizeHandle:B,resizePanel:z,startDragging:U,stopDragging:H,unregisterPanel:N,panelGroupElement:m.current}),[M,v,r,j,V,F,h,W,Y,X,L,B,z,U,H,N]),ne={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return uu(Xm.Provider,{value:Z},uu(d,{...p,children:t,className:n,id:o,ref:m,style:{...ne,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const Ux=VO((e,t)=>uu(lR,{...e,forwardedRef:t}));lR.displayName="PanelGroup";Ux.displayName="forwardRef(PanelGroup)";function bl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xs(e,t,n){const r=bl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function J9({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){ga(()=>{if(e||n==null||r==null)return;const i=Jm(t,r);if(i==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=i.getAttribute("data-panel-group-id");Ye(a,`No group element found for id "${a}"`);const u=kf(a,r),c=tR(a,t,r);Ye(c!==null,`No resize element found for id "${t}"`);const d=s.shiftKey?c>0?c-1:u.length-1:c+1{i.removeEventListener("keydown",o)}},[r,e,t,n])}function Wx({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onDragging:s,onFocus:a,style:u={},tabIndex:c=0,tagName:d="div",...p}){var h,m;const v=cr(null),x=cr({onDragging:s});ga(()=>{x.current.onDragging=s});const b=UO(Xm);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:_,registerResizeHandle:E,startDragging:C,stopDragging:T,panelGroupElement:I}=b,O=Uw(i),[M,j]=ql("inactive"),[V,F]=ql(!1),[W,Y]=ql(null),L=cr({state:M});ya(()=>{L.current.state=M}),ga(()=>{if(n)Y(null);else{const U=E(O);Y(()=>U)}},[n,O,E]);const B=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,z=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return ga(()=>{if(n||W==null)return;const U=v.current;return Ye(U,"Element ref not attached"),B9(O,U,y,{coarse:B,fine:z},(N,Z,ne)=>{if(Z)switch(N){case"down":{j("drag"),Ye(ne,'Expected event to be defined for "down" action'),C(O,ne);const{onDragging:R}=x.current;R&&R(!0);break}case"move":{const{state:R}=L.current;R!=="drag"&&j("hover"),Ye(ne,'Expected event to be defined for "move" action'),W(ne);break}case"up":{j("hover"),T();const{onDragging:R}=x.current;R&&R(!1);break}}else j("inactive")})},[B,y,n,z,E,O,W,C,T]),J9({disabled:n,handleId:O,resizeHandler:W,panelGroupElement:I}),uu(d,{...p,children:e,className:t,id:i,onBlur:()=>{F(!1),o==null||o()},onFocus:()=>{F(!0),a==null||a()},ref:v,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...u},tabIndex:c,"data-panel-group-direction":y,"data-panel-group-id":_,"data-resize-handle":"","data-resize-handle-active":M==="drag"?"pointer":V?"keyboard":void 0,"data-resize-handle-state":M,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":O})}Wx.displayName="PanelResizeHandle";function Jn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a7:s7;dR.useSyncExternalStore=cu.useSyncExternalStore!==void 0?cu.useSyncExternalStore:l7;fR.exports=dR;var u7=fR.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var eg=A,c7=u7;function f7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var d7=typeof Object.is=="function"?Object.is:f7,p7=c7.useSyncExternalStore,h7=eg.useRef,m7=eg.useEffect,g7=eg.useMemo,y7=eg.useDebugValue;cR.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=h7(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=g7(function(){function u(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return p=v}return p=m}if(v=p,d7(d,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(d=m,p=x)}var c=!1,d,p,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var a=p7(e,o[0],o[1]);return m7(function(){s.hasValue=!0,s.value=a},[a]),y7(a),a};uR.exports=cR;var v7=uR.exports;const pR=ks(v7),x7={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},OI=e=>{let t;const n=new Set,r=(d,p)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=p??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(v=>v(t,m))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(x7?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,u);return u},hR=e=>e?OI(e):OI,{useDebugValue:_7}=Q,{useSyncExternalStoreWithSelector:w7}=pR,b7=e=>e;function mR(e,t=b7,n){const r=w7(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _7(r),r}const RI=(e,t)=>{const n=hR(e),r=(i,o=t)=>mR(n,i,o);return Object.assign(r,n),r},E7=(e,t)=>e?RI(e,t):RI;function Rn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var S7={value:()=>{}};function tg(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}dh.prototype=tg.prototype={constructor:dh,on:function(e,t){var n=this._,r=C7(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),LI.hasOwnProperty(t)?{space:LI[t],local:e}:e}function A7(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Gx&&t.documentElement.namespaceURI===Gx?t.createElement(e):t.createElementNS(n,e)}}function T7(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gR(e){var t=ng(e);return(t.local?T7:A7)(t)}function k7(){}function qw(e){return e==null?k7:function(){return this.querySelector(e)}}function N7(e){typeof e!="function"&&(e=qw(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=E&&(E=_+1);!(T=b[E])&&++E=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function tV(e){e||(e=nV);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function rV(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iV(){return Array.from(this)}function oV(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?gV:typeof t=="function"?vV:yV)(e,t,n??"")):fu(this.node(),e)}function fu(e,t){return e.style.getPropertyValue(t)||wR(e).getComputedStyle(e,null).getPropertyValue(t)}function _V(e){return function(){delete this[e]}}function wV(e,t){return function(){this[e]=t}}function bV(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function EV(e,t){return arguments.length>1?this.each((t==null?_V:typeof t=="function"?bV:wV)(e,t)):this.node()[e]}function bR(e){return e.trim().split(/^|\s+/)}function Yw(e){return e.classList||new ER(e)}function ER(e){this._node=e,this._names=bR(e.getAttribute("class")||"")}ER.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 SR(e,t){for(var n=Yw(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function QV(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n()=>e;function Kx(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:u,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Kx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aU(e){return!e.ctrlKey&&!e.button}function lU(){return this.parentNode}function uU(e,t){return t??{x:e.x,y:e.y}}function cU(){return navigator.maxTouchPoints||"ontouchstart"in this}function fU(){var e=aU,t=lU,n=uU,r=cU,i={},o=tg("start","drag","end"),s=0,a,u,c,d,p=0;function h(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,sU).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,T){if(!(d||!e.call(this,C,T))){var I=E(this,t.call(this,C,T),C,T,"mouse");I&&(ki(C.view).on("mousemove.drag",v,Nf).on("mouseup.drag",x,Nf),TR(C.view),Gv(C),c=!1,a=C.clientX,u=C.clientY,I("start",C))}}function v(C){if(Xl(C),!c){var T=C.clientX-a,I=C.clientY-u;c=T*T+I*I>p}i.mouse("drag",C)}function x(C){ki(C.view).on("mousemove.drag mouseup.drag",null),kR(C.view,c),Xl(C),i.mouse("end",C)}function b(C,T){if(e.call(this,C,T)){var I=C.changedTouches,O=t.call(this,C,T),M=I.length,j,V;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kp(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=pU.exec(e))?new gr(t[1],t[2],t[3],1):(t=hU.exec(e))?new gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mU.exec(e))?kp(t[1],t[2],t[3],t[4]):(t=gU.exec(e))?kp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yU.exec(e))?zI(t[1],t[2]/100,t[3]/100,1):(t=vU.exec(e))?zI(t[1],t[2]/100,t[3]/100,t[4]):PI.hasOwnProperty(e)?FI(PI[e]):e==="transparent"?new gr(NaN,NaN,NaN,0):null}function FI(e){return new gr(e>>16&255,e>>8&255,e&255,1)}function kp(e,t,n,r){return r<=0&&(e=t=n=NaN),new gr(e,t,n,r)}function wU(e){return e instanceof ed||(e=Df(e)),e?(e=e.rgb(),new gr(e.r,e.g,e.b,e.opacity)):new gr}function qx(e,t,n,r){return arguments.length===1?wU(e):new gr(e,t,n,r??1)}function gr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xw(gr,qx,NR(ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Of:Math.pow(Of,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gr(va(this.r),va(this.g),va(this.b),Jh(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:BI,formatHex:BI,formatHex8:bU,formatRgb:HI,toString:HI}));function BI(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}`}function bU(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}${ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function HI(){const e=Jh(this.opacity);return`${e===1?"rgb(":"rgba("}${va(this.r)}, ${va(this.g)}, ${va(this.b)}${e===1?")":`, ${e})`}`}function Jh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function va(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ca(e){return e=va(e),(e<16?"0":"")+e.toString(16)}function zI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ni(e,t,n,r)}function OR(e){if(e instanceof Ni)return new Ni(e.h,e.s,e.l,e.opacity);if(e instanceof ed||(e=Df(e)),!e)return new Ni;if(e instanceof Ni)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,u=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&u<1?0:s,new Ni(s,a,u,e.opacity)}function EU(e,t,n,r){return arguments.length===1?OR(e):new Ni(e,t,n,r??1)}function Ni(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xw(Ni,EU,NR(ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new Ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Of:Math.pow(Of,e),new Ni(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new gr(Kv(e>=240?e-240:e+120,i,r),Kv(e,i,r),Kv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ni(jI(this.h),Np(this.s),Np(this.l),Jh(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=Jh(this.opacity);return`${e===1?"hsl(":"hsla("}${jI(this.h)}, ${Np(this.s)*100}%, ${Np(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jI(e){return e=(e||0)%360,e<0?e+360:e}function Np(e){return Math.max(0,Math.min(1,e||0))}function Kv(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 RR=e=>()=>e;function SU(e,t){return function(n){return e+n*t}}function CU(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function IU(e){return(e=+e)==1?DR:function(t,n){return n-t?CU(t,n,e):RR(isNaN(t)?n:t)}}function DR(e,t){var n=t-e;return n?SU(e,n):RR(isNaN(e)?t:e)}const VI=function e(t){var n=IU(t);function r(i,o){var s=n((i=qx(i)).r,(o=qx(o)).r),a=n(i.g,o.g),u=n(i.b,o.b),c=DR(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=a(d),i.b=u(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function Zo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Yx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qv=new RegExp(Yx.source,"g");function AU(e){return function(){return e}}function TU(e){return function(t){return e(t)+""}}function kU(e,t){var n=Yx.lastIndex=qv.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Yx.exec(e))&&(i=qv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:Zo(r,i)})),n=qv.lastIndex;return n180?d+=360:d-c>180&&(c+=360),h.push({i:p.push(i(p)+"rotate(",null,r)-2,x:Zo(c,d)})):d&&p.push(i(p)+"rotate("+d+r)}function a(c,d,p,h){c!==d?h.push({i:p.push(i(p)+"skewX(",null,r)-2,x:Zo(c,d)}):d&&p.push(i(p)+"skewX("+d+r)}function u(c,d,p,h,m,v){if(c!==p||d!==h){var x=m.push(i(m)+"scale(",null,",",null,")");v.push({i:x-4,x:Zo(c,p)},{i:x-2,x:Zo(d,h)})}else(p!==1||h!==1)&&m.push(i(m)+"scale("+p+","+h+")")}return function(c,d){var p=[],h=[];return c=e(c),d=e(d),o(c.translateX,c.translateY,d.translateX,d.translateY,p,h),s(c.rotate,d.rotate,p,h),a(c.skewX,d.skewX,p,h),u(c.scaleX,c.scaleY,d.scaleX,d.scaleY,p,h),c=d=null,function(m){for(var v=-1,x=h.length,b;++v=0&&e._call.call(void 0,t),e=e._next;--du}function GI(){Ta=(tm=Lf.now())+rg,du=jc=0;try{BU()}finally{du=0,zU(),Ta=0}}function HU(){var e=Lf.now(),t=e-tm;t>MR&&(rg-=t,tm=e)}function zU(){for(var e,t=em,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:em=n);Vc=e,Qx(r)}function Qx(e){if(!du){jc&&(jc=clearTimeout(jc));var t=e-Ta;t>24?(e<1/0&&(jc=setTimeout(GI,e-Lf.now()-rg)),xc&&(xc=clearInterval(xc))):(xc||(tm=Lf.now(),xc=setInterval(HU,MR)),du=1,$R(GI))}}function KI(e,t,n){var r=new nm;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var jU=tg("start","end","cancel","interrupt"),VU=[],BR=0,qI=1,Zx=2,ph=3,YI=4,Jx=5,hh=6;function ig(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;UU(e,n,{name:t,index:r,group:i,on:jU,tween:VU,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:BR})}function Zw(e,t){var n=$i(e,t);if(n.state>BR)throw new Error("too late; already scheduled");return n}function eo(e,t){var n=$i(e,t);if(n.state>ph)throw new Error("too late; already running");return n}function $i(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function UU(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=FR(o,0,n.time);function o(c){n.state=qI,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,p,h,m;if(n.state!==qI)return u();for(d in r)if(m=r[d],m.name===n.name){if(m.state===ph)return KI(s);m.state===YI?(m.state=hh,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+dZx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function _W(e,t,n){var r,i,o=xW(t)?Zw:eo;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function wW(e,t){var n=this._id;return arguments.length<2?$i(this.node(),n).on.on(e):this.each(_W(n,e,t))}function bW(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function EW(){return this.on("end.remove",bW(this._id))}function SW(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qw(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s()=>e;function YW(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function xo(e,t,n){this.k=e,this.x=t,this.y=n}xo.prototype={constructor:xo,scale:function(e){return e===1?this:new xo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new xo(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 xs=new xo(1,0,0);xo.prototype;function Yv(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}function XW(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function QW(){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 XI(){return this.__zoom||xs}function ZW(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function JW(){return navigator.maxTouchPoints||"ontouchstart"in this}function eG(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function tG(){var e=XW,t=QW,n=eG,r=ZW,i=JW,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=$U,c=tg("start","zoom","end"),d,p,h,m=500,v=150,x=0,b=10;function y(L){L.property("__zoom",XI).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",V).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,B,z,X){var U=L.selection?L.selection():L;U.property("__zoom",XI),L!==U?T(L,B,z,X):U.interrupt().each(function(){I(this,arguments).event(X).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},y.scaleBy=function(L,B,z,X){y.scaleTo(L,function(){var U=this.__zoom.k,H=typeof B=="function"?B.apply(this,arguments):B;return U*H},z,X)},y.scaleTo=function(L,B,z,X){y.transform(L,function(){var U=t.apply(this,arguments),H=this.__zoom,N=z==null?C(U):typeof z=="function"?z.apply(this,arguments):z,Z=H.invert(N),ne=typeof B=="function"?B.apply(this,arguments):B;return n(E(_(H,ne),N,Z),U,s)},z,X)},y.translateBy=function(L,B,z,X){y.transform(L,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),s)},null,X)},y.translateTo=function(L,B,z,X,U){y.transform(L,function(){var H=t.apply(this,arguments),N=this.__zoom,Z=X==null?C(H):typeof X=="function"?X.apply(this,arguments):X;return n(xs.translate(Z[0],Z[1]).scale(N.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof z=="function"?-z.apply(this,arguments):-z),H,s)},X,U)};function _(L,B){return B=Math.max(o[0],Math.min(o[1],B)),B===L.k?L:new xo(B,L.x,L.y)}function E(L,B,z){var X=B[0]-z[0]*L.k,U=B[1]-z[1]*L.k;return X===L.x&&U===L.y?L:new xo(L.k,X,U)}function C(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function T(L,B,z,X){L.on("start.zoom",function(){I(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(X).end()}).tween("zoom",function(){var U=this,H=arguments,N=I(U,H).event(X),Z=t.apply(U,H),ne=z==null?C(Z):typeof z=="function"?z.apply(U,H):z,R=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),ee=U.__zoom,ie=typeof B=="function"?B.apply(U,H):B,se=u(ee.invert(ne).concat(R/ee.k),ie.invert(ne).concat(R/ie.k));return function(pe){if(pe===1)pe=ie;else{var ye=se(pe),_e=R/ye[2];pe=new xo(_e,ne[0]-ye[0]*_e,ne[1]-ye[1]*_e)}N.zoom(null,pe)}})}function I(L,B,z){return!z&&L.__zooming||new O(L,B)}function O(L,B){this.that=L,this.args=B,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,B),this.taps=0}O.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,B){return this.mouse&&L!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var B=ki(this.that).datum();c.call(L,this.that,new YW(L,{sourceEvent:this.sourceEvent,target:y,type:L,transform:this.that.__zoom,dispatch:c}),B)}};function M(L,...B){if(!e.apply(this,arguments))return;var z=I(this,B).event(L),X=this.__zoom,U=Math.max(o[0],Math.min(o[1],X.k*Math.pow(2,r.apply(this,arguments)))),H=Gi(L);if(z.wheel)(z.mouse[0][0]!==H[0]||z.mouse[0][1]!==H[1])&&(z.mouse[1]=X.invert(z.mouse[0]=H)),clearTimeout(z.wheel);else{if(X.k===U)return;z.mouse=[H,X.invert(H)],mh(this),z.start()}_c(L),z.wheel=setTimeout(N,v),z.zoom("mouse",n(E(_(X,U),z.mouse[0],z.mouse[1]),z.extent,s));function N(){z.wheel=null,z.end()}}function j(L,...B){if(h||!e.apply(this,arguments))return;var z=L.currentTarget,X=I(this,B,!0).event(L),U=ki(L.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",R,!0),H=Gi(L,z),N=L.clientX,Z=L.clientY;TR(L.view),Yv(L),X.mouse=[H,this.__zoom.invert(H)],mh(this),X.start();function ne(ee){if(_c(ee),!X.moved){var ie=ee.clientX-N,se=ee.clientY-Z;X.moved=ie*ie+se*se>x}X.event(ee).zoom("mouse",n(E(X.that.__zoom,X.mouse[0]=Gi(ee,z),X.mouse[1]),X.extent,s))}function R(ee){U.on("mousemove.zoom mouseup.zoom",null),kR(ee.view,X.moved),_c(ee),X.event(ee).end()}}function V(L,...B){if(e.apply(this,arguments)){var z=this.__zoom,X=Gi(L.changedTouches?L.changedTouches[0]:L,this),U=z.invert(X),H=z.k*(L.shiftKey?.5:2),N=n(E(_(z,H),X,U),t.apply(this,B),s);_c(L),a>0?ki(this).transition().duration(a).call(T,N,X,L):ki(this).call(y.transform,N,X,L)}}function F(L,...B){if(e.apply(this,arguments)){var z=L.touches,X=z.length,U=I(this,B,L.changedTouches.length===X).event(L),H,N,Z,ne;for(Yv(L),N=0;N"[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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,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.`},VR=ko.error001();function $t(e,t){const n=A.useContext(og);if(n===null)throw new Error(VR);return mR(n,e,t)}const on=()=>{const e=A.useContext(og);if(e===null)throw new Error(VR);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},rG=e=>e.userSelectionActive?"none":"all";function UR({position:e,children:t,className:n,style:r,...i}){const o=$t(rG),s=`${e}`.split("-");return Q.createElement("div",{className:Jn(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i},t)}function iG({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:Q.createElement(UR,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},Q.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const oG=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...d})=>{const p=A.useRef(null),[h,m]=A.useState({x:0,y:0,width:0,height:0}),v=Jn(["react-flow__edge-textwrapper",c]);return A.useEffect(()=>{if(p.current){const x=p.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:Q.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...d},i&&Q.createElement("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),Q.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},n),u)};var sG=A.memo(oG);const e1=e=>({width:e.offsetWidth,height:e.offsetHeight}),pu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),t1=(e={x:0,y:0},t)=>({x:pu(e.x,t[0][0],t[1][0]),y:pu(e.y,t[0][1],t[1][1])}),QI=(e,t,n)=>en?-pu(Math.abs(e-n),1,50)/50:0,WR=(e,t)=>{const n=QI(e.x,35,t.width-35)*20,r=QI(e.y,35,t.height-35)*20;return[n,r]},GR=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aG=(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)}),n1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),lG=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ZI=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),e_=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},uG=e=>ui(e.width)&&ui(e.height)&&ui(e.x)&&ui(e.y),ui=e=>!isNaN(e)&&isFinite(e),zt=Symbol.for("internals"),KR=["Enter"," ","Escape"],cG=(e,t)=>{},fG=e=>"nativeEvent"in e;function t_(e){var i,o;const t=fG(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const qR=e=>"clientX"in e,_s=(e,t)=>{var o,s;const n=qR(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},rm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},td=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m=20})=>Q.createElement(Q.Fragment,null,Q.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:h}),m&&Q.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),i&&ui(n)&&ui(r)?Q.createElement(sG,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c}):null);td.displayName="BaseEdge";function wc(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function YR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n{const[b,y,_]=QR({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return Q.createElement(td,{path:b,labelX:y,labelY:_,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:x})});r1.displayName="SimpleBezierEdge";const eA={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}},dG=({source:e,sourcePosition:t=te.Bottom,target:n})=>t===te.Left||t===te.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function pG({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:r=te.Top,center:i,offset:o}){const s=eA[t],a=eA[r],u={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},d=dG({source:u,sourcePosition:t,target:c}),p=d.x!==0?"x":"y",h=d[p];let m=[],v,x;const b={x:0,y:0},y={x:0,y:0},[_,E,C,T]=YR({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[p]*a[p]===-1){v=i.x??_,x=i.y??E;const O=[{x:v,y:u.y},{x:v,y:c.y}],M=[{x:u.x,y:x},{x:c.x,y:x}];s[p]===h?m=p==="x"?O:M:m=p==="x"?M:O}else{const O=[{x:u.x,y:c.y}],M=[{x:c.x,y:u.y}];if(p==="x"?m=s.x===h?M:O:m=s.y===h?O:M,t===r){const Y=Math.abs(e[p]-n[p]);if(Y<=o){const L=Math.min(o-1,o-Y);s[p]===h?b[p]=(u[p]>e[p]?-1:1)*L:y[p]=(c[p]>n[p]?-1:1)*L}}if(t!==r){const Y=p==="x"?"y":"x",L=s[p]===a[Y],B=u[Y]>c[Y],z=u[Y]=W?(v=(j.x+V.x)/2,x=m[0].y):(v=m[0].x,x=(j.y+V.y)/2)}return[[e,{x:u.x+b.x,y:u.y+b.y},...m,{x:c.x+y.x,y:c.y+y.y},n],v,x,C,T]}function hG(e,t,n,r){const i=Math.min(tA(e,t)/2,tA(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x{let E="";return _>0&&_{const[y,_,E]=n_({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:h,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset});return Q.createElement(td,{path:y,labelX:_,labelY:E,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:v,interactionWidth:b})});sg.displayName="SmoothStepEdge";const i1=A.memo(e=>{var t;return Q.createElement(sg,{...e,pathOptions:A.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});i1.displayName="StepEdge";function mG({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=YR({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const o1=A.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m})=>{const[v,x,b]=mG({sourceX:e,sourceY:t,targetX:n,targetY:r});return Q.createElement(td,{path:v,labelX:x,labelY:b,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:d,markerEnd:p,markerStart:h,interactionWidth:m})});o1.displayName="StraightEdge";function Dp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function nA({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case te.Left:return[t-Dp(t-r,o),n];case te.Right:return[t+Dp(r-t,o),n];case te.Top:return[t,n-Dp(n-i,o)];case te.Bottom:return[t,n+Dp(i-n,o)]}}function ZR({sourceX:e,sourceY:t,sourcePosition:n=te.Bottom,targetX:r,targetY:i,targetPosition:o=te.Top,curvature:s=.25}){const[a,u]=nA({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,d]=nA({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[p,h,m,v]=XR({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${u} ${c},${d} ${r},${i}`,p,h,m,v]}const om=A.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=te.Bottom,targetPosition:o=te.Top,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,pathOptions:x,interactionWidth:b})=>{const[y,_,E]=ZR({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:x==null?void 0:x.curvature});return Q.createElement(td,{path:y,labelX:_,labelY:E,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:b})});om.displayName="BezierEdge";const s1=A.createContext(null),gG=s1.Provider;s1.Consumer;const yG=()=>A.useContext(s1),vG=e=>"id"in e&&"source"in e&&"target"in e,xG=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,r_=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,_G=(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)),JR=(e,t)=>{if(!e.source||!e.target)return t;let n;return vG(e)?n={...e}:n={...e,id:xG(e)},_G(n,t)?t:t.concat(n)},i_=({x:e,y:t},[n,r,i],o,[s,a])=>{const u={x:(e-n)/i,y:(t-r)/i};return o?{x:s*Math.round(u.x/s),y:a*Math.round(u.y/a)}:u},eD=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Zl=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},a1=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:s}=Zl(i,t).positionAbsolute;return aG(r,n1({x:o,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return lG(n)},tD=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const u={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},c=[];return e.forEach(d=>{const{width:p,height:h,selectable:m=!0,hidden:v=!1}=d;if(s&&!m||v)return!1;const{positionAbsolute:x}=Zl(d,a),b={x:x.x,y:x.y,width:p||0,height:h||0},y=e_(u,b),_=typeof p>"u"||typeof h>"u"||p===null||h===null,E=o&&y>0,C=(p||0)*(h||0);(_||E||y>=C||d.dragging)&&c.push(d)}),c},nD=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},rD=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),u=Math.min(s,a),c=pu(u,r,i),d=e.x+e.width/2,p=e.y+e.height/2,h=t/2-d*c,m=n/2-p*c;return{x:h,y:m,zoom:c}},ea=(e,t=0)=>e.transition().duration(t);function rA(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var s,a;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+o.x+o.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+o.y+o.height/2}),i},[])}function wG(e,t,n,r,i,o){const{x:s,y:a}=_s(e),c=t.elementsFromPoint(s,a).find(v=>v.classList.contains("react-flow__handle"));if(c){const v=c.getAttribute("data-nodeid");if(v){const x=l1(void 0,c),b=c.getAttribute("data-handleid"),y=o({nodeId:v,id:b,type:x});if(y){const _=i.find(E=>E.nodeId===v&&E.type===x&&E.id===b);return{handle:{id:b,type:x,nodeId:v,x:(_==null?void 0:_.x)||n.x,y:(_==null?void 0:_.y)||n.y},validHandleResult:y}}}}let d=[],p=1/0;if(i.forEach(v=>{const x=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(x<=r){const b=o(v);x<=p&&(xv.isValid),m=d.some(({handle:v})=>v.type==="target");return d.find(({handle:v,validHandleResult:x})=>m?v.type==="target":h?x.isValid:!0)||d[0]}const bG={source:null,target:null,sourceHandle:null,targetHandle:null},iD=()=>({handleDomNode:null,isValid:!1,connection:bG,endHandle:null});function oD(e,t,n,r,i,o,s){const a=i==="target",u=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...iD(),handleDomNode:u};if(u){const d=l1(void 0,u),p=u.getAttribute("data-nodeid"),h=u.getAttribute("data-handleid"),m=u.classList.contains("connectable"),v=u.classList.contains("connectableend"),x={source:a?p:n,sourceHandle:a?h:r,target:a?n:p,targetHandle:a?r:h};c.connection=x,m&&v&&(t===ka.Strict?a&&d==="source"||!a&&d==="target":p!==n||h!==r)&&(c.endHandle={nodeId:p,handleId:h,type:d},c.isValid=o(x))}return c}function EG({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[zt]){const{handleBounds:s}=o[zt];let a=[],u=[];s&&(a=rA(o,s,"source",`${t}-${n}-${r}`),u=rA(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...u)}return i},[])}function l1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Xv(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function SG(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function sD({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:u,onReconnectEnd:c}){const d=GR(e.target),{connectionMode:p,domNode:h,autoPanOnConnect:m,connectionRadius:v,onConnectStart:x,panBy:b,getNodes:y,cancelConnection:_}=o();let E=0,C;const{x:T,y:I}=_s(e),O=d==null?void 0:d.elementFromPoint(T,I),M=l1(u,O),j=h==null?void 0:h.getBoundingClientRect();if(!j||!M)return;let V,F=_s(e,j),W=!1,Y=null,L=!1,B=null;const z=EG({nodes:y(),nodeId:n,handleId:t,handleType:M}),X=()=>{if(!m)return;const[N,Z]=WR(F,j);b({x:N,y:Z}),E=requestAnimationFrame(X)};s({connectionPosition:F,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:M,connectionStartHandle:{nodeId:n,handleId:t,type:M},connectionEndHandle:null}),x==null||x(e,{nodeId:n,handleId:t,handleType:M});function U(N){const{transform:Z}=o();F=_s(N,j);const{handle:ne,validHandleResult:R}=wG(N,d,i_(F,Z,!1,[1,1]),v,z,ee=>oD(ee,p,n,t,i?"target":"source",a,d));if(C=ne,W||(X(),W=!0),B=R.handleDomNode,Y=R.connection,L=R.isValid,s({connectionPosition:C&&L?eD({x:C.x,y:C.y},Z):F,connectionStatus:SG(!!C,L),connectionEndHandle:R.endHandle}),!C&&!L&&!B)return Xv(V);Y.source!==Y.target&&B&&(Xv(V),V=B,B.classList.add("connecting","react-flow__handle-connecting"),B.classList.toggle("valid",L),B.classList.toggle("react-flow__handle-valid",L))}function H(N){var Z,ne;(C||B)&&Y&&L&&(r==null||r(Y)),(ne=(Z=o()).onConnectEnd)==null||ne.call(Z,N),u&&(c==null||c(N)),Xv(V),_(),cancelAnimationFrame(E),W=!1,L=!1,Y=null,B=null,d.removeEventListener("mousemove",U),d.removeEventListener("mouseup",H),d.removeEventListener("touchmove",U),d.removeEventListener("touchend",H)}d.addEventListener("mousemove",U),d.addEventListener("mouseup",H),d.addEventListener("touchmove",U),d.addEventListener("touchend",H)}const iA=()=>!0,CG=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),IG=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:s}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},aD=A.forwardRef(({type:e="source",position:t=te.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:u,className:c,onMouseDown:d,onTouchStart:p,...h},m)=>{var j,V;const v=s||null,x=e==="target",b=on(),y=yG(),{connectOnClick:_,noPanClassName:E}=$t(CG,Rn),{connecting:C,clickConnecting:T}=$t(IG(y,v,e),Rn);y||(V=(j=b.getState()).onError)==null||V.call(j,"010",ko.error010());const I=F=>{const{defaultEdgeOptions:W,onConnect:Y,hasDefaultEdges:L}=b.getState(),B={...W,...F};if(L){const{edges:z,setEdges:X}=b.getState();X(JR(B,z))}Y==null||Y(B),a==null||a(B)},O=F=>{if(!y)return;const W=qR(F);i&&(W&&F.button===0||!W)&&sD({event:F,handleId:v,nodeId:y,onConnect:I,isTarget:x,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||iA}),W?d==null||d(F):p==null||p(F)},M=F=>{const{onClickConnectStart:W,onClickConnectEnd:Y,connectionClickStartHandle:L,connectionMode:B,isValidConnection:z}=b.getState();if(!y||!L&&!i)return;if(!L){W==null||W(F,{nodeId:y,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:y,type:e,handleId:v}});return}const X=GR(F.target),U=n||z||iA,{connection:H,isValid:N}=oD({nodeId:y,id:v,type:e},B,L.nodeId,L.handleId||null,L.type,U,X);N&&I(H),Y==null||Y(F),b.setState({connectionClickStartHandle:null})};return Q.createElement("div",{"data-handleid":v,"data-nodeid":y,"data-handlepos":t,"data-id":`${y}-${v}-${e}`,className:Jn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,c,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,connecting:T,connectionindicator:r&&(i&&!C||o&&C)}]),onMouseDown:O,onTouchStart:O,onClick:_?M:void 0,ref:m,...h},u)});aD.displayName="Handle";var Na=A.memo(aD);const lD=({data:e,isConnectable:t,targetPosition:n=te.Top,sourcePosition:r=te.Bottom})=>Q.createElement(Q.Fragment,null,Q.createElement(Na,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,Q.createElement(Na,{type:"source",position:r,isConnectable:t}));lD.displayName="DefaultNode";var o_=A.memo(lD);const uD=({data:e,isConnectable:t,sourcePosition:n=te.Bottom})=>Q.createElement(Q.Fragment,null,e==null?void 0:e.label,Q.createElement(Na,{type:"source",position:n,isConnectable:t}));uD.displayName="InputNode";var cD=A.memo(uD);const fD=({data:e,isConnectable:t,targetPosition:n=te.Top})=>Q.createElement(Q.Fragment,null,Q.createElement(Na,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);fD.displayName="OutputNode";var dD=A.memo(fD);const u1=()=>null;u1.displayName="GroupNode";const AG=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Lp=e=>e.id;function TG(e,t){return Rn(e.selectedNodes.map(Lp),t.selectedNodes.map(Lp))&&Rn(e.selectedEdges.map(Lp),t.selectedEdges.map(Lp))}const pD=A.memo(({onSelectionChange:e})=>{const t=on(),{selectedNodes:n,selectedEdges:r}=$t(AG,TG);return A.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});pD.displayName="SelectionListener";const kG=e=>!!e.onSelectionChange;function NG({onSelectionChange:e}){const t=$t(kG);return e||t?Q.createElement(pD,{onSelectionChange:e}):null}const OG=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function pl(e,t){A.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Qe(e,t,n){A.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const RG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:u,nodesDraggable:c,nodesConnectable:d,nodesFocusable:p,edgesFocusable:h,edgesUpdatable:m,elevateNodesOnSelect:v,minZoom:x,maxZoom:b,nodeExtent:y,onNodesChange:_,onEdgesChange:E,elementsSelectable:C,connectionMode:T,snapGrid:I,snapToGrid:O,translateExtent:M,connectOnClick:j,defaultEdgeOptions:V,fitView:F,fitViewOptions:W,onNodesDelete:Y,onEdgesDelete:L,onNodeDrag:B,onNodeDragStart:z,onNodeDragStop:X,onSelectionDrag:U,onSelectionDragStart:H,onSelectionDragStop:N,noPanClassName:Z,nodeOrigin:ne,rfId:R,autoPanOnConnect:ee,autoPanOnNodeDrag:ie,onError:se,connectionRadius:pe,isValidConnection:ye,nodeDragThreshold:_e})=>{const{setNodes:Se,setEdges:Ve,setDefaultNodesAndEdges:Oe,setMinZoom:Re,setMaxZoom:Be,setTranslateExtent:Ie,setNodeExtent:rt,reset:Le}=$t(OG,Rn),we=on();return A.useEffect(()=>{const yt=r==null?void 0:r.map(pt=>({...pt,...V}));return Oe(n,yt),()=>{Le()}},[]),Qe("defaultEdgeOptions",V,we.setState),Qe("connectionMode",T,we.setState),Qe("onConnect",i,we.setState),Qe("onConnectStart",o,we.setState),Qe("onConnectEnd",s,we.setState),Qe("onClickConnectStart",a,we.setState),Qe("onClickConnectEnd",u,we.setState),Qe("nodesDraggable",c,we.setState),Qe("nodesConnectable",d,we.setState),Qe("nodesFocusable",p,we.setState),Qe("edgesFocusable",h,we.setState),Qe("edgesUpdatable",m,we.setState),Qe("elementsSelectable",C,we.setState),Qe("elevateNodesOnSelect",v,we.setState),Qe("snapToGrid",O,we.setState),Qe("snapGrid",I,we.setState),Qe("onNodesChange",_,we.setState),Qe("onEdgesChange",E,we.setState),Qe("connectOnClick",j,we.setState),Qe("fitViewOnInit",F,we.setState),Qe("fitViewOnInitOptions",W,we.setState),Qe("onNodesDelete",Y,we.setState),Qe("onEdgesDelete",L,we.setState),Qe("onNodeDrag",B,we.setState),Qe("onNodeDragStart",z,we.setState),Qe("onNodeDragStop",X,we.setState),Qe("onSelectionDrag",U,we.setState),Qe("onSelectionDragStart",H,we.setState),Qe("onSelectionDragStop",N,we.setState),Qe("noPanClassName",Z,we.setState),Qe("nodeOrigin",ne,we.setState),Qe("rfId",R,we.setState),Qe("autoPanOnConnect",ee,we.setState),Qe("autoPanOnNodeDrag",ie,we.setState),Qe("onError",se,we.setState),Qe("connectionRadius",pe,we.setState),Qe("isValidConnection",ye,we.setState),Qe("nodeDragThreshold",_e,we.setState),pl(e,Se),pl(t,Ve),pl(x,Re),pl(b,Be),pl(M,Ie),pl(y,rt),null},oA={display:"none"},DG={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},hD="react-flow__node-desc",mD="react-flow__edge-desc",LG="react-flow__aria-live",PG=e=>e.ariaLiveMessage;function MG({rfId:e}){const t=$t(PG);return Q.createElement("div",{id:`${LG}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DG},t)}function $G({rfId:e,disableKeyboardA11y:t}){return Q.createElement(Q.Fragment,null,Q.createElement("div",{id:`${hD}-${e}`,style:oA},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),Q.createElement("div",{id:`${mD}-${e}`,style:oA},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&Q.createElement(MG,{rfId:e}))}var Mf=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=A.useState(!1),i=A.useRef(!1),o=A.useRef(new Set([])),[s,a]=A.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),d=c.reduce((p,h)=>p.concat(...h),[]);return[c,d]}return[[],[]]},[e]);return A.useEffect(()=>{const u=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||u;if(e!==null){const d=m=>{if(i.current=m.ctrlKey||m.metaKey||m.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&t_(m))return!1;const x=aA(m.code,a);o.current.add(m[x]),sA(s,o.current,!1)&&(m.preventDefault(),r(!0))},p=m=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&t_(m))return!1;const x=aA(m.code,a);sA(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(m[x]),m.key==="Meta"&&o.current.clear(),i.current=!1},h=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",p),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",p),window.removeEventListener("blur",h)}}},[e,r]),n};function sA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function aA(e,t){return t.includes(e)?"code":"key"}function gD(e,t,n,r){var a,u;const i=e.parentNode||e.parentId;if(!i)return n;const o=t.get(i),s=Zl(o,r);return gD(o,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(((a=o[zt])==null?void 0:a.z)??0)>(n.z??0)?((u=o[zt])==null?void 0:u.z)??0:n.z??0},r)}function yD(e,t,n){e.forEach(r=>{var o;const i=r.parentNode||r.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||n!=null&&n[r.id]){const{x:s,y:a,z:u}=gD(r,e,{...r.position,z:((o=r[zt])==null?void 0:o.z)??0},t);r.positionAbsolute={x:s,y:a},r[zt].z=u,n!=null&&n[r.id]&&(r[zt].isParent=!0)}})}function Qv(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var m;const u=(ui(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},p=a.parentNode||a.parentId;p&&(o[p]=!0);const h=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,zt,{enumerable:!1,value:{handleBounds:h||(m=c==null?void 0:c[zt])==null?void 0:m.handleBounds,z:u}}),i.set(a.id,d)}),yD(i,n,o),i}function vD(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:u,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:p}=e(),h=t.initial&&!c&&d;if(a&&u&&(h||!t.initial)){const v=n().filter(b=>{var _;const y=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(_=t.nodes)!=null&&_.length?y&&t.nodes.some(E=>E.id===b.id):y}),x=v.every(b=>b.width&&b.height);if(v.length>0&&x){const b=a1(v,p),{x:y,y:_,zoom:E}=rD(b,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),C=xs.translate(y,_).scale(E);return typeof t.duration=="number"&&t.duration>0?a.transform(ea(u,t.duration),C):a.transform(u,C),!0}}return!1}function FG(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[zt]:r[zt],selected:n.selected})}),new Map(t)}function BG(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Pp({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:u,hasDefaultEdges:c}=n();e!=null&&e.length&&(u&&r({nodeInternals:FG(e,i)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:BG(t,o)}),a==null||a(t))}const hl=()=>{},HG={zoomIn:hl,zoomOut:hl,zoomTo:hl,getZoom:()=>1,setViewport:hl,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:hl,fitBounds:hl,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},zG=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),jG=()=>{const e=on(),{d3Zoom:t,d3Selection:n}=$t(zG,Rn);return A.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(ea(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(ea(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(ea(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,u]=e.getState().transform,c=xs.translate(i.x??s,i.y??a).scale(i.zoom??u);t.transform(ea(n,o==null?void 0:o.duration),c)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>vD(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:u,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,p=a/2-i*d,h=u/2-o*d,m=xs.translate(p,h).scale(d);t.transform(ea(n,s==null?void 0:s.duration),m)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:u,maxZoom:c}=e.getState(),{x:d,y:p,zoom:h}=rD(i,s,a,u,c,(o==null?void 0:o.padding)??.1),m=xs.translate(d,p).scale(h);t.transform(ea(n,o==null?void 0:o.duration),m)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),i_(i,o,s,a)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:s,snapGrid:a,domNode:u}=e.getState();if(!u)return i;const{x:c,y:d}=u.getBoundingClientRect(),p={x:i.x-c,y:i.y-d};return i_(p,o,s,a)},flowToScreenPosition:i=>{const{transform:o,domNode:s}=e.getState();if(!s)return i;const{x:a,y:u}=s.getBoundingClientRect(),c=eD(i,o);return{x:c.x+a,y:c.y+u}},viewportInitialized:!0}:HG,[t,n])};function Fa(){const e=jG(),t=on(),n=A.useCallback(()=>t.getState().getNodes().map(x=>({...x})),[]),r=A.useCallback(x=>t.getState().nodeInternals.get(x),[]),i=A.useCallback(()=>{const{edges:x=[]}=t.getState();return x.map(b=>({...b}))},[]),o=A.useCallback(x=>{const{edges:b=[]}=t.getState();return b.find(y=>y.id===x)},[]),s=A.useCallback(x=>{const{getNodes:b,setNodes:y,hasDefaultNodes:_,onNodesChange:E}=t.getState(),C=b(),T=typeof x=="function"?x(C):x;if(_)y(T);else if(E){const I=T.length===0?C.map(O=>({type:"remove",id:O.id})):T.map(O=>({item:O,type:"reset"}));E(I)}},[]),a=A.useCallback(x=>{const{edges:b=[],setEdges:y,hasDefaultEdges:_,onEdgesChange:E}=t.getState(),C=typeof x=="function"?x(b):x;if(_)y(C);else if(E){const T=C.length===0?b.map(I=>({type:"remove",id:I.id})):C.map(I=>({item:I,type:"reset"}));E(T)}},[]),u=A.useCallback(x=>{const b=Array.isArray(x)?x:[x],{getNodes:y,setNodes:_,hasDefaultNodes:E,onNodesChange:C}=t.getState();if(E){const I=[...y(),...b];_(I)}else if(C){const T=b.map(I=>({item:I,type:"add"}));C(T)}},[]),c=A.useCallback(x=>{const b=Array.isArray(x)?x:[x],{edges:y=[],setEdges:_,hasDefaultEdges:E,onEdgesChange:C}=t.getState();if(E)_([...y,...b]);else if(C){const T=b.map(I=>({item:I,type:"add"}));C(T)}},[]),d=A.useCallback(()=>{const{getNodes:x,edges:b=[],transform:y}=t.getState(),[_,E,C]=y;return{nodes:x().map(T=>({...T})),edges:b.map(T=>({...T})),viewport:{x:_,y:E,zoom:C}}},[]),p=A.useCallback(({nodes:x,edges:b})=>{const{nodeInternals:y,getNodes:_,edges:E,hasDefaultNodes:C,hasDefaultEdges:T,onNodesDelete:I,onEdgesDelete:O,onNodesChange:M,onEdgesChange:j}=t.getState(),V=(x||[]).map(B=>B.id),F=(b||[]).map(B=>B.id),W=_().reduce((B,z)=>{const X=z.parentNode||z.parentId,U=!V.includes(z.id)&&X&&B.find(N=>N.id===X);return(typeof z.deletable=="boolean"?z.deletable:!0)&&(V.includes(z.id)||U)&&B.push(z),B},[]),Y=E.filter(B=>typeof B.deletable=="boolean"?B.deletable:!0),L=Y.filter(B=>F.includes(B.id));if(W||L){const B=nD(W,Y),z=[...L,...B],X=z.reduce((U,H)=>(U.includes(H.id)||U.push(H.id),U),[]);if((T||C)&&(T&&t.setState({edges:E.filter(U=>!X.includes(U.id))}),C&&(W.forEach(U=>{y.delete(U.id)}),t.setState({nodeInternals:new Map(y)}))),X.length>0&&(O==null||O(z),j&&j(X.map(U=>({id:U,type:"remove"})))),W.length>0&&(I==null||I(W),M)){const U=W.map(H=>({id:H.id,type:"remove"}));M(U)}}},[]),h=A.useCallback(x=>{const b=uG(x),y=b?null:t.getState().nodeInternals.get(x.id);return!b&&!y?[null,null,b]:[b?x:ZI(y),y,b]},[]),m=A.useCallback((x,b=!0,y)=>{const[_,E,C]=h(x);return _?(y||t.getState().getNodes()).filter(T=>{if(!C&&(T.id===E.id||!T.positionAbsolute))return!1;const I=ZI(T),O=e_(I,_);return b&&O>0||O>=_.width*_.height}):[]},[]),v=A.useCallback((x,b,y=!0)=>{const[_]=h(x);if(!_)return!1;const E=e_(_,b);return y&&E>0||E>=_.width*_.height},[]);return A.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:u,addEdges:c,toObject:d,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:v}),[e,n,r,i,o,s,a,u,c,d,p,m,v])}const VG={actInsideInputWithModifier:!1};var UG=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=on(),{deleteElements:r}=Fa(),i=Mf(e,VG),o=Mf(t);A.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),u=a().filter(d=>d.selected),c=s.filter(d=>d.selected);r({nodes:u,edges:c}),n.setState({nodesSelectionActive:!1})}},[i]),A.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function WG(e){const t=on();A.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=e1(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",ko.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const c1={position:"absolute",width:"100%",height:"100%",top:0,left:0},GG=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Mp=e=>({x:e.x,y:e.y,zoom:e.k}),ml=(e,t)=>e.target.closest(`.${t}`),lA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),uA=e=>{const t=e.ctrlKey&&rm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},KG=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),qG=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:u=fa.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:p=!0,defaultViewport:h,translateExtent:m,minZoom:v,maxZoom:x,zoomActivationKeyCode:b,preventScrolling:y=!0,children:_,noWheelClassName:E,noPanClassName:C})=>{const T=A.useRef(),I=on(),O=A.useRef(!1),M=A.useRef(!1),j=A.useRef(null),V=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:W,d3ZoomHandler:Y,userSelectionActive:L}=$t(KG,Rn),B=Mf(b),z=A.useRef(0),X=A.useRef(!1),U=A.useRef();return WG(j),A.useEffect(()=>{if(j.current){const H=j.current.getBoundingClientRect(),N=tG().scaleExtent([v,x]).translateExtent(m),Z=ki(j.current).call(N),ne=xs.translate(h.x,h.y).scale(pu(h.zoom,v,x)),R=[[0,0],[H.width,H.height]],ee=N.constrain()(ne,R,m);N.transform(Z,ee),N.wheelDelta(uA),I.setState({d3Zoom:N,d3Selection:Z,d3ZoomHandler:Z.on("wheel.zoom"),transform:[ee.x,ee.y,ee.k],domNode:j.current.closest(".react-flow")})}},[]),A.useEffect(()=>{W&&F&&(s&&!B&&!L?W.on("wheel.zoom",H=>{if(ml(H,E))return!1;H.preventDefault(),H.stopImmediatePropagation();const N=W.property("__zoom").k||1;if(H.ctrlKey&&o){const ye=Gi(H),_e=uA(H),Se=N*Math.pow(2,_e);F.scaleTo(W,Se,ye,H);return}const Z=H.deltaMode===1?20:1;let ne=u===fa.Vertical?0:H.deltaX*Z,R=u===fa.Horizontal?0:H.deltaY*Z;!rm()&&H.shiftKey&&u!==fa.Vertical&&(ne=H.deltaY*Z,R=0),F.translateBy(W,-(ne/N)*a,-(R/N)*a,{internal:!0});const ee=Mp(W.property("__zoom")),{onViewportChangeStart:ie,onViewportChange:se,onViewportChangeEnd:pe}=I.getState();clearTimeout(U.current),X.current||(X.current=!0,t==null||t(H,ee),ie==null||ie(ee)),X.current&&(e==null||e(H,ee),se==null||se(ee),U.current=setTimeout(()=>{n==null||n(H,ee),pe==null||pe(ee),X.current=!1},150))},{passive:!1}):typeof Y<"u"&&W.on("wheel.zoom",function(H,N){if(!y&&H.type==="wheel"&&!H.ctrlKey||ml(H,E))return null;H.preventDefault(),Y.call(this,H,N)},{passive:!1}))},[L,s,u,W,F,Y,B,o,y,E,t,e,n]),A.useEffect(()=>{F&&F.on("start",H=>{var ne,R;if(!H.sourceEvent||H.sourceEvent.internal)return null;z.current=(ne=H.sourceEvent)==null?void 0:ne.button;const{onViewportChangeStart:N}=I.getState(),Z=Mp(H.transform);O.current=!0,V.current=Z,((R=H.sourceEvent)==null?void 0:R.type)==="mousedown"&&I.setState({paneDragging:!0}),N==null||N(Z),t==null||t(H.sourceEvent,Z)})},[F,t]),A.useEffect(()=>{F&&(L&&!O.current?F.on("zoom",null):L||F.on("zoom",H=>{var Z;const{onViewportChange:N}=I.getState();if(I.setState({transform:[H.transform.x,H.transform.y,H.transform.k]}),M.current=!!(r&&lA(p,z.current??0)),(e||N)&&!((Z=H.sourceEvent)!=null&&Z.internal)){const ne=Mp(H.transform);N==null||N(ne),e==null||e(H.sourceEvent,ne)}}))},[L,F,e,p,r]),A.useEffect(()=>{F&&F.on("end",H=>{if(!H.sourceEvent||H.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=I.getState();if(O.current=!1,I.setState({paneDragging:!1}),r&&lA(p,z.current??0)&&!M.current&&r(H.sourceEvent),M.current=!1,(n||N)&&GG(V.current,H.transform)){const Z=Mp(H.transform);V.current=Z,clearTimeout(T.current),T.current=setTimeout(()=>{N==null||N(Z),n==null||n(H.sourceEvent,Z)},s?150:0)}})},[F,s,p,n,r]),A.useEffect(()=>{F&&F.filter(H=>{const N=B||i,Z=o&&H.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&H.button===1&&H.type==="mousedown"&&(ml(H,"react-flow__node")||ml(H,"react-flow__edge")))return!0;if(!p&&!N&&!s&&!c&&!o||L||!c&&H.type==="dblclick"||ml(H,E)&&H.type==="wheel"||ml(H,C)&&(H.type!=="wheel"||s&&H.type==="wheel"&&!B)||!o&&H.ctrlKey&&H.type==="wheel"||!N&&!s&&!Z&&H.type==="wheel"||!p&&(H.type==="mousedown"||H.type==="touchstart")||Array.isArray(p)&&!p.includes(H.button)&&H.type==="mousedown")return!1;const ne=Array.isArray(p)&&p.includes(H.button)||!H.button||H.button<=1;return(!H.ctrlKey||H.type==="wheel")&&ne})},[L,F,i,o,s,c,p,d,B]),Q.createElement("div",{className:"react-flow__renderer",ref:j,style:c1},_)},YG=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function XG(){const{userSelectionActive:e,userSelectionRect:t}=$t(YG,Rn);return e&&t?Q.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function cA(e,t){const n=t.parentNode||t.parentId,r=e.find(i=>i.id===n);if(r){const i=t.position.x+t.width-r.width,o=t.position.y+t.height-r.height;if(i>0||o>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,i>0&&(r.style.width+=i),o>0&&(r.style.height+=o),t.position.x<0){const s=Math.abs(t.position.x);r.position.x=r.position.x-s,r.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);r.position.y=r.position.y-s,r.style.height+=s,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function xD(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(a=>a.id===i.id);if(o.length===0)return r.push(i),r;const s={...i};for(const a of o)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&cA(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&cA(r,s);break}case"remove":return r}return r.push(s),r},n)}function _D(e,t){return xD(e,t)}function QG(e,t){return xD(e,t)}const Jo=(e,t)=>({id:e,type:"select",selected:t});function Hl(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Jo(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Jo(r.id,!1))),n},[])}const Zv=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ZG=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),wD=A.memo(({isSelecting:e,selectionMode:t=Pf.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:u,onPaneMouseMove:c,onPaneMouseLeave:d,children:p})=>{const h=A.useRef(null),m=on(),v=A.useRef(0),x=A.useRef(0),b=A.useRef(),{userSelectionActive:y,elementsSelectable:_,dragging:E}=$t(ZG,Rn),C=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,x.current=0},T=Y=>{o==null||o(Y),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},I=Y=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){Y.preventDefault();return}s==null||s(Y)},O=a?Y=>a(Y):void 0,M=Y=>{const{resetSelectedElements:L,domNode:B}=m.getState();if(b.current=B==null?void 0:B.getBoundingClientRect(),!_||!e||Y.button!==0||Y.target!==h.current||!b.current)return;const{x:z,y:X}=_s(Y,b.current);L(),m.setState({userSelectionRect:{width:0,height:0,startX:z,startY:X,x:z,y:X}}),r==null||r(Y)},j=Y=>{const{userSelectionRect:L,nodeInternals:B,edges:z,transform:X,onNodesChange:U,onEdgesChange:H,nodeOrigin:N,getNodes:Z}=m.getState();if(!e||!b.current||!L)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const ne=_s(Y,b.current),R=L.startX??0,ee=L.startY??0,ie={...L,x:ne.xSe.id),_e=pe.map(Se=>Se.id);if(v.current!==_e.length){v.current=_e.length;const Se=Hl(se,_e);Se.length&&(U==null||U(Se))}if(x.current!==ye.length){x.current=ye.length;const Se=Hl(z,ye);Se.length&&(H==null||H(Se))}m.setState({userSelectionRect:ie})},V=Y=>{if(Y.button!==0)return;const{userSelectionRect:L}=m.getState();!y&&L&&Y.target===h.current&&(T==null||T(Y)),m.setState({nodesSelectionActive:v.current>0}),C(),i==null||i(Y)},F=Y=>{y&&(m.setState({nodesSelectionActive:v.current>0}),i==null||i(Y)),C()},W=_&&(e||y);return Q.createElement("div",{className:Jn(["react-flow__pane",{dragging:E,selection:e}]),onClick:W?void 0:Zv(T,h),onContextMenu:Zv(I,h),onWheel:Zv(O,h),onMouseEnter:W?void 0:u,onMouseDown:W?M:void 0,onMouseMove:W?j:c,onMouseUp:W?V:void 0,onMouseLeave:W?F:d,ref:h,style:c1},p,Q.createElement(XG,null))});wD.displayName="Pane";function bD(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:bD(r,t):!1}function fA(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function JG(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||i.parentId||!bD(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function eK(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ED(e,t,n,r,i=[0,0],o){const s=eK(e,e.extent||r);let a=s;const u=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(u&&e.width&&e.height){const p=n.get(u),{x:h,y:m}=Zl(p,i).positionAbsolute;a=p&&ui(h)&&ui(m)&&ui(p.width)&&ui(p.height)?[[h+e.width*i[0],m+e.height*i[1]],[h+p.width-e.width+e.width*i[0],m+p.height-e.height+e.height*i[1]]]:a}else o==null||o("005",ko.error005()),a=s;else if(e.extent&&u&&e.extent!=="parent"){const p=n.get(u),{x:h,y:m}=Zl(p,i).positionAbsolute;a=[[e.extent[0][0]+h,e.extent[0][1]+m],[e.extent[1][0]+h,e.extent[1][1]+m]]}let c={x:0,y:0};if(u){const p=n.get(u);c=Zl(p,i).positionAbsolute}const d=a&&a!=="parent"?t1(t,a):t;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function Jv({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const dA=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),position:u.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...e1(u)}})};function bc(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function s_({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",ko.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function tK(){const e=on();return A.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,u={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(u.x/i[0]):u.x,ySnapped:o?i[1]*Math.round(u.y/i[1]):u.y,...u}},[])}function e0(e){return(t,n,r)=>e==null?void 0:e(t,r)}function SD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=on(),[u,c]=A.useState(!1),d=A.useRef([]),p=A.useRef({x:null,y:null}),h=A.useRef(0),m=A.useRef(null),v=A.useRef({x:0,y:0}),x=A.useRef(null),b=A.useRef(!1),y=A.useRef(!1),_=A.useRef(!1),E=tK();return A.useEffect(()=>{if(e!=null&&e.current){const C=ki(e.current),T=({x:M,y:j})=>{const{nodeInternals:V,onNodeDrag:F,onSelectionDrag:W,updateNodePositions:Y,nodeExtent:L,snapGrid:B,snapToGrid:z,nodeOrigin:X,onError:U}=a.getState();p.current={x:M,y:j};let H=!1,N={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&L){const ne=a1(d.current,X);N=n1(ne)}if(d.current=d.current.map(ne=>{const R={x:M-ne.distance.x,y:j-ne.distance.y};z&&(R.x=B[0]*Math.round(R.x/B[0]),R.y=B[1]*Math.round(R.y/B[1]));const ee=[[L[0][0],L[0][1]],[L[1][0],L[1][1]]];d.current.length>1&&L&&!ne.extent&&(ee[0][0]=ne.positionAbsolute.x-N.x+L[0][0],ee[1][0]=ne.positionAbsolute.x+(ne.width??0)-N.x2+L[1][0],ee[0][1]=ne.positionAbsolute.y-N.y+L[0][1],ee[1][1]=ne.positionAbsolute.y+(ne.height??0)-N.y2+L[1][1]);const ie=ED(ne,R,V,ee,X,U);return H=H||ne.position.x!==ie.position.x||ne.position.y!==ie.position.y,ne.position=ie.position,ne.positionAbsolute=ie.positionAbsolute,ne}),!H)return;Y(d.current,!0,!0),c(!0);const Z=i?F:e0(W);if(Z&&x.current){const[ne,R]=Jv({nodeId:i,dragItems:d.current,nodeInternals:V});Z(x.current,ne,R)}},I=()=>{if(!m.current)return;const[M,j]=WR(v.current,m.current);if(M!==0||j!==0){const{transform:V,panBy:F}=a.getState();p.current.x=(p.current.x??0)-M/V[2],p.current.y=(p.current.y??0)-j/V[2],F({x:M,y:j})&&T(p.current)}h.current=requestAnimationFrame(I)},O=M=>{var X;const{nodeInternals:j,multiSelectionActive:V,nodesDraggable:F,unselectNodesAndEdges:W,onNodeDragStart:Y,onSelectionDragStart:L}=a.getState();y.current=!0;const B=i?Y:e0(L);(!s||!o)&&!V&&i&&((X=j.get(i))!=null&&X.selected||W()),i&&o&&s&&s_({id:i,store:a,nodeRef:e});const z=E(M);if(p.current=z,d.current=JG(j,F,z,i),B&&d.current){const[U,H]=Jv({nodeId:i,dragItems:d.current,nodeInternals:j});B(M.sourceEvent,U,H)}};if(t)C.on(".drag",null);else{const M=fU().on("start",j=>{const{domNode:V,nodeDragThreshold:F}=a.getState();F===0&&O(j),_.current=!1;const W=E(j);p.current=W,m.current=(V==null?void 0:V.getBoundingClientRect())||null,v.current=_s(j.sourceEvent,m.current)}).on("drag",j=>{var Y,L;const V=E(j),{autoPanOnNodeDrag:F,nodeDragThreshold:W}=a.getState();if(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1&&(_.current=!0),!_.current){if(!b.current&&y.current&&F&&(b.current=!0,I()),!y.current){const B=V.xSnapped-(((Y=p==null?void 0:p.current)==null?void 0:Y.x)??0),z=V.ySnapped-(((L=p==null?void 0:p.current)==null?void 0:L.y)??0);Math.sqrt(B*B+z*z)>W&&O(j)}(p.current.x!==V.xSnapped||p.current.y!==V.ySnapped)&&d.current&&y.current&&(x.current=j.sourceEvent,v.current=_s(j.sourceEvent,m.current),T(V))}}).on("end",j=>{if(!(!y.current||_.current)&&(c(!1),b.current=!1,y.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:V,nodeInternals:F,onNodeDragStop:W,onSelectionDragStop:Y}=a.getState(),L=i?W:e0(Y);if(V(d.current,!1,!1),L){const[B,z]=Jv({nodeId:i,dragItems:d.current,nodeInternals:F});L(j.sourceEvent,B,z)}}}).filter(j=>{const V=j.target;return!j.button&&(!n||!fA(V,`.${n}`,e))&&(!r||fA(V,r,e))});return C.call(M),()=>{C.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,E]),u}function CD(){const e=on();return A.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:u,onError:c,nodesDraggable:d}=e.getState(),p=s().filter(_=>_.selected&&(_.draggable||d&&typeof _.draggable>"u")),h=a?u[0]:5,m=a?u[1]:5,v=n.isShiftPressed?4:1,x=n.x*h*v,b=n.y*m*v,y=p.map(_=>{if(_.positionAbsolute){const E={x:_.positionAbsolute.x+x,y:_.positionAbsolute.y+b};a&&(E.x=u[0]*Math.round(E.x/u[0]),E.y=u[1]*Math.round(E.y/u[1]));const{positionAbsolute:C,position:T}=ED(_,E,r,i,void 0,c);_.position=T,_.positionAbsolute=C}return _});o(y,!0,!1)},[])}const Jl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ec=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:u,selected:c,onClick:d,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:v,onDoubleClick:x,style:b,className:y,isDraggable:_,isSelectable:E,isConnectable:C,isFocusable:T,selectNodesOnDrag:I,sourcePosition:O,targetPosition:M,hidden:j,resizeObserver:V,dragHandle:F,zIndex:W,isParent:Y,noDragClassName:L,noPanClassName:B,initialized:z,disableKeyboardA11y:X,ariaLabel:U,rfId:H,hasHandleBounds:N})=>{const Z=on(),ne=A.useRef(null),R=A.useRef(null),ee=A.useRef(O),ie=A.useRef(M),se=A.useRef(r),pe=E||_||d||p||h||m,ye=CD(),_e=bc(n,Z.getState,p),Se=bc(n,Z.getState,h),Ve=bc(n,Z.getState,m),Oe=bc(n,Z.getState,v),Re=bc(n,Z.getState,x),Be=Le=>{const{nodeDragThreshold:we}=Z.getState();if(E&&(!I||!_||we>0)&&s_({id:n,store:Z,nodeRef:ne}),d){const yt=Z.getState().nodeInternals.get(n);yt&&d(Le,{...yt})}},Ie=Le=>{if(!t_(Le)&&!X)if(KR.includes(Le.key)&&E){const we=Le.key==="Escape";s_({id:n,store:Z,unselect:we,nodeRef:ne})}else _&&c&&Object.prototype.hasOwnProperty.call(Jl,Le.key)&&(Z.setState({ariaLiveMessage:`Moved selected node ${Le.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),ye({x:Jl[Le.key].x,y:Jl[Le.key].y,isShiftPressed:Le.shiftKey}))};A.useEffect(()=>()=>{R.current&&(V==null||V.unobserve(R.current),R.current=null)},[]),A.useEffect(()=>{if(ne.current&&!j){const Le=ne.current;(!z||!N||R.current!==Le)&&(R.current&&(V==null||V.unobserve(R.current)),V==null||V.observe(Le),R.current=Le)}},[j,z,N]),A.useEffect(()=>{const Le=se.current!==r,we=ee.current!==O,yt=ie.current!==M;ne.current&&(Le||we||yt)&&(Le&&(se.current=r),we&&(ee.current=O),yt&&(ie.current=M),Z.getState().updateNodeDimensions([{id:n,nodeElement:ne.current,forceUpdate:!0}]))},[n,r,O,M]);const rt=SD({nodeRef:ne,disabled:j||!_,noDragClassName:L,handleSelector:F,nodeId:n,isSelectable:E,selectNodesOnDrag:I});return j?null:Q.createElement("div",{className:Jn(["react-flow__node",`react-flow__node-${r}`,{[B]:_},y,{selected:c,selectable:E,parent:Y,dragging:rt}]),ref:ne,style:{zIndex:W,transform:`translate(${a}px,${u}px)`,pointerEvents:pe?"all":"none",visibility:z?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:_e,onMouseMove:Se,onMouseLeave:Ve,onContextMenu:Oe,onClick:Be,onDoubleClick:Re,onKeyDown:T?Ie:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":X?void 0:`${hD}-${H}`,"aria-label":U},Q.createElement(gG,{value:n},Q.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:c,isConnectable:C,sourcePosition:O,targetPosition:M,dragging:rt,dragHandle:F,zIndex:W})))};return t.displayName="NodeWrapper",A.memo(t)};const nK=e=>{const t=e.getNodes().filter(n=>n.selected);return{...a1(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function rK({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=on(),{width:i,height:o,x:s,y:a,transformString:u,userSelectionActive:c}=$t(nK,Rn),d=CD(),p=A.useRef(null);if(A.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]),SD({nodeRef:p}),c||!i||!o)return null;const h=e?v=>{const x=r.getState().getNodes().filter(b=>b.selected);e(v,x)}:void 0,m=v=>{Object.prototype.hasOwnProperty.call(Jl,v.key)&&d({x:Jl[v.key].x,y:Jl[v.key].y,isShiftPressed:v.shiftKey})};return Q.createElement("div",{className:Jn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u}},Q.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:i,height:o,top:a,left:s}}))}var iK=A.memo(rK);const oK=e=>e.nodesSelectionActive,ID=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:u,onMoveStart:c,onMoveEnd:d,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:y,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:M,zoomOnDoubleClick:j,panOnDrag:V,defaultViewport:F,translateExtent:W,minZoom:Y,maxZoom:L,preventScrolling:B,onSelectionContextMenu:z,noWheelClassName:X,noPanClassName:U,disableKeyboardA11y:H})=>{const N=$t(oK),Z=Mf(p),ne=Mf(y),R=ne||V,ee=ne||I,ie=Z||h&&R!==!0;return UG({deleteKeyCode:a,multiSelectionKeyCode:b}),Q.createElement(qG,{onMove:u,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:o,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:ee,panOnScrollSpeed:O,panOnScrollMode:M,zoomOnDoubleClick:j,panOnDrag:!Z&&R,defaultViewport:F,translateExtent:W,minZoom:Y,maxZoom:L,zoomActivationKeyCode:_,preventScrolling:B,noWheelClassName:X,noPanClassName:U},Q.createElement(wD,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:R,isSelecting:!!ie,selectionMode:m},e,N&&Q.createElement(iK,{onSelectionContextMenu:z,noPanClassName:U,disableKeyboardA11y:H})))};ID.displayName="FlowRenderer";var sK=A.memo(ID);function aK(e){return $t(A.useCallback(n=>e?tD(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function lK(e){const t={input:Ec(e.input||cD),default:Ec(e.default||o_),output:Ec(e.output||dD),group:Ec(e.group||u1)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Ec(e[o]||o_),i),n);return{...t,...r}}const uK=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},cK=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),AD=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=$t(cK,Rn),a=aK(e.onlyRenderVisibleElements),u=A.useRef(),c=A.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(p=>{const h=p.map(m=>({id:m.target.getAttribute("data-id"),nodeElement:m.target,forceUpdate:!0}));o(h)});return u.current=d,d},[]);return A.useEffect(()=>()=>{var d;(d=u==null?void 0:u.current)==null||d.disconnect()},[]),Q.createElement("div",{className:"react-flow__nodes",style:c1},a.map(d=>{var T,I,O;let p=d.type||"default";e.nodeTypes[p]||(s==null||s("003",ko.error003(p)),p="default");const h=e.nodeTypes[p]||e.nodeTypes.default,m=!!(d.draggable||t&&typeof d.draggable>"u"),v=!!(d.selectable||i&&typeof d.selectable>"u"),x=!!(d.connectable||n&&typeof d.connectable>"u"),b=!!(d.focusable||r&&typeof d.focusable>"u"),y=e.nodeExtent?t1(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,_=(y==null?void 0:y.x)??0,E=(y==null?void 0:y.y)??0,C=uK({x:_,y:E,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return Q.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:p,data:d.data,sourcePosition:d.sourcePosition||te.Bottom,targetPosition:d.targetPosition||te.Top,hidden:d.hidden,xPos:_,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:m,isSelectable:v,isConnectable:x,isFocusable:b,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((T=d[zt])==null?void 0:T.z)??0,isParent:!!((I=d[zt])!=null&&I.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((O=d[zt])!=null&&O.handleBounds)})}))};AD.displayName="NodeRenderer";var fK=A.memo(AD);const dK=(e,t,n)=>n===te.Left?e-t:n===te.Right?e+t:e,pK=(e,t,n)=>n===te.Top?e-t:n===te.Bottom?e+t:e,pA="react-flow__edgeupdater",hA=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>Q.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Jn([pA,`${pA}-${a}`]),cx:dK(t,r,e),cy:pK(n,r,e),r,stroke:"transparent",fill:"transparent"}),hK=()=>!0;var gl=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:u,animated:c,label:d,labelStyle:p,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:x,style:b,source:y,target:_,sourceX:E,sourceY:C,targetX:T,targetY:I,sourcePosition:O,targetPosition:M,elementsSelectable:j,hidden:V,sourceHandleId:F,targetHandleId:W,onContextMenu:Y,onMouseEnter:L,onMouseMove:B,onMouseLeave:z,reconnectRadius:X,onReconnect:U,onReconnectStart:H,onReconnectEnd:N,markerEnd:Z,markerStart:ne,rfId:R,ariaLabel:ee,isFocusable:ie,isReconnectable:se,pathOptions:pe,interactionWidth:ye,disableKeyboardA11y:_e})=>{const Se=A.useRef(null),[Ve,Oe]=A.useState(!1),[Re,Be]=A.useState(!1),Ie=on(),rt=A.useMemo(()=>`url('#${r_(ne,R)}')`,[ne,R]),Le=A.useMemo(()=>`url('#${r_(Z,R)}')`,[Z,R]);if(V)return null;const we=st=>{var Ut;const{edges:Rt,addSelectedEdges:Vt,unselectNodesAndEdges:hn,multiSelectionActive:mn}=Ie.getState(),xt=Rt.find(gn=>gn.id===n);xt&&(j&&(Ie.setState({nodesSelectionActive:!1}),xt.selected&&mn?(hn({nodes:[],edges:[xt]}),(Ut=Se.current)==null||Ut.blur()):Vt([n])),s&&s(st,xt))},yt=wc(n,Ie.getState,a),pt=wc(n,Ie.getState,Y),vt=wc(n,Ie.getState,L),Qt=wc(n,Ie.getState,B),an=wc(n,Ie.getState,z),qt=(st,Rt)=>{if(st.button!==0)return;const{edges:Vt,isValidConnection:hn}=Ie.getState(),mn=Rt?_:y,xt=(Rt?W:F)||null,Ut=Rt?"target":"source",gn=hn||hK,Vu=Rt,Bs=Vt.find(to=>to.id===n);Be(!0),H==null||H(st,Bs,Ut);const qa=to=>{Be(!1),N==null||N(to,Bs,Ut)};sD({event:st,handleId:xt,nodeId:mn,onConnect:to=>U==null?void 0:U(Bs,to),isTarget:Vu,getState:Ie.getState,setState:Ie.setState,isValidConnection:gn,edgeUpdaterType:Ut,onReconnectEnd:qa})},Zt=st=>qt(st,!0),J=st=>qt(st,!1),ce=()=>Oe(!0),Ce=()=>Oe(!1),ze=!j&&!s,Ze=st=>{var Rt;if(!_e&&KR.includes(st.key)&&j){const{unselectNodesAndEdges:Vt,addSelectedEdges:hn,edges:mn}=Ie.getState();st.key==="Escape"?((Rt=Se.current)==null||Rt.blur(),Vt({edges:[mn.find(Ut=>Ut.id===n)]})):hn([n])}};return Q.createElement("g",{className:Jn(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:u,animated:c,inactive:ze,updating:Ve}]),onClick:we,onDoubleClick:yt,onContextMenu:pt,onMouseEnter:vt,onMouseMove:Qt,onMouseLeave:an,onKeyDown:ie?Ze:void 0,tabIndex:ie?0:void 0,role:ie?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":ee===null?void 0:ee||`Edge from ${y} to ${_}`,"aria-describedby":ie?`${mD}-${R}`:void 0,ref:Se},!Re&&Q.createElement(e,{id:n,source:y,target:_,selected:u,animated:c,label:d,labelStyle:p,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:x,data:o,style:b,sourceX:E,sourceY:C,targetX:T,targetY:I,sourcePosition:O,targetPosition:M,sourceHandleId:F,targetHandleId:W,markerStart:rt,markerEnd:Le,pathOptions:pe,interactionWidth:ye}),se&&Q.createElement(Q.Fragment,null,(se==="source"||se===!0)&&Q.createElement(hA,{position:O,centerX:E,centerY:C,radius:X,onMouseDown:Zt,onMouseEnter:ce,onMouseOut:Ce,type:"source"}),(se==="target"||se===!0)&&Q.createElement(hA,{position:M,centerX:T,centerY:I,radius:X,onMouseDown:J,onMouseEnter:ce,onMouseOut:Ce,type:"target"})))};return t.displayName="EdgeWrapper",A.memo(t)};function mK(e){const t={default:gl(e.default||om),straight:gl(e.bezier||o1),step:gl(e.step||i1),smoothstep:gl(e.step||sg),simplebezier:gl(e.simplebezier||r1)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=gl(e[o]||om),i),n);return{...t,...r}}function mA(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case te.Top:return{x:r+o/2,y:i};case te.Right:return{x:r+o,y:i+s/2};case te.Bottom:return{x:r+o/2,y:i+s};case te.Left:return{x:r,y:i+s/2}}}function gA(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const gK=(e,t,n,r,i,o)=>{const s=mA(n,e,t),a=mA(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function yK({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:s,height:a,transform:u}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=n1({x:(0-u[0])/u[2],y:(0-u[1])/u[2],width:s/u[2],height:a/u[2]}),p=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(p*h)>0}function yA(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[zt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const vK=[{level:0,isMaxLevel:!0,edges:[]}];function xK(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var d,p;const u=ui(a.zIndex);let c=u?a.zIndex:0;if(n){const h=t.get(a.target),m=t.get(a.source),v=a.selected||(h==null?void 0:h.selected)||(m==null?void 0:m.selected),x=Math.max(((d=m==null?void 0:m[zt])==null?void 0:d.z)||0,((p=h==null?void 0:h[zt])==null?void 0:p.z)||0,1e3);c=(u?a.zIndex:0)+(v?x:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),o=Object.entries(i).map(([s,a])=>{const u=+s;return{edges:a,level:u,isMaxLevel:u===r}});return o.length===0?vK:o}function _K(e,t,n){const r=$t(A.useCallback(i=>e?i.edges.filter(o=>{const s=t.get(o.source),a=t.get(o.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&yK({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return xK(r,t,n)}const wK=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),bK=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),vA={[im.Arrow]:wK,[im.ArrowClosed]:bK};function EK(e){const t=on();return A.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(vA,e)?vA[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ko.error009(e)),null)},[e])}const SK=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const u=EK(t);return u?Q.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0"},Q.createElement(u,{color:n,strokeWidth:s})):null},CK=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=r_(s,t);r.includes(a)||(i.push({id:a,color:s.color||e,...s}),r.push(a))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},TD=({defaultColor:e,rfId:t})=>{const n=$t(A.useCallback(CK({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return Q.createElement("defs",null,n.map(r=>Q.createElement(SK,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};TD.displayName="MarkerDefinitions";var IK=A.memo(TD);const AK=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),kD=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:x,children:b,disableKeyboardA11y:y})=>{const{edgesFocusable:_,edgesUpdatable:E,elementsSelectable:C,width:T,height:I,connectionMode:O,nodeInternals:M,onError:j}=$t(AK,Rn),V=_K(t,M,n);return T?Q.createElement(Q.Fragment,null,V.map(({level:F,edges:W,isMaxLevel:Y})=>Q.createElement("svg",{key:F,style:{zIndex:F},width:T,height:I,className:"react-flow__edges react-flow__container"},Y&&Q.createElement(IK,{defaultColor:e,rfId:r}),Q.createElement("g",null,W.map(L=>{const[B,z,X]=yA(M.get(L.source)),[U,H,N]=yA(M.get(L.target));if(!X||!N)return null;let Z=L.type||"default";i[Z]||(j==null||j("011",ko.error011(Z)),Z="default");const ne=i[Z]||i.default,R=O===ka.Strict?H.target:(H.target??[]).concat(H.source??[]),ee=gA(z.source,L.sourceHandle),ie=gA(R,L.targetHandle),se=(ee==null?void 0:ee.position)||te.Bottom,pe=(ie==null?void 0:ie.position)||te.Top,ye=!!(L.focusable||_&&typeof L.focusable>"u"),_e=L.reconnectable||L.updatable,Se=typeof h<"u"&&(_e||E&&typeof _e>"u");if(!ee||!ie)return j==null||j("008",ko.error008(ee,L)),null;const{sourceX:Ve,sourceY:Oe,targetX:Re,targetY:Be}=gK(B,ee,se,U,ie,pe);return Q.createElement(ne,{key:L.id,id:L.id,className:Jn([L.className,o]),type:Z,data:L.data,selected:!!L.selected,animated:!!L.animated,hidden:!!L.hidden,label:L.label,labelStyle:L.labelStyle,labelShowBg:L.labelShowBg,labelBgStyle:L.labelBgStyle,labelBgPadding:L.labelBgPadding,labelBgBorderRadius:L.labelBgBorderRadius,style:L.style,source:L.source,target:L.target,sourceHandleId:L.sourceHandle,targetHandleId:L.targetHandle,markerEnd:L.markerEnd,markerStart:L.markerStart,sourceX:Ve,sourceY:Oe,targetX:Re,targetY:Be,sourcePosition:se,targetPosition:pe,elementsSelectable:C,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:d,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:x,rfId:r,ariaLabel:L.ariaLabel,isFocusable:ye,isReconnectable:Se,pathOptions:"pathOptions"in L?L.pathOptions:void 0,interactionWidth:L.interactionWidth,disableKeyboardA11y:y})})))),b):null};kD.displayName="EdgeRenderer";var TK=A.memo(kD);const kK=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function NK({children:e}){const t=$t(kK);return Q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function OK(e){const t=Fa(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const RK={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},ND=({nodeId:e,handleType:t,style:n,type:r=os.Bezier,CustomComponent:i,connectionStatus:o})=>{var I,O,M;const{fromNode:s,handleId:a,toX:u,toY:c,connectionMode:d}=$t(A.useCallback(j=>({fromNode:j.nodeInternals.get(e),handleId:j.connectionHandleId,toX:(j.connectionPosition.x-j.transform[0])/j.transform[2],toY:(j.connectionPosition.y-j.transform[1])/j.transform[2],connectionMode:j.connectionMode}),[e]),Rn),p=(I=s==null?void 0:s[zt])==null?void 0:I.handleBounds;let h=p==null?void 0:p[t];if(d===ka.Loose&&(h=h||(p==null?void 0:p[t==="source"?"target":"source"])),!s||!h)return null;const m=a?h.find(j=>j.id===a):h[0],v=m?m.x+m.width/2:(s.width??0)/2,x=m?m.y+m.height/2:s.height??0,b=(((O=s.positionAbsolute)==null?void 0:O.x)??0)+v,y=(((M=s.positionAbsolute)==null?void 0:M.y)??0)+x,_=m==null?void 0:m.position,E=_?RK[_]:null;if(!_||!E)return null;if(i)return Q.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:m,fromX:b,fromY:y,toX:u,toY:c,fromPosition:_,toPosition:E,connectionStatus:o});let C="";const T={sourceX:b,sourceY:y,sourcePosition:_,targetX:u,targetY:c,targetPosition:E};return r===os.Bezier?[C]=ZR(T):r===os.Step?[C]=n_({...T,borderRadius:0}):r===os.SmoothStep?[C]=n_(T):r===os.SimpleBezier?[C]=QR(T):C=`M${b},${y} ${u},${c}`,Q.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:n})};ND.displayName="ConnectionLine";const DK=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function LK({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:u,connectionStatus:c}=$t(DK,Rn);return!(i&&o&&a&&s)?null:Q.createElement("svg",{style:e,width:a,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},Q.createElement("g",{className:Jn(["react-flow__connection",c])},Q.createElement(ND,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function xA(e,t){return A.useRef(null),on(),A.useMemo(()=>t(e),[e])}const OD=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:v,onSelectionStart:x,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:_,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:T,selectionOnDrag:I,selectionMode:O,multiSelectionKeyCode:M,panActivationKeyCode:j,zoomActivationKeyCode:V,deleteKeyCode:F,onlyRenderVisibleElements:W,elementsSelectable:Y,selectNodesOnDrag:L,defaultViewport:B,translateExtent:z,minZoom:X,maxZoom:U,preventScrolling:H,defaultMarkerColor:N,zoomOnScroll:Z,zoomOnPinch:ne,panOnScroll:R,panOnScrollSpeed:ee,panOnScrollMode:ie,zoomOnDoubleClick:se,panOnDrag:pe,onPaneClick:ye,onPaneMouseEnter:_e,onPaneMouseMove:Se,onPaneMouseLeave:Ve,onPaneScroll:Oe,onPaneContextMenu:Re,onEdgeContextMenu:Be,onEdgeMouseEnter:Ie,onEdgeMouseMove:rt,onEdgeMouseLeave:Le,onReconnect:we,onReconnectStart:yt,onReconnectEnd:pt,reconnectRadius:vt,noDragClassName:Qt,noWheelClassName:an,noPanClassName:qt,elevateEdgesOnSelect:Zt,disableKeyboardA11y:J,nodeOrigin:ce,nodeExtent:Ce,rfId:ze})=>{const Ze=xA(e,lK),st=xA(t,mK);return OK(o),Q.createElement(sK,{onPaneClick:ye,onPaneMouseEnter:_e,onPaneMouseMove:Se,onPaneMouseLeave:Ve,onPaneContextMenu:Re,onPaneScroll:Oe,deleteKeyCode:F,selectionKeyCode:T,selectionOnDrag:I,selectionMode:O,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:M,panActivationKeyCode:j,zoomActivationKeyCode:V,elementsSelectable:Y,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:Z,zoomOnPinch:ne,zoomOnDoubleClick:se,panOnScroll:R,panOnScrollSpeed:ee,panOnScrollMode:ie,panOnDrag:pe,defaultViewport:B,translateExtent:z,minZoom:X,maxZoom:U,onSelectionContextMenu:v,preventScrolling:H,noDragClassName:Qt,noWheelClassName:an,noPanClassName:qt,disableKeyboardA11y:J},Q.createElement(NK,null,Q.createElement(TK,{edgeTypes:st,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:W,onEdgeContextMenu:Be,onEdgeMouseEnter:Ie,onEdgeMouseMove:rt,onEdgeMouseLeave:Le,onReconnect:we,onReconnectStart:yt,onReconnectEnd:pt,reconnectRadius:vt,defaultMarkerColor:N,noPanClassName:qt,elevateEdgesOnSelect:!!Zt,disableKeyboardA11y:J,rfId:ze},Q.createElement(LK,{style:_,type:y,component:E,containerStyle:C})),Q.createElement("div",{className:"react-flow__edgelabel-renderer"}),Q.createElement(fK,{nodeTypes:Ze,onNodeClick:s,onNodeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:L,onlyRenderVisibleElements:W,noPanClassName:qt,noDragClassName:Qt,disableKeyboardA11y:J,nodeOrigin:ce,nodeExtent:Ce,rfId:ze})))};OD.displayName="GraphView";var PK=A.memo(OD);const a_=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ko={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:a_,nodeExtent:a_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ka.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:cG,isValidConnection:void 0},MK=()=>E7((e,t)=>({...Ko,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:Qv(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",s=i?Qv(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:u,nodeOrigin:c}=t(),d=u==null?void 0:u.querySelector(".react-flow__viewport");if(!d)return;const p=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(p.transform),m=n.reduce((x,b)=>{const y=i.get(b.id);if(y!=null&&y.hidden)i.set(y.id,{...y,[zt]:{...y[zt],handleBounds:void 0}});else if(y){const _=e1(b.nodeElement);!!(_.width&&_.height&&(y.width!==_.width||y.height!==_.height||b.forceUpdate))&&(i.set(y.id,{...y,[zt]:{...y[zt],handleBounds:{source:dA(".source",b.nodeElement,h,c),target:dA(".target",b.nodeElement,h,c)}},..._}),x.push({id:y.id,type:"dimensions",dimensions:_}))}return x},[]);yD(i,c);const v=s||o&&!s&&vD(t,{initial:!0,...a});e({nodeInternals:new Map(i),fitViewOnInitDone:v}),(m==null?void 0:m.length)>0&&(r==null||r(m))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),s=n.map(a=>{const u={id:a.id,type:"position",dragging:i};return r&&(u.positionAbsolute=a.positionAbsolute,u.position=a.position),u});o(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:u}=t();if(n!=null&&n.length){if(o){const c=_D(n,a()),d=Qv(c,i,s,u);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(u=>Jo(u,!0)):(s=Hl(o(),n),a=Hl(i,[])),Pp({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(u=>Jo(u,!0)):(s=Hl(i,n),a=Hl(o(),[])),Pp({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),s=n||o(),a=r||i,u=s.map(d=>(d.selected=!1,Jo(d.id,!1))),c=a.map(d=>Jo(d.id,!1));Pp({changedNodes:u,changedEdges:c,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(a=>a.selected).map(a=>Jo(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Jo(a.id,!1));Pp({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=t1(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:u}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=xs.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[i,o]],p=s==null?void 0:s.constrain()(c,d,u);return s.transform(a,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:Ko.connectionNodeId,connectionHandleId:Ko.connectionHandleId,connectionHandleType:Ko.connectionHandleType,connectionStatus:Ko.connectionStatus,connectionStartHandle:Ko.connectionStartHandle,connectionEndHandle:Ko.connectionEndHandle}),reset:()=>e({...Ko})}),Object.is),f1=({children:e})=>{const t=A.useRef(null);return t.current||(t.current=MK()),Q.createElement(nG,{value:t.current},e)};f1.displayName="ReactFlowProvider";const RD=({children:e})=>A.useContext(og)?Q.createElement(Q.Fragment,null,e):Q.createElement(f1,null,e);RD.displayName="ReactFlowWrapper";const $K={input:cD,default:o_,output:dD,group:u1},FK={default:om,straight:o1,step:i1,smoothstep:sg,simplebezier:r1},BK=[0,0],HK=[15,15],zK={x:0,y:0,zoom:1},jK={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},DD=A.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=$K,edgeTypes:s=FK,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:d,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:y,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:I,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onNodesDelete:V,onEdgesDelete:F,onSelectionChange:W,onSelectionDragStart:Y,onSelectionDrag:L,onSelectionDragStop:B,onSelectionContextMenu:z,onSelectionStart:X,onSelectionEnd:U,connectionMode:H=ka.Strict,connectionLineType:N=os.Bezier,connectionLineStyle:Z,connectionLineComponent:ne,connectionLineContainerStyle:R,deleteKeyCode:ee="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:se=!1,selectionMode:pe=Pf.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:_e=rm()?"Meta":"Control",zoomActivationKeyCode:Se=rm()?"Meta":"Control",snapToGrid:Ve=!1,snapGrid:Oe=HK,onlyRenderVisibleElements:Re=!1,selectNodesOnDrag:Be=!0,nodesDraggable:Ie,nodesConnectable:rt,nodesFocusable:Le,nodeOrigin:we=BK,edgesFocusable:yt,edgesUpdatable:pt,elementsSelectable:vt,defaultViewport:Qt=zK,minZoom:an=.5,maxZoom:qt=2,translateExtent:Zt=a_,preventScrolling:J=!0,nodeExtent:ce,defaultMarkerColor:Ce="#b1b1b7",zoomOnScroll:ze=!0,zoomOnPinch:Ze=!0,panOnScroll:st=!1,panOnScrollSpeed:Rt=.5,panOnScrollMode:Vt=fa.Free,zoomOnDoubleClick:hn=!0,panOnDrag:mn=!0,onPaneClick:xt,onPaneMouseEnter:Ut,onPaneMouseMove:gn,onPaneMouseLeave:Vu,onPaneScroll:Bs,onPaneContextMenu:qa,children:Uu,onEdgeContextMenu:to,onEdgeDoubleClick:Pg,onEdgeMouseEnter:Mg,onEdgeMouseMove:$g,onEdgeMouseLeave:xd,onEdgeUpdate:Fg,onEdgeUpdateStart:Bg,onEdgeUpdateEnd:Hg,onReconnect:Wu,onReconnectStart:zg,onReconnectEnd:Gu,reconnectRadius:jg=10,edgeUpdaterRadius:Vg=10,onNodesChange:Ug,onEdgesChange:Wg,noDragClassName:Gg="nodrag",noWheelClassName:Kg="nowheel",noPanClassName:_d="nopan",fitView:qg=!1,fitViewOptions:wd,connectOnClick:Yg=!0,attributionPosition:Xg,proOptions:Qg,defaultEdgeOptions:Zg,elevateNodesOnSelect:Jg=!0,elevateEdgesOnSelect:ey=!1,disableKeyboardA11y:Hs=!1,autoPanOnConnect:ty=!0,autoPanOnNodeDrag:Ya=!0,connectionRadius:ny=20,isValidConnection:ry,onError:iy,style:bd,id:Ku,nodeDragThreshold:Ed,...oy},sy)=>{const qu=Ku||"1";return Q.createElement("div",{...oy,style:{...bd,...jK},ref:sy,className:Jn(["react-flow",i]),"data-testid":"rf__wrapper",id:Ku},Q.createElement(RD,null,Q.createElement(PK,{onInit:c,onMove:d,onMoveStart:p,onMoveEnd:h,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:I,nodeTypes:o,edgeTypes:s,connectionLineType:N,connectionLineStyle:Z,connectionLineComponent:ne,connectionLineContainerStyle:R,selectionKeyCode:ie,selectionOnDrag:se,selectionMode:pe,deleteKeyCode:ee,multiSelectionKeyCode:_e,panActivationKeyCode:ye,zoomActivationKeyCode:Se,onlyRenderVisibleElements:Re,selectNodesOnDrag:Be,defaultViewport:Qt,translateExtent:Zt,minZoom:an,maxZoom:qt,preventScrolling:J,zoomOnScroll:ze,zoomOnPinch:Ze,zoomOnDoubleClick:hn,panOnScroll:st,panOnScrollSpeed:Rt,panOnScrollMode:Vt,panOnDrag:mn,onPaneClick:xt,onPaneMouseEnter:Ut,onPaneMouseMove:gn,onPaneMouseLeave:Vu,onPaneScroll:Bs,onPaneContextMenu:qa,onSelectionContextMenu:z,onSelectionStart:X,onSelectionEnd:U,onEdgeContextMenu:to,onEdgeDoubleClick:Pg,onEdgeMouseEnter:Mg,onEdgeMouseMove:$g,onEdgeMouseLeave:xd,onReconnect:Wu??Fg,onReconnectStart:zg??Bg,onReconnectEnd:Gu??Hg,reconnectRadius:jg??Vg,defaultMarkerColor:Ce,noDragClassName:Gg,noWheelClassName:Kg,noPanClassName:_d,elevateEdgesOnSelect:ey,rfId:qu,disableKeyboardA11y:Hs,nodeOrigin:we,nodeExtent:ce}),Q.createElement(RG,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:y,nodesDraggable:Ie,nodesConnectable:rt,nodesFocusable:Le,edgesFocusable:yt,edgesUpdatable:pt,elementsSelectable:vt,elevateNodesOnSelect:Jg,minZoom:an,maxZoom:qt,nodeExtent:ce,onNodesChange:Ug,onEdgesChange:Wg,snapToGrid:Ve,snapGrid:Oe,connectionMode:H,translateExtent:Zt,connectOnClick:Yg,defaultEdgeOptions:Zg,fitView:qg,fitViewOptions:wd,onNodesDelete:V,onEdgesDelete:F,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onSelectionDrag:L,onSelectionDragStart:Y,onSelectionDragStop:B,noPanClassName:_d,nodeOrigin:we,rfId:qu,autoPanOnConnect:ty,autoPanOnNodeDrag:Ya,onError:iy,connectionRadius:ny,isValidConnection:ry,nodeDragThreshold:Ed}),Q.createElement(NG,{onSelectionChange:W}),Uu,Q.createElement(iG,{proOptions:Qg,position:Xg}),Q.createElement($G,{rfId:qu,disableKeyboardA11y:Hs})))});DD.displayName="ReactFlow";function VK(){const e=on();return A.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const u=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return u&&s.push({id:a,nodeElement:u,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(o))},[])}function UK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Q.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function WK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Q.createElement("path",{d:"M0 0h32v4.2H0z"}))}function GK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Q.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function KK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function qK(){return Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Uc=({children:e,className:t,...n})=>Q.createElement("button",{type:"button",className:Jn(["react-flow__controls-button",t]),...n},e);Uc.displayName="ControlButton";const YK=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),LD=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:u,className:c,children:d,position:p="bottom-left"})=>{const h=on(),[m,v]=A.useState(!1),{isInteractive:x,minZoomReached:b,maxZoomReached:y}=$t(YK,Rn),{zoomIn:_,zoomOut:E,fitView:C}=Fa();if(A.useEffect(()=>{v(!0)},[]),!m)return null;const T=()=>{_(),o==null||o()},I=()=>{E(),s==null||s()},O=()=>{C(i),a==null||a()},M=()=>{h.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)};return Q.createElement(UR,{className:Jn(["react-flow__controls",c]),position:p,style:e,"data-testid":"rf__controls"},t&&Q.createElement(Q.Fragment,null,Q.createElement(Uc,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:y},Q.createElement(UK,null)),Q.createElement(Uc,{onClick:I,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},Q.createElement(WK,null))),n&&Q.createElement(Uc,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view"},Q.createElement(GK,null)),r&&Q.createElement(Uc,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity"},x?Q.createElement(qK,null):Q.createElement(KK,null)),d)};LD.displayName="Controls";var XK=A.memo(LD),Pi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pi||(Pi={}));function QK({color:e,dimensions:t,lineWidth:n}){return Q.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function ZK({color:e,radius:t}){return Q.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const JK={[Pi.Dots]:"#91919a",[Pi.Lines]:"#eee",[Pi.Cross]:"#e2e2e2"},eq={[Pi.Dots]:1,[Pi.Lines]:1,[Pi.Cross]:6},tq=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function PD({id:e,variant:t=Pi.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=2,color:s,style:a,className:u}){const c=A.useRef(null),{transform:d,patternId:p}=$t(tq,Rn),h=s||JK[t],m=r||eq[t],v=t===Pi.Dots,x=t===Pi.Cross,b=Array.isArray(n)?n:[n,n],y=[b[0]*d[2]||1,b[1]*d[2]||1],_=m*d[2],E=x?[_,_]:y,C=v?[_/o,_/o]:[E[0]/o,E[1]/o];return Q.createElement("svg",{className:Jn(["react-flow__background",u]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},Q.createElement("pattern",{id:p+e,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},v?Q.createElement(ZK,{color:h,radius:_/o}):Q.createElement(QK,{dimensions:E,color:h,lineWidth:i})),Q.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}PD.displayName="Background";var nq=A.memo(PD);const At={blue:"#0d6efd",indigo:"#6610f2",purple:"#6f42c1",pink:"#d63384",red:"#dc3545",orange:"#fd7e14",yellow:"#ffc107",green:"#198754",teal:"#20c997",cyan:"#0dcaf0",gray100:"#f8f9fa",gray200:"#e9ecef",gray300:"#dee2e6",gray400:"#ced4da",gray500:"#adb5bd",gray600:"#6c757d",gray700:"#495057",gray800:"#343a40",gray900:"#212529"};var sm={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",p=1,h=2,m=4,v=1,x=2,b=1,y=2,_=4,E=8,C=16,T=32,I=64,O=128,M=256,j=512,V=30,F="...",W=800,Y=16,L=1,B=2,z=3,X=1/0,U=9007199254740991,H=17976931348623157e292,N=NaN,Z=4294967295,ne=Z-1,R=Z>>>1,ee=[["ary",O],["bind",b],["bindKey",y],["curry",E],["curryRight",C],["flip",j],["partial",T],["partialRight",I],["rearg",M]],ie="[object Arguments]",se="[object Array]",pe="[object AsyncFunction]",ye="[object Boolean]",_e="[object Date]",Se="[object DOMException]",Ve="[object Error]",Oe="[object Function]",Re="[object GeneratorFunction]",Be="[object Map]",Ie="[object Number]",rt="[object Null]",Le="[object Object]",we="[object Promise]",yt="[object Proxy]",pt="[object RegExp]",vt="[object Set]",Qt="[object String]",an="[object Symbol]",qt="[object Undefined]",Zt="[object WeakMap]",J="[object WeakSet]",ce="[object ArrayBuffer]",Ce="[object DataView]",ze="[object Float32Array]",Ze="[object Float64Array]",st="[object Int8Array]",Rt="[object Int16Array]",Vt="[object Int32Array]",hn="[object Uint8Array]",mn="[object Uint8ClampedArray]",xt="[object Uint16Array]",Ut="[object Uint32Array]",gn=/\b__p \+= '';/g,Vu=/\b(__p \+=) '' \+/g,Bs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qa=/&(?:amp|lt|gt|quot|#39);/g,Uu=/[&<>"']/g,to=RegExp(qa.source),Pg=RegExp(Uu.source),Mg=/<%-([\s\S]+?)%>/g,$g=/<%([\s\S]+?)%>/g,xd=/<%=([\s\S]+?)%>/g,Fg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bg=/^\w*$/,Hg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wu=/[\\^$.*+?()[\]{}|]/g,zg=RegExp(Wu.source),Gu=/^\s+/,jg=/\s/,Vg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ug=/\{\n\/\* \[wrapped with (.+)\] \*/,Wg=/,? & /,Gg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kg=/[()=,{}\[\]\/\s]/,_d=/\\(\\)?/g,qg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wd=/\w*$/,Yg=/^[-+]0x[0-9a-f]+$/i,Xg=/^0b[01]+$/i,Qg=/^\[object .+?Constructor\]$/,Zg=/^0o[0-7]+$/i,Jg=/^(?:0|[1-9]\d*)$/,ey=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hs=/($^)/,ty=/['\n\r\u2028\u2029\\]/g,Ya="\\ud800-\\udfff",ny="\\u0300-\\u036f",ry="\\ufe20-\\ufe2f",iy="\\u20d0-\\u20ff",bd=ny+ry+iy,Ku="\\u2700-\\u27bf",Ed="a-z\\xdf-\\xf6\\xf8-\\xff",oy="\\xac\\xb1\\xd7\\xf7",sy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qu="\\u2000-\\u206f",U3=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wb="A-Z\\xc0-\\xd6\\xd8-\\xde",Gb="\\ufe0e\\ufe0f",Kb=oy+sy+qu+U3,ay="['’]",W3="["+Ya+"]",qb="["+Kb+"]",Sd="["+bd+"]",Yb="\\d+",G3="["+Ku+"]",Xb="["+Ed+"]",Qb="[^"+Ya+Kb+Yb+Ku+Ed+Wb+"]",ly="\\ud83c[\\udffb-\\udfff]",K3="(?:"+Sd+"|"+ly+")",Zb="[^"+Ya+"]",uy="(?:\\ud83c[\\udde6-\\uddff]){2}",cy="[\\ud800-\\udbff][\\udc00-\\udfff]",Xa="["+Wb+"]",Jb="\\u200d",eE="(?:"+Xb+"|"+Qb+")",q3="(?:"+Xa+"|"+Qb+")",tE="(?:"+ay+"(?:d|ll|m|re|s|t|ve))?",nE="(?:"+ay+"(?:D|LL|M|RE|S|T|VE))?",rE=K3+"?",iE="["+Gb+"]?",Y3="(?:"+Jb+"(?:"+[Zb,uy,cy].join("|")+")"+iE+rE+")*",X3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Q3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",oE=iE+rE+Y3,Z3="(?:"+[G3,uy,cy].join("|")+")"+oE,J3="(?:"+[Zb+Sd+"?",Sd,uy,cy,W3].join("|")+")",eF=RegExp(ay,"g"),tF=RegExp(Sd,"g"),fy=RegExp(ly+"(?="+ly+")|"+J3+oE,"g"),nF=RegExp([Xa+"?"+Xb+"+"+tE+"(?="+[qb,Xa,"$"].join("|")+")",q3+"+"+nE+"(?="+[qb,Xa+eE,"$"].join("|")+")",Xa+"?"+eE+"+"+tE,Xa+"+"+nE,Q3,X3,Yb,Z3].join("|"),"g"),rF=RegExp("["+Jb+Ya+bd+Gb+"]"),iF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],sF=-1,Ct={};Ct[ze]=Ct[Ze]=Ct[st]=Ct[Rt]=Ct[Vt]=Ct[hn]=Ct[mn]=Ct[xt]=Ct[Ut]=!0,Ct[ie]=Ct[se]=Ct[ce]=Ct[ye]=Ct[Ce]=Ct[_e]=Ct[Ve]=Ct[Oe]=Ct[Be]=Ct[Ie]=Ct[Le]=Ct[pt]=Ct[vt]=Ct[Qt]=Ct[Zt]=!1;var wt={};wt[ie]=wt[se]=wt[ce]=wt[Ce]=wt[ye]=wt[_e]=wt[ze]=wt[Ze]=wt[st]=wt[Rt]=wt[Vt]=wt[Be]=wt[Ie]=wt[Le]=wt[pt]=wt[vt]=wt[Qt]=wt[an]=wt[hn]=wt[mn]=wt[xt]=wt[Ut]=!0,wt[Ve]=wt[Oe]=wt[Zt]=!1;var aF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lF={"&":"&","<":"<",">":">",'"':""","'":"'"},uF={"&":"&","<":"<",">":">",""":'"',"'":"'"},cF={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fF=parseFloat,dF=parseInt,sE=typeof ra=="object"&&ra&&ra.Object===Object&&ra,pF=typeof self=="object"&&self&&self.Object===Object&&self,yn=sE||pF||Function("return this")(),dy=t&&!t.nodeType&&t,zs=dy&&!0&&e&&!e.nodeType&&e,aE=zs&&zs.exports===dy,py=aE&&sE.process,qr=function(){try{var K=zs&&zs.require&&zs.require("util").types;return K||py&&py.binding&&py.binding("util")}catch{}}(),lE=qr&&qr.isArrayBuffer,uE=qr&&qr.isDate,cE=qr&&qr.isMap,fE=qr&&qr.isRegExp,dE=qr&&qr.isSet,pE=qr&&qr.isTypedArray;function Sr(K,oe,re){switch(re.length){case 0:return K.call(oe);case 1:return K.call(oe,re[0]);case 2:return K.call(oe,re[0],re[1]);case 3:return K.call(oe,re[0],re[1],re[2])}return K.apply(oe,re)}function hF(K,oe,re,be){for(var je=-1,at=K==null?0:K.length;++je-1}function hy(K,oe,re){for(var be=-1,je=K==null?0:K.length;++be-1;);return re}function wE(K,oe){for(var re=K.length;re--&&Qa(oe,K[re],0)>-1;);return re}function EF(K,oe){for(var re=K.length,be=0;re--;)K[re]===oe&&++be;return be}var SF=vy(aF),CF=vy(lF);function IF(K){return"\\"+cF[K]}function AF(K,oe){return K==null?n:K[oe]}function Za(K){return rF.test(K)}function TF(K){return iF.test(K)}function kF(K){for(var oe,re=[];!(oe=K.next()).done;)re.push(oe.value);return re}function by(K){var oe=-1,re=Array(K.size);return K.forEach(function(be,je){re[++oe]=[je,be]}),re}function bE(K,oe){return function(re){return K(oe(re))}}function Bo(K,oe){for(var re=-1,be=K.length,je=0,at=[];++re-1}function gB(l,f){var g=this.__data__,w=jd(g,l);return w<0?(++this.size,g.push([l,f])):g[w][1]=f,this}no.prototype.clear=dB,no.prototype.delete=pB,no.prototype.get=hB,no.prototype.has=mB,no.prototype.set=gB;function ro(l){var f=-1,g=l==null?0:l.length;for(this.clear();++f=f?l:f)),l}function Zr(l,f,g,w,k,P){var $,G=f&p,q=f&h,ae=f&m;if(g&&($=k?g(l,w,k,P):g(l)),$!==n)return $;if(!Dt(l))return l;var le=Ue(l);if(le){if($=_4(l),!G)return ir(l,$)}else{var fe=In(l),xe=fe==Oe||fe==Re;if(Wo(l))return iS(l,G);if(fe==Le||fe==ie||xe&&!k){if($=q||xe?{}:ES(l),!G)return q?u4(l,RB($,l)):l4(l,LE($,l))}else{if(!wt[fe])return k?l:{};$=w4(l,fe,G)}}P||(P=new bi);var Ae=P.get(l);if(Ae)return Ae;P.set(l,$),ZS(l)?l.forEach(function($e){$.add(Zr($e,f,g,$e,l,P))}):XS(l)&&l.forEach(function($e,Je){$.set(Je,Zr($e,f,g,Je,l,P))});var Me=ae?q?qy:Ky:q?sr:ln,qe=le?n:Me(l);return Yr(qe||l,function($e,Je){qe&&(Je=$e,$e=l[Je]),tc($,Je,Zr($e,f,g,Je,l,P))}),$}function DB(l){var f=ln(l);return function(g){return PE(g,l,f)}}function PE(l,f,g){var w=g.length;if(l==null)return!w;for(l=_t(l);w--;){var k=g[w],P=f[k],$=l[k];if($===n&&!(k in l)||!P($))return!1}return!0}function ME(l,f,g){if(typeof l!="function")throw new Xr(s);return lc(function(){l.apply(n,g)},f)}function nc(l,f,g,w){var k=-1,P=Cd,$=!0,G=l.length,q=[],ae=f.length;if(!G)return q;g&&(f=kt(f,Cr(g))),w?(P=hy,$=!1):f.length>=i&&(P=Yu,$=!1,f=new Us(f));e:for(;++kk?0:k+g),w=w===n||w>k?k:Ke(w),w<0&&(w+=k),w=g>w?0:eC(w);g0&&g(G)?f>1?vn(G,f-1,g,w,k):Fo(k,G):w||(k[k.length]=G)}return k}var ky=cS(),BE=cS(!0);function Hi(l,f){return l&&ky(l,f,ln)}function Ny(l,f){return l&&BE(l,f,ln)}function Ud(l,f){return $o(f,function(g){return lo(l[g])})}function Gs(l,f){f=Vo(f,l);for(var g=0,w=f.length;l!=null&&gf}function MB(l,f){return l!=null&&ht.call(l,f)}function $B(l,f){return l!=null&&f in _t(l)}function FB(l,f,g){return l>=Cn(f,g)&&l=120&&le.length>=120)?new Us($&&le):n}le=l[0];var fe=-1,xe=G[0];e:for(;++fe-1;)G!==l&&Pd.call(G,q,1),Pd.call(l,q,1);return l}function XE(l,f){for(var g=l?f.length:0,w=g-1;g--;){var k=f[g];if(g==w||k!==P){var P=k;ao(k)?Pd.call(l,k,1):Hy(l,k)}}return l}function $y(l,f){return l+Fd(NE()*(f-l+1))}function QB(l,f,g,w){for(var k=-1,P=en($d((f-l)/(g||1)),0),$=re(P);P--;)$[w?P:++k]=l,l+=g;return $}function Fy(l,f){var g="";if(!l||f<1||f>U)return g;do f%2&&(g+=l),f=Fd(f/2),f&&(l+=l);while(f);return g}function Xe(l,f){return tv(IS(l,f,ar),l+"")}function ZB(l){return DE(ul(l))}function JB(l,f){var g=ul(l);return tp(g,Ws(f,0,g.length))}function oc(l,f,g,w){if(!Dt(l))return l;f=Vo(f,l);for(var k=-1,P=f.length,$=P-1,G=l;G!=null&&++kk?0:k+f),g=g>k?k:g,g<0&&(g+=k),k=f>g?0:g-f>>>0,f>>>=0;for(var P=re(k);++w>>1,$=l[P];$!==null&&!Ar($)&&(g?$<=f:$=i){var ae=f?null:p4(l);if(ae)return Ad(ae);$=!1,k=Yu,q=new Us}else q=f?[]:G;e:for(;++w=w?l:Jr(l,f,g)}var rS=UF||function(l){return yn.clearTimeout(l)};function iS(l,f){if(f)return l.slice();var g=l.length,w=CE?CE(g):new l.constructor(g);return l.copy(w),w}function Uy(l){var f=new l.constructor(l.byteLength);return new Dd(f).set(new Dd(l)),f}function i4(l,f){var g=f?Uy(l.buffer):l.buffer;return new l.constructor(g,l.byteOffset,l.byteLength)}function o4(l){var f=new l.constructor(l.source,wd.exec(l));return f.lastIndex=l.lastIndex,f}function s4(l){return ec?_t(ec.call(l)):{}}function oS(l,f){var g=f?Uy(l.buffer):l.buffer;return new l.constructor(g,l.byteOffset,l.length)}function sS(l,f){if(l!==f){var g=l!==n,w=l===null,k=l===l,P=Ar(l),$=f!==n,G=f===null,q=f===f,ae=Ar(f);if(!G&&!ae&&!P&&l>f||P&&$&&q&&!G&&!ae||w&&$&&q||!g&&q||!k)return 1;if(!w&&!P&&!ae&&l=G)return q;var ae=g[w];return q*(ae=="desc"?-1:1)}}return l.index-f.index}function aS(l,f,g,w){for(var k=-1,P=l.length,$=g.length,G=-1,q=f.length,ae=en(P-$,0),le=re(q+ae),fe=!w;++G1?g[k-1]:n,$=k>2?g[2]:n;for(P=l.length>3&&typeof P=="function"?(k--,P):n,$&&Hn(g[0],g[1],$)&&(P=k<3?n:P,k=1),f=_t(f);++w-1?k[P?f[$]:$]:n}}function pS(l){return so(function(f){var g=f.length,w=g,k=Qr.prototype.thru;for(l&&f.reverse();w--;){var P=f[w];if(typeof P!="function")throw new Xr(s);if(k&&!$&&Jd(P)=="wrapper")var $=new Qr([],!0)}for(w=$?w:g;++w1&&nt.reverse(),le&&qG))return!1;var ae=P.get(l),le=P.get(f);if(ae&&le)return ae==f&&le==l;var fe=-1,xe=!0,Ae=g&x?new Us:n;for(P.set(l,f),P.set(f,l);++fe1?"& ":"")+f[w],f=f.join(g>2?", ":" "),l.replace(Vg,`{ +/* [wrapped with `+f+`] */ +`)}function E4(l){return Ue(l)||Ys(l)||!!(TE&&l&&l[TE])}function ao(l,f){var g=typeof l;return f=f??U,!!f&&(g=="number"||g!="symbol"&&Jg.test(l))&&l>-1&&l%1==0&&l0){if(++f>=W)return arguments[0]}else f=0;return l.apply(n,arguments)}}function tp(l,f){var g=-1,w=l.length,k=w-1;for(f=f===n?w:f;++g1?l[f-1]:n;return g=typeof g=="function"?(l.pop(),g):n,FS(l,g)});function BS(l){var f=D(l);return f.__chain__=!0,f}function L5(l,f){return f(l),l}function np(l,f){return f(l)}var P5=so(function(l){var f=l.length,g=f?l[0]:0,w=this.__wrapped__,k=function(P){return Ty(P,l)};return f>1||this.__actions__.length||!(w instanceof tt)||!ao(g)?this.thru(k):(w=w.slice(g,+g+(f?1:0)),w.__actions__.push({func:np,args:[k],thisArg:n}),new Qr(w,this.__chain__).thru(function(P){return f&&!P.length&&P.push(n),P}))});function M5(){return BS(this)}function $5(){return new Qr(this.value(),this.__chain__)}function F5(){this.__values__===n&&(this.__values__=JS(this.value()));var l=this.__index__>=this.__values__.length,f=l?n:this.__values__[this.__index__++];return{done:l,value:f}}function B5(){return this}function H5(l){for(var f,g=this;g instanceof zd;){var w=RS(g);w.__index__=0,w.__values__=n,f?k.__wrapped__=w:f=w;var k=w;g=g.__wrapped__}return k.__wrapped__=l,f}function z5(){var l=this.__wrapped__;if(l instanceof tt){var f=l;return this.__actions__.length&&(f=new tt(this)),f=f.reverse(),f.__actions__.push({func:np,args:[nv],thisArg:n}),new Qr(f,this.__chain__)}return this.thru(nv)}function j5(){return tS(this.__wrapped__,this.__actions__)}var V5=qd(function(l,f,g){ht.call(l,g)?++l[g]:io(l,g,1)});function U5(l,f,g){var w=Ue(l)?hE:LB;return g&&Hn(l,f,g)&&(f=n),w(l,Pe(f,3))}function W5(l,f){var g=Ue(l)?$o:FE;return g(l,Pe(f,3))}var G5=dS(DS),K5=dS(LS);function q5(l,f){return vn(rp(l,f),1)}function Y5(l,f){return vn(rp(l,f),X)}function X5(l,f,g){return g=g===n?1:Ke(g),vn(rp(l,f),g)}function HS(l,f){var g=Ue(l)?Yr:zo;return g(l,Pe(f,3))}function zS(l,f){var g=Ue(l)?mF:$E;return g(l,Pe(f,3))}var Q5=qd(function(l,f,g){ht.call(l,g)?l[g].push(f):io(l,g,[f])});function Z5(l,f,g,w){l=or(l)?l:ul(l),g=g&&!w?Ke(g):0;var k=l.length;return g<0&&(g=en(k+g,0)),lp(l)?g<=k&&l.indexOf(f,g)>-1:!!k&&Qa(l,f,g)>-1}var J5=Xe(function(l,f,g){var w=-1,k=typeof f=="function",P=or(l)?re(l.length):[];return zo(l,function($){P[++w]=k?Sr(f,$,g):rc($,f,g)}),P}),eH=qd(function(l,f,g){io(l,g,f)});function rp(l,f){var g=Ue(l)?kt:UE;return g(l,Pe(f,3))}function tH(l,f,g,w){return l==null?[]:(Ue(f)||(f=f==null?[]:[f]),g=w?n:g,Ue(g)||(g=g==null?[]:[g]),qE(l,f,g))}var nH=qd(function(l,f,g){l[g?0:1].push(f)},function(){return[[],[]]});function rH(l,f,g){var w=Ue(l)?my:vE,k=arguments.length<3;return w(l,Pe(f,4),g,k,zo)}function iH(l,f,g){var w=Ue(l)?gF:vE,k=arguments.length<3;return w(l,Pe(f,4),g,k,$E)}function oH(l,f){var g=Ue(l)?$o:FE;return g(l,sp(Pe(f,3)))}function sH(l){var f=Ue(l)?DE:ZB;return f(l)}function aH(l,f,g){(g?Hn(l,f,g):f===n)?f=1:f=Ke(f);var w=Ue(l)?kB:JB;return w(l,f)}function lH(l){var f=Ue(l)?NB:t4;return f(l)}function uH(l){if(l==null)return 0;if(or(l))return lp(l)?Ja(l):l.length;var f=In(l);return f==Be||f==vt?l.size:Ly(l).length}function cH(l,f,g){var w=Ue(l)?gy:n4;return g&&Hn(l,f,g)&&(f=n),w(l,Pe(f,3))}var fH=Xe(function(l,f){if(l==null)return[];var g=f.length;return g>1&&Hn(l,f[0],f[1])?f=[]:g>2&&Hn(f[0],f[1],f[2])&&(f=[f[0]]),qE(l,vn(f,1),[])}),ip=WF||function(){return yn.Date.now()};function dH(l,f){if(typeof f!="function")throw new Xr(s);return l=Ke(l),function(){if(--l<1)return f.apply(this,arguments)}}function jS(l,f,g){return f=g?n:f,f=l&&f==null?l.length:f,oo(l,O,n,n,n,n,f)}function VS(l,f){var g;if(typeof f!="function")throw new Xr(s);return l=Ke(l),function(){return--l>0&&(g=f.apply(this,arguments)),l<=1&&(f=n),g}}var iv=Xe(function(l,f,g){var w=b;if(g.length){var k=Bo(g,al(iv));w|=T}return oo(l,w,f,g,k)}),US=Xe(function(l,f,g){var w=b|y;if(g.length){var k=Bo(g,al(US));w|=T}return oo(f,w,l,g,k)});function WS(l,f,g){f=g?n:f;var w=oo(l,E,n,n,n,n,n,f);return w.placeholder=WS.placeholder,w}function GS(l,f,g){f=g?n:f;var w=oo(l,C,n,n,n,n,n,f);return w.placeholder=GS.placeholder,w}function KS(l,f,g){var w,k,P,$,G,q,ae=0,le=!1,fe=!1,xe=!0;if(typeof l!="function")throw new Xr(s);f=ti(f)||0,Dt(g)&&(le=!!g.leading,fe="maxWait"in g,P=fe?en(ti(g.maxWait)||0,f):P,xe="trailing"in g?!!g.trailing:xe);function Ae(Gt){var Si=w,co=k;return w=k=n,ae=Gt,$=l.apply(co,Si),$}function Me(Gt){return ae=Gt,G=lc(Je,f),le?Ae(Gt):$}function qe(Gt){var Si=Gt-q,co=Gt-ae,dC=f-Si;return fe?Cn(dC,P-co):dC}function $e(Gt){var Si=Gt-q,co=Gt-ae;return q===n||Si>=f||Si<0||fe&&co>=P}function Je(){var Gt=ip();if($e(Gt))return nt(Gt);G=lc(Je,qe(Gt))}function nt(Gt){return G=n,xe&&w?Ae(Gt):(w=k=n,$)}function Tr(){G!==n&&rS(G),ae=0,w=q=k=G=n}function zn(){return G===n?$:nt(ip())}function kr(){var Gt=ip(),Si=$e(Gt);if(w=arguments,k=this,q=Gt,Si){if(G===n)return Me(q);if(fe)return rS(G),G=lc(Je,f),Ae(q)}return G===n&&(G=lc(Je,f)),$}return kr.cancel=Tr,kr.flush=zn,kr}var pH=Xe(function(l,f){return ME(l,1,f)}),hH=Xe(function(l,f,g){return ME(l,ti(f)||0,g)});function mH(l){return oo(l,j)}function op(l,f){if(typeof l!="function"||f!=null&&typeof f!="function")throw new Xr(s);var g=function(){var w=arguments,k=f?f.apply(this,w):w[0],P=g.cache;if(P.has(k))return P.get(k);var $=l.apply(this,w);return g.cache=P.set(k,$)||P,$};return g.cache=new(op.Cache||ro),g}op.Cache=ro;function sp(l){if(typeof l!="function")throw new Xr(s);return function(){var f=arguments;switch(f.length){case 0:return!l.call(this);case 1:return!l.call(this,f[0]);case 2:return!l.call(this,f[0],f[1]);case 3:return!l.call(this,f[0],f[1],f[2])}return!l.apply(this,f)}}function gH(l){return VS(2,l)}var yH=r4(function(l,f){f=f.length==1&&Ue(f[0])?kt(f[0],Cr(Pe())):kt(vn(f,1),Cr(Pe()));var g=f.length;return Xe(function(w){for(var k=-1,P=Cn(w.length,g);++k=f}),Ys=zE(function(){return arguments}())?zE:function(l){return Ft(l)&&ht.call(l,"callee")&&!AE.call(l,"callee")},Ue=re.isArray,RH=lE?Cr(lE):HB;function or(l){return l!=null&&ap(l.length)&&!lo(l)}function Wt(l){return Ft(l)&&or(l)}function DH(l){return l===!0||l===!1||Ft(l)&&Bn(l)==ye}var Wo=KF||gv,LH=uE?Cr(uE):zB;function PH(l){return Ft(l)&&l.nodeType===1&&!uc(l)}function MH(l){if(l==null)return!0;if(or(l)&&(Ue(l)||typeof l=="string"||typeof l.splice=="function"||Wo(l)||ll(l)||Ys(l)))return!l.length;var f=In(l);if(f==Be||f==vt)return!l.size;if(ac(l))return!Ly(l).length;for(var g in l)if(ht.call(l,g))return!1;return!0}function $H(l,f){return ic(l,f)}function FH(l,f,g){g=typeof g=="function"?g:n;var w=g?g(l,f):n;return w===n?ic(l,f,n,g):!!w}function sv(l){if(!Ft(l))return!1;var f=Bn(l);return f==Ve||f==Se||typeof l.message=="string"&&typeof l.name=="string"&&!uc(l)}function BH(l){return typeof l=="number"&&kE(l)}function lo(l){if(!Dt(l))return!1;var f=Bn(l);return f==Oe||f==Re||f==pe||f==yt}function YS(l){return typeof l=="number"&&l==Ke(l)}function ap(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=U}function Dt(l){var f=typeof l;return l!=null&&(f=="object"||f=="function")}function Ft(l){return l!=null&&typeof l=="object"}var XS=cE?Cr(cE):VB;function HH(l,f){return l===f||Dy(l,f,Xy(f))}function zH(l,f,g){return g=typeof g=="function"?g:n,Dy(l,f,Xy(f),g)}function jH(l){return QS(l)&&l!=+l}function VH(l){if(I4(l))throw new je(o);return jE(l)}function UH(l){return l===null}function WH(l){return l==null}function QS(l){return typeof l=="number"||Ft(l)&&Bn(l)==Ie}function uc(l){if(!Ft(l)||Bn(l)!=Le)return!1;var f=Ld(l);if(f===null)return!0;var g=ht.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&Nd.call(g)==zF}var av=fE?Cr(fE):UB;function GH(l){return YS(l)&&l>=-U&&l<=U}var ZS=dE?Cr(dE):WB;function lp(l){return typeof l=="string"||!Ue(l)&&Ft(l)&&Bn(l)==Qt}function Ar(l){return typeof l=="symbol"||Ft(l)&&Bn(l)==an}var ll=pE?Cr(pE):GB;function KH(l){return l===n}function qH(l){return Ft(l)&&In(l)==Zt}function YH(l){return Ft(l)&&Bn(l)==J}var XH=Zd(Py),QH=Zd(function(l,f){return l<=f});function JS(l){if(!l)return[];if(or(l))return lp(l)?wi(l):ir(l);if(Xu&&l[Xu])return kF(l[Xu]());var f=In(l),g=f==Be?by:f==vt?Ad:ul;return g(l)}function uo(l){if(!l)return l===0?l:0;if(l=ti(l),l===X||l===-X){var f=l<0?-1:1;return f*H}return l===l?l:0}function Ke(l){var f=uo(l),g=f%1;return f===f?g?f-g:f:0}function eC(l){return l?Ws(Ke(l),0,Z):0}function ti(l){if(typeof l=="number")return l;if(Ar(l))return N;if(Dt(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=Dt(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=xE(l);var g=Xg.test(l);return g||Zg.test(l)?dF(l.slice(2),g?2:8):Yg.test(l)?N:+l}function tC(l){return zi(l,sr(l))}function ZH(l){return l?Ws(Ke(l),-U,U):l===0?l:0}function ut(l){return l==null?"":Ir(l)}var JH=ol(function(l,f){if(ac(f)||or(f)){zi(f,ln(f),l);return}for(var g in f)ht.call(f,g)&&tc(l,g,f[g])}),nC=ol(function(l,f){zi(f,sr(f),l)}),up=ol(function(l,f,g,w){zi(f,sr(f),l,w)}),ez=ol(function(l,f,g,w){zi(f,ln(f),l,w)}),tz=so(Ty);function nz(l,f){var g=il(l);return f==null?g:LE(g,f)}var rz=Xe(function(l,f){l=_t(l);var g=-1,w=f.length,k=w>2?f[2]:n;for(k&&Hn(f[0],f[1],k)&&(w=1);++g1),P}),zi(l,qy(l),g),w&&(g=Zr(g,p|h|m,h4));for(var k=f.length;k--;)Hy(g,f[k]);return g});function wz(l,f){return iC(l,sp(Pe(f)))}var bz=so(function(l,f){return l==null?{}:YB(l,f)});function iC(l,f){if(l==null)return{};var g=kt(qy(l),function(w){return[w]});return f=Pe(f),YE(l,g,function(w,k){return f(w,k[0])})}function Ez(l,f,g){f=Vo(f,l);var w=-1,k=f.length;for(k||(k=1,l=n);++wf){var w=l;l=f,f=w}if(g||l%1||f%1){var k=NE();return Cn(l+k*(f-l+fF("1e-"+((k+"").length-1))),f)}return $y(l,f)}var Lz=sl(function(l,f,g){return f=f.toLowerCase(),l+(g?aC(f):f)});function aC(l){return cv(ut(l).toLowerCase())}function lC(l){return l=ut(l),l&&l.replace(ey,SF).replace(tF,"")}function Pz(l,f,g){l=ut(l),f=Ir(f);var w=l.length;g=g===n?w:Ws(Ke(g),0,w);var k=g;return g-=f.length,g>=0&&l.slice(g,k)==f}function Mz(l){return l=ut(l),l&&Pg.test(l)?l.replace(Uu,CF):l}function $z(l){return l=ut(l),l&&zg.test(l)?l.replace(Wu,"\\$&"):l}var Fz=sl(function(l,f,g){return l+(g?"-":"")+f.toLowerCase()}),Bz=sl(function(l,f,g){return l+(g?" ":"")+f.toLowerCase()}),Hz=fS("toLowerCase");function zz(l,f,g){l=ut(l),f=Ke(f);var w=f?Ja(l):0;if(!f||w>=f)return l;var k=(f-w)/2;return Qd(Fd(k),g)+l+Qd($d(k),g)}function jz(l,f,g){l=ut(l),f=Ke(f);var w=f?Ja(l):0;return f&&w>>0,g?(l=ut(l),l&&(typeof f=="string"||f!=null&&!av(f))&&(f=Ir(f),!f&&Za(l))?Uo(wi(l),0,g):l.split(f,g)):[]}var Yz=sl(function(l,f,g){return l+(g?" ":"")+cv(f)});function Xz(l,f,g){return l=ut(l),g=g==null?0:Ws(Ke(g),0,l.length),f=Ir(f),l.slice(g,g+f.length)==f}function Qz(l,f,g){var w=D.templateSettings;g&&Hn(l,f,g)&&(f=n),l=ut(l),f=up({},f,w,vS);var k=up({},f.imports,w.imports,vS),P=ln(k),$=wy(k,P),G,q,ae=0,le=f.interpolate||Hs,fe="__p += '",xe=Ey((f.escape||Hs).source+"|"+le.source+"|"+(le===xd?qg:Hs).source+"|"+(f.evaluate||Hs).source+"|$","g"),Ae="//# sourceURL="+(ht.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++sF+"]")+` +`;l.replace(xe,function($e,Je,nt,Tr,zn,kr){return nt||(nt=Tr),fe+=l.slice(ae,kr).replace(ty,IF),Je&&(G=!0,fe+=`' + +__e(`+Je+`) + +'`),zn&&(q=!0,fe+=`'; +`+zn+`; +__p += '`),nt&&(fe+=`' + +((__t = (`+nt+`)) == null ? '' : __t) + +'`),ae=kr+$e.length,$e}),fe+=`'; +`;var Me=ht.call(f,"variable")&&f.variable;if(!Me)fe=`with (obj) { +`+fe+` +} +`;else if(Kg.test(Me))throw new je(a);fe=(q?fe.replace(gn,""):fe).replace(Vu,"$1").replace(Bs,"$1;"),fe="function("+(Me||"obj")+`) { +`+(Me?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(G?", __e = _.escape":"")+(q?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+fe+`return __p +}`;var qe=cC(function(){return at(P,Ae+"return "+fe).apply(n,$)});if(qe.source=fe,sv(qe))throw qe;return qe}function Zz(l){return ut(l).toLowerCase()}function Jz(l){return ut(l).toUpperCase()}function ej(l,f,g){if(l=ut(l),l&&(g||f===n))return xE(l);if(!l||!(f=Ir(f)))return l;var w=wi(l),k=wi(f),P=_E(w,k),$=wE(w,k)+1;return Uo(w,P,$).join("")}function tj(l,f,g){if(l=ut(l),l&&(g||f===n))return l.slice(0,EE(l)+1);if(!l||!(f=Ir(f)))return l;var w=wi(l),k=wE(w,wi(f))+1;return Uo(w,0,k).join("")}function nj(l,f,g){if(l=ut(l),l&&(g||f===n))return l.replace(Gu,"");if(!l||!(f=Ir(f)))return l;var w=wi(l),k=_E(w,wi(f));return Uo(w,k).join("")}function rj(l,f){var g=V,w=F;if(Dt(f)){var k="separator"in f?f.separator:k;g="length"in f?Ke(f.length):g,w="omission"in f?Ir(f.omission):w}l=ut(l);var P=l.length;if(Za(l)){var $=wi(l);P=$.length}if(g>=P)return l;var G=g-Ja(w);if(G<1)return w;var q=$?Uo($,0,G).join(""):l.slice(0,G);if(k===n)return q+w;if($&&(G+=q.length-G),av(k)){if(l.slice(G).search(k)){var ae,le=q;for(k.global||(k=Ey(k.source,ut(wd.exec(k))+"g")),k.lastIndex=0;ae=k.exec(le);)var fe=ae.index;q=q.slice(0,fe===n?G:fe)}}else if(l.indexOf(Ir(k),G)!=G){var xe=q.lastIndexOf(k);xe>-1&&(q=q.slice(0,xe))}return q+w}function ij(l){return l=ut(l),l&&to.test(l)?l.replace(qa,DF):l}var oj=sl(function(l,f,g){return l+(g?" ":"")+f.toUpperCase()}),cv=fS("toUpperCase");function uC(l,f,g){return l=ut(l),f=g?n:f,f===n?TF(l)?MF(l):xF(l):l.match(f)||[]}var cC=Xe(function(l,f){try{return Sr(l,n,f)}catch(g){return sv(g)?g:new je(g)}}),sj=so(function(l,f){return Yr(f,function(g){g=ji(g),io(l,g,iv(l[g],l))}),l});function aj(l){var f=l==null?0:l.length,g=Pe();return l=f?kt(l,function(w){if(typeof w[1]!="function")throw new Xr(s);return[g(w[0]),w[1]]}):[],Xe(function(w){for(var k=-1;++kU)return[];var g=Z,w=Cn(l,Z);f=Pe(f),l-=Z;for(var k=_y(w,f);++g0||f<0)?new tt(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),f!==n&&(f=Ke(f),g=f<0?g.dropRight(-f):g.take(f-l)),g)},tt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},tt.prototype.toArray=function(){return this.take(Z)},Hi(tt.prototype,function(l,f){var g=/^(?:filter|find|map|reject)|While$/.test(f),w=/^(?:head|last)$/.test(f),k=D[w?"take"+(f=="last"?"Right":""):f],P=w||/^find/.test(f);k&&(D.prototype[f]=function(){var $=this.__wrapped__,G=w?[1]:arguments,q=$ instanceof tt,ae=G[0],le=q||Ue($),fe=function(Je){var nt=k.apply(D,Fo([Je],G));return w&&xe?nt[0]:nt};le&&g&&typeof ae=="function"&&ae.length!=1&&(q=le=!1);var xe=this.__chain__,Ae=!!this.__actions__.length,Me=P&&!xe,qe=q&&!Ae;if(!P&&le){$=qe?$:new tt(this);var $e=l.apply($,G);return $e.__actions__.push({func:np,args:[fe],thisArg:n}),new Qr($e,xe)}return Me&&qe?l.apply(this,G):($e=this.thru(fe),Me?w?$e.value()[0]:$e.value():$e)})}),Yr(["pop","push","shift","sort","splice","unshift"],function(l){var f=Td[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",w=/^(?:pop|shift)$/.test(l);D.prototype[l]=function(){var k=arguments;if(w&&!this.__chain__){var P=this.value();return f.apply(Ue(P)?P:[],k)}return this[g](function($){return f.apply(Ue($)?$:[],k)})}}),Hi(tt.prototype,function(l,f){var g=D[f];if(g){var w=g.name+"";ht.call(rl,w)||(rl[w]=[]),rl[w].push({name:f,func:g})}}),rl[Yd(n,y).name]=[{name:"wrapper",func:n}],tt.prototype.clone=iB,tt.prototype.reverse=oB,tt.prototype.value=sB,D.prototype.at=P5,D.prototype.chain=M5,D.prototype.commit=$5,D.prototype.next=F5,D.prototype.plant=H5,D.prototype.reverse=z5,D.prototype.toJSON=D.prototype.valueOf=D.prototype.value=j5,D.prototype.first=D.prototype.head,Xu&&(D.prototype[Xu]=B5),D},el=$F();zs?((zs.exports=el)._=el,dy._=el):yn._=el}).call(ra)})(sm,sm.exports);var rq=sm.exports;const ue=ks(rq),iq=["as","disabled"];function oq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sq(e){return!e||e.trim()==="#"}function d1({tagName:e,disabled:t,href:n,target:r,rel:i,role:o,onClick:s,tabIndex:a=0,type:u}){e||(n!=null||r!=null||i!=null?e="a":e="button");const c={tagName:e};if(e==="button")return[{type:u||"button",disabled:t},c];const d=h=>{if((t||e==="a"&&sq(n))&&h.preventDefault(),t){h.stopPropagation();return}s==null||s(h)},p=h=>{h.key===" "&&(h.preventDefault(),d(h))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:a,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?i:void 0,onClick:d,onKeyDown:p},c]}const MD=A.forwardRef((e,t)=>{let{as:n,disabled:r}=e,i=oq(e,iq);const[o,{tagName:s}]=d1(Object.assign({tagName:n,disabled:r},i));return S.jsx(s,Object.assign({},i,o,{ref:t}))});MD.displayName="Button";const Dn=A.forwardRef(({as:e,bsPrefix:t,variant:n="primary",size:r,active:i=!1,disabled:o=!1,className:s,...a},u)=>{const c=Fe(t,"btn"),[d,{tagName:p}]=d1({tagName:e,disabled:o,...a}),h=p;return S.jsx(h,{...d,...a,ref:u,disabled:o,className:Te(s,c,i&&"active",n&&`${c}-${n}`,r&&`${c}-${r}`,a.href&&o&&"disabled")})});Dn.displayName="Button";const $D=A.forwardRef(({bsPrefix:e,size:t,vertical:n=!1,className:r,role:i="group",as:o="div",...s},a)=>{const u=Fe(e,"btn-group");let c=u;return n&&(c=`${u}-vertical`),S.jsx(o,{...s,ref:a,role:i,className:Te(r,c,t&&`${u}-${t}`)})});$D.displayName="ButtonGroup";var Kn="top",zr="bottom",jr="right",qn="left",ag="auto",ku=[Kn,zr,jr,qn],Oa="start",hu="end",FD="clippingParents",p1="viewport",El="popper",BD="reference",l_=ku.reduce(function(e,t){return e.concat([t+"-"+Oa,t+"-"+hu])},[]),h1=[].concat(ku,[ag]).reduce(function(e,t){return e.concat([t,t+"-"+Oa,t+"-"+hu])},[]),HD="beforeRead",zD="read",jD="afterRead",VD="beforeMain",UD="main",WD="afterMain",GD="beforeWrite",KD="write",qD="afterWrite",YD=[HD,zD,jD,VD,UD,WD,GD,KD,qD];function Ji(e){return e?(e.nodeName||"").toLowerCase():null}function Vr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ra(e){var t=Vr(e).Element;return e instanceof t||e instanceof Element}function di(e){var t=Vr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function m1(e){if(typeof ShadowRoot>"u")return!1;var t=Vr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function aq(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!di(o)||!Ji(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function lq(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(u,c){return u[c]="",u},{});!di(i)||!Ji(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const g1={name:"applyStyles",enabled:!0,phase:"write",fn:aq,effect:lq,requires:["computeStyles"]};function Zi(e){return e.split("-")[0]}var xa=Math.max,am=Math.min,mu=Math.round;function u_(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function XD(){return!/^((?!chrome|android).)*safari/i.test(u_())}function gu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&di(e)&&(i=e.offsetWidth>0&&mu(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&mu(r.height)/e.offsetHeight||1);var s=Ra(e)?Vr(e):window,a=s.visualViewport,u=!XD()&&n,c=(r.left+(u&&a?a.offsetLeft:0))/i,d=(r.top+(u&&a?a.offsetTop:0))/o,p=r.width/i,h=r.height/o;return{width:p,height:h,top:d,right:c+p,bottom:d+h,left:c,x:c,y:d}}function y1(e){var t=gu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function QD(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&m1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function No(e){return Vr(e).getComputedStyle(e)}function uq(e){return["table","td","th"].indexOf(Ji(e))>=0}function Ds(e){return((Ra(e)?e.ownerDocument:e.document)||window.document).documentElement}function lg(e){return Ji(e)==="html"?e:e.assignedSlot||e.parentNode||(m1(e)?e.host:null)||Ds(e)}function _A(e){return!di(e)||No(e).position==="fixed"?null:e.offsetParent}function cq(e){var t=/firefox/i.test(u_()),n=/Trident/i.test(u_());if(n&&di(e)){var r=No(e);if(r.position==="fixed")return null}var i=lg(e);for(m1(i)&&(i=i.host);di(i)&&["html","body"].indexOf(Ji(i))<0;){var o=No(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function nd(e){for(var t=Vr(e),n=_A(e);n&&uq(n)&&No(n).position==="static";)n=_A(n);return n&&(Ji(n)==="html"||Ji(n)==="body"&&No(n).position==="static")?t:n||cq(e)||t}function v1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function rf(e,t,n){return xa(e,am(t,n))}function fq(e,t,n){var r=rf(e,t,n);return r>n?n:r}function ZD(){return{top:0,right:0,bottom:0,left:0}}function JD(e){return Object.assign({},ZD(),e)}function eL(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var dq=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,JD(typeof t!="number"?t:eL(t,ku))};function pq(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Zi(n.placement),u=v1(a),c=[qn,jr].indexOf(a)>=0,d=c?"height":"width";if(!(!o||!s)){var p=dq(i.padding,n),h=y1(o),m=u==="y"?Kn:qn,v=u==="y"?zr:jr,x=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],b=s[u]-n.rects.reference[u],y=nd(o),_=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,E=x/2-b/2,C=p[m],T=_-h[d]-p[v],I=_/2-h[d]/2+E,O=rf(C,I,T),M=u;n.modifiersData[r]=(t={},t[M]=O,t.centerOffset=O-I,t)}}function hq(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||QD(t.elements.popper,i)&&(t.elements.arrow=i))}const x1={name:"arrow",enabled:!0,phase:"main",fn:pq,effect:hq,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yu(e){return e.split("-")[1]}var mq={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gq(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:mu(n*i)/i||0,y:mu(r*i)/i||0}}function wA(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=s.x,m=h===void 0?0:h,v=s.y,x=v===void 0?0:v,b=typeof d=="function"?d({x:m,y:x}):{x:m,y:x};m=b.x,x=b.y;var y=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),E=qn,C=Kn,T=window;if(c){var I=nd(n),O="clientHeight",M="clientWidth";if(I===Vr(n)&&(I=Ds(n),No(I).position!=="static"&&a==="absolute"&&(O="scrollHeight",M="scrollWidth")),I=I,i===Kn||(i===qn||i===jr)&&o===hu){C=zr;var j=p&&I===T&&T.visualViewport?T.visualViewport.height:I[O];x-=j-r.height,x*=u?1:-1}if(i===qn||(i===Kn||i===zr)&&o===hu){E=jr;var V=p&&I===T&&T.visualViewport?T.visualViewport.width:I[M];m-=V-r.width,m*=u?1:-1}}var F=Object.assign({position:a},c&&mq),W=d===!0?gq({x:m,y:x},Vr(n)):{x:m,y:x};if(m=W.x,x=W.y,u){var Y;return Object.assign({},F,(Y={},Y[C]=_?"0":"",Y[E]=y?"0":"",Y.transform=(T.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",Y))}return Object.assign({},F,(t={},t[C]=_?x+"px":"",t[E]=y?m+"px":"",t.transform="",t))}function yq(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,u=a===void 0?!0:a,c={placement:Zi(t.placement),variation:yu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wA(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wA(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ug={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:yq,data:{}};var $p={passive:!0};function vq(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,u=Vr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(d){d.addEventListener("scroll",n.update,$p)}),a&&u.addEventListener("resize",n.update,$p),function(){o&&c.forEach(function(d){d.removeEventListener("scroll",n.update,$p)}),a&&u.removeEventListener("resize",n.update,$p)}}const cg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vq,data:{}};var xq={left:"right",right:"left",bottom:"top",top:"bottom"};function gh(e){return e.replace(/left|right|bottom|top/g,function(t){return xq[t]})}var _q={start:"end",end:"start"};function bA(e){return e.replace(/start|end/g,function(t){return _q[t]})}function _1(e){var t=Vr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function w1(e){return gu(Ds(e)).left+_1(e).scrollLeft}function wq(e,t){var n=Vr(e),r=Ds(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;var c=XD();(c||!c&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a+w1(e),y:u}}function bq(e){var t,n=Ds(e),r=_1(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=xa(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=xa(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+w1(e),u=-r.scrollTop;return No(i||n).direction==="rtl"&&(a+=xa(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:u}}function b1(e){var t=No(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function tL(e){return["html","body","#document"].indexOf(Ji(e))>=0?e.ownerDocument.body:di(e)&&b1(e)?e:tL(lg(e))}function of(e,t){var n;t===void 0&&(t=[]);var r=tL(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Vr(r),s=i?[o].concat(o.visualViewport||[],b1(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(of(lg(s)))}function c_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Eq(e,t){var n=gu(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function EA(e,t,n){return t===p1?c_(wq(e,n)):Ra(t)?Eq(t,n):c_(bq(Ds(e)))}function Sq(e){var t=of(lg(e)),n=["absolute","fixed"].indexOf(No(e).position)>=0,r=n&&di(e)?nd(e):e;return Ra(r)?t.filter(function(i){return Ra(i)&&QD(i,r)&&Ji(i)!=="body"}):[]}function Cq(e,t,n,r){var i=t==="clippingParents"?Sq(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(u,c){var d=EA(e,c,r);return u.top=xa(d.top,u.top),u.right=am(d.right,u.right),u.bottom=am(d.bottom,u.bottom),u.left=xa(d.left,u.left),u},EA(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function nL(e){var t=e.reference,n=e.element,r=e.placement,i=r?Zi(r):null,o=r?yu(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,u;switch(i){case Kn:u={x:s,y:t.y-n.height};break;case zr:u={x:s,y:t.y+t.height};break;case jr:u={x:t.x+t.width,y:a};break;case qn:u={x:t.x-n.width,y:a};break;default:u={x:t.x,y:t.y}}var c=i?v1(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case Oa:u[c]=u[c]-(t[d]/2-n[d]/2);break;case hu:u[c]=u[c]+(t[d]/2-n[d]/2);break}}return u}function vu(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,u=a===void 0?FD:a,c=n.rootBoundary,d=c===void 0?p1:c,p=n.elementContext,h=p===void 0?El:p,m=n.altBoundary,v=m===void 0?!1:m,x=n.padding,b=x===void 0?0:x,y=JD(typeof b!="number"?b:eL(b,ku)),_=h===El?BD:El,E=e.rects.popper,C=e.elements[v?_:h],T=Cq(Ra(C)?C:C.contextElement||Ds(e.elements.popper),u,d,s),I=gu(e.elements.reference),O=nL({reference:I,element:E,strategy:"absolute",placement:i}),M=c_(Object.assign({},E,O)),j=h===El?M:I,V={top:T.top-j.top+y.top,bottom:j.bottom-T.bottom+y.bottom,left:T.left-j.left+y.left,right:j.right-T.right+y.right},F=e.modifiersData.offset;if(h===El&&F){var W=F[i];Object.keys(V).forEach(function(Y){var L=[jr,zr].indexOf(Y)>=0?1:-1,B=[Kn,zr].indexOf(Y)>=0?"y":"x";V[Y]+=W[B]*L})}return V}function Iq(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?h1:u,d=yu(r),p=d?a?l_:l_.filter(function(v){return yu(v)===d}):ku,h=p.filter(function(v){return c.indexOf(v)>=0});h.length===0&&(h=p);var m=h.reduce(function(v,x){return v[x]=vu(e,{placement:x,boundary:i,rootBoundary:o,padding:s})[Zi(x)],v},{});return Object.keys(m).sort(function(v,x){return m[v]-m[x]})}function Aq(e){if(Zi(e)===ag)return[];var t=gh(e);return[bA(e),t,bA(t)]}function Tq(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.flipVariations,v=m===void 0?!0:m,x=n.allowedAutoPlacements,b=t.options.placement,y=Zi(b),_=y===b,E=u||(_||!v?[gh(b)]:Aq(b)),C=[b].concat(E).reduce(function(ee,ie){return ee.concat(Zi(ie)===ag?Iq(t,{placement:ie,boundary:d,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:x}):ie)},[]),T=t.rects.reference,I=t.rects.popper,O=new Map,M=!0,j=C[0],V=0;V=0,B=L?"width":"height",z=vu(t,{placement:F,boundary:d,rootBoundary:p,altBoundary:h,padding:c}),X=L?Y?jr:qn:Y?zr:Kn;T[B]>I[B]&&(X=gh(X));var U=gh(X),H=[];if(o&&H.push(z[W]<=0),a&&H.push(z[X]<=0,z[U]<=0),H.every(function(ee){return ee})){j=F,M=!1;break}O.set(F,H)}if(M)for(var N=v?3:1,Z=function(ie){var se=C.find(function(pe){var ye=O.get(pe);if(ye)return ye.slice(0,ie).every(function(_e){return _e})});if(se)return j=se,"break"},ne=N;ne>0;ne--){var R=Z(ne);if(R==="break")break}t.placement!==j&&(t.modifiersData[r]._skip=!0,t.placement=j,t.reset=!0)}}const E1={name:"flip",enabled:!0,phase:"main",fn:Tq,requiresIfExists:["offset"],data:{_skip:!1}};function SA(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function CA(e){return[Kn,jr,zr,qn].some(function(t){return e[t]>=0})}function kq(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=vu(t,{elementContext:"reference"}),a=vu(t,{altBoundary:!0}),u=SA(s,r),c=SA(a,i,o),d=CA(u),p=CA(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const S1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:kq};function Nq(e,t,n){var r=Zi(e),i=[qn,Kn].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[qn,jr].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Oq(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=h1.reduce(function(d,p){return d[p]=Nq(p,t.rects,o),d},{}),a=s[t.placement],u=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const C1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Oq};function Rq(e){var t=e.state,n=e.name;t.modifiersData[n]=nL({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const fg={name:"popperOffsets",enabled:!0,phase:"read",fn:Rq,data:{}};function Dq(e){return e==="x"?"y":"x"}function Lq(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,p=n.padding,h=n.tether,m=h===void 0?!0:h,v=n.tetherOffset,x=v===void 0?0:v,b=vu(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:d}),y=Zi(t.placement),_=yu(t.placement),E=!_,C=v1(y),T=Dq(C),I=t.modifiersData.popperOffsets,O=t.rects.reference,M=t.rects.popper,j=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,V=typeof j=="number"?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(I){if(o){var Y,L=C==="y"?Kn:qn,B=C==="y"?zr:jr,z=C==="y"?"height":"width",X=I[C],U=X+b[L],H=X-b[B],N=m?-M[z]/2:0,Z=_===Oa?O[z]:M[z],ne=_===Oa?-M[z]:-O[z],R=t.elements.arrow,ee=m&&R?y1(R):{width:0,height:0},ie=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ZD(),se=ie[L],pe=ie[B],ye=rf(0,O[z],ee[z]),_e=E?O[z]/2-N-ye-se-V.mainAxis:Z-ye-se-V.mainAxis,Se=E?-O[z]/2+N+ye+pe+V.mainAxis:ne+ye+pe+V.mainAxis,Ve=t.elements.arrow&&nd(t.elements.arrow),Oe=Ve?C==="y"?Ve.clientTop||0:Ve.clientLeft||0:0,Re=(Y=F==null?void 0:F[C])!=null?Y:0,Be=X+_e-Re-Oe,Ie=X+Se-Re,rt=rf(m?am(U,Be):U,X,m?xa(H,Ie):H);I[C]=rt,W[C]=rt-X}if(a){var Le,we=C==="x"?Kn:qn,yt=C==="x"?zr:jr,pt=I[T],vt=T==="y"?"height":"width",Qt=pt+b[we],an=pt-b[yt],qt=[Kn,qn].indexOf(y)!==-1,Zt=(Le=F==null?void 0:F[T])!=null?Le:0,J=qt?Qt:pt-O[vt]-M[vt]-Zt+V.altAxis,ce=qt?pt+O[vt]+M[vt]-Zt-V.altAxis:an,Ce=m&&qt?fq(J,pt,ce):rf(m?J:Qt,pt,m?ce:an);I[T]=Ce,W[T]=Ce-pt}t.modifiersData[r]=W}}const I1={name:"preventOverflow",enabled:!0,phase:"main",fn:Lq,requiresIfExists:["offset"]};function Pq(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Mq(e){return e===Vr(e)||!di(e)?_1(e):Pq(e)}function $q(e){var t=e.getBoundingClientRect(),n=mu(t.width)/e.offsetWidth||1,r=mu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Fq(e,t,n){n===void 0&&(n=!1);var r=di(t),i=di(t)&&$q(t),o=Ds(t),s=gu(e,i,n),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ji(t)!=="body"||b1(o))&&(a=Mq(t)),di(t)?(u=gu(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=w1(o))),{x:s.left+a.scrollLeft-u.x,y:s.top+a.scrollTop-u.y,width:s.width,height:s.height}}function Bq(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var u=t.get(a);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Hq(e){var t=Bq(e);return YD.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function zq(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function jq(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var IA={placement:"bottom",modifiers:[],strategy:"absolute"};function AA(){for(var e=arguments.length,t=new Array(e),n=0;n(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(t,n)=>`#${CSS.escape(n)}`)),e),Yq=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),Xq=e=>{do e+=Math.floor(Math.random()*Kq);while(document.getElementById(e));return e},Qq=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const r=Number.parseFloat(t),i=Number.parseFloat(n);return!r&&!i?0:(t=t.split(",")[0],n=n.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(n))*qq)},oL=e=>{e.dispatchEvent(new Event(f_))},wo=e=>!e||typeof e!="object"?!1:(typeof e.jquery<"u"&&(e=e[0]),typeof e.nodeType<"u"),Is=e=>wo(e)?e.jquery?e[0]:e:typeof e=="string"&&e.length>0?document.querySelector(iL(e)):null,Nu=e=>{if(!wo(e)||e.getClientRects().length===0)return!1;const t=getComputedStyle(e).getPropertyValue("visibility")==="visible",n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const r=e.closest("summary");if(r&&r.parentNode!==n||r===null)return!1}return t},As=e=>!e||e.nodeType!==Node.ELEMENT_NODE||e.classList.contains("disabled")?!0:typeof e.disabled<"u"?e.disabled:e.hasAttribute("disabled")&&e.getAttribute("disabled")!=="false",sL=e=>{if(!document.documentElement.attachShadow)return null;if(typeof e.getRootNode=="function"){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?sL(e.parentNode):null},lm=()=>{},id=e=>{e.offsetHeight},aL=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,n0=[],Zq=e=>{document.readyState==="loading"?(n0.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of n0)t()}),n0.push(e)):e()},gi=()=>document.documentElement.dir==="rtl",xi=e=>{Zq(()=>{const t=aL();if(t){const n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}})},hr=(e,t=[],n=e)=>typeof e=="function"?e(...t):n,lL=(e,t,n=!0)=>{if(!n){hr(e);return}const i=Qq(t)+5;let o=!1;const s=({target:a})=>{a===t&&(o=!0,t.removeEventListener(f_,s),hr(e))};t.addEventListener(f_,s),setTimeout(()=>{o||oL(t)},i)},T1=(e,t,n,r)=>{const i=e.length;let o=e.indexOf(t);return o===-1?!n&&r?e[i-1]:e[0]:(o+=n?1:-1,r&&(o=(o+i)%i),e[Math.max(0,Math.min(o,i-1))])},Jq=/[^.]*(?=\..*)\.|.*/,eY=/\..*/,tY=/::\d+$/,r0={};let TA=1;const uL={mouseenter:"mouseover",mouseleave:"mouseout"},nY=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function cL(e,t){return t&&`${t}::${TA++}`||e.uidEvent||TA++}function fL(e){const t=cL(e);return e.uidEvent=t,r0[t]=r0[t]||{},r0[t]}function rY(e,t){return function n(r){return k1(r,{delegateTarget:e}),n.oneOff&&de.off(e,r.type,t),t.apply(e,[r])}}function iY(e,t,n){return function r(i){const o=e.querySelectorAll(t);for(let{target:s}=i;s&&s!==this;s=s.parentNode)for(const a of o)if(a===s)return k1(i,{delegateTarget:s}),r.oneOff&&de.off(e,i.type,t,n),n.apply(s,[i])}}function dL(e,t,n=null){return Object.values(e).find(r=>r.callable===t&&r.delegationSelector===n)}function pL(e,t,n){const r=typeof t=="string",i=r?n:t||n;let o=hL(e);return nY.has(o)||(o=e),[r,i,o]}function kA(e,t,n,r,i){if(typeof t!="string"||!e)return;let[o,s,a]=pL(t,n,r);t in uL&&(s=(v=>function(x){if(!x.relatedTarget||x.relatedTarget!==x.delegateTarget&&!x.delegateTarget.contains(x.relatedTarget))return v.call(this,x)})(s));const u=fL(e),c=u[a]||(u[a]={}),d=dL(c,s,o?n:null);if(d){d.oneOff=d.oneOff&&i;return}const p=cL(s,t.replace(Jq,"")),h=o?iY(e,n,s):rY(e,s);h.delegationSelector=o?n:null,h.callable=s,h.oneOff=i,h.uidEvent=p,c[p]=h,e.addEventListener(a,h,o)}function d_(e,t,n,r,i){const o=dL(t[n],r,i);o&&(e.removeEventListener(n,o,!!i),delete t[n][o.uidEvent])}function oY(e,t,n,r){const i=t[n]||{};for(const[o,s]of Object.entries(i))o.includes(r)&&d_(e,t,n,s.callable,s.delegationSelector)}function hL(e){return e=e.replace(eY,""),uL[e]||e}const de={on(e,t,n,r){kA(e,t,n,r,!1)},one(e,t,n,r){kA(e,t,n,r,!0)},off(e,t,n,r){if(typeof t!="string"||!e)return;const[i,o,s]=pL(t,n,r),a=s!==t,u=fL(e),c=u[s]||{},d=t.startsWith(".");if(typeof o<"u"){if(!Object.keys(c).length)return;d_(e,u,s,o,i?n:null);return}if(d)for(const p of Object.keys(u))oY(e,u,p,t.slice(1));for(const[p,h]of Object.entries(c)){const m=p.replace(tY,"");(!a||t.includes(m))&&d_(e,u,s,h.callable,h.delegationSelector)}},trigger(e,t,n){if(typeof t!="string"||!e)return null;const r=aL(),i=hL(t),o=t!==i;let s=null,a=!0,u=!0,c=!1;o&&r&&(s=r.Event(t,n),r(e).trigger(s),a=!s.isPropagationStopped(),u=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());const d=k1(new Event(t,{bubbles:a,cancelable:!0}),n);return c&&d.preventDefault(),u&&e.dispatchEvent(d),d.defaultPrevented&&s&&s.preventDefault(),d}};function k1(e,t={}){for(const[n,r]of Object.entries(t))try{e[n]=r}catch{Object.defineProperty(e,n,{configurable:!0,get(){return r}})}return e}function NA(e){if(e==="true")return!0;if(e==="false")return!1;if(e===Number(e).toString())return Number(e);if(e===""||e==="null")return null;if(typeof e!="string")return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function i0(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const bo={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${i0(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${i0(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of n){let i=r.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),t[i]=NA(e.dataset[r])}return t},getDataAttribute(e,t){return NA(e.getAttribute(`data-bs-${i0(t)}`))}};class od{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,n){const r=wo(n)?bo.getDataAttribute(n,"config"):{};return{...this.constructor.Default,...typeof r=="object"?r:{},...wo(n)?bo.getDataAttributes(n):{},...typeof t=="object"?t:{}}}_typeCheckConfig(t,n=this.constructor.DefaultType){for(const[r,i]of Object.entries(n)){const o=t[r],s=wo(o)?"element":Yq(o);if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${i}".`)}}}const sY="5.3.3";class Fi extends od{constructor(t,n){super(),t=Is(t),t&&(this._element=t,this._config=this._getConfig(n),t0.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t0.remove(this._element,this.constructor.DATA_KEY),de.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,n,r=!0){lL(t,n,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return t0.get(Is(t),this.DATA_KEY)}static getOrCreateInstance(t,n={}){return this.getInstance(t)||new this(t,typeof n=="object"?n:null)}static get VERSION(){return sY}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const o0=e=>{let t=e.getAttribute("data-bs-target");if(!t||t==="#"){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&n!=="#"?n.trim():null}return t?t.split(",").map(n=>iL(n)).join(","):null},De={find(e,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e,t=document.documentElement){return Element.prototype.querySelector.call(t,e)},children(e,t){return[].concat(...e.children).filter(n=>n.matches(t))},parents(e,t){const n=[];let r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(n=>`${n}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(n=>!As(n)&&Nu(n))},getSelectorFromElement(e){const t=o0(e);return t&&De.findOne(t)?t:null},getElementFromSelector(e){const t=o0(e);return t?De.findOne(t):null},getMultipleElementsFromSelector(e){const t=o0(e);return t?De.find(t):[]}},dg=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;de.on(document,n,`[data-bs-dismiss="${r}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),As(this))return;const o=De.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(o)[t]()})},aY="alert",lY="bs.alert",mL=`.${lY}`,uY=`close${mL}`,cY=`closed${mL}`,fY="fade",dY="show";let gL=class yL extends Fi{static get NAME(){return aY}close(){if(de.trigger(this._element,uY).defaultPrevented)return;this._element.classList.remove(dY);const n=this._element.classList.contains(fY);this._queueCallback(()=>this._destroyElement(),this._element,n)}_destroyElement(){this._element.remove(),de.trigger(this._element,cY),this.dispose()}static jQueryInterface(t){return this.each(function(){const n=yL.getOrCreateInstance(this);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};dg(gL,"close");xi(gL);const pY="button",hY="bs.button",mY=`.${hY}`,gY=".data-api",yY="active",OA='[data-bs-toggle="button"]',vY=`click${mY}${gY}`;let vL=class xL extends Fi{static get NAME(){return pY}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(yY))}static jQueryInterface(t){return this.each(function(){const n=xL.getOrCreateInstance(this);t==="toggle"&&n[t]()})}};de.on(document,vY,OA,e=>{e.preventDefault();const t=e.target.closest(OA);vL.getOrCreateInstance(t).toggle()});xi(vL);const xY="swipe",Ou=".bs.swipe",_Y=`touchstart${Ou}`,wY=`touchmove${Ou}`,bY=`touchend${Ou}`,EY=`pointerdown${Ou}`,SY=`pointerup${Ou}`,CY="touch",IY="pen",AY="pointer-event",TY=40,kY={endCallback:null,leftCallback:null,rightCallback:null},NY={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class um extends od{constructor(t,n){super(),this._element=t,!(!t||!um.isSupported())&&(this._config=this._getConfig(n),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return kY}static get DefaultType(){return NY}static get NAME(){return xY}dispose(){de.off(this._element,Ou)}_start(t){if(!this._supportPointerEvents){this._deltaX=t.touches[0].clientX;return}this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX)}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),hr(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=TY)return;const n=t/this._deltaX;this._deltaX=0,n&&hr(n>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(de.on(this._element,EY,t=>this._start(t)),de.on(this._element,SY,t=>this._end(t)),this._element.classList.add(AY)):(de.on(this._element,_Y,t=>this._start(t)),de.on(this._element,wY,t=>this._move(t)),de.on(this._element,bY,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&(t.pointerType===IY||t.pointerType===CY)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const OY="carousel",RY="bs.carousel",Ls=`.${RY}`,_L=".data-api",DY="ArrowLeft",LY="ArrowRight",PY=500,Sc="next",yl="prev",Sl="left",yh="right",MY=`slide${Ls}`,s0=`slid${Ls}`,$Y=`keydown${Ls}`,FY=`mouseenter${Ls}`,BY=`mouseleave${Ls}`,HY=`dragstart${Ls}`,zY=`load${Ls}${_L}`,jY=`click${Ls}${_L}`,wL="carousel",Fp="active",VY="slide",UY="carousel-item-end",WY="carousel-item-start",GY="carousel-item-next",KY="carousel-item-prev",bL=".active",EL=".carousel-item",qY=bL+EL,YY=".carousel-item img",XY=".carousel-indicators",QY="[data-bs-slide], [data-bs-slide-to]",ZY='[data-bs-ride="carousel"]',JY={[DY]:yh,[LY]:Sl},eX={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},tX={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class sd extends Fi{constructor(t,n){super(t,n),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=De.findOne(XY,this._element),this._addEventListeners(),this._config.ride===wL&&this.cycle()}static get Default(){return eX}static get DefaultType(){return tX}static get NAME(){return OY}next(){this._slide(Sc)}nextWhenVisible(){!document.hidden&&Nu(this._element)&&this.next()}prev(){this._slide(yl)}pause(){this._isSliding&&oL(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){de.one(this._element,s0,()=>this.cycle());return}this.cycle()}}to(t){const n=this._getItems();if(t>n.length-1||t<0)return;if(this._isSliding){de.one(this._element,s0,()=>this.to(t));return}const r=this._getItemIndex(this._getActive());if(r===t)return;const i=t>r?Sc:yl;this._slide(i,n[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&de.on(this._element,$Y,t=>this._keydown(t)),this._config.pause==="hover"&&(de.on(this._element,FY,()=>this.pause()),de.on(this._element,BY,()=>this._maybeEnableCycle())),this._config.touch&&um.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of De.find(YY,this._element))de.on(r,HY,i=>i.preventDefault());const n={leftCallback:()=>this._slide(this._directionToOrder(Sl)),rightCallback:()=>this._slide(this._directionToOrder(yh)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),PY+this._config.interval))}};this._swipeHelper=new um(this._element,n)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const n=JY[t.key];n&&(t.preventDefault(),this._slide(this._directionToOrder(n)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const n=De.findOne(bL,this._indicatorsElement);n.classList.remove(Fp),n.removeAttribute("aria-current");const r=De.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);r&&(r.classList.add(Fp),r.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const n=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=n||this._config.defaultInterval}_slide(t,n=null){if(this._isSliding)return;const r=this._getActive(),i=t===Sc,o=n||T1(this._getItems(),r,i,this._config.wrap);if(o===r)return;const s=this._getItemIndex(o),a=m=>de.trigger(this._element,m,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(r),to:s});if(a(MY).defaultPrevented||!r||!o)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;const d=i?WY:UY,p=i?GY:KY;o.classList.add(p),id(o),r.classList.add(d),o.classList.add(d);const h=()=>{o.classList.remove(d,p),o.classList.add(Fp),r.classList.remove(Fp,p,d),this._isSliding=!1,a(s0)};this._queueCallback(h,r,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(VY)}_getActive(){return De.findOne(qY,this._element)}_getItems(){return De.find(EL,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return gi()?t===Sl?yl:Sc:t===Sl?Sc:yl}_orderToDirection(t){return gi()?t===yl?Sl:yh:t===yl?yh:Sl}static jQueryInterface(t){return this.each(function(){const n=sd.getOrCreateInstance(this,t);if(typeof t=="number"){n.to(t);return}if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(document,jY,QY,function(e){const t=De.getElementFromSelector(this);if(!t||!t.classList.contains(wL))return;e.preventDefault();const n=sd.getOrCreateInstance(t),r=this.getAttribute("data-bs-slide-to");if(r){n.to(r),n._maybeEnableCycle();return}if(bo.getDataAttribute(this,"slide")==="next"){n.next(),n._maybeEnableCycle();return}n.prev(),n._maybeEnableCycle()});de.on(window,zY,()=>{const e=De.find(ZY);for(const t of e)sd.getOrCreateInstance(t)});xi(sd);const nX="collapse",rX="bs.collapse",ad=`.${rX}`,iX=".data-api",oX=`show${ad}`,sX=`shown${ad}`,aX=`hide${ad}`,lX=`hidden${ad}`,uX=`click${ad}${iX}`,a0="show",zl="collapse",Bp="collapsing",cX="collapsed",fX=`:scope .${zl} .${zl}`,dX="collapse-horizontal",pX="width",hX="height",mX=".collapse.show, .collapse.collapsing",p_='[data-bs-toggle="collapse"]',gX={parent:null,toggle:!0},yX={parent:"(null|element)",toggle:"boolean"};let SL=class h_ extends Fi{constructor(t,n){super(t,n),this._isTransitioning=!1,this._triggerArray=[];const r=De.find(p_);for(const i of r){const o=De.getSelectorFromElement(i),s=De.find(o).filter(a=>a===this._element);o!==null&&s.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return gX}static get DefaultType(){return yX}static get NAME(){return nX}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(mX).filter(a=>a!==this._element).map(a=>h_.getOrCreateInstance(a,{toggle:!1}))),t.length&&t[0]._isTransitioning||de.trigger(this._element,oX).defaultPrevented)return;for(const a of t)a.hide();const r=this._getDimension();this._element.classList.remove(zl),this._element.classList.add(Bp),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(Bp),this._element.classList.add(zl,a0),this._element.style[r]="",de.trigger(this._element,sX)},s=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(i,this._element,!0),this._element.style[r]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||de.trigger(this._element,aX).defaultPrevented)return;const n=this._getDimension();this._element.style[n]=`${this._element.getBoundingClientRect()[n]}px`,id(this._element),this._element.classList.add(Bp),this._element.classList.remove(zl,a0);for(const i of this._triggerArray){const o=De.getElementFromSelector(i);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(Bp),this._element.classList.add(zl),de.trigger(this._element,lX)};this._element.style[n]="",this._queueCallback(r,this._element,!0)}_isShown(t=this._element){return t.classList.contains(a0)}_configAfterMerge(t){return t.toggle=!!t.toggle,t.parent=Is(t.parent),t}_getDimension(){return this._element.classList.contains(dX)?pX:hX}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(p_);for(const n of t){const r=De.getElementFromSelector(n);r&&this._addAriaAndCollapsedClass([n],this._isShown(r))}}_getFirstLevelChildren(t){const n=De.find(fX,this._config.parent);return De.find(t,this._config.parent).filter(r=>!n.includes(r))}_addAriaAndCollapsedClass(t,n){if(t.length)for(const r of t)r.classList.toggle(cX,!n),r.setAttribute("aria-expanded",n)}static jQueryInterface(t){const n={};return typeof t=="string"&&/show|hide/.test(t)&&(n.toggle=!1),this.each(function(){const r=h_.getOrCreateInstance(this,n);if(typeof t=="string"){if(typeof r[t]>"u")throw new TypeError(`No method named "${t}"`);r[t]()}})}};de.on(document,uX,p_,function(e){(e.target.tagName==="A"||e.delegateTarget&&e.delegateTarget.tagName==="A")&&e.preventDefault();for(const t of De.getMultipleElementsFromSelector(this))SL.getOrCreateInstance(t,{toggle:!1}).toggle()});xi(SL);const RA="dropdown",vX="bs.dropdown",Ba=`.${vX}`,N1=".data-api",xX="Escape",DA="Tab",_X="ArrowUp",LA="ArrowDown",wX=2,bX=`hide${Ba}`,EX=`hidden${Ba}`,SX=`show${Ba}`,CX=`shown${Ba}`,CL=`click${Ba}${N1}`,IL=`keydown${Ba}${N1}`,IX=`keyup${Ba}${N1}`,Cl="show",AX="dropup",TX="dropend",kX="dropstart",NX="dropup-center",OX="dropdown-center",da='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',RX=`${da}.${Cl}`,vh=".dropdown-menu",DX=".navbar",LX=".navbar-nav",PX=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",MX=gi()?"top-end":"top-start",$X=gi()?"top-start":"top-end",FX=gi()?"bottom-end":"bottom-start",BX=gi()?"bottom-start":"bottom-end",HX=gi()?"left-start":"right-start",zX=gi()?"right-start":"left-start",jX="top",VX="bottom",UX={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},WX={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};let Ru=class xh extends Fi{constructor(t,n){super(t,n),this._popper=null,this._parent=this._element.parentNode,this._menu=De.next(this._element,vh)[0]||De.prev(this._element,vh)[0]||De.findOne(vh,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return UX}static get DefaultType(){return WX}static get NAME(){return RA}toggle(){return this._isShown()?this.hide():this.show()}show(){if(As(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!de.trigger(this._element,SX,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(LX))for(const r of[].concat(...document.body.children))de.on(r,"mouseover",lm);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Cl),this._element.classList.add(Cl),de.trigger(this._element,CX,t)}}hide(){if(As(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!de.trigger(this._element,bX,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))de.off(r,"mouseover",lm);this._popper&&this._popper.destroy(),this._menu.classList.remove(Cl),this._element.classList.remove(Cl),this._element.setAttribute("aria-expanded","false"),bo.removeDataAttribute(this._menu,"popper"),de.trigger(this._element,EX,t)}}_getConfig(t){if(t=super._getConfig(t),typeof t.reference=="object"&&!wo(t.reference)&&typeof t.reference.getBoundingClientRect!="function")throw new TypeError(`${RA.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(typeof rL>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;this._config.reference==="parent"?t=this._parent:wo(this._config.reference)?t=Is(this._config.reference):typeof this._config.reference=="object"&&(t=this._config.reference);const n=this._getPopperConfig();this._popper=A1(t,this._menu,n)}_isShown(){return this._menu.classList.contains(Cl)}_getPlacement(){const t=this._parent;if(t.classList.contains(TX))return HX;if(t.classList.contains(kX))return zX;if(t.classList.contains(NX))return jX;if(t.classList.contains(OX))return VX;const n=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return t.classList.contains(AX)?n?$X:MX:n?BX:FX}_detectNavbar(){return this._element.closest(DX)!==null}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(n=>Number.parseInt(n,10)):typeof t=="function"?n=>t(n,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(bo.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...hr(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:n}){const r=De.find(PX,this._menu).filter(i=>Nu(i));r.length&&T1(r,n,t===LA,!r.includes(n)).focus()}static jQueryInterface(t){return this.each(function(){const n=xh.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}static clearMenus(t){if(t.button===wX||t.type==="keyup"&&t.key!==DA)return;const n=De.find(RX);for(const r of n){const i=xh.getInstance(r);if(!i||i._config.autoClose===!1)continue;const o=t.composedPath(),s=o.includes(i._menu);if(o.includes(i._element)||i._config.autoClose==="inside"&&!s||i._config.autoClose==="outside"&&s||i._menu.contains(t.target)&&(t.type==="keyup"&&t.key===DA||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const a={relatedTarget:i._element};t.type==="click"&&(a.clickEvent=t),i._completeHide(a)}}static dataApiKeydownHandler(t){const n=/input|textarea/i.test(t.target.tagName),r=t.key===xX,i=[_X,LA].includes(t.key);if(!i&&!r||n&&!r)return;t.preventDefault();const o=this.matches(da)?this:De.prev(this,da)[0]||De.next(this,da)[0]||De.findOne(da,t.delegateTarget.parentNode),s=xh.getOrCreateInstance(o);if(i){t.stopPropagation(),s.show(),s._selectMenuItem(t);return}s._isShown()&&(t.stopPropagation(),s.hide(),o.focus())}};de.on(document,IL,da,Ru.dataApiKeydownHandler);de.on(document,IL,vh,Ru.dataApiKeydownHandler);de.on(document,CL,Ru.clearMenus);de.on(document,IX,Ru.clearMenus);de.on(document,CL,da,function(e){e.preventDefault(),Ru.getOrCreateInstance(this).toggle()});xi(Ru);const AL="backdrop",GX="fade",PA="show",MA=`mousedown.bs.${AL}`,KX={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},qX={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class TL extends od{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return KX}static get DefaultType(){return qX}static get NAME(){return AL}show(t){if(!this._config.isVisible){hr(t);return}this._append();const n=this._getElement();this._config.isAnimated&&id(n),n.classList.add(PA),this._emulateAnimation(()=>{hr(t)})}hide(t){if(!this._config.isVisible){hr(t);return}this._getElement().classList.remove(PA),this._emulateAnimation(()=>{this.dispose(),hr(t)})}dispose(){this._isAppended&&(de.off(this._element,MA),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add(GX),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Is(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),de.on(t,MA,()=>{hr(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){lL(t,this._getElement(),this._config.isAnimated)}}const YX="focustrap",XX="bs.focustrap",cm=`.${XX}`,QX=`focusin${cm}`,ZX=`keydown.tab${cm}`,JX="Tab",eQ="forward",$A="backward",tQ={autofocus:!0,trapElement:null},nQ={autofocus:"boolean",trapElement:"element"};class kL extends od{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return tQ}static get DefaultType(){return nQ}static get NAME(){return YX}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),de.off(document,cm),de.on(document,QX,t=>this._handleFocusin(t)),de.on(document,ZX,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,de.off(document,cm))}_handleFocusin(t){const{trapElement:n}=this._config;if(t.target===document||t.target===n||n.contains(t.target))return;const r=De.focusableChildren(n);r.length===0?n.focus():this._lastTabNavDirection===$A?r[r.length-1].focus():r[0].focus()}_handleKeydown(t){t.key===JX&&(this._lastTabNavDirection=t.shiftKey?$A:eQ)}}const FA=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",BA=".sticky-top",Hp="padding-right",HA="margin-right";class m_{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Hp,n=>n+t),this._setElementAttributes(FA,Hp,n=>n+t),this._setElementAttributes(BA,HA,n=>n-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Hp),this._resetElementAttributes(FA,Hp),this._resetElementAttributes(BA,HA)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,n,r){const i=this.getWidth(),o=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+i)return;this._saveInitialAttribute(s,n);const a=window.getComputedStyle(s).getPropertyValue(n);s.style.setProperty(n,`${r(Number.parseFloat(a))}px`)};this._applyManipulationCallback(t,o)}_saveInitialAttribute(t,n){const r=t.style.getPropertyValue(n);r&&bo.setDataAttribute(t,n,r)}_resetElementAttributes(t,n){const r=i=>{const o=bo.getDataAttribute(i,n);if(o===null){i.style.removeProperty(n);return}bo.removeDataAttribute(i,n),i.style.setProperty(n,o)};this._applyManipulationCallback(t,r)}_applyManipulationCallback(t,n){if(wo(t)){n(t);return}for(const r of De.find(t,this._element))n(r)}}const rQ="modal",iQ="bs.modal",yi=`.${iQ}`,oQ=".data-api",sQ="Escape",aQ=`hide${yi}`,lQ=`hidePrevented${yi}`,NL=`hidden${yi}`,OL=`show${yi}`,uQ=`shown${yi}`,cQ=`resize${yi}`,fQ=`click.dismiss${yi}`,dQ=`mousedown.dismiss${yi}`,pQ=`keydown.dismiss${yi}`,hQ=`click${yi}${oQ}`,zA="modal-open",mQ="fade",jA="show",l0="modal-static",gQ=".modal.show",yQ=".modal-dialog",vQ=".modal-body",xQ='[data-bs-toggle="modal"]',_Q={backdrop:!0,focus:!0,keyboard:!0},wQ={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};let fm=class RL extends Fi{constructor(t,n){super(t,n),this._dialog=De.findOne(yQ,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new m_,this._addEventListeners()}static get Default(){return _Q}static get DefaultType(){return wQ}static get NAME(){return rQ}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||de.trigger(this._element,OL,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(zA),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){!this._isShown||this._isTransitioning||de.trigger(this._element,aQ).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(jA),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){de.off(window,yi),de.off(this._dialog,yi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new TL({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new kL({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const n=De.findOne(vQ,this._dialog);n&&(n.scrollTop=0),id(this._element),this._element.classList.add(jA);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,de.trigger(this._element,uQ,{relatedTarget:t})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){de.on(this._element,pQ,t=>{if(t.key===sQ){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),de.on(window,cQ,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),de.on(this._element,dQ,t=>{de.one(this._element,fQ,n=>{if(!(this._element!==t.target||this._element!==n.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(zA),this._resetAdjustments(),this._scrollBar.reset(),de.trigger(this._element,NL)})}_isAnimated(){return this._element.classList.contains(mQ)}_triggerBackdropTransition(){if(de.trigger(this._element,lQ).defaultPrevented)return;const n=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(l0)||(n||(this._element.style.overflowY="hidden"),this._element.classList.add(l0),this._queueCallback(()=>{this._element.classList.remove(l0),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._scrollBar.getWidth(),r=n>0;if(r&&!t){const i=gi()?"paddingLeft":"paddingRight";this._element.style[i]=`${n}px`}if(!r&&t){const i=gi()?"paddingRight":"paddingLeft";this._element.style[i]=`${n}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,n){return this.each(function(){const r=RL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof r[t]>"u")throw new TypeError(`No method named "${t}"`);r[t](n)}})}};de.on(document,hQ,xQ,function(e){const t=De.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),de.one(t,OL,i=>{i.defaultPrevented||de.one(t,NL,()=>{Nu(this)&&this.focus()})});const n=De.findOne(gQ);n&&fm.getInstance(n).hide(),fm.getOrCreateInstance(t).toggle(this)});dg(fm);xi(fm);const bQ="offcanvas",EQ="bs.offcanvas",Lo=`.${EQ}`,DL=".data-api",SQ=`load${Lo}${DL}`,CQ="Escape",VA="show",UA="showing",WA="hiding",IQ="offcanvas-backdrop",LL=".offcanvas.show",AQ=`show${Lo}`,TQ=`shown${Lo}`,kQ=`hide${Lo}`,GA=`hidePrevented${Lo}`,PL=`hidden${Lo}`,NQ=`resize${Lo}`,OQ=`click${Lo}${DL}`,RQ=`keydown.dismiss${Lo}`,DQ='[data-bs-toggle="offcanvas"]',LQ={backdrop:!0,keyboard:!0,scroll:!1},PQ={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};let xu=class ML extends Fi{constructor(t,n){super(t,n),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return LQ}static get DefaultType(){return PQ}static get NAME(){return bQ}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||de.trigger(this._element,AQ,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new m_().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(UA);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(VA),this._element.classList.remove(UA),de.trigger(this._element,TQ,{relatedTarget:t})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||de.trigger(this._element,kQ).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(WA),this._backdrop.hide();const n=()=>{this._element.classList.remove(VA,WA),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new m_().reset(),de.trigger(this._element,PL)};this._queueCallback(n,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=()=>{if(this._config.backdrop==="static"){de.trigger(this._element,GA);return}this.hide()},n=!!this._config.backdrop;return new TL({className:IQ,isVisible:n,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:n?t:null})}_initializeFocusTrap(){return new kL({trapElement:this._element})}_addEventListeners(){de.on(this._element,RQ,t=>{if(t.key===CQ){if(this._config.keyboard){this.hide();return}de.trigger(this._element,GA)}})}static jQueryInterface(t){return this.each(function(){const n=ML.getOrCreateInstance(this,t);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};de.on(document,OQ,DQ,function(e){const t=De.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),As(this))return;de.one(t,PL,()=>{Nu(this)&&this.focus()});const n=De.findOne(LL);n&&n!==t&&xu.getInstance(n).hide(),xu.getOrCreateInstance(t).toggle(this)});de.on(window,SQ,()=>{for(const e of De.find(LL))xu.getOrCreateInstance(e).show()});de.on(window,NQ,()=>{for(const e of De.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(e).position!=="fixed"&&xu.getOrCreateInstance(e).hide()});dg(xu);xi(xu);const MQ=/^aria-[\w-]*$/i,$L={"*":["class","dir","id","lang","role",MQ],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},$Q=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),FQ=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,BQ=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?$Q.has(n)?!!FQ.test(e.nodeValue):!0:t.filter(r=>r instanceof RegExp).some(r=>r.test(n))};function HQ(e,t,n){if(!e.length)return e;if(n&&typeof n=="function")return n(e);const i=new window.DOMParser().parseFromString(e,"text/html"),o=[].concat(...i.body.querySelectorAll("*"));for(const s of o){const a=s.nodeName.toLowerCase();if(!Object.keys(t).includes(a)){s.remove();continue}const u=[].concat(...s.attributes),c=[].concat(t["*"]||[],t[a]||[]);for(const d of u)BQ(d,c)||s.removeAttribute(d.nodeName)}return i.body.innerHTML}const zQ="TemplateFactory",jQ={allowList:$L,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},VQ={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},UQ={entry:"(string|element|function|null)",selector:"(string|element)"};class WQ extends od{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return jQ}static get DefaultType(){return VQ}static get NAME(){return zQ}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[i,o]of Object.entries(this._config.content))this._setContent(t,o,i);const n=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&n.classList.add(...r.split(" ")),n}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[n,r]of Object.entries(t))super._typeCheckConfig({selector:n,entry:r},UQ)}_setContent(t,n,r){const i=De.findOne(r,t);if(i){if(n=this._resolvePossibleFunction(n),!n){i.remove();return}if(wo(n)){this._putElementInTemplate(Is(n),i);return}if(this._config.html){i.innerHTML=this._maybeSanitize(n);return}i.textContent=n}}_maybeSanitize(t){return this._config.sanitize?HQ(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return hr(t,[this])}_putElementInTemplate(t,n){if(this._config.html){n.innerHTML="",n.append(t);return}n.textContent=t.textContent}}const GQ="tooltip",KQ=new Set(["sanitize","allowList","sanitizeFn"]),u0="fade",qQ="modal",zp="show",YQ=".tooltip-inner",KA=`.${qQ}`,qA="hide.bs.modal",Cc="hover",c0="focus",XQ="click",QQ="manual",ZQ="hide",JQ="hidden",eZ="show",tZ="shown",nZ="inserted",rZ="click",iZ="focusin",oZ="focusout",sZ="mouseenter",aZ="mouseleave",lZ={AUTO:"auto",TOP:"top",RIGHT:gi()?"left":"right",BOTTOM:"bottom",LEFT:gi()?"right":"left"},uZ={allowList:$L,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},cZ={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};let ld=class FL extends Fi{constructor(t,n){if(typeof rL>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,n),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return uZ}static get DefaultType(){return cZ}static get NAME(){return GQ}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),de.off(this._element.closest(KA),qA,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const t=de.trigger(this._element,this.constructor.eventName(eZ)),r=(sL(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!r)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(i),de.trigger(this._element,this.constructor.eventName(nZ))),this._popper=this._createPopper(i),i.classList.add(zp),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))de.on(a,"mouseover",lm);const s=()=>{de.trigger(this._element,this.constructor.eventName(tZ)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||de.trigger(this._element,this.constructor.eventName(ZQ)).defaultPrevented)return;if(this._getTipElement().classList.remove(zp),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))de.off(i,"mouseover",lm);this._activeTrigger[XQ]=!1,this._activeTrigger[c0]=!1,this._activeTrigger[Cc]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),de.trigger(this._element,this.constructor.eventName(JQ)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const n=this._getTemplateFactory(t).toHtml();if(!n)return null;n.classList.remove(u0,zp),n.classList.add(`bs-${this.constructor.NAME}-auto`);const r=Xq(this.constructor.NAME).toString();return n.setAttribute("id",r),this._isAnimated()&&n.classList.add(u0),n}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new WQ({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[YQ]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(u0)}_isShown(){return this.tip&&this.tip.classList.contains(zp)}_createPopper(t){const n=hr(this._config.placement,[this,t,this._element]),r=lZ[n.toUpperCase()];return A1(this._element,t,this._getPopperConfig(r))}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(n=>Number.parseInt(n,10)):typeof t=="function"?n=>t(n,this._element):t}_resolvePossibleFunction(t){return hr(t,[this._element])}_getPopperConfig(t){const n={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...n,...hr(this._config.popperConfig,[n])}}_setListeners(){const t=this._config.trigger.split(" ");for(const n of t)if(n==="click")de.on(this._element,this.constructor.eventName(rZ),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(n!==QQ){const r=n===Cc?this.constructor.eventName(sZ):this.constructor.eventName(iZ),i=n===Cc?this.constructor.eventName(aZ):this.constructor.eventName(oZ);de.on(this._element,r,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusin"?c0:Cc]=!0,s._enter()}),de.on(this._element,i,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusout"?c0:Cc]=s._element.contains(o.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},de.on(this._element.closest(KA),qA,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,n){clearTimeout(this._timeout),this._timeout=setTimeout(t,n)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const n=bo.getDataAttributes(this._element);for(const r of Object.keys(n))KQ.has(r)&&delete n[r];return t={...n,...typeof t=="object"&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=t.container===!1?document.body:Is(t.container),typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),typeof t.title=="number"&&(t.title=t.title.toString()),typeof t.content=="number"&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[n,r]of Object.entries(this._config))this.constructor.Default[n]!==r&&(t[n]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const n=FL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}};xi(ld);const fZ="popover",dZ=".popover-header",pZ=".popover-body",hZ={...ld.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},mZ={...ld.DefaultType,content:"(null|string|element|function)"};class O1 extends ld{static get Default(){return hZ}static get DefaultType(){return mZ}static get NAME(){return fZ}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[dZ]:this._getTitle(),[pZ]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const n=O1.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t]()}})}}xi(O1);const gZ="scrollspy",yZ="bs.scrollspy",R1=`.${yZ}`,vZ=".data-api",xZ=`activate${R1}`,YA=`click${R1}`,_Z=`load${R1}${vZ}`,wZ="dropdown-item",vl="active",bZ='[data-bs-spy="scroll"]',f0="[href]",EZ=".nav, .list-group",XA=".nav-link",SZ=".nav-item",CZ=".list-group-item",IZ=`${XA}, ${SZ} > ${XA}, ${CZ}`,AZ=".dropdown",TZ=".dropdown-toggle",kZ={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},NZ={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class pg extends Fi{constructor(t,n){super(t,n),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return kZ}static get DefaultType(){return NZ}static get NAME(){return gZ}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Is(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,typeof t.threshold=="string"&&(t.threshold=t.threshold.split(",").map(n=>Number.parseFloat(n))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(de.off(this._config.target,YA),de.on(this._config.target,YA,f0,t=>{const n=this._observableSections.get(t.target.hash);if(n){t.preventDefault();const r=this._rootElement||window,i=n.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:i,behavior:"smooth"});return}r.scrollTop=i}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(n=>this._observerCallback(n),t)}_observerCallback(t){const n=s=>this._targetLinks.get(`#${s.target.id}`),r=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(n(s))},i=(this._rootElement||document.documentElement).scrollTop,o=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(n(s));continue}const a=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(r(s),!i)return;continue}!o&&!a&&r(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=De.find(f0,this._config.target);for(const n of t){if(!n.hash||As(n))continue;const r=De.findOne(decodeURI(n.hash),this._element);Nu(r)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,r))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(vl),this._activateParents(t),de.trigger(this._element,xZ,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains(wZ)){De.findOne(TZ,t.closest(AZ)).classList.add(vl);return}for(const n of De.parents(t,EZ))for(const r of De.prev(n,IZ))r.classList.add(vl)}_clearActiveClass(t){t.classList.remove(vl);const n=De.find(`${f0}.${vl}`,t);for(const r of n)r.classList.remove(vl)}static jQueryInterface(t){return this.each(function(){const n=pg.getOrCreateInstance(this,t);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(window,_Z,()=>{for(const e of De.find(bZ))pg.getOrCreateInstance(e)});xi(pg);const OZ="tab",RZ="bs.tab",Ha=`.${RZ}`,DZ=`hide${Ha}`,LZ=`hidden${Ha}`,PZ=`show${Ha}`,MZ=`shown${Ha}`,$Z=`click${Ha}`,FZ=`keydown${Ha}`,BZ=`load${Ha}`,HZ="ArrowLeft",QA="ArrowRight",zZ="ArrowUp",ZA="ArrowDown",d0="Home",JA="End",pa="active",eT="fade",p0="show",jZ="dropdown",BL=".dropdown-toggle",VZ=".dropdown-menu",h0=`:not(${BL})`,UZ='.list-group, .nav, [role="tablist"]',WZ=".nav-item, .list-group-item",GZ=`.nav-link${h0}, .list-group-item${h0}, [role="tab"]${h0}`,HL='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',m0=`${GZ}, ${HL}`,KZ=`.${pa}[data-bs-toggle="tab"], .${pa}[data-bs-toggle="pill"], .${pa}[data-bs-toggle="list"]`;class _u extends Fi{constructor(t){super(t),this._parent=this._element.closest(UZ),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),de.on(this._element,FZ,n=>this._keydown(n)))}static get NAME(){return OZ}show(){const t=this._element;if(this._elemIsActive(t))return;const n=this._getActiveElem(),r=n?de.trigger(n,DZ,{relatedTarget:t}):null;de.trigger(t,PZ,{relatedTarget:n}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(n,t),this._activate(t,n))}_activate(t,n){if(!t)return;t.classList.add(pa),this._activate(De.getElementFromSelector(t));const r=()=>{if(t.getAttribute("role")!=="tab"){t.classList.add(p0);return}t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),de.trigger(t,MZ,{relatedTarget:n})};this._queueCallback(r,t,t.classList.contains(eT))}_deactivate(t,n){if(!t)return;t.classList.remove(pa),t.blur(),this._deactivate(De.getElementFromSelector(t));const r=()=>{if(t.getAttribute("role")!=="tab"){t.classList.remove(p0);return}t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),de.trigger(t,LZ,{relatedTarget:n})};this._queueCallback(r,t,t.classList.contains(eT))}_keydown(t){if(![HZ,QA,zZ,ZA,d0,JA].includes(t.key))return;t.stopPropagation(),t.preventDefault();const n=this._getChildren().filter(i=>!As(i));let r;if([d0,JA].includes(t.key))r=n[t.key===d0?0:n.length-1];else{const i=[QA,ZA].includes(t.key);r=T1(n,t.target,i,!0)}r&&(r.focus({preventScroll:!0}),_u.getOrCreateInstance(r).show())}_getChildren(){return De.find(m0,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,n){this._setAttributeIfNotExists(t,"role","tablist");for(const r of n)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const n=this._elemIsActive(t),r=this._getOuterElement(t);t.setAttribute("aria-selected",n),r!==t&&this._setAttributeIfNotExists(r,"role","presentation"),n||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const n=De.getElementFromSelector(t);n&&(this._setAttributeIfNotExists(n,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(n,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,n){const r=this._getOuterElement(t);if(!r.classList.contains(jZ))return;const i=(o,s)=>{const a=De.findOne(o,r);a&&a.classList.toggle(s,n)};i(BL,pa),i(VZ,p0),r.setAttribute("aria-expanded",n)}_setAttributeIfNotExists(t,n,r){t.hasAttribute(n)||t.setAttribute(n,r)}_elemIsActive(t){return t.classList.contains(pa)}_getInnerElement(t){return t.matches(m0)?t:De.findOne(m0,t)}_getOuterElement(t){return t.closest(WZ)||t}static jQueryInterface(t){return this.each(function(){const n=_u.getOrCreateInstance(this);if(typeof t=="string"){if(n[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);n[t]()}})}}de.on(document,$Z,HL,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),!As(this)&&_u.getOrCreateInstance(this).show()});de.on(window,BZ,()=>{for(const e of De.find(KZ))_u.getOrCreateInstance(e)});xi(_u);const qZ="toast",YZ="bs.toast",Ps=`.${YZ}`,XZ=`mouseover${Ps}`,QZ=`mouseout${Ps}`,ZZ=`focusin${Ps}`,JZ=`focusout${Ps}`,eJ=`hide${Ps}`,tJ=`hidden${Ps}`,nJ=`show${Ps}`,rJ=`shown${Ps}`,iJ="fade",tT="hide",jp="show",Vp="showing",oJ={animation:"boolean",autohide:"boolean",delay:"number"},sJ={animation:!0,autohide:!0,delay:5e3};let zL=class jL extends Fi{constructor(t,n){super(t,n),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return sJ}static get DefaultType(){return oJ}static get NAME(){return qZ}show(){if(de.trigger(this._element,nJ).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(iJ);const n=()=>{this._element.classList.remove(Vp),de.trigger(this._element,rJ),this._maybeScheduleHide()};this._element.classList.remove(tT),id(this._element),this._element.classList.add(jp,Vp),this._queueCallback(n,this._element,this._config.animation)}hide(){if(!this.isShown()||de.trigger(this._element,eJ).defaultPrevented)return;const n=()=>{this._element.classList.add(tT),this._element.classList.remove(Vp,jp),de.trigger(this._element,tJ)};this._element.classList.add(Vp),this._queueCallback(n,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(jp),super.dispose()}isShown(){return this._element.classList.contains(jp)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,n){switch(t.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=n;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=n;break}}if(n){this._clearTimeout();return}const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){de.on(this._element,XZ,t=>this._onInteraction(t,!0)),de.on(this._element,QZ,t=>this._onInteraction(t,!1)),de.on(this._element,ZZ,t=>this._onInteraction(t,!0)),de.on(this._element,JZ,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const n=jL.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof n[t]>"u")throw new TypeError(`No method named "${t}"`);n[t](this)}})}};dg(zL);xi(zL);function Du({children:e,text:t}){const n=A.useRef("");return A.useEffect(()=>{const r=new ld(n.current,{title:t,placement:"bottom",trigger:"hover"});return()=>r.dispose()},[t]),Q.cloneElement(e,{ref:n})}const VL=[{actionId:"reset",hotkey:"F6",description:"PlayButton_Reset",icon:"bi-arrow-clockwise",enabledStatuses:["exception","halted","running","waiting"]},{actionId:"stepBack",hotkey:"F7",description:"PlayButton_StepBack",icon:"bi-skip-start-fill",enabledStatuses:["exception","halted","running","waiting"]},{actionId:"nextStep",hotkey:"F8",description:"PlayButton_NextStep",icon:"bi-skip-end-fill",enabledStatuses:["ready","running"]}],UL={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:aJ}=Q,{useSyncExternalStoreWithSelector:lJ}=pR;let nT=!1;const uJ=e=>e;function cJ(e,t=uJ,n){(UL?"production":void 0)!=="production"&&n&&!nT&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nT=!0);const r=lJ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return aJ(r),r}const fJ=e=>{(UL?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?hR(e):e,n=(r,i)=>cJ(t,r,i);return Object.assign(n,t),n},hg=e=>fJ;function D1(e){const t=e.getRightmostFailures();let n="";for(let r=0;r0&&(n+=", ");const i=t[r];i.type==="description"?n+=i.text.replace(/end of input/g,"[[Syntax_EndOfInput]]"):n+=`\`${i.text}\``}return n}function er(e){const t=e||"";return function(){throw new Error("this method "+t+" is abstract! (it has no implementation in class "+this.constructor.name+")")}}function Ms(e,t){if(!e)throw new Error(t||"Assertion failed")}function g_(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||(r=n.call(this)),r}})}function dJ(e){return e&&Object.assign({},e)}function WL(e,t){const n=[];for(;t-- >0;)n.push(e());return n}function GL(e,t){return new Array(t+1).join(e)}function mg(e,t){return WL(()=>e,t)}function y_(e){const t=[];for(let n=0;n{t.indexOf(n)<0&&t.push(n)}),t}function _a(e){const t=e[0];return t===t.toUpperCase()}function qL(e){return!_a(e)}function YL(e,t,n){const r=n||" ";return e.lengthString.fromCodePoint(parseInt(e,16));function XL(e){if(e.charAt(0)==="\\")switch(e.charAt(1)){case"b":return"\b";case"f":return"\f";case"n":return` +`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"x":return g0(e.slice(2,4));case"u":return e.charAt(2)==="{"?g0(e.slice(3,-1)):g0(e.slice(2,6));default:return e.charAt(1)}else return e}function QL(e){if(e==null)return String(e);const t=Object.prototype.toString.call(e);try{let n;return e.constructor&&e.constructor.name?n=e.constructor.name:t.indexOf("[object ")===0?n=t.slice(8,-1):n=typeof e,n+": "+JSON.stringify(String(e))}catch{return t}}const pJ=Object.freeze(Object.defineProperty({__proto__:null,StringBuffer:za,abstract:er,assert:Ms,clone:dJ,copyWithoutDuplicates:KL,defineLazyProperty:g_,getDuplicates:y_,isLexical:qL,isSyntactic:_a,padLeft:YL,repeat:mg,repeatFn:WL,repeatStr:GL,unescapeCodePoint:XL,unexpectedObjToString:QL},Symbol.toStringTag,{value:"Module"})),hJ={Lu:new RegExp("\\p{Lu}","u"),Ll:new RegExp("\\p{Ll}","u"),Lt:new RegExp("\\p{Lt}","u"),Lm:new RegExp("\\p{Lm}","u"),Lo:new RegExp("\\p{Lo}","u"),Nl:new RegExp("\\p{Nl}","u"),Nd:new RegExp("\\p{Nd}","u"),Mn:new RegExp("\\p{Mn}","u"),Mc:new RegExp("\\p{Mc}","u"),Pc:new RegExp("\\p{Pc}","u"),Zs:new RegExp("\\p{Zs}","u"),L:new RegExp("\\p{Letter}","u"),Ltmo:new RegExp("\\p{Lt}|\\p{Lm}|\\p{Lo}","u")};class We{constructor(){if(this.constructor===We)throw new Error("PExpr cannot be instantiated -- it's abstract")}withSource(t){return t&&(this.source=t.trimmed()),this}}const Ln=Object.create(We.prototype),Pn=Object.create(We.prototype);class Sn extends We{constructor(t){super(),this.obj=t}}class Mn extends We{constructor(t,n){super(),this.from=t,this.to=n,this.matchCodePoint=t.length>1||n.length>1}}class $n extends We{constructor(t){super(),this.index=t}}class rn extends We{constructor(t){super(),this.terms=t}}class gg extends rn{constructor(t,n,r){const i=t.rules[n].body;super([r,i]),this.superGrammar=t,this.name=n,this.body=r}}class yg extends rn{constructor(t,n,r,i){const o=t.rules[n].body;super([...r,o,...i]),this.superGrammar=t,this.ruleName=n,this.expansionPos=r.length}}class dn extends We{constructor(t){super(),this.factors=t}}class tr extends We{constructor(t){super(),this.expr=t}}class ja extends tr{}class Lu extends tr{}class Po extends tr{}ja.prototype.operator="*";Lu.prototype.operator="+";Po.prototype.operator="?";ja.prototype.minNumMatches=0;Lu.prototype.minNumMatches=1;Po.prototype.minNumMatches=0;ja.prototype.maxNumMatches=Number.POSITIVE_INFINITY;Lu.prototype.maxNumMatches=Number.POSITIVE_INFINITY;Po.prototype.maxNumMatches=1;class nr extends We{constructor(t){super(),this.expr=t}}class rr extends We{constructor(t){super(),this.expr=t}}class br extends We{constructor(t){super(),this.expr=t}}class gt extends We{constructor(t,n=[]){super(),this.ruleName=t,this.args=n}isSyntactic(){return _a(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,"_memoKey",{value:this.toString()}),this._memoKey}}class bn extends We{constructor(t){super(),this.category=t,this.pattern=hJ[t]}}function jt(e,t){let n;return t?(n=new Error(t.getLineAndColumnMessage()+e),n.shortMessage=e,n.interval=t):n=new Error(e),n}function v_(){return jt("Interval sources don't match")}function mJ(e){const t=new Error;return Object.defineProperty(t,"message",{enumerable:!0,get(){return e.message}}),Object.defineProperty(t,"shortMessage",{enumerable:!0,get(){return"Expected "+e.getExpectedText()}}),t.interval=e.getInterval(),t}function gJ(e,t,n){const r=t?`Grammar ${e} is not declared in namespace '${t}'`:"Undeclared grammar "+e;return jt(r,n)}function yJ(e,t){return jt("Grammar "+e.name+" is already declared in this namespace")}function vJ(e){return jt(`Grammar '${e.name}' does not support incremental parsing`)}function ZL(e,t,n){return jt("Rule "+e+" is not declared in grammar "+t,n)}function xJ(e,t,n){return jt("Cannot override rule "+e+" because it is not declared in "+t,n)}function _J(e,t,n){return jt("Cannot extend rule "+e+" because it is not declared in "+t,n)}function rT(e,t,n,r){let i="Duplicate declaration for rule '"+e+"' in grammar '"+t+"'";return t!==n&&(i+=" (originally declared in '"+n+"')"),jt(i,r)}function JL(e,t,n,r){return jt("Wrong number of parameters for rule "+e+" (expected "+t+", got "+n+")",r)}function wJ(e,t,n,r){return jt("Wrong number of arguments for rule "+e+" (expected "+t+", got "+n+")",r)}function iT(e,t,n){return jt("Duplicate parameter names in rule "+e+": "+t.join(", "),n)}function bJ(e,t){return jt("Invalid parameter to rule "+e+": "+t+" has arity "+t.getArity()+", but parameter expressions must have arity 1",t.source)}const EJ="NOTE: A _syntactic rule_ is a rule whose name begins with a capital letter. See https://ohmjs.org/d/svl for more details.";function SJ(e,t){return jt("Cannot apply syntactic rule "+e+" from here (inside a lexical context)",t.source)}function CJ(e){const{ruleName:t}=e;return jt(`applySyntactic is for syntactic rules, but '${t}' is a lexical rule. `+EJ,e.source)}function IJ(e){return jt("applySyntactic is not required here (in a syntactic context)",e.source)}function oT(e,t){return jt("Incorrect argument type: expected "+e,t.source)}function AJ(e){return jt("'...' can appear at most once in a rule body",e.source)}function TJ(e){const t=e._node;Ms(t&&t.isNonterminal()&&t.ctorName==="escapeChar_unicodeCodePoint");const n=e.children.slice(1,-1).map(i=>i.source),r=n[0].coverageWith(...n.slice(1));return jt(`U+${r.contents} is not a valid Unicode code point`,r)}function eP(e,t){const n=t.length>0?t[t.length-1].args:[];let i="Nullable expression "+e.expr.substituteParams(n)+" is not allowed inside '"+e.operator+"' (possible infinite loop)";if(t.length>0){const o=t.map(s=>new gt(s.ruleName,s.args)).join(` +`);i+=` +Application stack (most recent application last): +`+o}return jt(i,e.expr.source)}function tP(e,t,n,r){return jt("Rule "+e+" involves an alternation which has inconsistent arity (expected "+t+", got "+n+")",r.source)}function kJ(e){const t=e.map(n=>n.message);return jt(["Errors:"].concat(t).join(` +- `),e[0].interval)}function NJ(e,t,n,r){let i=r.slice(0,-1).map(u=>{const c=" "+u[0].name+" > "+u[1];return u.length===3?c+" for '"+u[2]+"'":c}).join(` +`);i+=` + `+t+" > "+e;let o="";e==="_iter"&&(o=[` +NOTE: as of Ohm v16, there is no default action for iteration nodes — see `," https://ohmjs.org/d/dsa for details."].join(` +`));const s=[`Missing semantic action for '${e}' in ${n} '${t}'.${o}`,"Action stack (most recent call last):",i].join(` +`),a=jt(s);return a.name="missingSemanticAction",a}function OJ(e){if(e.length===1)throw e[0];if(e.length>1)throw kJ(e)}function RJ(e){let t=0;return e.map(r=>{const i=r.toString();return t=Math.max(t,i.length),i}).map(r=>YL(r,t))}function sT(e,t,n){const r=e.length,i=e.slice(0,n),o=e.slice(n+t.length);return(i+t+o).substr(0,r)}function DJ(...e){const t=this,{offset:n}=t,{repeatStr:r}=pJ,i=new za;i.append("Line "+t.lineNum+", col "+t.colNum+`: +`);const o=RJ([t.prevLine==null?0:t.lineNum-1,t.lineNum,t.nextLine==null?0:t.lineNum+1]),s=(d,p,h)=>{i.append(h+o[d]+" | "+p+` +`)};t.prevLine!=null&&s(0,t.prevLine," "),s(1,t.line,"> ");const a=t.line.length;let u=r(" ",a+1);for(let d=0;d=0&&p<=h,"range start must be >= 0 and <= end");const m=n-t.colNum+1;p=Math.max(0,p-m),h=Math.min(h-m,a),u=sT(u,r("~",h-p),p)}const c=2+o[1].length+3;return i.append(r(" ",c)),u=sT(u,"^",t.colNum-1),i.append(u.replace(/ +$/,"")+` +`),t.nextLine!=null&&s(2,t.nextLine," "),i.contents()}let x_=[];function nP(e){x_.push(e)}function LJ(e){x_.forEach(t=>{t(e)}),x_=null}function L1(e,t){let n=1,r=1,i=0,o=0,s=null,a=null,u=-1;for(;i=0&&(a=e.slice(u,o).replace(/\r?\n$/,""));const d=e.slice(o,c).replace(/\r$/,"");return{offset:t,lineNum:n,colNum:r,line:d,prevLine:a,nextLine:s,toString:DJ}}function P1(e,t,...n){return L1(e,t).toString(...n)}const aT=(()=>{let e=0;return t=>""+t+e++})();class kn{constructor(t,n,r){this.sourceString=t,this.startIdx=n,this.endIdx=r}get contents(){return this._contents===void 0&&(this._contents=this.sourceString.slice(this.startIdx,this.endIdx)),this._contents}get length(){return this.endIdx-this.startIdx}coverageWith(...t){return kn.coverage(...t,this)}collapsedLeft(){return new kn(this.sourceString,this.startIdx,this.startIdx)}collapsedRight(){return new kn(this.sourceString,this.endIdx,this.endIdx)}getLineAndColumn(){return L1(this.sourceString,this.startIdx)}getLineAndColumnMessage(){const t=[this.startIdx,this.endIdx];return P1(this.sourceString,this.startIdx,t)}minus(t){if(this.sourceString!==t.sourceString)throw v_();return this.startIdx===t.startIdx&&this.endIdx===t.endIdx?[]:this.startIdx=t.startIdx&&this.endIdx<=t.endIdx,"other interval does not cover this one"),new kn(this.sourceString,this.startIdx-t.startIdx,this.endIdx-t.startIdx)}trimmed(){const{contents:t}=this,n=this.startIdx+t.match(/^\s*/)[0].length,r=this.endIdx-t.match(/\s*$/)[0].length;return new kn(this.sourceString,n,r)}subInterval(t,n){const r=this.startIdx+t;return new kn(this.sourceString,r,r+n)}}kn.coverage=function(e,...t){let{startIdx:n,endIdx:r}=e;for(const i of t){if(i.sourceString!==e.sourceString)throw v_();n=Math.min(n,i.startIdx),r=Math.max(r,i.endIdx)}return new kn(e.sourceString,n,r)};const PJ=65535;class vg{constructor(t){this.source=t,this.pos=0,this.examinedLength=0}atEnd(){const t=this.pos>=this.source.length;return this.examinedLength=Math.max(this.examinedLength,this.pos+1),t}next(){const t=this.source[this.pos++];return this.examinedLength=Math.max(this.examinedLength,this.pos),t}nextCharCode(){const t=this.next();return t&&t.charCodeAt(0)}nextCodePoint(){const t=this.source.slice(this.pos++).codePointAt(0);return t>PJ&&(this.pos+=1),this.examinedLength=Math.max(this.examinedLength,this.pos),t}matchString(t,n){let r;if(n){for(r=0;r!r.isFluffy());for(let r=0;r0&&(r===n.length-1?t.append(n.length>2?", or ":" or "):t.append(", ")),t.append(n[r].toString());return t.contents()}getInterval(){const t=this.getRightmostFailurePosition();return new kn(this.input,t,t)}}class MJ{constructor(){this.applicationMemoKeyStack=[],this.memo={},this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,this.currentLeftRecursion=void 0}isActive(t){return this.applicationMemoKeyStack.indexOf(t.toMemoKey())>=0}enter(t){this.applicationMemoKeyStack.push(t.toMemoKey())}exit(){this.applicationMemoKeyStack.pop()}startLeftRecursion(t,n){n.isLeftRecursion=!0,n.headApplication=t,n.nextLeftRecursion=this.currentLeftRecursion,this.currentLeftRecursion=n;const{applicationMemoKeyStack:r}=this,i=r.indexOf(t.toMemoKey())+1,o=r.slice(i);n.isInvolved=function(s){return o.indexOf(s)>=0},n.updateInvolvedApplicationMemoKeys=function(){for(let s=i;s{const o=r[i];t+o.examinedLength>n?delete r[i]:(this.maxExaminedLength=Math.max(this.maxExaminedLength,o.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,o.rightmostFailureOffset))})}}const $J="✗",FJ="✓",BJ="⋅",HJ="⇒",zJ="␉",jJ="␊",VJ="␍",__={succeeded:1,isRootNode:2,isImplicitSpaces:4,isMemoized:8,isHeadOfLeftRecursion:16,terminatesLR:32};function UJ(e){return mg(" ",e).join("")}function WJ(e,t,n){const r=iP(e.slice(t,t+n));return r.length{i(c,o,a+1)}),r.exit&&r.exit.call(n,o,s,a))}this.isRootNode?this.children.forEach(o=>{i(o,null,0)}):i(this,null,0)}toString(){const t=new za;return this.walk((n,r,i)=>{if(!n)return this.SKIP;if(n.expr.constructor.name!=="Alt"){if(t.append(WJ(n.input,n.pos,10)+UJ(i*2+1)),t.append((n.succeeded?FJ:$J)+" "+n.displayString),n.isHeadOfLeftRecursion&&t.append(" (LR)"),n.succeeded){const s=iP(n.source.contents);t.append(" "+HJ+" "),t.append(typeof s=="string"?'"'+s+'"':s)}t.append(` +`)}}),t.contents()}}ws.prototype.SKIP={};Object.keys(__).forEach(e=>{const t=__[e];Object.defineProperty(ws.prototype,e,{get(){return(this._flags&t)!==0},set(n){n?this._flags|=t:this._flags&=~t}})});We.prototype.allowsSkippingPrecedingSpace=er("allowsSkippingPrecedingSpace");Ln.allowsSkippingPrecedingSpace=Pn.allowsSkippingPrecedingSpace=gt.prototype.allowsSkippingPrecedingSpace=Sn.prototype.allowsSkippingPrecedingSpace=Mn.prototype.allowsSkippingPrecedingSpace=bn.prototype.allowsSkippingPrecedingSpace=function(){return!0};rn.prototype.allowsSkippingPrecedingSpace=tr.prototype.allowsSkippingPrecedingSpace=br.prototype.allowsSkippingPrecedingSpace=rr.prototype.allowsSkippingPrecedingSpace=nr.prototype.allowsSkippingPrecedingSpace=$n.prototype.allowsSkippingPrecedingSpace=dn.prototype.allowsSkippingPrecedingSpace=function(){return!1};let Wc;nP(e=>{Wc=e});let dm;We.prototype.assertAllApplicationsAreValid=function(e,t){dm=0,this._assertAllApplicationsAreValid(e,t)};We.prototype._assertAllApplicationsAreValid=er("_assertAllApplicationsAreValid");Ln._assertAllApplicationsAreValid=Pn._assertAllApplicationsAreValid=Sn.prototype._assertAllApplicationsAreValid=Mn.prototype._assertAllApplicationsAreValid=$n.prototype._assertAllApplicationsAreValid=bn.prototype._assertAllApplicationsAreValid=function(e,t){};br.prototype._assertAllApplicationsAreValid=function(e,t){dm++,this.expr._assertAllApplicationsAreValid(e,t),dm--};rn.prototype._assertAllApplicationsAreValid=function(e,t){for(let n=0;n{if(c._assertAllApplicationsAreValid(e,t,a),c.getArity()!==1)throw bJ(this.ruleName,c)})};We.prototype.assertChoicesHaveUniformArity=er("assertChoicesHaveUniformArity");Ln.assertChoicesHaveUniformArity=Pn.assertChoicesHaveUniformArity=Sn.prototype.assertChoicesHaveUniformArity=Mn.prototype.assertChoicesHaveUniformArity=$n.prototype.assertChoicesHaveUniformArity=br.prototype.assertChoicesHaveUniformArity=bn.prototype.assertChoicesHaveUniformArity=function(e){};rn.prototype.assertChoicesHaveUniformArity=function(e){if(this.terms.length===0)return;const t=this.terms[0].getArity();for(let n=0;n{t.assertIteratedExprsAreNotNullable(e)})};let M1=class{constructor(t){this.matchLength=t}get ctorName(){throw new Error("subclass responsibility")}numChildren(){return this.children?this.children.length:0}childAt(t){if(this.children)return this.children[t]}indexOfChild(t){return this.children.indexOf(t)}hasChildren(){return this.numChildren()>0}hasNoChildren(){return!this.hasChildren()}onlyChild(){if(this.numChildren()!==1)throw new Error("cannot get only child of a node of type "+this.ctorName+" (it has "+this.numChildren()+" children)");return this.firstChild()}firstChild(){if(this.hasNoChildren())throw new Error("cannot get first child of a "+this.ctorName+" node, which has no children");return this.childAt(0)}lastChild(){if(this.hasNoChildren())throw new Error("cannot get last child of a "+this.ctorName+" node, which has no children");return this.childAt(this.numChildren()-1)}childBefore(t){const n=this.indexOfChild(t);if(n<0)throw new Error("Node.childBefore() called w/ an argument that is not a child");if(n===0)throw new Error("cannot get child before first child");return this.childAt(n-1)}childAfter(t){const n=this.indexOfChild(t);if(n<0)throw new Error("Node.childAfter() called w/ an argument that is not a child");if(n===this.numChildren()-1)throw new Error("cannot get child after last child");return this.childAt(n+1)}isTerminal(){return!1}isNonterminal(){return!1}isIteration(){return!1}isOptional(){return!1}};class Va extends M1{get ctorName(){return"_terminal"}isTerminal(){return!0}get primitiveValue(){throw new Error("The `primitiveValue` property was removed in Ohm v17.")}}class GJ extends M1{constructor(t,n,r,i){super(i),this.ruleName=t,this.children=n,this.childOffsets=r}get ctorName(){return this.ruleName}isNonterminal(){return!0}isLexical(){return qL(this.ctorName)}isSyntactic(){return _a(this.ctorName)}}class oP extends M1{constructor(t,n,r,i){super(r),this.children=t,this.childOffsets=n,this.optional=i}get ctorName(){return"_iter"}isIteration(){return!0}isOptional(){return this.optional}}We.prototype.eval=er("eval");Ln.eval=function(e){const{inputStream:t}=e,n=t.pos,r=t.nextCodePoint();return r!==void 0?(e.pushBinding(new Va(String.fromCodePoint(r).length),n),!0):(e.processFailure(n,this),!1)};Pn.eval=function(e){const{inputStream:t}=e,n=t.pos;return t.atEnd()?(e.pushBinding(new Va(0),n),!0):(e.processFailure(n,this),!1)};Sn.prototype.eval=function(e){const{inputStream:t}=e,n=t.pos;return t.matchString(this.obj)?(e.pushBinding(new Va(this.obj.length),n),!0):(e.processFailure(n,this),!1)};Mn.prototype.eval=function(e){const{inputStream:t}=e,n=t.pos,r=this.matchCodePoint?t.nextCodePoint():t.nextCharCode();return r!==void 0&&this.from.codePointAt(0)<=r&&r<=this.to.codePointAt(0)?(e.pushBinding(new Va(String.fromCodePoint(r).length),n),!0):(e.processFailure(n,this),!1)};$n.prototype.eval=function(e){return e.eval(e.currentApplication().args[this.index])};br.prototype.eval=function(e){e.enterLexifiedContext();const t=e.eval(this.expr);return e.exitLexifiedContext(),t};rn.prototype.eval=function(e){for(let t=0;t0){const h=i[r-1],m=o[r-1],v=m[m.length-1]+h[h.length-1].matchLength;c=o[0][0],d=v-c}const p=this instanceof Po;for(u=0;un.outputRecipe(e,t)))};gg.prototype.outputRecipe=function(e,t){return this.terms[0].outputRecipe(e,t)};yg.prototype.outputRecipe=function(e,t){const n=this.terms.slice(0,this.expansionPos),r=this.terms.slice(this.expansionPos+1);return["splice",Bi(this,t),n.map(i=>i.outputRecipe(e,t)),r.map(i=>i.outputRecipe(e,t))]};dn.prototype.outputRecipe=function(e,t){return["seq",Bi(this,t)].concat(this.factors.map(n=>n.outputRecipe(e,t)))};ja.prototype.outputRecipe=Lu.prototype.outputRecipe=Po.prototype.outputRecipe=nr.prototype.outputRecipe=rr.prototype.outputRecipe=br.prototype.outputRecipe=function(e,t){return[this.constructor.name.toLowerCase(),Bi(this,t),this.expr.outputRecipe(e,t)]};gt.prototype.outputRecipe=function(e,t){return["app",Bi(this,t),this.ruleName,this.args.map(n=>n.outputRecipe(e,t))]};bn.prototype.outputRecipe=function(e,t){return["unicodeChar",Bi(this,t),this.category]};We.prototype.introduceParams=er("introduceParams");Ln.introduceParams=Pn.introduceParams=Sn.prototype.introduceParams=Mn.prototype.introduceParams=$n.prototype.introduceParams=bn.prototype.introduceParams=function(e){return this};rn.prototype.introduceParams=function(e){return this.terms.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this};dn.prototype.introduceParams=function(e){return this.factors.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this};tr.prototype.introduceParams=nr.prototype.introduceParams=rr.prototype.introduceParams=br.prototype.introduceParams=function(e){return this.expr=this.expr.introduceParams(e),this};gt.prototype.introduceParams=function(e){const t=e.indexOf(this.ruleName);if(t>=0){if(this.args.length>0)throw new Error("Parameterized rules cannot be passed as arguments to another rule.");return new $n(t).withSource(this.source)}else return this.args.forEach((n,r,i)=>{i[r]=n.introduceParams(e)}),this};We.prototype.isNullable=function(e){return this._isNullable(e,Object.create(null))};We.prototype._isNullable=er("_isNullable");Ln._isNullable=Mn.prototype._isNullable=$n.prototype._isNullable=Lu.prototype._isNullable=bn.prototype._isNullable=function(e,t){return!1};Pn._isNullable=function(e,t){return!0};Sn.prototype._isNullable=function(e,t){return typeof this.obj=="string"?this.obj==="":!1};rn.prototype._isNullable=function(e,t){return this.terms.length===0||this.terms.some(n=>n._isNullable(e,t))};dn.prototype._isNullable=function(e,t){return this.factors.every(n=>n._isNullable(e,t))};ja.prototype._isNullable=Po.prototype._isNullable=nr.prototype._isNullable=rr.prototype._isNullable=function(e,t){return!0};br.prototype._isNullable=function(e,t){return this.expr._isNullable(e,t)};gt.prototype._isNullable=function(e,t){const n=this.toMemoKey();if(!Object.prototype.hasOwnProperty.call(t,n)){const{body:r}=e.rules[this.ruleName],i=r.substituteParams(this.args);t[n]=!1,t[n]=i._isNullable(e,t)}return t[n]};We.prototype.substituteParams=er("substituteParams");Ln.substituteParams=Pn.substituteParams=Sn.prototype.substituteParams=Mn.prototype.substituteParams=bn.prototype.substituteParams=function(e){return this};$n.prototype.substituteParams=function(e){return e[this.index]};rn.prototype.substituteParams=function(e){return new rn(this.terms.map(t=>t.substituteParams(e)))};dn.prototype.substituteParams=function(e){return new dn(this.factors.map(t=>t.substituteParams(e)))};tr.prototype.substituteParams=nr.prototype.substituteParams=rr.prototype.substituteParams=br.prototype.substituteParams=function(e){return new this.constructor(this.expr.substituteParams(e))};gt.prototype.substituteParams=function(e){if(this.args.length===0)return this;{const t=this.args.map(n=>n.substituteParams(e));return new gt(this.ruleName,t)}};function lT(e){return/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)}function $1(e){const t=Object.create(null);e.forEach(n=>{t[n]=(t[n]||0)+1}),Object.keys(t).forEach(n=>{if(t[n]<=1)return;let r=1;e.forEach((i,o)=>{i===n&&(e[o]=i+"_"+r++)})})}We.prototype.toArgumentNameList=er("toArgumentNameList");Ln.toArgumentNameList=function(e,t){return["any"]};Pn.toArgumentNameList=function(e,t){return["end"]};Sn.prototype.toArgumentNameList=function(e,t){return typeof this.obj=="string"&&/^[_a-zA-Z0-9]+$/.test(this.obj)?["_"+this.obj]:["$"+e]};Mn.prototype.toArgumentNameList=function(e,t){let n=this.from+"_to_"+this.to;return lT(n)||(n="_"+n),lT(n)||(n="$"+e),[n]};rn.prototype.toArgumentNameList=function(e,t){const n=this.terms.map(o=>o.toArgumentNameList(e,!0)),r=[],i=n[0].length;for(let o=0;o{const i=r.toArgumentNameList(e,!0);n=n.concat(i),e+=i.length}),t||$1(n),n};tr.prototype.toArgumentNameList=function(e,t){const n=this.expr.toArgumentNameList(e,t).map(r=>r[r.length-1]==="s"?r+"es":r+"s");return t||$1(n),n};Po.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t).map(n=>"opt"+n[0].toUpperCase()+n.slice(1))};nr.prototype.toArgumentNameList=function(e,t){return[]};rr.prototype.toArgumentNameList=br.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t)};gt.prototype.toArgumentNameList=function(e,t){return[this.ruleName]};bn.prototype.toArgumentNameList=function(e,t){return["$"+e]};$n.prototype.toArgumentNameList=function(e,t){return["param"+this.index]};We.prototype.toDisplayString=er("toDisplayString");rn.prototype.toDisplayString=dn.prototype.toDisplayString=function(){return this.source?this.source.trimmed().contents:"["+this.constructor.name+"]"};Ln.toDisplayString=Pn.toDisplayString=tr.prototype.toDisplayString=nr.prototype.toDisplayString=rr.prototype.toDisplayString=br.prototype.toDisplayString=Sn.prototype.toDisplayString=Mn.prototype.toDisplayString=$n.prototype.toDisplayString=function(){return this.toString()};gt.prototype.toDisplayString=function(){if(this.args.length>0){const e=this.args.map(t=>t.toDisplayString());return this.ruleName+"<"+e.join(",")+">"}else return this.ruleName};bn.prototype.toDisplayString=function(){return"Unicode ["+this.category+"] character"};function KJ(e){return e==="description"||e==="string"||e==="code"}class Er{constructor(t,n,r){if(!KJ(r))throw new Error("invalid Failure type: "+r);this.pexpr=t,this.text=n,this.type=r,this.fluffy=!1}getPExpr(){return this.pexpr}getText(){return this.text}getType(){return this.type}isDescription(){return this.type==="description"}isStringTerminal(){return this.type==="string"}isCode(){return this.type==="code"}isFluffy(){return this.fluffy}makeFluffy(){this.fluffy=!0}clearFluffy(){this.fluffy=!1}subsumes(t){return this.getText()===t.getText()&&this.type===t.type&&(!this.isFluffy()||this.isFluffy()&&t.isFluffy())}toString(){return this.type==="string"?JSON.stringify(this.getText()):this.getText()}clone(){const t=new Er(this.pexpr,this.text,this.type);return this.isFluffy()&&t.makeFluffy(),t}toKey(){return this.toString()+"#"+this.type}}We.prototype.toFailure=er("toFailure");Ln.toFailure=function(e){return new Er(this,"any object","description")};Pn.toFailure=function(e){return new Er(this,"end of input","description")};Sn.prototype.toFailure=function(e){return new Er(this,this.obj,"string")};Mn.prototype.toFailure=function(e){return new Er(this,JSON.stringify(this.from)+".."+JSON.stringify(this.to),"code")};nr.prototype.toFailure=function(e){const t=this.expr===Ln?"nothing":"not "+this.expr.toFailure(e);return new Er(this,t,"description")};rr.prototype.toFailure=function(e){return this.expr.toFailure(e)};gt.prototype.toFailure=function(e){let{description:t}=e.rules[this.ruleName];return t||(t=(/^[aeiouAEIOU]/.test(this.ruleName)?"an":"a")+" "+this.ruleName),new Er(this,t,"description")};bn.prototype.toFailure=function(e){return new Er(this,"a Unicode ["+this.category+"] character","description")};rn.prototype.toFailure=function(e){const n="("+this.terms.map(r=>r.toFailure(e)).join(" or ")+")";return new Er(this,n,"description")};dn.prototype.toFailure=function(e){const n="("+this.factors.map(r=>r.toFailure(e)).join(" ")+")";return new Er(this,n,"description")};tr.prototype.toFailure=function(e){const t="("+this.expr.toFailure(e)+this.operator+")";return new Er(this,t,"description")};We.prototype.toString=er("toString");Ln.toString=function(){return"any"};Pn.toString=function(){return"end"};Sn.prototype.toString=function(){return JSON.stringify(this.obj)};Mn.prototype.toString=function(){return JSON.stringify(this.from)+".."+JSON.stringify(this.to)};$n.prototype.toString=function(){return"$"+this.index};br.prototype.toString=function(){return"#("+this.expr.toString()+")"};rn.prototype.toString=function(){return this.terms.length===1?this.terms[0].toString():"("+this.terms.map(e=>e.toString()).join(" | ")+")"};dn.prototype.toString=function(){return this.factors.length===1?this.factors[0].toString():"("+this.factors.map(e=>e.toString()).join(" ")+")"};tr.prototype.toString=function(){return this.expr+this.operator};nr.prototype.toString=function(){return"~"+this.expr};rr.prototype.toString=function(){return"&"+this.expr};gt.prototype.toString=function(){if(this.args.length>0){const e=this.args.map(t=>t.toString());return this.ruleName+"<"+e.join(",")+">"}else return this.ruleName};bn.prototype.toString=function(){return"\\p{"+this.category+"}"};class F1 extends We{constructor(t){super(),this.obj=t}_getString(t){const n=t.currentApplication().args[this.obj.index];return Ms(n instanceof Sn,"expected a Terminal expression"),n.obj}allowsSkippingPrecedingSpace(){return!0}eval(t){const{inputStream:n}=t,r=n.pos,i=this._getString(t);return n.matchString(i,!0)?(t.pushBinding(new Va(i.length),r),!0):(t.processFailure(r,this),!1)}getArity(){return 1}substituteParams(t){return new F1(this.obj.substituteParams(t))}toDisplayString(){return this.obj.toDisplayString()+" (case-insensitive)"}toFailure(t){return new Er(this,this.obj.toFailure(t)+" (case-insensitive)","description")}_isNullable(t,n){return this.obj._isNullable(t,n)}}let sP;nP(e=>{sP=e.rules.applySyntactic.body});const y0=new gt("spaces");class qJ{constructor(t,n,r){this.matcher=t,this.startExpr=n,this.grammar=t.grammar,this.input=t.getInput(),this.inputStream=new vg(this.input),this.memoTable=t._memoTable,this.userData=void 0,this.doNotMemoize=!1,this._bindings=[],this._bindingOffsets=[],this._applicationStack=[],this._posStack=[0],this.inLexifiedContextStack=[!1],this.rightmostFailurePosition=-1,this._rightmostFailurePositionStack=[],this._recordedFailuresStack=[],r!==void 0&&(this.positionToRecordFailures=r,this.recordedFailures=Object.create(null))}posToOffset(t){return t-this._posStack[this._posStack.length-1]}enterApplication(t,n){this._posStack.push(this.inputStream.pos),this._applicationStack.push(n),this.inLexifiedContextStack.push(!1),t.enter(n),this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this.rightmostFailurePosition=-1}exitApplication(t,n){const r=this._posStack.pop();this._applicationStack.pop(),this.inLexifiedContextStack.pop(),t.exit(),this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,this._rightmostFailurePositionStack.pop()),n&&this.pushBinding(n,r)}enterLexifiedContext(){this.inLexifiedContextStack.push(!0)}exitLexifiedContext(){this.inLexifiedContextStack.pop()}currentApplication(){return this._applicationStack[this._applicationStack.length-1]}inSyntacticContext(){const t=this.currentApplication();return t?t.isSyntactic()&&!this.inLexifiedContext():this.startExpr.factors[0].isSyntactic()}inLexifiedContext(){return this.inLexifiedContextStack[this.inLexifiedContextStack.length-1]}skipSpaces(){return this.pushFailuresInfo(),this.eval(y0),this.popBinding(),this.popFailuresInfo(),this.inputStream.pos}skipSpacesIfInSyntacticContext(){return this.inSyntacticContext()?this.skipSpaces():this.inputStream.pos}maybeSkipSpacesBefore(t){return t.allowsSkippingPrecedingSpace()&&t!==y0?this.skipSpacesIfInSyntacticContext():this.inputStream.pos}pushBinding(t,n){this._bindings.push(t),this._bindingOffsets.push(this.posToOffset(n))}popBinding(){this._bindings.pop(),this._bindingOffsets.pop()}numBindings(){return this._bindings.length}truncateBindings(t){for(;this._bindings.length>t;)this.popBinding()}getCurrentPosInfo(){return this.getPosInfo(this.inputStream.pos)}getPosInfo(t){let n=this.memoTable[t];return n||(n=this.memoTable[t]=new MJ),n}processFailure(t,n){if(this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,t),this.recordedFailures&&t===this.positionToRecordFailures){const r=this.currentApplication();r&&(n=n.substituteParams(r.args)),this.recordFailure(n.toFailure(this.grammar),!1)}}recordFailure(t,n){const r=t.toKey();this.recordedFailures[r]?this.recordedFailures[r].isFluffy()&&!t.isFluffy()&&this.recordedFailures[r].clearFluffy():this.recordedFailures[r]=n?t.clone():t}recordFailures(t,n){Object.keys(t).forEach(r=>{this.recordFailure(t[r],n)})}cloneRecordedFailures(){if(!this.recordedFailures)return;const t=Object.create(null);return Object.keys(this.recordedFailures).forEach(n=>{t[n]=this.recordedFailures[n].clone()}),t}getRightmostFailurePosition(){return this.rightmostFailurePosition}_getRightmostFailureOffset(){return this.rightmostFailurePosition>=0?this.posToOffset(this.rightmostFailurePosition):-1}getMemoizedTraceEntry(t,n){const r=this.memoTable[t];if(r&&n instanceof gt){const i=r.memo[n.toMemoKey()];if(i&&i.traceEntry){const o=i.traceEntry.cloneWithExpr(n);return o.isMemoized=!0,o}}return null}getTraceEntry(t,n,r,i){if(n instanceof gt){const o=this.currentApplication(),s=o?o.args:[];n=n.substituteParams(s)}return this.getMemoizedTraceEntry(t,n)||new ws(this.input,t,this.inputStream.pos,n,r,i,this.trace)}isTracing(){return!!this.trace}hasNecessaryInfo(t){return this.trace&&!t.traceEntry?!1:this.recordedFailures&&this.inputStream.pos+t.rightmostFailureOffset===this.positionToRecordFailures?!!t.failuresAtRightmostPosition:!0}useMemoizedResult(t,n){this.trace&&this.trace.push(n.traceEntry);const r=this.inputStream.pos+n.rightmostFailureOffset;return this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,r),this.recordedFailures&&this.positionToRecordFailures===r&&n.failuresAtRightmostPosition&&this.recordFailures(n.failuresAtRightmostPosition,!0),this.inputStream.examinedLength=Math.max(this.inputStream.examinedLength,n.examinedLength+t),n.value?(this.inputStream.pos+=n.matchLength,this.pushBinding(n.value,t),!0):!1}eval(t){const{inputStream:n}=this,r=this._bindings.length,i=this.userData;let o;this.recordedFailures&&(o=this.recordedFailures,this.recordedFailures=Object.create(null));const s=n.pos,a=this.maybeSkipSpacesBefore(t);let u;this.trace&&(u=this.trace,this.trace=[]);const c=t.eval(this);if(this.trace){const d=this._bindings.slice(r),p=this.getTraceEntry(a,t,c,d);p.isImplicitSpaces=t===y0,p.isRootNode=t===this.startExpr,u.push(p),this.trace=u}return c?this.recordedFailures&&n.pos===this.positionToRecordFailures&&Object.keys(this.recordedFailures).forEach(d=>{this.recordedFailures[d].makeFluffy()}):(n.pos=s,this.truncateBindings(r),this.userData=i),this.recordedFailures&&this.recordFailures(o,!1),t===sP&&this.skipSpaces(),c}getMatchResult(){this.grammar._setUpMatchState(this),this.eval(this.startExpr);let t;this.recordedFailures&&(t=Object.keys(this.recordedFailures).map(r=>this.recordedFailures[r]));const n=this._bindings[0];return n&&(n.grammar=this.grammar),new rP(this.matcher,this.input,this.startExpr,n,this._bindingOffsets[0],this.rightmostFailurePosition,t)}getTrace(){this.trace=[];const t=this.getMatchResult(),n=this.trace[this.trace.length-1];return n.result=t,n}pushFailuresInfo(){this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this._recordedFailuresStack.push(this.recordedFailures)}popFailuresInfo(){this.rightmostFailurePosition=this._rightmostFailurePositionStack.pop(),this.recordedFailures=this._recordedFailuresStack.pop()}}class YJ{constructor(t){this.grammar=t,this._memoTable=[],this._input="",this._isMemoTableStale=!1}_resetMemoTable(){this._memoTable=[],this._isMemoTableStale=!1}getInput(){return this._input}setInput(t){return this._input!==t&&this.replaceInputRange(0,this._input.length,t),this}replaceInputRange(t,n,r){const i=this._input,o=this._memoTable;if(t<0||t>i.length||n<0||n>i.length||t>n)throw new Error("Invalid indices: "+t+" and "+n);this._input=i.slice(0,t)+r+i.slice(n),this._input!==i&&o.length>0&&(this._isMemoTableStale=!0);const s=o.slice(n);o.length=t;for(let a=0;aObject.prototype.hasOwnProperty.call(e,t);class uT{constructor(t,n,r){this._node=t,this.source=n,this._baseInterval=r,t.isNonterminal()&&Ms(n===r),this._childWrappers=[]}_forgetMemoizedResultFor(t){delete this._node[this._semantics.attributeKeys[t]],this.children.forEach(n=>{n._forgetMemoizedResultFor(t)})}child(t){if(!(0<=t&&ts._node),i=new oP(r,[],-1,!1),o=this._semantics.wrap(i,null,null);return o._childWrappers=n,o}get children(){return this._children()}get ctorName(){return this._node.ctorName}get numChildren(){return this._node.numChildren()}get sourceString(){return this.source.contents}}class _r{constructor(t,n){const r=this;if(this.grammar=t,this.checkedActionDicts=!1,this.Wrapper=class extends(n?n.Wrapper:uT){constructor(i,o,s){super(i,o,s),r.checkActionDictsIfHaventAlready(),this._semantics=r}toString(){return"[semantics wrapper for "+r.grammar.name+"]"}},this.super=n,n){if(!(t.equals(this.super.grammar)||t._inheritsFrom(this.super.grammar)))throw new Error("Cannot extend a semantics for grammar '"+this.super.grammar.name+"' for use with grammar '"+t.name+"' (not a sub-grammar)");this.operations=Object.create(this.super.operations),this.attributes=Object.create(this.super.attributes),this.attributeKeys=Object.create(null);for(const i in this.attributes)Object.defineProperty(this.attributeKeys,i,{value:aT(i)})}else this.operations=Object.create(null),this.attributes=Object.create(null),this.attributeKeys=Object.create(null)}toString(){return"[semantics for "+this.grammar.name+"]"}checkActionDictsIfHaventAlready(){this.checkedActionDicts||(this.checkActionDicts(),this.checkedActionDicts=!0)}checkActionDicts(){let t;for(t in this.operations)this.operations[t].checkActionDict(this.grammar);for(t in this.attributes)this.attributes[t].checkActionDict(this.grammar)}toRecipe(t){function n(i){return i.super!==_r.BuiltInSemantics._getSemantics()}let r=`(function(g) { +`;if(n(this)){r+=" var semantics = "+this.super.toRecipe(!0)+"(g";const i=this.super.grammar;let o=this.grammar;for(;o!==i;)r+=".superGrammar",o=o.superGrammar;r+=`); +`,r+=" return g.extendSemantics(semantics)"}else r+=" return g.createSemantics()";return["Operation","Attribute"].forEach(i=>{const o=this[i.toLowerCase()+"s"];Object.keys(o).forEach(s=>{const{actionDict:a,formals:u,builtInDefault:c}=o[s];let d=s;u.length>0&&(d+="("+u.join(", ")+")");let p;n(this)&&this.super[i.toLowerCase()+"s"][s]?p="extend"+i:p="add"+i,r+=` + .`+p+"("+JSON.stringify(d)+", {";const h=[];Object.keys(a).forEach(m=>{if(a[m]!==c){let v=a[m].toString().trim();v=v.replace(/^.*\(/,"function("),h.push(` + `+JSON.stringify(m)+": "+v)}}),r+=h.join(",")+` + })`})}),r+=`; + })`,t||(r=`(function() { + var grammar = this.fromRecipe(`+this.grammar.toRecipe()+`); + var semantics = `+r+`(grammar); + return semantics; +}); +`),r}addOperationOrAttribute(t,n,r){const i=t+"s",o=cT(n,t),{name:s}=o,{formals:a}=o;this.assertNewName(s,t);const u=XJ(t,s,p),c={_default:u};Object.keys(r).forEach(h=>{c[h]=r[h]});const d=t==="operation"?new $f(s,a,c,u):new b_(s,c,u);d.checkActionDict(this.grammar),this[i][s]=d;function p(...h){const m=this._semantics[i][s];if(arguments.length!==m.formals.length)throw new Error("Invalid number of arguments passed to "+s+" "+t+" (expected "+m.formals.length+", got "+arguments.length+")");const v=Object.create(null);for(const[y,_]of Object.entries(h)){const E=m.formals[y];v[E]=_}const x=this.args;this.args=v;const b=m.execute(this._semantics,this);return this.args=x,b}t==="operation"?(this.Wrapper.prototype[s]=p,this.Wrapper.prototype[s].toString=function(){return"["+s+" operation]"}):(Object.defineProperty(this.Wrapper.prototype,s,{get:p,configurable:!0}),Object.defineProperty(this.attributeKeys,s,{value:aT(s)}))}extendOperationOrAttribute(t,n,r){const i=t+"s";if(cT(n,"attribute"),!(this.super&&n in this.super[i]))throw new Error("Cannot extend "+t+" '"+n+"': did not inherit an "+t+" with that name");if(w_(this[i],n))throw new Error("Cannot extend "+t+" '"+n+"' again");const o=this[i][n].formals,s=this[i][n].actionDict,a=Object.create(s);Object.keys(r).forEach(u=>{a[u]=r[u]}),this[i][n]=t==="operation"?new $f(n,o,a):new b_(n,a),this[i][n].checkActionDict(this.grammar)}assertNewName(t,n){if(w_(uT.prototype,t))throw new Error("Cannot add "+n+" '"+t+"': that's a reserved name");if(t in this.operations)throw new Error("Cannot add "+n+" '"+t+"': an operation with that name already exists");if(t in this.attributes)throw new Error("Cannot add "+n+" '"+t+"': an attribute with that name already exists")}wrap(t,n,r){const i=r||n;return t instanceof this.Wrapper?t:new this.Wrapper(t,n,i)}}function cT(e,t){if(!_r.prototypeGrammar)return Ms(e.indexOf("(")===-1),{name:e,formals:[]};const n=_r.prototypeGrammar.match(e,t==="operation"?"OperationSignature":"AttributeSignature");if(n.failed())throw new Error(n.message);return _r.prototypeGrammarSemantics(n).parse()}function XJ(e,t,n){return function(...r){const o=(this._semantics.operations[t]||this._semantics.attributes[t]).formals.map(s=>this.args[s]);if(!this.isIteration()&&r.length===1)return n.apply(r[0],o);throw NJ(this.ctorName,t,e,Gc)}}_r.createSemantics=function(e,t){const n=new _r(e,t!==void 0?t:_r.BuiltInSemantics._getSemantics()),r=function(o){if(!(o instanceof rP))throw new TypeError("Semantics expected a MatchResult, but got "+QL(o));if(o.failed())throw new TypeError("cannot apply Semantics to "+o.toString());const s=o._cst;if(s.grammar!==e)throw new Error("Cannot use a MatchResult from grammar '"+s.grammar.name+"' with a semantics for '"+e.name+"'");const a=new vg(o.input);return n.wrap(s,a.interval(o._cstOffset,o.input.length))};return r.addOperation=function(i,o){return n.addOperationOrAttribute("operation",i,o),r},r.extendOperation=function(i,o){return n.extendOperationOrAttribute("operation",i,o),r},r.addAttribute=function(i,o){return n.addOperationOrAttribute("attribute",i,o),r},r.extendAttribute=function(i,o){return n.extendOperationOrAttribute("attribute",i,o),r},r._getActionDict=function(i){const o=n.operations[i]||n.attributes[i];if(!o)throw new Error('"'+i+'" is not a valid operation or attribute name in this semantics for "'+e.name+'"');return o.actionDict},r._remove=function(i){let o;return i in n.operations?(o=n.operations[i],delete n.operations[i]):i in n.attributes&&(o=n.attributes[i],delete n.attributes[i]),delete n.Wrapper.prototype[i],o},r.getOperationNames=function(){return Object.keys(n.operations)},r.getAttributeNames=function(){return Object.keys(n.attributes)},r.getGrammar=function(){return n.grammar},r.toRecipe=function(i){return n.toRecipe(i)},r.toString=n.toString.bind(n),r._getSemantics=function(){return n},r};class $f{constructor(t,n,r,i){this.name=t,this.formals=n,this.actionDict=r,this.builtInDefault=i}checkActionDict(t){t._checkTopDownActionDict(this.typeName,this.name,this.actionDict)}execute(t,n){try{const{ctorName:r}=n._node;let i=this.actionDict[r];return i?(Gc.push([this,r]),i.apply(n,n._children())):n.isNonterminal()&&(i=this.actionDict._nonterminal,i)?(Gc.push([this,"_nonterminal",r]),i.apply(n,n._children())):(Gc.push([this,"default action",r]),this.actionDict._default.apply(n,n._children()))}finally{Gc.pop()}}}$f.prototype.typeName="operation";class b_ extends $f{constructor(t,n,r){super(t,[],n,r)}execute(t,n){const r=n._node,i=t.attributeKeys[this.name];return w_(r,i)||(r[i]=$f.prototype.execute.call(this,t,n)),r[i]}}b_.prototype.typeName="attribute";const fT=["_iter","_terminal","_nonterminal","_default"];function dT(e){return Object.keys(e.rules).sort().map(t=>e.rules[t])}const QJ=e=>e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");let aP,lP;class Yn{constructor(t,n,r,i){if(this.name=t,this.superGrammar=n,this.rules=r,i){if(!(i in r))throw new Error("Invalid start rule: '"+i+"' is not a rule in grammar '"+t+"'");this.defaultStartRule=i}this._matchStateInitializer=void 0,this.supportsIncrementalParsing=!0}matcher(){return new YJ(this)}isBuiltIn(){return this===Yn.ProtoBuiltInRules||this===Yn.BuiltInRules}equals(t){if(this===t)return!0;if(t==null||this.name!==t.name||this.defaultStartRule!==t.defaultStartRule||!(this.superGrammar===t.superGrammar||this.superGrammar.equals(t.superGrammar)))return!1;const n=dT(this),r=dT(t);return n.length===r.length&&n.every((i,o)=>i.description===r[o].description&&i.formals.join(",")===r[o].formals.join(",")&&i.body.toString()===r[o].body.toString())}match(t,n){const r=this.matcher();return r.replaceInputRange(0,0,t),r.match(n)}trace(t,n){const r=this.matcher();return r.replaceInputRange(0,0,t),r.trace(n)}createSemantics(){return _r.createSemantics(this)}extendSemantics(t){return _r.createSemantics(this,t._getSemantics())}_checkTopDownActionDict(t,n,r){const i=[];for(const o in r){const s=r[o];if(!fT.includes(o)&&!(o in this.rules)){i.push(`'${o}' is not a valid semantic action for '${this.name}'`);continue}if(typeof s!="function"){i.push(`'${o}' must be a function in an action dictionary for '${this.name}'`);continue}const u=s.length,c=this._topDownActionArity(o);if(u!==c){let d;o==="_iter"||o==="_nonterminal"?d=`it should use a rest parameter, e.g. \`${o}(...children) {}\`. NOTE: this is new in Ohm v16 — see https://ohmjs.org/d/ati for details.`:d=`expected ${c}, got ${u}`,i.push(`Semantic action '${o}' has the wrong arity: ${d}`)}}if(i.length>0){const o=i.map(a=>"- "+a),s=new Error([`Found errors in the action dictionary of the '${n}' ${t}:`,...o].join(` +`));throw s.problems=i,s}}_topDownActionArity(t){return fT.includes(t)?0:this.rules[t].body.getArity()}_inheritsFrom(t){let n=this.superGrammar;for(;n;){if(n.equals(t,!0))return!0;n=n.superGrammar}return!1}toRecipe(t=void 0){const n={};this.source&&(n.source=this.source.contents);let r=null;this.defaultStartRule&&(r=this.defaultStartRule);const i={};Object.keys(this.rules).forEach(a=>{const u=this.rules[a],{body:c}=u,d=!this.superGrammar||!this.superGrammar.rules[a];let p;d?p="define":p=c instanceof gg?"extend":"override";const h={};if(u.source&&this.source){const x=u.source.relativeTo(this.source);h.sourceInterval=[x.startIdx,x.endIdx]}const m=d?u.description:null,v=c.outputRecipe(u.formals,this.source);i[a]=[p,h,m,u.formals,v]});let o="null";t?o=t:this.superGrammar&&!this.superGrammar.isBuiltIn()&&(o=this.superGrammar.toRecipe());const s=[...["grammar",n,this.name].map(JSON.stringify),o,...[r,i].map(JSON.stringify)];return QJ(`[${s.join(",")}]`)}toOperationActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}toAttributeActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}_toOperationOrAttributeActionDictionaryTemplate(){const t=new za;t.append("{");let n=!0;for(const r in this.rules){const{body:i}=this.rules[r];n?n=!1:t.append(","),t.append(` +`),t.append(" "),this.addSemanticActionTemplate(r,i,t)}return t.append(` +}`),t.contents()}addSemanticActionTemplate(t,n,r){r.append(t),r.append(": function(");const i=this._topDownActionArity(t);r.append(mg("_",i).join(", ")),r.append(`) { +`),r.append(" }")}parseApplication(t){let n;if(t.indexOf("<")===-1)n=new gt(t);else{const i=aP.match(t,"Base_application");n=lP(i,{})}if(!(n.ruleName in this.rules))throw ZL(n.ruleName,this.name);const{formals:r}=this.rules[n.ruleName];if(r.length!==n.args.length){const{source:i}=this.rules[n.ruleName];throw JL(n.ruleName,r.length,n.args.length,i)}return n}_setUpMatchState(t){this._matchStateInitializer&&this._matchStateInitializer(t)}}Yn.ProtoBuiltInRules=new Yn("ProtoBuiltInRules",void 0,{any:{body:Ln,formals:[],description:"any character",primitive:!0},end:{body:Pn,formals:[],description:"end of input",primitive:!0},caseInsensitive:{body:new F1(new $n(0)),formals:["str"],primitive:!0},lower:{body:new bn("Ll"),formals:[],description:"a lowercase letter",primitive:!0},upper:{body:new bn("Lu"),formals:[],description:"an uppercase letter",primitive:!0},unicodeLtmo:{body:new bn("Ltmo"),formals:[],description:"a Unicode character in Lt, Lm, or Lo",primitive:!0},spaces:{body:new ja(new gt("space")),formals:[]},space:{body:new Mn("\0"," "),formals:[],description:"a space"}});Yn.initApplicationParser=function(e,t){aP=e,lP=t};class pT{constructor(t){this.name=t}sourceInterval(t,n){return this.source.subInterval(t,n-t)}ensureSuperGrammar(){return this.superGrammar||this.withSuperGrammar(this.name==="BuiltInRules"?Yn.ProtoBuiltInRules:Yn.BuiltInRules),this.superGrammar}ensureSuperGrammarRuleForOverriding(t,n){const r=this.ensureSuperGrammar().rules[t];if(!r)throw xJ(t,this.superGrammar.name,n);return r}installOverriddenOrExtendedRule(t,n,r,i){const o=y_(n);if(o.length>0)throw iT(t,o,i);const s=this.ensureSuperGrammar().rules[t],a=s.formals,u=a?a.length:0;if(n.length!==u)throw JL(t,u,n.length,i);return this.install(t,n,r,s.description,i)}install(t,n,r,i,o,s=!1){return this.rules[t]={body:r.introduceParams(n),formals:n,description:i,source:o,primitive:s},this}withSuperGrammar(t){if(this.superGrammar)throw new Error("the super grammar of a GrammarDecl cannot be set more than once");return this.superGrammar=t,this.rules=Object.create(t.rules),t.isBuiltIn()||(this.defaultStartRule=t.defaultStartRule),this}withDefaultStartRule(t){return this.defaultStartRule=t,this}withSource(t){return this.source=new vg(t).interval(0,t.length),this}build(){const t=new Yn(this.name,this.ensureSuperGrammar(),this.rules,this.defaultStartRule);t._matchStateInitializer=t.superGrammar._matchStateInitializer,t.supportsIncrementalParsing=t.superGrammar.supportsIncrementalParsing;const n=[];let r=!1;return Object.keys(t.rules).forEach(i=>{const{body:o}=t.rules[i];try{o.assertChoicesHaveUniformArity(i)}catch(s){n.push(s)}try{o.assertAllApplicationsAreValid(i,t)}catch(s){n.push(s),r=!0}}),r||Object.keys(t.rules).forEach(i=>{const{body:o}=t.rules[i];try{o.assertIteratedExprsAreNotNullable(t,[])}catch(s){n.push(s)}}),n.length>0&&OJ(n),this.source&&(t.source=this.source),t}define(t,n,r,i,o,s){if(this.ensureSuperGrammar(),this.superGrammar.rules[t])throw rT(t,this.name,this.superGrammar.name,o);if(this.rules[t])throw rT(t,this.name,this.name,o);const a=y_(n);if(a.length>0)throw iT(t,a,o);return this.install(t,n,r,i,o,s)}override(t,n,r,i,o){return this.ensureSuperGrammarRuleForOverriding(t,o),this.installOverriddenOrExtendedRule(t,n,r,o),this}extend(t,n,r,i,o){if(!this.ensureSuperGrammar().rules[t])throw _J(t,this.superGrammar.name,o);const a=new gg(this.superGrammar,t,r);return a.source=r.source,this.installOverriddenOrExtendedRule(t,n,a,o),this}}class pm{constructor(){this.currentDecl=null,this.currentRuleName=null}newGrammar(t){return new pT(t)}grammar(t,n,r,i,o){const s=new pT(n);return r&&s.withSuperGrammar(r instanceof Yn?r:this.fromRecipe(r)),i&&s.withDefaultStartRule(i),t&&t.source&&s.withSource(t.source),this.currentDecl=s,Object.keys(o).forEach(a=>{this.currentRuleName=a;const u=o[a],c=u[0],d=u[1],p=u[2],h=u[3],m=this.fromRecipe(u[4]);let v;s.source&&d&&d.sourceInterval&&(v=s.source.subInterval(d.sourceInterval[0],d.sourceInterval[1]-d.sourceInterval[0])),s[c](a,h,m,p,v)}),this.currentRuleName=this.currentDecl=null,s.build()}terminal(t){return new Sn(t)}range(t,n){return new Mn(t,n)}param(t){return new $n(t)}alt(...t){let n=[];for(let r of t)r instanceof We||(r=this.fromRecipe(r)),r instanceof rn?n=n.concat(r.terms):n.push(r);return n.length===1?n[0]:new rn(n)}seq(...t){let n=[];for(let r of t)r instanceof We||(r=this.fromRecipe(r)),r instanceof dn?n=n.concat(r.factors):n.push(r);return n.length===1?n[0]:new dn(n)}star(t){return t instanceof We||(t=this.fromRecipe(t)),new ja(t)}plus(t){return t instanceof We||(t=this.fromRecipe(t)),new Lu(t)}opt(t){return t instanceof We||(t=this.fromRecipe(t)),new Po(t)}not(t){return t instanceof We||(t=this.fromRecipe(t)),new nr(t)}lookahead(t){return t instanceof We||(t=this.fromRecipe(t)),new rr(t)}lex(t){return t instanceof We||(t=this.fromRecipe(t)),new br(t)}app(t,n){return n&&n.length>0&&(n=n.map(function(r){return r instanceof We?r:this.fromRecipe(r)},this)),new gt(t,n)}splice(t,n){return new yg(this.currentDecl.superGrammar,this.currentRuleName,t.map(r=>this.fromRecipe(r)),n.map(r=>this.fromRecipe(r)))}fromRecipe(t){const n=t[0]==="grammar"?t.slice(1):t.slice(2),r=this[t[0]](...n),i=t[1];return i&&i.sourceInterval&&this.currentDecl&&r.withSource(this.currentDecl.sourceInterval(...i.sourceInterval)),r}}function B1(e){return typeof e=="function"?e.call(new pm):(typeof e=="string"&&(e=JSON.parse(e)),new pm().fromRecipe(e))}const H1=B1(["grammar",{source:`BuiltInRules { + + alnum (an alpha-numeric character) + = letter + | digit + + letter (a letter) + = lower + | upper + | unicodeLtmo + + digit (a digit) + = "0".."9" + + hexDigit (a hexadecimal digit) + = digit + | "a".."f" + | "A".."F" + + ListOf + = NonemptyListOf + | EmptyListOf + + NonemptyListOf + = elem (sep elem)* + + EmptyListOf + = /* nothing */ + + listOf + = nonemptyListOf + | emptyListOf + + nonemptyListOf + = elem (sep elem)* + + emptyListOf + = /* nothing */ + + // Allows a syntactic rule application within a lexical context. + applySyntactic = app +}`},"BuiltInRules",null,null,{alnum:["define",{sourceInterval:[18,78]},"an alpha-numeric character",[],["alt",{sourceInterval:[60,78]},["app",{sourceInterval:[60,66]},"letter",[]],["app",{sourceInterval:[73,78]},"digit",[]]]],letter:["define",{sourceInterval:[82,142]},"a letter",[],["alt",{sourceInterval:[107,142]},["app",{sourceInterval:[107,112]},"lower",[]],["app",{sourceInterval:[119,124]},"upper",[]],["app",{sourceInterval:[131,142]},"unicodeLtmo",[]]]],digit:["define",{sourceInterval:[146,177]},"a digit",[],["range",{sourceInterval:[169,177]},"0","9"]],hexDigit:["define",{sourceInterval:[181,254]},"a hexadecimal digit",[],["alt",{sourceInterval:[219,254]},["app",{sourceInterval:[219,224]},"digit",[]],["range",{sourceInterval:[231,239]},"a","f"],["range",{sourceInterval:[246,254]},"A","F"]]],ListOf:["define",{sourceInterval:[258,336]},null,["elem","sep"],["alt",{sourceInterval:[282,336]},["app",{sourceInterval:[282,307]},"NonemptyListOf",[["param",{sourceInterval:[297,301]},0],["param",{sourceInterval:[303,306]},1]]],["app",{sourceInterval:[314,336]},"EmptyListOf",[["param",{sourceInterval:[326,330]},0],["param",{sourceInterval:[332,335]},1]]]]],NonemptyListOf:["define",{sourceInterval:[340,388]},null,["elem","sep"],["seq",{sourceInterval:[372,388]},["param",{sourceInterval:[372,376]},0],["star",{sourceInterval:[377,388]},["seq",{sourceInterval:[378,386]},["param",{sourceInterval:[378,381]},1],["param",{sourceInterval:[382,386]},0]]]]],EmptyListOf:["define",{sourceInterval:[392,434]},null,["elem","sep"],["seq",{sourceInterval:[438,438]}]],listOf:["define",{sourceInterval:[438,516]},null,["elem","sep"],["alt",{sourceInterval:[462,516]},["app",{sourceInterval:[462,487]},"nonemptyListOf",[["param",{sourceInterval:[477,481]},0],["param",{sourceInterval:[483,486]},1]]],["app",{sourceInterval:[494,516]},"emptyListOf",[["param",{sourceInterval:[506,510]},0],["param",{sourceInterval:[512,515]},1]]]]],nonemptyListOf:["define",{sourceInterval:[520,568]},null,["elem","sep"],["seq",{sourceInterval:[552,568]},["param",{sourceInterval:[552,556]},0],["star",{sourceInterval:[557,568]},["seq",{sourceInterval:[558,566]},["param",{sourceInterval:[558,561]},1],["param",{sourceInterval:[562,566]},0]]]]],emptyListOf:["define",{sourceInterval:[572,682]},null,["elem","sep"],["seq",{sourceInterval:[685,685]}]],applySyntactic:["define",{sourceInterval:[685,710]},null,["app"],["param",{sourceInterval:[707,710]},0]]}]);Yn.BuiltInRules=H1;LJ(Yn.BuiltInRules);const z1=B1(["grammar",{source:`Ohm { + + Grammars + = Grammar* + + Grammar + = ident SuperGrammar? "{" Rule* "}" + + SuperGrammar + = "<:" ident + + Rule + = ident Formals? ruleDescr? "=" RuleBody -- define + | ident Formals? ":=" OverrideRuleBody -- override + | ident Formals? "+=" RuleBody -- extend + + RuleBody + = "|"? NonemptyListOf + + TopLevelTerm + = Seq caseName -- inline + | Seq + + OverrideRuleBody + = "|"? NonemptyListOf + + OverrideTopLevelTerm + = "..." -- superSplice + | TopLevelTerm + + Formals + = "<" ListOf ">" + + Params + = "<" ListOf ">" + + Alt + = NonemptyListOf + + Seq + = Iter* + + Iter + = Pred "*" -- star + | Pred "+" -- plus + | Pred "?" -- opt + | Pred + + Pred + = "~" Lex -- not + | "&" Lex -- lookahead + | Lex + + Lex + = "#" Base -- lex + | Base + + Base + = ident Params? ~(ruleDescr? "=" | ":=" | "+=") -- application + | oneCharTerminal ".." oneCharTerminal -- range + | terminal -- terminal + | "(" Alt ")" -- paren + + ruleDescr (a rule description) + = "(" ruleDescrText ")" + + ruleDescrText + = (~")" any)* + + caseName + = "--" (~"\\n" space)* name (~"\\n" space)* ("\\n" | &"}") + + name (a name) + = nameFirst nameRest* + + nameFirst + = "_" + | letter + + nameRest + = "_" + | alnum + + ident (an identifier) + = name + + terminal + = "\\"" terminalChar* "\\"" + + oneCharTerminal + = "\\"" terminalChar "\\"" + + terminalChar + = escapeChar + | ~"\\\\" ~"\\"" ~"\\n" "\\u{0}".."\\u{10FFFF}" + + escapeChar (an escape sequence) + = "\\\\\\\\" -- backslash + | "\\\\\\"" -- doubleQuote + | "\\\\\\'" -- singleQuote + | "\\\\b" -- backspace + | "\\\\n" -- lineFeed + | "\\\\r" -- carriageReturn + | "\\\\t" -- tab + | "\\\\u{" hexDigit hexDigit? hexDigit? + hexDigit? hexDigit? hexDigit? "}" -- unicodeCodePoint + | "\\\\u" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape + | "\\\\x" hexDigit hexDigit -- hexEscape + + space + += comment + + comment + = "//" (~"\\n" any)* &("\\n" | end) -- singleLine + | "/*" (~"*/" any)* "*/" -- multiLine + + tokens = token* + + token = caseName | comment | ident | operator | punctuation | terminal | any + + operator = "<:" | "=" | ":=" | "+=" | "*" | "+" | "?" | "~" | "&" + + punctuation = "<" | ">" | "," | "--" +}`},"Ohm",null,"Grammars",{Grammars:["define",{sourceInterval:[9,32]},null,[],["star",{sourceInterval:[24,32]},["app",{sourceInterval:[24,31]},"Grammar",[]]]],Grammar:["define",{sourceInterval:[36,83]},null,[],["seq",{sourceInterval:[50,83]},["app",{sourceInterval:[50,55]},"ident",[]],["opt",{sourceInterval:[56,69]},["app",{sourceInterval:[56,68]},"SuperGrammar",[]]],["terminal",{sourceInterval:[70,73]},"{"],["star",{sourceInterval:[74,79]},["app",{sourceInterval:[74,78]},"Rule",[]]],["terminal",{sourceInterval:[80,83]},"}"]]],SuperGrammar:["define",{sourceInterval:[87,116]},null,[],["seq",{sourceInterval:[106,116]},["terminal",{sourceInterval:[106,110]},"<:"],["app",{sourceInterval:[111,116]},"ident",[]]]],Rule_define:["define",{sourceInterval:[131,181]},null,[],["seq",{sourceInterval:[131,170]},["app",{sourceInterval:[131,136]},"ident",[]],["opt",{sourceInterval:[137,145]},["app",{sourceInterval:[137,144]},"Formals",[]]],["opt",{sourceInterval:[146,156]},["app",{sourceInterval:[146,155]},"ruleDescr",[]]],["terminal",{sourceInterval:[157,160]},"="],["app",{sourceInterval:[162,170]},"RuleBody",[]]]],Rule_override:["define",{sourceInterval:[188,248]},null,[],["seq",{sourceInterval:[188,235]},["app",{sourceInterval:[188,193]},"ident",[]],["opt",{sourceInterval:[194,202]},["app",{sourceInterval:[194,201]},"Formals",[]]],["terminal",{sourceInterval:[214,218]},":="],["app",{sourceInterval:[219,235]},"OverrideRuleBody",[]]]],Rule_extend:["define",{sourceInterval:[255,305]},null,[],["seq",{sourceInterval:[255,294]},["app",{sourceInterval:[255,260]},"ident",[]],["opt",{sourceInterval:[261,269]},["app",{sourceInterval:[261,268]},"Formals",[]]],["terminal",{sourceInterval:[281,285]},"+="],["app",{sourceInterval:[286,294]},"RuleBody",[]]]],Rule:["define",{sourceInterval:[120,305]},null,[],["alt",{sourceInterval:[131,305]},["app",{sourceInterval:[131,170]},"Rule_define",[]],["app",{sourceInterval:[188,235]},"Rule_override",[]],["app",{sourceInterval:[255,294]},"Rule_extend",[]]]],RuleBody:["define",{sourceInterval:[309,362]},null,[],["seq",{sourceInterval:[324,362]},["opt",{sourceInterval:[324,328]},["terminal",{sourceInterval:[324,327]},"|"]],["app",{sourceInterval:[329,362]},"NonemptyListOf",[["app",{sourceInterval:[344,356]},"TopLevelTerm",[]],["terminal",{sourceInterval:[358,361]},"|"]]]]],TopLevelTerm_inline:["define",{sourceInterval:[385,408]},null,[],["seq",{sourceInterval:[385,397]},["app",{sourceInterval:[385,388]},"Seq",[]],["app",{sourceInterval:[389,397]},"caseName",[]]]],TopLevelTerm:["define",{sourceInterval:[366,418]},null,[],["alt",{sourceInterval:[385,418]},["app",{sourceInterval:[385,397]},"TopLevelTerm_inline",[]],["app",{sourceInterval:[415,418]},"Seq",[]]]],OverrideRuleBody:["define",{sourceInterval:[422,491]},null,[],["seq",{sourceInterval:[445,491]},["opt",{sourceInterval:[445,449]},["terminal",{sourceInterval:[445,448]},"|"]],["app",{sourceInterval:[450,491]},"NonemptyListOf",[["app",{sourceInterval:[465,485]},"OverrideTopLevelTerm",[]],["terminal",{sourceInterval:[487,490]},"|"]]]]],OverrideTopLevelTerm_superSplice:["define",{sourceInterval:[522,543]},null,[],["terminal",{sourceInterval:[522,527]},"..."]],OverrideTopLevelTerm:["define",{sourceInterval:[495,562]},null,[],["alt",{sourceInterval:[522,562]},["app",{sourceInterval:[522,527]},"OverrideTopLevelTerm_superSplice",[]],["app",{sourceInterval:[550,562]},"TopLevelTerm",[]]]],Formals:["define",{sourceInterval:[566,606]},null,[],["seq",{sourceInterval:[580,606]},["terminal",{sourceInterval:[580,583]},"<"],["app",{sourceInterval:[584,602]},"ListOf",[["app",{sourceInterval:[591,596]},"ident",[]],["terminal",{sourceInterval:[598,601]},","]]],["terminal",{sourceInterval:[603,606]},">"]]],Params:["define",{sourceInterval:[610,647]},null,[],["seq",{sourceInterval:[623,647]},["terminal",{sourceInterval:[623,626]},"<"],["app",{sourceInterval:[627,643]},"ListOf",[["app",{sourceInterval:[634,637]},"Seq",[]],["terminal",{sourceInterval:[639,642]},","]]],["terminal",{sourceInterval:[644,647]},">"]]],Alt:["define",{sourceInterval:[651,685]},null,[],["app",{sourceInterval:[661,685]},"NonemptyListOf",[["app",{sourceInterval:[676,679]},"Seq",[]],["terminal",{sourceInterval:[681,684]},"|"]]]],Seq:["define",{sourceInterval:[689,704]},null,[],["star",{sourceInterval:[699,704]},["app",{sourceInterval:[699,703]},"Iter",[]]]],Iter_star:["define",{sourceInterval:[719,736]},null,[],["seq",{sourceInterval:[719,727]},["app",{sourceInterval:[719,723]},"Pred",[]],["terminal",{sourceInterval:[724,727]},"*"]]],Iter_plus:["define",{sourceInterval:[743,760]},null,[],["seq",{sourceInterval:[743,751]},["app",{sourceInterval:[743,747]},"Pred",[]],["terminal",{sourceInterval:[748,751]},"+"]]],Iter_opt:["define",{sourceInterval:[767,783]},null,[],["seq",{sourceInterval:[767,775]},["app",{sourceInterval:[767,771]},"Pred",[]],["terminal",{sourceInterval:[772,775]},"?"]]],Iter:["define",{sourceInterval:[708,794]},null,[],["alt",{sourceInterval:[719,794]},["app",{sourceInterval:[719,727]},"Iter_star",[]],["app",{sourceInterval:[743,751]},"Iter_plus",[]],["app",{sourceInterval:[767,775]},"Iter_opt",[]],["app",{sourceInterval:[790,794]},"Pred",[]]]],Pred_not:["define",{sourceInterval:[809,824]},null,[],["seq",{sourceInterval:[809,816]},["terminal",{sourceInterval:[809,812]},"~"],["app",{sourceInterval:[813,816]},"Lex",[]]]],Pred_lookahead:["define",{sourceInterval:[831,852]},null,[],["seq",{sourceInterval:[831,838]},["terminal",{sourceInterval:[831,834]},"&"],["app",{sourceInterval:[835,838]},"Lex",[]]]],Pred:["define",{sourceInterval:[798,862]},null,[],["alt",{sourceInterval:[809,862]},["app",{sourceInterval:[809,816]},"Pred_not",[]],["app",{sourceInterval:[831,838]},"Pred_lookahead",[]],["app",{sourceInterval:[859,862]},"Lex",[]]]],Lex_lex:["define",{sourceInterval:[876,892]},null,[],["seq",{sourceInterval:[876,884]},["terminal",{sourceInterval:[876,879]},"#"],["app",{sourceInterval:[880,884]},"Base",[]]]],Lex:["define",{sourceInterval:[866,903]},null,[],["alt",{sourceInterval:[876,903]},["app",{sourceInterval:[876,884]},"Lex_lex",[]],["app",{sourceInterval:[899,903]},"Base",[]]]],Base_application:["define",{sourceInterval:[918,979]},null,[],["seq",{sourceInterval:[918,963]},["app",{sourceInterval:[918,923]},"ident",[]],["opt",{sourceInterval:[924,931]},["app",{sourceInterval:[924,930]},"Params",[]]],["not",{sourceInterval:[932,963]},["alt",{sourceInterval:[934,962]},["seq",{sourceInterval:[934,948]},["opt",{sourceInterval:[934,944]},["app",{sourceInterval:[934,943]},"ruleDescr",[]]],["terminal",{sourceInterval:[945,948]},"="]],["terminal",{sourceInterval:[951,955]},":="],["terminal",{sourceInterval:[958,962]},"+="]]]]],Base_range:["define",{sourceInterval:[986,1041]},null,[],["seq",{sourceInterval:[986,1022]},["app",{sourceInterval:[986,1001]},"oneCharTerminal",[]],["terminal",{sourceInterval:[1002,1006]},".."],["app",{sourceInterval:[1007,1022]},"oneCharTerminal",[]]]],Base_terminal:["define",{sourceInterval:[1048,1106]},null,[],["app",{sourceInterval:[1048,1056]},"terminal",[]]],Base_paren:["define",{sourceInterval:[1113,1168]},null,[],["seq",{sourceInterval:[1113,1124]},["terminal",{sourceInterval:[1113,1116]},"("],["app",{sourceInterval:[1117,1120]},"Alt",[]],["terminal",{sourceInterval:[1121,1124]},")"]]],Base:["define",{sourceInterval:[907,1168]},null,[],["alt",{sourceInterval:[918,1168]},["app",{sourceInterval:[918,963]},"Base_application",[]],["app",{sourceInterval:[986,1022]},"Base_range",[]],["app",{sourceInterval:[1048,1056]},"Base_terminal",[]],["app",{sourceInterval:[1113,1124]},"Base_paren",[]]]],ruleDescr:["define",{sourceInterval:[1172,1231]},"a rule description",[],["seq",{sourceInterval:[1210,1231]},["terminal",{sourceInterval:[1210,1213]},"("],["app",{sourceInterval:[1214,1227]},"ruleDescrText",[]],["terminal",{sourceInterval:[1228,1231]},")"]]],ruleDescrText:["define",{sourceInterval:[1235,1266]},null,[],["star",{sourceInterval:[1255,1266]},["seq",{sourceInterval:[1256,1264]},["not",{sourceInterval:[1256,1260]},["terminal",{sourceInterval:[1257,1260]},")"]],["app",{sourceInterval:[1261,1264]},"any",[]]]]],caseName:["define",{sourceInterval:[1270,1338]},null,[],["seq",{sourceInterval:[1285,1338]},["terminal",{sourceInterval:[1285,1289]},"--"],["star",{sourceInterval:[1290,1304]},["seq",{sourceInterval:[1291,1302]},["not",{sourceInterval:[1291,1296]},["terminal",{sourceInterval:[1292,1296]},` +`]],["app",{sourceInterval:[1297,1302]},"space",[]]]],["app",{sourceInterval:[1305,1309]},"name",[]],["star",{sourceInterval:[1310,1324]},["seq",{sourceInterval:[1311,1322]},["not",{sourceInterval:[1311,1316]},["terminal",{sourceInterval:[1312,1316]},` +`]],["app",{sourceInterval:[1317,1322]},"space",[]]]],["alt",{sourceInterval:[1326,1337]},["terminal",{sourceInterval:[1326,1330]},` +`],["lookahead",{sourceInterval:[1333,1337]},["terminal",{sourceInterval:[1334,1337]},"}"]]]]],name:["define",{sourceInterval:[1342,1382]},"a name",[],["seq",{sourceInterval:[1363,1382]},["app",{sourceInterval:[1363,1372]},"nameFirst",[]],["star",{sourceInterval:[1373,1382]},["app",{sourceInterval:[1373,1381]},"nameRest",[]]]]],nameFirst:["define",{sourceInterval:[1386,1418]},null,[],["alt",{sourceInterval:[1402,1418]},["terminal",{sourceInterval:[1402,1405]},"_"],["app",{sourceInterval:[1412,1418]},"letter",[]]]],nameRest:["define",{sourceInterval:[1422,1452]},null,[],["alt",{sourceInterval:[1437,1452]},["terminal",{sourceInterval:[1437,1440]},"_"],["app",{sourceInterval:[1447,1452]},"alnum",[]]]],ident:["define",{sourceInterval:[1456,1489]},"an identifier",[],["app",{sourceInterval:[1485,1489]},"name",[]]],terminal:["define",{sourceInterval:[1493,1531]},null,[],["seq",{sourceInterval:[1508,1531]},["terminal",{sourceInterval:[1508,1512]},'"'],["star",{sourceInterval:[1513,1526]},["app",{sourceInterval:[1513,1525]},"terminalChar",[]]],["terminal",{sourceInterval:[1527,1531]},'"']]],oneCharTerminal:["define",{sourceInterval:[1535,1579]},null,[],["seq",{sourceInterval:[1557,1579]},["terminal",{sourceInterval:[1557,1561]},'"'],["app",{sourceInterval:[1562,1574]},"terminalChar",[]],["terminal",{sourceInterval:[1575,1579]},'"']]],terminalChar:["define",{sourceInterval:[1583,1660]},null,[],["alt",{sourceInterval:[1602,1660]},["app",{sourceInterval:[1602,1612]},"escapeChar",[]],["seq",{sourceInterval:[1621,1660]},["not",{sourceInterval:[1621,1626]},["terminal",{sourceInterval:[1622,1626]},"\\"]],["not",{sourceInterval:[1627,1632]},["terminal",{sourceInterval:[1628,1632]},'"']],["not",{sourceInterval:[1633,1638]},["terminal",{sourceInterval:[1634,1638]},` +`]],["range",{sourceInterval:[1639,1660]},"\0","􏿿"]]]],escapeChar_backslash:["define",{sourceInterval:[1703,1758]},null,[],["terminal",{sourceInterval:[1703,1709]},"\\\\"]],escapeChar_doubleQuote:["define",{sourceInterval:[1765,1822]},null,[],["terminal",{sourceInterval:[1765,1771]},'\\"']],escapeChar_singleQuote:["define",{sourceInterval:[1829,1886]},null,[],["terminal",{sourceInterval:[1829,1835]},"\\'"]],escapeChar_backspace:["define",{sourceInterval:[1893,1948]},null,[],["terminal",{sourceInterval:[1893,1898]},"\\b"]],escapeChar_lineFeed:["define",{sourceInterval:[1955,2009]},null,[],["terminal",{sourceInterval:[1955,1960]},"\\n"]],escapeChar_carriageReturn:["define",{sourceInterval:[2016,2076]},null,[],["terminal",{sourceInterval:[2016,2021]},"\\r"]],escapeChar_tab:["define",{sourceInterval:[2083,2132]},null,[],["terminal",{sourceInterval:[2083,2088]},"\\t"]],escapeChar_unicodeCodePoint:["define",{sourceInterval:[2139,2243]},null,[],["seq",{sourceInterval:[2139,2221]},["terminal",{sourceInterval:[2139,2145]},"\\u{"],["app",{sourceInterval:[2146,2154]},"hexDigit",[]],["opt",{sourceInterval:[2155,2164]},["app",{sourceInterval:[2155,2163]},"hexDigit",[]]],["opt",{sourceInterval:[2165,2174]},["app",{sourceInterval:[2165,2173]},"hexDigit",[]]],["opt",{sourceInterval:[2188,2197]},["app",{sourceInterval:[2188,2196]},"hexDigit",[]]],["opt",{sourceInterval:[2198,2207]},["app",{sourceInterval:[2198,2206]},"hexDigit",[]]],["opt",{sourceInterval:[2208,2217]},["app",{sourceInterval:[2208,2216]},"hexDigit",[]]],["terminal",{sourceInterval:[2218,2221]},"}"]]],escapeChar_unicodeEscape:["define",{sourceInterval:[2250,2309]},null,[],["seq",{sourceInterval:[2250,2291]},["terminal",{sourceInterval:[2250,2255]},"\\u"],["app",{sourceInterval:[2256,2264]},"hexDigit",[]],["app",{sourceInterval:[2265,2273]},"hexDigit",[]],["app",{sourceInterval:[2274,2282]},"hexDigit",[]],["app",{sourceInterval:[2283,2291]},"hexDigit",[]]]],escapeChar_hexEscape:["define",{sourceInterval:[2316,2371]},null,[],["seq",{sourceInterval:[2316,2339]},["terminal",{sourceInterval:[2316,2321]},"\\x"],["app",{sourceInterval:[2322,2330]},"hexDigit",[]],["app",{sourceInterval:[2331,2339]},"hexDigit",[]]]],escapeChar:["define",{sourceInterval:[1664,2371]},"an escape sequence",[],["alt",{sourceInterval:[1703,2371]},["app",{sourceInterval:[1703,1709]},"escapeChar_backslash",[]],["app",{sourceInterval:[1765,1771]},"escapeChar_doubleQuote",[]],["app",{sourceInterval:[1829,1835]},"escapeChar_singleQuote",[]],["app",{sourceInterval:[1893,1898]},"escapeChar_backspace",[]],["app",{sourceInterval:[1955,1960]},"escapeChar_lineFeed",[]],["app",{sourceInterval:[2016,2021]},"escapeChar_carriageReturn",[]],["app",{sourceInterval:[2083,2088]},"escapeChar_tab",[]],["app",{sourceInterval:[2139,2221]},"escapeChar_unicodeCodePoint",[]],["app",{sourceInterval:[2250,2291]},"escapeChar_unicodeEscape",[]],["app",{sourceInterval:[2316,2339]},"escapeChar_hexEscape",[]]]],space:["extend",{sourceInterval:[2375,2394]},null,[],["app",{sourceInterval:[2387,2394]},"comment",[]]],comment_singleLine:["define",{sourceInterval:[2412,2458]},null,[],["seq",{sourceInterval:[2412,2443]},["terminal",{sourceInterval:[2412,2416]},"//"],["star",{sourceInterval:[2417,2429]},["seq",{sourceInterval:[2418,2427]},["not",{sourceInterval:[2418,2423]},["terminal",{sourceInterval:[2419,2423]},` +`]],["app",{sourceInterval:[2424,2427]},"any",[]]]],["lookahead",{sourceInterval:[2430,2443]},["alt",{sourceInterval:[2432,2442]},["terminal",{sourceInterval:[2432,2436]},` +`],["app",{sourceInterval:[2439,2442]},"end",[]]]]]],comment_multiLine:["define",{sourceInterval:[2465,2501]},null,[],["seq",{sourceInterval:[2465,2487]},["terminal",{sourceInterval:[2465,2469]},"/*"],["star",{sourceInterval:[2470,2482]},["seq",{sourceInterval:[2471,2480]},["not",{sourceInterval:[2471,2476]},["terminal",{sourceInterval:[2472,2476]},"*/"]],["app",{sourceInterval:[2477,2480]},"any",[]]]],["terminal",{sourceInterval:[2483,2487]},"*/"]]],comment:["define",{sourceInterval:[2398,2501]},null,[],["alt",{sourceInterval:[2412,2501]},["app",{sourceInterval:[2412,2443]},"comment_singleLine",[]],["app",{sourceInterval:[2465,2487]},"comment_multiLine",[]]]],tokens:["define",{sourceInterval:[2505,2520]},null,[],["star",{sourceInterval:[2514,2520]},["app",{sourceInterval:[2514,2519]},"token",[]]]],token:["define",{sourceInterval:[2524,2600]},null,[],["alt",{sourceInterval:[2532,2600]},["app",{sourceInterval:[2532,2540]},"caseName",[]],["app",{sourceInterval:[2543,2550]},"comment",[]],["app",{sourceInterval:[2553,2558]},"ident",[]],["app",{sourceInterval:[2561,2569]},"operator",[]],["app",{sourceInterval:[2572,2583]},"punctuation",[]],["app",{sourceInterval:[2586,2594]},"terminal",[]],["app",{sourceInterval:[2597,2600]},"any",[]]]],operator:["define",{sourceInterval:[2604,2669]},null,[],["alt",{sourceInterval:[2615,2669]},["terminal",{sourceInterval:[2615,2619]},"<:"],["terminal",{sourceInterval:[2622,2625]},"="],["terminal",{sourceInterval:[2628,2632]},":="],["terminal",{sourceInterval:[2635,2639]},"+="],["terminal",{sourceInterval:[2642,2645]},"*"],["terminal",{sourceInterval:[2648,2651]},"+"],["terminal",{sourceInterval:[2654,2657]},"?"],["terminal",{sourceInterval:[2660,2663]},"~"],["terminal",{sourceInterval:[2666,2669]},"&"]]],punctuation:["define",{sourceInterval:[2673,2709]},null,[],["alt",{sourceInterval:[2687,2709]},["terminal",{sourceInterval:[2687,2690]},"<"],["terminal",{sourceInterval:[2693,2696]},">"],["terminal",{sourceInterval:[2699,2702]},","],["terminal",{sourceInterval:[2705,2709]},"--"]]]}]),v0=Object.create(We.prototype);function hT(e,t){for(const n in e)if(n===t)return!0;return!1}function uP(e,t,n){const r=new pm;let i,o,s,a=!1;return(n||z1).createSemantics().addOperation("visit",{Grammars(d){return d.children.map(p=>p.visit())},Grammar(d,p,h,m,v){const x=d.visit();i=r.newGrammar(x),p.child(0)&&p.child(0).visit(),m.children.map(y=>y.visit());const b=i.build();if(b.source=this.source.trimmed(),hT(t,x))throw yJ(b);return t[x]=b,b},SuperGrammar(d,p){const h=p.visit();if(h==="null")i.withSuperGrammar(null);else{if(!t||!hT(t,h))throw gJ(h,t,p.source);i.withSuperGrammar(t[h])}},Rule_define(d,p,h,m,v){o=d.visit(),s=p.children.map(_=>_.visit())[0]||[],!i.defaultStartRule&&i.ensureSuperGrammar()!==Yn.ProtoBuiltInRules&&i.withDefaultStartRule(o);const x=v.visit(),b=h.children.map(_=>_.visit())[0],y=this.source.trimmed();return i.define(o,s,x,b,y)},Rule_override(d,p,h,m){o=d.visit(),s=p.children.map(b=>b.visit())[0]||[];const v=this.source.trimmed();i.ensureSuperGrammarRuleForOverriding(o,v),a=!0;const x=m.visit();return a=!1,i.override(o,s,x,null,v)},Rule_extend(d,p,h,m){o=d.visit(),s=p.children.map(b=>b.visit())[0]||[];const v=m.visit(),x=this.source.trimmed();return i.extend(o,s,v,null,x)},RuleBody(d,p){return r.alt(...p.visit()).withSource(this.source)},OverrideRuleBody(d,p){const h=p.visit(),m=h.indexOf(v0);if(m>=0){const v=h.slice(0,m),x=h.slice(m+1);return x.forEach(b=>{if(b===v0)throw AJ(b)}),new yg(i.superGrammar,o,v,x).withSource(this.source)}else return r.alt(...h).withSource(this.source)},Formals(d,p,h){return p.visit()},Params(d,p,h){return p.visit()},Alt(d){return r.alt(...d.visit()).withSource(this.source)},TopLevelTerm_inline(d,p){const h=o+"_"+p.visit(),m=d.visit(),v=this.source.trimmed(),x=!(i.superGrammar&&i.superGrammar.rules[h]);a&&!x?i.override(h,s,m,null,v):i.define(h,s,m,null,v);const b=s.map(y=>r.app(y));return r.app(h,b).withSource(m.source)},OverrideTopLevelTerm_superSplice(d){return v0},Seq(d){return r.seq(...d.children.map(p=>p.visit())).withSource(this.source)},Iter_star(d,p){return r.star(d.visit()).withSource(this.source)},Iter_plus(d,p){return r.plus(d.visit()).withSource(this.source)},Iter_opt(d,p){return r.opt(d.visit()).withSource(this.source)},Pred_not(d,p){return r.not(p.visit()).withSource(this.source)},Pred_lookahead(d,p){return r.lookahead(p.visit()).withSource(this.source)},Lex_lex(d,p){return r.lex(p.visit()).withSource(this.source)},Base_application(d,p){const h=p.children.map(m=>m.visit())[0]||[];return r.app(d.visit(),h).withSource(this.source)},Base_range(d,p,h){return r.range(d.visit(),h.visit()).withSource(this.source)},Base_terminal(d){return r.terminal(d.visit()).withSource(this.source)},Base_paren(d,p,h){return p.visit()},ruleDescr(d,p,h){return p.visit()},ruleDescrText(d){return this.sourceString.trim()},caseName(d,p,h,m,v){return h.visit()},name(d,p){return this.sourceString},nameFirst(d){},nameRest(d){},terminal(d,p,h){return p.children.map(m=>m.visit()).join("")},oneCharTerminal(d,p,h){return p.visit()},escapeChar(d){try{return XL(this.sourceString)}catch(p){throw p instanceof RangeError&&p.message.startsWith("Invalid code point ")?TJ(d):p}},NonemptyListOf(d,p,h){return[d.visit()].concat(h.children.map(m=>m.visit()))},EmptyListOf(){return[]},_terminal(){return this.sourceString}})(e).visit()}const ZJ=B1(["grammar",{source:`OperationsAndAttributes { + + AttributeSignature = + name + + OperationSignature = + name Formals? + + Formals + = "(" ListOf ")" + + name (a name) + = nameFirst nameRest* + + nameFirst + = "_" + | letter + + nameRest + = "_" + | alnum + +}`},"OperationsAndAttributes",null,"AttributeSignature",{AttributeSignature:["define",{sourceInterval:[29,58]},null,[],["app",{sourceInterval:[54,58]},"name",[]]],OperationSignature:["define",{sourceInterval:[62,100]},null,[],["seq",{sourceInterval:[87,100]},["app",{sourceInterval:[87,91]},"name",[]],["opt",{sourceInterval:[92,100]},["app",{sourceInterval:[92,99]},"Formals",[]]]]],Formals:["define",{sourceInterval:[104,143]},null,[],["seq",{sourceInterval:[118,143]},["terminal",{sourceInterval:[118,121]},"("],["app",{sourceInterval:[122,139]},"ListOf",[["app",{sourceInterval:[129,133]},"name",[]],["terminal",{sourceInterval:[135,138]},","]]],["terminal",{sourceInterval:[140,143]},")"]]],name:["define",{sourceInterval:[147,187]},"a name",[],["seq",{sourceInterval:[168,187]},["app",{sourceInterval:[168,177]},"nameFirst",[]],["star",{sourceInterval:[178,187]},["app",{sourceInterval:[178,186]},"nameRest",[]]]]],nameFirst:["define",{sourceInterval:[191,223]},null,[],["alt",{sourceInterval:[207,223]},["terminal",{sourceInterval:[207,210]},"_"],["app",{sourceInterval:[217,223]},"letter",[]]]],nameRest:["define",{sourceInterval:[227,257]},null,[],["alt",{sourceInterval:[242,257]},["terminal",{sourceInterval:[242,245]},"_"],["app",{sourceInterval:[252,257]},"alnum",[]]]]}]);JJ(Yn.BuiltInRules);eee(ZJ);function JJ(e){const t={empty(){return this.iteration()},nonEmpty(n,r,i){return this.iteration([n].concat(i.children))}};_r.BuiltInSemantics=_r.createSemantics(e,null).addOperation("asIteration",{emptyListOf:t.empty,nonemptyListOf:t.nonEmpty,EmptyListOf:t.empty,NonemptyListOf:t.nonEmpty})}function eee(e){_r.prototypeGrammarSemantics=e.createSemantics().addOperation("parse",{AttributeSignature(t){return{name:t.parse(),formals:[]}},OperationSignature(t,n){return{name:t.parse(),formals:n.children.map(r=>r.parse())[0]||[]}},Formals(t,n,r){return n.asIteration().children.map(i=>i.parse())},name(t,n){return this.sourceString}}),_r.prototypeGrammar=e}function tee(e){let t=0;const n=[0],r=()=>n[n.length-1],i={},o=/( *).*(?:$|\r?\n|\r)/g;let s;for(;(s=o.exec(e))!=null;){const[a,u]=s;if(a.length===0)break;const c=u.length,d=r(),p=t+c;if(c>d)n.push(c),i[p]=1;else if(c1&&(i[t]=1-n.length),i}const cP="an indented block",fP="a dedent",mT=1114112;class nee extends vg{constructor(t){super(t.input),this.state=t}_indentationAt(t){return this.state.userData[t]||0}atEnd(){return super.atEnd()&&this._indentationAt(this.pos)===0}next(){if(this._indentationAt(this.pos)!==0){this.examinedLength=Math.max(this.examinedLength,this.pos);return}return super.next()}nextCharCode(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),mT):super.nextCharCode()}nextCodePoint(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),mT):super.nextCodePoint()}}class gT extends We{constructor(t=!0){super(),this.isIndent=t}allowsSkippingPrecedingSpace(){return!0}eval(t){const{inputStream:n}=t,r=t.userData;t.doNotMemoize=!0;const i=n.pos,o=this.isIndent?1:-1;return(r[i]||0)*o>0?(t.userData=Object.create(r),t.userData[i]-=o,t.pushBinding(new Va(0),i),!0):(t.processFailure(i,this),!1)}getArity(){return 1}_assertAllApplicationsAreValid(t,n){}_isNullable(t,n){return!1}assertChoicesHaveUniformArity(t){}assertIteratedExprsAreNotNullable(t){}introduceParams(t){return this}substituteParams(t){return this}toString(){return this.isIndent?"indent":"dedent"}toDisplayString(){return this.toString()}toFailure(t){const n=this.isIndent?cP:fP;return new Er(this,n,"description")}}const ree=new gt("indent"),iee=new gt("dedent"),oee=new yg(H1,"any",[ree,iee],[]),see=new pm().newGrammar("IndentationSensitive").withSuperGrammar(H1).define("indent",[],new gT(!0),cP,void 0,!0).define("dedent",[],new gT(!1),fP,void 0,!0).extend("any",[],oee,"any character",void 0).build();Object.assign(see,{_matchStateInitializer(e){e.userData=tee(e.input),e.inputStream=new nee(e)},supportsIncrementalParsing:!1});Yn.initApplicationParser(z1,uP);function aee(e,t){const n=z1.match(e,"Grammars");if(n.failed())throw mJ(n);return uP(n,t)}function lee(e,t){const n=uee(e),r=Object.keys(n);if(r.length===0)throw new Error("Missing grammar definition");if(r.length>1){const o=n[r[1]].source;throw new Error(P1(o.sourceString,o.startIdx)+"Found more than one grammar definition -- use ohm.grammars() instead.")}return n[r[0]]}function uee(e,t){const n=Object.create({});return aee(e,n),n}const cee=`Language { + Command + = var Identifier --var + | start --start + | read NonemptyListOf --read + | write NonemptyListOf --write + | assign Identifier "=" Expression --assign + | conditional Expression --conditional + + Expression + = Expression "||" Expression0 --binary + | Expression0 + + Expression0 + = Expression0 "&&" Expression1 --binary + | Expression1 + + Expression1 + = Expression2 ("<=" | "<" | ">=" | ">" | "==" | "!=") Expression2 --binary + | Expression2 + + Expression2 + = Expression2 ("+" | "-") Expression3 --binary + | Expression3 + + Expression3 + = Expression3 ("*" | "/" | div | mod) Expression4 --binary + | Expression4 + + Expression4 ([[Syntax_Expression]]) + = ("+" | "-" | "!") Expression4 --unary + | Primary + + FunctionCall (([[Syntax_FunctionCall]]) + = identifier "(" ListOf ")" + + Parentheses ([[Syntax_Parentheses]]) + = "(" Expression ")" + + Identifier ([[Syntax_Identifier]]) + = identifier + + Primary + = stringLiteral --stringLiteral + | numberLiteral --numberLiteral + | booleanLiteral --booleanLiteral + | FunctionCall + | Identifier + | Parentheses + + var = "var" ~alnum + start = "start" ~alnum + read = "read" ~alnum + write = "write" ~alnum + assign = "assign" ~alnum + conditional = "conditional" ~alnum + true = "true" ~alnum + false = "false" ~alnum + div = "div" ~alnum + mod = "mod" ~alnum + + keyword ([[Syntax_Keyword]]) + = true | false | div | mod + | var | start | read | write | assign | conditional + + identifier ([[Syntax_Identifier]]) + = ~keyword (letter | "_") (alnum | "_")* + + stringLiteral ([[Syntax_StringLiteral]]) + = "\\"" ("\\\\\\"" | ~"\\"" ~"\\n" any)* "\\"" + + numberLiteral ([[Syntax_NumberLiteral]]) + = digit+ ("." digit+)? (("E" | "e") ("+" | "-")? digit+)? + + booleanLiteral ([[Syntax_BooleanLiteral]]) + = true | false +} +`,ud=lee(cee);var Xn=(e=>(e.Number="number",e.Boolean="boolean",e.String="string",e))(Xn||{});const fee={number:{stringIsValid(e){return/^-?\d+(\.\d+)?(e[+-]?\d+)?$/.test(e)},read:e=>parseFloat(e),write:e=>{const t=e.toPrecision(6);if(t.includes("e")){const[n,r,i]=t.split(/e([+-])/);return n.replace(/0+$/,"").replace(/\.$/,"")+"e"+r+i.padStart(2,"0")}return t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}},boolean:{stringIsValid(e){return e==="true"||e==="false"},read:e=>e==="true",write:e=>e?"true":"false"},string:{stringIsValid(e){return!0},read:e=>e,write:e=>e}};function dP(e){return fee[e]}const pP=2147483647,dee=16807,pee=e=>dee*e%pP,hP=e=>e/pP,hee=(e,t,n)=>Math.floor((t-e+1)*hP(n)+e),hm={rand:hP,randInt:hee,getNext:pee},{Number:he,Boolean:Bt,String:Up}=Xn,j1=[{id:"+",operandType:he,resultType:he,work:e=>e},{id:"-",operandType:he,resultType:he,work:e=>-e},{id:"!",operandType:Bt,resultType:Bt,work:e=>!e}],V1=[{id:"||",leftType:Bt,rightType:Bt,resultType:Bt,work:(e,t)=>e||t},{id:"&&",leftType:Bt,rightType:Bt,resultType:Bt,work:(e,t)=>e&&t},{id:"<=",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e<=t},{id:"<",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e=",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e>=t},{id:">",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e>t},{id:"==",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e===t},{id:"==",leftType:Bt,rightType:Bt,resultType:Bt,work:(e,t)=>e===t},{id:"==",leftType:Up,rightType:Up,resultType:Bt,work:(e,t)=>e===t},{id:"!=",leftType:he,rightType:he,resultType:Bt,work:(e,t)=>e!==t},{id:"!=",leftType:Bt,rightType:Bt,resultType:Bt,work:(e,t)=>e!==t},{id:"!=",leftType:Up,rightType:Up,resultType:Bt,work:(e,t)=>e!==t},{id:"+",leftType:he,rightType:he,resultType:he,work:(e,t)=>e+t},{id:"-",leftType:he,rightType:he,resultType:he,work:(e,t)=>e-t},{id:"*",leftType:he,rightType:he,resultType:he,work:(e,t)=>e*t},{id:"/",leftType:he,rightType:he,resultType:he,work:(e,t)=>e/t},{id:"div",leftType:he,rightType:he,resultType:he,work:(e,t)=>Math.floor(e/t)},{id:"mod",leftType:he,rightType:he,resultType:he,work:(e,t)=>e%t}],Ua=[{id:"pow",parameterTypes:[he,he],returnType:he,work:Math.pow},{id:"sqrt",parameterTypes:[he],returnType:he,work:Math.sqrt},{id:"log",parameterTypes:[he],returnType:he,work:Math.log},{id:"log10",parameterTypes:[he],returnType:he,work:Math.log10},{id:"log2",parameterTypes:[he],returnType:he,work:Math.log2},{id:"exp",parameterTypes:[he],returnType:he,work:Math.exp},{id:"sin",parameterTypes:[he],returnType:he,work:Math.sin},{id:"cos",parameterTypes:[he],returnType:he,work:Math.cos},{id:"tan",parameterTypes:[he],returnType:he,work:Math.tan},{id:"asin",parameterTypes:[he],returnType:he,work:Math.asin},{id:"acos",parameterTypes:[he],returnType:he,work:Math.acos},{id:"atan",parameterTypes:[he],returnType:he,work:Math.atan},{id:"sinh",parameterTypes:[he],returnType:he,work:Math.sinh},{id:"cosh",parameterTypes:[he],returnType:he,work:Math.cosh},{id:"tanh",parameterTypes:[he],returnType:he,work:Math.tanh},{id:"asinh",parameterTypes:[he],returnType:he,work:Math.asinh},{id:"acosh",parameterTypes:[he],returnType:he,work:Math.acosh},{id:"atanh",parameterTypes:[he],returnType:he,work:Math.atanh},{id:"sign",parameterTypes:[he],returnType:he,work:Math.sign},{id:"abs",parameterTypes:[he],returnType:he,work:Math.abs},{id:"round",parameterTypes:[he],returnType:he,work:Math.round},{id:"floor",parameterTypes:[he],returnType:he,work:Math.floor},{id:"ceil",parameterTypes:[he],returnType:he,work:Math.ceil},{id:"min",parameterTypes:[he,he],returnType:he,work:Math.min},{id:"max",parameterTypes:[he,he],returnType:he,work:Math.max},{id:"rand",parameterTypes:[],returnType:he,work:hm.rand,tags:["random"]},{id:"rand_int",parameterTypes:[he,he],returnType:he,work:hm.randInt,tags:["random"]}],Pu=[{id:"pi",type:he,value:Math.PI},{id:"tau",type:he,value:2*Math.PI}];function mee(e){const t=e.sourceString;if(ue.find(Ua,{id:t})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:t}};const n=[...Pu,...this.args.variables];return ue.find(n,{id:t})===void 0?{message:"CheckError_VariableNotFound",payload:{id:t}}:null}function gee(e,t,n){return t.check(this.args.variables)}function Ic(e,t,n){const r=e.check(this.args.variables);if(r!==null)return r;const i=n.check(this.args.variables);if(i!==null)return i;const o=e.getType(this.args.variables),s=t.sourceString,a=n.getType(this.args.variables);return ue.find(V1,{id:s,leftType:o,rightType:a})===void 0?{message:"CheckError_BinaryOperatorTypeMismatch",payload:{id:s,leftType:o,rightType:a}}:null}function yee(e,t){const n=t.check(this.args.variables);if(n!==null)return n;const r=e.sourceString,i=t.getType(this.args.variables);return ue.find(j1,{id:r,operandType:i})===void 0?{message:"CheckError_UnaryOperatorTypeMismatch",payload:{id:r,operandType:i}}:null}function vee(e,t,n,r){for(const d of n.asIteration().children){const p=d.check(this.args.variables);if(p!==null)return p}const i=e.sourceString,o=ue.find(Ua,{id:i});if(o===void 0)return{message:"CheckError_FunctionDoesNotExist",payload:{id:i}};const{parameterTypes:s}=o,a=s.length,u=n.asIteration().children.length;if(a!==u)return{message:`CheckError_FunctionArityMismatch_${a<=2?a:"n"}`,payload:{id:i,arity:a,count:u}};const c=ue.map(n.asIteration().children,d=>d.getType(this.args.variables));return ue.isEqual(c,s)?null:{message:"CheckError_FunctionArgumentTypeMismatch",payload:{id:i,count:a,parameterTypes:s}}}function xee(e,t){const n=t.sourceString;return ue.find(this.args.variables,{id:n})!==void 0?{message:"IdentifierError_Duplicate"}:ue.find(Pu,{id:n})!==void 0?{message:"IdentifierError_Constant"}:ue.find(Ua,{id:n})!==void 0?{message:"IdentifierError_Function"}:null}function _ee(e){return null}function wee(e,t){for(const n of t.asIteration().children){const r=n.sourceString;if(ue.find(Pu,{id:r})!==void 0)return{message:"CheckError_VariableExpectedFoundConstant",payload:{id:r}};if(ue.find(Ua,{id:r})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:r}};const i=n.check(this.args.variables);if(i!==null)return i}return null}function bee(e,t){for(const n of t.asIteration().children){const r=n.check(this.args.variables);if(r!==null)return r}return null}function Eee(e,t,n,r){const i=t.sourceString;if(ue.find(Pu,{id:i})!==void 0)return{message:"CheckError_VariableExpectedFoundConstant",payload:{id:i}};if(ue.find(Ua,{id:i})!==void 0)return{message:"CheckError_VariableExpectedFoundFunction",payload:{id:i}};const o=t.check(this.args.variables);if(o!==null)return o;const s=r.check(this.args.variables);if(s!==null)return s;const a=t.getType(this.args.variables),u=r.getType(this.args.variables);return a!==u?{message:"CheckError_AssignmentTypeMismatch",payload:{id:i,leftType:a,rightType:u}}:null}function See(e,t){const n=t.check(this.args.variables);if(n!==null)return n;const r=t.getType(this.args.variables);return r!=="boolean"?{message:"CheckError_ConditionNotBoolean",payload:{conditionType:r}}:null}function vi(e){if(!e)throw new Error("Assertion failed")}function Cee(e,t){const n=e.sourceString,r=t.eval(this.args.state),i=ue.find(j1,{id:n});return vi(i!==void 0),i.work(r)}function Ac(e,t,n){const r=e.eval(this.args.state),i=t.sourceString,o=n.eval(this.args.state),s=ue.find(V1,{id:i});return vi(s!==void 0),s.work(r,o)}function Iee(e,t,n,r){const i=e.sourceString,o=ue.find(Ua,{id:i});vi(o!==void 0);const s=ue.map(n.asIteration().children,a=>a.eval(this.args.state));return ue.includes(o.tags,"random")&&(this.args.state.rand=hm.getNext(this.args.state.rand),s.push(this.args.state.rand)),o.work(...s)}function Aee(e){const t=e.sourceString,n=ue.find(Pu,{id:t});if(n!==void 0)return n.value;const{value:r}=this.args.state.memory[t];if(r===null)throw{message:"RuntimeError_VariableNotInitialized",payload:{id:t}};return r}function Tee(e,t,n){return t.eval(this.args.state)}function kee(e){const t=this.args.state;t.outPort="out"}function Nee(e,t){const n=this.args.state;vi(n.input!==null);const r=n.input.split(/\s+/),i=t.asIteration().children;if(i.length!==r.length)throw{message:"RuntimeError_InvalidNumberOfTokens",payload:{count:r.length,expected:i.length}};for(const[o,s]of ue.zip(i,r)){vi(o!==void 0&&s!==void 0);const a=o.sourceString,{type:u}=n.memory[a],c=dP(u);if(!c.stringIsValid(s))throw{message:"RuntimeError_InvalidInput",payload:{input:s,type:u}};n.memory[a].value=c.read(s)}n.interaction.push({direction:"in",text:n.input}),n.input=null,n.outPort="out"}function Oee(e,t){const n=this.args.state;let r="";for(const i of t.asIteration().children){const o=i.eval(n),a=dP(typeof o);r+=a.write(o)}n.interaction.push({direction:"out",text:r}),n.outPort="out"}function Ree(e,t,n,r){const i=this.args.state,o=t.sourceString,s=r.eval(i);i.memory[o].value=s,i.outPort="out"}function Dee(e,t){const n=this.args.state,r=t.eval(n);n.outPort=r?"true":"false"}function Lee(e){const t=[...Pu,...this.args.variables],n=ue.find(t,{id:e.sourceString});return n!==void 0?n.type:null}function Pee(e,t,n){return t.getType(this.args.variables)}function Tc(e,t,n){const r=e.getType(this.args.variables),i=t.sourceString,o=n.getType(this.args.variables),s=ue.find(V1,{id:i,leftType:r,rightType:o});return s!==void 0?s.resultType:null}function Mee(e,t){const n=e.sourceString,r=t.getType(this.args.variables),i=ue.find(j1,{id:n,operandType:r});return i!==void 0?i.resultType:null}function $ee(e,t,n,r){const i=e.sourceString,o=ue.map(n.asIteration().children,a=>a.getType(this.args.variables)),s=ue.find(Ua,{id:i,parameterTypes:o});return s!==void 0?s.returnType:null}const Wa=ud.createSemantics();Wa.addOperation("getType(variables)",{Primary_stringLiteral:e=>Xn.String,Primary_numberLiteral:e=>Xn.Number,Primary_booleanLiteral:e=>Xn.Boolean,Identifier:Lee,Parentheses:Pee,Expression_binary:Tc,Expression0_binary:Tc,Expression1_binary:Tc,Expression2_binary:Tc,Expression3_binary:Tc,Expression4_unary:Mee,FunctionCall:$ee});Wa.addOperation("check(variables)",{Primary_stringLiteral:e=>null,Primary_numberLiteral:e=>null,Primary_booleanLiteral:e=>null,Identifier:mee,Parentheses:gee,Expression_binary:Ic,Expression0_binary:Ic,Expression1_binary:Ic,Expression2_binary:Ic,Expression3_binary:Ic,Expression4_unary:yee,FunctionCall:vee,Command_var:xee,Command_start:_ee,Command_read:wee,Command_write:bee,Command_assign:Eee,Command_conditional:See});Wa.addOperation("eval(state)",{Primary_stringLiteral:e=>JSON.parse(e.sourceString),Primary_numberLiteral:e=>JSON.parse(e.sourceString),Primary_booleanLiteral:e=>JSON.parse(e.sourceString),Identifier:Aee,Parentheses:Tee,Expression_binary:Ac,Expression0_binary:Ac,Expression1_binary:Ac,Expression2_binary:Ac,Expression3_binary:Ac,Expression4_unary:Cee,FunctionCall:Iee});Wa.addOperation("exec(state)",{Command_start:kee,Command_read:Nee,Command_write:Oee,Command_assign:Ree,Command_conditional:Dee});/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var E_=function(){return E_=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?Math.round(c):c});return s}var zee=/rgba?|\(|\)|\/|,|\s/gi,jee=[255,255,255,1],Vee={"%":100};function Uee(e){var t=vP(e,zee,jee,Vee),n=t[0],r=t[1],i=t[2],o=t[3],s=o===void 0?1:o;return{r:n,g:r,b:i,a:s}}var Wee=/hsla?|\(|\)|\/|,|\s/gi,Gee=[360,1,1,1],Kee={"%":100,deg:360,rad:2*Math.PI,turn:1};function qee(e){var t=vP(e,Wee,Gee,Kee),n=t[0],r=t[1],i=t[2],o=t[3],s=o===void 0?1:o;return yP({h:n,s:r,l:i,a:s})}function Yee(e){var t=e.substring(1),n=t.length;if(n===3||n===4){var r=[0,1,2].map(function(c){return parseInt(""+t[c]+t[c],16)}),i=r[0],o=r[1],s=r[2],a=t.length===3?1:parseInt(""+t[3]+t[3],16)/255;return{r:i,g:o,b:s,a}}if(n===6||n===8){var u=[0,2,4].map(function(m){return parseInt(t.substring(m,m+2),16)}),i=u[0],o=u[1],s=u[2],a=t.length===6?1:parseInt(t.substring(6,8),16)/255;return{r:i,g:o,b:s,a}}throw new Error("Unable to parse "+e)}function Xee(e){var t=mP.get(e)||0;return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}function Qee(e){var t=gP.get(e)||0;return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}var Zee=/^rgba?\([^()]+\)$/,Jee=/^hsla?\([^()]+\)$/,ete=/^#[0-9a-f]+$/i;function tte(e){var t=e.trim().toLowerCase();if(t.match(Zee))return Uee(t);if(t.match(Jee))return qee(t);if(t.match(ete))return Yee(t);if(mP.has(t))return Xee(t);if(gP.has(t))return Qee(t);if(e==="transparent")return{r:0,g:0,b:0,a:0};throw new Error("Unable to parse "+e)}function nte(e){return typeof e=="string"?tte(e):Object.prototype.hasOwnProperty.call(e,"r")?E_({},e):yP(e)}function xP(e,t,n){n===void 0&&(n=function(i){return i});var r=n(nte(e));switch(t){case"rgb":return r;case"hsl":return yT(r);case"css-rgb":return Fee(r);case"css-hex":return Bee(r);case"css-hsl":return Hee(yT(r));default:throw new Error("Unsupported outputType '"+t+"'")}}function _P(e){var t=e===void 0?{}:e,n=t.contrast,r=n===void 0?1:n,i=t.brightness,o=i===void 0?0:i,s=function(a){return Math.min(255,Math.max(0,r*(a-128)+128+o))};return function(a){return{r:s(a.r),g:s(a.g),b:s(a.b),a:a.a===void 0?1:a.a}}}function rte(e,t=32){return xP(e,"css-hex",_P({brightness:t}))}function ite(e,t=32){return xP(e,"css-hex",_P({brightness:-t}))}const oi={brighter:rte,darker:ite};var Ne=(e=>(e.Start="start",e.Read="read",e.Write="write",e.Assign="assign",e.Conditional="conditional",e.End="end",e))(Ne||{});const ote={start:{backgroundColor:oi.brighter(At.purple),textColor:"white",borderRadius:"15px"},read:{backgroundColor:oi.brighter(At.blue),textColor:"white",clipPath:"polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%)",clipPathBorder:"polygon(20px 0, calc(100% + 1px) 0, calc(100% - 21px) 100%, -1px calc(100% - 1px))"},write:{backgroundColor:oi.brighter(At.green),textColor:"white",clipPath:"polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%)",clipPathBorder:"polygon(20px 0, calc(100% + 1px) 0, calc(100% - 21px) 100%, -1px calc(100% - 1px))"},assign:{backgroundColor:oi.brighter(At.orange),textColor:"white"},conditional:{backgroundColor:oi.brighter(At.red),textColor:"white",clipPath:"polygon(20px 0, 0 50%, 20px 100%, calc(100% - 20px) 100%, 100% 50%, calc(100% - 20px) 0)"},end:{backgroundColor:oi.brighter(At.purple),textColor:"white",borderRadius:"15px"}};function wP(e){return ote[e]}const ste={start:[{id:"out",position:te.Bottom}],read:[{id:"out",position:te.Bottom}],write:[{id:"out",position:te.Bottom}],assign:[{id:"out",position:te.Bottom}],conditional:[{id:"true",position:te.Bottom,label:"T"},{id:"false",position:te.Right,label:"F"}],end:[]};function xg(e){return ste[e]}function ate(e){const t=[];t.push(...lte(e));for(const n of e.nodes)n.data.role!==Ne.End&&t.push(...ute(e,n));return t}function lte(e){const{nodes:t,edges:n}=e,r=[],i=ue.filter(t,{data:{role:Ne.Start}});i.length===0&&r.push({type:"check",message:"CheckError_NoStart",nodeId:null}),i.length>1&&r.push({type:"check",message:"CheckError_MultipleStart",nodeId:null});for(const o of t){const s=xg(o.data.role);for(const a of s)if(ue.filter(n,{source:o.id,sourceHandle:a.id}).length===0){const c=a.label??"out";r.push({type:"check",message:c==="out"?"CheckError_NoOutgoing_Default":"CheckError_NoOutgoing_Handle",nodeId:o.id,payload:{output:c}})}}return r}function ute(e,t){const{variables:n}=e,r=[],i=t.data.role,o=ud.match(`${i} ${t.data.payload}`,"Command");if(o.failed())r.push({type:"syntax",message:"SyntaxError",nodeId:t.id,payload:{pos:o.getInterval().startIdx-i.length-1,expected:D1(o)}});else{const s=Wa(o).check(n);s&&r.push({type:"check",message:s.message,nodeId:t.id,payload:s.payload})}return r}function vT(e,t){const n=ue.find(e.nodes,{id:t});return vi(n!==void 0),n}function cte(e){const t=ue.find(e.nodes,{data:{role:Ne.Start}});return vi(t!==void 0),t}function fte(e,t,n){const r=ue.find(n.edges,{source:e,sourceHandle:t});return vi(r!==void 0),r.target}function bP(e,t){t=ue.cloneDeep(t);const n=t.curNodeId===null?cte(e):vT(e,t.curNodeId);try{const i=n.data.role,o=ud.match(`${i} ${n.data.payload}`,"Command");Wa(o).exec(t),t.status="running",t.timeSlot+=1}catch(i){return t.status="exception",t.errors=[{type:"runtime",nodeId:n.id,message:i.message,payload:i.payload}],t}vi(t.outPort!==null),t.curNodeId=fte(n.id,t.outPort,e);const r=vT(e,t.curNodeId);return r.data.role===Ne.End&&t.status==="running"?t.status="halted":r.data.role===Ne.Read&&t.status==="running"&&(t.status="waiting"),t}const xT=()=>({curNodeId:null,timeSlot:0,memory:{},input:null,outPort:null,rand:0,interaction:[],status:"invalid",errors:[]}),$s=hg()((e,t)=>({flowchart:null,seed:hm.getNext(Math.floor(Date.now())),machineState:xT(),stateHistory:[],resetMachine:n=>{const r=xT(),i=ate(n);r.status=i.length>0?"invalid":"ready",r.errors=i,r.memory={};for(const{id:o,type:s}of n.variables)r.memory[o]={type:s,value:null};r.rand=t().seed,e({machineState:r,flowchart:n})},executeAction:n=>{const{flowchart:r,stateHistory:i,machineState:o,resetMachine:s}=t();switch(vi(r!==null),n){case"reset":{s(r);break}case"stepBack":{const a=i.pop();e({machineState:a,stateHistory:i});break}case"nextStep":{i.push(o);const a=bP(r,o);e({machineState:a,stateHistory:i});break}}}})),dte={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function pte(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=u=>u===null?null:JSON.parse(u,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Ff=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ff(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ff(r)(n)}}}},hte=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...t},s=!1;const a=new Set,u=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...b)},r,i);const d=Ff(o.serialize),p=()=>{const b=o.partialize({...r()});let y;const _=d({state:b,version:o.version}).then(E=>c.setItem(o.name,E)).catch(E=>{y=E});if(y)throw y;return _},h=i.setState;i.setState=(b,y)=>{h(b,y),p()};const m=e((...b)=>{n(...b),p()},r,i);let v;const x=()=>{var b;if(!c)return;s=!1,a.forEach(_=>_(r()));const y=((b=o.onRehydrateStorage)==null?void 0:b.call(o,r()))||void 0;return Ff(c.getItem.bind(c))(o.name).then(_=>{if(_)return o.deserialize(_)}).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return o.migrate(_.state,_.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return _.state}).then(_=>{var E;return v=o.merge(_,(E=r())!=null?E:m),n(v,!0),p()}).then(()=>{y==null||y(v,void 0),s=!0,u.forEach(_=>_(v))}).catch(_=>{y==null||y(void 0,_)})};return i.persist={setOptions:b=>{o={...o,...b},b.getStorage&&(c=b.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(u.add(b),()=>{u.delete(b)})},x(),v||m},mte=(e,t)=>(n,r,i)=>{let o={storage:pte(()=>localStorage),partialize:x=>x,version:0,merge:(x,b)=>({...b,...x}),...t},s=!1;const a=new Set,u=new Set;let c=o.storage;if(!c)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,i);const d=()=>{const x=o.partialize({...r()});return c.setItem(o.name,{state:x,version:o.version})},p=i.setState;i.setState=(x,b)=>{p(x,b),d()};const h=e((...x)=>{n(...x),d()},r,i);i.getInitialState=()=>h;let m;const v=()=>{var x,b;if(!c)return;s=!1,a.forEach(_=>{var E;return _((E=r())!=null?E:h)});const y=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(x=r())!=null?x:h))||void 0;return Ff(c.getItem.bind(c))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var E;const[C,T]=_;if(m=o.merge(T,(E=r())!=null?E:h),n(m,!0),C)return d()}).then(()=>{y==null||y(m,void 0),m=r(),s=!0,u.forEach(_=>_(m))}).catch(_=>{y==null||y(void 0,_)})};return i.persist={setOptions:x=>{o={...o,...x},x.storage&&(c=x.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:x=>(a.add(x),()=>{a.delete(x)}),onFinishHydration:x=>(u.add(x),()=>{u.delete(x)})},o.skipHydration||v(),m||h},gte=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((dte?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),hte(e,t)):mte(e,t),EP=gte,yte={Block_Empty:"(empty)",BlockHelpText_assign:"Enter an assignment expression",BlockHelpText_conditional:"Enter a logical expression",BlockHelpText_read:"Enter variable identifiers separated by commas",BlockHelpText_write:"Enter expressions separated by commas",BlockLabel_assign:"",BlockLabel_conditional:"",BlockLabel_end:"End",BlockLabel_read:"Read",BlockLabel_start:"Start",BlockLabel_write:"Write",BlockTitle_assign:"Assignment",BlockTitle_conditional:"Conditional",BlockTitle_end:"End",BlockTitle_read:"Input",BlockTitle_start:"Start",BlockTitle_write:"Output",Button_Cancel:"Cancel",Button_Clear:"Clear",Button_Close:"Close",Button_Rename:"Rename",Button_Save:"Save changes",CheckError_AssignmentTypeMismatch:"Cannot assign an expression of type `[[DataType_{{rightType}}]]` to variable `{{id}}` of type `[[DataType_{{leftType}}]]`.",CheckError_BinaryOperatorTypeMismatch:"Cannot apply operator `{{id}}` to operands of types `{{leftType}}` and `{{rightType}}`.",CheckError_ConditionNotBoolean:"The condition must yield a boolean value.",CheckError_FunctionArgumentTypeMismatch:"Function `{{id}}` expects [[an argument|arguments]] of type `({{[[DataType_@parameterTypes@]]}})`.",CheckError_FunctionArityMismatch_0:"Function `{{id}}` does not require arguments ({{count}} provided).",CheckError_FunctionArityMismatch_1:"Function `{{id}}` requires exactly one argument ({{count}} provided).",CheckError_FunctionArityMismatch_2:"Function `{{id}}` requires exactly two arguments ({{count}} provided).",CheckError_FunctionArityMismatch_n:"Function `{{id}}` requires exactly {{arity}} arguments ({{count}} provided).",CheckError_FunctionDoesNotExist:"Function `{{id}}` does not exist.",CheckError_MultipleStart:"There are more than one start block.",CheckError_NoOutgoing_Default:"Block has no outgoing edge.",CheckError_NoOutgoing_Handle:"Block has no outgoing edge for output `{{output}}`.",CheckError_NoStart:"There must be a start block.",CheckError_UnaryOperatorTypeMismatch:"Cannot apply operator `{{id}}` to an operand of type `{{operandType}}`.",CheckError_VariableExpectedFoundConstant:"Identifier `{{id}}` is a constant and not a variable.",CheckError_VariableExpectedFoundFunction:"Identifier `{{id}}` is a function and not a variable.",CheckError_VariableNotFound:"Variable `{{id}}` does not exist.",DataType_boolean:"boolean",DataType_number:"number",DataType_string:"string",ExampleDescription_factorial:"Computes the factorial of a number.",ExampleDescription_overtime:"Calculates the overtime pay of a worker.",ExampleDescription_secret:"Guess the secret number drawn from 1 to 100.",ExampleDescription_sign:"Determines if a number is positive, negative or zero.",ExampleTitle_factorial:"Factorial",ExampleTitle_overtime:"Overtime",ExampleTitle_secret:"Secret number",ExampleTitle_sign:"Sign of a number",FlowchartTitle_Placeholder:"Untitled flowchart",IdentifierError_Constant:"A constant with the same name already exists.",IdentifierError_Duplicate:"Identifier already exists.",IdentifierError_Empty:"Identifier cannot be empty.",IdentifierError_Function:"A function with the same name already exists.",IdentifierError_Invalid:"Invalid identifier.",Interaction_Title:"Input / Output",MenuFlowchart_Clear:"Clear...",MenuFlowchart_CopyLink:"Copy link",MenuFlowchart_Tooltip:"Flowchart",MenuHelp_About:"About...",MenuHelp_Examples:"Examples...",MenuHelp_Help:"Help...",MenuHelp_Tooltip:"Help",MenuLanguage_Tooltip:"Language",ModalAbout_Body1:"**FluxoLab** is a web application designed to teach algorithm and programming fundamentals using flowcharts.",ModalAbout_Body2:"The source code is available on {{GitHub}}, under the {{GPL3}} license.",ModalAbout_Title:"About FluxoLab",ModalClear_Body:"Are you sure you want to clear the flowchart?",ModalClear_Title:"Clear flowchart",ModalExamples_Body:"Select an example below to load.",ModalExamples_Title:"Examples",ModalHelp_AbsoluteValue:"Absolute value",ModalHelp_Addition:"Addition",ModalHelp_ArcCosine:"Arc cosine",ModalHelp_ArcCosineHyperbolic:"Arc hyperbolic cosine",ModalHelp_ArcSine:"Arc sine",ModalHelp_ArcSineHyperbolic:"Arc hyperbolic sine",ModalHelp_ArcTangent:"Arc tangent",ModalHelp_ArcTangentHyperbolic:"Arc hyperbolic tangent",ModalHelp_Assignment:"Assignment",ModalHelp_BinaryLogarithm:"Logarithm to the base 2",ModalHelp_Ceil:"Round up",ModalHelp_CommonLogarithm:"Logarithm to the base 10",ModalHelp_Conjunction:"Conjunction (and)",ModalHelp_Cosine:"Cosine",ModalHelp_Disjunction:"Disjunction (or)",ModalHelp_Equal:"Equal",ModalHelp_Exponential:"Exponential",ModalHelp_Floor:"Round down",ModalHelp_Greater:"Greater",ModalHelp_GreaterOrEqual:"Greater or equal",ModalHelp_HyperbolicCosine:"Hyperbolic cosine",ModalHelp_HyperbolicSine:"Hyperbolic sine",ModalHelp_HyperbolicTangent:"Hyperbolic tangent",ModalHelp_IntegerDivision:"Integer division",ModalHelp_Less:"Less",ModalHelp_LessOrEqual:"Less or equal",ModalHelp_Maximum:"Maximum",ModalHelp_Minimum:"Minimum",ModalHelp_Modulus:"Remainder of division",ModalHelp_Multiplication:"Multiplication",ModalHelp_NaturalLogarithm:"Natural logarithm",ModalHelp_Negation:"Negation (not)",ModalHelp_Negative:"Negative",ModalHelp_NotEqual:"Not equal",ModalHelp_Positive:"Positive",ModalHelp_Power:"Power (x raised to y)",ModalHelp_Rand:"Random fractional number between 0 and 1",ModalHelp_RandInt:"Random integer number between a and b (inclusive)",ModalHelp_RealDivision:"Real division",ModalHelp_Round:"Round to the nearest integer",ModalHelp_Sign:"Sign",ModalHelp_Sine:"Sine",ModalHelp_SquareRoot:"Square root",ModalHelp_SubtitleArithmetic:"Arithmetic operators",ModalHelp_SubtitleAssignment:"Assignment operator",ModalHelp_SubtitleComparison:"Comparison operators",ModalHelp_SubtitleConstants:"Numerical constants",ModalHelp_SubtitleFunctions:"Mathematical functions",ModalHelp_SubtitleLogical:"Logical operators",ModalHelp_Subtraction:"Subtraction",ModalHelp_Tangent:"Tangent",ModalHelp_Title:"Help",ModalRenameVariable_HelpText:"Enter a valid identifier",ModalRenameVariable_Title:"Rename variable",PlayButton_NextStep:"Next step",PlayButton_Reset:"Reset execution",PlayButton_StepBack:"Step back",RuntimeError_InvalidInput:"Input `{{input}}` is invalid for type `{{type}}`.",RuntimeError_InvalidNumberOfTokens:"Input has {{count}} [[token|tokens]] (expected {{expected}}).",RuntimeError_VariableNotInitialized:"Variable `{{id}}` was not initialized.",Status_CompileErrors:"There [[is|are]] {{count}} compile [[error|errors]].",Status_Halted:"Execution completed.",Status_MultipleErrors:"Multiple errors:",Status_Ready:"Ready to start execution.",Status_Running:"Step {{step}} executed.",Status_Waiting:"Waiting for input.",Syntax_BooleanLiteral:"a boolean",Syntax_EndOfInput:"end-of-input",Syntax_Expression:"an expression",Syntax_FunctionCall:"a function call",Syntax_Identifier:"an identifier",Syntax_Keyword:"a keyword",Syntax_NumberLiteral:"a number",Syntax_Parentheses:"a parenthesized expression",Syntax_StringLiteral:"a string",SyntaxError:"Position {{pos}}: Expected {{expected}}.",ToastMessage_CopyLink:"Link copied to clipboard.",ToastMessage_ExampleLoaded:"Example loaded successfully.",ToastMessage_FlowchartCleared:"Flowchart cleared successfully.",ToastMessage_ImportError:"Error importing flowchart.",ToastMessage_ImportSuccess:"Flowchart imported successfully.",ToastMessage_LanguageChanged:"Language changed to {{language}}.",VariableList_Add:"Add variable",VariableList_Remove:"Remove variable",VariableList_Title:"Variables"},vte={en:yte,"pt-BR":{Block_Empty:"(vazio)",BlockHelpText_assign:"Digite uma expressão de atribuição",BlockHelpText_conditional:"Digite uma expressão lógica",BlockHelpText_read:"Digite identificadores de variáveis separados por vírgula",BlockHelpText_write:"Digite expressões separadas por vírgula",BlockLabel_assign:"",BlockLabel_conditional:"",BlockLabel_end:"Fim",BlockLabel_read:"Leia",BlockLabel_start:"Início",BlockLabel_write:"Escreva",BlockTitle_assign:"Atribuição",BlockTitle_conditional:"Condicional",BlockTitle_end:"Fim",BlockTitle_read:"Entrada",BlockTitle_start:"Início",BlockTitle_write:"Saída",Button_Cancel:"Cancelar",Button_Clear:"Limpar",Button_Close:"Fechar",Button_Rename:"Renomear",Button_Save:"Salvar alterações",CheckError_AssignmentTypeMismatch:"Não é possível atribuir uma expressão do tipo `[[DataType_{{rightType}}]]` à variável `{{id}}` do tipo `[[DataType_{{leftType}}]]`.",CheckError_BinaryOperatorTypeMismatch:"Não é possível aplicar o operador `{{id}}` a operandos dos tipos `[[DataType_{{leftType}}]]` e `[[DataType_{{rightType}}]]`.",CheckError_ConditionNotBoolean:"A condição deve resultar em um valor booleano.",CheckError_FunctionArgumentTypeMismatch:"Função `{{id}}` espera [[um argumento|argumentos]] do tipo `({{[[DataType_@parameterTypes@]]}})`.",CheckError_FunctionArityMismatch_0:"Função `{{id}}` não requer argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_1:"Função `{{id}}` requer exatamente um argumento ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_2:"Função `{{id}}` requer exatamente dois argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionArityMismatch_n:"Função `{{id}}` requer exatamente {{arity}} argumentos ([[fornecido|fornecidos]] {{count}}).",CheckError_FunctionDoesNotExist:"Função `{{id}}` não existe.",CheckError_MultipleStart:"Há mais de um bloco de início.",CheckError_NoOutgoing_Default:"Bloco não tem ramo de saída.",CheckError_NoOutgoing_Handle:"Bloco não tem ramo na saída `{{output}}`.",CheckError_NoStart:"Deve haver um bloco de início.",CheckError_UnaryOperatorTypeMismatch:"Não é possível aplicar o operador `{{id}}` a um operando do tipo `[[DataType_{{operandType}}]]`.",CheckError_VariableExpectedFoundConstant:"Identificador `{{id}}` é uma constante e não uma variável.",CheckError_VariableExpectedFoundFunction:"Identificador `{{id}}` é uma função e não uma variável.",CheckError_VariableNotFound:"Variável `{{id}}` não existe.",DataType_boolean:"booleano",DataType_number:"número",DataType_string:"string",ExampleDescription_factorial:"Calcula o fatorial de um número.",ExampleDescription_overtime:"Calcula o valor da hora extra de um trabalhador.",ExampleDescription_secret:"Adivinhe o número secreto sorteado de 1 a 100.",ExampleDescription_sign:"Determina se um número é positivo, negativo ou zero.",ExampleTitle_factorial:"Fatorial",ExampleTitle_overtime:"Hora extra",ExampleTitle_secret:"Número secreto",ExampleTitle_sign:"Sinal de um número",FlowchartTitle_Placeholder:"Fluxograma sem título",IdentifierError_Constant:"Já existe uma constante com esse nome.",IdentifierError_Duplicate:"Identificador já existe.",IdentifierError_Empty:"Identificador não pode ser vazio.",IdentifierError_Function:"Já existe uma função com o mesmo nome.",IdentifierError_Invalid:"Identificador inválido.",Interaction_Title:"Entrada / Saída",MenuFlowchart_Clear:"Limpar...",MenuFlowchart_CopyLink:"Copiar link",MenuFlowchart_Tooltip:"Fluxograma",MenuHelp_About:"Sobre...",MenuHelp_Examples:"Exemplos...",MenuHelp_Help:"Ajuda...",MenuHelp_Tooltip:"Ajuda",MenuLanguage_Tooltip:"Idioma",ModalAbout_Body1:"**FluxoLab** é uma aplicação web projetada para ensinar fundamentos de algoritmos e programação usando fluxogramas.",ModalAbout_Body2:"O código fonte está disponível no {{GitHub}}, sob a licença {{GPL3}}.",ModalAbout_Title:"Sobre o FluxoLab",ModalClear_Body:"Você tem certeza que deseja limpar o fluxograma?",ModalClear_Title:"Limpar fluxograma",ModalExamples_Body:"Selecione um exemplo abaixo para carregar.",ModalExamples_Title:"Exemplos",ModalHelp_AbsoluteValue:"Valor absoluto",ModalHelp_Addition:"Adição",ModalHelp_ArcCosine:"Arco cosseno",ModalHelp_ArcCosineHyperbolic:"Arco cosseno hiperbólico",ModalHelp_ArcSine:"Arco seno",ModalHelp_ArcSineHyperbolic:"Arco seno hiperbólico",ModalHelp_ArcTangent:"Arco tangente",ModalHelp_ArcTangentHyperbolic:"Arco tangente hiperbólico",ModalHelp_Assignment:"Atribuição",ModalHelp_BinaryLogarithm:"Logaritmo na base 2",ModalHelp_Ceil:"Arredondamento para cima",ModalHelp_CommonLogarithm:"Logaritmo na base 10",ModalHelp_Conjunction:"Conjunção (e)",ModalHelp_Cosine:"Cosseno",ModalHelp_Disjunction:"Disjunção (ou)",ModalHelp_Equal:"Igual",ModalHelp_Exponential:"Exponencial",ModalHelp_Floor:"Arredondamento para baixo",ModalHelp_Greater:"Maior",ModalHelp_GreaterOrEqual:"Maior ou igual",ModalHelp_HyperbolicCosine:"Cosseno hiperbólico",ModalHelp_HyperbolicSine:"Seno hiperbólico",ModalHelp_HyperbolicTangent:"Tangente hiperbólica",ModalHelp_IntegerDivision:"Divisão inteira",ModalHelp_Less:"Menor",ModalHelp_LessOrEqual:"Menor ou igual",ModalHelp_Maximum:"Máximo",ModalHelp_Minimum:"Mínimo",ModalHelp_Modulus:"Resto da divisão",ModalHelp_Multiplication:"Multiplicação",ModalHelp_NaturalLogarithm:"Logaritmo natural",ModalHelp_Negation:"Negação (não)",ModalHelp_Negative:"Negativo",ModalHelp_NotEqual:"Diferente",ModalHelp_Positive:"Positivo",ModalHelp_Power:"Potência (x elevado a y)",ModalHelp_Rand:"Número fracionário aleatório entre 0 e 1",ModalHelp_RandInt:"Número inteiro aleatório entre a e b (inclusive)",ModalHelp_RealDivision:"Divisão real",ModalHelp_Round:"Arredondamento para o inteiro mais próximo",ModalHelp_Sign:"Sinal",ModalHelp_Sine:"Seno",ModalHelp_SquareRoot:"Raiz quadrada",ModalHelp_SubtitleArithmetic:"Operadores aritméticos",ModalHelp_SubtitleAssignment:"Operador de atribuição",ModalHelp_SubtitleComparison:"Operadores de comparação",ModalHelp_SubtitleConstants:"Constantes numéricas",ModalHelp_SubtitleFunctions:"Funções matemáticas",ModalHelp_SubtitleLogical:"Operadores lógicos",ModalHelp_Subtraction:"Subtração",ModalHelp_Tangent:"Tangente",ModalHelp_Title:"Ajuda",ModalRenameVariable_HelpText:"Digite um identificador válido",ModalRenameVariable_Title:"Renomear variável",PlayButton_NextStep:"Executar próximo passo",PlayButton_Reset:"Encerrar execução",PlayButton_StepBack:"Voltar um passo",RuntimeError_InvalidInput:"Entrada `{{input}}` é inválida para o tipo `[[DataType_{{type}}]]`.",RuntimeError_InvalidNumberOfTokens:"Entrada tem {{count}} [[token|tokens]] (esperado {{expected}}).",RuntimeError_VariableNotInitialized:"Variável `{{id}}` não foi inicializada.",Status_CompileErrors:"Há {{count}} [[erro|erros]] de compilação.",Status_Halted:"Execução concluída.",Status_MultipleErrors:"Múltiplos erros:",Status_Ready:"Pronto para iniciar a execução.",Status_Running:"Executado passo {{step}}.",Status_Waiting:"Aguardando entrada.",Syntax_BooleanLiteral:"um booleano",Syntax_EndOfInput:"fim-de-entrada",Syntax_Expression:"uma expressão",Syntax_FunctionCall:"uma chamada de função",Syntax_Identifier:"um identificador",Syntax_Keyword:"uma palavra-chave",Syntax_NumberLiteral:"um número",Syntax_Parentheses:"uma expressão entre parênteses",Syntax_StringLiteral:"uma string",SyntaxError:"Posição {{pos}}: Esperado {{expected}}.",ToastMessage_CopyLink:"Link copiado para a área de transferência.",ToastMessage_ExampleLoaded:"Exemplo carregado com sucesso.",ToastMessage_FlowchartCleared:"Fluxograma limpo com sucesso.",ToastMessage_ImportError:"Erro ao importar fluxograma.",ToastMessage_ImportSuccess:"Fluxograma importado com sucesso.",ToastMessage_LanguageChanged:"Idioma alterado para {{language}}.",VariableList_Add:"Adicionar variável",VariableList_Remove:"Remover variável",VariableList_Title:"Variáveis"}},_T=vte,sn=hg()(EP((e,t)=>({language:navigator.language,setLanguage:n=>e({language:n}),getString:(n,r={})=>{let o=(_T[t().language]??_T.en)[n]??n;for(const[a,u]of ue.toPairs(r)){const c=ue.isArray(u)?u.join(", "):String(u);o=o.replace(new RegExp(`{{${a}}}`,"g"),c)}const s=/{{(.*?)@(.*?)@(.*?)}}/g;for(o=o.replace(s,(a,u,c,d)=>{const p=r[c];return!p||!ue.isArray(p)?a:p.map(h=>`${u}${h}${d}`).join(", ")});;){const a=o.match(/\[\[(.*?)\|(.*?)\]\]/);if(a===null)break;const[u,c,d]=a;o=o.replace(u,r.count===1?c:d)}for(;;){const a=o.match(/\[\[(.*?)\]\]/);if(a===null)break;const[u,c]=a;o=o.replace(u,t().getString(c,r))}return o}}),{name:"fluxolab_strings",version:1}));function xte(){const{machineState:e,executeAction:t}=$s(),{getString:n}=sn(),r=i=>{t(i)};return S.jsx($D,{style:{zIndex:10},children:ue.map(VL,({actionId:i,description:o,hotkey:s,icon:a,enabledStatuses:u})=>{const c=!u.includes(e.status),d=c?"":`${n(o)} (${s})`;return S.jsx(Du,{text:d,children:S.jsx(Dn,{disabled:c,onClick:()=>r(i),children:S.jsx("i",{className:`bi ${a}`})})},i)})})}function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?d-1:0),h=1;h{t.current=e},[e]),t}function Ot(e){const t=Ste(e);return A.useCallback(function(...n){return t.current&&t.current(...n)},[t])}const W1=e=>A.forwardRef((t,n)=>S.jsx("div",{...t,ref:n,className:Te(t.className,e)})),CP=W1("h4");CP.displayName="DivStyledAsH4";const IP=A.forwardRef(({className:e,bsPrefix:t,as:n=CP,...r},i)=>(t=Fe(t,"alert-heading"),S.jsx(n,{ref:i,className:Te(e,t),...r})));IP.displayName="AlertHeading";function AP(){return A.useState(null)}function Cte(e,t,n,r=!1){const i=Ot(n);A.useEffect(()=>{const o=typeof e=="function"?e():e;return o.addEventListener(t,i,r),()=>o.removeEventListener(t,i,r)},[e])}function G1(){const e=A.useRef(!0),t=A.useRef(()=>e.current);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function TP(e){const t=A.useRef(null);return A.useEffect(()=>{t.current=e}),t.current}const Ite=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",Ate=typeof document<"u",mm=Ate||Ite?A.useLayoutEffect:A.useEffect,Tte=["onKeyDown"];function kte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Nte(e){return!e||e.trim()==="#"}const K1=A.forwardRef((e,t)=>{let{onKeyDown:n}=e,r=kte(e,Tte);const[i]=d1(Object.assign({tagName:"a"},r)),o=Ot(s=>{i.onKeyDown(s),n==null||n(s)});return Nte(r.href)||r.role==="button"?S.jsx("a",Object.assign({ref:t},r,i,{onKeyDown:o})):S.jsx("a",Object.assign({ref:t},r,{onKeyDown:n}))});K1.displayName="Anchor";const kP=A.forwardRef(({className:e,bsPrefix:t,as:n=K1,...r},i)=>(t=Fe(t,"alert-link"),S.jsx(n,{ref:i,className:Te(e,t),...r})));kP.displayName="AlertLink";const bT={disabled:!1},NP=Q.createContext(null);var Ote=function(t){return t.scrollTop},Kc="unmounted",es="exited",si="entering",go="entered",wu="exiting",Mo=function(e){Ete(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,u;return o.appearStatus=null,r.in?a?(u=es,o.appearStatus=si):u=go:r.unmountOnExit||r.mountOnEnter?u=Kc:u=es,o.state={status:u},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===Kc?{status:es}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==si&&s!==go&&(o=si):(s===si||s===go)&&(o=wu)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===si){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:la.findDOMNode(this);s&&Ote(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===es&&this.setState({status:Kc})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,u=this.props.nodeRef?[a]:[la.findDOMNode(this),a],c=u[0],d=u[1],p=this.getTimeouts(),h=a?p.appear:p.enter;if(!i&&!s||bT.disabled){this.safeSetState({status:go},function(){o.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:si},function(){o.props.onEntering(c,d),o.onTransitionEnd(h,function(){o.safeSetState({status:go},function(){o.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:la.findDOMNode(this);if(!o||bT.disabled){this.safeSetState({status:es},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:wu},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:es},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:la.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=u[0],d=u[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Kc)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=SP(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Q.createElement(NP.Provider,{value:null},typeof s=="function"?s(i,a):Q.cloneElement(Q.Children.only(s),a))},t}(Q.Component);Mo.contextType=NP;Mo.propTypes={};function xl(){}Mo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:xl,onEntering:xl,onEntered:xl,onExit:xl,onExiting:xl,onExited:xl};Mo.UNMOUNTED=Kc;Mo.EXITED=es;Mo.ENTERING=si;Mo.ENTERED=go;Mo.EXITING=wu;function Rte(e){return e.code==="Escape"||e.keyCode===27}function OP(){const e=A.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}function cd(e){return e&&e.ownerDocument||document}function Dte(e){var t=cd(e);return t&&t.defaultView||window}function Lte(e,t){return Dte(e).getComputedStyle(e,t)}var Pte=/([A-Z])/g;function Mte(e){return e.replace(Pte,"-$1").toLowerCase()}var $te=/^ms-/;function Wp(e){return Mte(e).replace($te,"-ms-")}var Fte=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function Bte(e){return!!(e&&Fte.test(e))}function Eo(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Wp(t))||Lte(e).getPropertyValue(Wp(t));Object.keys(t).forEach(function(i){var o=t[i];!o&&o!==0?e.style.removeProperty(Wp(i)):Bte(i)?r+=i+"("+o+") ":n+=Wp(i)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}const Mu=!!(typeof window<"u"&&window.document&&window.document.createElement);var C_=!1,I_=!1;try{var x0={get passive(){return C_=!0},get once(){return I_=C_=!0}};Mu&&(window.addEventListener("test",x0,x0),window.removeEventListener("test",x0,!0))}catch{}function q1(e,t,n,r){if(r&&typeof r!="boolean"&&!I_){var i=r.once,o=r.capture,s=n;!I_&&i&&(s=n.__once||function a(u){this.removeEventListener(t,a,o),n.call(this,u)},n.__once=s),e.addEventListener(t,s,C_?r:o)}e.addEventListener(t,n,r)}function A_(e,t,n,r){var i=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}function ls(e,t,n,r){return q1(e,t,n,r),function(){A_(e,t,n,r)}}function Hte(e,t,n,r){if(r===void 0&&(r=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent(t,n,r),e.dispatchEvent(i)}}function zte(e){var t=Eo(e,"transitionDuration")||"",n=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*n}function jte(e,t,n){n===void 0&&(n=5);var r=!1,i=setTimeout(function(){r||Hte(e,"transitionend",!0)},t+n),o=ls(e,"transitionend",function(){r=!0},{once:!0});return function(){clearTimeout(i),o()}}function RP(e,t,n,r){n==null&&(n=zte(e)||0);var i=jte(e,n,r),o=ls(e,"transitionend",t);return function(){i(),o()}}function ET(e,t){const n=Eo(e,t)||"",r=n.indexOf("ms")===-1?1e3:1;return parseFloat(n)*r}function Y1(e,t){const n=ET(e,"transitionDuration"),r=ET(e,"transitionDelay"),i=RP(e,o=>{o.target===e&&(i(),t(o))},n+r)}function DP(e){e.offsetHeight}const ST=e=>!e||typeof e=="function"?e:t=>{e.current=t};function Vte(e,t){const n=ST(e),r=ST(t);return i=>{n&&n(i),r&&r(i)}}function Ga(e,t){return A.useMemo(()=>Vte(e,t),[e,t])}function Ute(e){return e&&"setState"in e?la.findDOMNode(e):e??null}const X1=Q.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,onExited:o,addEndListener:s,children:a,childRef:u,...c},d)=>{const p=A.useRef(null),h=Ga(p,u),m=I=>{h(Ute(I))},v=I=>O=>{I&&p.current&&I(p.current,O)},x=A.useCallback(v(e),[e]),b=A.useCallback(v(t),[t]),y=A.useCallback(v(n),[n]),_=A.useCallback(v(r),[r]),E=A.useCallback(v(i),[i]),C=A.useCallback(v(o),[o]),T=A.useCallback(v(s),[s]);return S.jsx(Mo,{ref:d,...c,onEnter:x,onEntered:y,onEntering:b,onExit:_,onExited:C,onExiting:E,addEndListener:T,nodeRef:p,children:typeof a=="function"?(I,O)=>a(I,{...O,ref:m}):Q.cloneElement(a,{ref:m})})}),Wte={[si]:"show",[go]:"show"},Da=A.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...i},o)=>{const s={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...i},a=A.useCallback((d,p)=>{DP(d),r==null||r(d,p)},[r]),{major:u}=OP(),c=u>=19?t.props.ref:t.ref;return S.jsx(X1,{ref:o,addEndListener:Y1,...s,onEnter:a,childRef:c,children:(d,p)=>A.cloneElement(t,{...p,className:Te("fade",e,t.props.className,Wte[d],n[d])})})});Da.displayName="Fade";const Gte={"aria-label":pr.string,onClick:pr.func,variant:pr.oneOf(["white"])},fd=A.forwardRef(({className:e,variant:t,"aria-label":n="Close",...r},i)=>S.jsx("button",{ref:i,type:"button",className:Te("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));fd.displayName="CloseButton";fd.propTypes=Gte;const LP=A.forwardRef((e,t)=>{const{bsPrefix:n,show:r=!0,closeLabel:i="Close alert",closeVariant:o,className:s,children:a,variant:u="primary",onClose:c,dismissible:d,transition:p=Da,...h}=U1(e,{show:"onClose"}),m=Fe(n,"alert"),v=Ot(y=>{c&&c(!1,y)}),x=p===!0?Da:p,b=S.jsxs("div",{role:"alert",...x?void 0:h,ref:t,className:Te(s,m,u&&`${m}-${u}`,d&&`${m}-dismissible`),children:[d&&S.jsx(fd,{onClick:v,"aria-label":i,variant:o}),a]});return x?S.jsx(x,{unmountOnExit:!0,...h,ref:void 0,in:r,children:b}):r?b:null});LP.displayName="Alert";const Kte=Object.assign(LP,{Link:kP,Heading:IP});function qte(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yte=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xte=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qte={};function CT(e,t){return(Qte.jsx?Xte:Yte).test(e)}const Zte=/[ \t\n\f\r]/g;function Jte(e){return typeof e=="object"?e.type==="text"?IT(e.value):!1:IT(e)}function IT(e){return e.replace(Zte,"")===""}class dd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}dd.prototype.property={};dd.prototype.normal={};dd.prototype.space=null;function PP(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&ine.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(TT,lne);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!TT.test(o)){let s=o.replace(one,ane);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Q1}return new i(r,t)}function ane(e){return"-"+e.toLowerCase()}function lne(e){return e.charAt(1).toUpperCase()}const une={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},cne=PP([FP,$P,zP,jP,nne],"html"),Z1=PP([FP,$P,zP,jP,rne],"svg");function fne(e){return e.join(" ").trim()}var VP={},kT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dne=/\n/g,pne=/^\s*/,hne=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mne=/^:\s*/,gne=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yne=/^[;\s]*/,vne=/^\s+|\s+$/g,xne=` +`,NT="/",OT="*",ia="",_ne="comment",wne="declaration",bne=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var x=v.match(dne);x&&(n+=x.length);var b=v.lastIndexOf(xne);r=~b?v.length-b:r+v.length}function o(){var v={line:n,column:r};return function(x){return x.position=new s(v),c(),x}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var x=new Error(t.source+":"+n+":"+r+": "+v);if(x.reason=v,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(v){var x=v.exec(e);if(x){var b=x[0];return i(b),e=e.slice(b.length),x}}function c(){u(pne)}function d(v){var x;for(v=v||[];x=p();)x!==!1&&v.push(x);return v}function p(){var v=o();if(!(NT!=e.charAt(0)||OT!=e.charAt(1))){for(var x=2;ia!=e.charAt(x)&&(OT!=e.charAt(x)||NT!=e.charAt(x+1));)++x;if(x+=2,ia===e.charAt(x-1))return a("End of comment missing");var b=e.slice(2,x-2);return r+=2,i(b),e=e.slice(x),r+=2,v({type:_ne,comment:b})}}function h(){var v=o(),x=u(hne);if(x){if(p(),!u(mne))return a("property missing ':'");var b=u(gne),y=v({type:wne,property:RT(x[0].replace(kT,ia)),value:b?RT(b[0].replace(kT,ia)):ia});return u(yne),y}}function m(){var v=[];d(v);for(var x;x=h();)x!==!1&&(v.push(x),d(v));return v}return c(),m()};function RT(e){return e?e.replace(vne,ia):ia}var Ene=ra&&ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(VP,"__esModule",{value:!0});var DT=VP.default=Cne,Sne=Ene(bne);function Cne(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Sne.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}const Ine=DT.default||DT,UP=WP("end"),J1=WP("start");function WP(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ane(e){const t=J1(e),n=UP(e);if(t&&n)return{start:t,end:n}}function sf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?LT(e.position):"start"in e||"end"in e?LT(e):"line"in e||"column"in e?N_(e):""}function N_(e){return PT(e&&e.line)+":"+PT(e&&e.column)}function LT(e){return N_(e&&e.start)+"-"+N_(e&&e.end)}function PT(e){return e&&typeof e=="number"?e:1}class Fn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=sf(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Fn.prototype.file="";Fn.prototype.name="";Fn.prototype.reason="";Fn.prototype.message="";Fn.prototype.stack="";Fn.prototype.column=void 0;Fn.prototype.line=void 0;Fn.prototype.ancestors=void 0;Fn.prototype.cause=void 0;Fn.prototype.fatal=void 0;Fn.prototype.place=void 0;Fn.prototype.ruleId=void 0;Fn.prototype.source=void 0;const eb={}.hasOwnProperty,Tne=new Map,kne=/[A-Z]/g,Nne=/-([a-z])/g,One=new Set(["table","tbody","thead","tfoot","tr"]),Rne=new Set(["td","th"]),GP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Dne(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zne(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Hne(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Z1:cne,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=KP(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function KP(e,t,n){if(t.type==="element")return Lne(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Pne(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $ne(e,t,n);if(t.type==="mdxjsEsm")return Mne(e,t);if(t.type==="root")return Fne(e,t,n);if(t.type==="text")return Bne(e,t)}function Lne(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Z1,e.schema=i),e.ancestors.push(t);const o=YP(e,t.tagName,!1),s=jne(e,t);let a=nb(e,t);return One.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Jte(u):!0})),qP(e,s,o,t),tb(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Pne(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Hf(e,t.position)}function Mne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hf(e,t.position)}function $ne(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Z1,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:YP(e,t.name,!0),s=Vne(e,t),a=nb(e,t);return qP(e,s,o,t),tb(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Fne(e,t,n){const r={};return tb(r,nb(e,t)),e.create(t,e.Fragment,r,n)}function Bne(e,t){return t.value}function qP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Hne(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function zne(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=J1(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function jne(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&eb.call(t.properties,i)){const o=Une(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Rne.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Vne(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Hf(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Hf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function nb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Tne;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Oo(e,e.length,0,t),e):t}const FT={}.hasOwnProperty;function Jne(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function tu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qi=Fs(/[A-Za-z]/),Lr=Fs(/[\dA-Za-z]/),nre=Fs(/[#-'*+\--9=?A-Z^-~]/);function O_(e){return e!==null&&(e<32||e===127)}const R_=Fs(/\d/),rre=Fs(/[\dA-Fa-f]/),ire=Fs(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function wr(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const ore=Fs(new RegExp("\\p{P}|\\p{S}","u")),sre=Fs(/\s/);function Fs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fu(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function St(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return lt(u)?(e.enter(n),a(u)):t(u)}function a(u){return lt(u)&&o++s))return;const O=t.events.length;let M=O,j,V;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(j){V=t.events[M][1].end;break}j=!0}for(y(r),I=O;IE;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=E}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fre(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function HT(e){if(e===null||wr(e)||sre(e))return 1;if(ore(e))return 2}function ib(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);zT(p,-u),zT(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ai(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ai(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=ai(c,ib(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ai(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ai(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Oo(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&<(I)?St(e,_,"linePrefix",o+1)(I):_(I)}function _(I){return I===null||He(I)?e.check(jT,x,C)(I):(e.enter("codeFlowValue"),E(I))}function E(I){return I===null||He(I)?(e.exit("codeFlowValue"),_(I)):(e.consume(I),E)}function C(I){return e.exit("codeFenced"),t(I)}function T(I,O,M){let j=0;return V;function V(B){return I.enter("lineEnding"),I.consume(B),I.exit("lineEnding"),F}function F(B){return I.enter("codeFencedFence"),lt(B)?St(I,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):W(B)}function W(B){return B===a?(I.enter("codeFencedFenceSequence"),Y(B)):M(B)}function Y(B){return B===a?(j++,I.consume(B),Y):j>=s?(I.exit("codeFencedFenceSequence"),lt(B)?St(I,L,"whitespace")(B):L(B)):M(B)}function L(B){return B===null||He(B)?(I.exit("codeFencedFence"),O(B)):M(B)}}}function Ere(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const b0={name:"codeIndented",tokenize:Cre},Sre={tokenize:Ire,partial:!0};function Cre(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),St(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):He(c)?e.attempt(Sre,s,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||He(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function Ire(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):St(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):He(s)?i(s):n(s)}}const Are={name:"codeText",tokenize:Nre,resolve:Tre,previous:kre};function Tre(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&kc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function nM(e,t,n,r,i,o,s,a,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||O_(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||He(y)?n(y):(e.consume(y),y===92?v:m)}function v(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!d&&(y===null||y===41||wr(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):d999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):He(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===null||m===91||m===93||He(m)||a++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!lt(m)),m===92?h:p)}function h(m){return m===91||m===92||m===93?(e.consume(m),a++,p):p(m)}}function iM(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),u(s)):h===null?n(h):He(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),St(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||He(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?p:d)}function p(h){return h===s||h===92?(e.consume(h),d):d(h)}}function af(e,t){let n;return r;function r(i){return He(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):lt(i)?St(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Fre={name:"definition",tokenize:Hre},Bre={tokenize:zre,partial:!0};function Hre(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),s(m)}function s(m){return rM.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=tu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return wr(m)?af(e,c)(m):c(m)}function c(m){return nM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Bre,p,p)(m)}function p(m){return lt(m)?St(e,h,"whitespace")(m):h(m)}function h(m){return m===null||He(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function zre(e,t,n){return r;function r(a){return wr(a)?af(e,i)(a):n(a)}function i(a){return iM(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return lt(a)?St(e,s,"whitespace")(a):s(a)}function s(a){return a===null||He(a)?t(a):n(a)}}const jre={name:"hardBreakEscape",tokenize:Vre};function Vre(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return He(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Ure={name:"headingAtx",tokenize:Gre,resolve:Wre};function Wre(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Oo(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Gre(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||wr(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||He(d)?(e.exit("atxHeading"),t(d)):lt(d)?St(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||wr(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Kre=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],UT=["pre","script","style","textarea"],qre={name:"htmlFlow",tokenize:Zre,resolveTo:Qre,concrete:!0},Yre={tokenize:eie,partial:!0},Xre={tokenize:Jre,partial:!0};function Qre(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zre(e,t,n){const r=this;let i,o,s,a,u;return c;function c(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),p}function p(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),o=!0,x):R===63?(e.consume(R),i=3,r.interrupt?t:N):qi(R)?(e.consume(R),s=String.fromCharCode(R),b):n(R)}function h(R){return R===45?(e.consume(R),i=2,m):R===91?(e.consume(R),i=5,a=0,v):qi(R)?(e.consume(R),i=4,r.interrupt?t:N):n(R)}function m(R){return R===45?(e.consume(R),r.interrupt?t:N):n(R)}function v(R){const ee="CDATA[";return R===ee.charCodeAt(a++)?(e.consume(R),a===ee.length?r.interrupt?t:W:v):n(R)}function x(R){return qi(R)?(e.consume(R),s=String.fromCharCode(R),b):n(R)}function b(R){if(R===null||R===47||R===62||wr(R)){const ee=R===47,ie=s.toLowerCase();return!ee&&!o&&UT.includes(ie)?(i=1,r.interrupt?t(R):W(R)):Kre.includes(s.toLowerCase())?(i=6,ee?(e.consume(R),y):r.interrupt?t(R):W(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?_(R):E(R))}return R===45||Lr(R)?(e.consume(R),s+=String.fromCharCode(R),b):n(R)}function y(R){return R===62?(e.consume(R),r.interrupt?t:W):n(R)}function _(R){return lt(R)?(e.consume(R),_):V(R)}function E(R){return R===47?(e.consume(R),V):R===58||R===95||qi(R)?(e.consume(R),C):lt(R)?(e.consume(R),E):V(R)}function C(R){return R===45||R===46||R===58||R===95||Lr(R)?(e.consume(R),C):T(R)}function T(R){return R===61?(e.consume(R),I):lt(R)?(e.consume(R),T):E(R)}function I(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),u=R,O):lt(R)?(e.consume(R),I):M(R)}function O(R){return R===u?(e.consume(R),u=null,j):R===null||He(R)?n(R):(e.consume(R),O)}function M(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||wr(R)?T(R):(e.consume(R),M)}function j(R){return R===47||R===62||lt(R)?E(R):n(R)}function V(R){return R===62?(e.consume(R),F):n(R)}function F(R){return R===null||He(R)?W(R):lt(R)?(e.consume(R),F):n(R)}function W(R){return R===45&&i===2?(e.consume(R),z):R===60&&i===1?(e.consume(R),X):R===62&&i===4?(e.consume(R),Z):R===63&&i===3?(e.consume(R),N):R===93&&i===5?(e.consume(R),H):He(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Yre,ne,Y)(R)):R===null||He(R)?(e.exit("htmlFlowData"),Y(R)):(e.consume(R),W)}function Y(R){return e.check(Xre,L,ne)(R)}function L(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),B}function B(R){return R===null||He(R)?Y(R):(e.enter("htmlFlowData"),W(R))}function z(R){return R===45?(e.consume(R),N):W(R)}function X(R){return R===47?(e.consume(R),s="",U):W(R)}function U(R){if(R===62){const ee=s.toLowerCase();return UT.includes(ee)?(e.consume(R),Z):W(R)}return qi(R)&&s.length<8?(e.consume(R),s+=String.fromCharCode(R),U):W(R)}function H(R){return R===93?(e.consume(R),N):W(R)}function N(R){return R===62?(e.consume(R),Z):R===45&&i===2?(e.consume(R),N):W(R)}function Z(R){return R===null||He(R)?(e.exit("htmlFlowData"),ne(R)):(e.consume(R),Z)}function ne(R){return e.exit("htmlFlow"),t(R)}}function Jre(e,t,n){const r=this;return i;function i(s){return He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function eie(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_g,t,n)}}const tie={name:"htmlText",tokenize:nie};function nie(e,t,n){const r=this;let i,o,s;return a;function a(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),T):N===63?(e.consume(N),E):qi(N)?(e.consume(N),M):n(N)}function c(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),o=0,v):qi(N)?(e.consume(N),_):n(N)}function d(N){return N===45?(e.consume(N),m):n(N)}function p(N){return N===null?n(N):N===45?(e.consume(N),h):He(N)?(s=p,X(N)):(e.consume(N),p)}function h(N){return N===45?(e.consume(N),m):p(N)}function m(N){return N===62?z(N):N===45?h(N):p(N)}function v(N){const Z="CDATA[";return N===Z.charCodeAt(o++)?(e.consume(N),o===Z.length?x:v):n(N)}function x(N){return N===null?n(N):N===93?(e.consume(N),b):He(N)?(s=x,X(N)):(e.consume(N),x)}function b(N){return N===93?(e.consume(N),y):x(N)}function y(N){return N===62?z(N):N===93?(e.consume(N),y):x(N)}function _(N){return N===null||N===62?z(N):He(N)?(s=_,X(N)):(e.consume(N),_)}function E(N){return N===null?n(N):N===63?(e.consume(N),C):He(N)?(s=E,X(N)):(e.consume(N),E)}function C(N){return N===62?z(N):E(N)}function T(N){return qi(N)?(e.consume(N),I):n(N)}function I(N){return N===45||Lr(N)?(e.consume(N),I):O(N)}function O(N){return He(N)?(s=O,X(N)):lt(N)?(e.consume(N),O):z(N)}function M(N){return N===45||Lr(N)?(e.consume(N),M):N===47||N===62||wr(N)?j(N):n(N)}function j(N){return N===47?(e.consume(N),z):N===58||N===95||qi(N)?(e.consume(N),V):He(N)?(s=j,X(N)):lt(N)?(e.consume(N),j):z(N)}function V(N){return N===45||N===46||N===58||N===95||Lr(N)?(e.consume(N),V):F(N)}function F(N){return N===61?(e.consume(N),W):He(N)?(s=F,X(N)):lt(N)?(e.consume(N),F):j(N)}function W(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,Y):He(N)?(s=W,X(N)):lt(N)?(e.consume(N),W):(e.consume(N),L)}function Y(N){return N===i?(e.consume(N),i=void 0,B):N===null?n(N):He(N)?(s=Y,X(N)):(e.consume(N),Y)}function L(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||wr(N)?j(N):(e.consume(N),L)}function B(N){return N===47||N===62||wr(N)?j(N):n(N)}function z(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function X(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),U}function U(N){return lt(N)?St(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):H(N)}function H(N){return e.enter("htmlTextData"),s(N)}}const ob={name:"labelEnd",tokenize:lie,resolveTo:aie,resolveAll:sie},rie={tokenize:uie},iie={tokenize:cie},oie={tokenize:fie};function sie(e){let t=-1;for(;++t=3&&(c===null||He(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),lt(c)?St(e,a,"whitespace")(c):a(c))}}const ur={name:"list",tokenize:_ie,continuation:{tokenize:wie},exit:Eie},vie={tokenize:Sie,partial:!0},xie={tokenize:bie,partial:!0};function _ie(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(m){const v=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:R_(m)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(_h,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return R_(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(_g,r.interrupt?n:d,e.attempt(vie,h,p))}function d(m){return r.containerState.initialBlankLine=!0,o++,h(m)}function p(m){return lt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function wie(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_g,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,St(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!lt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(xie,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,St(e,e.attempt(ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function bie(e,t,n){const r=this;return St(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Eie(e){e.exit(this.containerState.type)}function Sie(e,t,n){const r=this;return St(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!lt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const WT={name:"setextUnderline",tokenize:Iie,resolveTo:Cie};function Cie(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Iie(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),lt(c)?St(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||He(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Aie={tokenize:Tie};function Tie(e){const t=this,n=e.attempt(_g,r,e.attempt(this.parser.constructs.flowInitial,i,St(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Dre,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const kie={resolveAll:sM()},Nie=oM("string"),Oie=oM("text");function oM(e){return{tokenize:t,resolveAll:sM(e==="text"?Rie:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let h=-1;if(p)for(;++h-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Pie(e,t){let n=-1;const r=[];let i;for(;++n0){const st=Ce.tokenStack[Ce.tokenStack.length-1];(st[1]||KT).call(Ce,void 0,st[0])}for(ce.position={start:Yo(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:Yo(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function loe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uoe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function coe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uM(e,t);const i={src:Fu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function foe(e,t){const n={src:Fu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function doe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function poe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uM(e,t);const i={href:Fu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function hoe(e,t){const n={href:Fu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function moe(e,t,n){const r=e.all(t),i=n?goe(n):cM(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function yoe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=J1(t.children[1]),u=UP(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function boe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(XT(t.slice(i),i>0,!1)),o.join("")}function XT(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===qT||o===YT;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===qT||o===YT;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Coe(e,t){const n={type:"text",value:Soe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ioe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Aoe={blockquote:noe,break:roe,code:ioe,delete:ooe,emphasis:soe,footnoteReference:aoe,heading:loe,html:uoe,imageReference:coe,image:foe,inlineCode:doe,linkReference:poe,link:hoe,listItem:moe,list:yoe,paragraph:voe,root:xoe,strong:_oe,table:woe,tableCell:Eoe,tableRow:boe,text:Coe,thematicBreak:Ioe,toml:Gp,yaml:Gp,definition:Gp,footnoteDefinition:Gp};function Gp(){}const fM=-1,wg=0,gm=1,ym=2,sb=3,ab=4,lb=5,ub=6,dM=7,pM=8,QT=typeof self=="object"?self:globalThis,Toe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case wg:case fM:return n(s,i);case gm:{const a=n([],i);for(const u of s)a.push(r(u));return a}case ym:{const a=n({},i);for(const[u,c]of s)a[r(u)]=r(c);return a}case sb:return n(new Date(s),i);case ab:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case lb:{const a=n(new Map,i);for(const[u,c]of s)a.set(r(u),r(c));return a}case ub:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case dM:{const{name:a,message:u}=s;return n(new QT[a](u),i)}case pM:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new QT[o](s),i)};return r},ZT=e=>Toe(new Map,e)(0),_l="",{toString:koe}={},{keys:Noe}=Object,Nc=e=>{const t=typeof e;if(t!=="object"||!e)return[wg,t];const n=koe.call(e).slice(8,-1);switch(n){case"Array":return[gm,_l];case"Object":return[ym,_l];case"Date":return[sb,_l];case"RegExp":return[ab,_l];case"Map":return[lb,_l];case"Set":return[ub,_l]}return n.includes("Array")?[gm,n]:n.includes("Error")?[dM,n]:[ym,n]},Kp=([e,t])=>e===wg&&(t==="function"||t==="symbol"),Ooe=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=Nc(s);switch(a){case wg:{let d=s;switch(u){case"bigint":a=pM,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([fM],s)}return i([a,d],s)}case gm:{if(u)return i([u,[...s]],s);const d=[],p=i([a,d],s);for(const h of s)d.push(o(h));return p}case ym:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],p=i([a,d],s);for(const h of Noe(s))(e||!Kp(Nc(s[h])))&&d.push([o(h),o(s[h])]);return p}case sb:return i([a,s.toISOString()],s);case ab:{const{source:d,flags:p}=s;return i([a,{source:d,flags:p}],s)}case lb:{const d=[],p=i([a,d],s);for(const[h,m]of s)(e||!(Kp(Nc(h))||Kp(Nc(m))))&&d.push([o(h),o(m)]);return p}case ub:{const d=[],p=i([a,d],s);for(const h of s)(e||!Kp(Nc(h)))&&d.push(o(h));return p}}const{message:c}=s;return i([a,{name:u,message:c}],s)};return o},JT=(e,{json:t,lossy:n}={})=>{const r=[];return Ooe(!(t||n),!!t,new Map,r)(e),r},vm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ZT(JT(e,t)):structuredClone(e):(e,t)=>ZT(JT(e,t));function Roe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Doe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Loe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Roe,r=e.options.footnoteBackLabel||Doe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,m);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const _=b.children[b.children.length-1];_&&_.type==="text"?_.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...v)}else d.push(...v);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vm(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` +`}]}}const hM=function(e){if(e==null)return Foe;if(typeof e=="function")return bg(e);if(typeof e=="object")return Array.isArray(e)?Poe(e):Moe(e);if(typeof e=="string")return $oe(e);throw new Error("Expected function, string, or object as test")};function Poe(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=mM,v,x,b;if((!t||o(u,c,d[d.length-1]||void 0))&&(m=Voe(n(u,d)),m[0]===ek))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==zoe)for(x=(r?y.children.length:-1)+s,b=d.concat(y);x>-1&&x0&&n.push({type:"text",value:` +`}),n}function tk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nk(e,t){const n=Woe(e,t),r=n.one(e,void 0),i=Loe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function Xoe(e,t){return e&&"run"in e?async function(n,r){const i=nk(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nk(n,{file:r,...e||t})}}function rk(e){if(e)throw e}var wh=Object.prototype.hasOwnProperty,yM=Object.prototype.toString,ik=Object.defineProperty,ok=Object.getOwnPropertyDescriptor,sk=function(t){return typeof Array.isArray=="function"?Array.isArray(t):yM.call(t)==="[object Array]"},ak=function(t){if(!t||yM.call(t)!=="[object Object]")return!1;var n=wh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wh.call(t,i)},lk=function(t,n){ik&&n.name==="__proto__"?ik(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},uk=function(t,n){if(n==="__proto__")if(wh.call(t,n)){if(ok)return ok(t,n).value}else return;return t[n]},Qoe=function e(){var t,n,r,i,o,s,a=arguments[0],u=1,c=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});us.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(c){const d=c;if(a&&n)throw d;return i(d)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Wi={basename:ese,dirname:tse,extname:nse,join:rse,sep:"/"};function ese(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pd(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function tse(e){if(pd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nse(e){pd(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function rse(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ose(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function pd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sse={cwd:ase};function ase(){return"/"}function M_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lse(e){if(typeof e=="string")e=new URL(e);else if(!M_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return use(e)}function use(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...v]=d;const x=r[h][1];P_(x)&&P_(m)&&(m=S0(!0,x,m)),r[h]=[c,m,...v]}}}}const pse=new cb().freeze();function T0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function k0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function N0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fk(e){if(!P_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qp(e){return hse(e)?e:new vM(e)}function hse(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mse(e){return typeof e=="string"||gse(e)}function gse(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pk=[],hk={allowDangerousHtml:!0},vse=/^(https?|ircs?|mailto|xmpp)$/i,xse=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _se(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||pk,u=e.remarkPlugins||pk,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hk}:hk,d=e.skipHtml,p=e.unwrapDisallowed,h=e.urlTransform||wse,m=pse().use(toe).use(u).use(Xoe,c).use(a),v=new vM;typeof r=="string"&&(v.value=r);for(const _ of xse)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+yse+_.id,void 0);const x=m.parse(v);let b=m.runSync(x,v);return i&&(b={type:"element",tagName:"div",properties:{className:i},children:b.type==="root"?b.children:[b]}),gM(b,y),Dne(b,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function y(_,E,C){if(_.type==="raw"&&C&&typeof E=="number")return d?C.children.splice(E,1):C.children[E]={type:"text",value:_.value},E;if(_.type==="element"){let T;for(T in w0)if(Object.hasOwn(w0,T)&&Object.hasOwn(_.properties,T)){const I=_.properties[T],O=w0[T];(O===null||O.includes(_.tagName))&&(_.properties[T]=h(String(I||""),T,_))}}if(_.type==="element"){let T=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!T&&n&&typeof E=="number"&&(T=!n(_,E,C)),T&&C&&typeof E=="number")return p&&_.children?C.children.splice(E,1,..._.children):C.children.splice(E,1),E}}}function wse(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||vse.test(e.slice(0,t))?e:""}const bse={lineHeight:"1.2"},Ese={backgroundColor:"rgba(0, 0, 0, 0.10)",paddingLeft:"4px",paddingRight:"4px",paddingTop:"2px",paddingBottom:"2px",marginLeft:"2px",marginRight:"2px",borderRadius:"2px",whiteSpace:"nowrap",overflow:"auto",lineHeight:"1.2"};function bu({className:e="",source:t=""}){return S.jsx(_se,{className:e,components:{p:({children:n})=>S.jsx("span",{style:bse,children:n}),code:({children:n})=>S.jsx("span",{className:"font-monospace",style:Ese,children:n})},children:t})}const Gr=hg()((e,t)=>({isDraggingNode:!1,setIsDraggingNode:n=>e({isDraggingNode:n}),connectionSource:null,setConnectionSource:n=>e({connectionSource:n}),connectionSourceHandle:null,setConnectionSourceHandle:n=>e({connectionSourceHandle:n}),mouseOverNodeId:null,setMouseOverNodeId:n=>e({mouseOverNodeId:n}),toasts:[],triggerToast:n=>{e({toasts:[...t().toasts,n]}),setTimeout(()=>e({toasts:t().toasts.slice(1)}),5e3)},refInput:{current:null},setRefInput:n=>e({refInput:n})}));function Sse(){const{isDraggingNode:e,connectionSource:t,mouseOverNodeId:n}=Gr(),{machineState:r}=$s(),{getString:i}=sn();if(e||t!==null)return S.jsx(S.Fragment,{});function o(){const{status:d,errors:p,timeSlot:h}=r;switch(d){case"ready":return{backgroundColor:At.purple,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Ready")};case"running":return{backgroundColor:At.green,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Running",{step:h})};case"waiting":return{backgroundColor:At.blue,statusIcon:"bi-hourglass-split",mainStatus:i("Status_Waiting")};case"halted":return{backgroundColor:At.purple,statusIcon:"bi-check-circle-fill",mainStatus:i("Status_Halted")};case"exception":return{backgroundColor:At.red,statusIcon:"bi-exclamation-circle-fill",mainStatus:i(p[0].message,p[0].payload)};case"invalid":{const m=ue.filter(p,{nodeId:n}),v=ue.filter(p,{nodeId:null});let x="",b=[];if(m.length===0)if(v.length>0){const y=v[0];x=i(y.message,y.payload)}else{const y=p.length;x=i("Status_CompileErrors",{count:y})}else if(m.length===1){const y=m[0];x=i(y.message,y.payload)}else x=i("Status_MultipleErrors"),b=ue.map(m,y=>i(y.message,y.payload));return{backgroundColor:At.red,statusIcon:"bi-exclamation-triangle-fill",mainStatus:x,smallStatus:b}}}}const{backgroundColor:s,statusIcon:a,mainStatus:u,smallStatus:c}=o();return S.jsx(Kte,{className:"m-0 border-0 text-white",style:{backgroundColor:s,padding:"6px 12px",zIndex:10},children:S.jsxs($a,{direction:"horizontal",className:"align-items-start",children:[S.jsx("i",{className:`bi ${a}`}),S.jsxs("span",{className:"ms-2",style:{whiteSpace:"pre-wrap"},children:[S.jsx(bu,{source:u}),S.jsx(bu,{className:"small",source:c==null?void 0:c.join(` +`)})]})]})})}function Cse(e){const t=ue.map(e,r=>parseInt(r.id));let n=0;for(;ue.includes(t,n);)n++;return n.toString()}function Ise(e){const t="var";let n=1;for(;;){const r=`${t}${n}`,i=ue.map(e,"id");if(!ue.includes(i,r))return r;n++}}function mk(){return{title:"",variables:[],nodes:[],edges:[]}}const Kr=hg()(EP((e,t)=>({flowchart:mk(),savedViewport:{x:0,y:0,zoom:1},clearFlowchart:()=>{e({flowchart:mk()}),e({savedViewport:{x:0,y:0,zoom:1}})},importSimpleFlowchart:n=>{const{title:r,variables:i,nodes:o,edges:s}=n,a=ue.map(s,({source:c,target:d,sourceHandle:p})=>({id:`${c}-${d}-${p}`,source:c,target:d,sourceHandle:p})),u=ue.map(o,({id:c,role:d,position:p,payload:h,handlePositions:m})=>({id:c,type:"MyNode",position:p,data:{payload:h,role:d,handlePositions:m}}));e({flowchart:{title:r,variables:i,nodes:u,edges:a}})},setTitle:n=>{const{flowchart:r}=t();r.title=n,e({flowchart:r})},onNodesChange:n=>{const{flowchart:r}=t();r.nodes=_D(n,r.nodes),e({flowchart:r})},onEdgesChange:n=>{const{flowchart:r}=t();r.edges=QG(n,r.edges),e({flowchart:r})},addNode:(n,r)=>{const{flowchart:i}=t(),o=xg(n),s={id:Cse(i.nodes),type:"MyNode",position:r,data:{payload:"",role:n,handlePositions:ue.fromPairs(ue.map(o,({id:a,position:u})=>[a,u]))}};i.nodes=[...i.nodes,s],e({flowchart:i})},deleteNode:n=>{const{flowchart:r}=t();r.nodes=ue.filter(r.nodes,i=>i.id!==n),r.edges=ue.filter(r.edges,i=>i.source!==n&&i.target!==n),e({flowchart:r})},changeNodePayload:(n,r)=>{const{flowchart:i}=t(),o=ue.find(i.nodes,{id:n});vi(o!==void 0),o.data.payload=r,e({flowchart:i})},addEdge:n=>{const{flowchart:r}=t();r.edges=ue.reject(r.edges,i=>i.source===n.source&&i.sourceHandle===n.sourceHandle),r.edges=JR(n,r.edges),e({flowchart:r})},moveHandle:n=>{const{flowchart:r}=t(),i=n.source,o=n.sourceHandle,s=n.targetHandle,a=ue.find(r.nodes,{id:i});vi(a!==void 0),a.data.handlePositions[o]=s,e({flowchart:r})},addVariable:()=>{const{flowchart:n}=t(),r=Ise(n.variables);n.variables=[...n.variables,{id:r,type:Xn.Number}],e({flowchart:n})},removeVariable:n=>{const{flowchart:r}=t();r.variables=ue.reject(r.variables,{id:n}),e({flowchart:r})},renameVariable:(n,r)=>{const{flowchart:i}=t();i.variables=ue.map(i.variables,o=>(o.id===n&&(o.id=r),o)),e({flowchart:i})},changeVariableType:(n,r)=>{const{flowchart:i}=t();i.variables=ue.map(i.variables,o=>(o.id===n&&(o.type=r),o)),e({flowchart:i})},reorderVariables:(n,r)=>{if(r===void 0||n===r)return;const{flowchart:i}=t(),o=i.variables[n];i.variables.splice(n,1),i.variables.splice(r,0,o),e({flowchart:i})},setSavedViewport:n=>e({savedViewport:n})}),{name:"fluxolab_flow",version:8}));function Ase({svgPathString:e,selected:t,animated:n,targetX:r,targetY:i,targetPosition:o}){const[s,a]=A.useState(!1),u=oi.darker(t?At.blue:At.gray500,s?48:0);return S.jsxs("g",{fill:"none",children:[S.jsx("path",{d:e,stroke:"white",strokeWidth:2}),S.jsx("path",{d:e,stroke:u,strokeWidth:2,markerEnd:"url(#arrowhead)",strokeDasharray:n?5:0,style:{animation:n?"dashdraw 0.5s linear infinite":"none"}}),S.jsx("path",{d:Tse(r,i,o),stroke:u,fill:u}),S.jsx("path",{d:e,stroke:"transparent",strokeWidth:16,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)})]})}function Tse(e,t,n){switch(n){case te.Top:return`M ${e} ${t} l 3.5 -9 l -7 0 z`;case te.Bottom:return`M ${e} ${t} l 3.5 9 l -7 0 z`;case te.Left:return`M ${e} ${t} l -9 3.5 l 0 -7 z`;case te.Right:return`M ${e} ${t} l 9 3.5 l 0 -7 z`}}function gk(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function kse(e,t,n,r){const i=Math.min(gk(e,t)/2,gk(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x({x:i,y:o}));return n.reduce((i,o,s)=>{let a="";return s>0&&sp?C=(u+p)/2:a=y?C=Math.min(u,h)-s:C=Math.max(a,p)+s,E=[[x,b],[x,b+s],[C,b+s],[C,_-s],[y,_-s],[y,_]];break}case te.Left:{if(d<=m&&xv?(C=Math.min(u,h)-s,T=Math.max(d,v)+s):d[-I,O])}case te.Bottom:{if(b<=_)if(xp){const C=Math.max(_,b)+s;E=[[x,b],[x,C],[y,C],[y,_]]}else{const C=x<=y?h-s:p+s,T=(d+m)/2;E=[[x,b],[x,T],[C,T],[C,_+s],[y,_+s],[y,_]]}else{if(ay)return[[x,b],[x,b+s],[y,b+s],[y,_]];{const C=x<=y?a+s:u-s,T=(v+c)/2;return[[x,b],[x,b+s],[C,b+s],[C,T],[y,T],[y,_]]}}return E}}break}case te.Right:{switch(t){case te.Top:{const C={x:n.x,y:-n.y},T={x:r.x,y:-r.y};return ue.reverse(ue.map(Il(te.Bottom,te.Right,T,C,o,i),([I,O])=>[I,-O]))}case te.Left:{if(av||dr.y?(C=h-s,T=m-s):(C=h-s,T=v+s),E=[[x,b],[x+s,b],[x+s,T],[C,T],[C,_],[y,_]];break}case te.Right:{if(d<=m||c>=v){const C=Math.max(a,p)+s;E=[[x,b],[C,b],[C,_],[y,_]]}else if(a[-O,M])}case te.Top:{const C={x:n.x,y:-n.y},T={x:r.x,y:-r.y},I={[te.Top]:te.Bottom,[te.Bottom]:te.Top,[te.Left]:te.Left,[te.Right]:te.Right}[t];return ue.map(Il(te.Bottom,I,C,T,i,o),([O,M])=>[O,-M])}}return Rse(E)}function Rse(e){const t=[e[0]];for(let n=1;ne.length-1,yk=e=>{let t=0;for(let n=1;nIl(n||te.Bottom,p,e.position,t.position,i,o)),u=(ue.max(ue.map(s,yk))??0)+1,c=ue.minBy(s,p=>u*Dse(p)+yk(p))??s[0],d=ue.indexOf(s,c);return[c,r[d]]}function Pse({source:e,target:t,sourceHandleId:n,selected:r}){const[i,o]=A.useState(!1),{flowchart:s}=Kr(),{machineState:a}=$s();A.useEffect(()=>{if(u===void 0||c===void 0)o(!1);else if(a.status==="ready"&&u.data.role===Ne.Start)o(!0);else if(a.status==="waiting"&&u.data.role===Ne.Read)o(a.curNodeId===e);else if(a.status==="running"){const b=bP(s,a);o(a.curNodeId===e&&b.curNodeId===t&&b.outPort===n)}else o(!1)},[e,t,n,a.curNodeId,a.status]);const u=ue.find(s.nodes,{id:e}),c=ue.find(s.nodes,{id:t});if(u===void 0||c===void 0||n===null||n===void 0)return S.jsx(S.Fragment,{});const d=u.data.handlePositions[n],[p,h]=Lse(u,c,d);ue.includes([Ne.Read,Ne.Write],c.data.role)&&(h==="left"?p[p.length-1][0]+=10:h==="right"&&(p[p.length-1][0]-=10));const m=Nse(p,10),[v,x]=p[p.length-1];return S.jsx(Ase,{svgPathString:m,selected:r??!1,animated:i,targetX:v,targetY:x,targetPosition:h})}const Mse=({fromX:e,fromY:t,toX:n,toY:r})=>{const{connectionSource:i,mouseOverNodeId:o}=Gr();return S.jsxs("g",{children:[i!==o&&S.jsx("path",{d:`M ${e} ${t} L ${n} ${r}`,fill:"none",stroke:o!==null?"green":"gray",strokeWidth:4}),S.jsx("circle",{cx:e,cy:t,r:6,fill:"white",stroke:"gray",strokeWidth:1}),S.jsx("circle",{cx:n,cy:r,r:6,fill:"white",stroke:"gray",strokeWidth:1})]})};function $se({as:e,bsPrefix:t,className:n,...r}){t=Fe(t,"col");const i=jw(),o=Vw(),s=[],a=[];return i.forEach(u=>{const c=r[u];delete r[u];let d,p,h;typeof c=="object"&&c!=null?{span:d,offset:p,order:h}=c:d=c;const m=u!==o?`-${u}`:"";d&&s.push(d===!0?`${t}${m}`:`${t}${m}-${d}`),h!=null&&a.push(`order${m}-${h}`),p!=null&&a.push(`offset${m}-${p}`)}),[{...r,className:Te(n,...s,...a)},{as:e,bsPrefix:t,spans:s}]}const fb=A.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:s}]=$se(e);return S.jsx(i,{...r,ref:t,className:Te(n,!s.length&&o)})});fb.displayName="Col";const Fse={type:pr.string,tooltip:pr.bool,as:pr.elementType},Eg=A.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...i},o)=>S.jsx(e,{...i,ref:o,className:Te(t,`${n}-${r?"tooltip":"feedback"}`)}));Eg.displayName="Feedback";Eg.propTypes=Fse;const Ro=A.createContext({}),hd=A.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:o=!1,as:s="input",...a},u)=>{const{controlId:c}=A.useContext(Ro);return t=Fe(t,"form-check-input"),S.jsx(s,{...a,ref:u,type:r,id:e||c,className:Te(n,t,i&&"is-valid",o&&"is-invalid")})});hd.displayName="FormCheckInput";const xm=A.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{const{controlId:o}=A.useContext(Ro);return e=Fe(e,"form-check-label"),S.jsx("label",{...r,ref:i,htmlFor:n||o,className:Te(t,e)})});xm.displayName="FormCheckLabel";function Bse(e,t){return A.Children.toArray(e).some(n=>A.isValidElement(n)&&n.type===t)}const xM=A.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:i=!1,disabled:o=!1,isValid:s=!1,isInvalid:a=!1,feedbackTooltip:u=!1,feedback:c,feedbackType:d,className:p,style:h,title:m="",type:v="checkbox",label:x,children:b,as:y="input",..._},E)=>{t=Fe(t,"form-check"),n=Fe(n,"form-switch");const{controlId:C}=A.useContext(Ro),T=A.useMemo(()=>({controlId:e||C}),[C,e]),I=!b&&x!=null&&x!==!1||Bse(b,xm),O=S.jsx(hd,{..._,type:v==="switch"?"checkbox":v,ref:E,isValid:s,isInvalid:a,disabled:o,as:y});return S.jsx(Ro.Provider,{value:T,children:S.jsx("div",{style:h,className:Te(p,I&&t,r&&`${t}-inline`,i&&`${t}-reverse`,v==="switch"&&n),children:b||S.jsxs(S.Fragment,{children:[O,I&&S.jsx(xm,{title:m,children:x}),c&&S.jsx(Eg,{type:d,tooltip:u,children:c})]})})})});xM.displayName="FormCheck";const _m=Object.assign(xM,{Input:hd,Label:xm});var Hse=function(){},zse=Hse;const jse=ks(zse),_M=A.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:o,isValid:s=!1,isInvalid:a=!1,plaintext:u,readOnly:c,as:d="input",...p},h)=>{const{controlId:m}=A.useContext(Ro);return e=Fe(e,"form-control"),S.jsx(d,{...p,type:t,size:r,ref:h,readOnly:c,id:i||m,className:Te(o,u?`${e}-plaintext`:e,n&&`${e}-${n}`,t==="color"&&`${e}-color`,s&&"is-valid",a&&"is-invalid")})});_M.displayName="FormControl";const Vse=Object.assign(_M,{Feedback:Eg}),wM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Fe(t,"form-floating"),S.jsx(n,{ref:i,className:Te(e,t),...r})));wM.displayName="FormFloating";const db=A.forwardRef(({controlId:e,as:t="div",...n},r)=>{const i=A.useMemo(()=>({controlId:e}),[e]);return S.jsx(Ro.Provider,{value:i,children:S.jsx(t,{...n,ref:r})})});db.displayName="FormGroup";const bM=A.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:i,htmlFor:o,...s},a)=>{const{controlId:u}=A.useContext(Ro);t=Fe(t,"form-label");let c="col-form-label";typeof n=="string"&&(c=`${c} ${c}-${n}`);const d=Te(i,t,r&&"visually-hidden",n&&c);return o=o||u,n?S.jsx(fb,{ref:a,as:"label",className:d,htmlFor:o,...s}):S.jsx(e,{ref:a,className:d,htmlFor:o,...s})});bM.displayName="FormLabel";const EM=A.forwardRef(({bsPrefix:e,className:t,id:n,...r},i)=>{const{controlId:o}=A.useContext(Ro);return e=Fe(e,"form-range"),S.jsx("input",{...r,type:"range",ref:i,className:Te(t,e),id:n||o})});EM.displayName="FormRange";const SM=A.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:i=!1,isInvalid:o=!1,id:s,...a},u)=>{const{controlId:c}=A.useContext(Ro);return e=Fe(e,"form-select"),S.jsx("select",{...a,size:n,ref:u,className:Te(r,e,t&&`${e}-${t}`,i&&"is-valid",o&&"is-invalid"),id:s||c})});SM.displayName="FormSelect";const CM=A.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...i},o)=>(e=Fe(e,"form-text"),S.jsx(n,{...i,ref:o,className:Te(t,e,r&&"text-muted")})));CM.displayName="FormText";const IM=A.forwardRef((e,t)=>S.jsx(_m,{...e,ref:t,type:"switch"}));IM.displayName="Switch";const Use=Object.assign(IM,{Input:_m.Input,Label:_m.Label}),AM=A.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:i,...o},s)=>(e=Fe(e,"form-floating"),S.jsxs(db,{ref:s,className:Te(t,e),controlId:r,...o,children:[n,S.jsx("label",{htmlFor:r,children:i})]})));AM.displayName="FloatingLabel";const Wse={_ref:pr.any,validated:pr.bool,as:pr.elementType},pb=A.forwardRef(({className:e,validated:t,as:n="form",...r},i)=>S.jsx(n,{...r,ref:i,className:Te(e,t&&"was-validated")}));pb.displayName="Form";pb.propTypes=Wse;const wa=Object.assign(pb,{Group:db,Control:Vse,Floating:wM,Check:_m,Switch:Use,Label:bM,Text:CM,Range:EM,Select:SM,FloatingLabel:AM});var Yp;function vk(e){if((!Yp&&Yp!==0||e)&&Mu){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Yp=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Yp}function Gse(e){const t=A.useRef(e);return t.current=e,t}function hb(e){const t=Gse(e);A.useEffect(()=>()=>t.current(),[])}function O0(e){e===void 0&&(e=cd());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function wm(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}const Kse="data-rr-ui-";function mb(e){return`${Kse}${e}`}function qse(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const xk=mb("modal-open");class gb{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return qse(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",i=this.getElement();t.style={overflow:i.style.overflow,[r]:i.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(Eo(i,r)||"0",10)+t.scrollBarWidth}px`),i.setAttribute(xk,""),Eo(i,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(xk),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const TM=A.createContext(Mu?window:void 0);TM.Provider;function Sg(){return A.useContext(TM)}const R0=(e,t)=>Mu?e==null?(t||cd()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function Yse(e,t){const n=Sg(),[r,i]=A.useState(()=>R0(e,n==null?void 0:n.document));if(!r){const o=R0(e);o&&i(o)}return A.useEffect(()=>{},[t,r]),A.useEffect(()=>{const o=R0(e);o!==r&&i(o)},[e,r]),r}function Xse({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:i}){const o=A.useRef(null),s=A.useRef(t),a=Ot(n);A.useEffect(()=>{t?s.current=!0:a(o.current)},[t,a]);const u=Ga(o,e.ref),c=A.cloneElement(e,{ref:u});return t?c:i||!s.current&&r?null:c}const Qse=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function Zse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jse(e){let{onEnter:t,onEntering:n,onEntered:r,onExit:i,onExiting:o,onExited:s,addEndListener:a,children:u}=e,c=Zse(e,Qse);const{major:d}=OP(),p=d>=19?u.props.ref:u.ref,h=A.useRef(null),m=Ga(h,typeof u=="function"?null:p),v=I=>O=>{I&&h.current&&I(h.current,O)},x=A.useCallback(v(t),[t]),b=A.useCallback(v(n),[n]),y=A.useCallback(v(r),[r]),_=A.useCallback(v(i),[i]),E=A.useCallback(v(o),[o]),C=A.useCallback(v(s),[s]),T=A.useCallback(v(a),[a]);return Object.assign({},c,{nodeRef:h},t&&{onEnter:x},n&&{onEntering:b},r&&{onEntered:y},i&&{onExit:_},o&&{onExiting:E},s&&{onExited:C},a&&{addEndListener:T},{children:typeof u=="function"?(I,O)=>u(I,Object.assign({},O,{ref:m})):A.cloneElement(u,{ref:m})})}const eae=["component"];function tae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const nae=A.forwardRef((e,t)=>{let{component:n}=e,r=tae(e,eae);const i=Jse(r);return S.jsx(n,Object.assign({ref:t},i))});function rae({in:e,onTransition:t}){const n=A.useRef(null),r=A.useRef(!0),i=Ot(t);return mm(()=>{if(!n.current)return;let o=!1;return i({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,i]),mm(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function iae({children:e,in:t,onExited:n,onEntered:r,transition:i}){const[o,s]=A.useState(!t);t&&o&&s(!1);const a=rae({in:!!t,onTransition:c=>{const d=()=>{c.isStale()||(c.in?r==null||r(c.element,c.initial):(s(!0),n==null||n(c.element)))};Promise.resolve(i(c)).then(d,p=>{throw c.in||s(!0),p})}}),u=Ga(a,e.ref);return o&&!t?null:A.cloneElement(e,{ref:u})}function _k(e,t,n){return e?S.jsx(nae,Object.assign({},n,{component:e})):t?S.jsx(iae,Object.assign({},n,{transition:t})):S.jsx(Xse,Object.assign({},n))}const oae=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function sae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}let D0;function aae(e){return D0||(D0=new gb({ownerDocument:e==null?void 0:e.document})),D0}function lae(e){const t=Sg(),n=e||aae(t),r=A.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:A.useCallback(i=>{r.current.dialog=i},[]),setBackdropRef:A.useCallback(i=>{r.current.backdrop=i},[])})}const kM=A.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:i,style:o,children:s,backdrop:a=!0,keyboard:u=!0,onBackdropClick:c,onEscapeKeyDown:d,transition:p,runTransition:h,backdropTransition:m,runBackdropTransition:v,autoFocus:x=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:_,renderDialog:E,renderBackdrop:C=Ie=>S.jsx("div",Object.assign({},Ie)),manager:T,container:I,onShow:O,onHide:M=()=>{},onExit:j,onExited:V,onExiting:F,onEnter:W,onEntering:Y,onEntered:L}=e,B=sae(e,oae);const z=Sg(),X=Yse(I),U=lae(T),H=G1(),N=TP(n),[Z,ne]=A.useState(!n),R=A.useRef(null);A.useImperativeHandle(t,()=>U,[U]),Mu&&!N&&n&&(R.current=O0(z==null?void 0:z.document)),n&&Z&&ne(!1);const ee=Ot(()=>{if(U.add(),Se.current=ls(document,"keydown",ye),_e.current=ls(document,"focus",()=>setTimeout(se),!0),O&&O(),x){var Ie,rt;const Le=O0((Ie=(rt=U.dialog)==null?void 0:rt.ownerDocument)!=null?Ie:z==null?void 0:z.document);U.dialog&&Le&&!wm(U.dialog,Le)&&(R.current=Le,U.dialog.focus())}}),ie=Ot(()=>{if(U.remove(),Se.current==null||Se.current(),_e.current==null||_e.current(),y){var Ie;(Ie=R.current)==null||Ie.focus==null||Ie.focus(_),R.current=null}});A.useEffect(()=>{!n||!X||ee()},[n,X,ee]),A.useEffect(()=>{Z&&ie()},[Z,ie]),hb(()=>{ie()});const se=Ot(()=>{if(!b||!H()||!U.isTopModal())return;const Ie=O0(z==null?void 0:z.document);U.dialog&&Ie&&!wm(U.dialog,Ie)&&U.dialog.focus()}),pe=Ot(Ie=>{Ie.target===Ie.currentTarget&&(c==null||c(Ie),a===!0&&M())}),ye=Ot(Ie=>{u&&Rte(Ie)&&U.isTopModal()&&(d==null||d(Ie),Ie.defaultPrevented||M())}),_e=A.useRef(),Se=A.useRef(),Ve=(...Ie)=>{ne(!0),V==null||V(...Ie)};if(!X)return null;const Oe=Object.assign({role:r,ref:U.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},B,{style:o,className:i,tabIndex:-1});let Re=E?E(Oe):S.jsx("div",Object.assign({},Oe,{children:A.cloneElement(s,{role:"document"})}));Re=_k(p,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:j,onExiting:F,onExited:Ve,onEnter:W,onEntering:Y,onEntered:L,children:Re});let Be=null;return a&&(Be=C({ref:U.setBackdropRef,onClick:pe}),Be=_k(m,v,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Be})),S.jsx(S.Fragment,{children:la.createPortal(S.jsxs(S.Fragment,{children:[Be,Re]}),X)})});kM.displayName="Modal";const NM=Object.assign(kM,{Manager:gb});function uae(e,t){return e.classList?e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function cae(e,t){e.classList?e.classList.add(t):uae(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var fae=Function.prototype.bind.call(Function.prototype.call,[].slice);function ts(e,t){return fae(e.querySelectorAll(t))}function wk(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function dae(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wk(e.className,t):e.setAttribute("class",wk(e.className&&e.className.baseVal||"",t))}const wl={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class OM extends gb{adjustAndStore(t,n,r){const i=n.style[t];n.dataset[t]=i,Eo(n,{[t]:`${parseFloat(Eo(n,t))+r}px`})}restore(t,n){const r=n.dataset[t];r!==void 0&&(delete n.dataset[t],Eo(n,{[t]:r}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(cae(n,"modal-open"),!t.scrollBarWidth)return;const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";ts(n,wl.FIXED_CONTENT).forEach(o=>this.adjustAndStore(r,o,t.scrollBarWidth)),ts(n,wl.STICKY_CONTENT).forEach(o=>this.adjustAndStore(i,o,-t.scrollBarWidth)),ts(n,wl.NAVBAR_TOGGLER).forEach(o=>this.adjustAndStore(i,o,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();dae(n,"modal-open");const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";ts(n,wl.FIXED_CONTENT).forEach(o=>this.restore(r,o)),ts(n,wl.STICKY_CONTENT).forEach(o=>this.restore(i,o)),ts(n,wl.NAVBAR_TOGGLER).forEach(o=>this.restore(i,o))}}let L0;function RM(e){return L0||(L0=new OM(e)),L0}const DM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Fe(t,"modal-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));DM.displayName="ModalBody";const yb=A.createContext({onHide(){}}),vb=A.forwardRef(({bsPrefix:e,className:t,contentClassName:n,centered:r,size:i,fullscreen:o,children:s,scrollable:a,...u},c)=>{e=Fe(e,"modal");const d=`${e}-dialog`,p=typeof o=="string"?`${e}-fullscreen-${o}`:`${e}-fullscreen`;return S.jsx("div",{...u,ref:c,className:Te(d,t,i&&`${e}-${i}`,r&&`${d}-centered`,a&&`${d}-scrollable`,o&&p),children:S.jsx("div",{className:Te(`${e}-content`,n),children:s})})});vb.displayName="ModalDialog";const LM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Fe(t,"modal-footer"),S.jsx(n,{ref:i,className:Te(e,t),...r})));LM.displayName="ModalFooter";const PM=A.forwardRef(({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:i,...o},s)=>{const a=A.useContext(yb),u=Ot(()=>{a==null||a.onHide(),r==null||r()});return S.jsxs("div",{ref:s,...o,children:[i,n&&S.jsx(fd,{"aria-label":e,variant:t,onClick:u})]})}),MM=A.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...i},o)=>(e=Fe(e,"modal-header"),S.jsx(PM,{ref:o,...i,className:Te(t,e),closeLabel:n,closeButton:r})));MM.displayName="ModalHeader";const pae=W1("h4"),$M=A.forwardRef(({className:e,bsPrefix:t,as:n=pae,...r},i)=>(t=Fe(t,"modal-title"),S.jsx(n,{ref:i,className:Te(e,t),...r})));$M.displayName="ModalTitle";function hae(e){return S.jsx(Da,{...e,timeout:null})}function mae(e){return S.jsx(Da,{...e,timeout:null})}const FM=A.forwardRef(({bsPrefix:e,className:t,style:n,dialogClassName:r,contentClassName:i,children:o,dialogAs:s=vb,"data-bs-theme":a,"aria-labelledby":u,"aria-describedby":c,"aria-label":d,show:p=!1,animation:h=!0,backdrop:m=!0,keyboard:v=!0,onEscapeKeyDown:x,onShow:b,onHide:y,container:_,autoFocus:E=!0,enforceFocus:C=!0,restoreFocus:T=!0,restoreFocusOptions:I,onEntered:O,onExit:M,onExiting:j,onEnter:V,onEntering:F,onExited:W,backdropClassName:Y,manager:L,...B},z)=>{const[X,U]=A.useState({}),[H,N]=A.useState(!1),Z=A.useRef(!1),ne=A.useRef(!1),R=A.useRef(null),[ee,ie]=AP(),se=Ga(z,ie),pe=Ot(y),ye=BO();e=Fe(e,"modal");const _e=A.useMemo(()=>({onHide:pe}),[pe]);function Se(){return L||RM({isRTL:ye})}function Ve(J){if(!Mu)return;const ce=Se().getScrollbarWidth()>0,Ce=J.scrollHeight>cd(J).documentElement.clientHeight;U({paddingRight:ce&&!Ce?vk():void 0,paddingLeft:!ce&&Ce?vk():void 0})}const Oe=Ot(()=>{ee&&Ve(ee.dialog)});hb(()=>{A_(window,"resize",Oe),R.current==null||R.current()});const Re=()=>{Z.current=!0},Be=J=>{Z.current&&ee&&J.target===ee.dialog&&(ne.current=!0),Z.current=!1},Ie=()=>{N(!0),R.current=RP(ee.dialog,()=>{N(!1)})},rt=J=>{J.target===J.currentTarget&&Ie()},Le=J=>{if(m==="static"){rt(J);return}if(ne.current||J.target!==J.currentTarget){ne.current=!1;return}y==null||y()},we=J=>{v?x==null||x(J):(J.preventDefault(),m==="static"&&Ie())},yt=(J,ce)=>{J&&Ve(J),V==null||V(J,ce)},pt=J=>{R.current==null||R.current(),M==null||M(J)},vt=(J,ce)=>{F==null||F(J,ce),q1(window,"resize",Oe)},Qt=J=>{J&&(J.style.display=""),W==null||W(J),A_(window,"resize",Oe)},an=A.useCallback(J=>S.jsx("div",{...J,className:Te(`${e}-backdrop`,Y,!h&&"show")}),[h,Y,e]),qt={...n,...X};qt.display="block";const Zt=J=>S.jsx("div",{role:"dialog",...J,style:qt,className:Te(t,e,H&&`${e}-static`,!h&&"show"),onClick:m?Le:void 0,onMouseUp:Be,"data-bs-theme":a,"aria-label":d,"aria-labelledby":u,"aria-describedby":c,children:S.jsx(s,{...B,onMouseDown:Re,className:r,contentClassName:i,children:o})});return S.jsx(yb.Provider,{value:_e,children:S.jsx(NM,{show:p,ref:se,backdrop:m,container:_,keyboard:!0,autoFocus:E,enforceFocus:C,restoreFocus:T,restoreFocusOptions:I,onEscapeKeyDown:we,onShow:b,onHide:y,onEnter:yt,onEntering:vt,onEntered:O,onExit:pt,onExiting:j,onExited:Qt,manager:Se(),transition:h?hae:void 0,backdropTransition:h?mae:void 0,renderBackdrop:an,renderDialog:Zt})})});FM.displayName="Modal";const ft=Object.assign(FM,{Body:DM,Header:MM,Title:$M,Footer:LM,Dialog:vb,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),BM=A.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=Fe(e,"row"),s=jw(),a=Vw(),u=`${o}-cols`,c=[];return s.forEach(d=>{const p=r[d];delete r[d];let h;p!=null&&typeof p=="object"?{cols:h}=p:h=p;const m=d!==a?`-${d}`:"";h!=null&&c.push(`${u}${m}-${h}`)}),S.jsx(n,{ref:i,...r,className:Te(t,o,...c)})});BM.displayName="Row";const Cg=A.createContext(null);Cg.displayName="InputGroupContext";const Ig=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Fe(t,"input-group-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));Ig.displayName="InputGroupText";const gae=e=>S.jsx(Ig,{children:S.jsx(hd,{type:"checkbox",...e})}),yae=e=>S.jsx(Ig,{children:S.jsx(hd,{type:"radio",...e})}),HM=A.forwardRef(({bsPrefix:e,size:t,hasValidation:n,className:r,as:i="div",...o},s)=>{e=Fe(e,"input-group");const a=A.useMemo(()=>({}),[]);return S.jsx(Cg.Provider,{value:a,children:S.jsx(i,{ref:s,...o,className:Te(r,e,t&&`${e}-${t}`,n&&"has-validation")})})});HM.displayName="InputGroup";const bk=Object.assign(HM,{Text:Ig,Radio:yae,Checkbox:gae});function zM({helpText:e,value:t,setValue:n,problem:r=""}){return S.jsxs(S.Fragment,{children:[S.jsxs(bk,{children:[S.jsx(wa.Control,{type:"text",className:`font-monospace ${r===""?"":"is-invalid"}`,autoFocus:!0,autoComplete:"off",value:t,onChange:i=>n(i.target.value),onFocus:i=>i.target.select()}),S.jsx(Du,{text:e,children:S.jsx(bk.Text,{children:S.jsx("i",{className:"bi bi-question-circle"})})})]}),S.jsx(bu,{className:"pt-2 small text-danger",source:r===""?" ":r})]})}function vae({id:e,data:t,showModal:n,setShowModal:r}){const[i,o]=A.useState(""),[s,a]=A.useState(""),{changeNodePayload:u}=Kr(),{language:c,getString:d}=sn();A.useEffect(()=>{n&&o(t.payload)},[n]),A.useEffect(()=>{const m=t.role,v=ud.match(`${m} ${i}`,"Command");if(v.failed()){const x=d("SyntaxError",{pos:v.getInterval().startIdx-m.length-1,expected:D1(v)});a(x)}else a("")},[i,c]);const p=m=>{m.preventDefault(),u(e,i.trim()),r(!1)},h=d(`BlockLabel_${t.role}`);return S.jsx(ft,{show:n,onHide:()=>r(!1),children:S.jsxs(wa,{onSubmit:p,children:[S.jsx(ft.Header,{closeButton:!0,children:S.jsx(ft.Title,{children:d(`BlockTitle_${t.role}`)})}),S.jsx(ft.Body,{children:S.jsxs(wa.Group,{as:BM,children:[h!==""&&S.jsx(wa.Label,{column:!0,className:"fw-bold fst-italic",md:"auto",children:h}),S.jsx(fb,{children:S.jsx(zM,{helpText:d(`BlockHelpText_${t.role}`),value:i,setValue:o,problem:s})})]})}),S.jsxs(ft.Footer,{children:[S.jsx(Dn,{variant:"secondary",onClick:()=>r(!1),children:d("Button_Cancel")}),S.jsx(Dn,{variant:"primary",type:"submit",children:d("Button_Save")})]})]})})}function xae({boxStyle:e,boxFilter:t,isSelected:n,isMouseHover:r,children:i}){function o(a){const u=oi.darker(a);return`repeating-linear-gradient( + 45deg, + ${a}, + ${a} 10px, + ${u} 10px, + ${u} 20px + )`}function s(){const a=e.backgroundColor,u=oi.darker(a);return n&&r?o(u):n?o(a):r?u:a}return S.jsx("div",{className:"text-center small fw-bold",style:{filter:t},children:S.jsx("div",{style:{lineHeight:"40px",color:e.textColor,background:s(),borderRadius:e.borderRadius,clipPath:e.clipPath},children:i})})}function Ek({variant:e,top:t,right:n,bottom:r,left:i,icon:o,visible:s,onClick:a}){return S.jsx(Dn,{variant:e,size:"sm",onClick:s?a:void 0,style:{position:"absolute",top:t,right:n,bottom:r,left:i,width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",opacity:s?1:0,transition:"visibility 0s, opacity 0.2s linear"},children:S.jsx("i",{className:`bi ${o}`})})}function _ae({nodeId:e,position:t}){const[,n]=A.useState(!1),{connectionSource:r,mouseOverNodeId:i}=Gr(),o=i===e&&r===e;return S.jsx(Na,{id:t,type:"target",position:t,isConnectableStart:!1,style:{display:"flex",width:"20px",height:"20px",borderRadius:"50%",border:0,backgroundColor:o?"rgba(0, 0, 0, 0.3)":"transparent"},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1)})}function wae({data:e}){const{getString:t}=sn(),{role:n,payload:r}=e,i=t(`BlockLabel_${n}`);switch(n){case Ne.Read:case Ne.Write:return S.jsxs("span",{children:[S.jsx("i",{children:i}),"  ",S.jsx("span",{className:`font-monospace ${r?"":"fst-italic"}`,children:r||t("Block_Empty")})]});case Ne.Start:case Ne.End:return S.jsx("span",{style:{position:"relative",top:"-2.5px"},children:S.jsx("i",{children:i})});case Ne.Assign:case Ne.Conditional:return S.jsx("span",{className:`font-monospace ${r?"":"fst-italic"}`,children:r||t("Block_Empty")})}}function bae({id:e,position:t,label:n,boxStyle:r}){const[i,o]=A.useState(!1);return S.jsx(Na,{id:e,type:"source",position:t,style:{display:"flex",width:"15px",height:"15px",lineHeight:"15px",fontSize:"10px",fontWeight:"bold",textAlign:"center",justifyContent:"center",alignItems:"center",color:r.textColor,borderColor:oi.darker(r.backgroundColor),backgroundColor:i?oi.darker(r.backgroundColor):r.backgroundColor},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:n})}function Eae({id:e}){return S.jsx(Na,{id:e,type:"target",position:te.Top,isConnectableStart:!1,isConnectable:!1,style:{backgroundColor:"transparent",borderColor:"transparent"}})}function Sae({id:e,data:t,selected:n}){const r=A.useRef(null),[i,o]=A.useState(0),[s,a]=A.useState(""),[u,c]=A.useState(!1),{isDraggingNode:d,connectionSource:p,connectionSourceHandle:h,mouseOverNodeId:m,setMouseOverNodeId:v}=Gr(),{deleteNode:x,addEdge:b}=Kr(),{machineState:y}=$s(),{language:_}=sn(),{getZoom:E}=Fa();A.useEffect(()=>{if(r.current!==null){const B=E(),z=r.current.getBoundingClientRect().width/B,X=Math.min(40+20*Math.ceil(z/20),480);o((X-z)/2)}},[_]);function C(B){return`drop-shadow(+1px 0 1px ${B}) + drop-shadow(-1px 0 1px ${B}) + drop-shadow(0 +1px 1px ${B}) + drop-shadow(0 -1px 1px ${B})`}A.useEffect(()=>{a(()=>m===e&&p!==null&&p!==e?C(At.green):ue.some(y.errors,{nodeId:e})?C(At.red):y.status==="ready"&&t.role===Ne.Start||e===y.curNodeId?C(At.gray800):"")},[y,m,p]);function T(){x(e),v(null)}function I(){v(null),c(!0)}function O(){v(e)}function M(){v(null)}function j(){p!==null&&p!==e&&b({source:p,target:e,sourceHandle:h,targetHandle:"in"})}const V=wP(t.role),F=xg(t.role),W=m===e,Y=W&&!d&&p===null,L=Y&&!ue.includes([Ne.Start,Ne.End],t.role);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{onMouseEnter:O,onMouseLeave:M,onMouseUp:j,style:{cursor:d?"grabbing":"grab"},children:[S.jsx(xae,{boxStyle:V,boxFilter:s,isSelected:n,isMouseHover:W,children:S.jsx(S.Fragment,{children:S.jsx("span",{className:"d-block text-truncate",ref:r,style:{minWidth:"40px",maxWidth:"392px",marginLeft:`${i}px`,marginRight:`${i}px`},children:S.jsx(wae,{data:t})})})}),S.jsx(Ek,{variant:"danger",top:-8,right:-8,icon:"bi-trash-fill",visible:Y,onClick:T}),S.jsx(Ek,{variant:"primary",bottom:-8,right:-8,icon:"bi-pencil-fill",visible:L,onClick:I}),S.jsx(Eae,{id:"in"}),ue.map(F,({id:B,label:z},X)=>S.jsx(bae,{id:B,position:t.handlePositions[B],label:z,boxStyle:V},X)),ue.map(ue.difference(ue.values(te),ue.values(t.handlePositions)),(B,z)=>S.jsx(_ae,{nodeId:e,position:B},z))]}),S.jsx(vae,{id:e,data:t,showModal:u,setShowModal:c})]})}function Cae(){const{flowchart:e,onNodesChange:t,onEdgesChange:n,addNode:r,moveHandle:i,savedViewport:o,setSavedViewport:s}=Kr(),{connectionSource:a,setIsDraggingNode:u,setConnectionSource:c,setConnectionSourceHandle:d}=Gr(),{getViewport:p,screenToFlowPosition:h}=Fa(),m=VK(),v=T=>T.source===T.target,x=T=>{T.preventDefault(),T.dataTransfer.dropEffect="move"},b=T=>{T.preventDefault();const I=T.dataTransfer.getData("application/text"),O=h({x:T.clientX,y:T.clientY});ue.includes(Ne,I)&&r(I,O)},y=(T,{nodeId:I,handleId:O})=>{d(O),c(I)},_=()=>{a!==null&&m(a),c(null),d(null)},E=A.useMemo(()=>({MyNode:Sae}),[]),C=A.useMemo(()=>({MyEdge:Pse}),[]);return S.jsxs(DD,{nodes:e.nodes,edges:e.edges,nodeTypes:E,edgeTypes:C,onNodesChange:t,onEdgesChange:n,defaultEdgeOptions:{type:"MyEdge"},isValidConnection:v,connectionLineComponent:Mse,onConnect:i,onConnectStart:y,onConnectEnd:_,onDragOver:x,onDrop:b,onMoveEnd:()=>s(p()),onNodeDragStart:()=>u(!0),onNodeDragStop:()=>u(!1),defaultViewport:o,multiSelectionKeyCode:"Control",selectionKeyCode:"Shift",deleteKeyCode:"Delete",disableKeyboardA11y:!0,snapToGrid:!0,snapGrid:[20,20],nodeOrigin:[.5,.5],children:[S.jsx("div",{className:"position-relative m-3",children:S.jsxs($a,{direction:"horizontal",gap:3,className:"justify-content-between align-items-start",children:[S.jsx(xte,{}),S.jsx(Sse,{})]})}),S.jsx(XK,{onZoomIn:()=>s(p()),onZoomOut:()=>s(p()),onFitView:()=>s(p())}),S.jsx(nq,{gap:20})]})}function $_(){return $_=Object.assign?Object.assign.bind():function(e){for(var t=1;t'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var Dae=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,s=n.mod,a=n.shift,u=n.ctrl,c=n.keys,d=t.key,p=t.code,h=t.ctrlKey,m=t.metaKey,v=t.shiftKey,x=t.altKey,b=us(p),y=d.toLowerCase();if(!(c!=null&&c.includes(b))&&!(c!=null&&c.includes(y))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(b))return!1;if(!r){if(i===!x&&y!=="alt"||a===!v&&y!=="shift")return!1;if(s){if(!m&&!h)return!1}else if(o===!m&&y!=="meta"&&y!=="os"||u===!h&&y!=="ctrl"&&y!=="control")return!1}return c&&c.length===1&&(c.includes(y)||c.includes(b))?!0:c?Tae(c):!c},Lae=A.createContext(void 0),Pae=function(){return A.useContext(Lae)};function GM(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&GM(e[r],t[r])},!0):e===t}var Mae=A.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),$ae=function(){return A.useContext(Mae)};function Fae(e){var t=A.useRef(void 0);return GM(t.current,e)||(t.current=e),t.current}var Sk=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Bae=typeof window<"u"?A.useLayoutEffect:A.useEffect;function Hae(e,t,n,r){var i=A.useState(null),o=i[0],s=i[1],a=A.useRef(!1),u=n instanceof Array?r instanceof Array?void 0:r:n,c=xb(e)?e.join(u==null?void 0:u.splitKey):e,d=n instanceof Array?n:r instanceof Array?r:void 0,p=A.useCallback(t,d??[]),h=A.useRef(p);d?h.current=p:h.current=t;var m=Fae(u),v=$ae(),x=v.enabledScopes,b=Pae();return Bae(function(){if(!((m==null?void 0:m.enabled)===!1||!Rae(x,m==null?void 0:m.scopes))){var y=function(I,O){var M;if(O===void 0&&(O=!1),!(Oae(I)&&!WM(I,m==null?void 0:m.enableOnFormTags))){if(o!==null){var j=o.getRootNode();if((j instanceof Document||j instanceof ShadowRoot)&&j.activeElement!==o&&!o.contains(j.activeElement)){Sk(I);return}}(M=I.target)!=null&&M.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||P0(c,m==null?void 0:m.splitKey).forEach(function(V){var F,W=M0(V,m==null?void 0:m.combinationKey);if(Dae(I,W,m==null?void 0:m.ignoreModifiers)||(F=W.keys)!=null&&F.includes("*")){if(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I)||O&&a.current)return;if(kae(I,W,m==null?void 0:m.preventDefault),!Nae(I,W,m==null?void 0:m.enabled)){Sk(I);return}h.current(I,W),O||(a.current=!0)}})}},_=function(I){I.key!==void 0&&(VM(us(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&y(I))},E=function(I){I.key!==void 0&&(UM(us(I.code)),a.current=!1,m!=null&&m.keyup&&y(I,!0))},C=o||(u==null?void 0:u.document)||document;return C.addEventListener("keyup",E),C.addEventListener("keydown",_),b&&P0(c,m==null?void 0:m.splitKey).forEach(function(T){return b.addHotkey(M0(T,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){C.removeEventListener("keyup",E),C.removeEventListener("keydown",_),b&&P0(c,m==null?void 0:m.splitKey).forEach(function(T){return b.removeHotkey(M0(T,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[o,c,m,x]),s}function zae(){const{refInput:e}=Gr(),{machineState:t,executeAction:n}=$s();for(const{actionId:r,hotkey:i,enabledStatuses:o}of VL)Hae(i,()=>{var s;i==="F8"&&((s=e.current)==null||s.focus()),o.includes(t.status)&&n(r)},{enableOnFormTags:["INPUT","TEXTAREA"],preventDefault:!0});return S.jsx(S.Fragment,{})}const bm=A.createContext(null),Ck=(e,t=null)=>e!=null?String(e):t||null,KM=A.forwardRef(({bsPrefix:e,className:t,as:n,...r},i)=>{e=Fe(e,"navbar-brand");const o=n||(r.href?"a":"span");return S.jsx(o,{...r,ref:i,className:Te(t,e)})});KM.displayName="NavbarBrand";function Oc(...e){return e.filter(t=>t!=null).reduce((t,n)=>{if(typeof n!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?n:function(...i){t.apply(this,i),n.apply(this,i)}},null)}const jae={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Vae(e,t){const n=`offset${e[0].toUpperCase()}${e.slice(1)}`,r=t[n],i=jae[e];return r+parseInt(Eo(t,i[0]),10)+parseInt(Eo(t,i[1]),10)}const Uae={[es]:"collapse",[wu]:"collapsing",[si]:"collapsing",[go]:"collapse show"},Wae=Q.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,className:o,children:s,dimension:a="height",in:u=!1,timeout:c=300,mountOnEnter:d=!1,unmountOnExit:p=!1,appear:h=!1,getDimensionValue:m=Vae,...v},x)=>{const b=typeof a=="function"?a():a,y=A.useMemo(()=>Oc(I=>{I.style[b]="0"},e),[b,e]),_=A.useMemo(()=>Oc(I=>{const O=`scroll${b[0].toUpperCase()}${b.slice(1)}`;I.style[b]=`${I[O]}px`},t),[b,t]),E=A.useMemo(()=>Oc(I=>{I.style[b]=null},n),[b,n]),C=A.useMemo(()=>Oc(I=>{I.style[b]=`${m(b,I)}px`,DP(I)},r),[r,m,b]),T=A.useMemo(()=>Oc(I=>{I.style[b]=null},i),[b,i]);return S.jsx(X1,{ref:x,addEndListener:Y1,...v,"aria-expanded":v.role?u:null,onEnter:y,onEntering:_,onEntered:E,onExit:C,onExiting:T,childRef:s.ref,in:u,timeout:c,mountOnEnter:d,unmountOnExit:p,appear:h,children:(I,O)=>Q.cloneElement(s,{...O,className:Te(o,s.props.className,Uae[I],b==="width"&&"collapse-horizontal")})})}),Bu=A.createContext(null);Bu.displayName="NavbarContext";const qM=A.forwardRef(({children:e,bsPrefix:t,...n},r)=>{t=Fe(t,"navbar-collapse");const i=A.useContext(Bu);return S.jsx(Wae,{in:!!(i&&i.expanded),...n,children:S.jsx("div",{ref:r,className:t,children:e})})});qM.displayName="NavbarCollapse";const YM=A.forwardRef(({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:i="button",onClick:o,...s},a)=>{e=Fe(e,"navbar-toggler");const{onToggle:u,expanded:c}=A.useContext(Bu)||{},d=Ot(p=>{o&&o(p),u&&u()});return i==="button"&&(s.type="button"),S.jsx(i,{...s,ref:a,onClick:d,"aria-label":r,className:Te(t,e,!c&&"collapsed"),children:n||S.jsx("span",{className:`${e}-icon`})})});YM.displayName="NavbarToggle";const F_=new WeakMap,Ik=(e,t)=>{if(!e||!t)return;const n=F_.get(t)||new Map;F_.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function Gae(e,t=typeof window>"u"?void 0:window){const n=Ik(e,t),[r,i]=A.useState(()=>n?n.matches:!1);return mm(()=>{let o=Ik(e,t);if(!o)return i(!1);let s=F_.get(t);const a=()=>{i(o.matches)};return o.refCount++,o.addListener(a),a(),()=>{o.removeListener(a),o.refCount--,o.refCount<=0&&(s==null||s.delete(o.media)),o=void 0}},[e]),r}function Kae(e){const t=Object.keys(e);function n(a,u){return a===u?u:a?`${a} and ${u}`:u}function r(a){return t[Math.min(t.indexOf(a)+1,t.length-1)]}function i(a){const u=r(a);let c=e[u];return typeof c=="number"?c=`${c-.2}px`:c=`calc(${c} - 0.2px)`,`(max-width: ${c})`}function o(a){let u=e[a];return typeof u=="number"&&(u=`${u}px`),`(min-width: ${u})`}function s(a,u,c){let d;typeof a=="object"?(d=a,c=u,u=!0):(u=u||!0,d={[a]:u});let p=A.useMemo(()=>Object.entries(d).reduce((h,[m,v])=>((v==="up"||v===!0)&&(h=n(h,o(m))),(v==="down"||v===!0)&&(h=n(h,i(m))),h),""),[JSON.stringify(d)]);return Gae(p,c)}return s}const qae=Kae({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),XM=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Fe(t,"offcanvas-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));XM.displayName="OffcanvasBody";const Yae={[si]:"show",[go]:"show"},QM=A.forwardRef(({bsPrefix:e,className:t,children:n,in:r=!1,mountOnEnter:i=!1,unmountOnExit:o=!1,appear:s=!1,...a},u)=>(e=Fe(e,"offcanvas"),S.jsx(X1,{ref:u,addEndListener:Y1,in:r,mountOnEnter:i,unmountOnExit:o,appear:s,...a,childRef:n.ref,children:(c,d)=>A.cloneElement(n,{...d,className:Te(t,n.props.className,(c===si||c===wu)&&`${e}-toggling`,Yae[c])})})));QM.displayName="OffcanvasToggling";const ZM=A.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...i},o)=>(e=Fe(e,"offcanvas-header"),S.jsx(PM,{ref:o,...i,className:Te(t,e),closeLabel:n,closeButton:r})));ZM.displayName="OffcanvasHeader";const Xae=W1("h5"),JM=A.forwardRef(({className:e,bsPrefix:t,as:n=Xae,...r},i)=>(t=Fe(t,"offcanvas-title"),S.jsx(n,{ref:i,className:Te(e,t),...r})));JM.displayName="OffcanvasTitle";function Qae(e){return S.jsx(QM,{...e})}function Zae(e){return S.jsx(Da,{...e})}const e$=A.forwardRef(({bsPrefix:e,className:t,children:n,"aria-labelledby":r,placement:i="start",responsive:o,show:s=!1,backdrop:a=!0,keyboard:u=!0,scroll:c=!1,onEscapeKeyDown:d,onShow:p,onHide:h,container:m,autoFocus:v=!0,enforceFocus:x=!0,restoreFocus:b=!0,restoreFocusOptions:y,onEntered:_,onExit:E,onExiting:C,onEnter:T,onEntering:I,onExited:O,backdropClassName:M,manager:j,renderStaticNode:V=!1,...F},W)=>{const Y=A.useRef();e=Fe(e,"offcanvas");const[L,B]=A.useState(!1),z=Ot(h),X=qae(o||"xs","up");A.useEffect(()=>{B(o?s&&!X:s)},[s,o,X]);const U=A.useMemo(()=>({onHide:z}),[z]);function H(){return j||(c?(Y.current||(Y.current=new OM({handleContainerOverflow:!1})),Y.current):RM())}const N=(ee,...ie)=>{ee&&(ee.style.visibility="visible"),T==null||T(ee,...ie)},Z=(ee,...ie)=>{ee&&(ee.style.visibility=""),O==null||O(...ie)},ne=A.useCallback(ee=>S.jsx("div",{...ee,className:Te(`${e}-backdrop`,M)}),[M,e]),R=ee=>S.jsx("div",{...ee,...F,className:Te(t,o?`${e}-${o}`:e,`${e}-${i}`),"aria-labelledby":r,children:n});return S.jsxs(S.Fragment,{children:[!L&&(o||V)&&R({}),S.jsx(yb.Provider,{value:U,children:S.jsx(NM,{show:L,ref:W,backdrop:a,container:m,keyboard:u,autoFocus:v,enforceFocus:x&&!c,restoreFocus:b,restoreFocusOptions:y,onEscapeKeyDown:d,onShow:p,onHide:z,onEnter:N,onEntering:I,onEntered:_,onExit:E,onExiting:C,onExited:Z,manager:H(),transition:Qae,backdropTransition:Zae,renderBackdrop:ne,renderDialog:R})})]})});e$.displayName="Offcanvas";const Jae=Object.assign(e$,{Body:XM,Header:ZM,Title:JM}),t$=A.forwardRef(({onHide:e,...t},n)=>{const r=A.useContext(Bu),i=Ot(()=>{r==null||r.onToggle==null||r.onToggle(),e==null||e()});return S.jsx(Jae,{ref:n,show:!!(r!=null&&r.expanded),...t,renderStaticNode:!0,onHide:i})});t$.displayName="NavbarOffcanvas";const n$=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Fe(t,"navbar-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));n$.displayName="NavbarText";const r$=A.forwardRef((e,t)=>{const{bsPrefix:n,expand:r=!0,variant:i="light",bg:o,fixed:s,sticky:a,className:u,as:c="nav",expanded:d,onToggle:p,onSelect:h,collapseOnSelect:m=!1,...v}=U1(e,{expanded:"onToggle"}),x=Fe(n,"navbar"),b=A.useCallback((...E)=>{h==null||h(...E),m&&d&&(p==null||p(!1))},[h,m,d,p]);v.role===void 0&&c!=="nav"&&(v.role="navigation");let y=`${x}-expand`;typeof r=="string"&&(y=`${y}-${r}`);const _=A.useMemo(()=>({onToggle:()=>p==null?void 0:p(!d),bsPrefix:x,expanded:!!d,expand:r}),[x,d,r,p]);return S.jsx(Bu.Provider,{value:_,children:S.jsx(bm.Provider,{value:b,children:S.jsx(c,{ref:t,...v,className:Te(u,x,r&&y,i&&`${x}-${i}`,o&&`bg-${o}`,a&&`sticky-${a}`,s&&`fixed-${s}`)})})})});r$.displayName="Navbar";const i$=Object.assign(r$,{Brand:KM,Collapse:qM,Offcanvas:t$,Text:n$,Toggle:YM});pr.string,pr.bool,pr.bool,pr.bool,pr.bool;const _b=A.forwardRef(({bsPrefix:e,className:t,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...s},a)=>(e=Fe(e,"img"),S.jsx("img",{ref:a,...s,className:Te(t,n&&`${e}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${e}-thumbnail`)})));_b.displayName="Image";const o$=""+new URL("../FluxoLab.svg",import.meta.url).href;function ele(){return S.jsxs($a,{direction:"horizontal",className:"flex-fill",gap:2,children:[S.jsx(_b,{src:o$,alt:"Logo",width:"24",height:"24"}),S.jsx(i$.Brand,{children:"FluxoLab"})]})}function tle(e,t,n){const r=A.useRef(e!==void 0),[i,o]=A.useState(t),s=e!==void 0,a=r.current;return r.current=s,!s&&a&&i!==t&&o(t),[s?e:i,A.useCallback((...u)=>{const[c,...d]=u;let p=n==null?void 0:n(c,...d);return o(c),p},[n])]}function nle(){const[,e]=A.useReducer(t=>!t,!1);return e}const Ag=A.createContext(null);var Ak=Object.prototype.hasOwnProperty;function Tk(e,t,n){for(n of e.keys())if(lf(n,t))return n}function lf(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&lf(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Tk(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Tk(t,i),!i)||!lf(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ak.call(e,n)&&++r&&!Ak.call(t,n)||!(n in t)||!lf(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function rle(e){const t=G1();return[e[0],A.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}const ile=rd({defaultModifiers:[S1,fg,ug,cg,C1,E1,I1,x1]}),ole=["enabled","placement","strategy","modifiers"];function sle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const ale={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},lle={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const r=(t.getAttribute("aria-describedby")||"").split(",").filter(i=>i.trim()!==n.id);r.length?t.setAttribute("aria-describedby",r.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,i=(t=n.getAttribute("role"))==null?void 0:t.toLowerCase();if(n.id&&i==="tooltip"&&"setAttribute"in r){const o=r.getAttribute("aria-describedby");if(o&&o.split(",").indexOf(n.id)!==-1)return;r.setAttribute("aria-describedby",o?`${o},${n.id}`:n.id)}}},ule=[];function cle(e,t,n={}){let{enabled:r=!0,placement:i="bottom",strategy:o="absolute",modifiers:s=ule}=n,a=sle(n,ole);const u=A.useRef(s),c=A.useRef(),d=A.useCallback(()=>{var b;(b=c.current)==null||b.update()},[]),p=A.useCallback(()=>{var b;(b=c.current)==null||b.forceUpdate()},[]),[h,m]=rle(A.useState({placement:i,update:d,forceUpdate:p,attributes:{},styles:{popper:{},arrow:{}}})),v=A.useMemo(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:b})=>{const y={},_={};Object.keys(b.elements).forEach(E=>{y[E]=b.styles[E],_[E]=b.attributes[E]}),m({state:b,styles:y,attributes:_,update:d,forceUpdate:p,placement:b.placement})}}),[d,p,m]),x=A.useMemo(()=>(lf(u.current,s)||(u.current=s),u.current),[s]);return A.useEffect(()=>{!c.current||!r||c.current.setOptions({placement:i,strategy:o,modifiers:[...x,v,ale]})},[o,i,v,r,x]),A.useEffect(()=>{if(!(!r||e==null||t==null))return c.current=ile(e,t,Object.assign({},a,{placement:i,strategy:o,modifiers:[...x,lle,v]})),()=>{c.current!=null&&(c.current.destroy(),c.current=void 0,m(b=>Object.assign({},b,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),h}const kk=()=>{};function fle(e){return e.button===0}function dle(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const $0=e=>e&&("current"in e?e.current:e),Nk={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function ple(e,t=kk,{disabled:n,clickTrigger:r="click"}={}){const i=A.useRef(!1),o=A.useRef(!1),s=A.useCallback(c=>{const d=$0(e);jse(!!d,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),i.current=!d||dle(c)||!fle(c)||!!wm(d,c.target)||o.current,o.current=!1},[e]),a=Ot(c=>{const d=$0(e);d&&wm(d,c.target)&&(o.current=!0)}),u=Ot(c=>{i.current||t(c)});A.useEffect(()=>{var c,d;if(n||e==null)return;const p=cd($0(e)),h=p.defaultView||window;let m=(c=h.event)!=null?c:(d=h.parent)==null?void 0:d.event,v=null;Nk[r]&&(v=ls(p,Nk[r],a,!0));const x=ls(p,r,s,!0),b=ls(p,r,_=>{if(_===m){m=void 0;return}u(_)});let y=[];return"ontouchstart"in p.documentElement&&(y=[].slice.call(p.body.children).map(_=>ls(_,"mousemove",kk))),()=>{v==null||v(),x(),b(),y.forEach(_=>_())}},[e,n,r,s,a,u])}function hle(e){const t={};return Array.isArray(e)?(e==null||e.forEach(n=>{t[n.name]=n}),t):e||t}function mle(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}function gle({enabled:e,enableEvents:t,placement:n,flip:r,offset:i,fixed:o,containerPadding:s,arrowElement:a,popperConfig:u={}}){var c,d,p,h,m;const v=hle(u.modifiers);return Object.assign({},u,{placement:n,enabled:e,strategy:o?"fixed":u.strategy,modifiers:mle(Object.assign({},v,{eventListeners:{enabled:t,options:(c=v.eventListeners)==null?void 0:c.options},preventOverflow:Object.assign({},v.preventOverflow,{options:s?Object.assign({padding:s},(d=v.preventOverflow)==null?void 0:d.options):(p=v.preventOverflow)==null?void 0:p.options}),offset:{options:Object.assign({offset:i},(h=v.offset)==null?void 0:h.options)},arrow:Object.assign({},v.arrow,{enabled:!!a,options:Object.assign({},(m=v.arrow)==null?void 0:m.options,{element:a})}),flip:Object.assign({enabled:!!r},v.flip)}))})}const yle=["children","usePopper"];function vle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const xle=()=>{};function s$(e={}){const t=A.useContext(Ag),[n,r]=AP(),i=A.useRef(!1),{flip:o,offset:s,rootCloseEvent:a,fixed:u=!1,placement:c,popperConfig:d={},enableEventListeners:p=!0,usePopper:h=!!t}=e,m=(t==null?void 0:t.show)==null?!!e.show:t.show;m&&!i.current&&(i.current=!0);const v=I=>{t==null||t.toggle(!1,I)},{placement:x,setMenu:b,menuElement:y,toggleElement:_}=t||{},E=cle(_,y,gle({placement:c||x||"bottom-start",enabled:h,enableEvents:p??m,offset:s,flip:o,fixed:u,arrowElement:n,popperConfig:d})),C=Object.assign({ref:b||xle,"aria-labelledby":_==null?void 0:_.id},E.attributes.popper,{style:E.styles.popper}),T={show:m,placement:x,hasShown:i.current,toggle:t==null?void 0:t.toggle,popper:h?E:null,arrowProps:h?Object.assign({ref:r},E.attributes.arrow,{style:E.styles.arrow}):{}};return ple(y,v,{clickTrigger:a,disabled:!m}),[C,T]}function a$(e){let{children:t,usePopper:n=!0}=e,r=vle(e,yle);const[i,o]=s$(Object.assign({},r,{usePopper:n}));return S.jsx(S.Fragment,{children:t(i,o)})}a$.displayName="DropdownMenu";const Em={prefix:String(Math.round(Math.random()*1e10)),current:0},l$=Q.createContext(Em),_le=Q.createContext(!1);let wle=!!(typeof window<"u"&&window.document&&window.document.createElement),F0=new WeakMap;function ble(e=!1){let t=A.useContext(l$),n=A.useRef(null);if(n.current===null&&!e){var r,i;let o=(i=Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(o){let s=F0.get(o);s==null?F0.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==s.state&&(t.current=s.id,F0.delete(o))}n.current=++t.current}return n.current}function Ele(e){let t=A.useContext(l$);t===Em&&!wle&&console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=ble(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function Sle(e){let t=Q.useId(),[n]=A.useState(kle()),r=n?"react-aria":`react-aria${Em.prefix}`;return e||`${r}-${t}`}const Cle=typeof Q.useId=="function"?Sle:Ele;function Ile(){return!1}function Ale(){return!0}function Tle(e){return()=>{}}function kle(){return typeof Q.useSyncExternalStore=="function"?Q.useSyncExternalStore(Tle,Ile,Ale):A.useContext(_le)}const u$=e=>{var t;return((t=e.getAttribute("role"))==null?void 0:t.toLowerCase())==="menu"},Ok=()=>{};function c$(){const e=Cle(),{show:t=!1,toggle:n=Ok,setToggle:r,menuElement:i}=A.useContext(Ag)||{},o=A.useCallback(a=>{n(!t,a)},[t,n]),s={id:e,ref:r||Ok,onClick:o,"aria-expanded":!!t};return i&&u$(i)&&(s["aria-haspopup"]=!0),[s,{show:t,toggle:n}]}function f$({children:e}){const[t,n]=c$();return S.jsx(S.Fragment,{children:e(t,n)})}f$.displayName="DropdownToggle";const d$=A.createContext(null);d$.displayName="NavContext";const Nle=["eventKey","disabled","onClick","active","as"];function Ole(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function p$({key:e,href:t,active:n,disabled:r,onClick:i}){const o=A.useContext(bm),s=A.useContext(d$),{activeKey:a}=s||{},u=Ck(e,t),c=n==null&&e!=null?Ck(a)===u:n;return[{onClick:Ot(p=>{r||(i==null||i(p),o&&!p.isPropagationStopped()&&o(u,p))}),"aria-disabled":r||void 0,"aria-selected":c,[mb("dropdown-item")]:""},{isActive:c}]}const h$=A.forwardRef((e,t)=>{let{eventKey:n,disabled:r,onClick:i,active:o,as:s=MD}=e,a=Ole(e,Nle);const[u]=p$({key:n,href:a.href,disabled:r,onClick:i,active:o});return S.jsx(s,Object.assign({},a,{ref:t},u))});h$.displayName="DropdownItem";function Rk(){const e=nle(),t=A.useRef(null),n=A.useCallback(r=>{t.current=r,e()},[e]);return[t,n]}function md({defaultShow:e,show:t,onSelect:n,onToggle:r,itemSelector:i=`* [${mb("dropdown-item")}]`,focusFirstItemOnShow:o,placement:s="bottom-start",children:a}){const u=Sg(),[c,d]=tle(t,e,r),[p,h]=Rk(),m=p.current,[v,x]=Rk(),b=v.current,y=TP(c),_=A.useRef(null),E=A.useRef(!1),C=A.useContext(bm),T=A.useCallback((F,W,Y=W==null?void 0:W.type)=>{d(F,{originalEvent:W,source:Y})},[d]),I=Ot((F,W)=>{n==null||n(F,W),T(!1,W,"select"),W.isPropagationStopped()||C==null||C(F,W)}),O=A.useMemo(()=>({toggle:T,placement:s,show:c,menuElement:m,toggleElement:b,setMenu:h,setToggle:x}),[T,s,c,m,b,h,x]);m&&y&&!c&&(E.current=m.contains(m.ownerDocument.activeElement));const M=Ot(()=>{b&&b.focus&&b.focus()}),j=Ot(()=>{const F=_.current;let W=o;if(W==null&&(W=p.current&&u$(p.current)?"keyboard":!1),W===!1||W==="keyboard"&&!/^key.+$/.test(F))return;const Y=ts(p.current,i)[0];Y&&Y.focus&&Y.focus()});A.useEffect(()=>{c?j():E.current&&(E.current=!1,M())},[c,E,M,j]),A.useEffect(()=>{_.current=null});const V=(F,W)=>{if(!p.current)return null;const Y=ts(p.current,i);let L=Y.indexOf(F)+W;return L=Math.max(0,Math.min(L,Y.length)),Y[L]};return Cte(A.useCallback(()=>u.document,[u]),"keydown",F=>{var W,Y;const{key:L}=F,B=F.target,z=(W=p.current)==null?void 0:W.contains(B),X=(Y=v.current)==null?void 0:Y.contains(B);if(/input|textarea/i.test(B.tagName)&&(L===" "||L!=="Escape"&&z||L==="Escape"&&B.type==="search")||!z&&!X||L==="Tab"&&(!p.current||!c))return;_.current=F.type;const H={originalEvent:F,source:F.type};switch(L){case"ArrowUp":{const N=V(B,-1);N&&N.focus&&N.focus(),F.preventDefault();return}case"ArrowDown":if(F.preventDefault(),!c)d(!0,H);else{const N=V(B,1);N&&N.focus&&N.focus()}return;case"Tab":q1(B.ownerDocument,"keyup",N=>{var Z;(N.key==="Tab"&&!N.target||!((Z=p.current)!=null&&Z.contains(N.target)))&&d(!1,H)},{once:!0});break;case"Escape":L==="Escape"&&(F.preventDefault(),F.stopPropagation()),d(!1,H);break}}),S.jsx(bm.Provider,{value:I,children:S.jsx(Ag.Provider,{value:O,children:a})})}md.displayName="Dropdown";md.Menu=a$;md.Toggle=f$;md.Item=h$;const wb=A.createContext({});wb.displayName="DropdownContext";const m$=A.forwardRef(({className:e,bsPrefix:t,as:n="hr",role:r="separator",...i},o)=>(t=Fe(t,"dropdown-divider"),S.jsx(n,{ref:o,className:Te(e,t),role:r,...i})));m$.displayName="DropdownDivider";const g$=A.forwardRef(({className:e,bsPrefix:t,as:n="div",role:r="heading",...i},o)=>(t=Fe(t,"dropdown-header"),S.jsx(n,{ref:o,className:Te(e,t),role:r,...i})));g$.displayName="DropdownHeader";const y$=A.forwardRef(({bsPrefix:e,className:t,eventKey:n,disabled:r=!1,onClick:i,active:o,as:s=K1,...a},u)=>{const c=Fe(e,"dropdown-item"),[d,p]=p$({key:n,href:a.href,disabled:r,onClick:i,active:o});return S.jsx(s,{...a,...d,ref:u,className:Te(t,c,p.isActive&&"active",r&&"disabled")})});y$.displayName="DropdownItem";const v$=A.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=Fe(t,"dropdown-item-text"),S.jsx(n,{ref:i,className:Te(e,t),...r})));v$.displayName="DropdownItemText";function x$(e,t){return e}function _$(e,t,n){const r=n?"top-end":"top-start",i=n?"top-start":"top-end",o=n?"bottom-end":"bottom-start",s=n?"bottom-start":"bottom-end",a=n?"right-start":"left-start",u=n?"right-end":"left-end",c=n?"left-start":"right-start",d=n?"left-end":"right-end";let p=e?s:o;return t==="up"?p=e?i:r:t==="end"?p=e?d:c:t==="start"?p=e?u:a:t==="down-centered"?p="bottom":t==="up-centered"&&(p="top"),p}const w$=A.forwardRef(({bsPrefix:e,className:t,align:n,rootCloseEvent:r,flip:i=!0,show:o,renderOnMount:s,as:a="div",popperConfig:u,variant:c,...d},p)=>{let h=!1;const m=A.useContext(Bu),v=Fe(e,"dropdown-menu"),{align:x,drop:b,isRTL:y}=A.useContext(wb);n=n||x;const _=A.useContext(Cg),E=[];if(n)if(typeof n=="object"){const F=Object.keys(n);if(F.length){const W=F[0],Y=n[W];h=Y==="start",E.push(`${v}-${W}-${Y}`)}}else n==="end"&&(h=!0);const C=_$(h,b,y),[T,{hasShown:I,popper:O,show:M,toggle:j}]=s$({flip:i,rootCloseEvent:r,show:o,usePopper:!m&&E.length===0,offset:[0,2],popperConfig:u,placement:C});if(T.ref=Ga(x$(p),T.ref),mm(()=>{M&&(O==null||O.update())},[M]),!I&&!s&&!_)return null;typeof a!="string"&&(T.show=M,T.close=()=>j==null?void 0:j(!1),T.align=n);let V=d.style;return O!=null&&O.placement&&(V={...d.style,...T.style},d["x-placement"]=O.placement),S.jsx(a,{...d,...T,style:V,...(E.length||m)&&{"data-bs-popper":"static"},className:Te(t,v,M&&"show",h&&`${v}-end`,c&&`${v}-${c}`,...E)})});w$.displayName="DropdownMenu";const b$=A.forwardRef(({bsPrefix:e,split:t,className:n,childBsPrefix:r,as:i=Dn,...o},s)=>{const a=Fe(e,"dropdown-toggle"),u=A.useContext(Ag);r!==void 0&&(o.bsPrefix=r);const[c]=c$();return c.ref=Ga(c.ref,x$(s)),S.jsx(i,{className:Te(n,a,t&&`${a}-split`,(u==null?void 0:u.show)&&"show"),...c,...o})});b$.displayName="DropdownToggle";const E$=A.forwardRef((e,t)=>{const{bsPrefix:n,drop:r="down",show:i,className:o,align:s="start",onSelect:a,onToggle:u,focusFirstItemOnShow:c,as:d="div",navbar:p,autoClose:h=!0,...m}=U1(e,{show:"onToggle"}),v=A.useContext(Cg),x=Fe(n,"dropdown"),b=BO(),y=O=>h===!1?O==="click":h==="inside"?O!=="rootClose":h==="outside"?O!=="select":!0,_=Ot((O,M)=>{var j;!((j=M.originalEvent)==null||(j=j.target)==null)&&j.classList.contains("dropdown-toggle")&&M.source==="mousedown"||(M.originalEvent.currentTarget===document&&(M.source!=="keydown"||M.originalEvent.key==="Escape")&&(M.source="rootClose"),y(M.source)&&(u==null||u(O,M)))}),C=_$(s==="end",r,b),T=A.useMemo(()=>({align:s,drop:r,isRTL:b}),[s,r,b]),I={down:x,"down-centered":`${x}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return S.jsx(wb.Provider,{value:T,children:S.jsx(md,{placement:C,show:i,onSelect:a,onToggle:_,focusFirstItemOnShow:c,itemSelector:`.${x}-item:not(.disabled):not(:disabled)`,children:v?m.children:S.jsx(d,{...m,ref:t,className:Te(o,i&&"show",I[r])})})})});E$.displayName="Dropdown";const Wn=Object.assign(E$,{Toggle:b$,Menu:w$,Item:y$,ItemText:v$,Divider:m$,Header:g$});var bb={exports:{}};bb.exports;(function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function s(u,c){if(!o[u]){o[u]={};for(var d=0;d>>8,d[p*2+1]=m%256}return d},decompressFromUint8Array:function(u){if(u==null)return a.decompress(u);for(var c=new Array(u.length/2),d=0,p=c.length;d>1}else{for(h=1,p=0;p>1}_--,_==0&&(_=Math.pow(2,C),C++),delete v[y]}else for(h=m[y],p=0;p>1;_--,_==0&&(_=Math.pow(2,C),C++),m[b]=E++,y=String(x)}if(y!==""){if(Object.prototype.hasOwnProperty.call(v,y)){if(y.charCodeAt(0)<256){for(p=0;p>1}else{for(h=1,p=0;p>1}_--,_==0&&(_=Math.pow(2,C),C++),delete v[y]}else for(h=m[y],p=0;p>1;_--,_==0&&(_=Math.pow(2,C),C++)}for(h=2,p=0;p>1;for(;;)if(I=I<<1,O==c-1){T.push(d(I));break}else O++;return T.join("")},decompress:function(u){return u==null?"":u==""?null:a._decompress(u.length,32768,function(c){return u.charCodeAt(c)})},_decompress:function(u,c,d){var p=[],h=4,m=4,v=3,x="",b=[],y,_,E,C,T,I,O,M={val:d(0),position:c,index:1};for(y=0;y<3;y+=1)p[y]=y;for(E=0,T=Math.pow(2,2),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;switch(E){case 0:for(E=0,T=Math.pow(2,8),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;O=n(E);break;case 1:for(E=0,T=Math.pow(2,16),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;O=n(E);break;case 2:return""}for(p[3]=O,_=O,b.push(O);;){if(M.index>u)return"";for(E=0,T=Math.pow(2,v),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;switch(O=E){case 0:for(E=0,T=Math.pow(2,8),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;p[m++]=n(E),O=m-1,h--;break;case 1:for(E=0,T=Math.pow(2,16),I=1;I!=T;)C=M.val&M.position,M.position>>=1,M.position==0&&(M.position=c,M.val=d(M.index++)),E|=(C>0?1:0)*I,I<<=1;p[m++]=n(E),O=m-1,h--;break;case 2:return b.join("")}if(h==0&&(h=Math.pow(2,v),v++),p[O])x=p[O];else if(O===m)x=_+_.charAt(0);else return null;b.push(x),p[m++]=_+x.charAt(0),h--,_=x,h==0&&(h=Math.pow(2,v),v++)}}};return a}();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(bb);var S$=bb.exports;const bh=["number","string","boolean","start","read","write","assign","conditional","end","in","out","true","false"],B0=ue.fromPairs(ue.map(bh,(e,t)=>[e,t]));function Rle(e){const{title:t,variables:n,nodes:r,edges:i}=e,o=ue.map(r,a=>({id:a.id,role:a.data.role,position:a.position,payload:a.data.payload,handlePositions:a.data.handlePositions})),s=ue.map(i,({source:a,target:u,sourceHandle:c})=>({source:a,target:u,sourceHandle:c}));return{title:t,variables:n,nodes:o,edges:s}}function Dle(e){const{title:t,variables:n,nodes:r,edges:i}=e;return[t,ue.map(n,o=>[o.id,B0[o.type]]),ue.map(r,o=>[parseInt(o.id),B0[o.role],o.position.x,o.position.y,o.payload,ue.values(o.handlePositions)]),ue.map(i,o=>[parseInt(o.source),B0[o.sourceHandle],parseInt(o.target)])]}function Lle(e){const[t,n,r,i]=e,o=ue.map(n,([s,a])=>({id:s,type:bh[a]}));return{title:t,variables:o,nodes:ue.map(r,([s,a,u,c,d,p])=>{const h=s.toString(),m=bh[a],v={x:u,y:c},x=xg(m),b=p===void 0,y=ue.fromPairs(ue.map(x,({id:_,position:E},C)=>[_,b?E:p[C]]));return{id:h,role:m,position:v,payload:d,handlePositions:y}}),edges:ue.map(i,([s,a,u])=>({source:s.toString(),sourceHandle:bh[a],target:u.toString()}))}}const Ple=ue.flow(Rle,Dle,JSON.stringify,S$.compressToEncodedURIComponent),Mle=ue.flow(S$.decompressFromEncodedURIComponent,JSON.parse,Lle);function $le({showModal:e,setShowModal:t}){const{clearFlowchart:n}=Kr(),{triggerToast:r}=Gr(),{getString:i}=sn(),{setViewport:o}=Fa(),s=()=>{t(!1)},a=()=>{n(),o({x:0,y:0,zoom:1}),t(!1),r({background:"success",icon:"bi-recycle",message:i("ToastMessage_FlowchartCleared")})};return S.jsxs(ft,{show:e,onHide:s,children:[S.jsx(ft.Header,{closeButton:!0,children:S.jsx(ft.Title,{children:i("ModalClear_Title")})}),S.jsx(ft.Body,{children:S.jsx("p",{children:i("ModalClear_Body")})}),S.jsxs(ft.Footer,{children:[S.jsx(Dn,{variant:"secondary",onClick:s,children:i("Button_Cancel")}),S.jsx(Dn,{variant:"primary",onClick:a,children:i("Button_Clear")})]})]})}function Fle(){const[e,t]=A.useState(!1),{flowchart:n}=Kr(),{triggerToast:r}=Gr(),{getString:i}=sn(),o=()=>{const s=Ple(n),a=window.location.href.split("?")[0];navigator.clipboard.writeText(`${a}?lzs=${s}`),r({message:i("ToastMessage_CopyLink"),icon:"bi-clipboard-check",background:"secondary"})};return S.jsxs(S.Fragment,{children:[S.jsxs(Wn,{align:"end",children:[S.jsx(Du,{text:i("MenuFlowchart_Tooltip"),children:S.jsx(Wn.Toggle,{children:S.jsx("i",{className:"bi bi-bounding-box-circles"})})}),S.jsxs(Wn.Menu,{children:[S.jsx(Wn.Item,{onClick:()=>t(!0),children:i("MenuFlowchart_Clear")}),S.jsx(Wn.Item,{onClick:o,children:i("MenuFlowchart_CopyLink")})]})]}),S.jsx($le,{showModal:e,setShowModal:t})]})}function Ble({showModal:e,setShowModal:t}){const{getString:n}=sn();return S.jsxs(ft,{show:e,onHide:()=>t(!1),children:[S.jsxs(ft.Header,{closeButton:!0,children:[S.jsx(_b,{src:o$,alt:"Logo",width:"32",height:"32",className:"me-3"}),S.jsx(ft.Title,{children:n("ModalAbout_Title")})]}),S.jsxs(ft.Body,{children:[S.jsx("p",{children:S.jsx(bu,{source:n("ModalAbout_Body1")})}),S.jsx("p",{children:S.jsx(bu,{source:n("ModalAbout_Body2",{GitHub:"[GitHub](https://github.com/rwnobrega/FluxoLab.app)",GPL3:"[GPL3](https://www.gnu.org/licenses/gpl-3.0.en.html)"})})})]}),S.jsx(ft.Footer,{children:S.jsx(Dn,{variant:"secondary",onClick:()=>t(!1),children:n("Button_Close")})})]})}const Hle={title:"factorial",variables:[{id:"n",type:Xn.Number},{id:"fat",type:Xn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:400,y:120},payload:"",handlePositions:{out:te.Bottom}},{id:"1",role:Ne.Assign,position:{x:400,y:280},payload:"fat = 1",handlePositions:{out:te.Bottom}},{id:"2",role:Ne.Read,position:{x:400,y:200},payload:"n",handlePositions:{out:te.Bottom}},{id:"3",role:Ne.Conditional,position:{x:400,y:360},payload:"n > 1",handlePositions:{true:te.Bottom,false:te.Right}},{id:"4",role:Ne.Assign,position:{x:400,y:440},payload:"fat = fat * n",handlePositions:{out:te.Bottom}},{id:"5",role:Ne.Assign,position:{x:400,y:520},payload:"n = n - 1",handlePositions:{out:te.Left}},{id:"6",role:Ne.Write,position:{x:580,y:360},payload:"fat",handlePositions:{out:te.Bottom}},{id:"7",role:Ne.End,position:{x:580,y:440},payload:"",handlePositions:{}}],edges:[{source:"2",sourceHandle:"out",target:"1"},{source:"3",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"3",sourceHandle:"false",target:"6"},{source:"6",sourceHandle:"out",target:"7"},{source:"1",sourceHandle:"out",target:"3"},{source:"5",sourceHandle:"out",target:"3"},{source:"0",sourceHandle:"out",target:"2"}]},zle={title:"overtime",variables:[{id:"hours",type:Xn.Number},{id:"pay",type:Xn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:400,y:80},payload:"",handlePositions:{out:te.Bottom}},{id:"1",role:Ne.Read,position:{x:400,y:160},payload:"hours",handlePositions:{out:te.Bottom}},{id:"2",role:Ne.Assign,position:{x:400,y:240},payload:"pay = 50 * hours",handlePositions:{out:te.Bottom}},{id:"3",role:Ne.Conditional,position:{x:400,y:320},payload:"hours > 8",handlePositions:{true:te.Bottom,false:te.Right}},{id:"4",role:Ne.Assign,position:{x:400,y:400},payload:"pay = pay + 25 * (hours - 8)",handlePositions:{out:te.Bottom}},{id:"5",role:Ne.Write,position:{x:400,y:480},payload:'"The payment is $", pay, "."',handlePositions:{out:te.Bottom}},{id:"6",role:Ne.End,position:{x:400,y:560},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"out",target:"3"},{source:"3",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"5",sourceHandle:"out",target:"6"},{source:"3",sourceHandle:"false",target:"5"}]},jle={title:"secret",variables:[{id:"secret",type:Xn.Number},{id:"guess",type:Xn.Number},{id:"tries",type:Xn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:480,y:-60},payload:"",handlePositions:{out:te.Bottom}},{id:"1",role:Ne.Assign,position:{x:480,y:20},payload:"secret = rand_int(1, 100)",handlePositions:{out:te.Bottom}},{id:"2",role:Ne.Assign,position:{x:480,y:100},payload:"tries = 0",handlePositions:{out:te.Bottom}},{id:"3",role:Ne.Read,position:{x:480,y:180},payload:"guess",handlePositions:{out:te.Bottom}},{id:"4",role:Ne.Assign,position:{x:480,y:260},payload:"tries = tries + 1",handlePositions:{out:te.Bottom}},{id:"5",role:Ne.Conditional,position:{x:480,y:340},payload:"secret > guess",handlePositions:{true:te.Right,false:te.Bottom}},{id:"6",role:Ne.Write,position:{x:720,y:340},payload:'"Secret is higher"',handlePositions:{out:te.Right}},{id:"7",role:Ne.Conditional,position:{x:480,y:420},payload:"secret < guess",handlePositions:{true:te.Right,false:te.Bottom}},{id:"8",role:Ne.Write,position:{x:720,y:420},payload:'"Secret is lower"',handlePositions:{out:te.Right}},{id:"9",role:Ne.Conditional,position:{x:480,y:500},payload:"secret != guess",handlePositions:{true:te.Left,false:te.Bottom}},{id:"10",role:Ne.Write,position:{x:480,y:580},payload:'"Congratulations! ", tries, " tries."',handlePositions:{out:te.Right}},{id:"11",role:Ne.End,position:{x:760,y:580},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"out",target:"3"},{source:"3",sourceHandle:"out",target:"4"},{source:"4",sourceHandle:"out",target:"5"},{source:"5",sourceHandle:"false",target:"7"},{source:"5",sourceHandle:"true",target:"6"},{source:"6",sourceHandle:"out",target:"9"},{source:"7",sourceHandle:"false",target:"9"},{source:"7",sourceHandle:"true",target:"8"},{source:"8",sourceHandle:"out",target:"9"},{source:"9",sourceHandle:"false",target:"10"},{source:"9",sourceHandle:"true",target:"3"},{source:"10",sourceHandle:"out",target:"11"}]},Vle={title:"sign",variables:[{id:"n",type:Xn.Number}],nodes:[{id:"0",role:Ne.Start,position:{x:300,y:140},payload:"",handlePositions:{out:te.Bottom}},{id:"1",role:Ne.Read,position:{x:300,y:220},payload:"n",handlePositions:{out:te.Bottom}},{id:"2",role:Ne.Conditional,position:{x:300,y:300},payload:"n > 0",handlePositions:{true:te.Bottom,false:te.Right}},{id:"3",role:Ne.Conditional,position:{x:520,y:300},payload:"n < 0",handlePositions:{true:te.Bottom,false:te.Right}},{id:"4",role:Ne.Write,position:{x:300,y:380},payload:'"Positive"',handlePositions:{out:te.Bottom}},{id:"5",role:Ne.Write,position:{x:520,y:380},payload:'"Negative"',handlePositions:{out:te.Bottom}},{id:"6",role:Ne.Write,position:{x:720,y:380},payload:'"Zero"',handlePositions:{out:te.Bottom}},{id:"7",role:Ne.End,position:{x:720,y:480},payload:"",handlePositions:{}}],edges:[{source:"0",sourceHandle:"out",target:"1"},{source:"1",sourceHandle:"out",target:"2"},{source:"2",sourceHandle:"false",target:"3"},{source:"3",sourceHandle:"false",target:"6"},{source:"3",sourceHandle:"true",target:"5"},{source:"2",sourceHandle:"true",target:"4"},{source:"4",sourceHandle:"out",target:"7"},{source:"5",sourceHandle:"out",target:"7"},{source:"6",sourceHandle:"out",target:"7"}]},Dk=[zle,Vle,Hle,jle];function Ule({showModal:e,setShowModal:t}){const{importSimpleFlowchart:n,setSavedViewport:r}=Kr(),{triggerToast:i}=Gr(),{getString:o}=sn(),{fitView:s,getViewport:a}=Fa(),u=c=>{const{variables:d,nodes:p,edges:h,title:m}=Dk[c],v=o(`ExampleTitle_${m}`);n({title:v,variables:d,nodes:p,edges:h}),setTimeout(()=>{s({minZoom:1,maxZoom:1}),r(a())},100),i({message:o("ToastMessage_ExampleLoaded"),icon:"bi-check-circle",background:"success"}),t(!1)};return S.jsxs(ft,{size:"lg",show:e,onHide:()=>t(!1),children:[S.jsx(ft.Header,{closeButton:!0,children:S.jsx(ft.Title,{children:o("ModalExamples_Title")})}),S.jsxs(ft.Body,{children:[S.jsx("p",{children:S.jsx(bu,{source:o("ModalExamples_Body")})}),S.jsx("div",{className:"px-3",children:ue.map(Dk,({title:c},d)=>S.jsxs("p",{children:[S.jsx("b",{className:"text-primary",style:{cursor:"pointer"},onClick:()=>u(d),children:o(`ExampleTitle_${c}`)})," – ",S.jsx("i",{children:o(`ExampleDescription_${c}`)})]},d))})]}),S.jsx(ft.Footer,{children:S.jsx(Dn,{variant:"secondary",onClick:()=>t(!1),children:o("Button_Close")})})]})}const ta=A.forwardRef(({bsPrefix:e,className:t,striped:n,bordered:r,borderless:i,hover:o,size:s,variant:a,responsive:u,...c},d)=>{const p=Fe(e,"table"),h=Te(t,p,a&&`${p}-${a}`,s&&`${p}-${s}`,n&&`${p}-${typeof n=="string"?`striped-${n}`:"striped"}`,r&&`${p}-bordered`,i&&`${p}-borderless`,o&&`${p}-hover`),m=S.jsx("table",{...c,className:h,ref:d});if(u){let v=`${p}-responsive`;return typeof u=="string"&&(v=`${v}-${u}`),S.jsx("div",{className:v,children:m})}return m});function Wle({showModal:e,setShowModal:t}){const{getString:n}=sn(),r="font-monospace col-3";return S.jsxs(ft,{size:"lg",show:e,onHide:()=>t(!1),children:[S.jsx(ft.Header,{closeButton:!0,children:S.jsx(ft.Title,{children:n("ModalHelp_Title")})}),S.jsxs(ft.Body,{style:{overflowY:"auto",maxHeight:"67vh"},children:[S.jsx("h5",{children:n("ModalHelp_SubtitleAssignment")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsx("tbody",{children:S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"var = expr"}),S.jsx("td",{children:n("ModalHelp_Assignment")})]})})}),S.jsx("h5",{children:n("ModalHelp_SubtitleArithmetic")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x + y"}),S.jsx("td",{children:n("ModalHelp_Addition")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x - y"}),S.jsx("td",{children:n("ModalHelp_Subtraction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x * y"}),S.jsx("td",{children:n("ModalHelp_Multiplication")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x / y"}),S.jsx("td",{children:n("ModalHelp_RealDivision")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a div b"}),S.jsx("td",{children:n("ModalHelp_IntegerDivision")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a mod b"}),S.jsx("td",{children:n("ModalHelp_Modulus")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"+x"}),S.jsx("td",{children:n("ModalHelp_Positive")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"-x"}),S.jsx("td",{children:n("ModalHelp_Negative")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleComparison")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x == y"}),S.jsx("td",{children:n("ModalHelp_Equal")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x != y"}),S.jsx("td",{children:n("ModalHelp_NotEqual")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x > y"}),S.jsx("td",{children:n("ModalHelp_Greater")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x >= y"}),S.jsx("td",{children:n("ModalHelp_GreaterOrEqual")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x < y"}),S.jsx("td",{children:n("ModalHelp_Less")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"x <= y"}),S.jsx("td",{children:n("ModalHelp_LessOrEqual")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleLogical")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a || b"}),S.jsx("td",{children:n("ModalHelp_Disjunction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"a && b"}),S.jsx("td",{children:n("ModalHelp_Conjunction")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"!a"}),S.jsx("td",{children:n("ModalHelp_Negation")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleFunctions")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"pow(x, y)"}),S.jsx("td",{children:n("ModalHelp_Power")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sqrt(x)"}),S.jsx("td",{children:n("ModalHelp_SquareRoot")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log(x)"}),S.jsx("td",{children:n("ModalHelp_NaturalLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log10(x)"}),S.jsx("td",{children:n("ModalHelp_CommonLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"log2(x)"}),S.jsx("td",{children:n("ModalHelp_BinaryLogarithm")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"exp(x)"}),S.jsx("td",{children:n("ModalHelp_Exponential")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sin(x)"}),S.jsx("td",{children:n("ModalHelp_Sine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"cos(x)"}),S.jsx("td",{children:n("ModalHelp_Cosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tan(x)"}),S.jsx("td",{children:n("ModalHelp_Tangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"asin(x)"}),S.jsx("td",{children:n("ModalHelp_ArcSine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"acos(x)"}),S.jsx("td",{children:n("ModalHelp_ArcCosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"atan(x)"}),S.jsx("td",{children:n("ModalHelp_ArcTangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sinh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicSine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"cosh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicCosine")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tanh(x)"}),S.jsx("td",{children:n("ModalHelp_HyperbolicTangent")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"asinh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcSineHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"acosh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcCosineHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"atanh(x)"}),S.jsx("td",{children:n("ModalHelp_ArcTangentHyperbolic")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"sign(x)"}),S.jsx("td",{children:n("ModalHelp_Sign")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"abs(x)"}),S.jsx("td",{children:n("ModalHelp_AbsoluteValue")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"round(x)"}),S.jsx("td",{children:n("ModalHelp_Round")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"floor(x)"}),S.jsx("td",{children:n("ModalHelp_Floor")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"ceil(x)"}),S.jsx("td",{children:n("ModalHelp_Ceil")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"min(x, y)"}),S.jsx("td",{children:n("ModalHelp_Minimum")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"max(x, y)"}),S.jsx("td",{children:n("ModalHelp_Maximum")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"rand()"}),S.jsx("td",{children:n("ModalHelp_Rand")})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"rand_int(a, b)"}),S.jsx("td",{children:n("ModalHelp_RandInt")})]})]})}),S.jsx("h5",{children:n("ModalHelp_SubtitleConstants")}),S.jsx(ta,{striped:!0,bordered:!0,hover:!0,children:S.jsxs("tbody",{children:[S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"pi"}),S.jsx("td",{children:"π ≅ 3.141592653589793"})]}),S.jsxs("tr",{children:[S.jsx("td",{className:r,children:"tau"}),S.jsx("td",{children:"τ = 2π ≅ 6.283185307179586"})]})]})})]}),S.jsx(ft.Footer,{children:S.jsx(Dn,{variant:"secondary",onClick:()=>t(!1),children:n("Button_Close")})})]})}function Gle(){const{getString:e}=sn(),[t,n]=A.useState(!1),[r,i]=A.useState(!1),[o,s]=A.useState(!1);return S.jsxs(S.Fragment,{children:[S.jsxs(Wn,{align:"end",children:[S.jsx(Du,{text:e("MenuHelp_Tooltip"),children:S.jsx(Wn.Toggle,{children:S.jsx("i",{className:"bi bi-question-circle"})})}),S.jsxs(Wn.Menu,{children:[S.jsx(Wn.Item,{onClick:()=>n(!0),children:e("MenuHelp_Help")}),S.jsx(Wn.Item,{onClick:()=>i(!0),children:e("MenuHelp_Examples")}),S.jsx(Wn.Item,{onClick:()=>s(!0),children:e("MenuHelp_About")})]})]}),S.jsx(Wle,{showModal:t,setShowModal:n}),S.jsx(Ble,{showModal:o,setShowModal:s}),S.jsx(Ule,{showModal:r,setShowModal:i})]})}function Kle(){const{getString:e,language:t,setLanguage:n}=sn(),{triggerToast:r}=Gr(),i={en:"English","pt-BR":"Português (BR)"},o=s=>{n(s),r({message:e("ToastMessage_LanguageChanged",{language:i[s]}),icon:"bi-check2-circle",background:"success"})};return S.jsxs(Wn,{align:"end",children:[S.jsx(Du,{text:e("MenuLanguage_Tooltip"),children:S.jsx(Wn.Toggle,{children:S.jsx("i",{className:"bi bi-globe"})})}),S.jsx(Wn.Menu,{children:ue.map(i,(s,a)=>S.jsxs(Wn.Item,{onClick:()=>o(a),children:[a===t?S.jsx("i",{className:"bi bi-check2"}):null," ",s]},a))})]})}function qle(){const[e,t]=A.useState(!1),{flowchart:n,setTitle:r}=Kr(),{getString:i}=sn(),o=c=>{c.target.select(),t(!0)},s=()=>{t(!1)},a=c=>{r(c.target.value)},u=c=>{(c.key==="Enter"||c.key==="Escape")&&(t(!1),c.currentTarget.blur())};return S.jsx("input",{type:"text",className:"form-control bg-dark text-white fs-4",placeholder:i("FlowchartTitle_Placeholder"),value:n.title,onFocus:o,onBlur:s,onChange:a,onKeyDown:u,style:{borderColor:e?"white":"black"}})}function Yle(){return S.jsx(i$,{variant:"dark",bg:"dark",expand:"lg",children:S.jsxs($a,{direction:"horizontal",gap:3,className:"flex-fill mx-3",children:[S.jsx(ele,{}),S.jsx(qle,{}),S.jsx(Fle,{}),S.jsx(Kle,{}),S.jsx(Gle,{})]})})}function Xle({role:e}){const{getString:t}=sn(),[n,r]=A.useState(!1),i=wP(e);function o(s){s.dataTransfer.setData("application/text",e),s.dataTransfer.effectAllowed="move"}return S.jsx("div",{className:"text-center fw-bold small",draggable:!0,onDragStart:o,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{cursor:"grab",lineHeight:"40px",width:120,color:i.textColor,background:n?oi.darker(i.backgroundColor):i.backgroundColor,borderRadius:i.borderRadius,clipPath:i.clipPath},children:S.jsx("span",{children:t(`BlockTitle_${e}`)})})}function Qle(){return S.jsx("div",{className:"vstack gap-3",children:ue.map(Ne,e=>S.jsx(Xle,{role:e},e))})}const Lk={common:"d-flex",in:"align-self-end",out:"align-self-start"},Zle={in:{transform:"translateX(8px)"},out:{transform:"translateX(-8px)"}},Pk={common:"badge font-monospace fw-normal p-2",in:"text-bg-primary",out:"text-bg-success"},Mk={common:{whiteSpace:"normal",wordBreak:"break-word"},in:{textAlign:"right"},out:{textAlign:"left"}},Xp={common:{width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent"},in:{borderTop:`8px solid ${At.blue}`,transform:"translateY(16px) translateX(-8px) rotate(45deg)"},out:{borderTop:`8px solid ${At.green}`,transform:"translateY(16px) translateX(8px) rotate(-45deg)"}};function Jle({direction:e,text:t}){return S.jsxs("div",{className:`${Lk.common} ${Lk[e]}`,style:Zle[e],children:[e==="out"&&S.jsx("div",{style:{...Xp.common,...Xp.out}}),S.jsx("span",{className:`${Pk.common} ${Pk[e]}`,style:{...Mk.common,...Mk[e]},children:t}),e==="in"&&S.jsx("div",{style:{...Xp.common,...Xp.in}})]})}function eue(){const e=A.useRef(null),t=A.useRef(null),[n,r]=A.useState(""),{setRefInput:i}=Gr(),{machineState:o,executeAction:s}=$s(),{getString:a}=sn();A.useEffect(()=>{i(e)},[e]);const u=()=>{n.length>0&&(o.input=n,s("nextStep"),r(""))};return A.useEffect(()=>{var c;o.status==="waiting"&&((c=e.current)==null||c.focus())},[o.status]),A.useEffect(()=>{t.current!=null&&t.current.scrollIntoView({behavior:"smooth"})},[o.status,o.interaction]),S.jsxs("div",{className:"d-flex flex-column h-100",children:[S.jsx("p",{className:"fw-semibold",children:a("Interaction_Title")}),S.jsxs($a,{gap:2,className:"mb-3",style:{overflowY:"auto",overflowX:"clip"},children:[ue.map(o.interaction,({direction:c,text:d},p)=>S.jsx(Jle,{direction:c,text:d},p)),S.jsx("div",{ref:t})]}),S.jsx(wa.Control,{ref:e,size:"sm",value:n,disabled:o.status!=="waiting",onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&u()}})]})}function Vn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var tue=typeof Symbol=="function"&&Symbol.observable||"@@observable",$k=tue,H0=()=>Math.random().toString(36).substring(7).split("").join("."),nue={INIT:`@@redux/INIT${H0()}`,REPLACE:`@@redux/REPLACE${H0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${H0()}`},Fk=nue;function rue(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function C$(e,t,n){if(typeof e!="function")throw new Error(Vn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Vn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Vn(1));return n(C$)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,u=!1;function c(){s===o&&(s=new Map,o.forEach((b,y)=>{s.set(y,b)}))}function d(){if(u)throw new Error(Vn(3));return i}function p(b){if(typeof b!="function")throw new Error(Vn(4));if(u)throw new Error(Vn(5));let y=!0;c();const _=a++;return s.set(_,b),function(){if(y){if(u)throw new Error(Vn(6));y=!1,c(),s.delete(_),o=null}}}function h(b){if(!rue(b))throw new Error(Vn(7));if(typeof b.type>"u")throw new Error(Vn(8));if(typeof b.type!="string")throw new Error(Vn(17));if(u)throw new Error(Vn(9));try{u=!0,i=r(i,b)}finally{u=!1}return(o=s).forEach(_=>{_()}),b}function m(b){if(typeof b!="function")throw new Error(Vn(10));r=b,h({type:Fk.REPLACE})}function v(){const b=p;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Vn(11));function _(){const C=y;C.next&&C.next(d())}return _(),{unsubscribe:b(_)}},[$k](){return this}}}return h({type:Fk.INIT}),{dispatch:h,subscribe:p,getState:d,replaceReducer:m,[$k]:v}}function Bk(e,t){return function(...n){return t(e.apply(this,n))}}function Hk(e,t){if(typeof e=="function")return Bk(e,t);if(typeof e!="object"||e===null)throw new Error(Vn(16));const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=Bk(i,t))}return n}function I$(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function iue(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(Vn(15))};const s={getState:i.getState,dispatch:(u,...c)=>o(u,...c)},a=e.map(u=>u(s));return o=I$(...a)(i.dispatch),{...i,dispatch:o}}}var oue={};/** + * @license React + * use-sync-external-store-with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gd=A;function sue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aue=typeof Object.is=="function"?Object.is:sue,lue=gd.useSyncExternalStore,uue=gd.useRef,cue=gd.useEffect,fue=gd.useMemo,due=gd.useDebugValue;oue.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=uue(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=fue(function(){function u(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return p=v}return p=m}if(v=p,aue(d,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(d=m,p=x)}var c=!1,d,p,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var a=lue(e,o[0],o[1]);return cue(function(){s.hasValue=!0,s.value=a},[a]),due(a),a};var ct="default"in Sh?Q:Sh,zk=Symbol.for("react-redux-context"),jk=typeof globalThis<"u"?globalThis:{};function pue(){if(!ct.createContext)return{};const e=jk[zk]??(jk[zk]=new Map);let t=e.get(ct.createContext);return t||(t=ct.createContext(null),e.set(ct.createContext,t)),t}var A$=pue(),hue=()=>{throw new Error("uSES not initialized!")},mue=Symbol.for("react.element"),gue=Symbol.for("react.portal"),yue=Symbol.for("react.fragment"),vue=Symbol.for("react.strict_mode"),xue=Symbol.for("react.profiler"),_ue=Symbol.for("react.provider"),wue=Symbol.for("react.context"),bue=Symbol.for("react.server_context"),T$=Symbol.for("react.forward_ref"),Eue=Symbol.for("react.suspense"),Sue=Symbol.for("react.suspense_list"),Eb=Symbol.for("react.memo"),Cue=Symbol.for("react.lazy"),Iue=T$,Aue=Eb;function Tue(e){if(typeof e=="object"&&e!==null){const t=e.$$typeof;switch(t){case mue:{const n=e.type;switch(n){case yue:case xue:case vue:case Eue:case Sue:return n;default:{const r=n&&n.$$typeof;switch(r){case bue:case wue:case T$:case Cue:case Eb:case _ue:return r;default:return t}}}}case gue:return t}}}function kue(e){return Tue(e)===Eb}function Nue(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:o,areStatePropsEqual:s}){let a=!1,u,c,d,p,h;function m(_,E){return u=_,c=E,d=e(u,c),p=t(r,c),h=n(d,p,c),a=!0,h}function v(){return d=e(u,c),t.dependsOnOwnProps&&(p=t(r,c)),h=n(d,p,c),h}function x(){return e.dependsOnOwnProps&&(d=e(u,c)),t.dependsOnOwnProps&&(p=t(r,c)),h=n(d,p,c),h}function b(){const _=e(u,c),E=!s(_,d);return d=_,E&&(h=n(d,p,c)),h}function y(_,E){const C=!o(E,c),T=!i(_,u,E,c);return u=_,c=E,C&&T?v():C?x():T?b():h}return function(E,C){return a?y(E,C):m(E,C)}}function Oue(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){const o=t(e,i),s=n(e,i),a=r(e,i);return Nue(o,s,a,e,i)}function Rue(e,t){const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=(...o)=>t(i(...o)))}return n}function B_(e){return function(n){const r=e(n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function Vk(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function k$(e,t){return function(r,{displayName:i}){const o=function(a,u){return o.dependsOnOwnProps?o.mapToProps(a,u):o.mapToProps(a,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(a,u){o.mapToProps=e,o.dependsOnOwnProps=Vk(e);let c=o(a,u);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=Vk(c),c=o(a,u)),c},o}}function Sb(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Due(e){return e&&typeof e=="object"?B_(t=>Rue(e,t)):e?typeof e=="function"?k$(e):Sb(e,"mapDispatchToProps"):B_(t=>({dispatch:t}))}function Lue(e){return e?typeof e=="function"?k$(e):Sb(e,"mapStateToProps"):B_(()=>({}))}function Pue(e,t,n){return{...n,...e,...t}}function Mue(e){return function(n,{displayName:r,areMergedPropsEqual:i}){let o=!1,s;return function(u,c,d){const p=e(u,c,d);return o?i(p,s)||(s=p):(o=!0,s=p),s}}}function $ue(e){return e?typeof e=="function"?Mue(e):Sb(e,"mergeProps"):()=>Pue}function Fue(e){e()}function Bue(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Fue(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Uk={notify(){},get:()=>[]};function N$(e,t){let n,r=Uk,i=0,o=!1;function s(x){d();const b=r.subscribe(x);let y=!1;return()=>{y||(y=!0,b(),p())}}function a(){r.notify()}function u(){v.onStateChange&&v.onStateChange()}function c(){return o}function d(){i++,n||(n=t?t.addNestedSub(u):e.subscribe(u),r=Bue())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Uk)}function h(){o||(o=!0,d())}function m(){o&&(o=!1,p())}const v={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:u,isSubscribed:c,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>r};return v}var Hue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zue=typeof navigator<"u"&&navigator.product==="ReactNative",Sm=Hue||zue?ct.useLayoutEffect:ct.useEffect;function Wk(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function z0(e,t){if(Wk(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i{R$=e},Que=[null,null];function Zue(e,t,n){Sm(()=>e(...t),n)}function Jue(e,t,n,r,i,o){e.current=r,n.current=!1,i.current&&(i.current=null,o())}function ece(e,t,n,r,i,o,s,a,u,c,d){if(!e)return()=>{};let p=!1,h=null;const m=()=>{if(p||!a.current)return;const x=t.getState();let b,y;try{b=r(x,i.current)}catch(_){y=_,h=_}y||(h=null),b===o.current?s.current||c():(o.current=b,u.current=b,s.current=!0,d())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(p=!0,n.tryUnsubscribe(),n.onStateChange=null,h)throw h}}function tce(e,t){return e===t}function nce(e,t,n,{pure:r,areStatesEqual:i=tce,areOwnPropsEqual:o=z0,areStatePropsEqual:s=z0,areMergedPropsEqual:a=z0,forwardRef:u=!1,context:c=A$}={}){const d=c,p=Lue(e),h=Due(t),m=$ue(n),v=!!e;return b=>{const y=b.displayName||b.name||"Component",_=`Connect(${y})`,E={shouldHandleStateChanges:v,displayName:_,wrappedComponentName:y,WrappedComponent:b,initMapStateToProps:p,initMapDispatchToProps:h,initMergeProps:m,areStatesEqual:i,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:a};function C(O){const[M,j,V]=ct.useMemo(()=>{const{reactReduxForwardedRef:Oe,...Re}=O;return[O.context,Oe,Re]},[O]),F=ct.useMemo(()=>{let Oe=d;return M!=null&&M.Consumer,Oe},[M,d]),W=ct.useContext(F),Y=!!O.store&&!!O.store.getState&&!!O.store.dispatch,L=!!W&&!!W.store,B=Y?O.store:W.store,z=L?W.getServerState:B.getState,X=ct.useMemo(()=>Oue(B.dispatch,E),[B]),[U,H]=ct.useMemo(()=>{if(!v)return Que;const Oe=N$(B,Y?void 0:W.subscription),Re=Oe.notifyNestedSubs.bind(Oe);return[Oe,Re]},[B,Y,W]),N=ct.useMemo(()=>Y?W:{...W,subscription:U},[Y,W,U]),Z=ct.useRef(void 0),ne=ct.useRef(V),R=ct.useRef(void 0),ee=ct.useRef(!1),ie=ct.useRef(!1),se=ct.useRef(void 0);Sm(()=>(ie.current=!0,()=>{ie.current=!1}),[]);const pe=ct.useMemo(()=>()=>R.current&&V===ne.current?R.current:X(B.getState(),V),[B,V]),ye=ct.useMemo(()=>Re=>U?ece(v,B,U,X,ne,Z,ee,ie,R,H,Re):()=>{},[U]);Zue(Jue,[ne,Z,ee,V,R,H]);let _e;try{_e=R$(ye,pe,z?()=>X(z(),V):pe)}catch(Oe){throw se.current&&(Oe.message+=` +The error may be correlated with this previous error: +${se.current.stack} + +`),Oe}Sm(()=>{se.current=void 0,R.current=void 0,Z.current=_e});const Se=ct.useMemo(()=>ct.createElement(b,{..._e,ref:j}),[j,b,_e]);return ct.useMemo(()=>v?ct.createElement(F.Provider,{value:N},Se):Se,[F,Se,N])}const I=ct.memo(C);if(I.WrappedComponent=b,I.displayName=C.displayName=_,u){const M=ct.forwardRef(function(V,F){return ct.createElement(I,{...V,reactReduxForwardedRef:F})});return M.displayName=_,M.WrappedComponent=b,H_(M,b)}return H_(I,b)}}var D$=nce;function rce({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",identityFunctionCheck:o="once"}){const s=ct.useMemo(()=>{const c=N$(e);return{store:e,subscription:c,getServerState:r?()=>r:void 0,stabilityCheck:i,identityFunctionCheck:o}},[e,r,i,o]),a=ct.useMemo(()=>e.getState(),[e]);Sm(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,a]);const u=t||A$;return ct.createElement(u.Provider,{value:s},n)}var ice=rce;Xue(A.useSyncExternalStore);function oce(e,t){if(e.length!==t.length)return!1;for(var n=0;n{const o=pce(n,i.options);return e.addEventListener(i.eventName,i.fn,o),function(){e.removeEventListener(i.eventName,i.fn,o)}});return function(){r.forEach(o=>{o()})}}const hce="Invariant failed";class Am extends Error{}Am.prototype.toString=function(){return this.message};function ve(e,t){throw new Am(hce)}class mce extends Q.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=bs,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Am&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in ");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=ci(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Am){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const gce=` + Press space bar to start a drag. + When dragging you can use the arrow keys to move the item around and escape to cancel. + Some screen readers may require you to be in focus mode or to use your pass through key +`,Tm=e=>e+1,yce=e=>` + You have lifted an item in position ${Tm(e.source.index)} +`,F$=(e,t)=>{const n=e.droppableId===t.droppableId,r=Tm(e.index),i=Tm(t.index);return n?` + You have moved the item from position ${r} + to position ${i} + `:` + You have moved the item from position ${r} + in list ${e.droppableId} + to list ${t.droppableId} + in position ${i} + `},B$=(e,t,n)=>t.droppableId===n.droppableId?` + The item ${e} + has been combined with ${n.draggableId}`:` + The item ${e} + in list ${t.droppableId} + has been combined with ${n.draggableId} + in list ${n.droppableId} + `,vce=e=>{const t=e.destination;if(t)return F$(e.source,t);const n=e.combine;return n?B$(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Qk=e=>` + The item has returned to its starting position + of ${Tm(e.index)} +`,xce=e=>{if(e.reason==="CANCEL")return` + Movement cancelled. + ${Qk(e.source)} + `;const t=e.destination,n=e.combine;return t?` + You have dropped the item. + ${F$(e.source,t)} + `:n?` + You have dropped the item. + ${B$(e.draggableId,e.source,n)} + `:` + The item has been dropped while not over a drop area. + ${Qk(e.source)} + `},Eh={dragHandleUsageInstructions:gce,onDragStart:yce,onDragUpdate:vce,onDragEnd:xce},pn={x:0,y:0},_n=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Pr=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Es=(e,t)=>e.x===t.x&&e.y===t.y,Hu=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),La=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},jf=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Zk=(e,t)=>Math.min(...t.map(n=>jf(e,n))),H$=e=>t=>({x:e(t.x),y:e(t.y)});var _ce=(e,t)=>{const n=Oi({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const yd=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Jk=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],wce={top:0,right:0,bottom:0,left:0},bce=(e,t)=>t?yd(e,t.scroll.diff.displacement):e,Ece=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Sce=(e,t)=>t&&t.shouldClipSubject?_ce(t.pageMarginBox,e):Oi(e);var Eu=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=bce(e.marginBox,r),o=Ece(i,n,t),s=Sce(o,r);return{page:e,withPlaceholder:t,active:s}},Ab=(e,t)=>{e.frame||ve();const n=e.frame,r=Pr(t,n.scroll.initial),i=Hu(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},s=Eu({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:s}};const z$=fn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),j$=fn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Tg=fn(e=>Object.values(e)),Cce=fn(e=>Object.values(e));var zu=fn((e,t)=>Cce(t).filter(r=>e===r.descriptor.droppableId).sort((r,i)=>r.descriptor.index-i.descriptor.index));function Tb(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function kg(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Ng=fn((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Ice=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled||!Tb(i))return null;function s(m){const v={type:"COMBINE",combine:{draggableId:m,droppableId:n.descriptor.id}};return{...i,at:v}}const a=i.displaced.all,u=a.length?a[0]:null;if(e)return u?s(u):null;const c=Ng(t,r);if(!u){if(!c.length)return null;const m=c[c.length-1];return s(m.descriptor.id)}const d=c.findIndex(m=>m.descriptor.id===u);d===-1&&ve();const p=d-1;if(p<0)return null;const h=c[p];return s(h.descriptor.id)},ju=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const V$={point:pn,value:0},Vf={invisible:{},visible:{},all:[]},Ace={displaced:Vf,displacedBy:V$,at:null};var pi=(e,t)=>n=>e<=n&&n<=t,U$=e=>{const t=pi(e.top,e.bottom),n=pi(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(o&&s)return!0;const u=r.tope.bottom,c=r.lefte.right;return u&&c?!0:u&&s||c&&o}},Tce=e=>{const t=pi(e.top,e.bottom),n=pi(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const kb={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},W$={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var kce=e=>t=>{const n=pi(t.top,t.bottom),r=pi(t.left,t.right);return i=>e===kb?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)};const Nce=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:pn;return yd(e,n)},Oce=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,Rce=(e,t,n)=>n(t)(e),Nb=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?Nce(e,t):e;return Oce(o,t,i)&&Rce(o,n,i)},Dce=e=>Nb({...e,isVisibleThroughFrameFn:U$}),G$=e=>Nb({...e,isVisibleThroughFrameFn:Tce}),Lce=e=>Nb({...e,isVisibleThroughFrameFn:kce(e.destination.axis)}),Pce=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return o?o.shouldAnimate:!0};function Mce(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Oi(Cb(n,r))}function Uf({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,last:o}){return e.reduce(function(a,u){const c=Mce(u,n),d=u.descriptor.id;if(a.all.push(d),!Dce({target:c,destination:t,viewport:r,withDroppableDisplacement:!0}))return a.invisible[u.descriptor.id]=!0,a;const h=Pce(d,o,i),m={draggableId:d,shouldAnimate:h};return a.visible[d]=m,a},{all:[],visible:{},invisible:{}})}function $ce(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function eN({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const i=$ce(e,{inHomeList:t});return{displaced:Vf,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:i}}}}function km({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:i,last:o,index:s,forceShouldAnimate:a}){const u=ju(e,n);if(s==null)return eN({insideDestination:t,inHomeList:u,displacedBy:i,destination:n});const c=t.find(v=>v.descriptor.index===s);if(!c)return eN({insideDestination:t,inHomeList:u,displacedBy:i,destination:n});const d=Ng(e,t),p=t.indexOf(c),h=d.slice(p);return{displaced:Uf({afterDragging:h,destination:n,displacedBy:i,last:o,viewport:r.frame,forceShouldAnimate:a}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function Ts(e,t){return!!t.effected[e]}var Fce=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:i})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,a=n[o].descriptor.index;return Ts(o,i)?e?a:a-1:e?a+1:a},Bce=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const i=r.index,o=e?i+1:i-1,s=n[0].descriptor.index,a=n[n.length-1].descriptor.index,u=t?a:a+1;return ou?null:o},Hce=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:i,insideDestination:o,previousImpact:s,viewport:a,afterCritical:u})=>{const c=s.at;if(c||ve(),c.type==="REORDER"){const p=Bce({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:o});return p==null?null:km({draggable:n,insideDestination:o,destination:i,viewport:a,last:s.displaced,displacedBy:s.displacedBy,index:p})}const d=Fce({isMovingForward:e,destination:i,displaced:s.displaced,draggables:r,combine:c.combine,afterCritical:u});return d==null?null:km({draggable:n,insideDestination:o,destination:i,viewport:a,last:s.displaced,displacedBy:s.displacedBy,index:d})},zce=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const i=!!(e.visible[n]||e.invisible[n]);return Ts(n,t)?i?pn:Hu(r.point):i?r.point:pn},jce=({afterCritical:e,impact:t,draggables:n})=>{const r=kg(t);r||ve();const i=r.draggableId,o=n[i].page.borderBox.center,s=zce({displaced:t.displaced,afterCritical:e,combineWith:i,displacedBy:t.displacedBy});return _n(o,s)};const K$=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Vce=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,Ob=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,tN=({axis:e,moveRelativeTo:t,isMoving:n})=>La(e.line,t.marginBox[e.end]+K$(e,n),Ob(e,t.marginBox,n)),nN=({axis:e,moveRelativeTo:t,isMoving:n})=>La(e.line,t.marginBox[e.start]-Vce(e,n),Ob(e,t.marginBox,n)),Uce=({axis:e,moveInto:t,isMoving:n})=>La(e.line,t.contentBox[e.start]+K$(e,n),Ob(e,t.contentBox,n));var Wce=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:i})=>{const o=zu(r.descriptor.id,n),s=t.page,a=r.axis;if(!o.length)return Uce({axis:a,moveInto:r.page,isMoving:s});const{displaced:u,displacedBy:c}=e,d=u.all[0];if(d){const h=n[d];if(Ts(d,i))return nN({axis:a,moveRelativeTo:h.page,isMoving:s});const m=Cm(h.page,c.point);return nN({axis:a,moveRelativeTo:m,isMoving:s})}const p=o[o.length-1];if(p.descriptor.id===t.descriptor.id)return s.borderBox.center;if(Ts(p.descriptor.id,i)){const h=Cm(p.page,Hu(i.displacedBy.point));return tN({axis:a,moveRelativeTo:h,isMoving:s})}return tN({axis:a,moveRelativeTo:p.page,isMoving:s})},z_=(e,t)=>{const n=e.frame;return n?_n(t,n.scroll.diff.displacement):t};const Gce=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:i})=>{const o=t.page.borderBox.center,s=e.at;return!n||!s?o:s.type==="REORDER"?Wce({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i}):jce({impact:e,draggables:r,afterCritical:i})};var Og=e=>{const t=Gce(e),n=e.droppable;return n?z_(n,t):t},q$=(e,t)=>{const n=Pr(t,e.scroll.initial),r=Hu(n);return{frame:Oi({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function rN(e,t){return e.map(n=>t[n])}function Kce(e,t){for(let n=0;n{const o=q$(t,_n(t.scroll.current,i)),s=n.frame?Ab(n,_n(n.frame.scroll.current,i)):n,a=e.displaced,u=Uf({afterDragging:rN(a.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:a,forceShouldAnimate:!1}),c=Uf({afterDragging:rN(a.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:a,forceShouldAnimate:!1}),d={},p={},h=[a,u,c];return a.all.forEach(v=>{const x=Kce(v,h);if(x){p[v]=x;return}d[v]=!0}),{...e,displaced:{all:a.all,invisible:d,visible:p}}},Yce=(e,t)=>_n(e.scroll.diff.displacement,t),Rb=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Yce(n,e),i=Pr(r,t.page.borderBox.center);return _n(t.client.borderBox.center,i)},Y$=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:i,onlyOnMainAxis:o=!1})=>{const s=Pr(n,e.page.borderBox.center),u={target:yd(e.page.borderBox,s),destination:t,withDroppableDisplacement:i,viewport:r};return o?Lce(u):G$(u)},Xce=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:i,viewport:o,previousPageBorderBoxCenter:s,previousClientSelection:a,afterCritical:u})=>{if(!n.isEnabled)return null;const c=zu(n.descriptor.id,r),d=ju(t,n),p=Ice({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:i})||Hce({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:i,viewport:o,afterCritical:u});if(!p)return null;const h=Og({impact:p,draggable:t,droppable:n,draggables:r,afterCritical:u});if(Y$({draggable:t,destination:n,newPageBorderBoxCenter:h,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Rb({pageBorderBoxCenter:h,draggable:t,viewport:o}),impact:p,scrollJumpRequest:null};const v=Pr(h,s),x=qce({impact:p,viewport:o,destination:n,draggables:r,maxScrollChange:v});return{clientSelection:a,impact:x,scrollJumpRequest:v}};const jn=e=>{const t=e.subject.active;return t||ve(),t};var Qce=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:i})=>{const o=n.subject.active;if(!o)return null;const s=n.axis,a=pi(o[s.start],o[s.end]),u=Tg(r).filter(d=>d!==n).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>U$(i.frame)(jn(d))).filter(d=>{const p=jn(d);return e?o[s.crossAxisEnd]{const p=jn(d),h=pi(p[s.start],p[s.end]);return a(p[s.start])||a(p[s.end])||h(o[s.start])||h(o[s.end])}).sort((d,p)=>{const h=jn(d)[s.crossAxisStart],m=jn(p)[s.crossAxisStart];return e?h-m:m-h}).filter((d,p,h)=>jn(d)[s.crossAxisStart]===jn(h[0])[s.crossAxisStart]);if(!u.length)return null;if(u.length===1)return u[0];const c=u.filter(d=>pi(jn(d)[s.start],jn(d)[s.end])(t[s.line]));return c.length===1?c[0]:c.length>1?c.sort((d,p)=>jn(d)[s.start]-jn(p)[s.start])[0]:u.sort((d,p)=>{const h=Zk(t,Jk(jn(d))),m=Zk(t,Jk(jn(p)));return h!==m?h-m:jn(d)[s.start]-jn(p)[s.start]})[0]};const iN=(e,t)=>{const n=e.page.borderBox.center;return Ts(e.descriptor.id,t)?Pr(n,t.displacedBy.point):n},Zce=(e,t)=>{const n=e.page.borderBox;return Ts(e.descriptor.id,t)?yd(n,Hu(t.displacedBy.point)):n};var Jce=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:i})=>r.filter(s=>G$({target:Zce(s,i),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,a)=>{const u=jf(e,z_(n,iN(s,i))),c=jf(e,z_(n,iN(a,i)));return u{const r=e.axis;if(e.descriptor.mode==="virtual")return La(r.line,t[r.line]);const i=e.subject.page.contentBox[r.size],u=zu(e.descriptor.id,n).reduce((c,d)=>c+d.client.marginBox[r.size],0)+t[r.line]-i;return u<=0?null:La(r.line,u)},X$=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Q$=(e,t,n)=>{const r=e.frame;ju(t,e)&&ve(),e.subject.withPlaceholder&&ve();const i=vd(e.axis,t.displaceBy).point,o=efe(e,i,n),s={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const d=Eu({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:d}}const a=o?_n(r.scroll.max,o):r.scroll.max,u=X$(r,a),c=Eu({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:u});return{...e,subject:c,frame:u}},tfe=e=>{const t=e.subject.withPlaceholder;t||ve();const n=e.frame;if(!n){const s=Eu({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||ve();const i=X$(n,r),o=Eu({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return{...e,subject:o,frame:i}};var nfe=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:i,destination:o,viewport:s,afterCritical:a})=>{if(!t){if(n.length)return null;const p={displaced:Vf,displacedBy:V$,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},h=Og({impact:p,draggable:r,droppable:o,draggables:i,afterCritical:a}),m=ju(r,o)?o:Q$(o,r,i);return Y$({draggable:r,destination:m,newPageBorderBoxCenter:h,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?p:null}const u=e[o.axis.line]<=t.page.borderBox.center[o.axis.line],c=(()=>{const p=t.descriptor.index;return t.descriptor.id===r.descriptor.id||u?p:p+1})(),d=vd(o.axis,r.displaceBy);return km({draggable:r,insideDestination:n,destination:o,viewport:s,displacedBy:d,last:Vf,index:c})},rfe=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:i,droppables:o,viewport:s,afterCritical:a})=>{const u=Qce({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:s});if(!u)return null;const c=zu(u.descriptor.id,i),d=Jce({pageBorderBoxCenter:t,viewport:s,destination:u,insideDestination:c,afterCritical:a}),p=nfe({previousPageBorderBoxCenter:t,destination:u,draggable:n,draggables:i,moveRelativeTo:d,insideDestination:c,viewport:s,afterCritical:a});if(!p)return null;const h=Og({impact:p,draggable:n,droppable:u,draggables:i,afterCritical:a});return{clientSelection:Rb({pageBorderBoxCenter:h,draggable:n,viewport:s}),impact:p,scrollJumpRequest:null}},$r=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const ife=(e,t)=>{const n=$r(e);return n?t[n]:null};var ofe=({state:e,type:t})=>{const n=ife(e.impact,e.dimensions.droppables),r=!!n,i=e.dimensions.droppables[e.critical.droppable.id],o=n||i,s=o.axis.direction,a=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(a&&!r)return null;const u=t==="MOVE_DOWN"||t==="MOVE_RIGHT",c=e.dimensions.draggables[e.critical.draggable.id],d=e.current.page.borderBoxCenter,{draggables:p,droppables:h}=e.dimensions;return a?Xce({isMovingForward:u,previousPageBorderBoxCenter:d,draggable:c,destination:o,draggables:p,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):rfe({isMovingForward:u,previousPageBorderBoxCenter:d,draggable:c,isOver:o,draggables:p,droppables:h,viewport:e.viewport,afterCritical:e.afterCritical})};function na(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Z$(e){const t=pi(e.top,e.bottom),n=pi(e.left,e.right);return function(i){return t(i.y)&&n(i.x)}}function sfe(e,t){return e.leftt.left&&e.topt.top}function afe({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,i=n.map(o=>{const s=o.axis,a=La(o.axis.line,e.center[s.line],o.page.borderBox.center[s.crossAxisLine]);return{id:o.descriptor.id,distance:jf(r,a)}}).sort((o,s)=>s.distance-o.distance);return i[0]?i[0].id:null}function lfe({pageBorderBox:e,draggable:t,droppables:n}){const r=Tg(n).filter(i=>{if(!i.isEnabled)return!1;const o=i.subject.active;if(!o||!sfe(e,o))return!1;if(Z$(o)(e.center))return!0;const s=i.axis,a=o.center[s.crossAxisLine],u=e[s.crossAxisStart],c=e[s.crossAxisEnd],d=pi(o[s.crossAxisStart],o[s.crossAxisEnd]),p=d(u),h=d(c);return!p&&!h?!0:p?ua});return r.length?r.length===1?r[0].descriptor.id:afe({pageBorderBox:e,draggable:t,candidates:r}):null}const J$=(e,t)=>Oi(yd(e,t));var ufe=(e,t)=>{const n=e.frame;return n?J$(t,n.scroll.diff.value):t};function e3({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function cfe({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var ffe=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:i,viewport:o,afterCritical:s})=>{const a=n.axis,u=vd(n.axis,t.displaceBy),c=u.value,d=e[a.start],p=e[a.end],m=Ng(t,r).find(x=>{const b=x.descriptor.id,y=x.page.borderBox.center[a.line],_=Ts(b,s),E=e3({displaced:i,id:b});return _?E?p<=y:d{if(!r.isCombineEnabled)return null;const s=r.axis,a=vd(r.axis,e.displaceBy),u=a.value,c=t[s.start],d=t[s.end],h=Ng(e,i).find(v=>{const x=v.descriptor.id,b=v.page.borderBox,_=b[s.size]/dfe,E=Ts(x,o),C=e3({displaced:n.displaced,id:x});return E?C?d>b[s.start]+_&&db[s.start]-u+_&&cb[s.start]+u+_&&db[s.start]+_&&c{const a=J$(t.page.borderBox,e),u=lfe({pageBorderBox:a,draggable:t,droppables:r});if(!u)return Ace;const c=r[u],d=zu(c.descriptor.id,n),p=ufe(c,a);return pfe({pageBorderBoxWithDroppableScroll:p,draggable:t,previousImpact:i,destination:c,insideDestination:d,afterCritical:s})||ffe({pageBorderBoxWithDroppableScroll:p,draggable:t,destination:c,insideDestination:d,last:i.displaced,viewport:o,afterCritical:s})},Db=(e,t)=>({...e,[t.descriptor.id]:t});const hfe=({previousImpact:e,impact:t,droppables:n})=>{const r=$r(e),i=$r(t);if(!r||r===i)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const s=tfe(o);return Db(n,s)};var mfe=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:i})=>{const o=hfe({previousImpact:r,impact:i,droppables:n}),s=$r(i);if(!s)return o;const a=n[s];if(ju(e,a)||a.subject.withPlaceholder)return o;const u=Q$(a,e,t);return Db(o,u)},uf=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:i,scrollJumpRequest:o})=>{const s=r||e.viewport,a=n||e.dimensions,u=t||e.current.client.selection,c=Pr(u,e.initial.client.selection),d={offset:c,selection:u,borderBoxCenter:_n(e.initial.client.borderBoxCenter,c)},p={selection:_n(d.selection,s.scroll.current),borderBoxCenter:_n(d.borderBoxCenter,s.scroll.current),offset:_n(d.offset,s.scroll.diff.value)},h={client:d,page:p};if(e.phase==="COLLECTING")return{...e,dimensions:a,viewport:s,current:h};const m=a.draggables[e.critical.draggable.id],v=i||t3({pageOffset:p.offset,draggable:m,draggables:a.draggables,droppables:a.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),x=mfe({draggable:m,impact:v,previousImpact:e.impact,draggables:a.draggables,droppables:a.droppables});return{...e,current:h,dimensions:{draggables:a.draggables,droppables:x},impact:v,viewport:s,scrollJumpRequest:o||null,forceShouldAnimate:o?!1:null}};function gfe(e,t){return e.map(n=>t[n])}var n3=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:i})=>{const o=e.displaced,s=gfe(o.all,n),a=Uf({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:i,last:o});return{...e,displaced:a}},r3=({impact:e,draggable:t,droppable:n,draggables:r,viewport:i,afterCritical:o})=>{const s=Og({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return Rb({pageBorderBoxCenter:s,draggable:t,viewport:i})},i3=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&ve();const r=e.impact,i=n||e.viewport,o=t||e.dimensions,{draggables:s,droppables:a}=o,u=s[e.critical.draggable.id],c=$r(r);c||ve();const d=a[c],p=n3({impact:r,viewport:i,destination:d,draggables:s}),h=r3({impact:p,draggable:u,droppable:d,draggables:s,viewport:i,afterCritical:e.afterCritical});return uf({impact:p,clientSelection:h,state:e,dimensions:o,viewport:i})},yfe=e=>({index:e.index,droppableId:e.droppableId}),o3=({draggable:e,home:t,draggables:n,viewport:r})=>{const i=vd(t.axis,e.displaceBy),o=zu(t.descriptor.id,n),s=o.indexOf(e);s===-1&&ve();const a=o.slice(s+1),u=a.reduce((h,m)=>(h[m.descriptor.id]=!0,h),{}),c={inVirtualList:t.descriptor.mode==="virtual",displacedBy:i,effected:u};return{impact:{displaced:Uf({afterDragging:a,destination:t,displacedBy:i,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:yfe(e.descriptor)}},afterCritical:c}},vfe=(e,t)=>({draggables:e.draggables,droppables:Db(e.droppables,t)}),xfe=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Cm(e.client,t),i=Im(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:i}},_fe=e=>{const t=e.frame;return t||ve(),t},wfe=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(i=>{const o=i.descriptor.droppableId,s=t[o],u=_fe(s).scroll.diff.value,c=_n(r,u);return xfe({draggable:i,offset:c,initialWindowScroll:n.scroll.initial})})},bfe=({state:e,published:t})=>{const n=t.modified.map(y=>{const _=e.dimensions.droppables[y.droppableId];return Ab(_,y.scroll)}),r={...e.dimensions.droppables,...z$(n)},i=j$(wfe({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o={...e.dimensions.draggables,...i};t.removals.forEach(y=>{delete o[y]});const s={droppables:r,draggables:o},a=$r(e.impact),u=a?s.droppables[a]:null,c=s.draggables[e.critical.draggable.id],d=s.droppables[e.critical.droppable.id],{impact:p,afterCritical:h}=o3({draggable:c,home:d,draggables:o,viewport:e.viewport}),m=u&&u.isCombineEnabled?e.impact:p,v=t3({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:m,viewport:e.viewport,afterCritical:h}),x={...e,phase:"DRAGGING",impact:v,onLiftImpact:p,dimensions:s,afterCritical:h,forceShouldAnimate:!1};return e.phase==="COLLECTING"?x:{...x,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const j_=e=>e.movementMode==="SNAP",V0=(e,t,n)=>{const r=vfe(e.dimensions,t);return!j_(e)||n?uf({state:e,dimensions:r}):i3({state:e,dimensions:r})};function U0(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const oN={phase:"IDLE",completed:null,shouldFlush:!1};var Efe=(e=oN,t)=>{if(t.type==="FLUSH")return{...oN,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&ve();const{critical:n,clientSelection:r,viewport:i,dimensions:o,movementMode:s}=t.payload,a=o.draggables[n.draggable.id],u=o.droppables[n.droppable.id],c={selection:r,borderBoxCenter:a.client.borderBox.center,offset:pn},d={client:c,page:{selection:_n(c.selection,i.scroll.initial),borderBoxCenter:_n(c.selection,i.scroll.initial),offset:_n(c.selection,i.scroll.diff.value)}},p=Tg(o.droppables).every(x=>!x.isFixedOnPage),{impact:h,afterCritical:m}=o3({draggable:a,home:u,draggables:o.draggables,viewport:i});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:o,initial:d,current:d,isWindowScrollAllowed:p,impact:h,afterCritical:m,onLiftImpact:h,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&ve(),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||ve(),bfe({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{client:n}=t.payload;return Es(n,e.current.client.selection)?e:uf({state:e,clientSelection:n,impact:j_(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return U0(e);na(e)||ve();const{id:n,newScroll:r}=t.payload,i=e.dimensions.droppables[n];if(!i)return e;const o=Ab(i,r);return V0(e,o,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{id:n,isEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||ve(),i.isEnabled===r&&ve();const o={...i,isEnabled:r};return V0(e,o,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;na(e)||ve();const{id:n,isCombineEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||ve(),i.isCombineEnabled===r&&ve();const o={...i,isCombineEnabled:r};return V0(e,o,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;na(e)||ve(),e.isWindowScrollAllowed||ve();const n=t.payload.newScroll;if(Es(e.viewport.scroll.current,n))return U0(e);const r=q$(e.viewport,n);return j_(e)?i3({state:e,viewport:r}):uf({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!na(e))return e;const n=t.payload.maxScroll;if(Es(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&ve();const n=ofe({state:e,type:t.type});return n?uf({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&ve(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:i}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||ve(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:i,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function dt(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Sfe=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Cfe=e=>({type:"LIFT",payload:e}),Ife=e=>({type:"INITIAL_PUBLISH",payload:e}),Afe=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Tfe=()=>({type:"COLLECTION_STARTING",payload:null}),kfe=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Nfe=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Ofe=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),s3=e=>({type:"MOVE",payload:e}),Rfe=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),Dfe=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),Lfe=()=>({type:"MOVE_UP",payload:null}),Pfe=()=>({type:"MOVE_DOWN",payload:null}),Mfe=()=>({type:"MOVE_RIGHT",payload:null}),$fe=()=>({type:"MOVE_LEFT",payload:null}),Lb=()=>({type:"FLUSH",payload:null}),Ffe=e=>({type:"DROP_ANIMATE",payload:e}),Pb=e=>({type:"DROP_COMPLETE",payload:e}),a3=e=>({type:"DROP",payload:e}),Bfe=e=>({type:"DROP_PENDING",payload:e}),l3=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var Hfe=e=>({getState:t,dispatch:n})=>r=>i=>{if(!dt(i,"LIFT")){r(i);return}const{id:o,clientSelection:s,movementMode:a}=i.payload,u=t();u.phase==="DROP_ANIMATING"&&n(Pb({completed:u.completed})),t().phase!=="IDLE"&&ve(),n(Lb()),n(Sfe({draggableId:o,movementMode:a}));const d={draggableId:o,scrollOptions:{shouldPublishImmediately:a==="SNAP"}},{critical:p,dimensions:h,viewport:m}=e.startPublishing(d);n(Ife({critical:p,dimensions:h,clientSelection:s,movementMode:a,viewport:m}))},zfe=e=>()=>t=>n=>{dt(n,"INITIAL_PUBLISH")&&e.dragging(),dt(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(dt(n,"FLUSH")||dt(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Mb={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Wf={opacity:{drop:0,combining:.7},scale:{drop:.75}},u3={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Qs=`${u3.outOfTheWay}s ${Mb.outOfTheWay}`,cf={fluid:`opacity ${Qs}`,snap:`transform ${Qs}, opacity ${Qs}`,drop:e=>{const t=`${e}s ${Mb.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Qs}`,placeholder:`height ${Qs}, width ${Qs}, margin ${Qs}`},sN=e=>Es(e,pn)?void 0:`translate(${e.x}px, ${e.y}px)`,V_={moveTo:sN,drop:(e,t)=>{const n=sN(e);if(n)return t?`${n} scale(${Wf.scale.drop})`:n}},{minDropTime:U_,maxDropTime:c3}=u3,jfe=c3-U_,aN=1500,Vfe=.6;var Ufe=({current:e,destination:t,reason:n})=>{const r=jf(e,t);if(r<=0)return U_;if(r>=aN)return c3;const i=r/aN,o=U_+jfe*i,s=n==="CANCEL"?o*Vfe:o;return Number(s.toFixed(2))},Wfe=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:i})=>{const{draggables:o,droppables:s}=n,a=$r(e),u=a?s[a]:null,c=s[t.descriptor.droppableId],d=r3({impact:e,draggable:t,draggables:o,afterCritical:i,droppable:u||c,viewport:r});return Pr(d,t.client.borderBox.center)},Gfe=({draggables:e,reason:t,lastImpact:n,home:r,viewport:i,onLiftImpact:o})=>!n.at||t!=="DROP"?{impact:n3({draggables:e,impact:o,destination:r,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:Vf},didDropInsideDroppable:!0};const Kfe=({getState:e,dispatch:t})=>n=>r=>{if(!dt(r,"DROP")){n(r);return}const i=e(),o=r.payload.reason;if(i.phase==="COLLECTING"){t(Bfe({reason:o}));return}if(i.phase==="IDLE")return;i.phase==="DROP_PENDING"&&i.isWaiting&&ve(),i.phase==="DRAGGING"||i.phase==="DROP_PENDING"||ve();const a=i.critical,u=i.dimensions,c=u.draggables[i.critical.draggable.id],{impact:d,didDropInsideDroppable:p}=Gfe({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),h=p?Tb(d):null,m=p?kg(d):null,v={index:a.draggable.index,droppableId:a.droppable.id},x={draggableId:c.descriptor.id,type:c.descriptor.type,source:v,reason:o,mode:i.movementMode,destination:h,combine:m},b=Wfe({impact:d,draggable:c,dimensions:u,viewport:i.viewport,afterCritical:i.afterCritical}),y={critical:i.critical,afterCritical:i.afterCritical,result:x,impact:d};if(!(!Es(i.current.client.offset,b)||!!x.combine)){t(Pb({completed:y}));return}const E=Ufe({current:i.current.client.offset,destination:b,reason:o});t(Ffe({newHomeClientOffset:b,dropDuration:E,completed:y}))};var f3=()=>({x:window.pageXOffset,y:window.pageYOffset});function qfe(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Yfe({onWindowScroll:e}){function t(){e(f3())}const n=zf(t),r=qfe(n);let i=bs;function o(){return i!==bs}function s(){o()&&ve(),i=ci(window,[r])}function a(){o()||ve(),n.cancel(),i(),i=bs}return{start:s,stop:a,isActive:o}}const Xfe=e=>dt(e,"DROP_COMPLETE")||dt(e,"DROP_ANIMATE")||dt(e,"FLUSH"),Qfe=e=>{const t=Yfe({onWindowScroll:n=>{e.dispatch(Rfe({newScroll:n}))}});return n=>r=>{!t.isActive()&&dt(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Xfe(r)&&t.stop(),n(r)}};var Zfe=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),i=o=>{t||n||(t=!0,e(o),clearTimeout(r))};return i.wasCalled=()=>t,i},Jfe=()=>{const e=[],t=i=>{const o=e.findIndex(a=>a.timerId===i);o===-1&&ve();const[s]=e.splice(o,1);s.callback()};return{add:i=>{const o=setTimeout(()=>t(o)),s={timerId:o,callback:i};e.push(s)},flush:()=>{if(!e.length)return;const i=[...e];e.length=0,i.forEach(o=>{clearTimeout(o.timerId),o.callback()})}}};const ede=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,tde=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,nde=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},Rc=(e,t)=>{t()},Qp=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function W0(e,t,n,r){if(!e){n(r(t));return}const i=Zfe(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}var rde=(e,t)=>{const n=Jfe();let r=null;const i=(p,h)=>{r&&ve(),Rc("onBeforeCapture",()=>{const m=e().onBeforeCapture;m&&m({draggableId:p,mode:h})})},o=(p,h)=>{r&&ve(),Rc("onBeforeDragStart",()=>{const m=e().onBeforeDragStart;m&&m(Qp(p,h))})},s=(p,h)=>{r&&ve();const m=Qp(p,h);r={mode:h,lastCritical:p,lastLocation:m.source,lastCombine:null},n.add(()=>{Rc("onDragStart",()=>W0(e().onDragStart,m,t,Eh.onDragStart))})},a=(p,h)=>{const m=Tb(h),v=kg(h);r||ve();const x=!nde(p,r.lastCritical);x&&(r.lastCritical=p);const b=!ede(r.lastLocation,m);b&&(r.lastLocation=m);const y=!tde(r.lastCombine,v);if(y&&(r.lastCombine=v),!x&&!b&&!y)return;const _={...Qp(p,r.mode),combine:v,destination:m};n.add(()=>{Rc("onDragUpdate",()=>W0(e().onDragUpdate,_,t,Eh.onDragUpdate))})},u=()=>{r||ve(),n.flush()},c=p=>{r||ve(),r=null,Rc("onDragEnd",()=>W0(e().onDragEnd,p,t,Eh.onDragEnd))};return{beforeCapture:i,beforeStart:o,start:s,update:a,flush:u,drop:c,abort:()=>{if(!r)return;const p={...Qp(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};c(p)}}},ide=(e,t)=>{const n=rde(e,t);return r=>i=>o=>{if(dt(o,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(dt(o,"INITIAL_PUBLISH")){const a=o.payload.critical;n.beforeStart(a,o.payload.movementMode),i(o),n.start(a,o.payload.movementMode);return}if(dt(o,"DROP_COMPLETE")){const a=o.payload.completed.result;n.flush(),i(o),n.drop(a);return}if(i(o),dt(o,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const ode=e=>t=>n=>{if(!dt(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&ve(),e.dispatch(Pb({completed:r.completed}))},sde=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return i=>o=>{if((dt(o,"FLUSH")||dt(o,"DROP_COMPLETE")||dt(o,"DROP_ANIMATION_FINISHED"))&&r(),i(o),!dt(o,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(l3())}};n=requestAnimationFrame(()=>{n=null,t=ci(window,[s])})}};var ade=e=>()=>t=>n=>{(dt(n,"DROP_COMPLETE")||dt(n,"FLUSH")||dt(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},lde=e=>{let t=!1;return()=>n=>r=>{if(dt(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(dt(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(dt(r,"DROP_COMPLETE")){t=!1;const i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const ude=e=>dt(e,"DROP_COMPLETE")||dt(e,"DROP_ANIMATE")||dt(e,"FLUSH");var cde=e=>t=>n=>r=>{if(ude(r)){e.stop(),n(r);return}if(dt(r,"INITIAL_PUBLISH")){n(r);const i=t.getState();i.phase!=="DRAGGING"&&ve(),e.start(i);return}n(r),e.scroll(t.getState())};const fde=e=>t=>n=>{if(t(n),!dt(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(a3({reason:r.reason})))},dde=I$;var pde=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:i,autoScroller:o})=>C$(Efe,dde(iue(zfe(n),ade(e),Hfe(e),Kfe,ode,sde,fde,cde(o),Qfe,lde(t),ide(r,i))));const G0=()=>({additions:{},removals:{},modified:{}});function hde({registry:e,callbacks:t}){let n=G0(),r=null;const i=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:u,removals:c,modified:d}=n,p=Object.keys(u).map(v=>e.draggable.getById(v).getDimension(pn)).sort((v,x)=>v.descriptor.index-x.descriptor.index),h=Object.keys(d).map(v=>{const b=e.droppable.getById(v).callbacks.getScrollWhileDragging();return{droppableId:v,scroll:b}}),m={additions:p,removals:Object.keys(c),modified:h};n=G0(),t.publish(m)}))};return{add:u=>{const c=u.descriptor.id;n.additions[c]=u,n.modified[u.descriptor.droppableId]=!0,n.removals[c]&&delete n.removals[c],i()},remove:u=>{const c=u.descriptor;n.removals[c.id]=!0,n.modified[c.droppableId]=!0,n.additions[c.id]&&delete n.additions[c.id],i()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=G0())}}}var d3=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const i=Pr({x:t,y:e},{x:r,y:n});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},p3=()=>{const e=document.documentElement;return e||ve(),e},h3=()=>{const e=p3();return d3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},mde=()=>{const e=f3(),t=h3(),n=e.y,r=e.x,i=p3(),o=i.clientWidth,s=i.clientHeight,a=r+o,u=n+s;return{frame:Oi({top:n,left:r,right:a,bottom:u}),scroll:{initial:e,current:e,max:t,diff:{value:pn,displacement:pn}}}},gde=({critical:e,scrollOptions:t,registry:n})=>{const r=mde(),i=r.scroll.current,o=e.droppable,s=n.droppable.getAllByType(o.type).map(d=>d.callbacks.getDimensionAndWatchScroll(i,t)),a=n.draggable.getAllByType(e.draggable.type).map(d=>d.getDimension(i));return{dimensions:{draggables:j$(a),droppables:z$(s)},critical:e,viewport:r}};function lN(e,t,n){return!(n.descriptor.id===t.id||n.descriptor.type!==t.type||e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var yde=(e,t)=>{let n=null;const r=hde({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=(h,m)=>{e.droppable.exists(h)||ve(),n&&t.updateDroppableIsEnabled({id:h,isEnabled:m})},o=(h,m)=>{n&&(e.droppable.exists(h)||ve(),t.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:m}))},s=(h,m)=>{n&&(e.droppable.exists(h)||ve(),t.updateDroppableScroll({id:h,newScroll:m}))},a=(h,m)=>{n&&e.droppable.getById(h).callbacks.scroll(m)},u=()=>{if(!n)return;r.stop();const h=n.critical.droppable;e.droppable.getAllByType(h.type).forEach(m=>m.callbacks.dragStopped()),n.unsubscribe(),n=null},c=h=>{n||ve();const m=n.critical.draggable;h.type==="ADDITION"&&lN(e,m,h.value)&&r.add(h.value),h.type==="REMOVAL"&&lN(e,m,h.value)&&r.remove(h.value)};return{updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:h=>{n&&ve();const m=e.draggable.getById(h.draggableId),v=e.droppable.getById(m.descriptor.droppableId),x={draggable:m.descriptor,droppable:v.descriptor},b=e.subscribe(c);return n={critical:x,unsubscribe:b},gde({critical:x,registry:e,scrollOptions:h.scrollOptions})},stopPublishing:u}},m3=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",vde=e=>{window.scrollBy(e.x,e.y)};const xde=fn(e=>Tg(e).filter(t=>!(!t.isEnabled||!t.frame))),_de=(e,t)=>xde(t).find(r=>(r.frame||ve(),Z$(r.frame.pageMarginBox)(e)))||null;var wde=({center:e,destination:t,droppables:n})=>{if(t){const i=n[t];return i.frame?i:null}return _de(e,n)};const Gf={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var bde=(e,t,n=()=>Gf)=>{const r=n(),i=e[t.size]*r.startFromPercentage,o=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:i,maxScrollValueAt:o}},g3=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?0:(n-e)/r},$b=1,Ede=(e,t,n=()=>Gf)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return $b;const o=1-g3({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(o);return Math.ceil(s)},Sde=(e,t,n)=>{const r=n(),i=r.durationDampening.accelerateAt,o=r.durationDampening.stopDampeningAt,s=t,a=o,c=Date.now()-s;if(c>=o)return e;if(c{const o=Ede(e,t,i);return o===0?0:r?Math.max(Sde(o,n,i),$b):o},cN=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=bde(e,r,o);return t[r.end]{const r=t.height>e.height,i=t.width>e.width;return!i&&!r?n:i&&r?null:{x:i?0:n.x,y:r?0:n.y}};const Ide=H$(e=>e===0?0:e);var y3=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},a=cN({container:t,distanceToEdges:s,dragStartTime:e,axis:kb,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),u=cN({container:t,distanceToEdges:s,dragStartTime:e,axis:W$,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),c=Ide({x:u,y:a});if(Es(c,pn))return null;const d=Cde({container:t,subject:n,proposedScroll:c});return d?Es(d,pn)?null:d:null};const Ade=H$(e=>e===0?0:e>0?1:-1),Fb=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const i=_n(t,r),o={x:e(i.x,n.x),y:e(i.y,n.y)};return Es(o,pn)?null:o}})(),v3=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},i=Ade(n),o=Fb({max:r,current:t,change:i});return!o||i.x!==0&&o.x===0||i.y!==0&&o.y===0},Bb=(e,t)=>v3({current:e.scroll.current,max:e.scroll.max,change:t}),Tde=(e,t)=>{if(!Bb(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Fb({current:r,max:n,change:t})},Hb=(e,t)=>{const n=e.frame;return n?v3({current:n.scroll.current,max:n.scroll.max,change:t}):!1},kde=(e,t)=>{const n=e.frame;return!n||!Hb(e,t)?null:Fb({current:n.scroll.current,max:n.scroll.max,change:t})};var Nde=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=y3({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o});return s&&Bb(e,s)?s:null},Ode=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const s=e.frame;if(!s)return null;const a=y3({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o});return a&&Hb(e,a)?a:null},fN=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:i,getAutoScrollerOptions:o})=>{const s=e.current.page.borderBoxCenter,u=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const p=e.viewport,h=Nde({dragStartTime:t,viewport:p,subject:u,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:o});if(h){r(h);return}}const c=wde({center:s,destination:$r(e.impact),droppables:e.dimensions.droppables});if(!c)return;const d=Ode({dragStartTime:t,droppable:c,subject:u,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:o});d&&i(c.descriptor.id,d)},Rde=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Gf})=>{const r=zf(e),i=zf(t);let o=null;const s=c=>{o||ve();const{shouldUseTimeDampening:d,dragStartTime:p}=o;fN({state:c,scrollWindow:r,scrollDroppable:i,dragStartTime:p,shouldUseTimeDampening:d,getAutoScrollerOptions:n})};return{start:c=>{o&&ve();const d=Date.now();let p=!1;const h=()=>{p=!0};fN({state:c,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h,getAutoScrollerOptions:n}),o={dragStartTime:d,shouldUseTimeDampening:p},p&&s(c)},stop:()=>{o&&(r.cancel(),i.cancel(),o=null)},scroll:s}},Dde=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(a,u)=>{const c=_n(a.current.client.selection,u);e({client:c})},i=(a,u)=>{if(!Hb(a,u))return u;const c=kde(a,u);if(!c)return t(a.descriptor.id,u),null;const d=Pr(u,c);return t(a.descriptor.id,d),Pr(u,d)},o=(a,u,c)=>{if(!a||!Bb(u,c))return c;const d=Tde(u,c);if(!d)return n(c),null;const p=Pr(c,d);return n(p),Pr(c,p)};return a=>{const u=a.scrollJumpRequest;if(!u)return;const c=$r(a.impact);c||ve();const d=i(a.dimensions.droppables[c],u);if(!d)return;const p=a.viewport,h=o(a.isWindowScrollAllowed,p,d);h&&r(a,h)}},Lde=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const i=Rde({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),o=Dde({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:u=>{if(!(r().disabled||u.phase!=="DRAGGING")){if(u.movementMode==="FLUID"){i.scroll(u);return}u.scrollJumpRequest&&o(u)}},start:i.start,stop:i.stop}};const Su="data-rfd",Cu=(()=>{const e=`${Su}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),W_=(()=>{const e=`${Su}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Pde=(()=>{const e=`${Su}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),dN={contextId:`${Su}-scroll-container-context-id`},Mde=e=>t=>`[${t}="${e}"]`,Dc=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),$de="pointer-events: none;";var Fde=e=>{const t=Mde(e),n=(()=>{const a=` + cursor: -webkit-grab; + cursor: grab; + `;return{selector:t(Cu.contextId),styles:{always:` + -webkit-touch-callout: none; + -webkit-tap-highlight-color: rgba(0,0,0,0); + touch-action: manipulation; + `,resting:a,dragging:$de,dropAnimating:a}}})(),r=(()=>{const a=` + transition: ${cf.outOfTheWay}; + `;return{selector:t(W_.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),i={selector:t(Pde.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,i,{selector:"body",styles:{dragging:` + cursor: grabbing; + cursor: -webkit-grabbing; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + overflow-anchor: none; + `}}];return{always:Dc(s,"always"),resting:Dc(s,"resting"),dragging:Dc(s,"dragging"),dropAnimating:Dc(s,"dropAnimating"),userCancel:Dc(s,"userCancel")}};const Fr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?A.useLayoutEffect:A.useEffect,K0=()=>{const e=document.querySelector("head");return e||ve(),e},pN=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Bde(e,t){const n=it(()=>Fde(e),[e]),r=A.useRef(null),i=A.useRef(null),o=ke(fn(p=>{const h=i.current;h||ve(),h.textContent=p}),[]),s=ke(p=>{const h=r.current;h||ve(),h.textContent=p},[]);Fr(()=>{!r.current&&!i.current||ve();const p=pN(t),h=pN(t);return r.current=p,i.current=h,p.setAttribute(`${Su}-always`,e),h.setAttribute(`${Su}-dynamic`,e),K0().appendChild(p),K0().appendChild(h),s(n.always),o(n.resting),()=>{const m=v=>{const x=v.current;x||ve(),K0().removeChild(x),v.current=null};m(r),m(i)}},[t,s,o,n.always,n.resting,e]);const a=ke(()=>o(n.dragging),[o,n.dragging]),u=ke(p=>{if(p==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),c=ke(()=>{i.current&&o(n.resting)},[o,n.resting]);return it(()=>({dragging:a,dropping:u,resting:c}),[a,u,c])}function x3(e,t){return Array.from(e.querySelectorAll(t))}var _3=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Rg(e){return e instanceof _3(e).HTMLElement}function Hde(e,t){const n=`[${Cu.contextId}="${e}"]`,r=x3(document,n);if(!r.length)return null;const i=r.find(o=>o.getAttribute(Cu.draggableId)===t);return!i||!Rg(i)?null:i}function zde(e){const t=A.useRef({}),n=A.useRef(null),r=A.useRef(null),i=A.useRef(!1),o=ke(function(h,m){const v={id:h,focus:m};return t.current[h]=v,function(){const b=t.current;b[h]!==v&&delete b[h]}},[]),s=ke(function(h){const m=Hde(e,h);m&&m!==document.activeElement&&m.focus()},[e]),a=ke(function(h,m){n.current===h&&(n.current=m)},[]),u=ke(function(){r.current||i.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const h=n.current;h&&s(h)}))},[s]),c=ke(function(h){n.current=null;const m=document.activeElement;m&&m.getAttribute(Cu.draggableId)===h&&(n.current=h)},[]);return Fr(()=>(i.current=!0,function(){i.current=!1;const h=r.current;h&&cancelAnimationFrame(h)}),[]),it(()=>({register:o,tryRecordFocus:c,tryRestoreFocusRecorded:u,tryShiftRecord:a}),[o,c,u,a])}function jde(){const e={draggables:{},droppables:{}},t=[];function n(p){return t.push(p),function(){const m=t.indexOf(p);m!==-1&&t.splice(m,1)}}function r(p){t.length&&t.forEach(h=>h(p))}function i(p){return e.draggables[p]||null}function o(p){const h=i(p);return h||ve(),h}const s={register:p=>{e.draggables[p.descriptor.id]=p,r({type:"ADDITION",value:p})},update:(p,h)=>{const m=e.draggables[h.descriptor.id];m&&m.uniqueId===p.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:p=>{const h=p.descriptor.id,m=i(h);m&&p.uniqueId===m.uniqueId&&(delete e.draggables[h],e.droppables[p.descriptor.droppableId]&&r({type:"REMOVAL",value:p}))},getById:o,findById:i,exists:p=>!!i(p),getAllByType:p=>Object.values(e.draggables).filter(h=>h.descriptor.type===p)};function a(p){return e.droppables[p]||null}function u(p){const h=a(p);return h||ve(),h}const c={register:p=>{e.droppables[p.descriptor.id]=p},unregister:p=>{const h=a(p.descriptor.id);h&&p.uniqueId===h.uniqueId&&delete e.droppables[p.descriptor.id]},getById:u,findById:a,exists:p=>!!a(p),getAllByType:p=>Object.values(e.droppables).filter(h=>h.descriptor.type===p)};function d(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:c,subscribe:n,clean:d}}function Vde(){const e=it(jde,[]);return A.useEffect(()=>function(){e.clean()},[e]),e}var zb=Q.createContext(null),Nm=()=>{const e=document.body;return e||ve(),e};const Ude={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Wde=e=>`rfd-announcement-${e}`;function Gde(e){const t=it(()=>Wde(e),[e]),n=A.useRef(null);return A.useEffect(function(){const o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),Bf(o.style,Ude),Nm().appendChild(o),function(){setTimeout(function(){const u=Nm();u.contains(o)&&u.removeChild(o),o===n.current&&(n.current=null)})}},[t]),ke(i=>{const o=n.current;if(o){o.textContent=i;return}},[])}const Kde={separator:"::"};function jb(e,t=Kde){const n=Q.useId();return it(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function qde({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Yde({contextId:e,text:t}){const n=jb("hidden-text",{separator:"-"}),r=it(()=>qde({contextId:e,uniqueId:n}),[n,e]);return A.useEffect(function(){const o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",Nm().appendChild(o),function(){const a=Nm();a.contains(o)&&a.removeChild(o)}},[r,t]),r}var Dg=Q.createContext(null);function w3(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),t}function Xde(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&ve();const a={abandon:s};return e=a,a}function i(){e||ve(),e=null}function o(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:n,claim:r,release:i,tryAbandon:o}}function Kf(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Qde=9,Zde=13,Vb=27,b3=32,Jde=33,epe=34,tpe=35,npe=36,rpe=37,ipe=38,ope=39,spe=40,ape={[Zde]:!0,[Qde]:!0};var E3=e=>{ape[e.keyCode]&&e.preventDefault()};const Lg=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),S3=0,hN=5;function lpe(e,t){return Math.abs(t.x-e.x)>=hN||Math.abs(t.y-e.y)>=hN}const mN={type:"IDLE"};function upe({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:i=>{const{button:o,clientX:s,clientY:a}=i;if(o!==S3)return;const u={x:s,y:a},c=n();if(c.type==="DRAGGING"){i.preventDefault(),c.actions.move(u);return}c.type!=="PENDING"&&ve();const d=c.point;if(!lpe(d,u))return;i.preventDefault();const p=c.actions.fluidLift(u);r({type:"DRAGGING",actions:p})}},{eventName:"mouseup",fn:i=>{const o=n();if(o.type!=="DRAGGING"){e();return}i.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:i=>{n().type==="DRAGGING"&&i.preventDefault(),e()}},{eventName:"keydown",fn:i=>{if(n().type==="PENDING"){e();return}if(i.keyCode===Vb){i.preventDefault(),e();return}E3(i)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:i=>{const o=n();if(o.type==="IDLE"&&ve(),o.actions.shouldRespectForcePress()){e();return}i.preventDefault()}},{eventName:Lg,fn:e}]}function cpe(e){const t=A.useRef(mN),n=A.useRef(bs),r=it(()=>({eventName:"mousedown",fn:function(p){if(p.defaultPrevented||p.button!==S3||p.ctrlKey||p.metaKey||p.shiftKey||p.altKey)return;const h=e.findClosestDraggableId(p);if(!h)return;const m=e.tryGetLock(h,s,{sourceEvent:p});if(!m)return;p.preventDefault();const v={x:p.clientX,y:p.clientY};n.current(),c(m,v)}}),[e]),i=it(()=>({eventName:"webkitmouseforcewillbegin",fn:d=>{if(d.defaultPrevented)return;const p=e.findClosestDraggableId(d);if(!p)return;const h=e.findOptionsForDraggable(p);h&&(h.shouldRespectForcePress||e.canGetLock(p)&&d.preventDefault())}}),[e]),o=ke(function(){const p={passive:!1,capture:!0};n.current=ci(window,[i,r],p)},[i,r]),s=ke(()=>{t.current.type!=="IDLE"&&(t.current=mN,n.current(),o())},[o]),a=ke(()=>{const d=t.current;s(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[s]),u=ke(function(){const p={capture:!0,passive:!1},h=upe({cancel:a,completed:s,getPhase:()=>t.current,setPhase:m=>{t.current=m}});n.current=ci(window,h,p)},[a,s]),c=ke(function(p,h){t.current.type!=="IDLE"&&ve(),t.current={type:"PENDING",point:h,actions:p},u()},[u]);Fr(function(){return o(),function(){n.current()}},[o])}function fpe(){}const dpe={[epe]:!0,[Jde]:!0,[npe]:!0,[tpe]:!0};function ppe(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:i=>{if(i.keyCode===Vb){i.preventDefault(),n();return}if(i.keyCode===b3){i.preventDefault(),r();return}if(i.keyCode===spe){i.preventDefault(),e.moveDown();return}if(i.keyCode===ipe){i.preventDefault(),e.moveUp();return}if(i.keyCode===ope){i.preventDefault(),e.moveRight();return}if(i.keyCode===rpe){i.preventDefault(),e.moveLeft();return}if(dpe[i.keyCode]){i.preventDefault();return}E3(i)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Lg,fn:n}]}function hpe(e){const t=A.useRef(fpe),n=it(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==b3)return;const s=e.findClosestDraggableId(o);if(!s)return;const a=e.tryGetLock(s,d,{sourceEvent:o});if(!a)return;o.preventDefault();let u=!0;const c=a.snapLift();t.current();function d(){u||ve(),u=!1,t.current(),r()}t.current=ci(window,ppe(c,d),{capture:!0,passive:!1})}}),[e]),r=ke(function(){const o={passive:!1,capture:!0};t.current=ci(window,[n],o)},[n]);Fr(function(){return r(),function(){t.current()}},[r])}const q0={type:"IDLE"},mpe=120,gpe=.15;function ype({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Vb&&n.preventDefault(),e()}},{eventName:Lg,fn:e}]}function vpe({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const i=n();if(i.type!=="DRAGGING"){e();return}i.hasMoved=!0;const{clientX:o,clientY:s}=r.touches[0],a={x:o,y:s};r.preventDefault(),i.actions.move(a)}},{eventName:"touchend",fn:r=>{const i=n();if(i.type!=="DRAGGING"){e();return}r.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const i=n();i.type==="IDLE"&&ve();const o=r.touches[0];if(!o||!(o.force>=gpe))return;const a=i.actions.shouldRespectForcePress();if(i.type==="PENDING"){a&&e();return}if(a){if(i.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Lg,fn:e}]}function xpe(e){const t=A.useRef(q0),n=A.useRef(bs),r=ke(function(){return t.current},[]),i=ke(function(m){t.current=m},[]),o=it(()=>({eventName:"touchstart",fn:function(m){if(m.defaultPrevented)return;const v=e.findClosestDraggableId(m);if(!v)return;const x=e.tryGetLock(v,a,{sourceEvent:m});if(!x)return;const b=m.touches[0],{clientX:y,clientY:_}=b,E={x:y,y:_};n.current(),p(x,E)}}),[e]),s=ke(function(){const m={capture:!0,passive:!1};n.current=ci(window,[o],m)},[o]),a=ke(()=>{const h=t.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),i(q0),n.current(),s())},[s,i]),u=ke(()=>{const h=t.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),c=ke(function(){const m={capture:!0,passive:!1},v={cancel:u,completed:a,getPhase:r},x=ci(window,vpe(v),m),b=ci(window,ype(v),m);n.current=function(){x(),b()}},[u,r,a]),d=ke(function(){const m=r();m.type!=="PENDING"&&ve();const v=m.actions.fluidLift(m.point);i({type:"DRAGGING",actions:v,hasMoved:!1})},[r,i]),p=ke(function(m,v){r().type!=="IDLE"&&ve();const x=setTimeout(d,mpe);i({type:"PENDING",point:v,actions:m,longPressTimerId:x}),c()},[c,r,i,d]);Fr(function(){return s(),function(){n.current();const v=r();v.type==="PENDING"&&(clearTimeout(v.longPressTimerId),i(q0))}},[r,s,i]),Fr(function(){return ci(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const _pe=["input","button","textarea","select","option","optgroup","video","audio"];function C3(e,t){if(t==null)return!1;if(_pe.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:C3(e,t.parentElement)}function wpe(e,t){const n=t.target;return Rg(n)?C3(e,n):!1}var bpe=e=>Oi(e.getBoundingClientRect()).center;function Epe(e){return e instanceof _3(e).Element}const Spe=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function I3(e,t){return e==null?null:e[Spe](t)?e:I3(e.parentElement,t)}function Cpe(e,t){return e.closest?e.closest(t):I3(e,t)}function Ipe(e){return`[${Cu.contextId}="${e}"]`}function Ape(e,t){const n=t.target;if(!Epe(n))return null;const r=Ipe(e),i=Cpe(n,r);return!i||!Rg(i)?null:i}function Tpe(e,t){const n=Ape(e,t);return n?n.getAttribute(Cu.draggableId):null}function kpe(e,t){const n=`[${W_.contextId}="${e}"]`,i=x3(document,n).find(o=>o.getAttribute(W_.id)===t);return!i||!Rg(i)?null:i}function Npe(e){e.preventDefault()}function Zp({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function A3({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const i=n.draggable.findById(r);return!(!i||!i.options.isEnabled||!m3(t.getState(),r))}function Ope({lockAPI:e,contextId:t,store:n,registry:r,draggableId:i,forceSensorStop:o,sourceEvent:s}){if(!A3({lockAPI:e,store:n,registry:r,draggableId:i}))return null;const u=r.draggable.getById(i),c=kpe(t,u.descriptor.id);if(!c||s&&!u.options.canDragInteractiveElements&&wpe(c,s))return null;const d=e.claim(o||bs);let p="PRE_DRAG";function h(){return u.options.shouldRespectForcePress}function m(){return e.isActive(d)}function v(T,I){Zp({expected:T,phase:p,isLockActive:m,shouldWarn:!0})&&n.dispatch(I())}const x=v.bind(null,"DRAGGING");function b(T){function I(){e.release(),p="COMPLETED"}p!=="PRE_DRAG"&&(I(),ve()),n.dispatch(Cfe(T.liftActionArgs)),p="DRAGGING";function O(M,j={shouldBlockNextClick:!1}){if(T.cleanup(),j.shouldBlockNextClick){const V=ci(window,[{eventName:"click",fn:Npe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}I(),n.dispatch(a3({reason:M}))}return{isActive:()=>Zp({expected:"DRAGGING",phase:p,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,drop:M=>O("DROP",M),cancel:M=>O("CANCEL",M),...T.actions}}function y(T){const I=zf(M=>{x(()=>s3({client:M}))});return{...b({liftActionArgs:{id:i,clientSelection:T,movementMode:"FLUID"},cleanup:()=>I.cancel(),actions:{move:I}}),move:I}}function _(){const T={moveUp:()=>x(Lfe),moveRight:()=>x(Mfe),moveDown:()=>x(Pfe),moveLeft:()=>x($fe)};return b({liftActionArgs:{id:i,clientSelection:bpe(c),movementMode:"SNAP"},cleanup:bs,actions:T})}function E(){Zp({expected:"PRE_DRAG",phase:p,isLockActive:m,shouldWarn:!0})&&e.release()}return{isActive:()=>Zp({expected:"PRE_DRAG",phase:p,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,fluidLift:y,snapLift:_,abort:E}}const Rpe=[cpe,hpe,xpe];function Dpe({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:i}){const o=[...i?Rpe:[],...r||[]],s=A.useState(()=>Xde())[0],a=ke(function(b,y){Kf(b)&&!Kf(y)&&s.tryAbandon()},[s]);Fr(function(){let b=t.getState();return t.subscribe(()=>{const _=t.getState();a(b,_),b=_})},[s,t,a]),Fr(()=>s.tryAbandon,[s.tryAbandon]);const u=ke(x=>A3({lockAPI:s,registry:n,store:t,draggableId:x}),[s,n,t]),c=ke((x,b,y)=>Ope({lockAPI:s,registry:n,contextId:e,store:t,draggableId:x,forceSensorStop:b||null,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null}),[e,s,n,t]),d=ke(x=>Tpe(e,x),[e]),p=ke(x=>{const b=n.draggable.findById(x);return b?b.options:null},[n.draggable]),h=ke(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Lb()))},[s,t]),m=ke(()=>s.isClaimed(),[s]),v=it(()=>({canGetLock:u,tryGetLock:c,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:m}),[u,c,d,p,h,m]);for(let x=0;x({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};qm.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),Ppe=e=>({...Gf,...e.autoScrollerOptions,durationDampening:{...Gf.durationDampening,...e.autoScrollerOptions}});function Lc(e){return e.current||ve(),e.current}function Mpe(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:i,dragHandleUsageInstructions:o}=e,s=A.useRef(null),a=w3(e),u=ke(()=>Lpe(a.current),[a]),c=ke(()=>Ppe(a.current),[a]),d=Gde(t),p=Yde({contextId:t,text:o}),h=Bde(t,i),m=ke(V=>{Lc(s).dispatch(V)},[]),v=it(()=>Hk({publishWhileDragging:Afe,updateDroppableScroll:kfe,updateDroppableIsEnabled:Nfe,updateDroppableIsCombineEnabled:Ofe,collectionStarting:Tfe},m),[m]),x=Vde(),b=it(()=>yde(x,v),[x,v]),y=it(()=>Lde({scrollWindow:vde,scrollDroppable:b.scrollDroppable,getAutoScrollerOptions:c,...Hk({move:s3},m)}),[b.scrollDroppable,m,c]),_=zde(t),E=it(()=>pde({announce:d,autoScroller:y,dimensionMarshal:b,focusMarshal:_,getResponders:u,styleMarshal:h}),[d,y,b,_,u,h]);s.current=E;const C=ke(()=>{const V=Lc(s);V.getState().phase!=="IDLE"&&V.dispatch(Lb())},[]),T=ke(()=>{const V=Lc(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),I=it(()=>({isDragging:T,tryAbort:C}),[T,C]);n(I);const O=ke(V=>m3(Lc(s).getState(),V),[]),M=ke(()=>na(Lc(s).getState()),[]),j=it(()=>({marshal:b,focus:_,contextId:t,canLift:O,isMovementAllowed:M,dragHandleUsageInstructionsId:p,registry:x}),[t,b,p,_,O,M,x]);return Dpe({contextId:t,store:E,registry:x,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),A.useEffect(()=>C,[C]),Q.createElement(Dg.Provider,{value:j},Q.createElement(ice,{context:zb,store:E},e.children))}function $pe(){return Q.useId()}function Fpe(e){const t=$pe(),n=e.dragHandleUsageInstructions||Eh.dragHandleUsageInstructions;return Q.createElement(mce,null,r=>Q.createElement(Mpe,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const gN={dragging:5e3,dropAnimating:4500},Bpe=(e,t)=>t?cf.drop(t.duration):e?cf.snap:cf.fluid,Hpe=(e,t)=>{if(e)return t?Wf.opacity.drop:Wf.opacity.combining},zpe=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function jpe(e){const n=e.dimension.client,{offset:r,combineWith:i,dropping:o}=e,s=!!i,a=zpe(e),u=!!o,c=u?V_.drop(r,s):V_.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Bpe(a,o),transform:c,opacity:Hpe(s,u),zIndex:u?gN.dropAnimating:gN.dragging,pointerEvents:"none"}}function Vpe(e){return{transform:V_.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Upe(e){return e.type==="DRAGGING"?jpe(e):Vpe(e)}function Wpe(e,t,n=pn){const r=window.getComputedStyle(t),i=t.getBoundingClientRect(),o=P$(i,r),s=Im(o,n),a={client:o,tagName:t.tagName.toLowerCase(),display:r.display},u={x:o.marginBox.width,y:o.marginBox.height};return{descriptor:e,placeholder:a,displaceBy:u,client:o,page:s}}function Gpe(e){const t=jb("draggable"),{descriptor:n,registry:r,getDraggableRef:i,canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}=e,u=it(()=>({canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}),[o,a,s]),c=ke(m=>{const v=i();return v||ve(),Wpe(n,v,m)},[n,i]),d=it(()=>({uniqueId:t,descriptor:n,options:u,getDimension:c}),[n,c,u,t]),p=A.useRef(d),h=A.useRef(!0);Fr(()=>(r.draggable.register(p.current),()=>r.draggable.unregister(p.current)),[r.draggable]),Fr(()=>{if(h.current){h.current=!1;return}const m=p.current;p.current=d,r.draggable.update(d,m)},[d,r.draggable])}var Ub=Q.createContext(null);function Om(e){const t=A.useContext(e);return t||ve(),t}function Kpe(e){e.preventDefault()}const qpe=e=>{const t=A.useRef(null),n=ke((I=null)=>{t.current=I},[]),r=ke(()=>t.current,[]),{contextId:i,dragHandleUsageInstructionsId:o,registry:s}=Om(Dg),{type:a,droppableId:u}=Om(Ub),c=it(()=>({id:e.draggableId,index:e.index,type:a,droppableId:u}),[e.draggableId,e.index,a,u]),{children:d,draggableId:p,isEnabled:h,shouldRespectForcePress:m,canDragInteractiveElements:v,isClone:x,mapped:b,dropAnimationFinished:y}=e;if(!x){const I=it(()=>({descriptor:c,registry:s,getDraggableRef:r,canDragInteractiveElements:v,shouldRespectForcePress:m,isEnabled:h}),[c,s,r,v,m,h]);Gpe(I)}const _=it(()=>h?{tabIndex:0,role:"button","aria-describedby":o,"data-rfd-drag-handle-draggable-id":p,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:Kpe}:null,[i,o,p,h]),E=ke(I=>{b.type==="DRAGGING"&&b.dropping&&I.propertyName==="transform"&&qm.flushSync(y)},[y,b]),C=it(()=>{const I=Upe(b),O=b.type==="DRAGGING"&&b.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":i,"data-rfd-draggable-id":p,style:I,onTransitionEnd:O},dragHandleProps:_}},[i,_,p,b,E,n]),T=it(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return Q.createElement(Q.Fragment,null,d(C,b.snapshot,T))};var T3=(e,t)=>e===t,k3=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Ype=e=>e.combine?e.combine.draggableId:null,Xpe=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Qpe(){const e=fn((i,o)=>({x:i,y:o})),t=fn((i,o,s=null,a=null,u=null)=>({isDragging:!0,isClone:o,isDropAnimating:!!u,dropAnimation:u,mode:i,draggingOver:s,combineWith:a,combineTargetFor:null})),n=fn((i,o,s,a,u=null,c=null,d=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:u,combineWith:c,mode:o,offset:i,dimension:s,forceShouldAnimate:d,snapshot:t(o,a,u,c,null)}}));return(i,o)=>{if(Kf(i)){if(i.critical.draggable.id!==o.draggableId)return null;const s=i.current.client.offset,a=i.dimensions.draggables[o.draggableId],u=$r(i.impact),c=Xpe(i.impact),d=i.forceShouldAnimate;return n(e(s.x,s.y),i.movementMode,a,o.isClone,u,c,d)}if(i.phase==="DROP_ANIMATING"){const s=i.completed;if(s.result.draggableId!==o.draggableId)return null;const a=o.isClone,u=i.dimensions.draggables[o.draggableId],c=s.result,d=c.mode,p=k3(c),h=Ype(c),v={duration:i.dropDuration,curve:Mb.drop,moveTo:i.newHomeClientOffset,opacity:h?Wf.opacity.drop:null,scale:h?Wf.scale.drop:null};return{mapped:{type:"DRAGGING",offset:i.newHomeClientOffset,dimension:u,dropping:v,draggingOver:p,combineWith:h,mode:d,forceShouldAnimate:null,snapshot:t(d,a,p,h,v)}}}return null}}function N3(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Zpe={mapped:{type:"SECONDARY",offset:pn,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:N3(null)}};function Jpe(){const e=fn((s,a)=>({x:s,y:a})),t=fn(N3),n=fn((s,a=null,u)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:a,shouldAnimateDisplacement:u,snapshot:t(a)}})),r=s=>s?n(pn,s,!0):null,i=(s,a,u,c)=>{const d=u.displaced.visible[s],p=!!(c.inVirtualList&&c.effected[s]),h=kg(u),m=h&&h.draggableId===s?a:null;if(!d){if(!p)return r(m);if(u.displaced.invisible[s])return null;const b=Hu(c.displacedBy.point),y=e(b.x,b.y);return n(y,m,!0)}if(p)return r(m);const v=u.displacedBy.point,x=e(v.x,v.y);return n(x,m,d.shouldAnimate)};return(s,a)=>{if(Kf(s))return s.critical.draggable.id===a.draggableId?null:i(a.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const u=s.completed;return u.result.draggableId===a.draggableId?null:i(a.draggableId,u.result.draggableId,u.impact,u.afterCritical)}return null}}const ehe=()=>{const e=Qpe(),t=Jpe();return(r,i)=>e(r,i)||t(r,i)||Zpe},the={dropAnimationFinished:l3},nhe=D$(ehe,the,null,{context:zb,areStatePropsEqual:T3})(qpe);function O3(e){return Om(Ub).isUsingCloneFor===e.draggableId&&!e.isClone?null:Q.createElement(nhe,e)}function rhe(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return Q.createElement(O3,Bf({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const R3=e=>t=>e===t,ihe=R3("scroll"),ohe=R3("auto"),yN=(e,t)=>t(e.overflowX)||t(e.overflowY),she=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return yN(n,ihe)||yN(n,ohe)},ahe=()=>!1,D3=e=>e==null?null:e===document.body?ahe()?e:null:e===document.documentElement?null:she(e)?e:D3(e.parentElement);var G_=e=>({x:e.scrollLeft,y:e.scrollTop});const L3=e=>e?window.getComputedStyle(e).position==="fixed"?!0:L3(e.parentElement):!1;var lhe=e=>{const t=D3(e),n=L3(e);return{closestScrollable:t,isFixedOnPage:n}},uhe=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:i,client:o,page:s,closest:a})=>{const u=(()=>{if(!a)return null;const{scrollSize:h,client:m}=a,v=d3({scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:a.page.marginBox,frameClient:m,scrollSize:h,shouldClipSubject:a.shouldClipSubject,scroll:{initial:a.scroll,current:a.scroll,max:v,diff:{value:pn,displacement:pn}}}})(),c=i==="vertical"?kb:W$,d=Eu({page:s,withPlaceholder:null,axis:c,frame:u});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:o,page:s,frame:u,subject:d}};const che=(e,t)=>{const n=M$(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,i=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,s=i+t.scrollWidth,u=Cb({top:r,right:s,bottom:o,left:i},n.border);return Ib({borderBox:u,margin:n.margin,border:n.border,padding:n.padding})};var fhe=({ref:e,descriptor:t,env:n,windowScroll:r,direction:i,isDropDisabled:o,isCombineEnabled:s,shouldClipSubject:a})=>{const u=n.closestScrollable,c=che(e,u),d=Im(c,r),p=(()=>{if(!u)return null;const m=M$(u),v={scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth};return{client:m,page:Im(m,r),scroll:G_(u),scrollSize:v,shouldClipSubject:a}})();return uhe({descriptor:t,isEnabled:!o,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:i,client:c,page:d,closest:p})};const dhe={passive:!1},phe={passive:!0};var vN=e=>e.shouldPublishImmediately?dhe:phe;const Jp=e=>e&&e.env.closestScrollable||null;function hhe(e){const t=A.useRef(null),n=Om(Dg),r=jb("droppable"),{registry:i,marshal:o}=n,s=w3(e),a=it(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),u=A.useRef(a),c=it(()=>fn((C,T)=>{t.current||ve();const I={x:C,y:T};o.updateDroppableScroll(a.id,I)}),[a.id,o]),d=ke(()=>{const C=t.current;return!C||!C.env.closestScrollable?pn:G_(C.env.closestScrollable)},[]),p=ke(()=>{const C=d();c(C.x,C.y)},[d,c]),h=it(()=>zf(p),[p]),m=ke(()=>{const C=t.current,T=Jp(C);if(C&&T||ve(),C.scrollOptions.shouldPublishImmediately){p();return}h()},[h,p]),v=ke((C,T)=>{t.current&&ve();const I=s.current,O=I.getDroppableRef();O||ve();const M=lhe(O),j={ref:O,descriptor:a,env:M,scrollOptions:T};t.current=j;const V=fhe({ref:O,descriptor:a,env:M,windowScroll:C,direction:I.direction,isDropDisabled:I.isDropDisabled,isCombineEnabled:I.isCombineEnabled,shouldClipSubject:!I.ignoreContainerClipping}),F=M.closestScrollable;return F&&(F.setAttribute(dN.contextId,n.contextId),F.addEventListener("scroll",m,vN(j.scrollOptions))),V},[n.contextId,a,m,s]),x=ke(()=>{const C=t.current,T=Jp(C);return C&&T||ve(),G_(T)},[]),b=ke(()=>{const C=t.current;C||ve();const T=Jp(C);t.current=null,T&&(h.cancel(),T.removeAttribute(dN.contextId),T.removeEventListener("scroll",m,vN(C.scrollOptions)))},[m,h]),y=ke(C=>{const T=t.current;T||ve();const I=Jp(T);I||ve(),I.scrollTop+=C.y,I.scrollLeft+=C.x},[]),_=it(()=>({getDimensionAndWatchScroll:v,getScrollWhileDragging:x,dragStopped:b,scroll:y}),[b,v,x,y]),E=it(()=>({uniqueId:r,descriptor:a,callbacks:_}),[_,a,r]);Fr(()=>(u.current=E.descriptor,i.droppable.register(E),()=>{t.current&&b(),i.droppable.unregister(E)}),[_,a,b,E,o,i.droppable]),Fr(()=>{t.current&&o.updateDroppableIsEnabled(u.current.id,!e.isDropDisabled)},[e.isDropDisabled,o]),Fr(()=>{t.current&&o.updateDroppableIsCombineEnabled(u.current.id,e.isCombineEnabled)},[e.isCombineEnabled,o])}function Y0(){}const xN={width:0,height:0,margin:wce},mhe=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?xN:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},ghe=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=mhe({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?cf.placeholder:null}},yhe=e=>{const t=A.useRef(null),n=ke(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:i,onClose:o,contextId:s}=e,[a,u]=A.useState(e.animate==="open");A.useEffect(()=>a?r!=="open"?(n(),u(!1),Y0):t.current?Y0:(t.current=setTimeout(()=>{t.current=null,u(!1)}),n):Y0,[r,a,n]);const c=ke(p=>{p.propertyName==="height"&&(i(),r==="close"&&o())},[r,o,i]),d=ghe({isAnimatingOpenOnMount:a,animate:e.animate,placeholder:e.placeholder});return Q.createElement(e.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":s,onTransitionEnd:c,ref:e.innerRef})};var vhe=Q.memo(yhe);class xhe extends Q.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const _he=e=>{const t=A.useContext(Dg);t||ve();const{contextId:n,isMovementAllowed:r}=t,i=A.useRef(null),o=A.useRef(null),{children:s,droppableId:a,type:u,mode:c,direction:d,ignoreContainerClipping:p,isDropDisabled:h,isCombineEnabled:m,snapshot:v,useClone:x,updateViewportMaxScroll:b,getContainerForClone:y}=e,_=ke(()=>i.current,[]),E=ke((F=null)=>{i.current=F},[]);ke(()=>o.current,[]);const C=ke((F=null)=>{o.current=F},[]),T=ke(()=>{r()&&b({maxScroll:h3()})},[r,b]);hhe({droppableId:a,type:u,mode:c,direction:d,isDropDisabled:h,isCombineEnabled:m,ignoreContainerClipping:p,getDroppableRef:_});const I=it(()=>Q.createElement(xhe,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:F,data:W,animate:Y})=>Q.createElement(vhe,{placeholder:W,onClose:F,innerRef:C,animate:Y,contextId:n,onTransitionEnd:T})),[n,T,e.placeholder,e.shouldAnimatePlaceholder,C]),O=it(()=>({innerRef:E,placeholder:I,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":n}}),[n,a,I,E]),M=x?x.dragging.draggableId:null,j=it(()=>({droppableId:a,type:u,isUsingCloneFor:M}),[a,M,u]);function V(){if(!x)return null;const{dragging:F,render:W}=x,Y=Q.createElement(O3,{draggableId:F.draggableId,index:F.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(L,B)=>W(L,B,F));return la.createPortal(Y,y())}return Q.createElement(Ub.Provider,{value:j},s(O,v),V())};function whe(){return document.body||ve(),document.body}const _N={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:whe},P3=e=>{let t={...e},n;for(n in _N)e[n]===void 0&&(t={...t,[n]:_N[n]});return t},X0=(e,t)=>e===t.droppable.type,wN=(e,t)=>t.draggables[e.draggable.id],bhe=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=fn(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),r=fn((o,s,a,u,c,d)=>{const p=c.descriptor.id;if(c.descriptor.droppableId===o){const v=d?{render:d,dragging:n(c.descriptor)}:null,x={isDraggingOver:a,draggingOverWith:a?p:null,draggingFromThisWith:p,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:x,useClone:v}}if(!s)return t;if(!u)return e;const m={isDraggingOver:a,draggingOverWith:p,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:m,useClone:null}});return(o,s)=>{const a=P3(s),u=a.droppableId,c=a.type,d=!a.isDropDisabled,p=a.renderClone;if(Kf(o)){const h=o.critical;if(!X0(c,h))return t;const m=wN(h,o.dimensions),v=$r(o.impact)===u;return r(u,d,v,v,m,p)}if(o.phase==="DROP_ANIMATING"){const h=o.completed;if(!X0(c,h.critical))return t;const m=wN(h.critical,o.dimensions);return r(u,d,k3(h.result)===u,$r(h.impact)===u,m,p)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const h=o.completed;if(!X0(c,h.critical))return t;const m=$r(h.impact)===u,v=!!(h.impact.at&&h.impact.at.type==="COMBINE"),x=h.critical.droppable.id===u;return m?v?e:t:x?e:t}return t}},Ehe={updateViewportMaxScroll:Dfe},She=D$(bhe,Ehe,(e,t,n)=>({...P3(n),...e,...t}),{context:zb,areStatePropsEqual:T3})(_he);var Che=She;const K_=2**31-1;function M3(e,t,n){const r=n-Date.now();e.current=r<=K_?setTimeout(t,r):setTimeout(()=>M3(e,t,n),K_)}function Ihe(){const e=G1(),t=A.useRef();return hb(()=>clearTimeout(t.current)),A.useMemo(()=>{const n=()=>clearTimeout(t.current);function r(i,o=0){e()&&(n(),o<=K_?t.current=setTimeout(i,o):M3(t,i,Date.now()+o))}return{set:r,clear:n,handleRef:t}},[])}const Ahe={[si]:"showing",[wu]:"showing show"},$3=A.forwardRef((e,t)=>S.jsx(Da,{...e,ref:t,transitionClasses:Ahe}));$3.displayName="ToastFade";const F3=A.createContext({onClose(){}}),B3=A.forwardRef(({bsPrefix:e,closeLabel:t="Close",closeVariant:n,closeButton:r=!0,className:i,children:o,...s},a)=>{e=Fe(e,"toast-header");const u=A.useContext(F3),c=Ot(d=>{u==null||u.onClose==null||u.onClose(d)});return S.jsxs("div",{ref:a,...s,className:Te(e,i),children:[o,r&&S.jsx(fd,{"aria-label":t,variant:n,onClick:c,"data-dismiss":"toast"})]})});B3.displayName="ToastHeader";const H3=A.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=Fe(t,"toast-body"),S.jsx(n,{ref:i,className:Te(e,t),...r})));H3.displayName="ToastBody";const z3=A.forwardRef(({bsPrefix:e,className:t,transition:n=$3,show:r=!0,animation:i=!0,delay:o=5e3,autohide:s=!1,onClose:a,onEntered:u,onExit:c,onExiting:d,onEnter:p,onEntering:h,onExited:m,bg:v,...x},b)=>{e=Fe(e,"toast");const y=A.useRef(o),_=A.useRef(a);A.useEffect(()=>{y.current=o,_.current=a},[o,a]);const E=Ihe(),C=!!(s&&r),T=A.useCallback(()=>{C&&(_.current==null||_.current())},[C]);A.useEffect(()=>{E.set(T,y.current)},[E,T]);const I=A.useMemo(()=>({onClose:a}),[a]),O=!!(n&&i),M=S.jsx("div",{...x,ref:b,className:Te(e,t,v&&`bg-${v}`,!O&&(r?"show":"hide")),role:"alert","aria-live":"assertive","aria-atomic":"true"});return S.jsx(F3.Provider,{value:I,children:O&&n?S.jsx(n,{in:r,onEnter:p,onEntering:h,onEntered:u,onExit:c,onExiting:d,onExited:m,unmountOnExit:!0,children:M}):M})});z3.displayName="Toast";const bN=Object.assign(z3,{Body:H3,Header:B3}),The={"top-start":"top-0 start-0","top-center":"top-0 start-50 translate-middle-x","top-end":"top-0 end-0","middle-start":"top-50 start-0 translate-middle-y","middle-center":"top-50 start-50 translate-middle","middle-end":"top-50 end-0 translate-middle-y","bottom-start":"bottom-0 start-0","bottom-center":"bottom-0 start-50 translate-middle-x","bottom-end":"bottom-0 end-0"},j3=A.forwardRef(({bsPrefix:e,position:t,containerPosition:n,className:r,as:i="div",...o},s)=>(e=Fe(e,"toast-container"),S.jsx(i,{ref:s,...o,className:Te(e,t&&The[t],n&&`position-${n}`,r)})));j3.displayName="ToastContainer";function khe({id:e,showModal:t,setShowModal:n}){const[r,i]=A.useState(e),[o,s]=A.useState(""),{flowchart:a,renameVariable:u}=Kr(),{getString:c}=sn();A.useEffect(()=>{i(e)},[t]),A.useEffect(()=>{const p="var",h=ud.match(`${p} ${r}`,"Command");if(h.failed()){const m=c("SyntaxError",{pos:h.getInterval().startIdx-p.length-1,expected:D1(h)});s(m)}else{const m=ue.reject(a.variables,{id:e}),v=Wa(h).check(m);s(v!==null?c(v.message,v.payload):"")}},[r]);const d=p=>{p.preventDefault(),setTimeout(()=>{u(e,r.trim())},200),n(!1)};return S.jsx(ft,{show:t,onHide:()=>n(!1),children:S.jsxs(wa,{onSubmit:d,children:[S.jsx(ft.Header,{closeButton:!0,children:S.jsx(ft.Title,{children:c("ModalRenameVariable_Title")})}),S.jsx(ft.Body,{children:S.jsx(zM,{helpText:c("ModalRenameVariable_HelpText"),value:r,setValue:i,problem:c(o)})}),S.jsxs(ft.Footer,{children:[S.jsx(Dn,{variant:"secondary",onClick:()=>n(!1),children:c("Button_Cancel")}),S.jsx(Dn,{variant:"primary",type:"submit",disabled:o!=="",children:c("Button_Rename")})]})]})})}function Nhe({id:e}){const[t,n]=A.useState(!1),{changeVariableType:r,removeVariable:i}=Kr(),{machineState:o}=$s(),{getString:s}=sn();if(!ue.has(o.memory,e))return S.jsx(S.Fragment,{});const{type:a,value:u}=o.memory[e];return S.jsxs(S.Fragment,{children:[S.jsx(khe,{id:e,showModal:t,setShowModal:n}),S.jsx("td",{children:S.jsx(Dn,{variant:"secondary",size:"sm",className:"font-monospace",onClick:()=>n(!0),children:e})}),S.jsx("td",{children:S.jsx(wa.Select,{size:"sm",value:a,onChange:c=>r(e,c.target.value),className:"w-auto",children:ue.map(Xn,c=>S.jsx("option",{value:c,children:s(`DataType_${c}`)},c))})}),S.jsx("td",{className:"w-100",children:S.jsx("small",{className:"d-flex p-1 fw-bold font-monospace text-success bg-success bg-opacity-10 border border-success border-opacity-10 rounded-1",children:u===null?"?":JSON.stringify(u)})}),S.jsx("td",{children:S.jsx(Du,{text:s("VariableList_Remove"),children:S.jsx(Dn,{variant:"danger",size:"sm",onClick:()=>i(e),children:S.jsx("i",{className:"bi bi-trash-fill"})})})})]})}function Ohe(){const{flowchart:e,addVariable:t,reorderVariables:n}=Kr(),{getString:r}=sn(),i=()=>{var s;(s=document.activeElement)==null||s.blur()},o=({source:s,destination:a})=>{n(s.index,a==null?void 0:a.index)};return S.jsxs("div",{className:"d-flex flex-column h-100",children:[S.jsxs("div",{className:"d-flex flex-row justify-content-between align-items-center mb-2 gap-3",children:[S.jsx("span",{className:"fw-semibold",children:r("VariableList_Title")}),S.jsx(Dn,{size:"sm",className:"fw-semibold text-nowrap",onClick:t,children:r("VariableList_Add")})]}),S.jsx("div",{style:{overflowY:"auto",overflowX:"clip"},children:S.jsx(ta,{size:"sm",variant:"borderless",className:"mb-0",children:S.jsx(Fpe,{onDragStart:i,onDragEnd:o,children:S.jsx(Che,{droppableId:"droppable",children:({innerRef:s,droppableProps:a,placeholder:u})=>S.jsxs("tbody",{ref:s,...a,children:[ue.map(e.variables,({id:c},d)=>S.jsx(rhe,{draggableId:`${d}`,index:d,children:({innerRef:p,draggableProps:h,dragHandleProps:m})=>S.jsx("tr",{ref:p,...h,...m,children:S.jsx(Nhe,{id:c})})},d)),u]})})})})})]})}function Rhe(){const{toasts:e}=Gr();return S.jsx(j3,{className:"position-fixed bottom-0 end-0 m-3",children:ue.map(e,(t,n)=>S.jsx(bN,{bg:t.background,className:"text-white",children:S.jsxs(bN.Body,{children:[S.jsx("i",{className:`bi ${t.icon} me-2`})," ",t.message]})},n))})}function Dhe(){const{flowchart:e}=Kr(),{resetMachine:t}=$s(),n=JSON.stringify(ue.map(e.nodes,i=>ue.pick(i,["id","data"]))),r=JSON.stringify(ue.map(e.edges,i=>ue.pick(i,["source","sourceHandle","target"])));return A.useEffect(()=>{t(e)},[n,r,e.variables]),S.jsx(S.Fragment,{})}function Lhe(){const{importSimpleFlowchart:e}=Kr(),{triggerToast:t}=Gr(),{getString:n}=sn();return A.useEffect(()=>{const r=new URL(window.location.href),i=r.searchParams.get("lzs");if(i!==null)try{const o=Mle(i);e(o),r.searchParams.delete("lzs"),window.history.replaceState({},"",r.toString()),t({message:n("ToastMessage_ImportSuccess"),icon:"bi-check-circle",background:"success"})}catch{t({message:n("ToastMessage_ImportError"),icon:"bi-exclamation-triangle",background:"danger"})}},[]),S.jsx(S.Fragment,{})}function Phe(){const e={backgroundColor:At.gray300,background:`repeating-linear-gradient( + 45deg, + ${At.gray300}, + ${At.gray300} 2px, + ${At.gray100} 2px, + ${At.gray100} 4px + )`};return S.jsxs(f1,{children:[S.jsx(zae,{}),S.jsx(Dhe,{}),S.jsx(Lhe,{}),S.jsx(Rhe,{}),S.jsxs($a,{className:"vh-100 h-100",style:{userSelect:"none"},children:[S.jsx(Yle,{}),S.jsxs(Ux,{direction:"horizontal",autoSaveId:"fluxolab_main",children:[S.jsx("div",{className:"bg-light p-3",children:S.jsx(Qle,{})}),S.jsx(Bc,{defaultSize:70,minSize:50,children:S.jsx(Cae,{})}),S.jsx(Wx,{style:{width:"6px",...e}}),S.jsx(Bc,{defaultSize:30,minSize:24,children:S.jsxs(Ux,{direction:"vertical",autoSaveId:"fluxolab_right",className:"bg-light",children:[S.jsx(Bc,{defaultSize:40,minSize:24,className:"p-3",children:S.jsx(Ohe,{})}),S.jsx(Wx,{style:{height:"6px",...e}}),S.jsx(Bc,{defaultSize:60,className:"p-3",children:S.jsx(eue,{})})]})})]})]})]})}const V3=document.createElement("div"),Mhe=PO(V3);Mhe.render(S.jsx(Phe,{}));document.body.appendChild(V3); diff --git a/index.html b/index.html index 2599c15..2a0acff 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ FluxoLab.app - +