@theclearsky/react-blender-nodes 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Q,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],T):(Q=typeof globalThis<"u"?globalThis:Q||self,T(Q["react-blender-nodes"]={},Q.React))})(this,function(Q,T){"use strict";function Fl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const pe=Fl(T);function Wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cn={exports:{}},Ct={};/**
1
+ (function(ee,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],O):(ee=typeof globalThis<"u"?globalThis:ee||self,O(ee["react-blender-nodes"]={},ee.React,ee.ReactDOM))})(this,function(ee,O,Tu){"use strict";function Di(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=Di(O),Mu=Di(Tu);function Au(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Yt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Dr;function Yl(){if(Dr)return Ct;Dr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return Ct.Fragment=t,Ct.jsx=n,Ct.jsxs=n,Ct}var kt={};/**
9
+ */var Ri;function Iu(){if(Ri)return Yt;Ri=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return Yt.Fragment=t,Yt.jsx=n,Yt.jsxs=n,Yt}var Xt={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var zr;function Xl(){return zr||(zr=1,process.env.NODE_ENV!=="production"&&function(){function e(S){if(S==null)return null;if(typeof S=="function")return S.$$typeof===V?null:S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case g:return"Fragment";case w:return"Profiler";case y:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList";case z:return"Activity"}if(typeof S=="object")switch(typeof S.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case p:return"Portal";case m:return(S.displayName||"Context")+".Provider";case _:return(S._context.displayName||"Context")+".Consumer";case x:var O=S.render;return S=S.displayName,S||(S=O.displayName||O.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case M:return O=S.displayName||null,O!==null?O:e(S.type)||"Memo";case N:O=S._payload,S=S._init;try{return e(S(O))}catch{}}return null}function t(S){return""+S}function n(S){try{t(S);var O=!1}catch{O=!0}if(O){O=console;var H=O.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return H.call(O,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(S)}}function o(S){if(S===g)return"<>";if(typeof S=="object"&&S!==null&&S.$$typeof===N)return"<...>";try{var O=e(S);return O?"<"+O+">":"<...>"}catch{return"<...>"}}function r(){var S=j.A;return S===null?null:S.getOwner()}function i(){return Error("react-stack-top-frame")}function s(S){if(D.call(S,"key")){var O=Object.getOwnPropertyDescriptor(S,"key").get;if(O&&O.isReactWarning)return!1}return S.key!==void 0}function a(S,O){function H(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",O))}H.isReactWarning=!0,Object.defineProperty(S,"key",{get:H,configurable:!0})}function l(){var S=e(this.type);return k[S]||(k[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function c(S,O,H,B,F,U,K,W){return H=U.ref,S={$$typeof:h,type:S,key:O,props:U,_owner:F},(H!==void 0?H:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:l}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function d(S,O,H,B,F,U,K,W){var R=O.children;if(R!==void 0)if(B)if(L(R)){for(B=0;B<R.length;B++)f(R[B]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(R);if(D.call(O,"key")){R=e(S);var Y=Object.keys(O).filter(function(re){return re!=="key"});B=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",$[R+B]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Li;function Pu(){return Li||(Li=1,process.env.NODE_ENV!=="production"&&function(){function e(_){if(_==null)return null;if(typeof _=="function")return _.$$typeof===H?null:_.displayName||_.name||null;if(typeof _=="string")return _;switch(_){case g:return"Fragment";case b:return"Profiler";case x:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof _=="object")switch(typeof _.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),_.$$typeof){case p:return"Portal";case m:return(_.displayName||"Context")+".Provider";case v:return(_._context.displayName||"Context")+".Consumer";case w:var D=_.render;return _=_.displayName,_||(_=D.displayName||D.name||"",_=_!==""?"ForwardRef("+_+")":"ForwardRef"),_;case I:return D=_.displayName||null,D!==null?D:e(_.type)||"Memo";case M:D=_._payload,_=_._init;try{return e(_(D))}catch{}}return null}function t(_){return""+_}function n(_){try{t(_);var D=!1}catch{D=!0}if(D){D=console;var z=D.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&_[Symbol.toStringTag]||_.constructor.name||"Object";return z.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(_)}}function o(_){if(_===g)return"<>";if(typeof _=="object"&&_!==null&&_.$$typeof===M)return"<...>";try{var D=e(_);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function r(){var _=j.A;return _===null?null:_.getOwner()}function i(){return Error("react-stack-top-frame")}function s(_){if(R.call(_,"key")){var D=Object.getOwnPropertyDescriptor(_,"key").get;if(D&&D.isReactWarning)return!1}return _.key!==void 0}function a(_,D){function z(){A||(A=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}z.isReactWarning=!0,Object.defineProperty(_,"key",{get:z,configurable:!0})}function c(){var _=e(this.type);return T[_]||(T[_]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),_=this.props.ref,_!==void 0?_:null}function l(_,D,z,F,B,Y,K,W){return z=Y.ref,_={$$typeof:f,type:_,key:D,props:Y,_owner:B},(z!==void 0?z:null)!==null?Object.defineProperty(_,"ref",{enumerable:!1,get:c}):Object.defineProperty(_,"ref",{enumerable:!1,value:null}),_._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(_,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(_,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(_,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_}function u(_,D,z,F,B,Y,K,W){var V=D.children;if(V!==void 0)if(F)if($(V)){for(F=0;F<V.length;F++)h(V[F]);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(V);if(R.call(D,"key")){V=e(_);var X=Object.keys(D).filter(function(te){return te!=="key"});F=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",P[V+F]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,B,R,Y,R),$[R+B]=!0)}if(R=null,H!==void 0&&(n(H),R=""+H),s(O)&&(n(O.key),R=""+O.key),"key"in O){H={};for(var ee in O)ee!=="key"&&(H[ee]=O[ee])}else H=O;return R&&a(H,typeof S=="function"?S.displayName||S.name||"Unknown":S),c(S,R,U,F,r(),H,K,W)}function f(S){typeof S=="object"&&S!==null&&S.$$typeof===h&&S._store&&(S._store.validated=1)}var u=T,h=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),j=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,L=Array.isArray,b=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(S){return S()}};var I,k={},A=u.react_stack_bottom_frame.bind(u,i)(),P=b(o(i)),$={};kt.Fragment=g,kt.jsx=function(S,O,H,B,F){var U=1e4>j.recentlyCreatedOwnerStacks++;return d(S,O,H,!1,B,F,U?Error("react-stack-top-frame"):A,U?b(o(S)):P)},kt.jsxs=function(S,O,H,B,F){var U=1e4>j.recentlyCreatedOwnerStacks++;return d(S,O,H,!0,B,F,U?Error("react-stack-top-frame"):A,U?b(o(S)):P)}}()),kt}var $r;function Gl(){return $r||($r=1,process.env.NODE_ENV==="production"?cn.exports=Yl():cn.exports=Xl()),cn.exports}var v=Gl();function jr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ul(...e){return t=>{let n=!1;const o=e.map(r=>{const i=jr(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():jr(e[r],null)}}}}function ql(e){const t=Kl(e),n=pe.forwardRef((o,r)=>{const{children:i,...s}=o,a=pe.Children.toArray(i),l=a.find(Jl);if(l){const c=l.props.children,d=a.map(f=>f===l?pe.Children.count(c)>1?pe.Children.only(null):pe.isValidElement(c)?c.props.children:null:f);return v.jsx(t,{...s,ref:r,children:pe.isValidElement(c)?pe.cloneElement(c,void 0,d):null})}return v.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var Zl=ql("Slot");function Kl(e){const t=pe.forwardRef((n,o)=>{const{children:r,...i}=n;if(pe.isValidElement(r)){const s=tc(r),a=ec(i,r.props);return r.type!==pe.Fragment&&(a.ref=o?Ul(o,s):s),pe.cloneElement(r,a)}return pe.Children.count(r)>1?pe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ql=Symbol("radix.slottable");function Jl(e){return pe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ql}function ec(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function tc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hr(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hr(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Lr(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hr(e))&&(o&&(o+=" "),o+=t);return o}const Vr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rr=Lr,nc=(e,t)=>n=>{var o;if(t?.variants==null)return Rr(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(c=>{const d=n?.[c],f=i?.[c];if(d===null)return null;const u=Vr(d)||Vr(f);return r[c][u]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,u]=d;return u===void 0||(c[f]=u),c},{}),l=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,d)=>{let{class:f,className:u,...h}=d;return Object.entries(h).every(p=>{let[g,y]=p;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,f,u]:c},[]);return Rr(e,s,l,n?.class,n?.className)},po="-",oc=e=>{const t=ic(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(po);return a[0]===""&&a.length!==1&&a.shift(),Br(a,t)||rc(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},Br=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Br(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(po);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Fr=/^\[(.+)\]$/,rc=e=>{if(Fr.test(e)){const t=Fr.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ic=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const r in n)go(n[r],o,r,t);return o},go=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Wr(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(sc(r)){go(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{go(s,Wr(t,i),n,o)})})},Wr=(e,t)=>{let n=e;return t.split(po).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},sc=e=>e.isThemeGetter,ac=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},mo="!",yo=":",lc=yo.length,cc=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const i=[];let s=0,a=0,l=0,c;for(let p=0;p<r.length;p++){let g=r[p];if(s===0&&a===0){if(g===yo){i.push(r.slice(l,p)),l=p+lc;continue}if(g==="/"){c=p;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const d=i.length===0?r:r.substring(l),f=uc(d),u=f!==d,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:h}};if(t){const r=t+yo,i=o;o=s=>s.startsWith(r)?i(s.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const r=o;o=i=>n({className:i,parseClassName:r})}return o},uc=e=>e.endsWith(mo)?e.substring(0,e.length-1):e.startsWith(mo)?e.substring(1):e,dc=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const r=[];let i=[];return o.forEach(s=>{s[0]==="["||t[s]?(r.push(...i.sort(),s),i=[]):i.push(s)}),r.push(...i.sort()),r}},fc=e=>({cache:ac(e.cacheSize),parseClassName:cc(e),sortModifiers:dc(e),...oc(e)}),hc=/\s+/,pc=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:i}=t,s=[],a=e.trim().split(hc);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}=n(d);if(f){l=d+(l.length>0?" "+l:l);continue}let y=!!g,w=o(y?p.substring(0,g):p);if(!w){if(!y){l=d+(l.length>0?" "+l:l);continue}if(w=o(p),!w){l=d+(l.length>0?" "+l:l);continue}y=!1}const _=i(u).join(":"),m=h?_+mo:_,x=m+w;if(s.includes(x))continue;s.push(x);const C=r(w,y);for(let E=0;E<C.length;++E){const M=C[E];s.push(m+M)}l=d+(l.length>0?" "+l:l)}return l};function gc(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Yr(t))&&(o&&(o+=" "),o+=n);return o}const Yr=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Yr(e[o]))&&(n&&(n+=" "),n+=t);return n};function mc(e,...t){let n,o,r,i=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return n=fc(c),o=n.cache.get,r=n.cache.set,i=a,a(l)}function a(l){const c=o(l);if(c)return c;const d=pc(l,n);return r(l,d),d}return function(){return i(gc.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Xr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yc=/^\d+\/\d+$/,xc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_c=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>yc.test(e),te=e=>!!e&&!Number.isNaN(Number(e)),He=e=>!!e&&Number.isInteger(Number(e)),xo=e=>e.endsWith("%")&&te(e.slice(0,-1)),Oe=e=>xc.test(e),Ec=()=>!0,Sc=e=>wc.test(e)&&!bc.test(e),Ur=()=>!1,Nc=e=>vc.test(e),Cc=e=>_c.test(e),kc=e=>!X(e)&&!G(e),Tc=e=>rt(e,Jr,Ur),X=e=>Xr.test(e),Fe=e=>rt(e,ei,Sc),wo=e=>rt(e,Oc,te),qr=e=>rt(e,Kr,Ur),Mc=e=>rt(e,Qr,Cc),un=e=>rt(e,ti,Nc),G=e=>Gr.test(e),Tt=e=>it(e,ei),Ac=e=>it(e,Dc),Zr=e=>it(e,Kr),Ic=e=>it(e,Jr),Pc=e=>it(e,Qr),dn=e=>it(e,ti,!0),rt=(e,t,n)=>{const o=Xr.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},it=(e,t,n=!1)=>{const o=Gr.exec(e);return o?o[1]?t(o[1]):n:!1},Kr=e=>e==="position"||e==="percentage",Qr=e=>e==="image"||e==="url",Jr=e=>e==="length"||e==="size"||e==="bg-size",ei=e=>e==="length",Oc=e=>e==="number",Dc=e=>e==="family-name",ti=e=>e==="shadow",zc=mc(()=>{const e=de("color"),t=de("font"),n=de("text"),o=de("font-weight"),r=de("tracking"),i=de("leading"),s=de("breakpoint"),a=de("container"),l=de("spacing"),c=de("radius"),d=de("shadow"),f=de("inset-shadow"),u=de("text-shadow"),h=de("drop-shadow"),p=de("blur"),g=de("perspective"),y=de("aspect"),w=de("ease"),_=de("animate"),m=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...x(),G,X],E=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],N=()=>[G,X,l],z=()=>[ot,"full","auto",...N()],V=()=>[He,"none","subgrid",G,X],j=()=>["auto",{span:["full",He,G,X]},He,G,X],D=()=>[He,"auto",G,X],L=()=>["auto","min","max","fr",G,X],b=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...N()],A=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],P=()=>[e,G,X],$=()=>[...x(),Zr,qr,{position:[G,X]}],S=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",Ic,Tc,{size:[G,X]}],H=()=>[xo,Tt,Fe],B=()=>["","none","full",c,G,X],F=()=>["",te,Tt,Fe],U=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[te,xo,Zr,qr],R=()=>["","none",p,G,X],Y=()=>["none",te,G,X],ee=()=>["none",te,G,X],re=()=>[te,G,X],Z=()=>[ot,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oe],breakpoint:[Oe],color:[Ec],container:[Oe],"drop-shadow":[Oe],ease:["in","out","in-out"],font:[kc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oe],shadow:[Oe],spacing:["px",te],text:[Oe],"text-shadow":[Oe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,X,G,y]}],container:["container"],columns:[{columns:[te,X,G,a]}],"break-after":[{"break-after":m()}],"break-before":[{"break-before":m()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[He,"auto",G,X]}],basis:[{basis:[ot,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[te,ot,"auto","initial","none",X]}],grow:[{grow:["",te,G,X]}],shrink:[{shrink:["",te,G,X]}],order:[{order:[He,"first","last","none",G,X]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...b(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...b()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":b()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[a,"screen",...A()]}],"min-w":[{"min-w":[a,"screen","none",...A()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",n,Tt,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,G,wo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xo,X]}],"font-family":[{font:[Ac,X,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,G,X]}],"line-clamp":[{"line-clamp":[te,"none",G,wo]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",G,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,X]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[te,"from-font","auto",G,Fe]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[te,"auto",G,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:S()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},He,G,X],radial:["",G,X],conic:[He,G,X]},Pc,Mc]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[te,G,X]}],"outline-w":[{outline:["",te,Tt,Fe]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",d,dn,un]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",f,dn,un]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[te,Fe]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",u,dn,un]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[te,G,X]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[te]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[G,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[te]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:S()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,X]}],filter:[{filter:["","none",G,X]}],blur:[{blur:R()}],brightness:[{brightness:[te,G,X]}],contrast:[{contrast:[te,G,X]}],"drop-shadow":[{"drop-shadow":["","none",h,dn,un]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",te,G,X]}],"hue-rotate":[{"hue-rotate":[te,G,X]}],invert:[{invert:["",te,G,X]}],saturate:[{saturate:[te,G,X]}],sepia:[{sepia:["",te,G,X]}],"backdrop-filter":[{"backdrop-filter":["","none",G,X]}],"backdrop-blur":[{"backdrop-blur":R()}],"backdrop-brightness":[{"backdrop-brightness":[te,G,X]}],"backdrop-contrast":[{"backdrop-contrast":[te,G,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",te,G,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[te,G,X]}],"backdrop-invert":[{"backdrop-invert":["",te,G,X]}],"backdrop-opacity":[{"backdrop-opacity":[te,G,X]}],"backdrop-saturate":[{"backdrop-saturate":[te,G,X]}],"backdrop-sepia":[{"backdrop-sepia":["",te,G,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[te,"initial",G,X]}],ease:[{ease:["linear","initial",w,G,X]}],delay:[{delay:[te,G,X]}],animate:[{animate:["none",_,G,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,G,X]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[G,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G,X]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G,X]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[te,Tt,Fe,wo]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ie(...e){return zc(Lr(e))}const $c=nc("inline-flex items-center justify-center gap-2 py-2 px-4 rounded-md transition-all text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white disabled:cursor-not-allowed outline-none focus-visible:outline-none border",{variants:{color:{dark:"bg-secondary-black border-secondary-dark-gray",lightNonPriority:"bg-primary-gray border-transparent",lightPriority:"bg-primary-gray border-transparent",lightParentGroupBasedHover:"bg-primary-gray border-transparent"},applyHoverStyles:{true:"",false:""}},defaultVariants:{color:"dark",applyHoverStyles:!0},compoundVariants:[{color:"dark",applyHoverStyles:!0,className:"hover:bg-primary-dark-gray"},{color:"lightNonPriority",applyHoverStyles:!0,className:"hover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightPriority",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightParentGroupBasedHover",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray group-hover/lightParentGroupBasedHover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"}]}),st=T.forwardRef(({className:e,color:t,asChild:n=!1,applyHoverStyles:o,...r},i)=>{const s=n?Zl:"button";return v.jsx(s,{ref:i,"data-slot":"button",className:ie($c({color:t,className:e,applyHoverStyles:o})),...r})});st.displayName="Button";function bo(e,t,n,o=!1,r=!1){if(t>n){const i=t;t=n,n=i}return(o?e>=t:e>t)&&(r?e<=n:e<n)}function ni(e,t,n=!1,o=!1){return bo(e.x,t.left,t.right,n)&&bo(e.y,t.top,t.bottom,o)}function oi(e){const t=e.startsWith("-"),n=e.replaceAll(/[^0-9\.]/g,""),o=n.indexOf(".");let r=0;if(o===-1)r=Number(n);else{const i=n.substring(0,o).replaceAll(/[^0-9]/g,""),s=n.substring(o+1).replaceAll(/[^0-9]/g,"");r=+(i+"."+s)}return t&&(r=-r),r}function vo(e,t){return e.toFixed(t).replace(/[0]+$/,"").replace(/\.$/,"")}const ke=["string","number","complex","noEquivalent","inferFromConnection"],ri={[ke[0]]:ke[0],[ke[1]]:ke[1],[ke[2]]:ke[2],[ke[3]]:ke[3],[ke[4]]:ke[4]};function jc(e){return!!ri[e]}function Hc(e){return e}function Lc(e,t){return e in t}function Vc(e){return e}function Rc(e,t){return e in t}function Bc(e){return e}function Fc(e){return e}function Wc(e){return e}var ii=Symbol.for("immer-nothing"),si=Symbol.for("immer-draftable"),xe=Symbol.for("immer-state"),Yc=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ge(e,...t){if(process.env.NODE_ENV!=="production"){const n=Yc[e],o=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var at=Object.getPrototypeOf;function lt(e){return!!e&&!!e[xe]}function We(e){return e?ai(e)||Array.isArray(e)||!!e[si]||!!e.constructor?.[si]||Mt(e)||pn(e):!1}var Xc=Object.prototype.constructor.toString();function ai(e){if(!e||typeof e!="object")return!1;const t=at(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Xc}function fn(e,t){hn(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function hn(e){const t=e[xe];return t?t.type_:Array.isArray(e)?1:Mt(e)?2:pn(e)?3:0}function _o(e,t){return hn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function li(e,t,n){const o=hn(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function Gc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mt(e){return e instanceof Map}function pn(e){return e instanceof Set}function Ye(e){return e.copy_||e.base_}function Eo(e,t){if(Mt(e))return new Map(e);if(pn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ai(e);if(t===!0||t==="class_only"&&!n){const o=Object.getOwnPropertyDescriptors(e);delete o[xe];let r=Reflect.ownKeys(o);for(let i=0;i<r.length;i++){const s=r[i],a=o[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(o[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(at(e),o)}else{const o=at(e);if(o!==null&&n)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function So(e,t=!1){return mn(e)||lt(e)||!We(e)||(hn(e)>1&&Object.defineProperties(e,{set:{value:gn},add:{value:gn},clear:{value:gn},delete:{value:gn}}),Object.freeze(e),t&&Object.values(e).forEach(n=>So(n,!0))),e}function gn(){ge(2)}function mn(e){return Object.isFrozen(e)}var Uc={};function Xe(e){const t=Uc[e];return t||ge(0,e),t}var At;function ci(){return At}function qc(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ui(e,t){t&&(Xe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function No(e){Co(e),e.drafts_.forEach(Zc),e.drafts_=null}function Co(e){e===At&&(At=e.parent_)}function di(e){return At=qc(At,e)}function Zc(e){const t=e[xe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fi(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[xe].modified_&&(No(t),ge(4)),We(e)&&(e=yn(t,e),t.parent_||xn(t,e)),t.patches_&&Xe("Patches").generateReplacementPatches_(n[xe].base_,e,t.patches_,t.inversePatches_)):e=yn(t,n,[]),No(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ii?e:void 0}function yn(e,t,n){if(mn(t))return t;const o=t[xe];if(!o)return fn(t,(r,i)=>hi(e,o,t,r,i,n)),t;if(o.scope_!==e)return t;if(!o.modified_)return xn(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let i=r,s=!1;o.type_===3&&(i=new Set(r),r.clear(),s=!0),fn(i,(a,l)=>hi(e,o,r,a,l,n,s)),xn(e,r,!1),n&&e.patches_&&Xe("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function hi(e,t,n,o,r,i,s){if(process.env.NODE_ENV!=="production"&&r===n&&ge(5),lt(r)){const a=i&&t&&t.type_!==3&&!_o(t.assigned_,o)?i.concat(o):void 0,l=yn(e,r,a);if(li(n,o,l),lt(l))e.canAutoFreeze_=!1;else return}else s&&n.add(r);if(We(r)&&!mn(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yn(e,r),(!t||!t.scope_.parent_)&&typeof o!="symbol"&&(Mt(n)?n.has(o):Object.prototype.propertyIsEnumerable.call(n,o))&&xn(e,r)}}function xn(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&So(t,n)}function Kc(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:ci(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=ko;n&&(r=[o],i=It);const{revoke:s,proxy:a}=Proxy.revocable(r,i);return o.draft_=a,o.revoke_=s,a}var ko={get(e,t){if(t===xe)return e;const n=Ye(e);if(!_o(n,t))return Qc(e,n,t);const o=n[t];return e.finalized_||!We(o)?o:o===To(e.base_,t)?(Ao(e),e.copy_[t]=Io(o,e)):o},has(e,t){return t in Ye(e)},ownKeys(e){return Reflect.ownKeys(Ye(e))},set(e,t,n){const o=pi(Ye(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const r=To(Ye(e),t),i=r?.[xe];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Gc(n,r)&&(n!==void 0||_o(e.base_,t)))return!0;Ao(e),Mo(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return To(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ao(e),Mo(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ye(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty(){ge(11)},getPrototypeOf(e){return at(e.base_)},setPrototypeOf(){ge(12)}},It={};fn(ko,(e,t)=>{It[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),It.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ge(13),It.set.call(this,e,t,void 0)},It.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ge(14),ko.set.call(this,e[0],t,n,e[0])};function To(e,t){const n=e[xe];return(n?Ye(n):e)[t]}function Qc(e,t,n){const o=pi(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}function pi(e,t){if(!(t in e))return;let n=at(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=at(n)}}function Mo(e){e.modified_||(e.modified_=!0,e.parent_&&Mo(e.parent_))}function Ao(e){e.copy_||(e.copy_=Eo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Jc=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,o)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ge(6),o!==void 0&&typeof o!="function"&&ge(7);let r;if(We(t)){const i=di(this),s=Io(t,void 0);let a=!0;try{r=n(s),a=!1}finally{a?No(i):Co(i)}return ui(i,o),fi(r,i)}else if(!t||typeof t!="object"){if(r=n(t),r===void 0&&(r=t),r===ii&&(r=void 0),this.autoFreeze_&&So(r,!0),o){const i=[],s=[];Xe("Patches").generateReplacementPatches_(t,r,i,s),o(i,s)}return r}else ge(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let o,r;return[this.produce(t,n,(s,a)=>{o=s,r=a}),o,r]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){We(e)||ge(8),lt(e)&&(e=eu(e));const t=di(this),n=Io(e,void 0);return n[xe].isManual_=!0,Co(t),n}finishDraft(e,t){const n=e&&e[xe];(!n||!n.isManual_)&&ge(9);const{scope_:o}=n;return ui(o,t),fi(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}n>-1&&(t=t.slice(n+1));const o=Xe("Patches").applyPatches_;return lt(e)?o(e,t):this.produce(e,r=>o(r,t))}};function Io(e,t){const n=Mt(e)?Xe("MapSet").proxyMap_(e,t):pn(e)?Xe("MapSet").proxySet_(e,t):Kc(e,t);return(t?t.scope_:ci()).drafts_.push(n),n}function eu(e){return lt(e)||ge(10,e),gi(e)}function gi(e){if(!We(e)||mn(e))return e;const t=e[xe];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Eo(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Eo(e,!0);return fn(n,(o,r)=>{li(n,o,gi(r))}),t&&(t.finalized_=!1),n}var tu=new Jc,nu=tu.produce;function ct(e){const t=[];for(let o=0;o<Math.floor(e/8);o++)t.push(Math.random().toString(36).substring(2,10));return t.push(Math.random().toString(36).substring(2,e%8+2)),t.join("")}function ue(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ue(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ou={value:()=>{}};function wn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new bn(n)}function bn(e){this._=e}function ru(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}bn.prototype=wn.prototype={constructor:bn,on:function(e,t){var n=this._,o=ru(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=iu(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=mi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=mi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new bn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function iu(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function mi(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=ou,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Po="http://www.w3.org/1999/xhtml";const yi={svg:"http://www.w3.org/2000/svg",xhtml:Po,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yi.hasOwnProperty(t)?{space:yi[t],local:e}:e}function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Po&&t.documentElement.namespaceURI===Po?t.createElement(e):t.createElementNS(n,e)}}function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function xi(e){var t=vn(e);return(t.local?au:su)(t)}function lu(){}function Oo(e){return e==null?lu:function(){return this.querySelector(e)}}function cu(e){typeof e!="function"&&(e=Oo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),a[d]=c);return new we(o,this._parents)}function uu(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function du(){return[]}function wi(e){return e==null?du:function(){return this.querySelectorAll(e)}}function fu(e){return function(){return uu(e.apply(this,arguments))}}function hu(e){typeof e=="function"?e=fu(e):e=wi(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new we(o,r)}function bi(e){return function(){return this.matches(e)}}function vi(e){return function(t){return t.matches(e)}}var pu=Array.prototype.find;function gu(e){return function(){return pu.call(this.children,e)}}function mu(){return this.firstElementChild}function yu(e){return this.select(e==null?mu:gu(typeof e=="function"?e:vi(e)))}var xu=Array.prototype.filter;function wu(){return Array.from(this.children)}function bu(e){return function(){return xu.call(this.children,e)}}function vu(e){return this.selectAll(e==null?wu:bu(typeof e=="function"?e:vi(e)))}function _u(e){typeof e!="function"&&(e=bi(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new we(o,this._parents)}function _i(e){return new Array(e.length)}function Eu(){return new we(this._enter||this._groups.map(_i),this._parents)}function _n(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_n.prototype={constructor:_n,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Su(e){return function(){return e}}function Nu(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new _n(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Cu(e,t,n,o,r,i,s){var a,l,c=new Map,d=t.length,f=i.length,u=new Array(d),h;for(a=0;a<d;++a)(l=t[a])&&(u[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new _n(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(u[a])===l&&(r[a]=l)}function ku(e){return e.__data__}function Tu(e,t){if(!arguments.length)return Array.from(this,ku);var n=t?Cu:Nu,o=this._parents,r=this._groups;typeof e!="function"&&(e=Su(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var d=o[c],f=r[c],u=f.length,h=Mu(e.call(d,d&&d.__data__,c,o)),p=h.length,g=a[c]=new Array(p),y=s[c]=new Array(p),w=l[c]=new Array(u);n(d,f,g,y,w,h,t);for(var _=0,m=0,x,C;_<p;++_)if(x=g[_]){for(_>=m&&(m=_+1);!(C=y[m])&&++m<p;);x._next=C||null}}return s=new we(s,o),s._enter=a,s._exit=l,s}function Mu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Au(){return new we(this._exit||this._groups.map(_i),this._parents)}function Iu(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Pu(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],d=o[l],f=c.length,u=a[l]=new Array(f),h,p=0;p<f;++p)(h=c[p]||d[p])&&(u[p]=h);for(;l<r;++l)a[l]=n[l];return new we(a,this._parents)}function Ou(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Du(e){e||(e=zu);function t(f,u){return f&&u?e(f.__data__,u.__data__):!f-!u}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,d=0;d<a;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new we(r,this._parents).order()}function zu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $u(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ju(){return Array.from(this)}function Hu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Lu(){let e=0;for(const t of this)++e;return e}function Vu(){return!this.node()}function Ru(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Bu(e){return function(){this.removeAttribute(e)}}function Fu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wu(e,t){return function(){this.setAttribute(e,t)}}function Yu(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Gu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Uu(e,t){var n=vn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Fu:Bu:typeof t=="function"?n.local?Gu:Xu:n.local?Yu:Wu)(n,t))}function Ei(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qu(e){return function(){this.style.removeProperty(e)}}function Zu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ku(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Qu(e,t,n){return arguments.length>1?this.each((t==null?qu:typeof t=="function"?Ku:Zu)(e,t,n??"")):ut(this.node(),e)}function ut(e,t){return e.style.getPropertyValue(t)||Ei(e).getComputedStyle(e,null).getPropertyValue(t)}function Ju(e){return function(){delete this[e]}}function ed(e,t){return function(){this[e]=t}}function td(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function nd(e,t){return arguments.length>1?this.each((t==null?Ju:typeof t=="function"?td:ed)(e,t)):this.node()[e]}function Si(e){return e.trim().split(/^|\s+/)}function Do(e){return e.classList||new Ni(e)}function Ni(e){this._node=e,this._names=Si(e.getAttribute("class")||"")}Ni.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 Ci(e,t){for(var n=Do(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ki(e,t){for(var n=Do(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function od(e){return function(){Ci(this,e)}}function rd(e){return function(){ki(this,e)}}function id(e,t){return function(){(t.apply(this,arguments)?Ci:ki)(this,e)}}function sd(e,t){var n=Si(e+"");if(arguments.length<2){for(var o=Do(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?id:t?od:rd)(n,t))}function ad(){this.textContent=""}function ld(e){return function(){this.textContent=e}}function cd(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ud(e){return arguments.length?this.each(e==null?ad:(typeof e=="function"?cd:ld)(e)):this.node().textContent}function dd(){this.innerHTML=""}function fd(e){return function(){this.innerHTML=e}}function hd(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function pd(e){return arguments.length?this.each(e==null?dd:(typeof e=="function"?hd:fd)(e)):this.node().innerHTML}function gd(){this.nextSibling&&this.parentNode.appendChild(this)}function md(){return this.each(gd)}function yd(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xd(){return this.each(yd)}function wd(e){var t=typeof e=="function"?e:xi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function bd(){return null}function vd(e,t){var n=typeof e=="function"?e:xi(e),o=t==null?bd:typeof t=="function"?t:Oo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function _d(){var e=this.parentNode;e&&e.removeChild(this)}function Ed(){return this.each(_d)}function Sd(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Nd(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Cd(e){return this.select(e?Nd:Sd)}function kd(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Td(e){return function(t){e.call(this,t,this.__data__)}}function Md(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ad(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Id(e,t,n){return function(){var o=this.__on,r,i=Td(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Pd(e,t,n){var o=Md(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,d;l<c;++l)for(r=0,d=a[l];r<i;++r)if((s=o[r]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?Id:Ad,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Ti(e,t,n){var o=Ei(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Od(e,t){return function(){return Ti(this,e,t)}}function Dd(e,t){return function(){return Ti(this,e,t.apply(this,arguments))}}function zd(e,t){return this.each((typeof t=="function"?Dd:Od)(e,t))}function*$d(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Mi=[null];function we(e,t){this._groups=e,this._parents=t}function Pt(){return new we([[document.documentElement]],Mi)}function jd(){return this}we.prototype=Pt.prototype={constructor:we,select:cu,selectAll:hu,selectChild:yu,selectChildren:vu,filter:_u,data:Tu,enter:Eu,exit:Au,join:Iu,merge:Pu,selection:jd,order:Ou,sort:Du,call:$u,nodes:ju,node:Hu,size:Lu,empty:Vu,each:Ru,attr:Uu,style:Qu,property:nd,classed:sd,text:ud,html:pd,raise:md,lower:xd,append:wd,insert:vd,remove:Ed,clone:Cd,datum:kd,on:Pd,dispatch:zd,[Symbol.iterator]:$d};function be(e){return typeof e=="string"?new we([[document.querySelector(e)]],[document.documentElement]):new we([[e]],Mi)}function Hd(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _e(e,t){if(e=Hd(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ld={passive:!1},Ot={capture:!0,passive:!1};function zo(e){e.stopImmediatePropagation()}function dt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ai(e){var t=e.document.documentElement,n=be(e).on("dragstart.drag",dt,Ot);"onselectstart"in t?n.on("selectstart.drag",dt,Ot):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ii(e,t){var n=e.document.documentElement,o=be(e).on("dragstart.drag",null);t&&(o.on("click.drag",dt,Ot),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const En=e=>()=>e;function $o(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}$o.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Vd(e){return!e.ctrlKey&&!e.button}function Rd(){return this.parentNode}function Bd(e,t){return t??{x:e.x,y:e.y}}function Fd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pi(){var e=Vd,t=Rd,n=Bd,o=Fd,r={},i=wn("start","drag","end"),s=0,a,l,c,d,f=0;function u(x){x.on("mousedown.drag",h).filter(o).on("touchstart.drag",y).on("touchmove.drag",w,Ld).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(x,C){if(!(d||!e.call(this,x,C))){var E=m(this,t.call(this,x,C),x,C,"mouse");E&&(be(x.view).on("mousemove.drag",p,Ot).on("mouseup.drag",g,Ot),Ai(x.view),zo(x),c=!1,a=x.clientX,l=x.clientY,E("start",x))}}function p(x){if(dt(x),!c){var C=x.clientX-a,E=x.clientY-l;c=C*C+E*E>f}r.mouse("drag",x)}function g(x){be(x.view).on("mousemove.drag mouseup.drag",null),Ii(x.view,c),dt(x),r.mouse("end",x)}function y(x,C){if(e.call(this,x,C)){var E=x.changedTouches,M=t.call(this,x,C),N=E.length,z,V;for(z=0;z<N;++z)(V=m(this,M,x,C,E[z].identifier,E[z]))&&(zo(x),V("start",x,E[z]))}}function w(x){var C=x.changedTouches,E=C.length,M,N;for(M=0;M<E;++M)(N=r[C[M].identifier])&&(dt(x),N("drag",x,C[M]))}function _(x){var C=x.changedTouches,E=C.length,M,N;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<E;++M)(N=r[C[M].identifier])&&(zo(x),N("end",x,C[M]))}function m(x,C,E,M,N,z){var V=i.copy(),j=_e(z||E,C),D,L,b;if((b=n.call(x,new $o("beforestart",{sourceEvent:E,target:u,identifier:N,active:s,x:j[0],y:j[1],dx:0,dy:0,dispatch:V}),M))!=null)return D=b.x-j[0]||0,L=b.y-j[1]||0,function I(k,A,P){var $=j,S;switch(k){case"start":r[N]=I,S=s++;break;case"end":delete r[N],--s;case"drag":j=_e(P||A,C),S=s;break}V.call(k,x,new $o(k,{sourceEvent:A,subject:b,target:u,identifier:N,active:S,x:j[0]+D,y:j[1]+L,dx:j[0]-$[0],dy:j[1]-$[1],dispatch:V}),M)}}return u.filter=function(x){return arguments.length?(e=typeof x=="function"?x:En(!!x),u):e},u.container=function(x){return arguments.length?(t=typeof x=="function"?x:En(x),u):t},u.subject=function(x){return arguments.length?(n=typeof x=="function"?x:En(x),u):n},u.touchable=function(x){return arguments.length?(o=typeof x=="function"?x:En(!!x),u):o},u.on=function(){var x=i.on.apply(i,arguments);return x===i?u:x},u.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,u):Math.sqrt(f)},u}function jo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Oi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Dt(){}var zt=.7,Sn=1/zt,ft="\\s*([+-]?\\d+)\\s*",$t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Te="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wd=/^#([0-9a-f]{3,8})$/,Yd=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),Xd=new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`),Gd=new RegExp(`^rgba\\(${ft},${ft},${ft},${$t}\\)$`),Ud=new RegExp(`^rgba\\(${Te},${Te},${Te},${$t}\\)$`),qd=new RegExp(`^hsl\\(${$t},${Te},${Te}\\)$`),Zd=new RegExp(`^hsla\\(${$t},${Te},${Te},${$t}\\)$`),Di={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jo(Dt,Ge,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zi,formatHex:zi,formatHex8:Kd,formatHsl:Qd,formatRgb:$i,toString:$i});function zi(){return this.rgb().formatHex()}function Kd(){return this.rgb().formatHex8()}function Qd(){return Ri(this).formatHsl()}function $i(){return this.rgb().formatRgb()}function Ge(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ji(t):n===3?new me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Nn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Nn(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=Yd.exec(e))?new me(t[1],t[2],t[3],1):(t=Xd.exec(e))?new me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gd.exec(e))?Nn(t[1],t[2],t[3],t[4]):(t=Ud.exec(e))?Nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qd.exec(e))?Vi(t[1],t[2]/100,t[3]/100,1):(t=Zd.exec(e))?Vi(t[1],t[2]/100,t[3]/100,t[4]):Di.hasOwnProperty(e)?ji(Di[e]):e==="transparent"?new me(NaN,NaN,NaN,0):null}function ji(e){return new me(e>>16&255,e>>8&255,e&255,1)}function Nn(e,t,n,o){return o<=0&&(e=t=n=NaN),new me(e,t,n,o)}function Jd(e){return e instanceof Dt||(e=Ge(e)),e?(e=e.rgb(),new me(e.r,e.g,e.b,e.opacity)):new me}function Ho(e,t,n,o){return arguments.length===1?Jd(e):new me(e,t,n,o??1)}function me(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}jo(me,Ho,Oi(Dt,{brighter(e){return e=e==null?Sn:Math.pow(Sn,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zt:Math.pow(zt,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new me(Ue(this.r),Ue(this.g),Ue(this.b),Cn(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:Hi,formatHex:Hi,formatHex8:ef,formatRgb:Li,toString:Li}));function Hi(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}`}function ef(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}${qe((isNaN(this.opacity)?1:this.opacity)*255)}`}function Li(){const e=Cn(this.opacity);return`${e===1?"rgb(":"rgba("}${Ue(this.r)}, ${Ue(this.g)}, ${Ue(this.b)}${e===1?")":`, ${e})`}`}function Cn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ue(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qe(e){return e=Ue(e),(e<16?"0":"")+e.toString(16)}function Vi(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,n,o)}function Ri(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Dt||(e=Ge(e)),!e)return new Ee;if(e instanceof Ee)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new Ee(s,a,l,e.opacity)}function tf(e,t,n,o){return arguments.length===1?Ri(e):new Ee(e,t,n,o??1)}function Ee(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}jo(Ee,tf,Oi(Dt,{brighter(e){return e=e==null?Sn:Math.pow(Sn,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zt:Math.pow(zt,e),new Ee(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,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new me(Lo(e>=240?e-240:e+120,r,o),Lo(e,r,o),Lo(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Ee(Bi(this.h),kn(this.s),kn(this.l),Cn(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=Cn(this.opacity);return`${e===1?"hsl(":"hsla("}${Bi(this.h)}, ${kn(this.s)*100}%, ${kn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bi(e){return e=(e||0)%360,e<0?e+360:e}function kn(e){return Math.max(0,Math.min(1,e||0))}function Lo(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 Vo=e=>()=>e;function nf(e,t){return function(n){return e+n*t}}function of(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function rf(e){return(e=+e)==1?Fi:function(t,n){return n-t?of(t,n,e):Vo(isNaN(t)?n:t)}}function Fi(e,t){var n=t-e;return n?nf(e,n):Vo(isNaN(e)?t:e)}const Tn=function e(t){var n=rf(t);function o(r,i){var s=n((r=Ho(r)).r,(i=Ho(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=Fi(r.opacity,i.opacity);return function(d){return r.r=s(d),r.g=a(d),r.b=l(d),r.opacity=c(d),r+""}}return o.gamma=e,o}(1);function sf(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function af(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lf(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=jt(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function cf(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Me(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uf(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=jt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Ro=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bo=new RegExp(Ro.source,"g");function df(e){return function(){return e}}function ff(e){return function(t){return e(t)+""}}function Wi(e,t){var n=Ro.lastIndex=Bo.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Ro.exec(e))&&(r=Bo.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Me(o,r)})),n=Bo.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?ff(l[0].x):df(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)a[(f=l[d]).i]=f.x(c);return a.join("")})}function jt(e,t){var n=typeof t,o;return t==null||n==="boolean"?Vo(t):(n==="number"?Me:n==="string"?(o=Ge(t))?(t=o,Tn):Wi:t instanceof Ge?Tn:t instanceof Date?cf:af(t)?sf:Array.isArray(t)?lf:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uf:Me)(e,t)}var Yi=180/Math.PI,Fo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xi(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Yi,skewX:Math.atan(l)*Yi,scaleX:s,scaleY:a}}var Mn;function hf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fo:Xi(t.a,t.b,t.c,t.d,t.e,t.f)}function pf(e){return e==null||(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",e),!(e=Mn.transform.baseVal.consolidate()))?Fo:(e=e.matrix,Xi(e.a,e.b,e.c,e.d,e.e,e.f))}function Gi(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,d,f,u,h,p){if(c!==f||d!==u){var g=h.push("translate(",null,t,null,n);p.push({i:g-4,x:Me(c,f)},{i:g-2,x:Me(d,u)})}else(f||u)&&h.push("translate("+f+t+u+n)}function s(c,d,f,u){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),u.push({i:f.push(r(f)+"rotate(",null,o)-2,x:Me(c,d)})):d&&f.push(r(f)+"rotate("+d+o)}function a(c,d,f,u){c!==d?u.push({i:f.push(r(f)+"skewX(",null,o)-2,x:Me(c,d)}):d&&f.push(r(f)+"skewX("+d+o)}function l(c,d,f,u,h,p){if(c!==f||d!==u){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:Me(c,f)},{i:g-2,x:Me(d,u)})}else(f!==1||u!==1)&&h.push(r(h)+"scale("+f+","+u+")")}return function(c,d){var f=[],u=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,u),s(c.rotate,d.rotate,f,u),a(c.skewX,d.skewX,f,u),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,u),c=d=null,function(h){for(var p=-1,g=u.length,y;++p<g;)f[(y=u[p]).i]=y.x(h);return f.join("")}}}var gf=Gi(hf,"px, ","px)","deg)"),mf=Gi(pf,", ",")",")"),yf=1e-12;function Ui(e){return((e=Math.exp(e))+1/e)/2}function xf(e){return((e=Math.exp(e))-1/e)/2}function wf(e){return((e=Math.exp(2*e))-1)/(e+1)}const An=function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],d=s[0],f=s[1],u=s[2],h=d-a,p=f-l,g=h*h+p*p,y,w;if(g<yf)w=Math.log(u/c)/t,y=function(M){return[a+M*h,l+M*p,c*Math.exp(t*M*w)]};else{var _=Math.sqrt(g),m=(u*u-c*c+o*g)/(2*c*n*_),x=(u*u-c*c-o*g)/(2*u*n*_),C=Math.log(Math.sqrt(m*m+1)-m),E=Math.log(Math.sqrt(x*x+1)-x);w=(E-C)/t,y=function(M){var N=M*w,z=Ui(C),V=c/(n*_)*(z*wf(t*N+C)-xf(C));return[a+V*h,l+V*p,c*z/Ui(t*N+C)]}}return y.duration=w*1e3*t/Math.SQRT2,y}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r}(Math.SQRT2,2,4);var ht=0,Ht=0,Lt=0,qi=1e3,In,Vt,Pn=0,Ze=0,On=0,Rt=typeof performance=="object"&&performance.now?performance:Date,Zi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wo(){return Ze||(Zi(bf),Ze=Rt.now()+On)}function bf(){Ze=0}function Dn(){this._call=this._time=this._next=null}Dn.prototype=Ki.prototype={constructor:Dn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Wo():+n)+(t==null?0:+t),!this._next&&Vt!==this&&(Vt?Vt._next=this:In=this,Vt=this),this._call=e,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function Ki(e,t,n){var o=new Dn;return o.restart(e,t,n),o}function vf(){Wo(),++ht;for(var e=In,t;e;)(t=Ze-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ht}function Qi(){Ze=(Pn=Rt.now())+On,ht=Ht=0;try{vf()}finally{ht=0,Ef(),Ze=0}}function _f(){var e=Rt.now(),t=e-Pn;t>qi&&(On-=t,Pn=e)}function Ef(){for(var e,t=In,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:In=n);Vt=e,Yo(o)}function Yo(e){if(!ht){Ht&&(Ht=clearTimeout(Ht));var t=e-Ze;t>24?(e<1/0&&(Ht=setTimeout(Qi,e-Rt.now()-On)),Lt&&(Lt=clearInterval(Lt))):(Lt||(Pn=Rt.now(),Lt=setInterval(_f,qi)),ht=1,Zi(Qi))}}function Ji(e,t,n){var o=new Dn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Sf=wn("start","end","cancel","interrupt"),Nf=[],es=0,ts=1,Xo=2,zn=3,ns=4,Go=5,$n=6;function jn(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Cf(e,n,{name:t,index:o,group:r,on:Sf,tween:Nf,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:es})}function Uo(e,t){var n=Se(e,t);if(n.state>es)throw new Error("too late; already scheduled");return n}function Ae(e,t){var n=Se(e,t);if(n.state>zn)throw new Error("too late; already running");return n}function Se(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Cf(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Ki(i,0,n.time);function i(c){n.state=ts,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,f,u,h;if(n.state!==ts)return l();for(d in o)if(h=o[d],h.name===n.name){if(h.state===zn)return Ji(s);h.state===ns?(h.state=$n,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[d]):+d<t&&(h.state=$n,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[d])}if(Ji(function(){n.state===zn&&(n.state=ns,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xo){for(n.state=zn,r=new Array(u=n.tween.length),d=0,f=-1;d<u;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Go,1),f=-1,u=r.length;++f<u;)r[f].call(e,d);n.state===Go&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=$n,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Hn(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Xo&&o.state<Go,o.state=$n,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function kf(e){return this.each(function(){Hn(this,e)})}function Tf(e,t){var n,o;return function(){var r=Ae(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Mf(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ae(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Af(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Se(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Tf:Mf)(n,e,t))}function qo(e,t,n){var o=e._id;return e.each(function(){var r=Ae(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Se(r,o).value[t]}}function os(e,t){var n;return(typeof t=="number"?Me:t instanceof Ge?Tn:(n=Ge(t))?(t=n,Tn):Wi)(e,t)}function If(e){return function(){this.removeAttribute(e)}}function Pf(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Of(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Df(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function zf(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function $f(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function jf(e,t){var n=vn(e),o=n==="transform"?mf:os;return this.attrTween(e,typeof t=="function"?(n.local?$f:zf)(n,o,qo(this,"attr."+e,t)):t==null?(n.local?Pf:If)(n):(n.local?Df:Of)(n,o,t))}function Hf(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Lf(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Vf(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Lf(e,i)),n}return r._value=t,r}function Rf(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Hf(e,i)),n}return r._value=t,r}function Bf(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=vn(e);return this.tween(n,(o.local?Vf:Rf)(o,t))}function Ff(e,t){return function(){Uo(this,e).delay=+t.apply(this,arguments)}}function Wf(e,t){return t=+t,function(){Uo(this,e).delay=t}}function Yf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ff:Wf)(t,e)):Se(this.node(),t).delay}function Xf(e,t){return function(){Ae(this,e).duration=+t.apply(this,arguments)}}function Gf(e,t){return t=+t,function(){Ae(this,e).duration=t}}function Uf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xf:Gf)(t,e)):Se(this.node(),t).duration}function qf(e,t){if(typeof t!="function")throw new Error;return function(){Ae(this,e).ease=t}}function Zf(e){var t=this._id;return arguments.length?this.each(qf(t,e)):Se(this.node(),t).ease}function Kf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ae(this,e).ease=n}}function Qf(e){if(typeof e!="function")throw new Error;return this.each(Kf(this._id,e))}function Jf(e){typeof e!="function"&&(e=bi(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new De(o,this._parents,this._name,this._id)}function eh(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],d=l.length,f=s[a]=new Array(d),u,h=0;h<d;++h)(u=l[h]||c[h])&&(f[h]=u);for(;a<o;++a)s[a]=t[a];return new De(s,this._parents,this._name,this._id)}function th(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function nh(e,t,n){var o,r,i=th(t)?Uo:Ae;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function oh(e,t){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(e):this.each(nh(n,e,t))}function rh(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ih(){return this.on("end.remove",rh(this._id))}function sh(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oo(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),d,f,u=0;u<l;++u)(d=a[u])&&(f=e.call(d,d.__data__,u,a))&&("__data__"in d&&(f.__data__=d.__data__),c[u]=f,jn(c[u],t,n,u,c,Se(d,n)));return new De(i,this._parents,t,n)}function ah(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wi(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var u=e.call(d,d.__data__,f,l),h,p=Se(d,n),g=0,y=u.length;g<y;++g)(h=u[g])&&jn(h,t,n,g,u,p);i.push(u),s.push(d)}return new De(i,s,t,n)}var lh=Pt.prototype.constructor;function ch(){return new lh(this._groups,this._parents)}function uh(e,t){var n,o,r;return function(){var i=ut(this,e),s=(this.style.removeProperty(e),ut(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function rs(e){return function(){this.style.removeProperty(e)}}function dh(e,t,n){var o,r=n+"",i;return function(){var s=ut(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function fh(e,t,n){var o,r,i;return function(){var s=ut(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ut(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function hh(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=Ae(this,e),c=l.on,d=l.value[i]==null?a||(a=rs(t)):void 0;(c!==n||r!==d)&&(o=(n=c).copy()).on(s,r=d),l.on=o}}function ph(e,t,n){var o=(e+="")=="transform"?gf:os;return t==null?this.styleTween(e,uh(e,o)).on("end.style."+e,rs(e)):typeof t=="function"?this.styleTween(e,fh(e,o,qo(this,"style."+e,t))).each(hh(this._id,e)):this.styleTween(e,dh(e,o,t),n).on("end.style."+e,null)}function gh(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function mh(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&gh(e,s,n)),o}return i._value=t,i}function yh(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,mh(e,t,n??""))}function xh(e){return function(){this.textContent=e}}function wh(e){return function(){var t=e(this);this.textContent=t??""}}function bh(e){return this.tween("text",typeof e=="function"?wh(qo(this,"text",e)):xh(e==null?"":e+""))}function vh(e){return function(t){this.textContent=e.call(this,t)}}function _h(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&vh(r)),t}return o._value=e,o}function Eh(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,_h(e))}function Sh(){for(var e=this._name,t=this._id,n=is(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var d=Se(l,t);jn(l,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new De(o,this._parents,e,n)}function Nh(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=Ae(this,o),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Ch=0;function De(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function is(){return++Ch}var ze=Pt.prototype;De.prototype={constructor:De,select:sh,selectAll:ah,selectChild:ze.selectChild,selectChildren:ze.selectChildren,filter:Jf,merge:eh,selection:ch,transition:Sh,call:ze.call,nodes:ze.nodes,node:ze.node,size:ze.size,empty:ze.empty,each:ze.each,on:oh,attr:jf,attrTween:Bf,style:ph,styleTween:yh,text:bh,textTween:Eh,remove:ih,tween:Af,delay:Yf,duration:Uf,ease:Zf,easeVarying:Qf,end:Nh,[Symbol.iterator]:ze[Symbol.iterator]};function kh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Th={time:null,delay:0,duration:250,ease:kh};function Mh(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ah(e){var t,n;e instanceof De?(t=e._id,e=e._name):(t=is(),(n=Th).time=Wo(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&jn(l,e,t,c,s,n||Mh(l,t));return new De(o,this._parents,e,t)}Pt.prototype.interrupt=kf,Pt.prototype.transition=Ah;const Ln=e=>()=>e;function Ih(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function $e(e,t,n){this.k=e,this.x=t,this.y=n}$e.prototype={constructor:$e,scale:function(e){return e===1?this:new $e(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $e(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 Vn=new $e(1,0,0);ss.prototype=$e.prototype;function ss(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vn;return e.__zoom}function Zo(e){e.stopImmediatePropagation()}function Bt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ph(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Oh(){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 as(){return this.__zoom||Vn}function Dh(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zh(){return navigator.maxTouchPoints||"ontouchstart"in this}function $h(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ls(){var e=Ph,t=Oh,n=$h,o=Dh,r=zh,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=An,c=wn("start","zoom","end"),d,f,u,h=500,p=150,g=0,y=10;function w(b){b.property("__zoom",as).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(b,I,k,A){var P=b.selection?b.selection():b;P.property("__zoom",as),b!==P?C(b,I,k,A):P.interrupt().each(function(){E(this,arguments).event(A).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(b,I,k,A){w.scaleTo(b,function(){var P=this.__zoom.k,$=typeof I=="function"?I.apply(this,arguments):I;return P*$},k,A)},w.scaleTo=function(b,I,k,A){w.transform(b,function(){var P=t.apply(this,arguments),$=this.__zoom,S=k==null?x(P):typeof k=="function"?k.apply(this,arguments):k,O=$.invert(S),H=typeof I=="function"?I.apply(this,arguments):I;return n(m(_($,H),S,O),P,s)},k,A)},w.translateBy=function(b,I,k,A){w.transform(b,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,A)},w.translateTo=function(b,I,k,A,P){w.transform(b,function(){var $=t.apply(this,arguments),S=this.__zoom,O=A==null?x($):typeof A=="function"?A.apply(this,arguments):A;return n(Vn.translate(O[0],O[1]).scale(S.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof k=="function"?-k.apply(this,arguments):-k),$,s)},A,P)};function _(b,I){return I=Math.max(i[0],Math.min(i[1],I)),I===b.k?b:new $e(I,b.x,b.y)}function m(b,I,k){var A=I[0]-k[0]*b.k,P=I[1]-k[1]*b.k;return A===b.x&&P===b.y?b:new $e(b.k,A,P)}function x(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function C(b,I,k,A){b.on("start.zoom",function(){E(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(A).end()}).tween("zoom",function(){var P=this,$=arguments,S=E(P,$).event(A),O=t.apply(P,$),H=k==null?x(O):typeof k=="function"?k.apply(P,$):k,B=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),F=P.__zoom,U=typeof I=="function"?I.apply(P,$):I,K=l(F.invert(H).concat(B/F.k),U.invert(H).concat(B/U.k));return function(W){if(W===1)W=U;else{var R=K(W),Y=B/R[2];W=new $e(Y,H[0]-R[0]*Y,H[1]-R[1]*Y)}S.zoom(null,W)}})}function E(b,I,k){return!k&&b.__zooming||new M(b,I)}function M(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}M.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var I=be(this.that).datum();c.call(b,this.that,new Ih(b,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:c}),I)}};function N(b,...I){if(!e.apply(this,arguments))return;var k=E(this,I).event(b),A=this.__zoom,P=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,o.apply(this,arguments)))),$=_e(b);if(k.wheel)(k.mouse[0][0]!==$[0]||k.mouse[0][1]!==$[1])&&(k.mouse[1]=A.invert(k.mouse[0]=$)),clearTimeout(k.wheel);else{if(A.k===P)return;k.mouse=[$,A.invert($)],Hn(this),k.start()}Bt(b),k.wheel=setTimeout(S,p),k.zoom("mouse",n(m(_(A,P),k.mouse[0],k.mouse[1]),k.extent,s));function S(){k.wheel=null,k.end()}}function z(b,...I){if(u||!e.apply(this,arguments))return;var k=b.currentTarget,A=E(this,I,!0).event(b),P=be(b.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",B,!0),$=_e(b,k),S=b.clientX,O=b.clientY;Ai(b.view),Zo(b),A.mouse=[$,this.__zoom.invert($)],Hn(this),A.start();function H(F){if(Bt(F),!A.moved){var U=F.clientX-S,K=F.clientY-O;A.moved=U*U+K*K>g}A.event(F).zoom("mouse",n(m(A.that.__zoom,A.mouse[0]=_e(F,k),A.mouse[1]),A.extent,s))}function B(F){P.on("mousemove.zoom mouseup.zoom",null),Ii(F.view,A.moved),Bt(F),A.event(F).end()}}function V(b,...I){if(e.apply(this,arguments)){var k=this.__zoom,A=_e(b.changedTouches?b.changedTouches[0]:b,this),P=k.invert(A),$=k.k*(b.shiftKey?.5:2),S=n(m(_(k,$),A,P),t.apply(this,I),s);Bt(b),a>0?be(this).transition().duration(a).call(C,S,A,b):be(this).call(w.transform,S,A,b)}}function j(b,...I){if(e.apply(this,arguments)){var k=b.touches,A=k.length,P=E(this,I,b.changedTouches.length===A).event(b),$,S,O,H;for(Zo(b),S=0;S<A;++S)O=k[S],H=_e(O,this),H=[H,this.__zoom.invert(H),O.identifier],P.touch0?!P.touch1&&P.touch0[2]!==H[2]&&(P.touch1=H,P.taps=0):(P.touch0=H,$=!0,P.taps=1+!!d);d&&(d=clearTimeout(d)),$&&(P.taps<2&&(f=H[0],d=setTimeout(function(){d=null},h)),Hn(this),P.start())}}function D(b,...I){if(this.__zooming){var k=E(this,I).event(b),A=b.changedTouches,P=A.length,$,S,O,H;for(Bt(b),$=0;$<P;++$)S=A[$],O=_e(S,this),k.touch0&&k.touch0[2]===S.identifier?k.touch0[0]=O:k.touch1&&k.touch1[2]===S.identifier&&(k.touch1[0]=O);if(S=k.that.__zoom,k.touch1){var B=k.touch0[0],F=k.touch0[1],U=k.touch1[0],K=k.touch1[1],W=(W=U[0]-B[0])*W+(W=U[1]-B[1])*W,R=(R=K[0]-F[0])*R+(R=K[1]-F[1])*R;S=_(S,Math.sqrt(W/R)),O=[(B[0]+U[0])/2,(B[1]+U[1])/2],H=[(F[0]+K[0])/2,(F[1]+K[1])/2]}else if(k.touch0)O=k.touch0[0],H=k.touch0[1];else return;k.zoom("touch",n(m(S,O,H),k.extent,s))}}function L(b,...I){if(this.__zooming){var k=E(this,I).event(b),A=b.changedTouches,P=A.length,$,S;for(Zo(b),u&&clearTimeout(u),u=setTimeout(function(){u=null},h),$=0;$<P;++$)S=A[$],k.touch0&&k.touch0[2]===S.identifier?delete k.touch0:k.touch1&&k.touch1[2]===S.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(S=_e(S,this),Math.hypot(f[0]-S[0],f[1]-S[1])<y)){var O=be(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return w.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:Ln(+b),w):o},w.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Ln(!!b),w):e},w.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Ln(!!b),w):r},w.extent=function(b){return arguments.length?(t=typeof b=="function"?b:Ln([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),w):t},w.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],w):[i[0],i[1]]},w.translateExtent=function(b){return arguments.length?(s[0][0]=+b[0][0],s[1][0]=+b[1][0],s[0][1]=+b[0][1],s[1][1]=+b[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(b){return arguments.length?(n=b,w):n},w.duration=function(b){return arguments.length?(a=+b,w):a},w.interpolate=function(b){return arguments.length?(l=b,w):l},w.on=function(){var b=c.on.apply(c,arguments);return b===c?w:b},w.clickDistance=function(b){return arguments.length?(g=(b=+b)*b,w):Math.sqrt(g)},w.tapDistance=function(b){return arguments.length?(y=+b,w):y},w}const ye={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ft=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],cs=["Enter"," ","Escape"],us={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var pt;(function(e){e.Strict="strict",e.Loose="loose"})(pt||(pt={}));var Ke;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ke||(Ke={}));var gt;(function(e){e.Partial="partial",e.Full="full"})(gt||(gt={}));const ds={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Le;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Le||(Le={}));var Rn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Rn||(Rn={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));const fs={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top};function jh(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function hs(e,t,n){if(!n)return;const o=[];e.forEach((r,i)=>{t?.has(i)||o.push(r)}),o.length&&n(o)}function ps(e){return e===null?null:e?"valid":"invalid"}const gs=e=>"id"in e&&"source"in e&&"target"in e,Hh=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ko=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Wt=(e,t=[0,0])=>{const{width:n,height:o}=je(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Lh=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Ko(r)?r:t.nodeLookup.get(r.id));const a=s?Wn(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Bn(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Fn(n)},Yt=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(o=>{if(t.filter===void 0||t.filter(o)){const r=Wn(o);n=Bn(n,r)}}),Fn(n)},Qo=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...Ut(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const c of e.values()){const{measured:d,selectable:f=!0,hidden:u=!1}=c;if(s&&!f||u)continue;const h=d.width??c.width??c.initialWidth??null,p=d.height??c.height??c.initialHeight??null,g=Xt(a,yt(c)),y=(h??0)*(p??0),w=i&&g>0;(!c.internals.handleBounds||w||g>=y||c.dragging)&&l.push(c)}return l},Jo=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Vh(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Rh({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Vh(e,s),l=Yt(a),c=tr(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function ms({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ye.error005());else{const h=a.measured.width,p=a.measured.height;h&&p&&(f=[[l,c],[l+h,c+p]])}else a&&wt(s.extent)&&(f=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const u=wt(f)?Qe(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ye.error015()),{position:{x:u.x-l+(s.measured.width??0)*d[0],y:u.y-c+(s.measured.height??0)*d[1]},positionAbsolute:u}}async function Bh({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(u=>u.id)),s=[];for(const u of n){if(u.deletable===!1)continue;const h=i.has(u.id),p=!h&&u.parentId&&s.find(g=>g.id===u.parentId);(h||p)&&s.push(u)}const a=new Set(t.map(u=>u.id)),l=o.filter(u=>u.deletable!==!1),d=Jo(s,l);for(const u of l)a.has(u.id)&&!d.find(p=>p.id===u.id)&&d.push(u);if(!r)return{edges:d,nodes:s};const f=await r({nodes:s,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:s}:{edges:[],nodes:[]}:f}const mt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qe=(e={x:0,y:0},t,n)=>({x:mt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:mt(e.y,t[0][1],t[1][1]-(n?.height??0))});function ys(e,t,n){const{width:o,height:r}=je(n),{x:i,y:s}=n.internals.positionAbsolute;return Qe(e,[[i,s],[i+o,s+r]],t)}const xs=(e,t,n)=>e<t?mt(Math.abs(e-t),1,t)/t:e>n?-mt(Math.abs(e-n),1,t)/t:0,ws=(e,t,n=15,o=40)=>{const r=xs(e.x,o,t.width-o)*n,i=xs(e.y,o,t.height-o)*n;return[r,i]},Bn=(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)}),er=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Fn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),yt=(e,t=[0,0])=>{const{x:n,y:o}=Ko(e)?e.internals.positionAbsolute:Wt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Wn=(e,t=[0,0])=>{const{x:n,y:o}=Ko(e)?e.internals.positionAbsolute:Wt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},bs=(e,t)=>Fn(Bn(er(e),er(t))),Xt=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},vs=e=>Ne(e.width)&&Ne(e.height)&&Ne(e.x)&&Ne(e.y),Ne=e=>!isNaN(e)&&isFinite(e),_s=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Gt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ut=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?Gt(a,s):a},Yn=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function xt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Fh(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=xt(e,n),r=xt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=xt(e.top??e.y??0,n),r=xt(e.bottom??e.y??0,n),i=xt(e.left??e.x??0,t),s=xt(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Wh(e,t,n,o,r,i){const{x:s,y:a}=Yn(e,[t,n,o]),{x:l,y:c}=Yn({x:e.x+e.width,y:e.y+e.height},[t,n,o]),d=r-l,f=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(f)}}const tr=(e,t,n,o,r,i)=>{const s=Fh(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),d=mt(c,o,r),f=e.x+e.width/2,u=e.y+e.height/2,h=t/2-f*d,p=n/2-u*d,g=Wh(e,h,p,d,t,n),y={left:Math.min(g.left-s.left,0),top:Math.min(g.top-s.top,0),right:Math.min(g.right-s.right,0),bottom:Math.min(g.bottom-s.bottom,0)};return{x:h-y.left+y.right,y:p-y.top+y.bottom,zoom:d}},qt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function wt(e){return e!=null&&e!=="parent"}function je(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Es(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ss(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ns(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Yh(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Xh(e){return{...us,...e||{}}}function Zt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=Ie(e),a=Ut({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?Gt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const nr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Cs=e=>e?.getRootNode?.()||window?.document,Gh=["INPUT","SELECT","TEXTAREA"];function ks(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Gh.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ts=e=>"clientX"in e,Ie=(e,t)=>{const n=Ts(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Ms=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...nr(s)}})};function As({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}function Xn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Is({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case q.Left:return[t-Xn(t-o,i),n];case q.Right:return[t+Xn(o-t,i),n];case q.Top:return[t,n-Xn(n-r,i)];case q.Bottom:return[t,n+Xn(r-n,i)]}}function Gn({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:o,targetY:r,targetPosition:i=q.Top,curvature:s=.25}){const[a,l]=Is({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,d]=Is({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,u,h,p]=As({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${o},${r}`,f,u,h,p]}function Ps({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function Uh({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:r=!1}){if(o!==void 0)return o;const i=r&&n?1e3:0,s=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+s}function qh({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Bn(Wn(e),Wn(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Xt(s,Fn(i))>0}const Zh=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Kh=(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)),Un=(e,t)=>{if(!e.source||!e.target)return _s("006",ye.error006()),t;let n;return gs(e)?n={...e}:n={...e,id:Zh(e)},Kh(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Os({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ps({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Ds={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},Qh=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},zs=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Jh({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:o=q.Top,center:r,offset:i,stepPosition:s}){const a=Ds[t],l=Ds[o],c={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},f=Qh({source:c,sourcePosition:t,target:d}),u=f.x!==0?"x":"y",h=f[u];let p=[],g,y;const w={x:0,y:0},_={x:0,y:0},[,,m,x]=Ps({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[u]*l[u]===-1){u==="x"?(g=r.x??c.x+(d.x-c.x)*s,y=r.y??(c.y+d.y)/2):(g=r.x??(c.x+d.x)/2,y=r.y??c.y+(d.y-c.y)*s);const E=[{x:g,y:c.y},{x:g,y:d.y}],M=[{x:c.x,y},{x:d.x,y}];a[u]===h?p=u==="x"?E:M:p=u==="x"?M:E}else{const E=[{x:c.x,y:d.y}],M=[{x:d.x,y:c.y}];if(u==="x"?p=a.x===h?M:E:p=a.y===h?E:M,t===o){const D=Math.abs(e[u]-n[u]);if(D<=i){const L=Math.min(i-1,i-D);a[u]===h?w[u]=(c[u]>e[u]?-1:1)*L:_[u]=(d[u]>n[u]?-1:1)*L}}if(t!==o){const D=u==="x"?"y":"x",L=a[u]===l[D],b=c[D]>d[D],I=c[D]<d[D];(a[u]===1&&(!L&&b||L&&I)||a[u]!==1&&(!L&&I||L&&b))&&(p=u==="x"?E:M)}const N={x:c.x+w.x,y:c.y+w.y},z={x:d.x+_.x,y:d.y+_.y},V=Math.max(Math.abs(N.x-p[0].x),Math.abs(z.x-p[0].x)),j=Math.max(Math.abs(N.y-p[0].y),Math.abs(z.y-p[0].y));V>=j?(g=(N.x+z.x)/2,y=p[0].y):(g=p[0].x,y=(N.y+z.y)/2)}return[[e,{x:c.x+w.x,y:c.y+w.y},...p,{x:d.x+_.x,y:d.y+_.y},n],g,y,m,x]}function ep(e,t,n,o){const r=Math.min(zs(e,t)/2,zs(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function or({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:o,targetY:r,targetPosition:i=q.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:d=.5}){const[f,u,h,p,g]=Jh({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:d});return[f.reduce((w,_,m)=>{let x="";return m>0&&m<f.length-1?x=ep(f[m-1],_,f[m+1],s):x=`${m===0?"M":"L"}${_.x} ${_.y}`,w+=x,w},""),u,h,p,g]}function $s(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function tp(e){const{sourceNode:t,targetNode:n}=e;if(!$s(t)||!$s(n))return null;const o=t.internals.handleBounds||js(t.handles),r=n.internals.handleBounds||js(n.handles),i=Hs(o?.source??[],e.sourceHandle),s=Hs(e.connectionMode===pt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ye.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||q.Bottom,l=s?.position||q.Top,c=Kt(t,i,a),d=Kt(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function js(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function Kt(e,t,n=q.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??je(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case q.Top:return{x:r+s/2,y:i};case q.Right:return{x:r+s,y:i+a/2};case q.Bottom:return{x:r+s/2,y:i+a};case q.Left:return{x:r,y:i+a/2}}}function Hs(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function rr(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function np(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=rr(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const ir={nodeOrigin:[0,0],nodeExtent:Ft,elevateNodesOnSelect:!0,defaults:{}},op={...ir,checkEquality:!0};function sr(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function rp(e,t,n){const o=sr(ir,n);for(const r of e.values())if(r.parentId)lr(r,e,t,o);else{const i=Wt(r,o.nodeOrigin),s=wt(r.extent)?r.extent:o.nodeExtent,a=Qe(i,s,je(r));r.internals.positionAbsolute=a}}function ar(e,t,n,o){const r=sr(op,o);let i=e.length>0;const s=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const l of e){let c=s.get(l.id);if(r.checkEquality&&l===c?.internals.userNode)t.set(l.id,c);else{const d=Wt(l,r.nodeOrigin),f=wt(l.extent)?l.extent:r.nodeExtent,u=Qe(d,f,je(l));c={...r.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:u,handleBounds:l.measured?c?.internals.handleBounds:void 0,z:Ls(l,a),userNode:l}},t.set(l.id,c)}(c.measured===void 0||c.measured.width===void 0||c.measured.height===void 0)&&!c.hidden&&(i=!1),l.parentId&&lr(c,t,n,o)}return i}function ip(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function lr(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:s}=sr(ir,o),a=e.parentId,l=t.get(a);if(!l){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ip(e,n);const c=r?1e3:0,{x:d,y:f,z:u}=sp(e,l,i,s,c),{positionAbsolute:h}=e.internals,p=d!==h.x||f!==h.y;(p||u!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:d,y:f}:h,z:u}})}function Ls(e,t){return(Ne(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function sp(e,t,n,o,r){const{x:i,y:s}=t.internals.positionAbsolute,a=je(e),l=Wt(e,n),c=wt(e.extent)?Qe(l,e.extent,a):l;let d=Qe({x:i+c.x,y:s+c.y},o,a);e.extent==="parent"&&(d=ys(d,a,t));const f=Ls(e,r),u=t.internals.z??0;return{x:d.x,y:d.y,z:u>=f?u+1:f}}function cr(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??yt(a),c=bs(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,d=je(a),f=a.origin??o,u=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,h=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,p=Math.max(d.width,Math.round(s.width)),g=Math.max(d.height,Math.round(s.height)),y=(p-d.width)*f[0],w=(g-d.height)*f[1];(u>0||h>0||y||w)&&(r.push({id:l,type:"position",position:{x:a.position.x-u+y,y:a.position.y-h+w}}),n.get(l)?.forEach(_=>{e.some(m=>m.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+u,y:_.position.y+h}})})),(d.width<s.width||d.height<s.height||u||h)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(u?f[0]*u-y:0),height:g+(h?f[1]*h-w:0)}})}),r}function ap(e,t,n,o,r,i){const s=o?.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const l=[],c=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const u of e.values()){const h=t.get(u.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const p=nr(u.nodeElement),g=h.measured.width!==p.width||h.measured.height!==p.height;if(!!(p.width&&p.height&&(g||!h.internals.handleBounds||u.force))){const w=u.nodeElement.getBoundingClientRect(),_=wt(h.extent)?h.extent:i;let{positionAbsolute:m}=h.internals;h.parentId&&h.extent==="parent"?m=ys(m,p,t.get(h.parentId)):_&&(m=Qe(m,_,p));const x={...h,measured:p,internals:{...h.internals,positionAbsolute:m,handleBounds:{source:Ms("source",u.nodeElement,w,d,h.id),target:Ms("target",u.nodeElement,w,d,h.id)}}};t.set(h.id,x),h.parentId&&lr(x,t,n,{nodeOrigin:r}),a=!0,g&&(l.push({id:h.id,type:"dimensions",dimensions:p}),h.expandParent&&h.parentId&&f.push({id:h.id,parentId:h.parentId,rect:yt(x,r)}))}}if(f.length>0){const u=cr(f,t,n,r);l.push(...u)}return{changes:l,updatedInternals:a}}async function lp({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Vs(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function Rs(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,d=`${i}-${a}--${r}-${s}`;Vs("source",l,d,e,r,s),Vs("target",l,c,e,i,a),t.set(o.id,o)}}function cp(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(n[r].id!==o[r].id||n[r].type!==o[r].type||!Object.is(n[r].data,o[r].data))return!1;return!0}function Bs(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Bs(n,t):!1}function Fs(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function up(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Bs(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function ur({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function dp({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=Gt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function fp({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},d=null,f=!1,u=null,h=!1,p=!1,g=null;function y({noDragClassName:_,handleSelector:m,domNode:x,isSelectable:C,nodeId:E,nodeClickDistance:M=0}){u=be(x);function N({x:D,y:L}){const{nodeLookup:b,nodeExtent:I,snapGrid:k,snapToGrid:A,nodeOrigin:P,onNodeDrag:$,onSelectionDrag:S,onError:O,updateNodePositions:H}=t();i={x:D,y:L};let B=!1;const F=a.size>1,U=F&&I?er(Yt(a)):null,K=F&&A?dp({dragItems:a,snapGrid:k,x:D,y:L}):null;for(const[W,R]of a){if(!b.has(W))continue;let Y={x:D-R.distance.x,y:L-R.distance.y};A&&(Y=K?{x:Math.round(Y.x+K.x),y:Math.round(Y.y+K.y)}:Gt(Y,k));let ee=null;if(F&&I&&!R.extent&&U){const{positionAbsolute:ne}=R.internals,J=ne.x-U.x+I[0][0],le=ne.x+R.measured.width-U.x2+I[1][0],he=ne.y-U.y+I[0][1],Ce=ne.y+R.measured.height-U.y2+I[1][1];ee=[[J,he],[le,Ce]]}const{position:re,positionAbsolute:Z}=ms({nodeId:W,nextPosition:Y,nodeLookup:b,nodeExtent:ee||I,nodeOrigin:P,onError:O});B=B||R.position.x!==re.x||R.position.y!==re.y,R.position=re,R.internals.positionAbsolute=Z}if(p=p||B,!!B&&(H(a,!0),g&&(o||$||!E&&S))){const[W,R]=ur({nodeId:E,dragItems:a,nodeLookup:b});o?.(g,a,W,R),$?.(g,W,R),E||S?.(g,R)}}async function z(){if(!d)return;const{transform:D,panBy:L,autoPanSpeed:b,autoPanOnNodeDrag:I}=t();if(!I){l=!1,cancelAnimationFrame(s);return}const[k,A]=ws(c,d,b);(k!==0||A!==0)&&(i.x=(i.x??0)-k/D[2],i.y=(i.y??0)-A/D[2],await L({x:k,y:A})&&N(i)),s=requestAnimationFrame(z)}function V(D){const{nodeLookup:L,multiSelectionActive:b,nodesDraggable:I,transform:k,snapGrid:A,snapToGrid:P,selectNodesOnDrag:$,onNodeDragStart:S,onSelectionDragStart:O,unselectNodesAndEdges:H}=t();f=!0,(!$||!C)&&!b&&E&&(L.get(E)?.selected||H()),C&&$&&E&&e?.(E);const B=Zt(D.sourceEvent,{transform:k,snapGrid:A,snapToGrid:P,containerBounds:d});if(i=B,a=up(L,I,B,E),a.size>0&&(n||S||!E&&O)){const[F,U]=ur({nodeId:E,dragItems:a,nodeLookup:L});n?.(D.sourceEvent,a,F,U),S?.(D.sourceEvent,F,U),E||O?.(D.sourceEvent,U)}}const j=Pi().clickDistance(M).on("start",D=>{const{domNode:L,nodeDragThreshold:b,transform:I,snapGrid:k,snapToGrid:A}=t();d=L?.getBoundingClientRect()||null,h=!1,p=!1,g=D.sourceEvent,b===0&&V(D),i=Zt(D.sourceEvent,{transform:I,snapGrid:k,snapToGrid:A,containerBounds:d}),c=Ie(D.sourceEvent,d)}).on("drag",D=>{const{autoPanOnNodeDrag:L,transform:b,snapGrid:I,snapToGrid:k,nodeDragThreshold:A,nodeLookup:P}=t(),$=Zt(D.sourceEvent,{transform:b,snapGrid:I,snapToGrid:k,containerBounds:d});if(g=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||E&&!P.has(E))&&(h=!0),!h){if(!l&&L&&f&&(l=!0,z()),!f){const S=$.xSnapped-(i.x??0),O=$.ySnapped-(i.y??0);Math.sqrt(S*S+O*O)>A&&V(D)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&a&&f&&(c=Ie(D.sourceEvent,d),N($))}}).on("end",D=>{if(!(!f||h)&&(l=!1,f=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:L,updateNodePositions:b,onNodeDragStop:I,onSelectionDragStop:k}=t();if(p&&(b(a,!1),p=!1),r||I||!E&&k){const[A,P]=ur({nodeId:E,dragItems:a,nodeLookup:L,dragging:!1});r?.(D.sourceEvent,a,A,P),I?.(D.sourceEvent,A,P),E||k?.(D.sourceEvent,P)}}}).filter(D=>{const L=D.target;return!D.button&&(!_||!Fs(L,`.${_}`,x))&&(!m||Fs(L,m,x))});u.call(j)}function w(){u?.on(".drag",null)}return{update:y,destroy:w}}function hp(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Xt(r,yt(i))>0&&o.push(i);return o}const pp=250;function gp(e,t,n,o){let r=[],i=1/0;const s=hp(e,n,t+pp);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:d,y:f}=Kt(a,c,c.position,!0),u=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));u>t||(u<i?(r=[{...c,x:d,y:f}],i=u):u===i&&r.push({...c,x:d,y:f}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function Ws(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...Kt(s,l,l.position,!0)}:l}function Ys(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function mp(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Xs=()=>!0;function yp(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:f,panBy:u,cancelConnection:h,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:w=Xs,onReconnectEnd:_,updateConnection:m,getTransform:x,getFromHandle:C,autoPanSpeed:E,dragThreshold:M=1,handleDomNode:N}){const z=Cs(e.target);let V=0,j;const{x:D,y:L}=Ie(e),b=Ys(i,N),I=a?.getBoundingClientRect();let k=!1;if(!I||!b)return;const A=Ws(r,b,o,l,t);if(!A)return;let P=Ie(e,I),$=!1,S=null,O=!1,H=null;function B(){if(!d||!I)return;const[re,Z]=ws(P,I,E);u({x:re,y:Z}),V=requestAnimationFrame(B)}const F={...A,nodeId:r,type:b,position:A.position},U=l.get(r);let W={inProgress:!0,isValid:null,from:Kt(U,F,q.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:U,to:P,toHandle:null,toPosition:fs[F.position],toNode:null};function R(){k=!0,m(W),p?.(e,{nodeId:r,handleId:o,handleType:b})}M===0&&R();function Y(re){if(!k){const{x:le,y:he}=Ie(re),Ce=le-D,St=he-L;if(!(Ce*Ce+St*St>M*M))return;R()}if(!C()||!F){ee(re);return}const Z=x();P=Ie(re,I),j=gp(Ut(P,Z,!1,[1,1]),n,l,F),$||(B(),$=!0);const ne=Gs(re,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:w,doc:z,lib:c,flowId:f,nodeLookup:l});H=ne.handleDomNode,S=ne.connection,O=mp(!!j,ne.isValid);const J={...W,isValid:O,to:ne.toHandle&&O?Yn({x:ne.toHandle.x,y:ne.toHandle.y},Z):P,toHandle:ne.toHandle,toPosition:O&&ne.toHandle?ne.toHandle.position:fs[F.position],toNode:ne.toHandle?l.get(ne.toHandle.nodeId):null};O&&j&&W.toHandle&&J.toHandle&&W.toHandle.type===J.toHandle.type&&W.toHandle.nodeId===J.toHandle.nodeId&&W.toHandle.id===J.toHandle.id&&W.to.x===J.to.x&&W.to.y===J.to.y||(m(J),W=J)}function ee(re){if(k){(j||H)&&S&&O&&g?.(S);const{inProgress:Z,...ne}=W,J={...ne,toPosition:W.toHandle?W.toPosition:null};y?.(re,J),i&&_?.(re,J)}h(),cancelAnimationFrame(V),$=!1,O=!1,S=null,H=null,z.removeEventListener("mousemove",Y),z.removeEventListener("mouseup",ee),z.removeEventListener("touchmove",Y),z.removeEventListener("touchend",ee)}z.addEventListener("mousemove",Y),z.addEventListener("mouseup",ee),z.addEventListener("touchmove",Y),z.addEventListener("touchend",ee)}function Gs(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Xs,nodeLookup:d}){const f=i==="target",u=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:p}=Ie(e),g=s.elementFromPoint(h,p),y=g?.classList.contains(`${a}-flow__handle`)?g:u,w={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const _=Ys(void 0,y),m=y.getAttribute("data-nodeid"),x=y.getAttribute("data-handleid"),C=y.classList.contains("connectable"),E=y.classList.contains("connectableend");if(!m||!_)return w;const M={source:f?m:o,sourceHandle:f?x:r,target:f?o:m,targetHandle:f?r:x};w.connection=M;const z=C&&E&&(n===pt.Strict?f&&_==="source"||!f&&_==="target":m!==o||x!==r);w.isValid=z&&c(M),w.toHandle=Ws(m,_,x,d,n,!0)}return w}const dr={onPointerDown:yp,isValid:Gs};function xp({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=be(e);function i({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:f=!0,zoomable:u=!0,inversePan:h=!1}){const p=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const x=n(),C=m.sourceEvent.ctrlKey&&qt()?10:1,E=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,M=x[2]*Math.pow(2,E*C);t.scaleTo(M)};let g=[0,0];const y=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(g=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},w=m=>{const x=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const C=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],E=[C[0]-g[0],C[1]-g[1]];g=C;const M=o()*Math.max(x[2],Math.log(x[2]))*(h?-1:1),N={x:x[0]-E[0]*M,y:x[1]-E[1]*M},z=[[0,0],[l,c]];t.setViewportConstrained({x:N.x,y:N.y,zoom:x[2]},z,a)},_=ls().on("start",y).on("zoom",f?w:null).on("zoom.wheel",u?p:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:_e}}const wp=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,qn=e=>({x:e.x,y:e.y,zoom:e.k}),fr=({x:e,y:t,zoom:n})=>Vn.translate(e,t).scale(n),bt=(e,t)=>e.target.closest(`.${t}`),Us=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),bp=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,hr=(e,t=0,n=bp,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},qs=e=>{const t=e.ctrlKey&&qt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function vp({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(bt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&s){const y=_e(d),w=qs(d),_=f*Math.pow(2,w);o.scaleTo(n,_,y,d);return}const u=d.deltaMode===1?20:1;let h=r===Ke.Vertical?0:d.deltaX*u,p=r===Ke.Horizontal?0:d.deltaY*u;!qt()&&d.shiftKey&&r!==Ke.Vertical&&(h=d.deltaY*u,p=0),o.translateBy(n,-(h/f)*i,-(p/f)*i,{internal:!0});const g=qn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(d,g)),e.isPanScrolling&&(l?.(d,g),e.panScrollTimeout=setTimeout(()=>{c?.(d,g),e.isPanScrolling=!1},150))}}function _p({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=bt(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Ep({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=qn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Sp({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Us(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,qn(i.transform))}}function Np({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Us(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&wp(e.prevViewport,s.transform))){const a=qn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Cp({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c}){return d=>{const f=e||t,u=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(bt(d,`${c}-flow__node`)||bt(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||bt(d,a)&&d.type==="wheel"||bt(d,l)&&(d.type!=="wheel"||r&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!u&&d.type==="wheel"||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const h=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&h}}function kp({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),u=ls().clickDistance(!Ne(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),h=be(e).call(u);m({x:i.x,y:i.y,zoom:mt(i.zoom,t,n)},[[0,0],[f.width,f.height]],r);const p=h.on("wheel.zoom"),g=h.on("dblclick.zoom");u.wheelDelta(qs);function y(D,L){return h?new Promise(b=>{u?.interpolate(L?.interpolate==="linear"?jt:An).transform(hr(h,L?.duration,L?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function w({noWheelClassName:D,noPanClassName:L,onPaneContextMenu:b,userSelectionActive:I,panOnScroll:k,panOnDrag:A,panOnScrollMode:P,panOnScrollSpeed:$,preventScrolling:S,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:B,zoomActivationKeyPressed:F,lib:U,onTransformChange:K}){I&&!d.isZoomingOrPanning&&_();const R=k&&!F&&!I?vp({zoomPanValues:d,noWheelClassName:D,d3Selection:h,d3Zoom:u,panOnScrollMode:P,panOnScrollSpeed:$,zoomOnPinch:O,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):_p({noWheelClassName:D,preventScrolling:S,d3ZoomHandler:p});if(h.on("wheel.zoom",R,{passive:!1}),!I){const ee=Ep({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:a});u.on("start",ee);const re=Sp({zoomPanValues:d,panOnDrag:A,onPaneContextMenu:!!b,onPanZoom:s,onTransformChange:K});u.on("zoom",re);const Z=Np({zoomPanValues:d,panOnDrag:A,panOnScroll:k,onPaneContextMenu:b,onPanZoomEnd:l,onDraggingChange:c});u.on("end",Z)}const Y=Cp({zoomActivationKeyPressed:F,panOnDrag:A,zoomOnScroll:H,panOnScroll:k,zoomOnDoubleClick:B,zoomOnPinch:O,userSelectionActive:I,noPanClassName:L,noWheelClassName:D,lib:U});u.filter(Y),B?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function _(){u.on("zoom",null)}async function m(D,L,b){const I=fr(D),k=u?.constrain()(I,L,b);return k&&await y(k),new Promise(A=>A(k))}async function x(D,L){const b=fr(D);return await y(b,L),new Promise(I=>I(b))}function C(D){if(h){const L=fr(D),b=h.property("__zoom");(b.k!==D.zoom||b.x!==D.x||b.y!==D.y)&&u?.transform(h,L,null,{sync:!0})}}function E(){const D=h?ss(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function M(D,L){return h?new Promise(b=>{u?.interpolate(L?.interpolate==="linear"?jt:An).scaleTo(hr(h,L?.duration,L?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function N(D,L){return h?new Promise(b=>{u?.interpolate(L?.interpolate==="linear"?jt:An).scaleBy(hr(h,L?.duration,L?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function z(D){u?.scaleExtent(D)}function V(D){u?.translateExtent(D)}function j(D){const L=!Ne(D)||D<0?0:D;u?.clickDistance(L)}return{update:w,destroy:_,setViewport:x,setViewportConstrained:m,getViewport:E,scaleTo:M,scaleBy:N,setScaleExtent:z,setTranslateExtent:V,syncViewport:C,setClickDistance:j}}var Je;(function(e){e.Line="line",e.Handle="handle"})(Je||(Je={}));function Tp({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Mp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ve(e,t){return Math.max(0,t-e)}function Re(e,t){return Math.max(0,e-t)}function Zn(e,t,n){return Math.max(0,t-e,e-n)}function Zs(e,t){return e?!t:t}function Ap(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:d,isVertical:f}=t,u=d&&f,{xSnapped:h,ySnapped:p}=n,{minWidth:g,maxWidth:y,minHeight:w,maxHeight:_}=o,{x:m,y:x,width:C,height:E,aspectRatio:M}=e;let N=Math.floor(d?h-e.pointerX:0),z=Math.floor(f?p-e.pointerY:0);const V=C+(l?-N:N),j=E+(c?-z:z),D=-i[0]*C,L=-i[1]*E;let b=Zn(V,g,y),I=Zn(j,w,_);if(s){let P=0,$=0;l&&N<0?P=Ve(m+N+D,s[0][0]):!l&&N>0&&(P=Re(m+V+D,s[1][0])),c&&z<0?$=Ve(x+z+L,s[0][1]):!c&&z>0&&($=Re(x+j+L,s[1][1])),b=Math.max(b,P),I=Math.max(I,$)}if(a){let P=0,$=0;l&&N>0?P=Re(m+N,a[0][0]):!l&&N<0&&(P=Ve(m+V,a[1][0])),c&&z>0?$=Re(x+z,a[0][1]):!c&&z<0&&($=Ve(x+j,a[1][1])),b=Math.max(b,P),I=Math.max(I,$)}if(r){if(d){const P=Zn(V/M,w,_)*M;if(b=Math.max(b,P),s){let $=0;!l&&!c||l&&!c&&u?$=Re(x+L+V/M,s[1][1])*M:$=Ve(x+L+(l?N:-N)/M,s[0][1])*M,b=Math.max(b,$)}if(a){let $=0;!l&&!c||l&&!c&&u?$=Ve(x+V/M,a[1][1])*M:$=Re(x+(l?N:-N)/M,a[0][1])*M,b=Math.max(b,$)}}if(f){const P=Zn(j*M,g,y)/M;if(I=Math.max(I,P),s){let $=0;!l&&!c||c&&!l&&u?$=Re(m+j*M+D,s[1][0])/M:$=Ve(m+(c?z:-z)*M+D,s[0][0])/M,I=Math.max(I,$)}if(a){let $=0;!l&&!c||c&&!l&&u?$=Ve(m+j*M,a[1][0])/M:$=Re(m+(c?z:-z)*M,a[0][0])/M,I=Math.max(I,$)}}}z=z+(z<0?I:-I),N=N+(N<0?b:-b),r&&(u?V>j*M?z=(Zs(l,c)?-N:N)/M:N=(Zs(l,c)?-z:z)*M:d?(z=N/M,c=l):(N=z*M,l=c));const k=l?m+N:m,A=c?x+z:x;return{width:C+(l?-N:N),height:E+(c?-z:z),x:i[0]*N*(l?-1:1)+k,y:i[1]*z*(c?-1:1)+A}}const Ks={width:0,height:0,x:0,y:0},Ip={...Ks,pointerX:0,pointerY:0,aspectRatio:1};function Pp(e){return[[0,0],[e.measured.width,e.measured.height]]}function Op(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function Dp({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=be(e);function s({controlPosition:l,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:u,onResize:h,onResizeEnd:p,shouldResize:g}){let y={...Ks},w={...Ip};const _=Mp(l);let m,x=null,C=[],E,M,N;const z=Pi().on("start",V=>{const{nodeLookup:j,transform:D,snapGrid:L,snapToGrid:b,nodeOrigin:I,paneDomNode:k}=n();if(m=j.get(t),!m)return;x=k?.getBoundingClientRect()??null;const{xSnapped:A,ySnapped:P}=Zt(V.sourceEvent,{transform:D,snapGrid:L,snapToGrid:b,containerBounds:x});y={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},w={...y,pointerX:A,pointerY:P,aspectRatio:y.width/y.height},E=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(E=j.get(m.parentId),M=E&&m.extent==="parent"?Pp(E):void 0),C=[],N=void 0;for(const[$,S]of j)if(S.parentId===t&&(C.push({id:$,position:{...S.position},extent:S.extent}),S.extent==="parent"||S.expandParent)){const O=Op(S,m,S.origin??I);N?N=[[Math.min(O[0][0],N[0][0]),Math.min(O[0][1],N[0][1])],[Math.max(O[1][0],N[1][0]),Math.max(O[1][1],N[1][1])]]:N=O}u?.(V,{...y})}).on("drag",V=>{const{transform:j,snapGrid:D,snapToGrid:L,nodeOrigin:b}=n(),I=Zt(V.sourceEvent,{transform:j,snapGrid:D,snapToGrid:L,containerBounds:x}),k=[];if(!m)return;const{x:A,y:P,width:$,height:S}=y,O={},H=m.origin??b,{width:B,height:F,x:U,y:K}=Ap(w,_,I,c,d,H,M,N),W=B!==$,R=F!==S,Y=U!==A&&W,ee=K!==P&&R;if(!Y&&!ee&&!W&&!R)return;if((Y||ee||H[0]===1||H[1]===1)&&(O.x=Y?U:y.x,O.y=ee?K:y.y,y.x=O.x,y.y=O.y,C.length>0)){const J=U-A,le=K-P;for(const he of C)he.position={x:he.position.x-J+H[0]*(B-$),y:he.position.y-le+H[1]*(F-S)},k.push(he)}if((W||R)&&(O.width=W&&(!f||f==="horizontal")?B:y.width,O.height=R&&(!f||f==="vertical")?F:y.height,y.width=O.width,y.height=O.height),E&&m.expandParent){const J=H[0]*(O.width??0);O.x&&O.x<J&&(y.x=J,w.x=w.x-(O.x-J));const le=H[1]*(O.height??0);O.y&&O.y<le&&(y.y=le,w.y=w.y-(O.y-le))}const re=Tp({width:y.width,prevWidth:$,height:y.height,prevHeight:S,affectsX:_.affectsX,affectsY:_.affectsY}),Z={...y,direction:re};g?.(V,Z)!==!1&&(h?.(V,Z),o(O,k))}).on("end",V=>{p?.(V,{...y}),r?.({...y})});i.call(z)}function a(){i.on(".drag",null)}return{update:s,destroy:a}}var Kn={exports:{}},pr={},Qn={exports:{}},gr={};/**
22
+ <%s key={someKey} {...props} />`,F,V,X,V),P[V+F]=!0)}if(V=null,z!==void 0&&(n(z),V=""+z),s(D)&&(n(D.key),V=""+D.key),"key"in D){z={};for(var J in D)J!=="key"&&(z[J]=D[J])}else z=D;return V&&a(z,typeof _=="function"?_.displayName||_.name||"Unknown":_),l(_,V,Y,B,r(),z,K,W)}function h(_){typeof _=="object"&&_!==null&&_.$$typeof===f&&_._store&&(_._store.validated=1)}var d=O,f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),m=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),j=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,$=Array.isArray,y=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(_){return _()}};var A,T={},S=d.react_stack_bottom_frame.bind(d,i)(),E=y(o(i)),P={};Xt.Fragment=g,Xt.jsx=function(_,D,z,F,B){var Y=1e4>j.recentlyCreatedOwnerStacks++;return u(_,D,z,!1,F,B,Y?Error("react-stack-top-frame"):S,Y?y(o(_)):E)},Xt.jsxs=function(_,D,z,F,B){var Y=1e4>j.recentlyCreatedOwnerStacks++;return u(_,D,z,!0,F,B,Y?Error("react-stack-top-frame"):S,Y?y(o(_)):E)}}()),Xt}var $i;function Ou(){return $i||($i=1,process.env.NODE_ENV==="production"?In.exports=Iu():In.exports=Pu()),In.exports}var C=Ou();function zi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Du(...e){return t=>{let n=!1;const o=e.map(r=>{const i=zi(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():zi(e[r],null)}}}}function Ru(e){const t=$u(e),n=U.forwardRef((o,r)=>{const{children:i,...s}=o,a=U.Children.toArray(i),c=a.find(Hu);if(c){const l=c.props.children,u=a.map(h=>h===c?U.Children.count(l)>1?U.Children.only(null):U.isValidElement(l)?l.props.children:null:h);return C.jsx(t,{...s,ref:r,children:U.isValidElement(l)?U.cloneElement(l,void 0,u):null})}return C.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var Lu=Ru("Slot");function $u(e){const t=U.forwardRef((n,o)=>{const{children:r,...i}=n;if(U.isValidElement(r)){const s=Vu(r),a=ju(i,r.props);return r.type!==U.Fragment&&(a.ref=o?Du(o,s):s),U.cloneElement(r,a)}return U.Children.count(r)>1?U.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zu=Symbol("radix.slottable");function Hu(e){return U.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zu}function ju(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Vu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function ji(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hi(e))&&(o&&(o+=" "),o+=t);return o}const Vi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fi=ji,Fu=(e,t)=>n=>{var o;if(t?.variants==null)return Fi(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(l=>{const u=n?.[l],h=i?.[l];if(u===null)return null;const d=Vi(u)||Vi(h);return r[l][d]}),a=n&&Object.entries(n).reduce((l,u)=>{let[h,d]=u;return d===void 0||(l[h]=d),l},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((l,u)=>{let{class:h,className:d,...f}=u;return Object.entries(f).every(p=>{let[g,x]=p;return Array.isArray(x)?x.includes({...i,...a}[g]):{...i,...a}[g]===x})?[...l,h,d]:l},[]);return Fi(e,s,c,n?.class,n?.className)},Jo="-",Bu=e=>{const t=Yu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(Jo);return a[0]===""&&a.length!==1&&a.shift(),Bi(a,t)||Wu(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&o[s]?[...c,...o[s]]:c}}},Bi=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Bi(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Jo);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Wi=/^\[(.+)\]$/,Wu=e=>{if(Wi.test(e)){const t=Wi.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Yu=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const r in n)er(n[r],o,r,t);return o},er=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Yi(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(Xu(r)){er(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{er(s,Yi(t,i),n,o)})})},Yi=(e,t)=>{let n=e;return t.split(Jo).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},Xu=e=>e.isThemeGetter,Uu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},tr="!",nr=":",Gu=nr.length,qu=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const i=[];let s=0,a=0,c=0,l;for(let p=0;p<r.length;p++){let g=r[p];if(s===0&&a===0){if(g===nr){i.push(r.slice(c,p)),c=p+Gu;continue}if(g==="/"){l=p;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const u=i.length===0?r:r.substring(c),h=Zu(u),d=h!==u,f=l&&l>c?l-c:void 0;return{modifiers:i,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}};if(t){const r=t+nr,i=o;o=s=>s.startsWith(r)?i(s.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const r=o;o=i=>n({className:i,parseClassName:r})}return o},Zu=e=>e.endsWith(tr)?e.substring(0,e.length-1):e.startsWith(tr)?e.substring(1):e,Ku=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const r=[];let i=[];return o.forEach(s=>{s[0]==="["||t[s]?(r.push(...i.sort(),s),i=[]):i.push(s)}),r.push(...i.sort()),r}},Qu=e=>({cache:Uu(e.cacheSize),parseClassName:qu(e),sortModifiers:Ku(e),...Bu(e)}),Ju=/\s+/,ed=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:i}=t,s=[],a=e.trim().split(Ju);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:h,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}=n(u);if(h){c=u+(c.length>0?" "+c:c);continue}let x=!!g,b=o(x?p.substring(0,g):p);if(!b){if(!x){c=u+(c.length>0?" "+c:c);continue}if(b=o(p),!b){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=i(d).join(":"),m=f?v+tr:v,w=m+b;if(s.includes(w))continue;s.push(w);const k=r(b,x);for(let N=0;N<k.length;++N){const I=k[N];s.push(m+I)}c=u+(c.length>0?" "+c:c)}return c};function td(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xi(t))&&(o&&(o+=" "),o+=n);return o}const Xi=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Xi(e[o]))&&(n&&(n+=" "),n+=t);return n};function nd(e,...t){let n,o,r,i=s;function s(c){const l=t.reduce((u,h)=>h(u),e());return n=Qu(l),o=n.cache.get,r=n.cache.set,i=a,a(c)}function a(c){const l=o(c);if(l)return l;const u=ed(c,n);return r(c,u),u}return function(){return i(td.apply(null,arguments))}}const he=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ui=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,od=/^\d+\/\d+$/,rd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,id=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>od.test(e),re=e=>!!e&&!Number.isNaN(Number(e)),qe=e=>!!e&&Number.isInteger(Number(e)),or=e=>e.endsWith("%")&&re(e.slice(0,-1)),Fe=e=>rd.test(e),ld=()=>!0,ud=e=>id.test(e)&&!sd.test(e),qi=()=>!1,dd=e=>ad.test(e),fd=e=>cd.test(e),hd=e=>!G(e)&&!q(e),pd=e=>wt(e,es,qi),G=e=>Ui.test(e),nt=e=>wt(e,ts,ud),rr=e=>wt(e,wd,re),Zi=e=>wt(e,Qi,qi),gd=e=>wt(e,Ji,fd),Pn=e=>wt(e,ns,dd),q=e=>Gi.test(e),Ut=e=>bt(e,ts),md=e=>bt(e,bd),Ki=e=>bt(e,Qi),yd=e=>bt(e,es),xd=e=>bt(e,Ji),On=e=>bt(e,ns,!0),wt=(e,t,n)=>{const o=Ui.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},bt=(e,t,n=!1)=>{const o=Gi.exec(e);return o?o[1]?t(o[1]):n:!1},Qi=e=>e==="position"||e==="percentage",Ji=e=>e==="image"||e==="url",es=e=>e==="length"||e==="size"||e==="bg-size",ts=e=>e==="length",wd=e=>e==="number",bd=e=>e==="family-name",ns=e=>e==="shadow",vd=nd(()=>{const e=he("color"),t=he("font"),n=he("text"),o=he("font-weight"),r=he("tracking"),i=he("leading"),s=he("breakpoint"),a=he("container"),c=he("spacing"),l=he("radius"),u=he("shadow"),h=he("inset-shadow"),d=he("text-shadow"),f=he("drop-shadow"),p=he("blur"),g=he("perspective"),x=he("aspect"),b=he("ease"),v=he("animate"),m=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...w(),q,G],N=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],M=()=>[q,G,c],L=()=>[xt,"full","auto",...M()],H=()=>[qe,"none","subgrid",q,G],j=()=>["auto",{span:["full",qe,q,G]},qe,q,G],R=()=>[qe,"auto",q,G],$=()=>["auto","min","max","fr",q,G],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...M()],S=()=>[xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],E=()=>[e,q,G],P=()=>[...w(),Ki,Zi,{position:[q,G]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",yd,pd,{size:[q,G]}],z=()=>[or,Ut,nt],F=()=>["","none","full",l,q,G],B=()=>["",re,Ut,nt],Y=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[re,or,Ki,Zi],V=()=>["","none",p,q,G],X=()=>["none",re,q,G],J=()=>["none",re,q,G],te=()=>[re,q,G],Z=()=>[xt,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fe],breakpoint:[Fe],color:[ld],container:[Fe],"drop-shadow":[Fe],ease:["in","out","in-out"],font:[hd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fe],shadow:[Fe],spacing:["px",re],text:[Fe],"text-shadow":[Fe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xt,G,q,x]}],container:["container"],columns:[{columns:[re,G,q,a]}],"break-after":[{"break-after":m()}],"break-before":[{"break-before":m()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[qe,"auto",q,G]}],basis:[{basis:[xt,"full","auto",a,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,xt,"auto","initial","none",G]}],grow:[{grow:["",re,q,G]}],shrink:[{shrink:["",re,q,G]}],order:[{order:[qe,"first","last","none",q,G]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[a,"screen",...S()]}],"min-w":[{"min-w":[a,"screen","none",...S()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",n,Ut,nt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,q,rr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",or,G]}],"font-family":[{font:[md,G,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,q,G]}],"line-clamp":[{"line-clamp":[re,"none",q,rr]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",q,G]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",q,nt]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[re,"auto",q,G]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q,G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qe,q,G],radial:["",q,G],conic:[qe,q,G]},xd,gd]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,q,G]}],"outline-w":[{outline:["",re,Ut,nt]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,On,Pn]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",h,On,Pn]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[re,nt]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",d,On,Pn]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[re,q,G]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[q,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,G]}],filter:[{filter:["","none",q,G]}],blur:[{blur:V()}],brightness:[{brightness:[re,q,G]}],contrast:[{contrast:[re,q,G]}],"drop-shadow":[{"drop-shadow":["","none",f,On,Pn]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",re,q,G]}],"hue-rotate":[{"hue-rotate":[re,q,G]}],invert:[{invert:["",re,q,G]}],saturate:[{saturate:[re,q,G]}],sepia:[{sepia:["",re,q,G]}],"backdrop-filter":[{"backdrop-filter":["","none",q,G]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[re,q,G]}],"backdrop-contrast":[{"backdrop-contrast":[re,q,G]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,q,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,q,G]}],"backdrop-invert":[{"backdrop-invert":["",re,q,G]}],"backdrop-opacity":[{"backdrop-opacity":[re,q,G]}],"backdrop-saturate":[{"backdrop-saturate":[re,q,G]}],"backdrop-sepia":[{"backdrop-sepia":["",re,q,G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,G]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",q,G]}],ease:[{ease:["linear","initial",b,q,G]}],delay:[{delay:[re,q,G]}],animate:[{animate:["none",v,q,G]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,q,G]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[q,G,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q,G]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,G]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[re,Ut,nt,rr]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function se(...e){return vd(ji(e))}const Ed=Fu("inline-flex items-center justify-center gap-2 py-2 px-4 rounded-md transition-all text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white disabled:cursor-not-allowed outline-none focus-visible:outline-none border",{variants:{color:{dark:"bg-secondary-black border-secondary-dark-gray",lightNonPriority:"bg-primary-gray border-transparent",lightPriority:"bg-primary-gray border-transparent",lightParentGroupBasedHover:"bg-primary-gray border-transparent"},applyHoverStyles:{true:"",false:""}},defaultVariants:{color:"dark",applyHoverStyles:!0},compoundVariants:[{color:"dark",applyHoverStyles:!0,className:"hover:bg-primary-dark-gray"},{color:"lightNonPriority",applyHoverStyles:!0,className:"hover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightPriority",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightParentGroupBasedHover",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray group-hover/lightParentGroupBasedHover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"}]}),vt=O.forwardRef(({className:e,color:t,asChild:n=!1,applyHoverStyles:o,...r},i)=>{const s=n?Lu:"button";return C.jsx(s,{ref:i,"data-slot":"button",className:se(Ed({color:t,className:e,applyHoverStyles:o})),...r})});vt.displayName="Button";function ir(e,t,n,o=!1,r=!1){if(t>n){const i=t;t=n,n=i}return(o?e>=t:e>t)&&(r?e<=n:e<n)}function os(e,t,n=!1,o=!1){return ir(e.x,t.left,t.right,n)&&ir(e.y,t.top,t.bottom,o)}function rs(e){const t=e.startsWith("-"),n=e.replaceAll(/[^0-9\.]/g,""),o=n.indexOf(".");let r=0;if(o===-1)r=Number(n);else{const i=n.substring(0,o).replaceAll(/[^0-9]/g,""),s=n.substring(o+1).replaceAll(/[^0-9]/g,"");r=+(i+"."+s)}return t&&(r=-r),r}function sr(e,t){return e.toFixed(t).replace(/[0]+$/,"").replace(/\.$/,"")}const Oe=["string","number","complex","noEquivalent","inferFromConnection"],is={[Oe[0]]:Oe[0],[Oe[1]]:Oe[1],[Oe[2]]:Oe[2],[Oe[3]]:Oe[3],[Oe[4]]:Oe[4]};function _d(e){return!!is[e]}function Sd(e){return e}function Cd(e,t){return e in t}function Nd(e){return e}function kd(e,t){return e in t}function Td(e){return e}function Md(e){return e}function Ad(e){return e}var ss=Symbol.for("immer-nothing"),as=Symbol.for("immer-draftable"),we=Symbol.for("immer-state"),Id=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function me(e,...t){if(process.env.NODE_ENV!=="production"){const n=Id[e],o=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Et=Object.getPrototypeOf;function _t(e){return!!e&&!!e[we]}function ot(e){return e?cs(e)||Array.isArray(e)||!!e[as]||!!e.constructor?.[as]||Gt(e)||Ln(e):!1}var Pd=Object.prototype.constructor.toString();function cs(e){if(!e||typeof e!="object")return!1;const t=Et(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Pd}function Dn(e,t){Rn(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function Rn(e){const t=e[we];return t?t.type_:Array.isArray(e)?1:Gt(e)?2:Ln(e)?3:0}function ar(e,t){return Rn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ls(e,t,n){const o=Rn(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function Od(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Gt(e){return e instanceof Map}function Ln(e){return e instanceof Set}function rt(e){return e.copy_||e.base_}function cr(e,t){if(Gt(e))return new Map(e);if(Ln(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=cs(e);if(t===!0||t==="class_only"&&!n){const o=Object.getOwnPropertyDescriptors(e);delete o[we];let r=Reflect.ownKeys(o);for(let i=0;i<r.length;i++){const s=r[i],a=o[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(o[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Et(e),o)}else{const o=Et(e);if(o!==null&&n)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function lr(e,t=!1){return zn(e)||_t(e)||!ot(e)||(Rn(e)>1&&Object.defineProperties(e,{set:{value:$n},add:{value:$n},clear:{value:$n},delete:{value:$n}}),Object.freeze(e),t&&Object.values(e).forEach(n=>lr(n,!0))),e}function $n(){me(2)}function zn(e){return Object.isFrozen(e)}var Dd={};function it(e){const t=Dd[e];return t||me(0,e),t}var qt;function us(){return qt}function Rd(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ds(e,t){t&&(it("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ur(e){dr(e),e.drafts_.forEach(Ld),e.drafts_=null}function dr(e){e===qt&&(qt=e.parent_)}function fs(e){return qt=Rd(qt,e)}function Ld(e){const t=e[we];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hs(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[we].modified_&&(ur(t),me(4)),ot(e)&&(e=Hn(t,e),t.parent_||jn(t,e)),t.patches_&&it("Patches").generateReplacementPatches_(n[we].base_,e,t.patches_,t.inversePatches_)):e=Hn(t,n,[]),ur(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ss?e:void 0}function Hn(e,t,n){if(zn(t))return t;const o=t[we];if(!o)return Dn(t,(r,i)=>ps(e,o,t,r,i,n)),t;if(o.scope_!==e)return t;if(!o.modified_)return jn(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let i=r,s=!1;o.type_===3&&(i=new Set(r),r.clear(),s=!0),Dn(i,(a,c)=>ps(e,o,r,a,c,n,s)),jn(e,r,!1),n&&e.patches_&&it("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function ps(e,t,n,o,r,i,s){if(process.env.NODE_ENV!=="production"&&r===n&&me(5),_t(r)){const a=i&&t&&t.type_!==3&&!ar(t.assigned_,o)?i.concat(o):void 0,c=Hn(e,r,a);if(ls(n,o,c),_t(c))e.canAutoFreeze_=!1;else return}else s&&n.add(r);if(ot(r)&&!zn(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Hn(e,r),(!t||!t.scope_.parent_)&&typeof o!="symbol"&&(Gt(n)?n.has(o):Object.prototype.propertyIsEnumerable.call(n,o))&&jn(e,r)}}function jn(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lr(t,n)}function $d(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:us(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=fr;n&&(r=[o],i=Zt);const{revoke:s,proxy:a}=Proxy.revocable(r,i);return o.draft_=a,o.revoke_=s,a}var fr={get(e,t){if(t===we)return e;const n=rt(e);if(!ar(n,t))return zd(e,n,t);const o=n[t];return e.finalized_||!ot(o)?o:o===hr(e.base_,t)?(gr(e),e.copy_[t]=mr(o,e)):o},has(e,t){return t in rt(e)},ownKeys(e){return Reflect.ownKeys(rt(e))},set(e,t,n){const o=gs(rt(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const r=hr(rt(e),t),i=r?.[we];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Od(n,r)&&(n!==void 0||ar(e.base_,t)))return!0;gr(e),pr(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return hr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gr(e),pr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=rt(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty(){me(11)},getPrototypeOf(e){return Et(e.base_)},setPrototypeOf(){me(12)}},Zt={};Dn(fr,(e,t)=>{Zt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Zt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&me(13),Zt.set.call(this,e,t,void 0)},Zt.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&me(14),fr.set.call(this,e[0],t,n,e[0])};function hr(e,t){const n=e[we];return(n?rt(n):e)[t]}function zd(e,t,n){const o=gs(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}function gs(e,t){if(!(t in e))return;let n=Et(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Et(n)}}function pr(e){e.modified_||(e.modified_=!0,e.parent_&&pr(e.parent_))}function gr(e){e.copy_||(e.copy_=cr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Hd=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,o)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(c=i,...l){return s.produce(c,u=>n.call(this,u,...l))}}typeof n!="function"&&me(6),o!==void 0&&typeof o!="function"&&me(7);let r;if(ot(t)){const i=fs(this),s=mr(t,void 0);let a=!0;try{r=n(s),a=!1}finally{a?ur(i):dr(i)}return ds(i,o),hs(r,i)}else if(!t||typeof t!="object"){if(r=n(t),r===void 0&&(r=t),r===ss&&(r=void 0),this.autoFreeze_&&lr(r,!0),o){const i=[],s=[];it("Patches").generateReplacementPatches_(t,r,i,s),o(i,s)}return r}else me(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,c=>t(c,...a));let o,r;return[this.produce(t,n,(s,a)=>{o=s,r=a}),o,r]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ot(e)||me(8),_t(e)&&(e=jd(e));const t=fs(this),n=mr(e,void 0);return n[we].isManual_=!0,dr(t),n}finishDraft(e,t){const n=e&&e[we];(!n||!n.isManual_)&&me(9);const{scope_:o}=n;return ds(o,t),hs(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}n>-1&&(t=t.slice(n+1));const o=it("Patches").applyPatches_;return _t(e)?o(e,t):this.produce(e,r=>o(r,t))}};function mr(e,t){const n=Gt(e)?it("MapSet").proxyMap_(e,t):Ln(e)?it("MapSet").proxySet_(e,t):$d(e,t);return(t?t.scope_:us()).drafts_.push(n),n}function jd(e){return _t(e)||me(10,e),ms(e)}function ms(e){if(!ot(e)||zn(e))return e;const t=e[we];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cr(e,t.scope_.immer_.useStrictShallowCopy_)}else n=cr(e,!0);return Dn(n,(o,r)=>{ls(n,o,ms(r))}),t&&(t.finalized_=!1),n}var Vd=new Hd,Fd=Vd.produce;function St(e){const t=[];for(let o=0;o<Math.floor(e/8);o++)t.push(Math.random().toString(36).substring(2,10));return t.push(Math.random().toString(36).substring(2,e%8+2)),t.join("")}function fe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=fe(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Bd={value:()=>{}};function Vn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Fn(n)}function Fn(e){this._=e}function Wd(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Fn.prototype=Vn.prototype={constructor:Fn,on:function(e,t){var n=this._,o=Wd(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=Yd(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=ys(n[r],e.name,t);else if(t==null)for(r in n)n[r]=ys(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function Yd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function ys(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Bd,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var yr="http://www.w3.org/1999/xhtml";const xs={svg:"http://www.w3.org/2000/svg",xhtml:yr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),xs.hasOwnProperty(t)?{space:xs[t],local:e}:e}function Xd(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yr&&t.documentElement.namespaceURI===yr?t.createElement(e):t.createElementNS(n,e)}}function Ud(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ws(e){var t=Bn(e);return(t.local?Ud:Xd)(t)}function Gd(){}function xr(e){return e==null?Gd:function(){return this.querySelector(e)}}function qd(e){typeof e!="function"&&(e=xr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),c,l,u=0;u<s;++u)(c=i[u])&&(l=e.call(c,c.__data__,u,i))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new be(o,this._parents)}function Zd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Kd(){return[]}function bs(e){return e==null?Kd:function(){return this.querySelectorAll(e)}}function Qd(e){return function(){return Zd(e.apply(this,arguments))}}function Jd(e){typeof e=="function"?e=Qd(e):e=bs(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(o.push(e.call(c,c.__data__,l,s)),r.push(c));return new be(o,r)}function vs(e){return function(){return this.matches(e)}}function Es(e){return function(t){return t.matches(e)}}var ef=Array.prototype.find;function tf(e){return function(){return ef.call(this.children,e)}}function nf(){return this.firstElementChild}function of(e){return this.select(e==null?nf:tf(typeof e=="function"?e:Es(e)))}var rf=Array.prototype.filter;function sf(){return Array.from(this.children)}function af(e){return function(){return rf.call(this.children,e)}}function cf(e){return this.selectAll(e==null?sf:af(typeof e=="function"?e:Es(e)))}function lf(e){typeof e!="function"&&(e=vs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new be(o,this._parents)}function _s(e){return new Array(e.length)}function uf(){return new be(this._enter||this._groups.map(_s),this._parents)}function Wn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wn.prototype={constructor:Wn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function df(e){return function(){return e}}function ff(e,t,n,o,r,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Wn(e,i[s]);for(;s<c;++s)(a=t[s])&&(r[s]=a)}function hf(e,t,n,o,r,i,s){var a,c,l=new Map,u=t.length,h=i.length,d=new Array(u),f;for(a=0;a<u;++a)(c=t[a])&&(d[a]=f=s.call(c,c.__data__,a,t)+"",l.has(f)?r[a]=c:l.set(f,c));for(a=0;a<h;++a)f=s.call(e,i[a],a,i)+"",(c=l.get(f))?(o[a]=c,c.__data__=i[a],l.delete(f)):n[a]=new Wn(e,i[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(r[a]=c)}function pf(e){return e.__data__}function gf(e,t){if(!arguments.length)return Array.from(this,pf);var n=t?hf:ff,o=this._parents,r=this._groups;typeof e!="function"&&(e=df(e));for(var i=r.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var u=o[l],h=r[l],d=h.length,f=mf(e.call(u,u&&u.__data__,l,o)),p=f.length,g=a[l]=new Array(p),x=s[l]=new Array(p),b=c[l]=new Array(d);n(u,h,g,x,b,f,t);for(var v=0,m=0,w,k;v<p;++v)if(w=g[v]){for(v>=m&&(m=v+1);!(k=x[m])&&++m<p;);w._next=k||null}}return s=new be(s,o),s._enter=a,s._exit=c,s}function mf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yf(){return new be(this._exit||this._groups.map(_s),this._parents)}function xf(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function wf(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=n[c],u=o[c],h=l.length,d=a[c]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;c<r;++c)a[c]=n[c];return new be(a,this._parents)}function bf(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function vf(e){e||(e=Ef);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,c=r[i]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new be(r,this._parents).order()}function Ef(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _f(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sf(){return Array.from(this)}function Cf(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Nf(){let e=0;for(const t of this)++e;return e}function kf(){return!this.node()}function Tf(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Mf(e){return function(){this.removeAttribute(e)}}function Af(e){return function(){this.removeAttributeNS(e.space,e.local)}}function If(e,t){return function(){this.setAttribute(e,t)}}function Pf(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Of(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Df(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Rf(e,t){var n=Bn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Af:Mf:typeof t=="function"?n.local?Df:Of:n.local?Pf:If)(n,t))}function Ss(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lf(e){return function(){this.style.removeProperty(e)}}function $f(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zf(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Hf(e,t,n){return arguments.length>1?this.each((t==null?Lf:typeof t=="function"?zf:$f)(e,t,n??"")):Ct(this.node(),e)}function Ct(e,t){return e.style.getPropertyValue(t)||Ss(e).getComputedStyle(e,null).getPropertyValue(t)}function jf(e){return function(){delete this[e]}}function Vf(e,t){return function(){this[e]=t}}function Ff(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Bf(e,t){return arguments.length>1?this.each((t==null?jf:typeof t=="function"?Ff:Vf)(e,t)):this.node()[e]}function Cs(e){return e.trim().split(/^|\s+/)}function wr(e){return e.classList||new Ns(e)}function Ns(e){this._node=e,this._names=Cs(e.getAttribute("class")||"")}Ns.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 ks(e,t){for(var n=wr(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Ts(e,t){for(var n=wr(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Wf(e){return function(){ks(this,e)}}function Yf(e){return function(){Ts(this,e)}}function Xf(e,t){return function(){(t.apply(this,arguments)?ks:Ts)(this,e)}}function Uf(e,t){var n=Cs(e+"");if(arguments.length<2){for(var o=wr(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Xf:t?Wf:Yf)(n,t))}function Gf(){this.textContent=""}function qf(e){return function(){this.textContent=e}}function Zf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Kf(e){return arguments.length?this.each(e==null?Gf:(typeof e=="function"?Zf:qf)(e)):this.node().textContent}function Qf(){this.innerHTML=""}function Jf(e){return function(){this.innerHTML=e}}function eh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function th(e){return arguments.length?this.each(e==null?Qf:(typeof e=="function"?eh:Jf)(e)):this.node().innerHTML}function nh(){this.nextSibling&&this.parentNode.appendChild(this)}function oh(){return this.each(nh)}function rh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ih(){return this.each(rh)}function sh(e){var t=typeof e=="function"?e:ws(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ah(){return null}function ch(e,t){var n=typeof e=="function"?e:ws(e),o=t==null?ah:typeof t=="function"?t:xr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function lh(){var e=this.parentNode;e&&e.removeChild(this)}function uh(){return this.each(lh)}function dh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hh(e){return this.select(e?fh:dh)}function ph(e){return arguments.length?this.property("__data__",e):this.node().__data__}function gh(e){return function(t){e.call(this,t,this.__data__)}}function mh(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function yh(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function xh(e,t,n){return function(){var o=this.__on,r,i=gh(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function wh(e,t,n){var o=mh(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(r=0,u=a[c];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?xh:yh,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Ms(e,t,n){var o=Ss(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function bh(e,t){return function(){return Ms(this,e,t)}}function vh(e,t){return function(){return Ms(this,e,t.apply(this,arguments))}}function Eh(e,t){return this.each((typeof t=="function"?vh:bh)(e,t))}function*_h(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var As=[null];function be(e,t){this._groups=e,this._parents=t}function Kt(){return new be([[document.documentElement]],As)}function Sh(){return this}be.prototype=Kt.prototype={constructor:be,select:qd,selectAll:Jd,selectChild:of,selectChildren:cf,filter:lf,data:gf,enter:uf,exit:yf,join:xf,merge:wf,selection:Sh,order:bf,sort:vf,call:_f,nodes:Sf,node:Cf,size:Nf,empty:kf,each:Tf,attr:Rf,style:Hf,property:Bf,classed:Uf,text:Kf,html:th,raise:oh,lower:ih,append:sh,insert:ch,remove:uh,clone:hh,datum:ph,on:wh,dispatch:Eh,[Symbol.iterator]:_h};function ve(e){return typeof e=="string"?new be([[document.querySelector(e)]],[document.documentElement]):new be([[e]],As)}function Ch(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ne(e,t){if(e=Ch(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Nh={passive:!1},Qt={capture:!0,passive:!1};function br(e){e.stopImmediatePropagation()}function Nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Is(e){var t=e.document.documentElement,n=ve(e).on("dragstart.drag",Nt,Qt);"onselectstart"in t?n.on("selectstart.drag",Nt,Qt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ps(e,t){var n=e.document.documentElement,o=ve(e).on("dragstart.drag",null);t&&(o.on("click.drag",Nt,Qt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Yn=e=>()=>e;function vr(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:l,dispatch:u}){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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}vr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function kh(e){return!e.ctrlKey&&!e.button}function Th(){return this.parentNode}function Mh(e,t){return t??{x:e.x,y:e.y}}function Ah(){return navigator.maxTouchPoints||"ontouchstart"in this}function Os(){var e=kh,t=Th,n=Mh,o=Ah,r={},i=Vn("start","drag","end"),s=0,a,c,l,u,h=0;function d(w){w.on("mousedown.drag",f).filter(o).on("touchstart.drag",x).on("touchmove.drag",b,Nh).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,k){if(!(u||!e.call(this,w,k))){var N=m(this,t.call(this,w,k),w,k,"mouse");N&&(ve(w.view).on("mousemove.drag",p,Qt).on("mouseup.drag",g,Qt),Is(w.view),br(w),l=!1,a=w.clientX,c=w.clientY,N("start",w))}}function p(w){if(Nt(w),!l){var k=w.clientX-a,N=w.clientY-c;l=k*k+N*N>h}r.mouse("drag",w)}function g(w){ve(w.view).on("mousemove.drag mouseup.drag",null),Ps(w.view,l),Nt(w),r.mouse("end",w)}function x(w,k){if(e.call(this,w,k)){var N=w.changedTouches,I=t.call(this,w,k),M=N.length,L,H;for(L=0;L<M;++L)(H=m(this,I,w,k,N[L].identifier,N[L]))&&(br(w),H("start",w,N[L]))}}function b(w){var k=w.changedTouches,N=k.length,I,M;for(I=0;I<N;++I)(M=r[k[I].identifier])&&(Nt(w),M("drag",w,k[I]))}function v(w){var k=w.changedTouches,N=k.length,I,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),I=0;I<N;++I)(M=r[k[I].identifier])&&(br(w),M("end",w,k[I]))}function m(w,k,N,I,M,L){var H=i.copy(),j=Ne(L||N,k),R,$,y;if((y=n.call(w,new vr("beforestart",{sourceEvent:N,target:d,identifier:M,active:s,x:j[0],y:j[1],dx:0,dy:0,dispatch:H}),I))!=null)return R=y.x-j[0]||0,$=y.y-j[1]||0,function A(T,S,E){var P=j,_;switch(T){case"start":r[M]=A,_=s++;break;case"end":delete r[M],--s;case"drag":j=Ne(E||S,k),_=s;break}H.call(T,w,new vr(T,{sourceEvent:S,subject:y,target:d,identifier:M,active:_,x:j[0]+R,y:j[1]+$,dx:j[0]-P[0],dy:j[1]-P[1],dispatch:H}),I)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yn(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:Yn(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Yn(w),d):n},d.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Yn(!!w),d):o},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(h=(w=+w)*w,d):Math.sqrt(h)},d}function Er(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ds(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Jt(){}var en=.7,Xn=1/en,kt="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",De="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ih=/^#([0-9a-f]{3,8})$/,Ph=new RegExp(`^rgb\\(${kt},${kt},${kt}\\)$`),Oh=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),Dh=new RegExp(`^rgba\\(${kt},${kt},${kt},${tn}\\)$`),Rh=new RegExp(`^rgba\\(${De},${De},${De},${tn}\\)$`),Lh=new RegExp(`^hsl\\(${tn},${De},${De}\\)$`),$h=new RegExp(`^hsla\\(${tn},${De},${De},${tn}\\)$`),Rs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Er(Jt,st,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ls,formatHex:Ls,formatHex8:zh,formatHsl:Hh,formatRgb:$s,toString:$s});function Ls(){return this.rgb().formatHex()}function zh(){return this.rgb().formatHex8()}function Hh(){return Fs(this).formatHsl()}function $s(){return this.rgb().formatRgb()}function st(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ih.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?zs(t):n===3?new ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Un(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Un(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=Ph.exec(e))?new ye(t[1],t[2],t[3],1):(t=Oh.exec(e))?new ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dh.exec(e))?Un(t[1],t[2],t[3],t[4]):(t=Rh.exec(e))?Un(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lh.exec(e))?Vs(t[1],t[2]/100,t[3]/100,1):(t=$h.exec(e))?Vs(t[1],t[2]/100,t[3]/100,t[4]):Rs.hasOwnProperty(e)?zs(Rs[e]):e==="transparent"?new ye(NaN,NaN,NaN,0):null}function zs(e){return new ye(e>>16&255,e>>8&255,e&255,1)}function Un(e,t,n,o){return o<=0&&(e=t=n=NaN),new ye(e,t,n,o)}function jh(e){return e instanceof Jt||(e=st(e)),e?(e=e.rgb(),new ye(e.r,e.g,e.b,e.opacity)):new ye}function _r(e,t,n,o){return arguments.length===1?jh(e):new ye(e,t,n,o??1)}function ye(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Er(ye,_r,Ds(Jt,{brighter(e){return e=e==null?Xn:Math.pow(Xn,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?en:Math.pow(en,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ye(at(this.r),at(this.g),at(this.b),Gn(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:Hs,formatHex:Hs,formatHex8:Vh,formatRgb:js,toString:js}));function Hs(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}`}function Vh(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}${ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function js(){const e=Gn(this.opacity);return`${e===1?"rgb(":"rgba("}${at(this.r)}, ${at(this.g)}, ${at(this.b)}${e===1?")":`, ${e})`}`}function Gn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function at(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ct(e){return e=at(e),(e<16?"0":"")+e.toString(16)}function Vs(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,o)}function Fs(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof Jt||(e=st(e)),!e)return new ke;if(e instanceof ke)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,c=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+r:2-i-r,s*=60):a=c>0&&c<1?0:s,new ke(s,a,c,e.opacity)}function Fh(e,t,n,o){return arguments.length===1?Fs(e):new ke(e,t,n,o??1)}function ke(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Er(ke,Fh,Ds(Jt,{brighter(e){return e=e==null?Xn:Math.pow(Xn,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?en:Math.pow(en,e),new ke(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,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ye(Sr(e>=240?e-240:e+120,r,o),Sr(e,r,o),Sr(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new ke(Bs(this.h),qn(this.s),qn(this.l),Gn(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=Gn(this.opacity);return`${e===1?"hsl(":"hsla("}${Bs(this.h)}, ${qn(this.s)*100}%, ${qn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bs(e){return e=(e||0)%360,e<0?e+360:e}function qn(e){return Math.max(0,Math.min(1,e||0))}function Sr(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 Cr=e=>()=>e;function Bh(e,t){return function(n){return e+n*t}}function Wh(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Yh(e){return(e=+e)==1?Ws:function(t,n){return n-t?Wh(t,n,e):Cr(isNaN(t)?n:t)}}function Ws(e,t){var n=t-e;return n?Bh(e,n):Cr(isNaN(e)?t:e)}const Zn=function e(t){var n=Yh(t);function o(r,i){var s=n((r=_r(r)).r,(i=_r(i)).r),a=n(r.g,i.g),c=n(r.b,i.b),l=Ws(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=c(u),r.opacity=l(u),r+""}}return o.gamma=e,o}(1);function Xh(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Uh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Gh(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=nn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function qh(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Re(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zh(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=nn(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Nr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kr=new RegExp(Nr.source,"g");function Kh(e){return function(){return e}}function Qh(e){return function(t){return e(t)+""}}function Ys(e,t){var n=Nr.lastIndex=kr.lastIndex=0,o,r,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(o=Nr.exec(e))&&(r=kr.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:Re(o,r)})),n=kr.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?Qh(c[0].x):Kh(t):(t=c.length,function(l){for(var u=0,h;u<t;++u)a[(h=c[u]).i]=h.x(l);return a.join("")})}function nn(e,t){var n=typeof t,o;return t==null||n==="boolean"?Cr(t):(n==="number"?Re:n==="string"?(o=st(t))?(t=o,Zn):Ys:t instanceof st?Zn:t instanceof Date?qh:Uh(t)?Xh:Array.isArray(t)?Gh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Zh:Re)(e,t)}var Xs=180/Math.PI,Tr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Us(e,t,n,o,r,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*o)&&(n-=e*c,o-=t*c),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,c/=a),e*o<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Xs,skewX:Math.atan(c)*Xs,scaleX:s,scaleY:a}}var Kn;function Jh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tr:Us(t.a,t.b,t.c,t.d,t.e,t.f)}function ep(e){return e==null||(Kn||(Kn=document.createElementNS("http://www.w3.org/2000/svg","g")),Kn.setAttribute("transform",e),!(e=Kn.transform.baseVal.consolidate()))?Tr:(e=e.matrix,Us(e.a,e.b,e.c,e.d,e.e,e.f))}function Gs(e,t,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,u,h,d,f,p){if(l!==h||u!==d){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Re(l,h)},{i:g-2,x:Re(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function s(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(r(h)+"rotate(",null,o)-2,x:Re(l,u)})):u&&h.push(r(h)+"rotate("+u+o)}function a(l,u,h,d){l!==u?d.push({i:h.push(r(h)+"skewX(",null,o)-2,x:Re(l,u)}):u&&h.push(r(h)+"skewX("+u+o)}function c(l,u,h,d,f,p){if(l!==h||u!==d){var g=f.push(r(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Re(l,h)},{i:g-2,x:Re(u,d)})}else(h!==1||d!==1)&&f.push(r(f)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=e(l),u=e(u),i(l.translateX,l.translateY,u.translateX,u.translateY,h,d),s(l.rotate,u.rotate,h,d),a(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(f){for(var p=-1,g=d.length,x;++p<g;)h[(x=d[p]).i]=x.x(f);return h.join("")}}}var tp=Gs(Jh,"px, ","px)","deg)"),np=Gs(ep,", ",")",")"),op=1e-12;function qs(e){return((e=Math.exp(e))+1/e)/2}function rp(e){return((e=Math.exp(e))-1/e)/2}function ip(e){return((e=Math.exp(2*e))-1)/(e+1)}const Qn=function e(t,n,o){function r(i,s){var a=i[0],c=i[1],l=i[2],u=s[0],h=s[1],d=s[2],f=u-a,p=h-c,g=f*f+p*p,x,b;if(g<op)b=Math.log(d/l)/t,x=function(I){return[a+I*f,c+I*p,l*Math.exp(t*I*b)]};else{var v=Math.sqrt(g),m=(d*d-l*l+o*g)/(2*l*n*v),w=(d*d-l*l-o*g)/(2*d*n*v),k=Math.log(Math.sqrt(m*m+1)-m),N=Math.log(Math.sqrt(w*w+1)-w);b=(N-k)/t,x=function(I){var M=I*b,L=qs(k),H=l/(n*v)*(L*ip(t*M+k)-rp(k));return[a+H*f,c+H*p,l*L/qs(t*M+k)]}}return x.duration=b*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},r}(Math.SQRT2,2,4);var Tt=0,on=0,rn=0,Zs=1e3,Jn,sn,eo=0,lt=0,to=0,an=typeof performance=="object"&&performance.now?performance:Date,Ks=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mr(){return lt||(Ks(sp),lt=an.now()+to)}function sp(){lt=0}function no(){this._call=this._time=this._next=null}no.prototype=Qs.prototype={constructor:no,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Mr():+n)+(t==null?0:+t),!this._next&&sn!==this&&(sn?sn._next=this:Jn=this,sn=this),this._call=e,this._time=n,Ar()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ar())}};function Qs(e,t,n){var o=new no;return o.restart(e,t,n),o}function ap(){Mr(),++Tt;for(var e=Jn,t;e;)(t=lt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function Js(){lt=(eo=an.now())+to,Tt=on=0;try{ap()}finally{Tt=0,lp(),lt=0}}function cp(){var e=an.now(),t=e-eo;t>Zs&&(to-=t,eo=e)}function lp(){for(var e,t=Jn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jn=n);sn=e,Ar(o)}function Ar(e){if(!Tt){on&&(on=clearTimeout(on));var t=e-lt;t>24?(e<1/0&&(on=setTimeout(Js,e-an.now()-to)),rn&&(rn=clearInterval(rn))):(rn||(eo=an.now(),rn=setInterval(cp,Zs)),Tt=1,Ks(Js))}}function ea(e,t,n){var o=new no;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var up=Vn("start","end","cancel","interrupt"),dp=[],ta=0,na=1,Ir=2,oo=3,oa=4,Pr=5,ro=6;function io(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;fp(e,n,{name:t,index:o,group:r,on:up,tween:dp,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ta})}function Or(e,t){var n=Te(e,t);if(n.state>ta)throw new Error("too late; already scheduled");return n}function Le(e,t){var n=Te(e,t);if(n.state>oo)throw new Error("too late; already running");return n}function Te(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function fp(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Qs(i,0,n.time);function i(l){n.state=na,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,h,d,f;if(n.state!==na)return c();for(u in o)if(f=o[u],f.name===n.name){if(f.state===oo)return ea(s);f.state===oa?(f.state=ro,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=ro,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(ea(function(){n.state===oo&&(n.state=oa,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Ir,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ir){for(n.state=oo,r=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Pr,1),h=-1,d=r.length;++h<d;)r[h].call(e,u);n.state===Pr&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ro,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function so(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Ir&&o.state<Pr,o.state=ro,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function hp(e){return this.each(function(){so(this,e)})}function pp(e,t){var n,o;return function(){var r=Le(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function gp(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Le(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=a;break}c===l&&r.push(a)}i.tween=r}}function mp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Te(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?pp:gp)(n,e,t))}function Dr(e,t,n){var o=e._id;return e.each(function(){var r=Le(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Te(r,o).value[t]}}function ra(e,t){var n;return(typeof t=="number"?Re:t instanceof st?Zn:(n=st(t))?(t=n,Zn):Ys)(e,t)}function yp(e){return function(){this.removeAttribute(e)}}function xp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wp(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function bp(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function vp(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function Ep(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function _p(e,t){var n=Bn(e),o=n==="transform"?np:ra;return this.attrTween(e,typeof t=="function"?(n.local?Ep:vp)(n,o,Dr(this,"attr."+e,t)):t==null?(n.local?xp:yp)(n):(n.local?bp:wp)(n,o,t))}function Sp(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Cp(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Np(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Cp(e,i)),n}return r._value=t,r}function kp(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Sp(e,i)),n}return r._value=t,r}function Tp(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Bn(e);return this.tween(n,(o.local?Np:kp)(o,t))}function Mp(e,t){return function(){Or(this,e).delay=+t.apply(this,arguments)}}function Ap(e,t){return t=+t,function(){Or(this,e).delay=t}}function Ip(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Mp:Ap)(t,e)):Te(this.node(),t).delay}function Pp(e,t){return function(){Le(this,e).duration=+t.apply(this,arguments)}}function Op(e,t){return t=+t,function(){Le(this,e).duration=t}}function Dp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pp:Op)(t,e)):Te(this.node(),t).duration}function Rp(e,t){if(typeof t!="function")throw new Error;return function(){Le(this,e).ease=t}}function Lp(e){var t=this._id;return arguments.length?this.each(Rp(t,e)):Te(this.node(),t).ease}function $p(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Le(this,e).ease=n}}function zp(e){if(typeof e!="function")throw new Error;return this.each($p(this._id,e))}function Hp(e){typeof e!="function"&&(e=vs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new Be(o,this._parents,this._name,this._id)}function jp(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var c=t[a],l=n[a],u=c.length,h=s[a]=new Array(u),d,f=0;f<u;++f)(d=c[f]||l[f])&&(h[f]=d);for(;a<o;++a)s[a]=t[a];return new Be(s,this._parents,this._name,this._id)}function Vp(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Fp(e,t,n){var o,r,i=Vp(t)?Or:Le;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function Bp(e,t){var n=this._id;return arguments.length<2?Te(this.node(),n).on.on(e):this.each(Fp(n,e,t))}function Wp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Yp(){return this.on("end.remove",Wp(this._id))}function Xp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xr(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],c=a.length,l=i[s]=new Array(c),u,h,d=0;d<c;++d)(u=a[d])&&(h=e.call(u,u.__data__,d,a))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,io(l[d],t,n,d,l,Te(u,n)));return new Be(i,this._parents,t,n)}function Up(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bs(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var c=o[a],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=e.call(u,u.__data__,h,c),f,p=Te(u,n),g=0,x=d.length;g<x;++g)(f=d[g])&&io(f,t,n,g,d,p);i.push(d),s.push(u)}return new Be(i,s,t,n)}var Gp=Kt.prototype.constructor;function qp(){return new Gp(this._groups,this._parents)}function Zp(e,t){var n,o,r;return function(){var i=Ct(this,e),s=(this.style.removeProperty(e),Ct(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function ia(e){return function(){this.style.removeProperty(e)}}function Kp(e,t,n){var o,r=n+"",i;return function(){var s=Ct(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Qp(e,t,n){var o,r,i;return function(){var s=Ct(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Ct(this,e))),s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a))}}function Jp(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var c=Le(this,e),l=c.on,u=c.value[i]==null?a||(a=ia(t)):void 0;(l!==n||r!==u)&&(o=(n=l).copy()).on(s,r=u),c.on=o}}function eg(e,t,n){var o=(e+="")=="transform"?tp:ra;return t==null?this.styleTween(e,Zp(e,o)).on("end.style."+e,ia(e)):typeof t=="function"?this.styleTween(e,Qp(e,o,Dr(this,"style."+e,t))).each(Jp(this._id,e)):this.styleTween(e,Kp(e,o,t),n).on("end.style."+e,null)}function tg(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function ng(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&tg(e,s,n)),o}return i._value=t,i}function og(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,ng(e,t,n??""))}function rg(e){return function(){this.textContent=e}}function ig(e){return function(){var t=e(this);this.textContent=t??""}}function sg(e){return this.tween("text",typeof e=="function"?ig(Dr(this,"text",e)):rg(e==null?"":e+""))}function ag(e){return function(t){this.textContent=e.call(this,t)}}function cg(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ag(r)),t}return o._value=e,o}function lg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cg(e))}function ug(){for(var e=this._name,t=this._id,n=sa(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=Te(c,t);io(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Be(o,this._parents,e,n)}function dg(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--r===0&&i()}};n.each(function(){var l=Le(this,o),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),r===0&&i()})}var fg=0;function Be(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function sa(){return++fg}var We=Kt.prototype;Be.prototype={constructor:Be,select:Xp,selectAll:Up,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:Hp,merge:jp,selection:qp,transition:ug,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:Bp,attr:_p,attrTween:Tp,style:eg,styleTween:og,text:sg,textTween:lg,remove:Yp,tween:mp,delay:Ip,duration:Dp,ease:Lp,easeVarying:zp,end:dg,[Symbol.iterator]:We[Symbol.iterator]};function hg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var pg={time:null,delay:0,duration:250,ease:hg};function gg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function mg(e){var t,n;e instanceof Be?(t=e._id,e=e._name):(t=sa(),(n=pg).time=Mr(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&io(c,e,t,l,s,n||gg(c,t));return new Be(o,this._parents,e,t)}Kt.prototype.interrupt=hp,Kt.prototype.transition=mg;const ao=e=>()=>e;function yg(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ye(e,t,n){this.k=e,this.x=t,this.y=n}Ye.prototype={constructor:Ye,scale:function(e){return e===1?this:new Ye(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ye(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 co=new Ye(1,0,0);aa.prototype=Ye.prototype;function aa(e){for(;!e.__zoom;)if(!(e=e.parentNode))return co;return e.__zoom}function Rr(e){e.stopImmediatePropagation()}function cn(e){e.preventDefault(),e.stopImmediatePropagation()}function xg(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wg(){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 ca(){return this.__zoom||co}function bg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eg(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function la(){var e=xg,t=wg,n=Eg,o=bg,r=vg,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Qn,l=Vn("start","zoom","end"),u,h,d,f=500,p=150,g=0,x=10;function b(y){y.property("__zoom",ca).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",H).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(y,A,T,S){var E=y.selection?y.selection():y;E.property("__zoom",ca),y!==E?k(y,A,T,S):E.interrupt().each(function(){N(this,arguments).event(S).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},b.scaleBy=function(y,A,T,S){b.scaleTo(y,function(){var E=this.__zoom.k,P=typeof A=="function"?A.apply(this,arguments):A;return E*P},T,S)},b.scaleTo=function(y,A,T,S){b.transform(y,function(){var E=t.apply(this,arguments),P=this.__zoom,_=T==null?w(E):typeof T=="function"?T.apply(this,arguments):T,D=P.invert(_),z=typeof A=="function"?A.apply(this,arguments):A;return n(m(v(P,z),_,D),E,s)},T,S)},b.translateBy=function(y,A,T,S){b.transform(y,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,S)},b.translateTo=function(y,A,T,S,E){b.transform(y,function(){var P=t.apply(this,arguments),_=this.__zoom,D=S==null?w(P):typeof S=="function"?S.apply(this,arguments):S;return n(co.translate(D[0],D[1]).scale(_.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof T=="function"?-T.apply(this,arguments):-T),P,s)},S,E)};function v(y,A){return A=Math.max(i[0],Math.min(i[1],A)),A===y.k?y:new Ye(A,y.x,y.y)}function m(y,A,T){var S=A[0]-T[0]*y.k,E=A[1]-T[1]*y.k;return S===y.x&&E===y.y?y:new Ye(y.k,S,E)}function w(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function k(y,A,T,S){y.on("start.zoom",function(){N(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(S).end()}).tween("zoom",function(){var E=this,P=arguments,_=N(E,P).event(S),D=t.apply(E,P),z=T==null?w(D):typeof T=="function"?T.apply(E,P):T,F=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),B=E.__zoom,Y=typeof A=="function"?A.apply(E,P):A,K=c(B.invert(z).concat(F/B.k),Y.invert(z).concat(F/Y.k));return function(W){if(W===1)W=Y;else{var V=K(W),X=F/V[2];W=new Ye(X,z[0]-V[0]*X,z[1]-V[1]*X)}_.zoom(null,W)}})}function N(y,A,T){return!T&&y.__zooming||new I(y,A)}function I(y,A){this.that=y,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,A),this.taps=0}I.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,A){return this.mouse&&y!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var A=ve(this.that).datum();l.call(y,this.that,new yg(y,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:l}),A)}};function M(y,...A){if(!e.apply(this,arguments))return;var T=N(this,A).event(y),S=this.__zoom,E=Math.max(i[0],Math.min(i[1],S.k*Math.pow(2,o.apply(this,arguments)))),P=Ne(y);if(T.wheel)(T.mouse[0][0]!==P[0]||T.mouse[0][1]!==P[1])&&(T.mouse[1]=S.invert(T.mouse[0]=P)),clearTimeout(T.wheel);else{if(S.k===E)return;T.mouse=[P,S.invert(P)],so(this),T.start()}cn(y),T.wheel=setTimeout(_,p),T.zoom("mouse",n(m(v(S,E),T.mouse[0],T.mouse[1]),T.extent,s));function _(){T.wheel=null,T.end()}}function L(y,...A){if(d||!e.apply(this,arguments))return;var T=y.currentTarget,S=N(this,A,!0).event(y),E=ve(y.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",F,!0),P=Ne(y,T),_=y.clientX,D=y.clientY;Is(y.view),Rr(y),S.mouse=[P,this.__zoom.invert(P)],so(this),S.start();function z(B){if(cn(B),!S.moved){var Y=B.clientX-_,K=B.clientY-D;S.moved=Y*Y+K*K>g}S.event(B).zoom("mouse",n(m(S.that.__zoom,S.mouse[0]=Ne(B,T),S.mouse[1]),S.extent,s))}function F(B){E.on("mousemove.zoom mouseup.zoom",null),Ps(B.view,S.moved),cn(B),S.event(B).end()}}function H(y,...A){if(e.apply(this,arguments)){var T=this.__zoom,S=Ne(y.changedTouches?y.changedTouches[0]:y,this),E=T.invert(S),P=T.k*(y.shiftKey?.5:2),_=n(m(v(T,P),S,E),t.apply(this,A),s);cn(y),a>0?ve(this).transition().duration(a).call(k,_,S,y):ve(this).call(b.transform,_,S,y)}}function j(y,...A){if(e.apply(this,arguments)){var T=y.touches,S=T.length,E=N(this,A,y.changedTouches.length===S).event(y),P,_,D,z;for(Rr(y),_=0;_<S;++_)D=T[_],z=Ne(D,this),z=[z,this.__zoom.invert(z),D.identifier],E.touch0?!E.touch1&&E.touch0[2]!==z[2]&&(E.touch1=z,E.taps=0):(E.touch0=z,P=!0,E.taps=1+!!u);u&&(u=clearTimeout(u)),P&&(E.taps<2&&(h=z[0],u=setTimeout(function(){u=null},f)),so(this),E.start())}}function R(y,...A){if(this.__zooming){var T=N(this,A).event(y),S=y.changedTouches,E=S.length,P,_,D,z;for(cn(y),P=0;P<E;++P)_=S[P],D=Ne(_,this),T.touch0&&T.touch0[2]===_.identifier?T.touch0[0]=D:T.touch1&&T.touch1[2]===_.identifier&&(T.touch1[0]=D);if(_=T.that.__zoom,T.touch1){var F=T.touch0[0],B=T.touch0[1],Y=T.touch1[0],K=T.touch1[1],W=(W=Y[0]-F[0])*W+(W=Y[1]-F[1])*W,V=(V=K[0]-B[0])*V+(V=K[1]-B[1])*V;_=v(_,Math.sqrt(W/V)),D=[(F[0]+Y[0])/2,(F[1]+Y[1])/2],z=[(B[0]+K[0])/2,(B[1]+K[1])/2]}else if(T.touch0)D=T.touch0[0],z=T.touch0[1];else return;T.zoom("touch",n(m(_,D,z),T.extent,s))}}function $(y,...A){if(this.__zooming){var T=N(this,A).event(y),S=y.changedTouches,E=S.length,P,_;for(Rr(y),d&&clearTimeout(d),d=setTimeout(function(){d=null},f),P=0;P<E;++P)_=S[P],T.touch0&&T.touch0[2]===_.identifier?delete T.touch0:T.touch1&&T.touch1[2]===_.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(_=Ne(_,this),Math.hypot(h[0]-_[0],h[1]-_[1])<x)){var D=ve(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return b.wheelDelta=function(y){return arguments.length?(o=typeof y=="function"?y:ao(+y),b):o},b.filter=function(y){return arguments.length?(e=typeof y=="function"?y:ao(!!y),b):e},b.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:ao(!!y),b):r},b.extent=function(y){return arguments.length?(t=typeof y=="function"?y:ao([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),b):t},b.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],b):[i[0],i[1]]},b.translateExtent=function(y){return arguments.length?(s[0][0]=+y[0][0],s[1][0]=+y[1][0],s[0][1]=+y[0][1],s[1][1]=+y[1][1],b):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},b.constrain=function(y){return arguments.length?(n=y,b):n},b.duration=function(y){return arguments.length?(a=+y,b):a},b.interpolate=function(y){return arguments.length?(c=y,b):c},b.on=function(){var y=l.on.apply(l,arguments);return y===l?b:y},b.clickDistance=function(y){return arguments.length?(g=(y=+y)*y,b):Math.sqrt(g)},b.tapDistance=function(y){return arguments.length?(x=+y,b):x},b}const xe={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ln=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ua=["Enter"," ","Escape"],da={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Mt;(function(e){e.Strict="strict",e.Loose="loose"})(Mt||(Mt={}));var ut;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ut||(ut={}));var At;(function(e){e.Partial="partial",e.Full="full"})(At||(At={}));const fa={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ze;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ze||(Ze={}));var lo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lo||(lo={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const ha={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function _g(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function pa(e,t,n){if(!n)return;const o=[];e.forEach((r,i)=>{t?.has(i)||o.push(r)}),o.length&&n(o)}function ga(e){return e===null?null:e?"valid":"invalid"}const ma=e=>"id"in e&&"source"in e&&"target"in e,Sg=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Lr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Cg=(e,t,n)=>{if(!e.id)return[];const o=new Set;return n.forEach(r=>{r.source===e.id&&o.add(r.target)}),t.filter(r=>o.has(r.id))},un=(e,t=[0,0])=>{const{width:n,height:o}=Xe(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Ng=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Lr(r)?r:t.nodeLookup.get(r.id));const a=s?ho(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return uo(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fo(n)},dn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(o=>{if(t.filter===void 0||t.filter(o)){const r=ho(o);n=uo(n,r)}}),fo(n)},$r=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...pn(t,[n,o,r]),width:t.width/r,height:t.height/r},c=[];for(const l of e.values()){const{measured:u,selectable:h=!0,hidden:d=!1}=l;if(s&&!h||d)continue;const f=u.width??l.width??l.initialWidth??null,p=u.height??l.height??l.initialHeight??null,g=fn(a,Pt(l)),x=(f??0)*(p??0),b=i&&g>0;(!l.internals.handleBounds||b||g>=x||l.dragging)&&c.push(l)}return c},zr=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function kg(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Tg({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=kg(e,s),c=dn(a),l=jr(c,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(l,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function ya({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let h=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",xe.error005());else{const f=a.measured.width,p=a.measured.height;f&&p&&(h=[[c,l],[c+f,l+p]])}else a&&Dt(s.extent)&&(h=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const d=Dt(h)?dt(t,h,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",xe.error015()),{position:{x:d.x-c+(s.measured.width??0)*u[0],y:d.y-l+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function Mg({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const f=i.has(d.id),p=!f&&d.parentId&&s.find(g=>g.id===d.parentId);(f||p)&&s.push(d)}const a=new Set(t.map(d=>d.id)),c=o.filter(d=>d.deletable!==!1),u=zr(s,c);for(const d of c)a.has(d.id)&&!u.find(p=>p.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const h=await r({nodes:s,edges:u});return typeof h=="boolean"?h?{edges:u,nodes:s}:{edges:[],nodes:[]}:h}const It=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dt=(e={x:0,y:0},t,n)=>({x:It(e.x,t[0][0],t[1][0]-(n?.width??0)),y:It(e.y,t[0][1],t[1][1]-(n?.height??0))});function xa(e,t,n){const{width:o,height:r}=Xe(n),{x:i,y:s}=n.internals.positionAbsolute;return dt(e,[[i,s],[i+o,s+r]],t)}const wa=(e,t,n)=>e<t?It(Math.abs(e-t),1,t)/t:e>n?-It(Math.abs(e-n),1,t)/t:0,ba=(e,t,n=15,o=40)=>{const r=wa(e.x,o,t.width-o)*n,i=wa(e.y,o,t.height-o)*n;return[r,i]},uo=(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)}),Hr=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),fo=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),Pt=(e,t=[0,0])=>{const{x:n,y:o}=Lr(e)?e.internals.positionAbsolute:un(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},ho=(e,t=[0,0])=>{const{x:n,y:o}=Lr(e)?e.internals.positionAbsolute:un(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},va=(e,t)=>fo(uo(Hr(e),Hr(t))),fn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Ea=e=>Me(e.width)&&Me(e.height)&&Me(e.x)&&Me(e.y),Me=e=>!isNaN(e)&&isFinite(e),_a=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},hn=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),pn=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?hn(a,s):a},po=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Ot(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ag(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Ot(e,n),r=Ot(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Ot(e.top??e.y??0,n),r=Ot(e.bottom??e.y??0,n),i=Ot(e.left??e.x??0,t),s=Ot(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ig(e,t,n,o,r,i){const{x:s,y:a}=po(e,[t,n,o]),{x:c,y:l}=po({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-c,h=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(h)}}const jr=(e,t,n,o,r,i)=>{const s=Ag(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),u=It(l,o,r),h=e.x+e.width/2,d=e.y+e.height/2,f=t/2-h*u,p=n/2-d*u,g=Ig(e,f,p,u,t,n),x={left:Math.min(g.left-s.left,0),top:Math.min(g.top-s.top,0),right:Math.min(g.right-s.right,0),bottom:Math.min(g.bottom-s.bottom,0)};return{x:f-x.left+x.right,y:p-x.top+x.bottom,zoom:u}},gn=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Dt(e){return e!=null&&e!=="parent"}function Xe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Sa(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ca(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Na(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Pg(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Og(e){return{...da,...e||{}}}function mn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=$e(e),a=pn({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:c,y:l}=n?hn(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const Vr=e=>({width:e.offsetWidth,height:e.offsetHeight}),ka=e=>e?.getRootNode?.()||window?.document,Dg=["INPUT","SELECT","TEXTAREA"];function Ta(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Dg.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ma=e=>"clientX"in e,$e=(e,t)=>{const n=Ma(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Aa=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Vr(s)}})};function Ia({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+r*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+o*.125,u=Math.abs(c-e),h=Math.abs(l-t);return[c,l,u,h]}function go(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Pa({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Q.Left:return[t-go(t-o,i),n];case Q.Right:return[t+go(o-t,i),n];case Q.Top:return[t,n-go(n-r,i)];case Q.Bottom:return[t,n+go(r-n,i)]}}function mo({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top,curvature:s=.25}){const[a,c]=Pa({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[l,u]=Pa({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[h,d,f,p]=Ia({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${o},${r}`,h,d,f,p]}function Oa({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function Rg({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:r=!1}){if(o!==void 0)return o;const i=r&&n?1e3:0,s=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+s}function Lg({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=uo(ho(e),ho(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return fn(s,fo(i))>0}const $g=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,zg=(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)),yo=(e,t)=>{if(!e.source||!e.target)return _a("006",xe.error006()),t;let n;return ma(e)?n={...e}:n={...e,id:$g(e)},zg(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Da({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Oa({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Ra={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Hg=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},La=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jg({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:o=Q.Top,center:r,offset:i,stepPosition:s}){const a=Ra[t],c=Ra[o],l={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},h=Hg({source:l,sourcePosition:t,target:u}),d=h.x!==0?"x":"y",f=h[d];let p=[],g,x;const b={x:0,y:0},v={x:0,y:0},[,,m,w]=Oa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*c[d]===-1){d==="x"?(g=r.x??l.x+(u.x-l.x)*s,x=r.y??(l.y+u.y)/2):(g=r.x??(l.x+u.x)/2,x=r.y??l.y+(u.y-l.y)*s);const N=[{x:g,y:l.y},{x:g,y:u.y}],I=[{x:l.x,y:x},{x:u.x,y:x}];a[d]===f?p=d==="x"?N:I:p=d==="x"?I:N}else{const N=[{x:l.x,y:u.y}],I=[{x:u.x,y:l.y}];if(d==="x"?p=a.x===f?I:N:p=a.y===f?N:I,t===o){const R=Math.abs(e[d]-n[d]);if(R<=i){const $=Math.min(i-1,i-R);a[d]===f?b[d]=(l[d]>e[d]?-1:1)*$:v[d]=(u[d]>n[d]?-1:1)*$}}if(t!==o){const R=d==="x"?"y":"x",$=a[d]===c[R],y=l[R]>u[R],A=l[R]<u[R];(a[d]===1&&(!$&&y||$&&A)||a[d]!==1&&(!$&&A||$&&y))&&(p=d==="x"?N:I)}const M={x:l.x+b.x,y:l.y+b.y},L={x:u.x+v.x,y:u.y+v.y},H=Math.max(Math.abs(M.x-p[0].x),Math.abs(L.x-p[0].x)),j=Math.max(Math.abs(M.y-p[0].y),Math.abs(L.y-p[0].y));H>=j?(g=(M.x+L.x)/2,x=p[0].y):(g=p[0].x,x=(M.y+L.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...p,{x:u.x+v.x,y:u.y+v.y},n],g,x,m,w]}function Vg(e,t,n,o){const r=Math.min(La(e,t)/2,La(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+r*c}Q ${i},${s} ${i+r*a},${s}`}function Fr({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:u=.5}){const[h,d,f,p,g]=jg({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:u});return[h.reduce((b,v,m)=>{let w="";return m>0&&m<h.length-1?w=Vg(h[m-1],v,h[m+1],s):w=`${m===0?"M":"L"}${v.x} ${v.y}`,b+=w,b},""),d,f,p,g]}function $a(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Fg(e){const{sourceNode:t,targetNode:n}=e;if(!$a(t)||!$a(n))return null;const o=t.internals.handleBounds||za(t.handles),r=n.internals.handleBounds||za(n.handles),i=Ha(o?.source??[],e.sourceHandle),s=Ha(e.connectionMode===Mt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",xe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=s?.position||Q.Top,l=yn(t,i,a),u=yn(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:c}}function za(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function yn(e,t,n=Q.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Xe(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+s/2,y:i};case Q.Right:return{x:r+s,y:i+a/2};case Q.Bottom:return{x:r+s/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function Ha(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Br(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Bg(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const l=Br(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Wr={nodeOrigin:[0,0],nodeExtent:ln,elevateNodesOnSelect:!0,defaults:{}},Wg={...Wr,checkEquality:!0};function Yr(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Yg(e,t,n){const o=Yr(Wr,n);for(const r of e.values())if(r.parentId)Ur(r,e,t,o);else{const i=un(r,o.nodeOrigin),s=Dt(r.extent)?r.extent:o.nodeExtent,a=dt(i,s,Xe(r));r.internals.positionAbsolute=a}}function Xr(e,t,n,o){const r=Yr(Wg,o);let i=e.length>0;const s=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let l=s.get(c.id);if(r.checkEquality&&c===l?.internals.userNode)t.set(c.id,l);else{const u=un(c,r.nodeOrigin),h=Dt(c.extent)?c.extent:r.nodeExtent,d=dt(u,h,Xe(c));l={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:d,handleBounds:c.measured?l?.internals.handleBounds:void 0,z:ja(c,a),userNode:c}},t.set(c.id,l)}(l.measured===void 0||l.measured.width===void 0||l.measured.height===void 0)&&!l.hidden&&(i=!1),c.parentId&&Ur(l,t,n,o)}return i}function Xg(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ur(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:s}=Yr(Wr,o),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Xg(e,n);const l=r?1e3:0,{x:u,y:h,z:d}=Ug(e,c,i,s,l),{positionAbsolute:f}=e.internals,p=u!==f.x||h!==f.y;(p||d!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:u,y:h}:f,z:d}})}function ja(e,t){return(Me(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ug(e,t,n,o,r){const{x:i,y:s}=t.internals.positionAbsolute,a=Xe(e),c=un(e,n),l=Dt(e.extent)?dt(c,e.extent,a):c;let u=dt({x:i+l.x,y:s+l.y},o,a);e.extent==="parent"&&(u=xa(u,a,t));const h=ja(e,r),d=t.internals.z??0;return{x:u.x,y:u.y,z:d>=h?d+1:h}}function Gr(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const c=i.get(s.parentId)?.expandedRect??Pt(a),l=va(c,s.rect);i.set(s.parentId,{expandedRect:l,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},c)=>{const l=a.internals.positionAbsolute,u=Xe(a),h=a.origin??o,d=s.x<l.x?Math.round(Math.abs(l.x-s.x)):0,f=s.y<l.y?Math.round(Math.abs(l.y-s.y)):0,p=Math.max(u.width,Math.round(s.width)),g=Math.max(u.height,Math.round(s.height)),x=(p-u.width)*h[0],b=(g-u.height)*h[1];(d>0||f>0||x||b)&&(r.push({id:c,type:"position",position:{x:a.position.x-d+x,y:a.position.y-f+b}}),n.get(c)?.forEach(v=>{e.some(m=>m.id===v.id)||r.push({id:v.id,type:"position",position:{x:v.position.x+d,y:v.position.y+f}})})),(u.width<s.width||u.height<s.height||d||f)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:p+(d?h[0]*d-x:0),height:g+(f?h[1]*f-b:0)}})}),r}function Gg(e,t,n,o,r,i){const s=o?.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const c=[],l=window.getComputedStyle(s),{m22:u}=new window.DOMMatrixReadOnly(l.transform),h=[];for(const d of e.values()){const f=t.get(d.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),a=!0;continue}const p=Vr(d.nodeElement),g=f.measured.width!==p.width||f.measured.height!==p.height;if(!!(p.width&&p.height&&(g||!f.internals.handleBounds||d.force))){const b=d.nodeElement.getBoundingClientRect(),v=Dt(f.extent)?f.extent:i;let{positionAbsolute:m}=f.internals;f.parentId&&f.extent==="parent"?m=xa(m,p,t.get(f.parentId)):v&&(m=dt(m,v,p));const w={...f,measured:p,internals:{...f.internals,positionAbsolute:m,handleBounds:{source:Aa("source",d.nodeElement,b,u,f.id),target:Aa("target",d.nodeElement,b,u,f.id)}}};t.set(f.id,w),f.parentId&&Ur(w,t,n,{nodeOrigin:r}),a=!0,g&&(c.push({id:f.id,type:"dimensions",dimensions:p}),f.expandParent&&f.parentId&&h.push({id:f.id,parentId:f.parentId,rect:Pt(w,r)}))}}if(h.length>0){const d=Gr(h,t,n,r);c.push(...d)}return{changes:c,updatedInternals:a}}async function qg({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Va(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,t)),i){s=`${r}-${e}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,t))}}function Fa(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Va("source",c,u,e,r,s),Va("target",c,l,e,i,a),t.set(o.id,o)}}function Zg(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(n[r].id!==o[r].id||n[r].type!==o[r].type||!Object.is(n[r].data,o[r].data))return!1;return!0}function Ba(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ba(n,t):!1}function Wa(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function Kg(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Ba(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function qr({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const c=n.get(s)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Qg({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=hn(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Jg({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},u=null,h=!1,d=null,f=!1,p=!1,g=null;function x({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:k,nodeId:N,nodeClickDistance:I=0}){d=ve(w);function M({x:R,y:$}){const{nodeLookup:y,nodeExtent:A,snapGrid:T,snapToGrid:S,nodeOrigin:E,onNodeDrag:P,onSelectionDrag:_,onError:D,updateNodePositions:z}=t();i={x:R,y:$};let F=!1;const B=a.size>1,Y=B&&A?Hr(dn(a)):null,K=B&&S?Qg({dragItems:a,snapGrid:T,x:R,y:$}):null;for(const[W,V]of a){if(!y.has(W))continue;let X={x:R-V.distance.x,y:$-V.distance.y};S&&(X=K?{x:Math.round(X.x+K.x),y:Math.round(X.y+K.y)}:hn(X,T));let J=null;if(B&&A&&!V.extent&&Y){const{positionAbsolute:oe}=V.internals,ne=oe.x-Y.x+A[0][0],ue=oe.x+V.measured.width-Y.x2+A[1][0],ge=oe.y-Y.y+A[0][1],Pe=oe.y+V.measured.height-Y.y2+A[1][1];J=[[ne,ge],[ue,Pe]]}const{position:te,positionAbsolute:Z}=ya({nodeId:W,nextPosition:X,nodeLookup:y,nodeExtent:J||A,nodeOrigin:E,onError:D});F=F||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=Z}if(p=p||F,!!F&&(z(a,!0),g&&(o||P||!N&&_))){const[W,V]=qr({nodeId:N,dragItems:a,nodeLookup:y});o?.(g,a,W,V),P?.(g,W,V),N||_?.(g,V)}}async function L(){if(!u)return;const{transform:R,panBy:$,autoPanSpeed:y,autoPanOnNodeDrag:A}=t();if(!A){c=!1,cancelAnimationFrame(s);return}const[T,S]=ba(l,u,y);(T!==0||S!==0)&&(i.x=(i.x??0)-T/R[2],i.y=(i.y??0)-S/R[2],await $({x:T,y:S})&&M(i)),s=requestAnimationFrame(L)}function H(R){const{nodeLookup:$,multiSelectionActive:y,nodesDraggable:A,transform:T,snapGrid:S,snapToGrid:E,selectNodesOnDrag:P,onNodeDragStart:_,onSelectionDragStart:D,unselectNodesAndEdges:z}=t();h=!0,(!P||!k)&&!y&&N&&($.get(N)?.selected||z()),k&&P&&N&&e?.(N);const F=mn(R.sourceEvent,{transform:T,snapGrid:S,snapToGrid:E,containerBounds:u});if(i=F,a=Kg($,A,F,N),a.size>0&&(n||_||!N&&D)){const[B,Y]=qr({nodeId:N,dragItems:a,nodeLookup:$});n?.(R.sourceEvent,a,B,Y),_?.(R.sourceEvent,B,Y),N||D?.(R.sourceEvent,Y)}}const j=Os().clickDistance(I).on("start",R=>{const{domNode:$,nodeDragThreshold:y,transform:A,snapGrid:T,snapToGrid:S}=t();u=$?.getBoundingClientRect()||null,f=!1,p=!1,g=R.sourceEvent,y===0&&H(R),i=mn(R.sourceEvent,{transform:A,snapGrid:T,snapToGrid:S,containerBounds:u}),l=$e(R.sourceEvent,u)}).on("drag",R=>{const{autoPanOnNodeDrag:$,transform:y,snapGrid:A,snapToGrid:T,nodeDragThreshold:S,nodeLookup:E}=t(),P=mn(R.sourceEvent,{transform:y,snapGrid:A,snapToGrid:T,containerBounds:u});if(g=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||N&&!E.has(N))&&(f=!0),!f){if(!c&&$&&h&&(c=!0,L()),!h){const _=P.xSnapped-(i.x??0),D=P.ySnapped-(i.y??0);Math.sqrt(_*_+D*D)>S&&H(R)}(i.x!==P.xSnapped||i.y!==P.ySnapped)&&a&&h&&(l=$e(R.sourceEvent,u),M(P))}}).on("end",R=>{if(!(!h||f)&&(c=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:$,updateNodePositions:y,onNodeDragStop:A,onSelectionDragStop:T}=t();if(p&&(y(a,!1),p=!1),r||A||!N&&T){const[S,E]=qr({nodeId:N,dragItems:a,nodeLookup:$,dragging:!1});r?.(R.sourceEvent,a,S,E),A?.(R.sourceEvent,S,E),N||T?.(R.sourceEvent,E)}}}).filter(R=>{const $=R.target;return!R.button&&(!v||!Wa($,`.${v}`,w))&&(!m||Wa($,m,w))});d.call(j)}function b(){d?.on(".drag",null)}return{update:x,destroy:b}}function em(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())fn(r,Pt(i))>0&&o.push(i);return o}const tm=250;function nm(e,t,n,o){let r=[],i=1/0;const s=em(e,n,t+tm);for(const a of s){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const l of c){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:u,y:h}=yn(a,l,l.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(h-e.y,2));d>t||(d<i?(r=[{...l,x:u,y:h}],i=d):d===i&&r.push({...l,x:u,y:h}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Ya(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],c=(n?a?.find(l=>l.id===n):a?.[0])??null;return c&&i?{...c,...yn(s,c,c.position,!0)}:c}function Xa(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function om(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ua=()=>!0;function rm(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:h,panBy:d,cancelConnection:f,onConnectStart:p,onConnect:g,onConnectEnd:x,isValidConnection:b=Ua,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:k,autoPanSpeed:N,dragThreshold:I=1,handleDomNode:M}){const L=ka(e.target);let H=0,j;const{x:R,y:$}=$e(e),y=Xa(i,M),A=a?.getBoundingClientRect();let T=!1;if(!A||!y)return;const S=Ya(r,y,o,c,t);if(!S)return;let E=$e(e,A),P=!1,_=null,D=!1,z=null;function F(){if(!u||!A)return;const[te,Z]=ba(E,A,N);d({x:te,y:Z}),H=requestAnimationFrame(F)}const B={...S,nodeId:r,type:y,position:S.position},Y=c.get(r);let W={inProgress:!0,isValid:null,from:yn(Y,B,Q.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:Y,to:E,toHandle:null,toPosition:ha[B.position],toNode:null};function V(){T=!0,m(W),p?.(e,{nodeId:r,handleId:o,handleType:y})}I===0&&V();function X(te){if(!T){const{x:ue,y:ge}=$e(te),Pe=ue-R,Bt=ge-$;if(!(Pe*Pe+Bt*Bt>I*I))return;V()}if(!k()||!B){J(te);return}const Z=w();E=$e(te,A),j=nm(pn(E,Z,!1,[1,1]),n,c,B),P||(F(),P=!0);const oe=Ga(te,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:b,doc:L,lib:l,flowId:h,nodeLookup:c});z=oe.handleDomNode,_=oe.connection,D=om(!!j,oe.isValid);const ne={...W,isValid:D,to:oe.toHandle&&D?po({x:oe.toHandle.x,y:oe.toHandle.y},Z):E,toHandle:oe.toHandle,toPosition:D&&oe.toHandle?oe.toHandle.position:ha[B.position],toNode:oe.toHandle?c.get(oe.toHandle.nodeId):null};D&&j&&W.toHandle&&ne.toHandle&&W.toHandle.type===ne.toHandle.type&&W.toHandle.nodeId===ne.toHandle.nodeId&&W.toHandle.id===ne.toHandle.id&&W.to.x===ne.to.x&&W.to.y===ne.to.y||(m(ne),W=ne)}function J(te){if(T){(j||z)&&_&&D&&g?.(_);const{inProgress:Z,...oe}=W,ne={...oe,toPosition:W.toHandle?W.toPosition:null};x?.(te,ne),i&&v?.(te,ne)}f(),cancelAnimationFrame(H),P=!1,D=!1,_=null,z=null,L.removeEventListener("mousemove",X),L.removeEventListener("mouseup",J),L.removeEventListener("touchmove",X),L.removeEventListener("touchend",J)}L.addEventListener("mousemove",X),L.addEventListener("mouseup",J),L.addEventListener("touchmove",X),L.addEventListener("touchend",J)}function Ga(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=Ua,nodeLookup:u}){const h=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:f,y:p}=$e(e),g=s.elementFromPoint(f,p),x=g?.classList.contains(`${a}-flow__handle`)?g:d,b={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const v=Xa(void 0,x),m=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!m||!v)return b;const I={source:h?m:o,sourceHandle:h?w:r,target:h?o:m,targetHandle:h?r:w};b.connection=I;const L=k&&N&&(n===Mt.Strict?h&&v==="source"||!h&&v==="target":m!==o||w!==r);b.isValid=L&&l(I),b.toHandle=Ya(m,v,w,u,n,!0)}return b}const Zr={onPointerDown:rm,isValid:Ga};function im({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ve(e);function i({translateExtent:a,width:c,height:l,zoomStep:u=1,pannable:h=!0,zoomable:d=!0,inversePan:f=!1}){const p=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=m.sourceEvent.ctrlKey&&gn()?10:1,N=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*u,I=w[2]*Math.pow(2,N*k);t.scaleTo(I)};let g=[0,0];const x=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(g=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},b=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const k=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const I=o()*Math.max(w[2],Math.log(w[2]))*(f?-1:1),M={x:w[0]-N[0]*I,y:w[1]-N[1]*I},L=[[0,0],[c,l]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},L,a)},v=la().on("start",x).on("zoom",h?b:null).on("zoom.wheel",d?p:null);r.call(v,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:Ne}}const sm=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,xo=e=>({x:e.x,y:e.y,zoom:e.k}),Kr=({x:e,y:t,zoom:n})=>co.translate(e,t).scale(n),Rt=(e,t)=>e.target.closest(`.${t}`),qa=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),am=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qr=(e,t=0,n=am,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Za=e=>{const t=e.ctrlKey&&gn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function cm({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Rt(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=Ne(u),b=Za(u),v=h*Math.pow(2,b);o.scaleTo(n,v,x,u);return}const d=u.deltaMode===1?20:1;let f=r===ut.Vertical?0:u.deltaX*d,p=r===ut.Horizontal?0:u.deltaY*d;!gn()&&u.shiftKey&&r!==ut.Vertical&&(f=u.deltaY*d,p=0),o.translateBy(n,-(f/h)*i,-(p/h)*i,{internal:!0});const g=xo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(u,g)),e.isPanScrolling&&(c?.(u,g),e.panScrollTimeout=setTimeout(()=>{l?.(u,g),e.isPanScrolling=!1},150))}}function lm({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Rt(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function um({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=xo(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function dm({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&qa(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,xo(i.transform))}}function fm({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&qa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&sm(e.prevViewport,s.transform))){const a=xo(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function hm({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:l}){return u=>{const h=e||t,d=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Rt(u,`${l}-flow__node`)||Rt(u,`${l}-flow__edge`)))return!0;if(!o&&!h&&!r&&!i&&!n||s||Rt(u,a)&&u.type==="wheel"||Rt(u,c)&&(u.type!=="wheel"||r&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&u.touches?.length>1)return u.preventDefault(),!1;if(!h&&!r&&!d&&u.type==="wheel"||!o&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(o)&&!o.includes(u.button)&&u.type==="mousedown")return!1;const f=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&f}}function pm({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=la().clickDistance(!Me(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),f=ve(e).call(d);m({x:i.x,y:i.y,zoom:It(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");d.wheelDelta(Za);function x(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).transform(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function b({noWheelClassName:R,noPanClassName:$,onPaneContextMenu:y,userSelectionActive:A,panOnScroll:T,panOnDrag:S,panOnScrollMode:E,panOnScrollSpeed:P,preventScrolling:_,zoomOnPinch:D,zoomOnScroll:z,zoomOnDoubleClick:F,zoomActivationKeyPressed:B,lib:Y,onTransformChange:K}){A&&!u.isZoomingOrPanning&&v();const V=T&&!B&&!A?cm({zoomPanValues:u,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:E,panOnScrollSpeed:P,zoomOnPinch:D,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):lm({noWheelClassName:R,preventScrolling:_,d3ZoomHandler:p});if(f.on("wheel.zoom",V,{passive:!1}),!A){const J=um({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",J);const te=dm({zoomPanValues:u,panOnDrag:S,onPaneContextMenu:!!y,onPanZoom:s,onTransformChange:K});d.on("zoom",te);const Z=fm({zoomPanValues:u,panOnDrag:S,panOnScroll:T,onPaneContextMenu:y,onPanZoomEnd:c,onDraggingChange:l});d.on("end",Z)}const X=hm({zoomActivationKeyPressed:B,panOnDrag:S,zoomOnScroll:z,panOnScroll:T,zoomOnDoubleClick:F,zoomOnPinch:D,userSelectionActive:A,noPanClassName:$,noWheelClassName:R,lib:Y});d.filter(X),F?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function v(){d.on("zoom",null)}async function m(R,$,y){const A=Kr(R),T=d?.constrain()(A,$,y);return T&&await x(T),new Promise(S=>S(T))}async function w(R,$){const y=Kr(R);return await x(y,$),new Promise(A=>A(y))}function k(R){if(f){const $=Kr(R),y=f.property("__zoom");(y.k!==R.zoom||y.x!==R.x||y.y!==R.y)&&d?.transform(f,$,null,{sync:!0})}}function N(){const R=f?aa(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function I(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).scaleTo(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function M(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).scaleBy(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function L(R){d?.scaleExtent(R)}function H(R){d?.translateExtent(R)}function j(R){const $=!Me(R)||R<0?0:R;d?.clickDistance($)}return{update:b,destroy:v,setViewport:w,setViewportConstrained:m,getViewport:N,scaleTo:I,scaleBy:M,setScaleExtent:L,setTranslateExtent:H,syncViewport:k,setClickDistance:j}}var ft;(function(e){e.Line="line",e.Handle="handle"})(ft||(ft={}));function gm({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function mm(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ke(e,t){return Math.max(0,t-e)}function Qe(e,t){return Math.max(0,e-t)}function wo(e,t,n){return Math.max(0,t-e,e-n)}function Ka(e,t){return e?!t:t}function ym(e,t,n,o,r,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:u,isVertical:h}=t,d=u&&h,{xSnapped:f,ySnapped:p}=n,{minWidth:g,maxWidth:x,minHeight:b,maxHeight:v}=o,{x:m,y:w,width:k,height:N,aspectRatio:I}=e;let M=Math.floor(u?f-e.pointerX:0),L=Math.floor(h?p-e.pointerY:0);const H=k+(c?-M:M),j=N+(l?-L:L),R=-i[0]*k,$=-i[1]*N;let y=wo(H,g,x),A=wo(j,b,v);if(s){let E=0,P=0;c&&M<0?E=Ke(m+M+R,s[0][0]):!c&&M>0&&(E=Qe(m+H+R,s[1][0])),l&&L<0?P=Ke(w+L+$,s[0][1]):!l&&L>0&&(P=Qe(w+j+$,s[1][1])),y=Math.max(y,E),A=Math.max(A,P)}if(a){let E=0,P=0;c&&M>0?E=Qe(m+M,a[0][0]):!c&&M<0&&(E=Ke(m+H,a[1][0])),l&&L>0?P=Qe(w+L,a[0][1]):!l&&L<0&&(P=Ke(w+j,a[1][1])),y=Math.max(y,E),A=Math.max(A,P)}if(r){if(u){const E=wo(H/I,b,v)*I;if(y=Math.max(y,E),s){let P=0;!c&&!l||c&&!l&&d?P=Qe(w+$+H/I,s[1][1])*I:P=Ke(w+$+(c?M:-M)/I,s[0][1])*I,y=Math.max(y,P)}if(a){let P=0;!c&&!l||c&&!l&&d?P=Ke(w+H/I,a[1][1])*I:P=Qe(w+(c?M:-M)/I,a[0][1])*I,y=Math.max(y,P)}}if(h){const E=wo(j*I,g,x)/I;if(A=Math.max(A,E),s){let P=0;!c&&!l||l&&!c&&d?P=Qe(m+j*I+R,s[1][0])/I:P=Ke(m+(l?L:-L)*I+R,s[0][0])/I,A=Math.max(A,P)}if(a){let P=0;!c&&!l||l&&!c&&d?P=Ke(m+j*I,a[1][0])/I:P=Qe(m+(l?L:-L)*I,a[0][0])/I,A=Math.max(A,P)}}}L=L+(L<0?A:-A),M=M+(M<0?y:-y),r&&(d?H>j*I?L=(Ka(c,l)?-M:M)/I:M=(Ka(c,l)?-L:L)*I:u?(L=M/I,l=c):(M=L*I,c=l));const T=c?m+M:m,S=l?w+L:w;return{width:k+(c?-M:M),height:N+(l?-L:L),x:i[0]*M*(c?-1:1)+T,y:i[1]*L*(l?-1:1)+S}}const Qa={width:0,height:0,x:0,y:0},xm={...Qa,pointerX:0,pointerY:0,aspectRatio:1};function wm(e){return[[0,0],[e.measured.width,e.measured.height]]}function bm(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function vm({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ve(e);function s({controlPosition:c,boundaries:l,keepAspectRatio:u,resizeDirection:h,onResizeStart:d,onResize:f,onResizeEnd:p,shouldResize:g}){let x={...Qa},b={...xm};const v=mm(c);let m,w=null,k=[],N,I,M;const L=Os().on("start",H=>{const{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,paneDomNode:T}=n();if(m=j.get(t),!m)return;w=T?.getBoundingClientRect()??null;const{xSnapped:S,ySnapped:E}=mn(H.sourceEvent,{transform:R,snapGrid:$,snapToGrid:y,containerBounds:w});x={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...x,pointerX:S,pointerY:E,aspectRatio:x.width/x.height},N=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(N=j.get(m.parentId),I=N&&m.extent==="parent"?wm(N):void 0),k=[],M=void 0;for(const[P,_]of j)if(_.parentId===t&&(k.push({id:P,position:{..._.position},extent:_.extent}),_.extent==="parent"||_.expandParent)){const D=bm(_,m,_.origin??A);M?M=[[Math.min(D[0][0],M[0][0]),Math.min(D[0][1],M[0][1])],[Math.max(D[1][0],M[1][0]),Math.max(D[1][1],M[1][1])]]:M=D}d?.(H,{...x})}).on("drag",H=>{const{transform:j,snapGrid:R,snapToGrid:$,nodeOrigin:y}=n(),A=mn(H.sourceEvent,{transform:j,snapGrid:R,snapToGrid:$,containerBounds:w}),T=[];if(!m)return;const{x:S,y:E,width:P,height:_}=x,D={},z=m.origin??y,{width:F,height:B,x:Y,y:K}=ym(b,v,A,l,u,z,I,M),W=F!==P,V=B!==_,X=Y!==S&&W,J=K!==E&&V;if(!X&&!J&&!W&&!V)return;if((X||J||z[0]===1||z[1]===1)&&(D.x=X?Y:x.x,D.y=J?K:x.y,x.x=D.x,x.y=D.y,k.length>0)){const ne=Y-S,ue=K-E;for(const ge of k)ge.position={x:ge.position.x-ne+z[0]*(F-P),y:ge.position.y-ue+z[1]*(B-_)},T.push(ge)}if((W||V)&&(D.width=W&&(!h||h==="horizontal")?F:x.width,D.height=V&&(!h||h==="vertical")?B:x.height,x.width=D.width,x.height=D.height),N&&m.expandParent){const ne=z[0]*(D.width??0);D.x&&D.x<ne&&(x.x=ne,b.x=b.x-(D.x-ne));const ue=z[1]*(D.height??0);D.y&&D.y<ue&&(x.y=ue,b.y=b.y-(D.y-ue))}const te=gm({width:x.width,prevWidth:P,height:x.height,prevHeight:_,affectsX:v.affectsX,affectsY:v.affectsY}),Z={...x,direction:te};g?.(H,Z)!==!1&&(f?.(H,Z),o(D,T))}).on("end",H=>{p?.(H,{...x}),r?.({...x})});i.call(L)}function a(){i.on(".drag",null)}return{update:s,destroy:a}}var bo={exports:{}},Jr={},vo={exports:{}},ei={};/**
23
23
  * @license React
24
24
  * use-sync-external-store-shim.production.js
25
25
  *
@@ -27,7 +27,7 @@ React keys must be passed directly to JSX without using spread:
27
27
  *
28
28
  * This source code is licensed under the MIT license found in the
29
29
  * LICENSE file in the root directory of this source tree.
30
- */var Qs;function zp(){if(Qs)return gr;Qs=1;var e=T;function t(f,u){return f===u&&(f!==0||1/f===1/u)||f!==f&&u!==u}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,u){var h=u(),p=o({inst:{value:h,getSnapshot:u}}),g=p[0].inst,y=p[1];return i(function(){g.value=h,g.getSnapshot=u,l(g)&&y({inst:g})},[f,h,u]),r(function(){return l(g)&&y({inst:g}),f(function(){l(g)&&y({inst:g})})},[f]),s(h),h}function l(f){var u=f.getSnapshot;f=f.value;try{var h=u();return!n(f,h)}catch{return!0}}function c(f,u){return u()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return gr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,gr}var mr={};/**
30
+ */var Ja;function Em(){if(Ja)return ei;Ja=1;var e=O;function t(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(h,d){var f=d(),p=o({inst:{value:f,getSnapshot:d}}),g=p[0].inst,x=p[1];return i(function(){g.value=f,g.getSnapshot=d,c(g)&&x({inst:g})},[h,f,d]),r(function(){return c(g)&&x({inst:g}),h(function(){c(g)&&x({inst:g})})},[h]),s(f),f}function c(h){var d=h.getSnapshot;h=h.value;try{var f=d();return!n(h,f)}catch{return!0}}function l(h,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return ei.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,ei}var ti={};/**
31
31
  * @license React
32
32
  * use-sync-external-store-shim.development.js
33
33
  *
@@ -35,7 +35,7 @@ React keys must be passed directly to JSX without using spread:
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var Js;function $p(){return Js||(Js=1,process.env.NODE_ENV!=="production"&&function(){function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function t(h,p){d||r.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!f){var y=p();i(g,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=s({inst:{value:g,getSnapshot:p}});var w=y[0].inst,_=y[1];return l(function(){w.value=g,w.getSnapshot=p,n(w)&&_({inst:w})},[h,g,p]),a(function(){return n(w)&&_({inst:w}),h(function(){n(w)&&_({inst:w})})},[h]),c(g),g}function n(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!i(h,g)}catch{return!0}}function o(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=T,i=typeof Object.is=="function"?Object.is:e,s=r.useState,a=r.useEffect,l=r.useLayoutEffect,c=r.useDebugValue,d=!1,f=!1,u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;mr.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),mr}var ea;function ta(){return ea||(ea=1,process.env.NODE_ENV==="production"?Qn.exports=zp():Qn.exports=$p()),Qn.exports}/**
38
+ */var ec;function _m(){return ec||(ec=1,process.env.NODE_ENV!=="production"&&function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}function t(f,p){u||r.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!h){var x=p();i(g,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}x=s({inst:{value:g,getSnapshot:p}});var b=x[0].inst,v=x[1];return c(function(){b.value=g,b.getSnapshot=p,n(b)&&v({inst:b})},[f,g,p]),a(function(){return n(b)&&v({inst:b}),f(function(){n(b)&&v({inst:b})})},[f]),l(g),g}function n(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!i(f,g)}catch{return!0}}function o(f,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=O,i=typeof Object.is=="function"?Object.is:e,s=r.useState,a=r.useEffect,c=r.useLayoutEffect,l=r.useDebugValue,u=!1,h=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;ti.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ti}var tc;function nc(){return tc||(tc=1,process.env.NODE_ENV==="production"?vo.exports=Em():vo.exports=_m()),vo.exports}/**
39
39
  * @license React
40
40
  * use-sync-external-store-shim/with-selector.production.js
41
41
  *
@@ -43,7 +43,7 @@ React keys must be passed directly to JSX without using spread:
43
43
  *
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
- */var na;function jp(){if(na)return pr;na=1;var e=T,t=ta();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return pr.useSyncExternalStoreWithSelector=function(c,d,f,u,h){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function w(E){if(!_){if(_=!0,m=E,E=u(E),h!==void 0&&g.hasValue){var M=g.value;if(h(M,E))return x=M}return x=E}if(M=x,o(m,E))return M;var N=u(E);return h!==void 0&&h(M,N)?(m=E,M):(m=E,x=N)}var _=!1,m,x,C=f===void 0?null:f;return[function(){return w(d())},C===null?void 0:function(){return w(C())}]},[d,f,u,h]);var y=r(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},pr}var yr={};/**
46
+ */var oc;function Sm(){if(oc)return Jr;oc=1;var e=O,t=nc();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Jr.useSyncExternalStoreWithSelector=function(l,u,h,d,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function b(N){if(!v){if(v=!0,m=N,N=d(N),f!==void 0&&g.hasValue){var I=g.value;if(f(I,N))return w=I}return w=N}if(I=w,o(m,N))return I;var M=d(N);return f!==void 0&&f(I,M)?(m=N,I):(m=N,w=M)}var v=!1,m,w,k=h===void 0?null:h;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,h,d,f]);var x=r(l,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=x},[x]),c(x),x},Jr}var ni={};/**
47
47
  * @license React
48
48
  * use-sync-external-store-shim/with-selector.development.js
49
49
  *
@@ -51,57 +51,57 @@ React keys must be passed directly to JSX without using spread:
51
51
  *
52
52
  * This source code is licensed under the MIT license found in the
53
53
  * LICENSE file in the root directory of this source tree.
54
- */var oa;function Hp(){return oa||(oa=1,process.env.NODE_ENV!=="production"&&function(){function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=ta(),o=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;yr.useSyncExternalStoreWithSelector=function(c,d,f,u,h){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function w(E){if(!_){if(_=!0,m=E,E=u(E),h!==void 0&&g.hasValue){var M=g.value;if(h(M,E))return x=M}return x=E}if(M=x,o(m,E))return M;var N=u(E);return h!==void 0&&h(M,N)?(m=E,M):(m=E,x=N)}var _=!1,m,x,C=f===void 0?null:f;return[function(){return w(d())},C===null?void 0:function(){return w(C())}]},[d,f,u,h]);var y=r(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),yr}var ra;function Lp(){return ra||(ra=1,process.env.NODE_ENV==="production"?Kn.exports=jp():Kn.exports=Hp()),Kn.exports}var Vp=Lp();const Rp=Wl(Vp),Bp={},ia=e=>{let t;const n=new Set,o=(d,f)=>{const u=typeof d=="function"?d(t):d;if(!Object.is(u,t)){const h=t;t=f??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,h))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Bp?"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(o,r,l);return l},Fp=e=>e?ia(e):ia,{useDebugValue:Wp}=T,{useSyncExternalStoreWithSelector:Yp}=Rp,Xp=e=>e;function sa(e,t=Xp,n){const o=Yp(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Wp(o),o}const aa=(e,t)=>{const n=Fp(e),o=(r,i=t)=>sa(n,r,i);return Object.assign(o,n),o},Gp=(e,t)=>e?aa(e,t):aa;function ce(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[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const Jn=T.createContext(null),Up=Jn.Provider,la=ye.error001();function oe(e,t){const n=T.useContext(Jn);if(n===null)throw new Error(la);return sa(n,e,t)}function ae(){const e=T.useContext(Jn);if(e===null)throw new Error(la);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ca={display:"none"},qp={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ua="react-flow__node-desc",da="react-flow__edge-desc",Zp="react-flow__aria-live",Kp=e=>e.ariaLiveMessage,Qp=e=>e.ariaLabelConfig;function Jp({rfId:e}){const t=oe(Kp);return v.jsx("div",{id:`${Zp}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:qp,children:t})}function eg({rfId:e,disableKeyboardA11y:t}){const n=oe(Qp);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${ua}-${e}`,style:ca,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${da}-${e}`,style:ca,children:n["edge.a11yDescription.default"]}),!t&&v.jsx(Jp,{rfId:e})]})}const eo=T.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return v.jsx("div",{className:ue(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});eo.displayName="Panel";function tg({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:v.jsx(eo,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ng=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},to=e=>e.id;function og(e,t){return ce(e.selectedNodes.map(to),t.selectedNodes.map(to))&&ce(e.selectedEdges.map(to),t.selectedEdges.map(to))}function rg({onSelectionChange:e}){const t=ae(),{selectedNodes:n,selectedEdges:o}=oe(ng,og);return T.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const ig=e=>!!e.onSelectionChangeHandlers;function sg({onSelectionChange:e}){const t=oe(ig);return e||t?v.jsx(rg,{onSelectionChange:e}):null}const fa=[0,0],ag={x:0,y:0,zoom:1},ha=[...["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],"rfId"],lg=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),pa={translateExtent:Ft,nodeOrigin:fa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function cg(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l,setPaneClickDistance:c}=oe(lg,ce),d=ae();T.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{f.current=pa,a()}),[]);const f=T.useRef(pa);return T.useEffect(()=>{for(const u of ha){const h=e[u],p=f.current[u];h!==p&&(typeof e[u]>"u"||(u==="nodes"?t(h):u==="edges"?n(h):u==="minZoom"?o(h):u==="maxZoom"?r(h):u==="translateExtent"?i(h):u==="nodeExtent"?s(h):u==="paneClickDistance"?c(h):u==="ariaLabelConfig"?d.setState({ariaLabelConfig:Xh(h)}):u==="fitView"?d.setState({fitViewQueued:h}):u==="fitViewOptions"?d.setState({fitViewOptions:h}):d.setState({[u]:h})))}f.current=e},ha.map(u=>e[u])),null}function ga(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function ug(e){const[t,n]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){n(e);return}const o=ga(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:ga()?.matches?"dark":"light"}const ma=typeof document<"u"?document:null;function Qt(e=null,t={target:ma,actInsideInputWithModifier:!0}){const[n,o]=T.useState(!1),r=T.useRef(!1),i=T.useRef(new Set([])),[s,a]=T.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
54
+ */var rc;function Cm(){return rc||(rc=1,process.env.NODE_ENV!=="production"&&function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=O,n=nc(),o=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,c=t.useDebugValue;ni.useSyncExternalStoreWithSelector=function(l,u,h,d,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function b(N){if(!v){if(v=!0,m=N,N=d(N),f!==void 0&&g.hasValue){var I=g.value;if(f(I,N))return w=I}return w=N}if(I=w,o(m,N))return I;var M=d(N);return f!==void 0&&f(I,M)?(m=N,I):(m=N,w=M)}var v=!1,m,w,k=h===void 0?null:h;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,h,d,f]);var x=r(l,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=x},[x]),c(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ni}var ic;function Nm(){return ic||(ic=1,process.env.NODE_ENV==="production"?bo.exports=Sm():bo.exports=Cm()),bo.exports}var km=Nm();const Tm=Au(km),Mm={},sc=e=>{let t;const n=new Set,o=(u,h)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const f=t;t=h??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Mm?"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()}},l=t=e(o,r,c);return c},Am=e=>e?sc(e):sc,{useDebugValue:Im}=O,{useSyncExternalStoreWithSelector:Pm}=Tm,Om=e=>e;function ac(e,t=Om,n){const o=Pm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Im(o),o}const cc=(e,t)=>{const n=Am(e),o=(r,i=t)=>ac(n,r,i);return Object.assign(o,n),o},Dm=(e,t)=>e?cc(e,t):cc;function de(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[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const Eo=O.createContext(null),Rm=Eo.Provider,lc=xe.error001();function ie(e,t){const n=O.useContext(Eo);if(n===null)throw new Error(lc);return ac(n,e,t)}function ce(){const e=O.useContext(Eo);if(e===null)throw new Error(lc);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const uc={display:"none"},Lm={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dc="react-flow__node-desc",fc="react-flow__edge-desc",$m="react-flow__aria-live",zm=e=>e.ariaLiveMessage,Hm=e=>e.ariaLabelConfig;function jm({rfId:e}){const t=ie(zm);return C.jsx("div",{id:`${$m}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Lm,children:t})}function Vm({rfId:e,disableKeyboardA11y:t}){const n=ie(Hm);return C.jsxs(C.Fragment,{children:[C.jsx("div",{id:`${dc}-${e}`,style:uc,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),C.jsx("div",{id:`${fc}-${e}`,style:uc,children:n["edge.a11yDescription.default"]}),!t&&C.jsx(jm,{rfId:e})]})}const _o=O.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return C.jsx("div",{className:fe(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});_o.displayName="Panel";function Fm({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:C.jsx(_o,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:C.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Bm=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},So=e=>e.id;function Wm(e,t){return de(e.selectedNodes.map(So),t.selectedNodes.map(So))&&de(e.selectedEdges.map(So),t.selectedEdges.map(So))}function Ym({onSelectionChange:e}){const t=ce(),{selectedNodes:n,selectedEdges:o}=ie(Bm,Wm);return O.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Xm=e=>!!e.onSelectionChangeHandlers;function Um({onSelectionChange:e}){const t=ie(Xm);return e||t?C.jsx(Ym,{onSelectionChange:e}):null}const hc=[0,0],Gm={x:0,y:0,zoom:1},pc=[...["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],"rfId"],qm=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),gc={translateExtent:ln,nodeOrigin:hc,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Zm(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:l}=ie(qm,de),u=ce();O.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=gc,a()}),[]);const h=O.useRef(gc);return O.useEffect(()=>{for(const d of pc){const f=e[d],p=h.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="paneClickDistance"?l(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Og(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},pc.map(d=>e[d])),null}function mc(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Km(e){const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const o=mc(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:mc()?.matches?"dark":"light"}const yc=typeof document<"u"?document:null;function xn(e=null,t={target:yc,actInsideInputWithModifier:!0}){const[n,o]=O.useState(!1),r=O.useRef(!1),i=O.useRef(new Set([])),[s,a]=O.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
55
55
  `).replace(`
56
56
 
57
57
  `,`
58
58
  +`).split(`
59
- `)),d=c.reduce((f,u)=>f.concat(...u),[]);return[c,d]}return[[],[]]},[e]);return T.useEffect(()=>{const l=t?.target??ma,c=t?.actInsideInputWithModifier??!0;if(e!==null){const d=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!c)&&ks(h))return!1;const g=xa(h.code,a);if(i.current.add(h[g]),ya(s,i.current,!1)){const y=h.composedPath?.()?.[0]||h.target,w=y?.nodeName==="BUTTON"||y?.nodeName==="A";t.preventDefault!==!1&&(r.current||!w)&&h.preventDefault(),o(!0)}},f=h=>{const p=xa(h.code,a);ya(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[p]),h.key==="Meta"&&i.current.clear(),r.current=!1},u=()=>{i.current.clear(),o(!1)};return l?.addEventListener("keydown",d),l?.addEventListener("keyup",f),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{l?.removeEventListener("keydown",d),l?.removeEventListener("keyup",f),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,o]),n}function ya(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function xa(e,t){return t.includes(e)?"code":"key"}const dg=()=>{const e=ae();return T.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=tr(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-l},d=n.snapGrid??r,f=n.snapToGrid??i;return Ut(c,o,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=Yn(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function wa(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)fg(l,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function fg(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ba(e,t){return wa(e,t)}function Jt(e,t){return wa(e,t)}function et(e,t){return{id:e,type:"select",selected:t}}function vt(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(et(i.id,s)))}return o}function va({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function _a(e){return{id:e.id,type:"remove"}}const Ea=e=>Hh(e),hg=e=>gs(e);function Sa(e){return T.forwardRef(e)}const pg=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Na(e){const[t,n]=T.useState(BigInt(0)),[o]=T.useState(()=>gg(()=>n(r=>r+BigInt(1))));return pg(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function gg(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Ca=T.createContext(null);function mg({children:e}){const t=ae(),n=T.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:f,nodeLookup:u,fitViewQueued:h}=t.getState();let p=l;for(const y of a)p=typeof y=="function"?y(p):y;const g=va({items:p,lookup:u});d&&c(p),g.length>0?f?.(g):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:_}=t.getState();y&&_(w)})},[]),o=Na(n),r=T.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:u}=t.getState();let h=l;for(const p of a)h=typeof p=="function"?p(h):p;d?c(h):f&&f(va({items:h,lookup:u}))},[]),i=Na(r),s=T.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return v.jsx(Ca.Provider,{value:s,children:e})}function yg(){const e=T.useContext(Ca);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xg=e=>!!e.panZoom;function en(){const e=dg(),t=ae(),n=yg(),o=oe(xg),r=T.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},a=f=>{n.edgeQueue.push(f)},l=f=>{const{nodeLookup:u,nodeOrigin:h}=t.getState(),p=Ea(f)?f:u.get(f.id),g=p.parentId?Ss(p.position,p.measured,p.parentId,u,h):p.position,y={...p,position:g,width:p.measured?.width??p.width,height:p.measured?.height??p.height};return yt(y)},c=(f,u,h={replace:!1})=>{s(p=>p.map(g=>{if(g.id===f){const y=typeof u=="function"?u(g):u;return h.replace&&Ea(y)?y:{...g,...y}}return g}))},d=(f,u,h={replace:!1})=>{a(p=>p.map(g=>{if(g.id===f){const y=typeof u=="function"?u(g):u;return h.replace&&hg(y)?y:{...g,...y}}return g}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>i(f)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(u=>({...u}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:a,addNodes:f=>{const u=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...u])},addEdges:f=>{const u=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...u])},toObject:()=>{const{nodes:f=[],edges:u=[],transform:h}=t.getState(),[p,g,y]=h;return{nodes:f.map(w=>({...w})),edges:u.map(w=>({...w})),viewport:{x:p,y:g,zoom:y}}},deleteElements:async({nodes:f=[],edges:u=[]})=>{const{nodes:h,edges:p,onNodesDelete:g,onEdgesDelete:y,triggerNodeChanges:w,triggerEdgeChanges:_,onDelete:m,onBeforeDelete:x}=t.getState(),{nodes:C,edges:E}=await Bh({nodesToRemove:f,edgesToRemove:u,nodes:h,edges:p,onBeforeDelete:x}),M=E.length>0,N=C.length>0;if(M){const z=E.map(_a);y?.(E),_(z)}if(N){const z=C.map(_a);g?.(C),w(z)}return(N||M)&&m?.({nodes:C,edges:E}),{deletedNodes:C,deletedEdges:E}},getIntersectingNodes:(f,u=!0,h)=>{const p=vs(f),g=p?f:l(f),y=h!==void 0;return g?(h||t.getState().nodes).filter(w=>{const _=t.getState().nodeLookup.get(w.id);if(_&&!p&&(w.id===f.id||!_.internals.positionAbsolute))return!1;const m=yt(y?w:_),x=Xt(m,g);return u&&x>0||x>=m.width*m.height||x>=g.width*g.height}):[]},isNodeIntersecting:(f,u,h=!0)=>{const g=vs(f)?f:l(f);if(!g)return!1;const y=Xt(g,u);return h&&y>0||y>=g.width*g.height},updateNode:c,updateNodeData:(f,u,h={replace:!1})=>{c(f,p=>{const g=typeof u=="function"?u(p):u;return h.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},h)},updateEdge:d,updateEdgeData:(f,u,h={replace:!1})=>{d(f,p=>{const g=typeof u=="function"?u(p):u;return h.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},h)},getNodesBounds:f=>{const{nodeLookup:u,nodeOrigin:h}=t.getState();return Lh(f,{nodeLookup:u,nodeOrigin:h})},getHandleConnections:({type:f,id:u,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${f}${u?`-${u}`:""}`)?.values()??[]),getNodeConnections:({type:f,handleId:u,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${f?u?`-${f}-${u}`:`-${f}`:""}`)?.values()??[]),fitView:async f=>{const u=t.getState().fitViewResolver??Yh();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:u}),n.nodeQueue.push(h=>[...h]),u.promise}}},[]);return T.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const ka=e=>e.selected,wg=typeof window<"u"?window:void 0;function bg({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ae(),{deleteElements:o}=en(),r=Qt(e,{actInsideInputWithModifier:!1}),i=Qt(t,{target:wg});T.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(ka),edges:s.filter(ka)}),n.setState({nodesSelectionActive:!1})}},[r]),T.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function vg(e){const t=ae();T.useEffect(()=>{const n=()=>{if(!e.current)return!1;const o=nr(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",ye.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const no={position:"absolute",width:"100%",height:"100%",top:0,left:0},_g=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Eg({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Ke.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:u,preventScrolling:h=!0,children:p,noWheelClassName:g,noPanClassName:y,onViewportChange:w,isControlledViewport:_,paneClickDistance:m}){const x=ae(),C=T.useRef(null),{userSelectionActive:E,lib:M}=oe(_g,ce),N=Qt(u),z=T.useRef();vg(C);const V=T.useCallback(j=>{w?.({x:j[0],y:j[1],zoom:j[2]}),_||x.setState({transform:j})},[w,_]);return T.useEffect(()=>{if(C.current){z.current=kp({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:l,paneClickDistance:m,onDraggingChange:b=>x.setState({paneDragging:b}),onPanZoomStart:(b,I)=>{const{onViewportChangeStart:k,onMoveStart:A}=x.getState();A?.(b,I),k?.(I)},onPanZoom:(b,I)=>{const{onViewportChange:k,onMove:A}=x.getState();A?.(b,I),k?.(I)},onPanZoomEnd:(b,I)=>{const{onViewportChangeEnd:k,onMoveEnd:A}=x.getState();A?.(b,I),k?.(I)}});const{x:j,y:D,zoom:L}=z.current.getViewport();return x.setState({panZoom:z.current,transform:[j,D,L],domNode:C.current.closest(".react-flow")}),()=>{z.current?.destroy()}}},[]),T.useEffect(()=>{z.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:N,preventScrolling:h,noPanClassName:y,userSelectionActive:E,noWheelClassName:g,lib:M,onTransformChange:V})},[e,t,n,o,r,i,s,a,N,h,y,E,g,M,V]),v.jsx("div",{className:"react-flow__renderer",ref:C,style:no,children:p})}const Sg=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ng(){const{userSelectionActive:e,userSelectionRect:t}=oe(Sg,ce);return e&&t?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const xr=(e,t)=>n=>{n.target===t.current&&e?.(n)},Cg=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function kg({isSelecting:e,selectionKeyPressed:t,selectionMode:n=gt.Full,panOnDrag:o,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:u,children:h}){const p=ae(),{userSelectionActive:g,elementsSelectable:y,dragging:w,connectionInProgress:_}=oe(Cg,ce),m=y&&(e||g),x=T.useRef(null),C=T.useRef(),E=T.useRef(new Set),M=T.useRef(new Set),N=T.useRef(!1),z=T.useRef(!1),V=A=>{if(N.current||_){N.current=!1;return}a?.(A),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},j=A=>{if(Array.isArray(o)&&o?.includes(2)){A.preventDefault();return}l?.(A)},D=c?A=>c(A):void 0,L=A=>{const{resetSelectedElements:P,domNode:$}=p.getState();if(C.current=$?.getBoundingClientRect(),!y||!e||A.button!==0||A.target!==x.current||!C.current)return;A.target?.setPointerCapture?.(A.pointerId),z.current=!0,N.current=!1;const{x:S,y:O}=Ie(A.nativeEvent,C.current);P(),p.setState({userSelectionRect:{width:0,height:0,startX:S,startY:O,x:S,y:O}}),i?.(A)},b=A=>{const{userSelectionRect:P,transform:$,nodeLookup:S,edgeLookup:O,connectionLookup:H,triggerNodeChanges:B,triggerEdgeChanges:F,defaultEdgeOptions:U}=p.getState();if(!C.current||!P)return;N.current=!0;const{x:K,y:W}=Ie(A.nativeEvent,C.current),{startX:R,startY:Y}=P,ee={startX:R,startY:Y,x:K<R?K:R,y:W<Y?W:Y,width:Math.abs(K-R),height:Math.abs(W-Y)},re=E.current,Z=M.current;E.current=new Set(Qo(S,ee,$,n===gt.Partial,!0).map(J=>J.id)),M.current=new Set;const ne=U?.selectable??!0;for(const J of E.current){const le=H.get(J);if(le)for(const{edgeId:he}of le.values()){const Ce=O.get(he);Ce&&(Ce.selectable??ne)&&M.current.add(he)}}if(!Ns(re,E.current)){const J=vt(S,E.current,!0);B(J)}if(!Ns(Z,M.current)){const J=vt(O,M.current);F(J)}p.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},I=A=>{if(A.button!==0||!z.current)return;A.target?.releasePointerCapture?.(A.pointerId);const{userSelectionRect:P}=p.getState();!g&&P&&A.target===x.current&&V?.(A),p.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:E.current.size>0}),s?.(A),(t||r)&&(N.current=!1),z.current=!1},k=o===!0||Array.isArray(o)&&o.includes(0);return v.jsxs("div",{className:ue(["react-flow__pane",{draggable:k,dragging:w,selection:e}]),onClick:m?void 0:xr(V,x),onContextMenu:xr(j,x),onWheel:xr(D,x),onPointerEnter:m?void 0:d,onPointerDown:m?L:f,onPointerMove:m?b:f,onPointerUp:m?I:void 0,onPointerLeave:u,ref:x,style:no,children:[h,v.jsx(Ng,{})]})}function wr({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",ye.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Ta({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=ae(),[l,c]=T.useState(!1),d=T.useRef();return T.useEffect(()=>{d.current=fp({getStoreItems:()=>a.getState(),onNodeMouseDown:f=>{wr({id:f,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),T.useEffect(()=>{if(t)d.current?.destroy();else if(e.current)return d.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{d.current?.destroy()}},[n,o,t,i,e,r]),l}const Tg=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ma(){const e=ae();return T.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=e.getState(),f=new Map,u=Tg(s),h=r?i[0]:5,p=r?i[1]:5,g=n.direction.x*h*n.factor,y=n.direction.y*p*n.factor;for(const[,w]of c){if(!u(w))continue;let _={x:w.internals.positionAbsolute.x+g,y:w.internals.positionAbsolute.y+y};r&&(_=Gt(_,i));const{position:m,positionAbsolute:x}=ms({nodeId:w.id,nextPosition:_,nodeLookup:c,nodeExtent:o,nodeOrigin:d,onError:a});w.position=m,w.internals.positionAbsolute=x,f.set(w.id,w)}l(f)},[])}const br=T.createContext(null),Mg=br.Provider;br.Consumer;const oo=()=>T.useContext(br),Ag=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ig=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:l,isValid:c}=s,d=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:d,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===pt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:d&&c}};function Pg({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:f,...u},h){const p=s||null,g=e==="target",y=ae(),w=oo(),{connectOnClick:_,noPanClassName:m,rfId:x}=oe(Ag,ce),{connectingFrom:C,connectingTo:E,clickConnecting:M,isPossibleEndHandle:N,connectionInProcess:z,clickConnectionInProcess:V,valid:j}=oe(Ig(w,p,e),ce);w||y.getState().onError?.("010",ye.error010());const D=I=>{const{defaultEdgeOptions:k,onConnect:A,hasDefaultEdges:P}=y.getState(),$={...k,...I};if(P){const{edges:S,setEdges:O}=y.getState();O(Un($,S))}A?.($),a?.($)},L=I=>{if(!w)return;const k=Ts(I.nativeEvent);if(r&&(k&&I.button===0||!k)){const A=y.getState();dr.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:g,handleId:p,nodeId:w,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:A.onConnectEnd,updateConnection:A.updateConnection,onConnect:D,isValidConnection:n||A.isValidConnection,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}k?d?.(I):f?.(I)},b=I=>{const{onClickConnectStart:k,onClickConnectEnd:A,connectionClickStartHandle:P,connectionMode:$,isValidConnection:S,lib:O,rfId:H,nodeLookup:B,connection:F}=y.getState();if(!w||!P&&!r)return;if(!P){k?.(I.nativeEvent,{nodeId:w,handleId:p,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:w,type:e,id:p}});return}const U=Cs(I.target),K=n||S,{connection:W,isValid:R}=dr.isValid(I.nativeEvent,{handle:{nodeId:w,id:p,type:e},connectionMode:$,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:K,flowId:H,doc:U,lib:O,nodeLookup:B});R&&W&&D(W);const Y=structuredClone(F);delete Y.inProgress,Y.toPosition=Y.toHandle?Y.toHandle.position:null,A?.(I,Y),y.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":p,"data-nodeid":w,"data-handlepos":t,"data-id":`${x}-${w}-${p}-${e}`,className:ue(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:i,clickconnecting:M,connectingfrom:C,connectingto:E,valid:j,connectionindicator:o&&(!z||N)&&(z||V?i:r)}]),onMouseDown:L,onTouchStart:L,onClick:_?b:void 0,ref:h,...u,children:l})}const tn=T.memo(Sa(Pg));function Og({data:e,isConnectable:t,sourcePosition:n=q.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(tn,{type:"source",position:n,isConnectable:t})]})}function Dg({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:o=q.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(tn,{type:"target",position:n,isConnectable:t}),e?.label,v.jsx(tn,{type:"source",position:o,isConnectable:t})]})}function zg(){return null}function $g({data:e,isConnectable:t,targetPosition:n=q.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(tn,{type:"target",position:n,isConnectable:t}),e?.label]})}const ro={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Aa={input:Og,default:Dg,output:$g,group:zg};function jg(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const Hg=e=>{const{width:t,height:n,x:o,y:r}=Yt(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ne(t)?t:null,height:Ne(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Lg({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=ae(),{width:r,height:i,transformString:s,userSelectionActive:a}=oe(Hg,ce),l=Ma(),c=T.useRef(null);if(T.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]),Ta({nodeRef:c}),a||!r||!i)return null;const d=e?u=>{const h=o.getState().nodes.filter(p=>p.selected);e(u,h)}:void 0,f=u=>{Object.prototype.hasOwnProperty.call(ro,u.key)&&(u.preventDefault(),l({direction:ro[u.key],factor:u.shiftKey?4:1}))};return v.jsx("div",{className:ue(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:v.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const Ia=typeof window<"u"?window:void 0,Vg=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pa({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:f,onSelectionStart:u,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:g,zoomActivationKeyCode:y,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:m,panOnScroll:x,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:N,defaultViewport:z,translateExtent:V,minZoom:j,maxZoom:D,preventScrolling:L,onSelectionContextMenu:b,noWheelClassName:I,noPanClassName:k,disableKeyboardA11y:A,onViewportChange:P,isControlledViewport:$}){const{nodesSelectionActive:S,userSelectionActive:O}=oe(Vg),H=Qt(c,{target:Ia}),B=Qt(g,{target:Ia}),F=B||N,U=B||x,K=d&&F!==!0,W=H||O||K;return bg({deleteKeyCode:l,multiSelectionKeyCode:p}),v.jsx(Eg,{onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:m,panOnScroll:U,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:!H&&F,defaultViewport:z,translateExtent:V,minZoom:j,maxZoom:D,zoomActivationKeyCode:y,preventScrolling:L,noWheelClassName:I,noPanClassName:k,onViewportChange:P,isControlledViewport:$,paneClickDistance:a,children:v.jsxs(kg,{onSelectionStart:u,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,isSelecting:!!W,selectionMode:f,selectionKeyPressed:H,selectionOnDrag:K,children:[e,S&&v.jsx(Lg,{onSelectionContextMenu:b,noPanClassName:k,disableKeyboardA11y:A})]})})}Pa.displayName="FlowRenderer";const Rg=T.memo(Pa),Bg=e=>t=>e?Qo(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Fg(e){return oe(T.useCallback(Bg(e),[e]),ce)}const Wg=e=>e.updateNodeInternals;function Yg(){const e=oe(Wg),[t]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return T.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Xg({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=ae(),i=T.useRef(null),s=T.useRef(null),a=T.useRef(e.sourcePosition),l=T.useRef(e.targetPosition),c=T.useRef(t),d=n&&!!e.internals.handleBounds;return T.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[d,e.hidden]),T.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),T.useEffect(()=>{if(i.current){const f=c.current!==t,u=a.current!==e.sourcePosition,h=l.current!==e.targetPosition;(f||u||h)&&(c.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Gg({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:f,noDragClassName:u,noPanClassName:h,disableKeyboardA11y:p,rfId:g,nodeTypes:y,nodeClickDistance:w,onError:_}){const{node:m,internals:x,isParent:C}=oe(R=>{const Y=R.nodeLookup.get(e),ee=R.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:ee}},ce);let E=m.type||"default",M=y?.[E]||Aa[E];M===void 0&&(_?.("003",ye.error003(E)),E="default",M=y?.default||Aa.default);const N=!!(m.draggable||a&&typeof m.draggable>"u"),z=!!(m.selectable||l&&typeof m.selectable>"u"),V=!!(m.connectable||c&&typeof m.connectable>"u"),j=!!(m.focusable||d&&typeof m.focusable>"u"),D=ae(),L=Es(m),b=Xg({node:m,nodeType:E,hasDimensions:L,resizeObserver:f}),I=Ta({nodeRef:b,disabled:m.hidden||!N,noDragClassName:u,handleSelector:m.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:w}),k=Ma();if(m.hidden)return null;const A=je(m),P=jg(m),$=z||N||t||n||o||r,S=n?R=>n(R,{...x.userNode}):void 0,O=o?R=>o(R,{...x.userNode}):void 0,H=r?R=>r(R,{...x.userNode}):void 0,B=i?R=>i(R,{...x.userNode}):void 0,F=s?R=>s(R,{...x.userNode}):void 0,U=R=>{const{selectNodesOnDrag:Y,nodeDragThreshold:ee}=D.getState();z&&(!Y||!N||ee>0)&&wr({id:e,store:D,nodeRef:b}),t&&t(R,{...x.userNode})},K=R=>{if(!(ks(R.nativeEvent)||p)){if(cs.includes(R.key)&&z){const Y=R.key==="Escape";wr({id:e,store:D,unselect:Y,nodeRef:b})}else if(N&&m.selected&&Object.prototype.hasOwnProperty.call(ro,R.key)){R.preventDefault();const{ariaLabelConfig:Y}=D.getState();D.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:R.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),k({direction:ro[R.key],factor:R.shiftKey?4:1})}}},W=()=>{if(p||!b.current?.matches(":focus-visible"))return;const{transform:R,width:Y,height:ee,autoPanOnNodeFocus:re,setCenter:Z}=D.getState();if(!re)return;Qo(new Map([[e,m]]),{x:0,y:0,width:Y,height:ee},R,!0).length>0||Z(m.position.x+A.width/2,m.position.y+A.height/2,{zoom:R[2]})};return v.jsx("div",{className:ue(["react-flow__node",`react-flow__node-${E}`,{[h]:N},m.className,{selected:m.selected,selectable:z,parent:C,draggable:N,dragging:I}]),ref:b,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:L?"visible":"hidden",...m.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:S,onMouseMove:O,onMouseLeave:H,onContextMenu:B,onClick:U,onDoubleClick:F,onKeyDown:j?K:void 0,tabIndex:j?0:void 0,onFocus:j?W:void 0,role:m.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${ua}-${g}`,"aria-label":m.ariaLabel,...m.domAttributes,children:v.jsx(Mg,{value:e,children:v.jsx(M,{id:e,data:m.data,type:E,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:m.selected??!1,selectable:z,draggable:N,deletable:m.deletable??!0,isConnectable:V,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:I,dragHandle:m.dragHandle,zIndex:x.z,parentId:m.parentId,...A})})})}const Ug=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Oa(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=oe(Ug,ce),s=Fg(e.onlyRenderVisibleElements),a=Yg();return v.jsx("div",{className:"react-flow__nodes",style:no,children:s.map(l=>v.jsx(Gg,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}Oa.displayName="NodeRenderer";const qg=T.memo(Oa);function Zg(e){return oe(T.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&qh({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),ce)}const Kg=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Qg=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Da={[Rn.Arrow]:Kg,[Rn.ArrowClosed]:Qg};function Jg(e){const t=ae();return T.useMemo(()=>Object.prototype.hasOwnProperty.call(Da,e)?Da[e]:(t.getState().onError?.("009",ye.error009(e)),null),[e])}const em=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Jg(t);return l?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:v.jsx(l,{color:n,strokeWidth:s})}):null},za=({defaultColor:e,rfId:t})=>{const n=oe(i=>i.edges),o=oe(i=>i.defaultEdgeOptions),r=T.useMemo(()=>np(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:r.map(i=>v.jsx(em,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};za.displayName="MarkerDefinitions";var tm=T.memo(za);function $a({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d}){const[f,u]=T.useState({x:1,y:0,width:0,height:0}),h=ue(["react-flow__edge-textwrapper",c]),p=T.useRef(null);return T.useEffect(()=>{if(p.current){const g=p.current.getBBox();u({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?v.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...d,children:[r&&v.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),v.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:o,children:n}),l]}):null}$a.displayName="EdgeText";const nm=T.memo($a);function _t({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...d,d:e,fill:"none",className:ue(["react-flow__edge-path",d.className])}),c?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&Ne(t)&&Ne(n)?v.jsx(nm,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function ja({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===q.Left||e===q.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Ha({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:o,targetY:r,targetPosition:i=q.Top}){const[s,a]=ja({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=ja({pos:i,x1:o,y1:r,x2:e,y2:t}),[d,f,u,h]=As({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${o},${r}`,d,f,u,h]}function La(e){return T.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:y,interactionWidth:w})=>{const[_,m,x]=Ha({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),C=e.isInternal?void 0:t;return v.jsx(_t,{id:C,path:_,labelX:m,labelY:x,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:y,interactionWidth:w})})}const om=La({isInternal:!1}),Va=La({isInternal:!0});om.displayName="SimpleBezierEdge",Va.displayName="SimpleBezierEdgeInternal";function Ra(e){return T.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:u,sourcePosition:h=q.Bottom,targetPosition:p=q.Top,markerEnd:g,markerStart:y,pathOptions:w,interactionWidth:_})=>{const[m,x,C]=or({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:p,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),E=e.isInternal?void 0:t;return v.jsx(_t,{id:E,path:m,labelX:x,labelY:C,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:u,markerEnd:g,markerStart:y,interactionWidth:_})})}const Ba=Ra({isInternal:!1}),Fa=Ra({isInternal:!0});Ba.displayName="SmoothStepEdge",Fa.displayName="SmoothStepEdgeInternal";function Wa(e){return T.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return v.jsx(Ba,{...n,id:o,pathOptions:T.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const rm=Wa({isInternal:!1}),Ya=Wa({isInternal:!0});rm.displayName="StepEdge",Ya.displayName="StepEdgeInternal";function Xa(e){return T.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:u,markerEnd:h,markerStart:p,interactionWidth:g})=>{const[y,w,_]=Os({sourceX:n,sourceY:o,targetX:r,targetY:i}),m=e.isInternal?void 0:t;return v.jsx(_t,{id:m,path:y,labelX:w,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:u,markerEnd:h,markerStart:p,interactionWidth:g})})}const im=Xa({isInternal:!1}),Ga=Xa({isInternal:!0});im.displayName="StraightEdge",Ga.displayName="StraightEdgeInternal";function Ua(e){return T.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=q.Bottom,targetPosition:a=q.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:y,pathOptions:w,interactionWidth:_})=>{const[m,x,C]=Gn({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:w?.curvature}),E=e.isInternal?void 0:t;return v.jsx(_t,{id:E,path:m,labelX:x,labelY:C,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:u,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:y,interactionWidth:_})})}const sm=Ua({isInternal:!1}),qa=Ua({isInternal:!0});sm.displayName="BezierEdge",qa.displayName="BezierEdgeInternal";const Za={default:qa,straight:Ga,step:Ya,smoothstep:Fa,simplebezier:Va},Ka={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},am=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,lm=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,Qa="react-flow__edgeupdater";function Ja({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return v.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ue([Qa,`${Qa}-${a}`]),cx:am(t,o,e),cy:lm(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function cm({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:f,setReconnecting:u,setUpdateHover:h}){const p=ae(),g=(x,C)=>{if(x.button!==0)return;const{autoPanOnConnect:E,domNode:M,isValidConnection:N,connectionMode:z,connectionRadius:V,lib:j,onConnectStart:D,onConnectEnd:L,cancelConnection:b,nodeLookup:I,rfId:k,panBy:A,updateConnection:P}=p.getState(),$=C.type==="target",S=(B,F)=>{u(!1),f?.(B,n,C.type,F)},O=B=>c?.(n,B),H=(B,F)=>{u(!0),d?.(x,n,C.type),D?.(B,F)};dr.onPointerDown(x.nativeEvent,{autoPanOnConnect:E,connectionMode:z,connectionRadius:V,domNode:M,handleId:C.id,nodeId:C.nodeId,nodeLookup:I,isTarget:$,edgeUpdaterType:C.type,lib:j,flowId:k,cancelConnection:b,panBy:A,isValidConnection:N,onConnect:O,onConnectStart:H,onConnectEnd:L,onReconnectEnd:S,updateConnection:P,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},y=x=>g(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=x=>g(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>h(!0),m=()=>h(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Ja,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:y,onMouseEnter:_,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&v.jsx(Ja,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:w,onMouseEnter:_,onMouseOut:m,type:"target"})]})}function um({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:f,onReconnectStart:u,onReconnectEnd:h,rfId:p,edgeTypes:g,noPanClassName:y,onError:w,disableKeyboardA11y:_}){let m=oe(Z=>Z.edgeLookup.get(e));const x=oe(Z=>Z.defaultEdgeOptions);m=x?{...x,...m}:m;let C=m.type||"default",E=g?.[C]||Za[C];E===void 0&&(w?.("011",ye.error011(C)),C="default",E=g?.default||Za.default);const M=!!(m.focusable||t&&typeof m.focusable>"u"),N=typeof f<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),z=!!(m.selectable||o&&typeof m.selectable>"u"),V=T.useRef(null),[j,D]=T.useState(!1),[L,b]=T.useState(!1),I=ae(),{zIndex:k,sourceX:A,sourceY:P,targetX:$,targetY:S,sourcePosition:O,targetPosition:H}=oe(T.useCallback(Z=>{const ne=Z.nodeLookup.get(m.source),J=Z.nodeLookup.get(m.target);if(!ne||!J)return{zIndex:m.zIndex,...Ka};const le=tp({id:e,sourceNode:ne,targetNode:J,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:w});return{zIndex:Uh({selected:m.selected,zIndex:m.zIndex,sourceNode:ne,targetNode:J,elevateOnSelect:Z.elevateEdgesOnSelect}),...le||Ka}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),ce),B=T.useMemo(()=>m.markerStart?`url('#${rr(m.markerStart,p)}')`:void 0,[m.markerStart,p]),F=T.useMemo(()=>m.markerEnd?`url('#${rr(m.markerEnd,p)}')`:void 0,[m.markerEnd,p]);if(m.hidden||A===null||P===null||$===null||S===null)return null;const U=Z=>{const{addSelectedEdges:ne,unselectNodesAndEdges:J,multiSelectionActive:le}=I.getState();z&&(I.setState({nodesSelectionActive:!1}),m.selected&&le?(J({nodes:[],edges:[m]}),V.current?.blur()):ne([e])),r&&r(Z,m)},K=i?Z=>{i(Z,{...m})}:void 0,W=s?Z=>{s(Z,{...m})}:void 0,R=a?Z=>{a(Z,{...m})}:void 0,Y=l?Z=>{l(Z,{...m})}:void 0,ee=c?Z=>{c(Z,{...m})}:void 0,re=Z=>{if(!_&&cs.includes(Z.key)&&z){const{unselectNodesAndEdges:ne,addSelectedEdges:J}=I.getState();Z.key==="Escape"?(V.current?.blur(),ne({edges:[m]})):J([e])}};return v.jsx("svg",{style:{zIndex:k},children:v.jsxs("g",{className:ue(["react-flow__edge",`react-flow__edge-${C}`,m.className,y,{selected:m.selected,animated:m.animated,inactive:!z&&!r,updating:j,selectable:z}]),onClick:U,onDoubleClick:K,onContextMenu:W,onMouseEnter:R,onMouseMove:Y,onMouseLeave:ee,onKeyDown:M?re:void 0,tabIndex:M?0:void 0,role:m.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":M?`${da}-${p}`:void 0,ref:V,...m.domAttributes,children:[!L&&v.jsx(E,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:z,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:A,sourceY:P,targetX:$,targetY:S,sourcePosition:O,targetPosition:H,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:B,markerEnd:F,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),N&&v.jsx(cm,{edge:m,isReconnectable:N,reconnectRadius:d,onReconnect:f,onReconnectStart:u,onReconnectEnd:h,sourceX:A,sourceY:P,targetX:$,targetY:S,sourcePosition:O,targetPosition:H,setUpdateHover:D,setReconnecting:b})]})})}const dm=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function el({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:u,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:g}){const{edgesFocusable:y,edgesReconnectable:w,elementsSelectable:_,onError:m}=oe(dm,ce),x=Zg(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(tm,{defaultColor:e,rfId:n}),x.map(C=>v.jsx(um,{id:C,edgesFocusable:y,edgesReconnectable:w,elementsSelectable:_,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:f,onDoubleClick:u,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:m,edgeTypes:o,disableKeyboardA11y:g},C))]})}el.displayName="EdgeRenderer";const fm=T.memo(el),hm=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function pm({children:e}){const t=oe(hm);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function gm(e){const t=en(),n=T.useRef(!1);T.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const mm=e=>e.panZoom?.syncViewport;function ym(e){const t=oe(mm),n=ae();return T.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function xm(e){return e.connection.inProgress?{...e.connection,to:Ut(e.connection.to,e.transform)}:{...e.connection}}function wm(e){return xm}function tl(e){const t=wm();return oe(t,ce)}const bm=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function vm({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:l}=oe(bm,ce);return!(i&&r&&l)?null:v.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:ue(["react-flow__connection",ps(a)]),children:v.jsx(nl,{style:t,type:n,CustomComponent:o,isValid:a})})})}const nl=({style:e,type:t=Le.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:c,toNode:d,toHandle:f,toPosition:u}=tl();if(!r)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:u,connectionStatus:ps(o),toNode:d,toHandle:f});let h="";const p={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:u};switch(t){case Le.Bezier:[h]=Gn(p);break;case Le.SimpleBezier:[h]=Ha(p);break;case Le.Step:[h]=or({...p,borderRadius:0});break;case Le.SmoothStep:[h]=or(p);break;default:[h]=Os(p)}return v.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};nl.displayName="ConnectionLine";const _m={};function ol(e=_m){const t=T.useRef(e),n=ae();T.useEffect(()=>{if(process.env.NODE_ENV==="development"){const o=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of o)if(t.current[r]!==e[r]){n.getState().onError?.("002",ye.error002());break}t.current=e}},[e])}function Em(){const e=ae(),t=T.useRef(!1);T.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",ye.error013("react")),t.current=!0}},[])}function rl({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:u,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:y,connectionLineContainerStyle:w,selectionKeyCode:_,selectionOnDrag:m,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:N,onlyRenderVisibleElements:z,elementsSelectable:V,defaultViewport:j,translateExtent:D,minZoom:L,maxZoom:b,preventScrolling:I,defaultMarkerColor:k,zoomOnScroll:A,zoomOnPinch:P,panOnScroll:$,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:H,panOnDrag:B,onPaneClick:F,onPaneMouseEnter:U,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneScroll:R,onPaneContextMenu:Y,paneClickDistance:ee,nodeClickDistance:re,onEdgeContextMenu:Z,onEdgeMouseEnter:ne,onEdgeMouseMove:J,onEdgeMouseLeave:le,reconnectRadius:he,onReconnect:Ce,onReconnectStart:St,onReconnectEnd:co,noDragClassName:uo,noWheelClassName:fo,noPanClassName:sn,disableKeyboardA11y:an,nodeExtent:Ir,rfId:ho,viewport:Nt,onViewportChange:ln}){return ol(e),ol(t),Em(),gm(n),ym(Nt),v.jsx(Rg,{onPaneClick:F,onPaneMouseEnter:U,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneContextMenu:Y,onPaneScroll:R,paneClickDistance:ee,deleteKeyCode:N,selectionKeyCode:_,selectionOnDrag:m,selectionMode:x,onSelectionStart:u,onSelectionEnd:h,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:V,zoomOnScroll:A,zoomOnPinch:P,zoomOnDoubleClick:H,panOnScroll:$,panOnScrollSpeed:S,panOnScrollMode:O,panOnDrag:B,defaultViewport:j,translateExtent:D,minZoom:L,maxZoom:b,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:uo,noWheelClassName:fo,noPanClassName:sn,disableKeyboardA11y:an,onViewportChange:ln,isControlledViewport:!!Nt,children:v.jsxs(pm,{children:[v.jsx(fm,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Ce,onReconnectStart:St,onReconnectEnd:co,onlyRenderVisibleElements:z,onEdgeContextMenu:Z,onEdgeMouseEnter:ne,onEdgeMouseMove:J,onEdgeMouseLeave:le,reconnectRadius:he,defaultMarkerColor:k,noPanClassName:sn,disableKeyboardA11y:an,rfId:ho}),v.jsx(vm,{style:g,type:p,component:y,containerStyle:w}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(qg,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:re,onlyRenderVisibleElements:z,noPanClassName:sn,noDragClassName:uo,disableKeyboardA11y:an,nodeExtent:Ir,rfId:ho}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}rl.displayName="GraphView";const Sm=T.memo(rl),il=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:f}={})=>{const u=new Map,h=new Map,p=new Map,g=new Map,y=o??t??[],w=n??e??[],_=d??[0,0],m=f??Ft;Rs(p,g,y);const x=ar(w,u,h,{nodeOrigin:_,nodeExtent:m,elevateNodesOnSelect:!1});let C=[0,0,1];if(s&&r&&i){const E=Yt(u,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:M,y:N,zoom:z}=tr(E,r,i,l,c,a?.padding??.1);C=[M,N,z]}return{rfId:"1",width:0,height:0,transform:C,nodes:w,nodesInitialized:x,nodeLookup:u,parentLookup:h,edges:y,edgeLookup:g,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:Ft,nodeExtent:m,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:pt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...ds},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:_s,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:us}},Nm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f})=>Gp((u,h)=>{async function p(){const{nodeLookup:g,panZoom:y,fitViewOptions:w,fitViewResolver:_,width:m,height:x,minZoom:C,maxZoom:E}=h();y&&(await Rh({nodes:g,width:m,height:x,panZoom:y,minZoom:C,maxZoom:E},w),_?.resolve(!0),u({fitViewResolver:null}))}return{...il({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:o}),setNodes:g=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:_,elevateNodesOnSelect:m,fitViewQueued:x}=h(),C=ar(g,y,w,{nodeOrigin:_,nodeExtent:f,elevateNodesOnSelect:m,checkEquality:!0});x&&C?(p(),u({nodes:g,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0})):u({nodes:g,nodesInitialized:C})},setEdges:g=>{const{connectionLookup:y,edgeLookup:w}=h();Rs(y,w,g),u({edges:g})},setDefaultNodesAndEdges:(g,y)=>{if(g){const{setNodes:w}=h();w(g),u({hasDefaultNodes:!0})}if(y){const{setEdges:w}=h();w(y),u({hasDefaultEdges:!0})}},updateNodeInternals:g=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:_,domNode:m,nodeOrigin:x,nodeExtent:C,debug:E,fitViewQueued:M}=h(),{changes:N,updatedInternals:z}=ap(g,w,_,m,x,C);z&&(rp(w,_,{nodeOrigin:x,nodeExtent:C}),M?(p(),u({fitViewQueued:!1,fitViewOptions:void 0})):u({}),N?.length>0&&(E&&console.log("React Flow: trigger node changes",N),y?.(N)))},updateNodePositions:(g,y=!1)=>{const w=[],_=[],{nodeLookup:m,triggerNodeChanges:x}=h();for(const[C,E]of g){const M=m.get(C),N=!!(M?.expandParent&&M?.parentId&&E?.position),z={id:C,type:"position",position:N?{x:Math.max(0,E.position.x),y:Math.max(0,E.position.y)}:E.position,dragging:y};N&&M.parentId&&w.push({id:C,parentId:M.parentId,rect:{...E.internals.positionAbsolute,width:E.measured.width??0,height:E.measured.height??0}}),_.push(z)}if(w.length>0){const{parentLookup:C,nodeOrigin:E}=h(),M=cr(w,m,C,E);_.push(...M)}x(_)},triggerNodeChanges:g=>{const{onNodesChange:y,setNodes:w,nodes:_,hasDefaultNodes:m,debug:x}=h();if(g?.length){if(m){const C=ba(g,_);w(C)}x&&console.log("React Flow: trigger node changes",g),y?.(g)}},triggerEdgeChanges:g=>{const{onEdgesChange:y,setEdges:w,edges:_,hasDefaultEdges:m,debug:x}=h();if(g?.length){if(m){const C=Jt(g,_);w(C)}x&&console.log("React Flow: trigger edge changes",g),y?.(g)}},addSelectedNodes:g=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:_,triggerNodeChanges:m,triggerEdgeChanges:x}=h();if(y){const C=g.map(E=>et(E,!0));m(C);return}m(vt(_,new Set([...g]),!0)),x(vt(w))},addSelectedEdges:g=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:_,triggerNodeChanges:m,triggerEdgeChanges:x}=h();if(y){const C=g.map(E=>et(E,!0));x(C);return}x(vt(w,new Set([...g]))),m(vt(_,new Set,!0))},unselectNodesAndEdges:({nodes:g,edges:y}={})=>{const{edges:w,nodes:_,nodeLookup:m,triggerNodeChanges:x,triggerEdgeChanges:C}=h(),E=g||_,M=y||w,N=E.map(V=>{const j=m.get(V.id);return j&&(j.selected=!1),et(V.id,!1)}),z=M.map(V=>et(V.id,!1));x(N),C(z)},setMinZoom:g=>{const{panZoom:y,maxZoom:w}=h();y?.setScaleExtent([g,w]),u({minZoom:g})},setMaxZoom:g=>{const{panZoom:y,minZoom:w}=h();y?.setScaleExtent([w,g]),u({maxZoom:g})},setTranslateExtent:g=>{h().panZoom?.setTranslateExtent(g),u({translateExtent:g})},setPaneClickDistance:g=>{h().panZoom?.setClickDistance(g)},resetSelectedElements:()=>{const{edges:g,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:_,elementsSelectable:m}=h();if(!m)return;const x=y.reduce((E,M)=>M.selected?[...E,et(M.id,!1)]:E,[]),C=g.reduce((E,M)=>M.selected?[...E,et(M.id,!1)]:E,[]);w(x),_(C)},setNodeExtent:g=>{const{nodes:y,nodeLookup:w,parentLookup:_,nodeOrigin:m,elevateNodesOnSelect:x,nodeExtent:C}=h();g[0][0]===C[0][0]&&g[0][1]===C[0][1]&&g[1][0]===C[1][0]&&g[1][1]===C[1][1]||(ar(y,w,_,{nodeOrigin:m,nodeExtent:g,elevateNodesOnSelect:x,checkEquality:!1}),u({nodeExtent:g}))},panBy:g=>{const{transform:y,width:w,height:_,panZoom:m,translateExtent:x}=h();return lp({delta:g,panZoom:m,transform:y,translateExtent:x,width:w,height:_})},setCenter:async(g,y,w)=>{const{width:_,height:m,maxZoom:x,panZoom:C}=h();if(!C)return Promise.resolve(!1);const E=typeof w?.zoom<"u"?w.zoom:x;return await C.setViewport({x:_/2-g*E,y:m/2-y*E,zoom:E},{duration:w?.duration,ease:w?.ease,interpolate:w?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{u({connection:{...ds}})},updateConnection:g=>{u({connection:g})},reset:()=>u({...il()})}},Object.is);function sl({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:f,children:u}){const[h]=T.useState(()=>Nm({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:f}));return v.jsx(Up,{value:h,children:v.jsx(mg,{children:u})})}function Cm({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:u}){return T.useContext(Jn)?v.jsx(v.Fragment,{children:e}):v.jsx(sl,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:f,nodeExtent:u,children:e})}const km={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Tm({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:u,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:w,onNodeMouseEnter:_,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,onNodeDragStart:M,onNodeDrag:N,onNodeDragStop:z,onNodesDelete:V,onEdgesDelete:j,onDelete:D,onSelectionChange:L,onSelectionDragStart:b,onSelectionDrag:I,onSelectionDragStop:k,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:$,onBeforeDelete:S,connectionMode:O,connectionLineType:H=Le.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:U,deleteKeyCode:K="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:R=!1,selectionMode:Y=gt.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:re=qt()?"Meta":"Control",zoomActivationKeyCode:Z=qt()?"Meta":"Control",snapToGrid:ne,snapGrid:J,onlyRenderVisibleElements:le=!1,selectNodesOnDrag:he,nodesDraggable:Ce,autoPanOnNodeFocus:St,nodesConnectable:co,nodesFocusable:uo,nodeOrigin:fo=fa,edgesFocusable:sn,edgesReconnectable:an,elementsSelectable:Ir=!0,defaultViewport:ho=ag,minZoom:Nt=.5,maxZoom:ln=2,translateExtent:Dl=Ft,preventScrolling:My=!0,nodeExtent:Pr,defaultMarkerColor:Ay="#b1b1b7",zoomOnScroll:Iy=!0,zoomOnPinch:Py=!0,panOnScroll:Oy=!1,panOnScrollSpeed:Dy=.5,panOnScrollMode:zy=Ke.Free,zoomOnDoubleClick:$y=!0,panOnDrag:jy=!0,onPaneClick:Hy,onPaneMouseEnter:Ly,onPaneMouseMove:Vy,onPaneMouseLeave:Ry,onPaneScroll:By,onPaneContextMenu:Fy,paneClickDistance:zl=0,nodeClickDistance:Wy=0,children:Yy,onReconnect:Xy,onReconnectStart:Gy,onReconnectEnd:Uy,onEdgeContextMenu:qy,onEdgeDoubleClick:Zy,onEdgeMouseEnter:Ky,onEdgeMouseMove:Qy,onEdgeMouseLeave:Jy,reconnectRadius:e0=10,onNodesChange:t0,onEdgesChange:n0,noDragClassName:o0="nodrag",noWheelClassName:r0="nowheel",noPanClassName:$l="nopan",fitView:jl,fitViewOptions:Hl,connectOnClick:i0,attributionPosition:s0,proOptions:a0,defaultEdgeOptions:l0,elevateNodesOnSelect:c0,elevateEdgesOnSelect:u0,disableKeyboardA11y:Ll=!1,autoPanOnConnect:d0,autoPanOnNodeDrag:f0,autoPanSpeed:h0,connectionRadius:p0,isValidConnection:g0,onError:m0,style:y0,id:Vl,nodeDragThreshold:x0,connectionDragThreshold:w0,viewport:b0,onViewportChange:v0,width:_0,height:E0,colorMode:S0="light",debug:N0,onScroll:Rl,ariaLabelConfig:C0,...k0},T0){const Or=Vl||"1",M0=ug(S0),A0=T.useCallback(Bl=>{Bl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rl?.(Bl)},[Rl]);return v.jsx("div",{"data-testid":"rf__wrapper",...k0,onScroll:A0,style:{...y0,...km},ref:T0,className:ue(["react-flow",r,M0]),id:Vl,role:"application",children:v.jsxs(Cm,{nodes:e,edges:t,width:_0,height:E0,fitView:jl,fitViewOptions:Hl,minZoom:Nt,maxZoom:ln,nodeOrigin:fo,nodeExtent:Pr,children:[v.jsx(Sm,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:m,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:s,connectionLineType:H,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:U,selectionKeyCode:W,selectionOnDrag:R,selectionMode:Y,deleteKeyCode:K,multiSelectionKeyCode:re,panActivationKeyCode:ee,zoomActivationKeyCode:Z,onlyRenderVisibleElements:le,defaultViewport:ho,translateExtent:Dl,minZoom:Nt,maxZoom:ln,preventScrolling:My,zoomOnScroll:Iy,zoomOnPinch:Py,zoomOnDoubleClick:$y,panOnScroll:Oy,panOnScrollSpeed:Dy,panOnScrollMode:zy,panOnDrag:jy,onPaneClick:Hy,onPaneMouseEnter:Ly,onPaneMouseMove:Vy,onPaneMouseLeave:Ry,onPaneScroll:By,onPaneContextMenu:Fy,paneClickDistance:zl,nodeClickDistance:Wy,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:$,onReconnect:Xy,onReconnectStart:Gy,onReconnectEnd:Uy,onEdgeContextMenu:qy,onEdgeDoubleClick:Zy,onEdgeMouseEnter:Ky,onEdgeMouseMove:Qy,onEdgeMouseLeave:Jy,reconnectRadius:e0,defaultMarkerColor:Ay,noDragClassName:o0,noWheelClassName:r0,noPanClassName:$l,rfId:Or,disableKeyboardA11y:Ll,nodeExtent:Pr,viewport:b0,onViewportChange:v0}),v.jsx(cg,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:w,nodesDraggable:Ce,autoPanOnNodeFocus:St,nodesConnectable:co,nodesFocusable:uo,edgesFocusable:sn,edgesReconnectable:an,elementsSelectable:Ir,elevateNodesOnSelect:c0,elevateEdgesOnSelect:u0,minZoom:Nt,maxZoom:ln,nodeExtent:Pr,onNodesChange:t0,onEdgesChange:n0,snapToGrid:ne,snapGrid:J,connectionMode:O,translateExtent:Dl,connectOnClick:i0,defaultEdgeOptions:l0,fitView:jl,fitViewOptions:Hl,onNodesDelete:V,onEdgesDelete:j,onDelete:D,onNodeDragStart:M,onNodeDrag:N,onNodeDragStop:z,onSelectionDrag:I,onSelectionDragStart:b,onSelectionDragStop:k,onMove:d,onMoveStart:f,onMoveEnd:u,noPanClassName:$l,nodeOrigin:fo,rfId:Or,autoPanOnConnect:d0,autoPanOnNodeDrag:f0,autoPanSpeed:h0,onError:m0,connectionRadius:p0,isValidConnection:g0,selectNodesOnDrag:he,nodeDragThreshold:x0,connectionDragThreshold:w0,onBeforeDelete:S,paneClickDistance:zl,debug:N0,ariaLabelConfig:C0}),v.jsx(sg,{onSelectionChange:L}),Yy,v.jsx(tg,{proOptions:a0,position:s0}),v.jsx(eg,{rfId:Or,disableKeyboardA11y:Ll})]})})}var Mm=Sa(Tm);const Am=ye.error014();function Im({id:e,handleType:t,handleId:n,onConnect:o,onDisconnect:r}={}){const i=oo(),s=e??i;if(!s)throw new Error(Am);const a=T.useRef(null),l=oe(c=>c.connectionLookup.get(`${s}${t?n?`-${t}-${n}`:`-${t}`:""}`),jh);return T.useEffect(()=>{if(a.current&&a.current!==l){const c=l??new Map;hs(a.current,c,r),hs(c,a.current,o)}a.current=l??new Map},[l,o,r]),T.useMemo(()=>Array.from(l?.values()??[]),[l])}function vr(e){return oe(T.useCallback(n=>{const o=[],r=Array.isArray(e),i=r?e:[e];for(const s of i){const a=n.nodeLookup.get(s);a&&o.push({id:a.id,type:a.type,data:a.data})}return r?o:o[0]??null},[e]),cp)}function Pm({dimensions:e,lineWidth:t,variant:n,className:o}){return v.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ue(["react-flow__background-pattern",n,o])})}function Om({radius:e,className:t}){return v.jsx("circle",{cx:e,cy:e,r:e,className:ue(["react-flow__background-pattern","dots",t])})}var Be;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Be||(Be={}));const Dm={[Be.Dots]:1,[Be.Lines]:1,[Be.Cross]:6},zm=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function al({id:e,variant:t=Be.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:l,className:c,patternClassName:d}){const f=T.useRef(null),{transform:u,patternId:h}=oe(zm,ce),p=o||Dm[t],g=t===Be.Dots,y=t===Be.Cross,w=Array.isArray(n)?n:[n,n],_=[w[0]*u[2]||1,w[1]*u[2]||1],m=p*u[2],x=Array.isArray(i)?i:[i,i],C=y?[m,m]:_,E=[x[0]*u[2]||1+C[0]/2,x[1]*u[2]||1+C[1]/2],M=`${h}${e||""}`;return v.jsxs("svg",{className:ue(["react-flow__background",c]),style:{...l,...no,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[v.jsx("pattern",{id:M,x:u[0]%_[0],y:u[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:g?v.jsx(Om,{radius:m/2,className:d}):v.jsx(Pm,{dimensions:C,lineWidth:r,variant:t,className:d})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}al.displayName="Background";const $m=T.memo(al);function jm(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Hm(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Lm(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Vm(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Rm(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function io({children:e,className:t,...n}){return v.jsx("button",{type:"button",className:ue(["react-flow__controls-button",t]),...n,children:e})}const Bm=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ll({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:f="bottom-left",orientation:u="vertical","aria-label":h}){const p=ae(),{isInteractive:g,minZoomReached:y,maxZoomReached:w,ariaLabelConfig:_}=oe(Bm,ce),{zoomIn:m,zoomOut:x,fitView:C}=en(),E=()=>{m(),i?.()},M=()=>{x(),s?.()},N=()=>{C(r),a?.()},z=()=>{p.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),l?.(!g)},V=u==="horizontal"?"horizontal":"vertical";return v.jsxs(eo,{className:ue(["react-flow__controls",V,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??_["controls.ariaLabel"],children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(io,{onClick:E,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:w,children:v.jsx(jm,{})}),v.jsx(io,{onClick:M,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:y,children:v.jsx(Hm,{})})]}),n&&v.jsx(io,{className:"react-flow__controls-fitview",onClick:N,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:v.jsx(Lm,{})}),o&&v.jsx(io,{className:"react-flow__controls-interactive",onClick:z,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:g?v.jsx(Rm,{}):v.jsx(Vm,{})}),d]})}ll.displayName="Controls";const Fm=T.memo(ll);function Wm({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:f,selected:u,onClick:h}){const{background:p,backgroundColor:g}=i||{},y=s||p||g;return v.jsx("rect",{className:ue(["react-flow__minimap-node",{selected:u},c]),x:t,y:n,rx:d,ry:d,width:o,height:r,style:{fill:y,stroke:a,strokeWidth:l},shapeRendering:f,onClick:h?w=>h(w,e):void 0})}const Ym=T.memo(Wm),Xm=e=>e.nodes.map(t=>t.id),_r=e=>e instanceof Function?e:()=>e;function Gm({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=Ym,onClick:s}){const a=oe(Xm,ce),l=_r(t),c=_r(e),d=_r(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:a.map(u=>v.jsx(qm,{id:u,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:f},u))})}function Um({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:c,x:d,y:f,width:u,height:h}=oe(p=>{const{internals:g}=p.nodeLookup.get(e),y=g.userNode,{x:w,y:_}=g.positionAbsolute,{width:m,height:x}=je(y);return{node:y,x:w,y:_,width:m,height:x}},ce);return!c||c.hidden||!Es(c)?null:v.jsx(a,{x:d,y:f,width:u,height:h,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:l,id:c.id})}const qm=T.memo(Um);var Zm=T.memo(Gm);const Km=200,Qm=150,Jm=e=>!e.hidden,ey=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?bs(Yt(e.nodeLookup,{filter:Jm}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ty="react-flow__minimap-desc";function cl({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:f,position:u="bottom-right",onClick:h,onNodeClick:p,pannable:g=!1,zoomable:y=!1,ariaLabel:w,inversePan:_,zoomStep:m=1,offsetScale:x=5}){const C=ae(),E=T.useRef(null),{boundingRect:M,viewBB:N,rfId:z,panZoom:V,translateExtent:j,flowWidth:D,flowHeight:L,ariaLabelConfig:b}=oe(ey,ce),I=e?.width??Km,k=e?.height??Qm,A=M.width/I,P=M.height/k,$=Math.max(A,P),S=$*I,O=$*k,H=x*$,B=M.x-(S-M.width)/2-H,F=M.y-(O-M.height)/2-H,U=S+H*2,K=O+H*2,W=`${ty}-${z}`,R=T.useRef(0),Y=T.useRef();R.current=$,T.useEffect(()=>{if(E.current&&V)return Y.current=xp({domNode:E.current,panZoom:V,getTransform:()=>C.getState().transform,getViewScale:()=>R.current}),()=>{Y.current?.destroy()}},[V]),T.useEffect(()=>{Y.current?.update({translateExtent:j,width:D,height:L,inversePan:_,pannable:g,zoomStep:m,zoomable:y})},[g,y,_,m,j,D,L]);const ee=h?ne=>{const[J,le]=Y.current?.pointer(ne)||[0,0];h(ne,{x:J,y:le})}:void 0,re=p?T.useCallback((ne,J)=>{const le=C.getState().nodeLookup.get(J).internals.userNode;p(ne,le)},[]):void 0,Z=w??b["minimap.ariaLabel"];return v.jsx(eo,{position:u,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*$:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ue(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:I,height:k,viewBox:`${B} ${F} ${U} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:E,onClick:ee,children:[Z&&v.jsx("title",{id:W,children:Z}),v.jsx(Zm,{onClick:re,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-H},${F-H}h${U+H*2}v${K+H*2}h${-U-H*2}z
60
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}cl.displayName="MiniMap";const ny=T.memo(cl),oy=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,ry={[Je.Line]:"right",[Je.Handle]:"bottom-right"};function iy({nodeId:e,position:t,variant:n=Je.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:u,autoScale:h=!0,shouldResize:p,onResizeStart:g,onResize:y,onResizeEnd:w}){const _=oo(),m=typeof e=="string"?e:_,x=ae(),C=T.useRef(null),E=n===Je.Handle,M=oe(T.useCallback(oy(E&&h),[E,h]),ce),N=T.useRef(null),z=t??ry[n];T.useEffect(()=>{if(!(!C.current||!m))return N.current||(N.current=Dp({domNode:C.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:j,transform:D,snapGrid:L,snapToGrid:b,nodeOrigin:I,domNode:k}=x.getState();return{nodeLookup:j,transform:D,snapGrid:L,snapToGrid:b,nodeOrigin:I,paneDomNode:k}},onChange:(j,D)=>{const{triggerNodeChanges:L,nodeLookup:b,parentLookup:I,nodeOrigin:k}=x.getState(),A=[],P={x:j.x,y:j.y},$=b.get(m);if($&&$.expandParent&&$.parentId){const S=$.origin??k,O=j.width??$.measured.width??0,H=j.height??$.measured.height??0,B={id:$.id,parentId:$.parentId,rect:{width:O,height:H,...Ss({x:j.x??$.position.x,y:j.y??$.position.y},{width:O,height:H},$.parentId,b,S)}},F=cr([B],b,I,k);A.push(...F),P.x=j.x?Math.max(S[0]*O,j.x):void 0,P.y=j.y?Math.max(S[1]*H,j.y):void 0}if(P.x!==void 0&&P.y!==void 0){const S={id:m,type:"position",position:{...P}};A.push(S)}if(j.width!==void 0&&j.height!==void 0){const O={id:m,type:"dimensions",resizing:!0,setAttributes:u?u==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};A.push(O)}for(const S of D){const O={...S,type:"position"};A.push(O)}L(A)},onEnd:({width:j,height:D})=>{const L={id:m,type:"dimensions",resizing:!1,dimensions:{width:j,height:D}};x.getState().triggerNodeChanges([L])}})),N.current.update({controlPosition:z,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:f,resizeDirection:u,onResizeStart:g,onResize:y,onResizeEnd:w,shouldResize:p}),()=>{N.current?.destroy()}},[z,a,l,c,d,f,g,y,w,p]);const V=z.split("-");return v.jsx("div",{className:ue(["react-flow__resize-control","nodrag",...V,n,o]),ref:C,style:{...r,scale:M,...s&&{[E?"backgroundColor":"borderColor"]:s}},children:i})}const ul=T.memo(iy),Er=20;function tt(e,t){const n=t[e.dataType],o=e.allowInput??n.allowInput;return n.underlyingType==="number"?{id:ct(Er),name:e.name,handleColor:n.color,allowInput:o,type:"number",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:{id:ct(Er),name:e.name,handleColor:n.color,allowInput:n.underlyingType==="string"?o:!1,type:"string",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}}function dl(e,t){const n=ct(Er),o=e.inputs.map(r=>tt(r,t));return{id:n,name:e.name,inputs:o}}function Sr(e,t,n,o,r){const i=n[t],s=i.inputs.map(l=>"inputs"in l?dl(l,e):tt(l,e)),a=i.outputs.map(l=>tt(l,e));return{id:o,position:r,sourcePosition:q.Right,targetPosition:q.Left,type:"configurableNode",width:400,data:{name:i.name,headerColor:i.headerColor,inputs:s,outputs:a}}}function fl(e,t,n,o){const r=n[t];if(o)if(o.type==="input"){const i=r?.inputs?.[o.index1];if(!i)return;if(o.index2!==void 0&&"inputs"in i)return tt(i.inputs?.[o.index2],e);if(o.index2===void 0&&!("inputs"in i))return tt(i,e)}else return tt(r?.outputs?.[o.index1],e)}function sy(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=nt(o,e.nodes[t].data),a=nt(r,e.nodes[n].data),l=s?.dataType,c=a?.dataType,d=s?.inferredDataType,f=a?.inferredDataType;if(!l||!c)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(l.dataTypeObject.underlyingType!=="inferFromConnection"&&c.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};if(l.dataTypeObject.underlyingType==="inferFromConnection"&&c.dataTypeObject.underlyingType==="inferFromConnection"){if(!d&&!f)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"None of the handles are inferred, inference has no information to work with"}};if(d&&f)return{updatedNodes:e.nodes,validation:{isValid:!0}};if(d){const u=[...e.nodes];return u[n]={...e.nodes[n],data:Et(e.nodes[n].data,o,l.dataTypeUniqueId,{dataTypeToInferAs:d.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:u,validation:{isValid:!0}}}if(f){const u=[...e.nodes];return u[t]={...e.nodes[t],data:Et(e.nodes[t].data,r,c.dataTypeUniqueId,{dataTypeToInferAs:f.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:u,validation:{isValid:!0}}}}if(l.dataTypeObject.underlyingType==="inferFromConnection"){if(d)return{updatedNodes:e.nodes,validation:{isValid:!0}};const u=[...e.nodes];return u[t]={...e.nodes[t],data:Et(e.nodes[t].data,r,l.dataTypeUniqueId,{dataTypeToInferAs:c.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:u,validation:{isValid:!0}}}if(c.dataTypeObject.underlyingType==="inferFromConnection"){if(f)return{updatedNodes:e.nodes,validation:{isValid:!0}};const u=[...e.nodes];return u[n]={...e.nodes[n],data:Et(e.nodes[n].data,o,c.dataTypeUniqueId,{dataTypeToInferAs:l.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:u,validation:{isValid:!0}}}return{updatedNodes:e.nodes,validation:{isValid:!0}}}function ay(e,t,n,o,r,i){const s=e.nodes[t],a=e.nodes[n],l=nt(o,s.data),c=nt(r,a.data),d=l?.dataType,f=c?.dataType;if(!d||!f)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(d.dataTypeObject.underlyingType!=="inferFromConnection"&&f.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};let u=e.nodes;if(d.dataTypeObject.underlyingType==="inferFromConnection"){const h=Jo([s],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=Cr(s.data),y={};for(const _ of p)_.input.dataType?.dataTypeUniqueId===d.dataTypeUniqueId&&(y[_.input.id]=!0);for(const _ of g)_.output.dataType?.dataTypeUniqueId===d.dataTypeUniqueId&&(y[_.output.id]=!0);let w=!1;for(const _ of h)if(_.id!==i.id&&!(!_.sourceHandle||!_.targetHandle)){if(y[_.sourceHandle]){w=!0;break}if(y[_.targetHandle]){w=!0;break}}w||(u=[...e.nodes],u[t]={...e.nodes[t],data:Et(e.nodes[t].data,o,d.dataTypeUniqueId,{dataTypeToInferAs:d.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}if(f.dataTypeObject.underlyingType==="inferFromConnection"){const h=Jo([a],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=Cr(a.data),y={};for(const _ of p)_.input.dataType?.dataTypeUniqueId===f.dataTypeUniqueId&&(y[_.input.id]=!0);for(const _ of g)_.output.dataType?.dataTypeUniqueId===f.dataTypeUniqueId&&(y[_.output.id]=!0);let w=!1;for(const _ of h)if(_.id!==i.id&&!(!_.sourceHandle||!_.targetHandle)){if(y[_.sourceHandle]){w=!0;break}if(y[_.targetHandle]){w=!0;break}}w||(u=[...e.nodes],u[n]={...e.nodes[n],data:Et(e.nodes[n].data,r,f.dataTypeUniqueId,{dataTypeToInferAs:f.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}return{updatedNodes:u,validation:{isValid:!0}}}const ly=20;function hl(e,t,n,o,r){const i={id:ct(ly),source:e,target:n,sourceHandle:t,targetHandle:o,type:"configurableEdge"};if(Un(i,r.edges)===r.edges)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(r.enableTypeInference||r.enableComplexTypeChecking||r.allowedConversionsBetweenDataTypes))return{updatedNodes:r.nodes,updatedEdges:Un(i,r.edges),validation:{isValid:!0}};const a=r.nodes.findIndex(g=>g.id===e),l=r.nodes.findIndex(g=>g.id===n);if(a===-1||l===-1)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target node not found"}};const c=r.nodes[a],d=r.nodes[l],f=nn(t,c.data),u=nn(o,d.data);if(!f||!u)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let h=r.nodes,p={isValid:!0};if(r.enableTypeInference){const{updatedNodes:g,validation:y}=sy(r,a,l,f,u,i);h=g,p=y}return{updatedNodes:h,updatedEdges:Un(i,r.edges),validation:p}}function pl(e,t,n){if(Jt([n],t.edges)===t.edges)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(t.enableTypeInference||t.enableComplexTypeChecking||t.allowedConversionsBetweenDataTypes))return{updatedNodes:t.nodes,updatedEdges:Jt([n],t.edges),validation:{isValid:!0}};const r=t.nodes.findIndex(u=>u.id===e.source),i=t.nodes.findIndex(u=>u.id===e.target);if(r===-1||i===-1)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target node not found"}};if(!e.sourceHandle||!e.targetHandle)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=t.nodes[r],a=t.nodes[i],l=nn(e.sourceHandle,s.data),c=nn(e.targetHandle,a.data);if(!l||!c)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let d=t.nodes,f={isValid:!0};if(t.enableTypeInference){const{updatedNodes:u,validation:h}=ay(t,r,i,l,c,e);d=u,f=h}return{updatedNodes:d,updatedEdges:Jt([n],t.edges),validation:f}}const gl=20,ve=["ADD_NODE","ADD_NODE_AND_SELECT","UPDATE_NODE_BY_REACT_FLOW","UPDATE_EDGES_BY_REACT_FLOW","ADD_EDGE_BY_REACT_FLOW","UPDATE_INPUT_VALUE"],Pe={[ve[0]]:ve[0],[ve[1]]:ve[1],[ve[2]]:ve[2],[ve[3]]:ve[3],[ve[4]]:ve[4],[ve[5]]:ve[5]};function ml(e,t){return nu(e,o=>{switch(t.type){case Pe.ADD_NODE:const r=t.payload.type,i=ct(gl),s=t.payload.position,a=Sr(o.dataTypes,r,o.typeOfNodes,i,s);o.nodes.push(a),o.nodeIdToNodeType[i]=r;break;case Pe.ADD_NODE_AND_SELECT:const l=t.payload.type,c=ct(gl),d=t.payload.position,f=Sr(o.dataTypes,l,o.typeOfNodes,c,d);o.nodes=o.nodes.map(x=>({...x,selected:!1})),o.nodes.push({...f,selected:!0}),o.nodeIdToNodeType[c]=l;break;case Pe.UPDATE_NODE_BY_REACT_FLOW:const u=t.payload.changes;o.nodes=ba(u,o.nodes);break;case Pe.UPDATE_EDGES_BY_REACT_FLOW:const h=t.payload.changes;for(const x of h){if(x.type!=="remove"){o.edges=Jt([x],o.edges);continue}const{id:C}=x,E=o.edges.find(N=>N.id===C);if(!E)continue;const M=pl(E,o,x);M.validation.isValid&&(o.edges=M.updatedEdges,o.nodes=M.updatedNodes)}break;case Pe.ADD_EDGE_BY_REACT_FLOW:const p=t.payload.edge,{sourceHandle:g,targetHandle:y,source:w,target:_}=p;if(!w||!_||!g||!y)break;const m=hl(w,g,_,y,o);if(!m.validation.isValid)break;o.edges=m.updatedEdges,o.nodes=m.updatedNodes;break}})}function nn(e,t){const n=t?.inputs instanceof Array?t?.inputs:[],r=(t?.outputs instanceof Array?t?.outputs:[]).findIndex(a=>a.id===e);if(r!==-1)return{type:"output",index1:r,index2:void 0};let i;const s=n.findIndex(a=>{if("inputs"in a){const l=a.inputs.findIndex(c=>c.id===e);return l!==-1?(i=l,!0):!1}else return a.id===e});if(s!==-1)return{type:"input",index1:s,index2:i}}function nt(e,t){if(e)if(e.type==="input"){const n=t?.inputs?.[e.index1];if(!n)return;if(e.index2!==void 0&&"inputs"in n)return n.inputs?.[e.index2];if(e.index2===void 0&&!("inputs"in n))return n}else return t?.outputs?.[e.index1]}function Nr(e,t){const n=nn(e,t);return nt(n,t)}function cy(e,t,n){return t.map(o=>o.id===e?{...o,...n}:o)}function uy(e,t,n){return"inputs"in t?{...t,inputs:cy(e,t.inputs,n)}:t.id===e?{...t,...n}:t}function yl(e,t,n){return{...t,inputs:(t.inputs||[]).map(r=>uy(e,r,n))}}function dy(e,t,n){if(e.type!="input")return t;const o=nt(e,t);if(!o)return t;const r={...o,...n},i=[...t.inputs||[]],s=t?.inputs?.[e.index1];if(!s)return t;if(e.index2!==void 0&&"inputs"in s){const l=[...s.inputs||[]];l[e.index2]=r,i[e.index1]={...s,inputs:l}}else e.index2===void 0&&!("inputs"in s)&&(i[e.index1]=r);return{...t,inputs:i}}function fy(e,t,n){if(e.type!="output")return t;const o=nt(e,t);if(!o)return t;const r={...o,...n},i=[...t.outputs||[]];return i[e.index1]=r,{...t,outputs:i}}function hy(e){let t=[];return e.inputs?.forEach((n,o)=>{"inputs"in n?n.inputs.forEach((r,i)=>{t.push({input:r,handleIndices:{type:"input",index1:o,index2:i}})}):t.push({input:n,handleIndices:{type:"input",index1:o,index2:void 0}})}),t}function py(e){let t=[];return e.outputs?.forEach((n,o)=>{t.push({output:n,handleIndices:{type:"output",index1:o,index2:void 0}})}),t}function Cr(e){return{inputsAndIndices:hy(e),outputsAndIndices:py(e)}}function xl(e,t,n,o,r,i){const s=o?fl(r,o.connectedNodeType,i,n):void 0;let a;if(s){const{id:l,name:c,dataType:d,...f}=s;a=f}return t.type==="input"?dy(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}}):fy(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}})}function Et(e,t,n,o,r,i){const{inputsAndIndices:s,outputsAndIndices:a}=Cr(e);let l=e;for(const c of s)c.input.dataType?.dataTypeUniqueId===n&&(l=xl(l,c.handleIndices,t,o,r,i));for(const c of a)c.output.dataType?.dataTypeUniqueId===n&&(l=xl(l,c.handleIndices,t,o,r,i));return l}const kr=T.forwardRef(({id:e,sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:i,targetPosition:s,...a},l)=>{const[c]=Gn({sourceX:t,sourceY:n,sourcePosition:i,targetX:o,targetY:r,targetPosition:s}),d=ae(),[f,u]=T.useState(!0),h=T.useRef(null);T.useEffect(()=>{const M=d.getState().domNode;if(!M)return;const N=document.getElementById(e);if(!N)return;const z=new IntersectionObserver(V=>{const j=V.find(D=>D.target.id===e);j&&u(D=>j.isIntersecting)},{root:M,threshold:1,rootMargin:"20px"});return z.observe(N),h.current=z,()=>{h.current&&(h.current.disconnect(),h.current=null)}},[d.getState().domNode]);const p=vr(a.source||""),g=T.useMemo(()=>!a.source||!p?void 0:Nr(a.sourceHandleId||"",p?.data)?.handleColor??"#A1A1A1",[a.source,p]),y=vr(a.target||""),w=T.useMemo(()=>!a.target||!y?void 0:Nr(a.targetHandleId||"",y?.data)?.handleColor??"#A1A1A1",[a.target,y]),{label:_,labelStyle:m,markerStart:x,markerEnd:C,interactionWidth:E}=a;return v.jsxs(v.Fragment,{children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:`linear-gradient-edge-${e}`,x1:t,y1:n,x2:o,y2:r,gradientUnits:"userSpaceOnUse",children:[v.jsx("stop",{stopColor:g,offset:"0"}),v.jsx("stop",{stopColor:w,offset:"1"})]})}),v.jsx(_t,{id:e,path:c,label:_,labelStyle:m,markerEnd:C,markerStart:x,interactionWidth:E,className:ie("!stroke-7 in-[g.selected]:brightness-150",!f&&"opacity-25"),style:{stroke:`url(#${`linear-gradient-edge-${e}`})`},focusable:!0})]})});kr.displayName="ConfigurableEdge";function wl(e,t,n=!0,o=!1){const r=e!==null?"current"in e?e.current:e:null,i=T.useCallback(s=>{if(!r)return;let a=!0;if(n&&s.target instanceof Node&&!r.contains(s.target))a=!1;else if(o){const l="clientX"in s?{x:s.clientX,y:s.clientY}:{x:s.touches[0].clientX,y:s.touches[0].clientY},c=r.getBoundingClientRect();ni(l,c)||(a=!1)}a||t()},[r,t,n,o]);T.useEffect(()=>(document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}),[r,i])}const on=T.forwardRef(({placeholder:e="Input",className:t,...n},o)=>{const r=T.useMemo(()=>n.allowOnlyNumbers&&n.value!==void 0?vo(n.value,n.numberOfDecimals??5):n.value?.toString(),[n.value,n.allowOnlyNumbers,n.numberOfDecimals]),[i,s]=T.useState(r??""),[a,l]=T.useState(null),c=n.value??i,[d,f]=T.useState(c.toString());function u(p){n.allowOnlyNumbers&&/[^0-9\.\-]/.test(p)||f(p)}function h(){if(n.allowOnlyNumbers){const p=oi(d||c.toString()),g=vo(p,n.numberOfDecimals??5);s(g),n.onChange?.(p),f(g)}else s(d),n.onChange?.(d),f(d)}return wl(a,()=>h()),v.jsx("input",{type:"text",className:ie("h-[44px] rounded-md text-primary-white bg-primary-black font-main px-4 text-[27px] leading-[27px] outline-none focus-visible:!outline-none border-secondary-dark-gray border w-max min-w-0 placeholder:text-[#6B6B6B]",t),placeholder:e,size:5,ref:p=>{l(p),typeof o=="function"?o(p):o&&(o.current=p)},value:d,onChange:p=>u(p.target.value),onKeyDown:p=>{p.key==="Enter"&&h()},onMouseMove:p=>{p.preventDefault(),p.stopPropagation()},onBlur:p=>{p.preventDefault(),p.stopPropagation(),h()}})});on.displayName="Input";function bl({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:o,lineClassName:r,lineStyle:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,autoScale:u=!0,shouldResize:h,onResizeStart:p,onResize:g,onResizeEnd:y,linePosition:w=["left","right"],handlePosition:_=[],resizeDirection:m="horizontal"}){return t?v.jsxs(v.Fragment,{children:[w.map(x=>v.jsx(ul,{className:ie("!border-none",x==="left"||x==="right"?"!w-4":"!h-4",r),style:i,nodeId:e,position:x,variant:Je.Line,color:s,minWidth:a,minHeight:l,maxWidth:c,maxHeight:d,onResizeStart:p,keepAspectRatio:f,autoScale:u,shouldResize:h,onResize:g,onResizeEnd:y,resizeDirection:m},x)),_.map(x=>v.jsx(ul,{className:n,style:o,nodeId:e,position:x,color:s,minWidth:a,minHeight:l,maxWidth:c,maxHeight:d,onResizeStart:p,keepAspectRatio:f,autoScale:u,shouldResize:h,onResize:g,onResizeEnd:y,resizeDirection:m},x))]}):null}function vl({onMove:e,onClick:t,clickThreshold:n=2,enabled:o=!0,preventDefaultAndStopPropagation:r=!0}={}){const[i,s]=T.useState(!1),[a,l]=T.useState(null),c=T.useRef(null),d=T.useRef(null),f=T.useCallback(u=>{l(u)},[]);return T.useEffect(()=>{if(!a||!o)return;const u=h=>{r&&(h.preventDefault(),h.stopPropagation()),c.current={x:h.clientX,y:h.clientY},d.current={width:a.clientWidth,height:a.clientHeight},s(!0);const p=y=>{r&&(y.preventDefault(),y.stopPropagation()),document.removeEventListener("mouseup",p),document.removeEventListener("mousemove",g),s(!1),c.current&&Math.sqrt((y.clientX-c.current.x)**2+(y.clientY-c.current.y)**2)<n&&t?.()},g=y=>{r&&(y.preventDefault(),y.stopPropagation());const w=y.movementX,_=y.movementY,m=d.current?.width||1,x=d.current?.height||1,C=w/m,E=_/x;e?.(w,_,C,E,m,x)};document.addEventListener("mouseup",p),document.addEventListener("mousemove",g)};return a.addEventListener("mousedown",u),()=>{a.removeEventListener("mousedown",u)}},[a,o,e,t,n,r]),{isDragging:i,dragRef:f}}/**
59
+ `)),u=l.reduce((h,d)=>h.concat(...d),[]);return[l,u]}return[[],[]]},[e]);return O.useEffect(()=>{const c=t?.target??yc,l=t?.actInsideInputWithModifier??!0;if(e!==null){const u=f=>{if(r.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!r.current||r.current&&!l)&&Ta(f))return!1;const g=wc(f.code,a);if(i.current.add(f[g]),xc(s,i.current,!1)){const x=f.composedPath?.()?.[0]||f.target,b=x?.nodeName==="BUTTON"||x?.nodeName==="A";t.preventDefault!==!1&&(r.current||!b)&&f.preventDefault(),o(!0)}},h=f=>{const p=wc(f.code,a);xc(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(f[p]),f.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",u),c?.addEventListener("keyup",h),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{c?.removeEventListener("keydown",u),c?.removeEventListener("keyup",h),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function xc(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function wc(e,t){return t.includes(e)?"code":"key"}const Qm=()=>{const e=ce();return O.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),c=jr(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:c}=s.getBoundingClientRect(),l={x:t.x-a,y:t.y-c},u=n.snapGrid??r,h=n.snapToGrid??i;return pn(l,o,h,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=po(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function bc(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const c of s)Jm(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Jm(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function vc(e,t){return bc(e,t)}function wn(e,t){return bc(e,t)}function ht(e,t){return{id:e,type:"select",selected:t}}function Lt(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(ht(i.id,s)))}return o}function Ec({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function _c(e){return{id:e.id,type:"remove"}}const Sc=e=>Sg(e),ey=e=>ma(e);function Cc(e){return O.forwardRef(e)}const ty=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Nc(e){const[t,n]=O.useState(BigInt(0)),[o]=O.useState(()=>ny(()=>n(r=>r+BigInt(1))));return ty(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function ny(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const kc=O.createContext(null);function oy({children:e}){const t=ce(),n=O.useCallback(a=>{const{nodes:c=[],setNodes:l,hasDefaultNodes:u,onNodesChange:h,nodeLookup:d,fitViewQueued:f}=t.getState();let p=c;for(const x of a)p=typeof x=="function"?x(p):x;const g=Ec({items:p,lookup:d});u&&l(p),g.length>0?h?.(g):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:x,nodes:b,setNodes:v}=t.getState();x&&v(b)})},[]),o=Nc(n),r=O.useCallback(a=>{const{edges:c=[],setEdges:l,hasDefaultEdges:u,onEdgesChange:h,edgeLookup:d}=t.getState();let f=c;for(const p of a)f=typeof p=="function"?p(f):p;u?l(f):h&&h(Ec({items:f,lookup:d}))},[]),i=Nc(r),s=O.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return C.jsx(kc.Provider,{value:s,children:e})}function ry(){const e=O.useContext(kc);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iy=e=>!!e.panZoom;function bn(){const e=Qm(),t=ce(),n=ry(),o=ie(iy),r=O.useMemo(()=>{const i=h=>t.getState().nodeLookup.get(h),s=h=>{n.nodeQueue.push(h)},a=h=>{n.edgeQueue.push(h)},c=h=>{const{nodeLookup:d,nodeOrigin:f}=t.getState(),p=Sc(h)?h:d.get(h.id),g=p.parentId?Ca(p.position,p.measured,p.parentId,d,f):p.position,x={...p,position:g,width:p.measured?.width??p.width,height:p.measured?.height??p.height};return Pt(x)},l=(h,d,f={replace:!1})=>{s(p=>p.map(g=>{if(g.id===h){const x=typeof d=="function"?d(g):d;return f.replace&&Sc(x)?x:{...g,...x}}return g}))},u=(h,d,f={replace:!1})=>{a(p=>p.map(g=>{if(g.id===h){const x=typeof d=="function"?d(g):d;return f.replace&&ey(x)?x:{...g,...x}}return g}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>i(h)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(d=>({...d}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:s,setEdges:a,addNodes:h=>{const d=Array.isArray(h)?h:[h];n.nodeQueue.push(f=>[...f,...d])},addEdges:h=>{const d=Array.isArray(h)?h:[h];n.edgeQueue.push(f=>[...f,...d])},toObject:()=>{const{nodes:h=[],edges:d=[],transform:f}=t.getState(),[p,g,x]=f;return{nodes:h.map(b=>({...b})),edges:d.map(b=>({...b})),viewport:{x:p,y:g,zoom:x}}},deleteElements:async({nodes:h=[],edges:d=[]})=>{const{nodes:f,edges:p,onNodesDelete:g,onEdgesDelete:x,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:k,edges:N}=await Mg({nodesToRemove:h,edgesToRemove:d,nodes:f,edges:p,onBeforeDelete:w}),I=N.length>0,M=k.length>0;if(I){const L=N.map(_c);x?.(N),v(L)}if(M){const L=k.map(_c);g?.(k),b(L)}return(M||I)&&m?.({nodes:k,edges:N}),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(h,d=!0,f)=>{const p=Ea(h),g=p?h:c(h),x=f!==void 0;return g?(f||t.getState().nodes).filter(b=>{const v=t.getState().nodeLookup.get(b.id);if(v&&!p&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const m=Pt(x?b:v),w=fn(m,g);return d&&w>0||w>=m.width*m.height||w>=g.width*g.height}):[]},isNodeIntersecting:(h,d,f=!0)=>{const g=Ea(h)?h:c(h);if(!g)return!1;const x=fn(g,d);return f&&x>0||x>=g.width*g.height},updateNode:l,updateNodeData:(h,d,f={replace:!1})=>{l(h,p=>{const g=typeof d=="function"?d(p):d;return f.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},f)},updateEdge:u,updateEdgeData:(h,d,f={replace:!1})=>{u(h,p=>{const g=typeof d=="function"?d(p):d;return f.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},f)},getNodesBounds:h=>{const{nodeLookup:d,nodeOrigin:f}=t.getState();return Ng(h,{nodeLookup:d,nodeOrigin:f})},getHandleConnections:({type:h,id:d,nodeId:f})=>Array.from(t.getState().connectionLookup.get(`${f}-${h}${d?`-${d}`:""}`)?.values()??[]),getNodeConnections:({type:h,handleId:d,nodeId:f})=>Array.from(t.getState().connectionLookup.get(`${f}${h?d?`-${h}-${d}`:`-${h}`:""}`)?.values()??[]),fitView:async h=>{const d=t.getState().fitViewResolver??Pg();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:d}),n.nodeQueue.push(f=>[...f]),d.promise}}},[]);return O.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Tc=e=>e.selected,sy=typeof window<"u"?window:void 0;function ay({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ce(),{deleteElements:o}=bn(),r=xn(e,{actInsideInputWithModifier:!1}),i=xn(t,{target:sy});O.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Tc),edges:s.filter(Tc)}),n.setState({nodesSelectionActive:!1})}},[r]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function cy(e){const t=ce();O.useEffect(()=>{const n=()=>{if(!e.current)return!1;const o=Vr(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",xe.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const Co={position:"absolute",width:"100%",height:"100%",top:0,left:0},ly=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function uy({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=ut.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:h,zoomActivationKeyCode:d,preventScrolling:f=!0,children:p,noWheelClassName:g,noPanClassName:x,onViewportChange:b,isControlledViewport:v,paneClickDistance:m}){const w=ce(),k=O.useRef(null),{userSelectionActive:N,lib:I}=ie(ly,de),M=xn(d),L=O.useRef();cy(k);const H=O.useCallback(j=>{b?.({x:j[0],y:j[1],zoom:j[2]}),v||w.setState({transform:j})},[b,v]);return O.useEffect(()=>{if(k.current){L.current=pm({domNode:k.current,minZoom:u,maxZoom:h,translateExtent:l,viewport:c,paneClickDistance:m,onDraggingChange:y=>w.setState({paneDragging:y}),onPanZoomStart:(y,A)=>{const{onViewportChangeStart:T,onMoveStart:S}=w.getState();S?.(y,A),T?.(A)},onPanZoom:(y,A)=>{const{onViewportChange:T,onMove:S}=w.getState();S?.(y,A),T?.(A)},onPanZoomEnd:(y,A)=>{const{onViewportChangeEnd:T,onMoveEnd:S}=w.getState();S?.(y,A),T?.(A)}});const{x:j,y:R,zoom:$}=L.current.getViewport();return w.setState({panZoom:L.current,transform:[j,R,$],domNode:k.current.closest(".react-flow")}),()=>{L.current?.destroy()}}},[]),O.useEffect(()=>{L.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:M,preventScrolling:f,noPanClassName:x,userSelectionActive:N,noWheelClassName:g,lib:I,onTransformChange:H})},[e,t,n,o,r,i,s,a,M,f,x,N,g,I,H]),C.jsx("div",{className:"react-flow__renderer",ref:k,style:Co,children:p})}const dy=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function fy(){const{userSelectionActive:e,userSelectionRect:t}=ie(dy,de);return e&&t?C.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const oi=(e,t)=>n=>{n.target===t.current&&e?.(n)},hy=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function py({isSelecting:e,selectionKeyPressed:t,selectionMode:n=At.Full,panOnDrag:o,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:h,onPaneMouseLeave:d,children:f}){const p=ce(),{userSelectionActive:g,elementsSelectable:x,dragging:b,connectionInProgress:v}=ie(hy,de),m=x&&(e||g),w=O.useRef(null),k=O.useRef(),N=O.useRef(new Set),I=O.useRef(new Set),M=O.useRef(!1),L=O.useRef(!1),H=S=>{if(M.current||v){M.current=!1;return}a?.(S),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},j=S=>{if(Array.isArray(o)&&o?.includes(2)){S.preventDefault();return}c?.(S)},R=l?S=>l(S):void 0,$=S=>{const{resetSelectedElements:E,domNode:P}=p.getState();if(k.current=P?.getBoundingClientRect(),!x||!e||S.button!==0||S.target!==w.current||!k.current)return;S.target?.setPointerCapture?.(S.pointerId),L.current=!0,M.current=!1;const{x:_,y:D}=$e(S.nativeEvent,k.current);E(),p.setState({userSelectionRect:{width:0,height:0,startX:_,startY:D,x:_,y:D}}),i?.(S)},y=S=>{const{userSelectionRect:E,transform:P,nodeLookup:_,edgeLookup:D,connectionLookup:z,triggerNodeChanges:F,triggerEdgeChanges:B,defaultEdgeOptions:Y}=p.getState();if(!k.current||!E)return;M.current=!0;const{x:K,y:W}=$e(S.nativeEvent,k.current),{startX:V,startY:X}=E,J={startX:V,startY:X,x:K<V?K:V,y:W<X?W:X,width:Math.abs(K-V),height:Math.abs(W-X)},te=N.current,Z=I.current;N.current=new Set($r(_,J,P,n===At.Partial,!0).map(ne=>ne.id)),I.current=new Set;const oe=Y?.selectable??!0;for(const ne of N.current){const ue=z.get(ne);if(ue)for(const{edgeId:ge}of ue.values()){const Pe=D.get(ge);Pe&&(Pe.selectable??oe)&&I.current.add(ge)}}if(!Na(te,N.current)){const ne=Lt(_,N.current,!0);F(ne)}if(!Na(Z,I.current)){const ne=Lt(D,I.current);B(ne)}p.setState({userSelectionRect:J,userSelectionActive:!0,nodesSelectionActive:!1})},A=S=>{if(S.button!==0||!L.current)return;S.target?.releasePointerCapture?.(S.pointerId);const{userSelectionRect:E}=p.getState();!g&&E&&S.target===w.current&&H?.(S),p.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:N.current.size>0}),s?.(S),(t||r)&&(M.current=!1),L.current=!1},T=o===!0||Array.isArray(o)&&o.includes(0);return C.jsxs("div",{className:fe(["react-flow__pane",{draggable:T,dragging:b,selection:e}]),onClick:m?void 0:oi(H,w),onContextMenu:oi(j,w),onWheel:oi(R,w),onPointerEnter:m?void 0:u,onPointerDown:m?$:h,onPointerMove:m?y:h,onPointerUp:m?A:void 0,onPointerLeave:d,ref:w,style:Co,children:[f,C.jsx(fy,{})]})}function ri({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:c}=t.getState(),l=a.get(e);if(!l){c?.("012",xe.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Mc({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=ce(),[c,l]=O.useState(!1),u=O.useRef();return O.useEffect(()=>{u.current=Jg({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{ri({id:h,store:a,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),O.useEffect(()=>{if(t)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{u.current?.destroy()}},[n,o,t,i,e,r]),c}const gy=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ac(){const e=ce();return O.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:c,nodeLookup:l,nodeOrigin:u}=e.getState(),h=new Map,d=gy(s),f=r?i[0]:5,p=r?i[1]:5,g=n.direction.x*f*n.factor,x=n.direction.y*p*n.factor;for(const[,b]of l){if(!d(b))continue;let v={x:b.internals.positionAbsolute.x+g,y:b.internals.positionAbsolute.y+x};r&&(v=hn(v,i));const{position:m,positionAbsolute:w}=ya({nodeId:b.id,nextPosition:v,nodeLookup:l,nodeExtent:o,nodeOrigin:u,onError:a});b.position=m,b.internals.positionAbsolute=w,h.set(b.id,b)}c(h)},[])}const ii=O.createContext(null),my=ii.Provider;ii.Consumer;const No=()=>O.useContext(ii),yy=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),xy=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:c,isValid:l}=s,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Mt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&l}};function wy({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:l,onMouseDown:u,onTouchStart:h,...d},f){const p=s||null,g=e==="target",x=ce(),b=No(),{connectOnClick:v,noPanClassName:m,rfId:w}=ie(yy,de),{connectingFrom:k,connectingTo:N,clickConnecting:I,isPossibleEndHandle:M,connectionInProcess:L,clickConnectionInProcess:H,valid:j}=ie(xy(b,p,e),de);b||x.getState().onError?.("010",xe.error010());const R=A=>{const{defaultEdgeOptions:T,onConnect:S,hasDefaultEdges:E}=x.getState(),P={...T,...A};if(E){const{edges:_,setEdges:D}=x.getState();D(yo(P,_))}S?.(P),a?.(P)},$=A=>{if(!b)return;const T=Ma(A.nativeEvent);if(r&&(T&&A.button===0||!T)){const S=x.getState();Zr.onPointerDown(A.nativeEvent,{handleDomNode:A.currentTarget,autoPanOnConnect:S.autoPanOnConnect,connectionMode:S.connectionMode,connectionRadius:S.connectionRadius,domNode:S.domNode,nodeLookup:S.nodeLookup,lib:S.lib,isTarget:g,handleId:p,nodeId:b,flowId:S.rfId,panBy:S.panBy,cancelConnection:S.cancelConnection,onConnectStart:S.onConnectStart,onConnectEnd:S.onConnectEnd,updateConnection:S.updateConnection,onConnect:R,isValidConnection:n||S.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:S.autoPanSpeed,dragThreshold:S.connectionDragThreshold})}T?u?.(A):h?.(A)},y=A=>{const{onClickConnectStart:T,onClickConnectEnd:S,connectionClickStartHandle:E,connectionMode:P,isValidConnection:_,lib:D,rfId:z,nodeLookup:F,connection:B}=x.getState();if(!b||!E&&!r)return;if(!E){T?.(A.nativeEvent,{nodeId:b,handleId:p,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:b,type:e,id:p}});return}const Y=ka(A.target),K=n||_,{connection:W,isValid:V}=Zr.isValid(A.nativeEvent,{handle:{nodeId:b,id:p,type:e},connectionMode:P,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:K,flowId:z,doc:Y,lib:D,nodeLookup:F});V&&W&&R(W);const X=structuredClone(B);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,S?.(A,X),x.setState({connectionClickStartHandle:null})};return C.jsx("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${w}-${b}-${p}-${e}`,className:fe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,l,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:i,clickconnecting:I,connectingfrom:k,connectingto:N,valid:j,connectionindicator:o&&(!L||M)&&(L||H?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:v?y:void 0,ref:f,...d,children:c})}const vn=O.memo(Cc(wy));function by({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return C.jsxs(C.Fragment,{children:[e?.label,C.jsx(vn,{type:"source",position:n,isConnectable:t})]})}function vy({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:o=Q.Bottom}){return C.jsxs(C.Fragment,{children:[C.jsx(vn,{type:"target",position:n,isConnectable:t}),e?.label,C.jsx(vn,{type:"source",position:o,isConnectable:t})]})}function Ey(){return null}function _y({data:e,isConnectable:t,targetPosition:n=Q.Top}){return C.jsxs(C.Fragment,{children:[C.jsx(vn,{type:"target",position:n,isConnectable:t}),e?.label]})}const ko={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ic={input:by,default:vy,output:_y,group:Ey};function Sy(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const Cy=e=>{const{width:t,height:n,x:o,y:r}=dn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Me(t)?t:null,height:Me(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Ny({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=ce(),{width:r,height:i,transformString:s,userSelectionActive:a}=ie(Cy,de),c=Ac(),l=O.useRef(null);if(O.useEffect(()=>{n||l.current?.focus({preventScroll:!0})},[n]),Mc({nodeRef:l}),a||!r||!i)return null;const u=e?d=>{const f=o.getState().nodes.filter(p=>p.selected);e(d,f)}:void 0,h=d=>{Object.prototype.hasOwnProperty.call(ko,d.key)&&(d.preventDefault(),c({direction:ko[d.key],factor:d.shiftKey?4:1}))};return C.jsx("div",{className:fe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:C.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:i}})})}const Pc=typeof window<"u"?window:void 0,ky=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Oc({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:h,onSelectionStart:d,onSelectionEnd:f,multiSelectionKeyCode:p,panActivationKeyCode:g,zoomActivationKeyCode:x,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:I,panOnDrag:M,defaultViewport:L,translateExtent:H,minZoom:j,maxZoom:R,preventScrolling:$,onSelectionContextMenu:y,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:S,onViewportChange:E,isControlledViewport:P}){const{nodesSelectionActive:_,userSelectionActive:D}=ie(ky),z=xn(l,{target:Pc}),F=xn(g,{target:Pc}),B=F||M,Y=F||w,K=u&&B!==!0,W=z||D||K;return ay({deleteKeyCode:c,multiSelectionKeyCode:p}),C.jsx(uy,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:I,panOnDrag:!z&&B,defaultViewport:L,translateExtent:H,minZoom:j,maxZoom:R,zoomActivationKeyCode:x,preventScrolling:$,noWheelClassName:A,noPanClassName:T,onViewportChange:E,isControlledViewport:P,paneClickDistance:a,children:C.jsxs(py,{onSelectionStart:d,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!W,selectionMode:h,selectionKeyPressed:z,selectionOnDrag:K,children:[e,_&&C.jsx(Ny,{onSelectionContextMenu:y,noPanClassName:T,disableKeyboardA11y:S})]})})}Oc.displayName="FlowRenderer";const Ty=O.memo(Oc),My=e=>t=>e?$r(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Ay(e){return ie(O.useCallback(My(e),[e]),de)}const Iy=e=>e.updateNodeInternals;function Py(){const e=ie(Iy),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return O.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Oy({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=ce(),i=O.useRef(null),s=O.useRef(null),a=O.useRef(e.sourcePosition),c=O.useRef(e.targetPosition),l=O.useRef(t),u=n&&!!e.internals.handleBounds;return O.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),O.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),O.useEffect(()=>{if(i.current){const h=l.current!==t,d=a.current!==e.sourcePosition,f=c.current!==e.targetPosition;(h||d||f)&&(l.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Dy({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:h,noDragClassName:d,noPanClassName:f,disableKeyboardA11y:p,rfId:g,nodeTypes:x,nodeClickDistance:b,onError:v}){const{node:m,internals:w,isParent:k}=ie(V=>{const X=V.nodeLookup.get(e),J=V.parentLookup.has(e);return{node:X,internals:X.internals,isParent:J}},de);let N=m.type||"default",I=x?.[N]||Ic[N];I===void 0&&(v?.("003",xe.error003(N)),N="default",I=x?.default||Ic.default);const M=!!(m.draggable||a&&typeof m.draggable>"u"),L=!!(m.selectable||c&&typeof m.selectable>"u"),H=!!(m.connectable||l&&typeof m.connectable>"u"),j=!!(m.focusable||u&&typeof m.focusable>"u"),R=ce(),$=Sa(m),y=Oy({node:m,nodeType:N,hasDimensions:$,resizeObserver:h}),A=Mc({nodeRef:y,disabled:m.hidden||!M,noDragClassName:d,handleSelector:m.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:b}),T=Ac();if(m.hidden)return null;const S=Xe(m),E=Sy(m),P=L||M||t||n||o||r,_=n?V=>n(V,{...w.userNode}):void 0,D=o?V=>o(V,{...w.userNode}):void 0,z=r?V=>r(V,{...w.userNode}):void 0,F=i?V=>i(V,{...w.userNode}):void 0,B=s?V=>s(V,{...w.userNode}):void 0,Y=V=>{const{selectNodesOnDrag:X,nodeDragThreshold:J}=R.getState();L&&(!X||!M||J>0)&&ri({id:e,store:R,nodeRef:y}),t&&t(V,{...w.userNode})},K=V=>{if(!(Ta(V.nativeEvent)||p)){if(ua.includes(V.key)&&L){const X=V.key==="Escape";ri({id:e,store:R,unselect:X,nodeRef:y})}else if(M&&m.selected&&Object.prototype.hasOwnProperty.call(ko,V.key)){V.preventDefault();const{ariaLabelConfig:X}=R.getState();R.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),T({direction:ko[V.key],factor:V.shiftKey?4:1})}}},W=()=>{if(p||!y.current?.matches(":focus-visible"))return;const{transform:V,width:X,height:J,autoPanOnNodeFocus:te,setCenter:Z}=R.getState();if(!te)return;$r(new Map([[e,m]]),{x:0,y:0,width:X,height:J},V,!0).length>0||Z(m.position.x+S.width/2,m.position.y+S.height/2,{zoom:V[2]})};return C.jsx("div",{className:fe(["react-flow__node",`react-flow__node-${N}`,{[f]:M},m.className,{selected:m.selected,selectable:L,parent:k,draggable:M,dragging:A}]),ref:y,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:$?"visible":"hidden",...m.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:_,onMouseMove:D,onMouseLeave:z,onContextMenu:F,onClick:Y,onDoubleClick:B,onKeyDown:j?K:void 0,tabIndex:j?0:void 0,onFocus:j?W:void 0,role:m.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${dc}-${g}`,"aria-label":m.ariaLabel,...m.domAttributes,children:C.jsx(my,{value:e,children:C.jsx(I,{id:e,data:m.data,type:N,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:L,draggable:M,deletable:m.deletable??!0,isConnectable:H,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:A,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...S})})})}const Ry=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Dc(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=ie(Ry,de),s=Ay(e.onlyRenderVisibleElements),a=Py();return C.jsx("div",{className:"react-flow__nodes",style:Co,children:s.map(c=>C.jsx(Dy,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Dc.displayName="NodeRenderer";const Ly=O.memo(Dc);function $y(e){return ie(O.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Lg({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),de)}const zy=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return C.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Hy=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return C.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Rc={[lo.Arrow]:zy,[lo.ArrowClosed]:Hy};function jy(e){const t=ce();return O.useMemo(()=>Object.prototype.hasOwnProperty.call(Rc,e)?Rc[e]:(t.getState().onError?.("009",xe.error009(e)),null),[e])}const Vy=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=jy(t);return c?C.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:C.jsx(c,{color:n,strokeWidth:s})}):null},Lc=({defaultColor:e,rfId:t})=>{const n=ie(i=>i.edges),o=ie(i=>i.defaultEdgeOptions),r=O.useMemo(()=>Bg(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?C.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:C.jsx("defs",{children:r.map(i=>C.jsx(Vy,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Lc.displayName="MarkerDefinitions";var Fy=O.memo(Lc);function $c({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:l,...u}){const[h,d]=O.useState({x:1,y:0,width:0,height:0}),f=fe(["react-flow__edge-textwrapper",l]),p=O.useRef(null);return O.useEffect(()=>{if(p.current){const g=p.current.getBBox();d({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?C.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...u,children:[r&&C.jsx("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:i,rx:a,ry:a}),C.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:o,children:n}),c]}):null}$c.displayName="EdgeText";const By=O.memo($c);function $t({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return C.jsxs(C.Fragment,{children:[C.jsx("path",{...u,d:e,fill:"none",className:fe(["react-flow__edge-path",u.className])}),l?C.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,o&&Me(t)&&Me(n)?C.jsx(By,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function zc({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Hc({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top}){const[s,a]=zc({pos:n,x1:e,y1:t,x2:o,y2:r}),[c,l]=zc({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,h,d,f]=Ia({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:l});return[`M${e},${t} C${s},${a} ${c},${l} ${o},${r}`,u,h,d,f]}function jc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:b})=>{const[v,m,w]=Hc({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),k=e.isInternal?void 0:t;return C.jsx($t,{id:k,path:v,labelX:m,labelY:w,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:b})})}const Wy=jc({isInternal:!1}),Vc=jc({isInternal:!0});Wy.displayName="SimpleBezierEdge",Vc.displayName="SimpleBezierEdgeInternal";function Fc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,sourcePosition:f=Q.Bottom,targetPosition:p=Q.Top,markerEnd:g,markerStart:x,pathOptions:b,interactionWidth:v})=>{const[m,w,k]=Fr({sourceX:n,sourceY:o,sourcePosition:f,targetX:r,targetY:i,targetPosition:p,borderRadius:b?.borderRadius,offset:b?.offset,stepPosition:b?.stepPosition}),N=e.isInternal?void 0:t;return C.jsx($t,{id:N,path:m,labelX:w,labelY:k,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:g,markerStart:x,interactionWidth:v})})}const Bc=Fc({isInternal:!1}),Wc=Fc({isInternal:!0});Bc.displayName="SmoothStepEdge",Wc.displayName="SmoothStepEdgeInternal";function Yc(e){return O.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return C.jsx(Bc,{...n,id:o,pathOptions:O.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Yy=Yc({isInternal:!1}),Xc=Yc({isInternal:!0});Yy.displayName="StepEdge",Xc.displayName="StepEdgeInternal";function Uc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:f,markerStart:p,interactionWidth:g})=>{const[x,b,v]=Da({sourceX:n,sourceY:o,targetX:r,targetY:i}),m=e.isInternal?void 0:t;return C.jsx($t,{id:m,path:x,labelX:b,labelY:v,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:f,markerStart:p,interactionWidth:g})})}const Xy=Uc({isInternal:!1}),Gc=Uc({isInternal:!0});Xy.displayName="StraightEdge",Gc.displayName="StraightEdgeInternal";function qc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,pathOptions:b,interactionWidth:v})=>{const[m,w,k]=mo({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:b?.curvature}),N=e.isInternal?void 0:t;return C.jsx($t,{id:N,path:m,labelX:w,labelY:k,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:v})})}const Uy=qc({isInternal:!1}),Zc=qc({isInternal:!0});Uy.displayName="BezierEdge",Zc.displayName="BezierEdgeInternal";const Kc={default:Zc,straight:Gc,step:Xc,smoothstep:Wc,simplebezier:Vc},Qc={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Gy=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,qy=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Jc="react-flow__edgeupdater";function el({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return C.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:fe([Jc,`${Jc}-${a}`]),cx:Gy(t,o,e),cy:qy(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Zy({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:h,setReconnecting:d,setUpdateHover:f}){const p=ce(),g=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:I,isValidConnection:M,connectionMode:L,connectionRadius:H,lib:j,onConnectStart:R,onConnectEnd:$,cancelConnection:y,nodeLookup:A,rfId:T,panBy:S,updateConnection:E}=p.getState(),P=k.type==="target",_=(F,B)=>{d(!1),h?.(F,n,k.type,B)},D=F=>l?.(n,F),z=(F,B)=>{d(!0),u?.(w,n,k.type),R?.(F,B)};Zr.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:L,connectionRadius:H,domNode:I,handleId:k.id,nodeId:k.nodeId,nodeLookup:A,isTarget:P,edgeUpdaterType:k.type,lib:j,flowId:T,cancelConnection:y,panBy:S,isValidConnection:M,onConnect:D,onConnectStart:z,onConnectEnd:$,onReconnectEnd:_,updateConnection:E,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>g(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),b=w=>g(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>f(!0),m=()=>f(!1);return C.jsxs(C.Fragment,{children:[(e===!0||e==="source")&&C.jsx(el,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:x,onMouseEnter:v,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&C.jsx(el,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:b,onMouseEnter:v,onMouseOut:m,type:"target"})]})}function Ky({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:h,onReconnectStart:d,onReconnectEnd:f,rfId:p,edgeTypes:g,noPanClassName:x,onError:b,disableKeyboardA11y:v}){let m=ie(Z=>Z.edgeLookup.get(e));const w=ie(Z=>Z.defaultEdgeOptions);m=w?{...w,...m}:m;let k=m.type||"default",N=g?.[k]||Kc[k];N===void 0&&(b?.("011",xe.error011(k)),k="default",N=g?.default||Kc.default);const I=!!(m.focusable||t&&typeof m.focusable>"u"),M=typeof h<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),L=!!(m.selectable||o&&typeof m.selectable>"u"),H=O.useRef(null),[j,R]=O.useState(!1),[$,y]=O.useState(!1),A=ce(),{zIndex:T,sourceX:S,sourceY:E,targetX:P,targetY:_,sourcePosition:D,targetPosition:z}=ie(O.useCallback(Z=>{const oe=Z.nodeLookup.get(m.source),ne=Z.nodeLookup.get(m.target);if(!oe||!ne)return{zIndex:m.zIndex,...Qc};const ue=Fg({id:e,sourceNode:oe,targetNode:ne,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:b});return{zIndex:Rg({selected:m.selected,zIndex:m.zIndex,sourceNode:oe,targetNode:ne,elevateOnSelect:Z.elevateEdgesOnSelect}),...ue||Qc}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),de),F=O.useMemo(()=>m.markerStart?`url('#${Br(m.markerStart,p)}')`:void 0,[m.markerStart,p]),B=O.useMemo(()=>m.markerEnd?`url('#${Br(m.markerEnd,p)}')`:void 0,[m.markerEnd,p]);if(m.hidden||S===null||E===null||P===null||_===null)return null;const Y=Z=>{const{addSelectedEdges:oe,unselectNodesAndEdges:ne,multiSelectionActive:ue}=A.getState();L&&(A.setState({nodesSelectionActive:!1}),m.selected&&ue?(ne({nodes:[],edges:[m]}),H.current?.blur()):oe([e])),r&&r(Z,m)},K=i?Z=>{i(Z,{...m})}:void 0,W=s?Z=>{s(Z,{...m})}:void 0,V=a?Z=>{a(Z,{...m})}:void 0,X=c?Z=>{c(Z,{...m})}:void 0,J=l?Z=>{l(Z,{...m})}:void 0,te=Z=>{if(!v&&ua.includes(Z.key)&&L){const{unselectNodesAndEdges:oe,addSelectedEdges:ne}=A.getState();Z.key==="Escape"?(H.current?.blur(),oe({edges:[m]})):ne([e])}};return C.jsx("svg",{style:{zIndex:T},children:C.jsxs("g",{className:fe(["react-flow__edge",`react-flow__edge-${k}`,m.className,x,{selected:m.selected,animated:m.animated,inactive:!L&&!r,updating:j,selectable:L}]),onClick:Y,onDoubleClick:K,onContextMenu:W,onMouseEnter:V,onMouseMove:X,onMouseLeave:J,onKeyDown:I?te:void 0,tabIndex:I?0:void 0,role:m.ariaRole??(I?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":I?`${fc}-${p}`:void 0,ref:H,...m.domAttributes,children:[!$&&C.jsx(N,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:L,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:S,sourceY:E,targetX:P,targetY:_,sourcePosition:D,targetPosition:z,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:F,markerEnd:B,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),M&&C.jsx(Zy,{edge:m,isReconnectable:M,reconnectRadius:u,onReconnect:h,onReconnectStart:d,onReconnectEnd:f,sourceX:S,sourceY:E,targetX:P,targetY:_,sourcePosition:D,targetPosition:z,setUpdateHover:R,setReconnecting:y})]})})}const Qy=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function tl({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:h,onEdgeDoubleClick:d,onReconnectStart:f,onReconnectEnd:p,disableKeyboardA11y:g}){const{edgesFocusable:x,edgesReconnectable:b,elementsSelectable:v,onError:m}=ie(Qy,de),w=$y(t);return C.jsxs("div",{className:"react-flow__edges",children:[C.jsx(Fy,{defaultColor:e,rfId:n}),w.map(k=>C.jsx(Ky,{id:k,edgesFocusable:x,edgesReconnectable:b,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:h,onDoubleClick:d,onReconnectStart:f,onReconnectEnd:p,rfId:n,onError:m,edgeTypes:o,disableKeyboardA11y:g},k))]})}tl.displayName="EdgeRenderer";const Jy=O.memo(tl),e0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function t0({children:e}){const t=ie(e0);return C.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function n0(e){const t=bn(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const o0=e=>e.panZoom?.syncViewport;function r0(e){const t=ie(o0),n=ce();return O.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function i0(e){return e.connection.inProgress?{...e.connection,to:pn(e.connection.to,e.transform)}:{...e.connection}}function s0(e){return i0}function nl(e){const t=s0();return ie(t,de)}const a0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function c0({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:c}=ie(a0,de);return!(i&&r&&c)?null:C.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:C.jsx("g",{className:fe(["react-flow__connection",ga(a)]),children:C.jsx(ol,{style:t,type:n,CustomComponent:o,isValid:a})})})}const ol=({style:e,type:t=Ze.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:c,to:l,toNode:u,toHandle:h,toPosition:d}=nl();if(!r)return;if(n)return C.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:d,connectionStatus:ga(o),toNode:u,toHandle:h});let f="";const p={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:d};switch(t){case Ze.Bezier:[f]=mo(p);break;case Ze.SimpleBezier:[f]=Hc(p);break;case Ze.Step:[f]=Fr({...p,borderRadius:0});break;case Ze.SmoothStep:[f]=Fr(p);break;default:[f]=Da(p)}return C.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};ol.displayName="ConnectionLine";const l0={};function rl(e=l0){const t=O.useRef(e),n=ce();O.useEffect(()=>{if(process.env.NODE_ENV==="development"){const o=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of o)if(t.current[r]!==e[r]){n.getState().onError?.("002",xe.error002());break}t.current=e}},[e])}function u0(){const e=ce(),t=O.useRef(!1);O.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",xe.error013("react")),t.current=!0}},[])}function il({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:h,onSelectionStart:d,onSelectionEnd:f,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:x,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:I,deleteKeyCode:M,onlyRenderVisibleElements:L,elementsSelectable:H,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:y,preventScrolling:A,defaultMarkerColor:T,zoomOnScroll:S,zoomOnPinch:E,panOnScroll:P,panOnScrollSpeed:_,panOnScrollMode:D,zoomOnDoubleClick:z,panOnDrag:F,onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneScroll:V,onPaneContextMenu:X,paneClickDistance:J,nodeClickDistance:te,onEdgeContextMenu:Z,onEdgeMouseEnter:oe,onEdgeMouseMove:ne,onEdgeMouseLeave:ue,reconnectRadius:ge,onReconnect:Pe,onReconnectStart:Bt,onReconnectEnd:qo,noDragClassName:Zo,noWheelClassName:Ko,noPanClassName:Tn,disableKeyboardA11y:Mn,nodeExtent:Ii,rfId:Qo,viewport:Wt,onViewportChange:An}){return rl(e),rl(t),u0(),n0(n),r0(Wt),C.jsx(Ty,{onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneContextMenu:X,onPaneScroll:V,paneClickDistance:J,deleteKeyCode:M,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,onSelectionStart:d,onSelectionEnd:f,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:I,elementsSelectable:H,zoomOnScroll:S,zoomOnPinch:E,zoomOnDoubleClick:z,panOnScroll:P,panOnScrollSpeed:_,panOnScrollMode:D,panOnDrag:F,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:y,onSelectionContextMenu:h,preventScrolling:A,noDragClassName:Zo,noWheelClassName:Ko,noPanClassName:Tn,disableKeyboardA11y:Mn,onViewportChange:An,isControlledViewport:!!Wt,children:C.jsxs(t0,{children:[C.jsx(Jy,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Pe,onReconnectStart:Bt,onReconnectEnd:qo,onlyRenderVisibleElements:L,onEdgeContextMenu:Z,onEdgeMouseEnter:oe,onEdgeMouseMove:ne,onEdgeMouseLeave:ue,reconnectRadius:ge,defaultMarkerColor:T,noPanClassName:Tn,disableKeyboardA11y:Mn,rfId:Qo}),C.jsx(c0,{style:g,type:p,component:x,containerStyle:b}),C.jsx("div",{className:"react-flow__edgelabel-renderer"}),C.jsx(Ly,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:te,onlyRenderVisibleElements:L,noPanClassName:Tn,noDragClassName:Zo,disableKeyboardA11y:Mn,nodeExtent:Ii,rfId:Qo}),C.jsx("div",{className:"react-flow__viewport-portal"})]})})}il.displayName="GraphView";const d0=O.memo(il),sl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:h}={})=>{const d=new Map,f=new Map,p=new Map,g=new Map,x=o??t??[],b=n??e??[],v=u??[0,0],m=h??ln;Fa(p,g,x);const w=Xr(b,d,f,{nodeOrigin:v,nodeExtent:m,elevateNodesOnSelect:!1});let k=[0,0,1];if(s&&r&&i){const N=dn(d,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:I,y:M,zoom:L}=jr(N,r,i,c,l,a?.padding??.1);k=[I,M,L]}return{rfId:"1",width:0,height:0,transform:k,nodes:b,nodesInitialized:w,nodeLookup:d,parentLookup:f,edges:x,edgeLookup:g,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ln,nodeExtent:m,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...fa},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:_a,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:da}},f0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:h})=>Dm((d,f)=>{async function p(){const{nodeLookup:g,panZoom:x,fitViewOptions:b,fitViewResolver:v,width:m,height:w,minZoom:k,maxZoom:N}=f();x&&(await Tg({nodes:g,width:m,height:w,panZoom:x,minZoom:k,maxZoom:N},b),v?.resolve(!0),d({fitViewResolver:null}))}return{...sl({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:h,defaultNodes:n,defaultEdges:o}),setNodes:g=>{const{nodeLookup:x,parentLookup:b,nodeOrigin:v,elevateNodesOnSelect:m,fitViewQueued:w}=f(),k=Xr(g,x,b,{nodeOrigin:v,nodeExtent:h,elevateNodesOnSelect:m,checkEquality:!0});w&&k?(p(),d({nodes:g,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):d({nodes:g,nodesInitialized:k})},setEdges:g=>{const{connectionLookup:x,edgeLookup:b}=f();Fa(x,b,g),d({edges:g})},setDefaultNodesAndEdges:(g,x)=>{if(g){const{setNodes:b}=f();b(g),d({hasDefaultNodes:!0})}if(x){const{setEdges:b}=f();b(x),d({hasDefaultEdges:!0})}},updateNodeInternals:g=>{const{triggerNodeChanges:x,nodeLookup:b,parentLookup:v,domNode:m,nodeOrigin:w,nodeExtent:k,debug:N,fitViewQueued:I}=f(),{changes:M,updatedInternals:L}=Gg(g,b,v,m,w,k);L&&(Yg(b,v,{nodeOrigin:w,nodeExtent:k}),I?(p(),d({fitViewQueued:!1,fitViewOptions:void 0})):d({}),M?.length>0&&(N&&console.log("React Flow: trigger node changes",M),x?.(M)))},updateNodePositions:(g,x=!1)=>{const b=[],v=[],{nodeLookup:m,triggerNodeChanges:w}=f();for(const[k,N]of g){const I=m.get(k),M=!!(I?.expandParent&&I?.parentId&&N?.position),L={id:k,type:"position",position:M?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:x};M&&I.parentId&&b.push({id:k,parentId:I.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),v.push(L)}if(b.length>0){const{parentLookup:k,nodeOrigin:N}=f(),I=Gr(b,m,k,N);v.push(...I)}w(v)},triggerNodeChanges:g=>{const{onNodesChange:x,setNodes:b,nodes:v,hasDefaultNodes:m,debug:w}=f();if(g?.length){if(m){const k=vc(g,v);b(k)}w&&console.log("React Flow: trigger node changes",g),x?.(g)}},triggerEdgeChanges:g=>{const{onEdgesChange:x,setEdges:b,edges:v,hasDefaultEdges:m,debug:w}=f();if(g?.length){if(m){const k=wn(g,v);b(k)}w&&console.log("React Flow: trigger edge changes",g),x?.(g)}},addSelectedNodes:g=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:v,triggerNodeChanges:m,triggerEdgeChanges:w}=f();if(x){const k=g.map(N=>ht(N,!0));m(k);return}m(Lt(v,new Set([...g]),!0)),w(Lt(b))},addSelectedEdges:g=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:v,triggerNodeChanges:m,triggerEdgeChanges:w}=f();if(x){const k=g.map(N=>ht(N,!0));w(k);return}w(Lt(b,new Set([...g]))),m(Lt(v,new Set,!0))},unselectNodesAndEdges:({nodes:g,edges:x}={})=>{const{edges:b,nodes:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:k}=f(),N=g||v,I=x||b,M=N.map(H=>{const j=m.get(H.id);return j&&(j.selected=!1),ht(H.id,!1)}),L=I.map(H=>ht(H.id,!1));w(M),k(L)},setMinZoom:g=>{const{panZoom:x,maxZoom:b}=f();x?.setScaleExtent([g,b]),d({minZoom:g})},setMaxZoom:g=>{const{panZoom:x,minZoom:b}=f();x?.setScaleExtent([b,g]),d({maxZoom:g})},setTranslateExtent:g=>{f().panZoom?.setTranslateExtent(g),d({translateExtent:g})},setPaneClickDistance:g=>{f().panZoom?.setClickDistance(g)},resetSelectedElements:()=>{const{edges:g,nodes:x,triggerNodeChanges:b,triggerEdgeChanges:v,elementsSelectable:m}=f();if(!m)return;const w=x.reduce((N,I)=>I.selected?[...N,ht(I.id,!1)]:N,[]),k=g.reduce((N,I)=>I.selected?[...N,ht(I.id,!1)]:N,[]);b(w),v(k)},setNodeExtent:g=>{const{nodes:x,nodeLookup:b,parentLookup:v,nodeOrigin:m,elevateNodesOnSelect:w,nodeExtent:k}=f();g[0][0]===k[0][0]&&g[0][1]===k[0][1]&&g[1][0]===k[1][0]&&g[1][1]===k[1][1]||(Xr(x,b,v,{nodeOrigin:m,nodeExtent:g,elevateNodesOnSelect:w,checkEquality:!1}),d({nodeExtent:g}))},panBy:g=>{const{transform:x,width:b,height:v,panZoom:m,translateExtent:w}=f();return qg({delta:g,panZoom:m,transform:x,translateExtent:w,width:b,height:v})},setCenter:async(g,x,b)=>{const{width:v,height:m,maxZoom:w,panZoom:k}=f();if(!k)return Promise.resolve(!1);const N=typeof b?.zoom<"u"?b.zoom:w;return await k.setViewport({x:v/2-g*N,y:m/2-x*N,zoom:N},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{d({connection:{...fa}})},updateConnection:g=>{d({connection:g})},reset:()=>d({...sl()})}},Object.is);function al({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:h,children:d}){const[f]=O.useState(()=>f0({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:l,minZoom:s,maxZoom:a,fitViewOptions:c,nodeOrigin:u,nodeExtent:h}));return C.jsx(Rm,{value:f,children:C.jsx(oy,{children:d})})}function h0({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:h,nodeExtent:d}){return O.useContext(Eo)?C.jsx(C.Fragment,{children:e}):C.jsx(al,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:h,nodeExtent:d,children:e})}const p0={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function g0({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:h,onMoveEnd:d,onConnect:f,onConnectStart:p,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:I,onNodeDrag:M,onNodeDragStop:L,onNodesDelete:H,onEdgesDelete:j,onDelete:R,onSelectionChange:$,onSelectionDragStart:y,onSelectionDrag:A,onSelectionDragStop:T,onSelectionContextMenu:S,onSelectionStart:E,onSelectionEnd:P,onBeforeDelete:_,connectionMode:D,connectionLineType:z=Ze.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:Y,deleteKeyCode:K="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:V=!1,selectionMode:X=At.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:te=gn()?"Meta":"Control",zoomActivationKeyCode:Z=gn()?"Meta":"Control",snapToGrid:oe,snapGrid:ne,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:ge,nodesDraggable:Pe,autoPanOnNodeFocus:Bt,nodesConnectable:qo,nodesFocusable:Zo,nodeOrigin:Ko=hc,edgesFocusable:Tn,edgesReconnectable:Mn,elementsSelectable:Ii=!0,defaultViewport:Qo=Gm,minZoom:Wt=.5,maxZoom:An=2,translateExtent:wu=ln,preventScrolling:$w=!0,nodeExtent:Pi,defaultMarkerColor:zw="#b1b1b7",zoomOnScroll:Hw=!0,zoomOnPinch:jw=!0,panOnScroll:Vw=!1,panOnScrollSpeed:Fw=.5,panOnScrollMode:Bw=ut.Free,zoomOnDoubleClick:Ww=!0,panOnDrag:Yw=!0,onPaneClick:Xw,onPaneMouseEnter:Uw,onPaneMouseMove:Gw,onPaneMouseLeave:qw,onPaneScroll:Zw,onPaneContextMenu:Kw,paneClickDistance:bu=0,nodeClickDistance:Qw=0,children:Jw,onReconnect:eb,onReconnectStart:tb,onReconnectEnd:nb,onEdgeContextMenu:ob,onEdgeDoubleClick:rb,onEdgeMouseEnter:ib,onEdgeMouseMove:sb,onEdgeMouseLeave:ab,reconnectRadius:cb=10,onNodesChange:lb,onEdgesChange:ub,noDragClassName:db="nodrag",noWheelClassName:fb="nowheel",noPanClassName:vu="nopan",fitView:Eu,fitViewOptions:_u,connectOnClick:hb,attributionPosition:pb,proOptions:gb,defaultEdgeOptions:mb,elevateNodesOnSelect:yb,elevateEdgesOnSelect:xb,disableKeyboardA11y:Su=!1,autoPanOnConnect:wb,autoPanOnNodeDrag:bb,autoPanSpeed:vb,connectionRadius:Eb,isValidConnection:_b,onError:Sb,style:Cb,id:Cu,nodeDragThreshold:Nb,connectionDragThreshold:kb,viewport:Tb,onViewportChange:Mb,width:Ab,height:Ib,colorMode:Pb="light",debug:Ob,onScroll:Nu,ariaLabelConfig:Db,...Rb},Lb){const Oi=Cu||"1",$b=Km(Pb),zb=O.useCallback(ku=>{ku.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Nu?.(ku)},[Nu]);return C.jsx("div",{"data-testid":"rf__wrapper",...Rb,onScroll:zb,style:{...Cb,...p0},ref:Lb,className:fe(["react-flow",r,$b]),id:Cu,role:"application",children:C.jsxs(h0,{nodes:e,edges:t,width:Ab,height:Ib,fitView:Eu,fitViewOptions:_u,minZoom:Wt,maxZoom:An,nodeOrigin:Ko,nodeExtent:Pi,children:[C.jsx(d0,{onInit:l,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:s,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:Y,selectionKeyCode:W,selectionOnDrag:V,selectionMode:X,deleteKeyCode:K,multiSelectionKeyCode:te,panActivationKeyCode:J,zoomActivationKeyCode:Z,onlyRenderVisibleElements:ue,defaultViewport:Qo,translateExtent:wu,minZoom:Wt,maxZoom:An,preventScrolling:$w,zoomOnScroll:Hw,zoomOnPinch:jw,zoomOnDoubleClick:Ww,panOnScroll:Vw,panOnScrollSpeed:Fw,panOnScrollMode:Bw,panOnDrag:Yw,onPaneClick:Xw,onPaneMouseEnter:Uw,onPaneMouseMove:Gw,onPaneMouseLeave:qw,onPaneScroll:Zw,onPaneContextMenu:Kw,paneClickDistance:bu,nodeClickDistance:Qw,onSelectionContextMenu:S,onSelectionStart:E,onSelectionEnd:P,onReconnect:eb,onReconnectStart:tb,onReconnectEnd:nb,onEdgeContextMenu:ob,onEdgeDoubleClick:rb,onEdgeMouseEnter:ib,onEdgeMouseMove:sb,onEdgeMouseLeave:ab,reconnectRadius:cb,defaultMarkerColor:zw,noDragClassName:db,noWheelClassName:fb,noPanClassName:vu,rfId:Oi,disableKeyboardA11y:Su,nodeExtent:Pi,viewport:Tb,onViewportChange:Mb}),C.jsx(Zm,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:f,onConnectStart:p,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:b,nodesDraggable:Pe,autoPanOnNodeFocus:Bt,nodesConnectable:qo,nodesFocusable:Zo,edgesFocusable:Tn,edgesReconnectable:Mn,elementsSelectable:Ii,elevateNodesOnSelect:yb,elevateEdgesOnSelect:xb,minZoom:Wt,maxZoom:An,nodeExtent:Pi,onNodesChange:lb,onEdgesChange:ub,snapToGrid:oe,snapGrid:ne,connectionMode:D,translateExtent:wu,connectOnClick:hb,defaultEdgeOptions:mb,fitView:Eu,fitViewOptions:_u,onNodesDelete:H,onEdgesDelete:j,onDelete:R,onNodeDragStart:I,onNodeDrag:M,onNodeDragStop:L,onSelectionDrag:A,onSelectionDragStart:y,onSelectionDragStop:T,onMove:u,onMoveStart:h,onMoveEnd:d,noPanClassName:vu,nodeOrigin:Ko,rfId:Oi,autoPanOnConnect:wb,autoPanOnNodeDrag:bb,autoPanSpeed:vb,onError:Sb,connectionRadius:Eb,isValidConnection:_b,selectNodesOnDrag:ge,nodeDragThreshold:Nb,connectionDragThreshold:kb,onBeforeDelete:_,paneClickDistance:bu,debug:Ob,ariaLabelConfig:Db}),C.jsx(Um,{onSelectionChange:$}),Jw,C.jsx(Fm,{proOptions:gb,position:pb}),C.jsx(Vm,{rfId:Oi,disableKeyboardA11y:Su})]})})}var m0=Cc(g0);const y0=xe.error014();function x0({id:e,handleType:t,handleId:n,onConnect:o,onDisconnect:r}={}){const i=No(),s=e??i;if(!s)throw new Error(y0);const a=O.useRef(null),c=ie(l=>l.connectionLookup.get(`${s}${t?n?`-${t}-${n}`:`-${t}`:""}`),_g);return O.useEffect(()=>{if(a.current&&a.current!==c){const l=c??new Map;pa(a.current,l,r),pa(l,a.current,o)}a.current=c??new Map},[c,o,r]),O.useMemo(()=>Array.from(c?.values()??[]),[c])}function si(e){return ie(O.useCallback(n=>{const o=[],r=Array.isArray(e),i=r?e:[e];for(const s of i){const a=n.nodeLookup.get(s);a&&o.push({id:a.id,type:a.type,data:a.data})}return r?o:o[0]??null},[e]),Zg)}function w0({dimensions:e,lineWidth:t,variant:n,className:o}){return C.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fe(["react-flow__background-pattern",n,o])})}function b0({radius:e,className:t}){return C.jsx("circle",{cx:e,cy:e,r:e,className:fe(["react-flow__background-pattern","dots",t])})}var Je;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Je||(Je={}));const v0={[Je.Dots]:1,[Je.Lines]:1,[Je.Cross]:6},E0=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cl({id:e,variant:t=Je.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:c,className:l,patternClassName:u}){const h=O.useRef(null),{transform:d,patternId:f}=ie(E0,de),p=o||v0[t],g=t===Je.Dots,x=t===Je.Cross,b=Array.isArray(n)?n:[n,n],v=[b[0]*d[2]||1,b[1]*d[2]||1],m=p*d[2],w=Array.isArray(i)?i:[i,i],k=x?[m,m]:v,N=[w[0]*d[2]||1+k[0]/2,w[1]*d[2]||1+k[1]/2],I=`${f}${e||""}`;return C.jsxs("svg",{className:fe(["react-flow__background",l]),style:{...c,...Co,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:h,"data-testid":"rf__background",children:[C.jsx("pattern",{id:I,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?C.jsx(b0,{radius:m/2,className:u}):C.jsx(w0,{dimensions:k,lineWidth:r,variant:t,className:u})}),C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${I})`})]})}cl.displayName="Background";const _0=O.memo(cl);function S0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:C.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function C0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:C.jsx("path",{d:"M0 0h32v4.2H0z"})})}function N0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:C.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function k0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function T0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function To({children:e,className:t,...n}){return C.jsx("button",{type:"button",className:fe(["react-flow__controls-button",t]),...n,children:e})}const M0=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ll({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:l,children:u,position:h="bottom-left",orientation:d="vertical","aria-label":f}){const p=ce(),{isInteractive:g,minZoomReached:x,maxZoomReached:b,ariaLabelConfig:v}=ie(M0,de),{zoomIn:m,zoomOut:w,fitView:k}=bn(),N=()=>{m(),i?.()},I=()=>{w(),s?.()},M=()=>{k(r),a?.()},L=()=>{p.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},H=d==="horizontal"?"horizontal":"vertical";return C.jsxs(_o,{className:fe(["react-flow__controls",H,l]),position:h,style:e,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[t&&C.jsxs(C.Fragment,{children:[C.jsx(To,{onClick:N,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:C.jsx(S0,{})}),C.jsx(To,{onClick:I,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:x,children:C.jsx(C0,{})})]}),n&&C.jsx(To,{className:"react-flow__controls-fitview",onClick:M,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:C.jsx(N0,{})}),o&&C.jsx(To,{className:"react-flow__controls-interactive",onClick:L,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:g?C.jsx(T0,{}):C.jsx(k0,{})}),u]})}ll.displayName="Controls";const A0=O.memo(ll);function I0({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:c,className:l,borderRadius:u,shapeRendering:h,selected:d,onClick:f}){const{background:p,backgroundColor:g}=i||{},x=s||p||g;return C.jsx("rect",{className:fe(["react-flow__minimap-node",{selected:d},l]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:x,stroke:a,strokeWidth:c},shapeRendering:h,onClick:f?b=>f(b,e):void 0})}const P0=O.memo(I0),O0=e=>e.nodes.map(t=>t.id),ai=e=>e instanceof Function?e:()=>e;function D0({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=P0,onClick:s}){const a=ie(O0,de),c=ai(t),l=ai(e),u=ai(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return C.jsx(C.Fragment,{children:a.map(d=>C.jsx(L0,{id:d,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:h},d))})}function R0({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:c}){const{node:l,x:u,y:h,width:d,height:f}=ie(p=>{const{internals:g}=p.nodeLookup.get(e),x=g.userNode,{x:b,y:v}=g.positionAbsolute,{width:m,height:w}=Xe(x);return{node:x,x:b,y:v,width:m,height:w}},de);return!l||l.hidden||!Sa(l)?null:C.jsx(a,{x:u,y:h,width:d,height:f,style:l.style,selected:!!l.selected,className:o(l),color:t(l),borderRadius:r,strokeColor:n(l),strokeWidth:i,shapeRendering:s,onClick:c,id:l.id})}const L0=O.memo(R0);var $0=O.memo(D0);const z0=200,H0=150,j0=e=>!e.hidden,V0=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?va(dn(e.nodeLookup,{filter:j0}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},F0="react-flow__minimap-desc";function ul({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:h,position:d="bottom-right",onClick:f,onNodeClick:p,pannable:g=!1,zoomable:x=!1,ariaLabel:b,inversePan:v,zoomStep:m=1,offsetScale:w=5}){const k=ce(),N=O.useRef(null),{boundingRect:I,viewBB:M,rfId:L,panZoom:H,translateExtent:j,flowWidth:R,flowHeight:$,ariaLabelConfig:y}=ie(V0,de),A=e?.width??z0,T=e?.height??H0,S=I.width/A,E=I.height/T,P=Math.max(S,E),_=P*A,D=P*T,z=w*P,F=I.x-(_-I.width)/2-z,B=I.y-(D-I.height)/2-z,Y=_+z*2,K=D+z*2,W=`${F0}-${L}`,V=O.useRef(0),X=O.useRef();V.current=P,O.useEffect(()=>{if(N.current&&H)return X.current=im({domNode:N.current,panZoom:H,getTransform:()=>k.getState().transform,getViewScale:()=>V.current}),()=>{X.current?.destroy()}},[H]),O.useEffect(()=>{X.current?.update({translateExtent:j,width:R,height:$,inversePan:v,pannable:g,zoomStep:m,zoomable:x})},[g,x,v,m,j,R,$]);const J=f?oe=>{const[ne,ue]=X.current?.pointer(oe)||[0,0];f(oe,{x:ne,y:ue})}:void 0,te=p?O.useCallback((oe,ne)=>{const ue=k.getState().nodeLookup.get(ne).internals.userNode;p(oe,ue)},[]):void 0,Z=b??y["minimap.ariaLabel"];return C.jsx(_o,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*P:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:fe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:C.jsxs("svg",{width:A,height:T,viewBox:`${F} ${B} ${Y} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:N,onClick:J,children:[Z&&C.jsx("title",{id:W,children:Z}),C.jsx($0,{onClick:te,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),C.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${B-z}h${Y+z*2}v${K+z*2}h${-Y-z*2}z
60
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ul.displayName="MiniMap";const B0=O.memo(ul),W0=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Y0={[ft.Line]:"right",[ft.Handle]:"bottom-right"};function X0({nodeId:e,position:t,variant:n=ft.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:d,autoScale:f=!0,shouldResize:p,onResizeStart:g,onResize:x,onResizeEnd:b}){const v=No(),m=typeof e=="string"?e:v,w=ce(),k=O.useRef(null),N=n===ft.Handle,I=ie(O.useCallback(W0(N&&f),[N,f]),de),M=O.useRef(null),L=t??Y0[n];O.useEffect(()=>{if(!(!k.current||!m))return M.current||(M.current=vm({domNode:k.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,domNode:T}=w.getState();return{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,paneDomNode:T}},onChange:(j,R)=>{const{triggerNodeChanges:$,nodeLookup:y,parentLookup:A,nodeOrigin:T}=w.getState(),S=[],E={x:j.x,y:j.y},P=y.get(m);if(P&&P.expandParent&&P.parentId){const _=P.origin??T,D=j.width??P.measured.width??0,z=j.height??P.measured.height??0,F={id:P.id,parentId:P.parentId,rect:{width:D,height:z,...Ca({x:j.x??P.position.x,y:j.y??P.position.y},{width:D,height:z},P.parentId,y,_)}},B=Gr([F],y,A,T);S.push(...B),E.x=j.x?Math.max(_[0]*D,j.x):void 0,E.y=j.y?Math.max(_[1]*z,j.y):void 0}if(E.x!==void 0&&E.y!==void 0){const _={id:m,type:"position",position:{...E}};S.push(_)}if(j.width!==void 0&&j.height!==void 0){const D={id:m,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};S.push(D)}for(const _ of R){const D={..._,type:"position"};S.push(D)}$(S)},onEnd:({width:j,height:R})=>{const $={id:m,type:"dimensions",resizing:!1,dimensions:{width:j,height:R}};w.getState().triggerNodeChanges([$])}})),M.current.update({controlPosition:L,boundaries:{minWidth:a,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:h,resizeDirection:d,onResizeStart:g,onResize:x,onResizeEnd:b,shouldResize:p}),()=>{M.current?.destroy()}},[L,a,c,l,u,h,g,x,b,p]);const H=L.split("-");return C.jsx("div",{className:fe(["react-flow__resize-control","nodrag",...H,n,o]),ref:k,style:{...r,scale:I,...s&&{[N?"backgroundColor":"borderColor"]:s}},children:i})}const dl=O.memo(X0),ci=20;function pt(e,t){const n=t[e.dataType],o=e.allowInput??n.allowInput;return n.underlyingType==="number"?{id:St(ci),name:e.name,handleColor:n.color,allowInput:o,type:"number",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:{id:St(ci),name:e.name,handleColor:n.color,allowInput:n.underlyingType==="string"?o:!1,type:"string",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}}function fl(e,t){const n=St(ci),o=e.inputs.map(r=>pt(r,t));return{id:n,name:e.name,inputs:o}}function li(e,t,n,o,r){const i=n[t],s=i.inputs.map(c=>"inputs"in c?fl(c,e):pt(c,e)),a=i.outputs.map(c=>pt(c,e));return{id:o,position:r,sourcePosition:Q.Right,targetPosition:Q.Left,type:"configurableNode",width:400,data:{name:i.name,headerColor:i.headerColor,inputs:s,outputs:a}}}function hl(e,t,n,o){const r=n[t];if(o)if(o.type==="input"){const i=r?.inputs?.[o.index1];if(!i)return;if(o.index2!==void 0&&"inputs"in i)return pt(i.inputs?.[o.index2],e);if(o.index2===void 0&&!("inputs"in i))return pt(i,e)}else return pt(r?.outputs?.[o.index1],e)}function U0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=s?.dataType,l=a?.dataType,u=s?.inferredDataType,h=a?.inferredDataType;if(!c||!l)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(c.dataTypeObject.underlyingType!=="inferFromConnection"&&l.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};if(c.dataTypeObject.underlyingType==="inferFromConnection"&&l.dataTypeObject.underlyingType==="inferFromConnection"){if(!u&&!h)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"None of the handles are inferred, inference has no information to work with"}};if(u&&h)return{updatedNodes:e.nodes,validation:{isValid:!0}};if(u){const d=[...e.nodes];return d[n]={...e.nodes[n],data:zt(e.nodes[n].data,o,c.dataTypeUniqueId,{dataTypeToInferAs:u.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}if(h){const d=[...e.nodes];return d[t]={...e.nodes[t],data:zt(e.nodes[t].data,r,l.dataTypeUniqueId,{dataTypeToInferAs:h.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}}if(c.dataTypeObject.underlyingType==="inferFromConnection"){if(u)return{updatedNodes:e.nodes,validation:{isValid:!0}};const d=[...e.nodes];return d[t]={...e.nodes[t],data:zt(e.nodes[t].data,r,c.dataTypeUniqueId,{dataTypeToInferAs:l.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}if(l.dataTypeObject.underlyingType==="inferFromConnection"){if(h)return{updatedNodes:e.nodes,validation:{isValid:!0}};const d=[...e.nodes];return d[n]={...e.nodes[n],data:zt(e.nodes[n].data,o,l.dataTypeUniqueId,{dataTypeToInferAs:c.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}return{updatedNodes:e.nodes,validation:{isValid:!0}}}function G0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=En(s),l=En(a);if(!c||!l)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const u=c?.dataTypeObject.underlyingType==="complex",h=l?.dataTypeObject.underlyingType==="complex";return!u&&!h?{validation:{isValid:!0}}:u!==h?{validation:{isValid:!1,reason:"Can't connect complex types with non-complex types"}}:u&&h?c.dataTypeUniqueId===l.dataTypeUniqueId||JSON.stringify(c.dataTypeObject.complexSchema)===JSON.stringify(l.dataTypeObject.complexSchema)?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:"Can't connect complex types with different types"}}:{validation:{isValid:!0}}}function q0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=En(s),l=En(a);if(!c||!l)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(c.dataTypeUniqueId===l.dataTypeUniqueId)return{validation:{isValid:!0}};const h=e.allowedConversionsBetweenDataTypes?.[c.dataTypeUniqueId]?.[l.dataTypeUniqueId],d=c.dataTypeObject.underlyingType==="complex"&&l.dataTypeObject.underlyingType==="complex";return h||d&&e.allowConversionBetweenComplexTypesUnlessDisallowedByComplexTypeChecking?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:`${c.dataTypeUniqueId} to ${l.dataTypeUniqueId} conversion is not allowed`}}}function Z0(e,t,n,o,r,i){const s=e.nodes[t],a=e.nodes[n],c=Ae(o,s.data),l=Ae(r,a.data),u=c?.dataType,h=l?.dataType;if(!u||!h)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(u.dataTypeObject.underlyingType!=="inferFromConnection"&&h.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};let d=e.nodes;if(u.dataTypeObject.underlyingType==="inferFromConnection"){const f=zr([s],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=di(s.data),x={};for(const v of p)v.input.dataType?.dataTypeUniqueId===u.dataTypeUniqueId&&(x[v.input.id]=!0);for(const v of g)v.output.dataType?.dataTypeUniqueId===u.dataTypeUniqueId&&(x[v.output.id]=!0);let b=!1;for(const v of f)if(v.id!==i.id&&!(!v.sourceHandle||!v.targetHandle)){if(x[v.sourceHandle]){b=!0;break}if(x[v.targetHandle]){b=!0;break}}b||(d=[...e.nodes],d[t]={...e.nodes[t],data:zt(e.nodes[t].data,o,u.dataTypeUniqueId,{dataTypeToInferAs:u.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[t].id],resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}if(h.dataTypeObject.underlyingType==="inferFromConnection"){const f=zr([a],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=di(a.data),x={};for(const v of p)v.input.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(x[v.input.id]=!0);for(const v of g)v.output.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(x[v.output.id]=!0);let b=!1;for(const v of f)if(v.id!==i.id&&!(!v.sourceHandle||!v.targetHandle)){if(x[v.sourceHandle]){b=!0;break}if(x[v.targetHandle]){b=!0;break}}b||(d=[...e.nodes],d[n]={...e.nodes[n],data:zt(e.nodes[n].data,r,h.dataTypeUniqueId,{dataTypeToInferAs:h.dataTypeUniqueId,connectedNodeType:e.nodeIdToNodeType[e.nodes[n].id],resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}return{updatedNodes:d,validation:{isValid:!0}}}const K0=20;function pl(e,t,n,o,r){const i={id:St(K0),source:e,target:n,sourceHandle:t,targetHandle:o,type:"configurableEdge"};if(yo(i,r.edges)===r.edges)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(r.enableTypeInference||r.enableComplexTypeChecking||r.allowedConversionsBetweenDataTypes))return{updatedNodes:r.nodes,updatedEdges:yo(i,r.edges),validation:{isValid:!0}};const a=r.nodes.findIndex(g=>g.id===e),c=r.nodes.findIndex(g=>g.id===n);if(a===-1||c===-1)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target node not found"}};const l=r.nodes[a],u=r.nodes[c],h=_n(t,l.data),d=_n(o,u.data);if(!h||!d)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let f=r.nodes,p={isValid:!0};if(r.enableTypeInference){const{updatedNodes:g,validation:x}=U0(r,a,c,h,d,i);f=g,p=x}if(r.enableComplexTypeChecking&&p.isValid){const{validation:g}=G0({...r,nodes:f},a,c,h,d,i);p=g}if(r.allowedConversionsBetweenDataTypes&&p.isValid){const{validation:g}=q0({...r,nodes:f},a,c,h,d,i);p=g}return console.log("validation",p),{updatedNodes:f,updatedEdges:yo(i,r.edges),validation:p}}function gl(e,t,n){if(wn([n],t.edges)===t.edges)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(t.enableTypeInference||t.enableComplexTypeChecking||t.allowedConversionsBetweenDataTypes))return{updatedNodes:t.nodes,updatedEdges:wn([n],t.edges),validation:{isValid:!0}};const r=t.nodes.findIndex(d=>d.id===e.source),i=t.nodes.findIndex(d=>d.id===e.target);if(r===-1||i===-1)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target node not found"}};if(!e.sourceHandle||!e.targetHandle)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=t.nodes[r],a=t.nodes[i],c=_n(e.sourceHandle,s.data),l=_n(e.targetHandle,a.data);if(!c||!l)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let u=t.nodes,h={isValid:!0};if(t.enableTypeInference){const{updatedNodes:d,validation:f}=Z0(t,r,i,c,l,e);u=d,h=f}return{updatedNodes:u,updatedEdges:wn([n],t.edges),validation:h}}function En(e){const t=e?.dataType,n=e?.inferredDataType;if(t)return t.dataTypeObject.underlyingType!=="inferFromConnection"?t:n||void 0}function ml(e,t,n){const o=e.nodes.find(i=>i.id===n);if(!o)return!1;if(o.id===t)return!0;const r=(i,s=new Set)=>{if(s.has(i.id))return!1;s.add(i.id);for(const a of Cg(i,e.nodes,e.edges))if(a.id===t||r(a,s))return!0;return!1};return r(o)}const yl=20,Se=["ADD_NODE","ADD_NODE_AND_SELECT","UPDATE_NODE_BY_REACT_FLOW","UPDATE_EDGES_BY_REACT_FLOW","ADD_EDGE_BY_REACT_FLOW","UPDATE_INPUT_VALUE"],ze={[Se[0]]:Se[0],[Se[1]]:Se[1],[Se[2]]:Se[2],[Se[3]]:Se[3],[Se[4]]:Se[4],[Se[5]]:Se[5]};function xl(e,t){return Fd(e,o=>{switch(t.type){case ze.ADD_NODE:const r=t.payload.type,i=St(yl),s=t.payload.position,a=li(o.dataTypes,r,o.typeOfNodes,i,s);o.nodes.push(a),o.nodeIdToNodeType[i]=r;break;case ze.ADD_NODE_AND_SELECT:const c=t.payload.type,l=St(yl),u=t.payload.position,h=li(o.dataTypes,c,o.typeOfNodes,l,u);o.nodes=o.nodes.map(w=>({...w,selected:!1})),o.nodes.push({...h,selected:!0}),o.nodeIdToNodeType[l]=c;break;case ze.UPDATE_NODE_BY_REACT_FLOW:const d=t.payload.changes;o.nodes=vc(d,o.nodes);break;case ze.UPDATE_EDGES_BY_REACT_FLOW:const f=t.payload.changes;for(const w of f){if(w.type!=="remove"){o.edges=wn([w],o.edges);continue}const{id:k}=w,N=o.edges.find(M=>M.id===k);if(!N)continue;const I=gl(N,o,w);I.validation.isValid&&(o.edges=I.updatedEdges,o.nodes=I.updatedNodes)}break;case ze.ADD_EDGE_BY_REACT_FLOW:const p=t.payload.edge,{sourceHandle:g,targetHandle:x,source:b,target:v}=p;if(o.enableCycleChecking&&ml(o,b,v)||!b||!v||!g||!x)break;const m=pl(b,g,v,x,o);if(!m.validation.isValid)break;o.edges=m.updatedEdges,o.nodes=m.updatedNodes;break}})}function _n(e,t){const n=t?.inputs instanceof Array?t?.inputs:[],r=(t?.outputs instanceof Array?t?.outputs:[]).findIndex(a=>a.id===e);if(r!==-1)return{type:"output",index1:r,index2:void 0};let i;const s=n.findIndex(a=>{if("inputs"in a){const c=a.inputs.findIndex(l=>l.id===e);return c!==-1?(i=c,!0):!1}else return a.id===e});if(s!==-1)return{type:"input",index1:s,index2:i}}function Ae(e,t){if(e)if(e.type==="input"){const n=t?.inputs?.[e.index1];if(!n)return;if(e.index2!==void 0&&"inputs"in n)return n.inputs?.[e.index2];if(e.index2===void 0&&!("inputs"in n))return n}else return t?.outputs?.[e.index1]}function ui(e,t){const n=_n(e,t);return Ae(n,t)}function Q0(e,t,n){return t.map(o=>o.id===e?{...o,...n}:o)}function J0(e,t,n){return"inputs"in t?{...t,inputs:Q0(e,t.inputs,n)}:t.id===e?{...t,...n}:t}function wl(e,t,n){return{...t,inputs:(t.inputs||[]).map(r=>J0(e,r,n))}}function ex(e,t,n){if(e.type!="input")return t;const o=Ae(e,t);if(!o)return t;const r={...o,...n},i=[...t.inputs||[]],s=t?.inputs?.[e.index1];if(!s)return t;if(e.index2!==void 0&&"inputs"in s){const c=[...s.inputs||[]];c[e.index2]=r,i[e.index1]={...s,inputs:c}}else e.index2===void 0&&!("inputs"in s)&&(i[e.index1]=r);return{...t,inputs:i}}function tx(e,t,n){if(e.type!="output")return t;const o=Ae(e,t);if(!o)return t;const r={...o,...n},i=[...t.outputs||[]];return i[e.index1]=r,{...t,outputs:i}}function nx(e){let t=[];return e.inputs?.forEach((n,o)=>{"inputs"in n?n.inputs.forEach((r,i)=>{t.push({input:r,handleIndices:{type:"input",index1:o,index2:i}})}):t.push({input:n,handleIndices:{type:"input",index1:o,index2:void 0}})}),t}function ox(e){let t=[];return e.outputs?.forEach((n,o)=>{t.push({output:n,handleIndices:{type:"output",index1:o,index2:void 0}})}),t}function di(e){return{inputsAndIndices:nx(e),outputsAndIndices:ox(e)}}function bl(e,t,n,o,r,i){const s=o?hl(r,o.connectedNodeType,i,n):void 0;let a;if(s){const{id:c,name:l,dataType:u,...h}=s;a=h}return t.type==="input"?ex(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}}):tx(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}})}function zt(e,t,n,o,r,i){const{inputsAndIndices:s,outputsAndIndices:a}=di(e);let c=e;for(const l of s)l.input.dataType?.dataTypeUniqueId===n&&(c=bl(c,l.handleIndices,t,o,r,i));for(const l of a)l.output.dataType?.dataTypeUniqueId===n&&(c=bl(c,l.handleIndices,t,o,r,i));return c}const fi=O.forwardRef(({id:e,sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:i,targetPosition:s,...a},c)=>{const[l]=mo({sourceX:t,sourceY:n,sourcePosition:i,targetX:o,targetY:r,targetPosition:s}),u=ce(),[h,d]=O.useState(!0),f=O.useRef(null);O.useEffect(()=>{const I=u.getState().domNode;if(!I)return;const M=document.getElementById(e);if(!M)return;const L=new IntersectionObserver(H=>{const j=H.find(R=>R.target.id===e);j&&d(R=>j.isIntersecting)},{root:I,threshold:1,rootMargin:"20px"});return L.observe(M),f.current=L,()=>{f.current&&(f.current.disconnect(),f.current=null)}},[u.getState().domNode]);const p=si(a.source||""),g=O.useMemo(()=>!a.source||!p?void 0:ui(a.sourceHandleId||"",p?.data)?.handleColor??"#A1A1A1",[a.source,p]),x=si(a.target||""),b=O.useMemo(()=>!a.target||!x?void 0:ui(a.targetHandleId||"",x?.data)?.handleColor??"#A1A1A1",[a.target,x]),{label:v,labelStyle:m,markerStart:w,markerEnd:k,interactionWidth:N}=a;return C.jsxs(C.Fragment,{children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:`linear-gradient-edge-${e}`,x1:t,y1:n,x2:o,y2:r,gradientUnits:"userSpaceOnUse",children:[C.jsx("stop",{stopColor:g,offset:"0"}),C.jsx("stop",{stopColor:b,offset:"1"})]})}),C.jsx($t,{id:e,path:l,label:v,labelStyle:m,markerEnd:k,markerStart:w,interactionWidth:N,className:se("!stroke-7 in-[g.selected]:brightness-150",!h&&"opacity-25"),style:{stroke:`url(#${`linear-gradient-edge-${e}`})`},focusable:!0})]})});fi.displayName="ConfigurableEdge";function vl(e,t,n=!0,o=!1){const r=e!==null?"current"in e?e.current:e:null,i=O.useCallback(s=>{if(!r)return;let a=!0;if(n&&s.target instanceof Node&&!r.contains(s.target))a=!1;else if(o){const c="clientX"in s?{x:s.clientX,y:s.clientY}:{x:s.touches[0].clientX,y:s.touches[0].clientY},l=r.getBoundingClientRect();os(c,l)||(a=!1)}a||t()},[r,t,n,o]);O.useEffect(()=>(document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}),[r,i])}const Sn=O.forwardRef(({placeholder:e="Input",className:t,...n},o)=>{const r=O.useMemo(()=>n.allowOnlyNumbers&&n.value!==void 0?sr(n.value,n.numberOfDecimals??5):n.value?.toString(),[n.value,n.allowOnlyNumbers,n.numberOfDecimals]),[i,s]=O.useState(r??""),[a,c]=O.useState(null),l=n.value??i,[u,h]=O.useState(l.toString());function d(p){n.allowOnlyNumbers&&/[^0-9\.\-]/.test(p)||h(p)}function f(){if(n.allowOnlyNumbers){const p=rs(u||l.toString()),g=sr(p,n.numberOfDecimals??5);s(g),n.onChange?.(p),h(g)}else s(u),n.onChange?.(u),h(u)}return vl(a,()=>f()),C.jsx("input",{type:"text",className:se("h-[44px] rounded-md text-primary-white bg-primary-black font-main px-4 text-[27px] leading-[27px] outline-none focus-visible:!outline-none border-secondary-dark-gray border w-max min-w-0 placeholder:text-[#6B6B6B]",t),placeholder:e,size:5,ref:p=>{c(p),typeof o=="function"?o(p):o&&(o.current=p)},value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&f()},onMouseMove:p=>{p.preventDefault(),p.stopPropagation()},onBlur:p=>{p.preventDefault(),p.stopPropagation(),f()}})});Sn.displayName="Input";function El({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:o,lineClassName:r,lineStyle:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:h=!1,autoScale:d=!0,shouldResize:f,onResizeStart:p,onResize:g,onResizeEnd:x,linePosition:b=["left","right"],handlePosition:v=[],resizeDirection:m="horizontal"}){return t?C.jsxs(C.Fragment,{children:[b.map(w=>C.jsx(dl,{className:se("!border-none",w==="left"||w==="right"?"!w-4":"!h-4",r),style:i,nodeId:e,position:w,variant:ft.Line,color:s,minWidth:a,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:p,keepAspectRatio:h,autoScale:d,shouldResize:f,onResize:g,onResizeEnd:x,resizeDirection:m},w)),v.map(w=>C.jsx(dl,{className:n,style:o,nodeId:e,position:w,color:s,minWidth:a,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:p,keepAspectRatio:h,autoScale:d,shouldResize:f,onResize:g,onResizeEnd:x,resizeDirection:m},w))]}):null}function _l({onMove:e,onClick:t,clickThreshold:n=2,enabled:o=!0,preventDefaultAndStopPropagation:r=!0}={}){const[i,s]=O.useState(!1),[a,c]=O.useState(null),l=O.useRef(null),u=O.useRef(null),h=O.useCallback(d=>{c(d)},[]);return O.useEffect(()=>{if(!a||!o)return;const d=f=>{r&&(f.preventDefault(),f.stopPropagation()),l.current={x:f.clientX,y:f.clientY},u.current={width:a.clientWidth,height:a.clientHeight},s(!0);const p=x=>{r&&(x.preventDefault(),x.stopPropagation()),document.removeEventListener("mouseup",p),document.removeEventListener("mousemove",g),s(!1),l.current&&Math.sqrt((x.clientX-l.current.x)**2+(x.clientY-l.current.y)**2)<n&&t?.()},g=x=>{r&&(x.preventDefault(),x.stopPropagation());const b=x.movementX,v=x.movementY,m=u.current?.width||1,w=u.current?.height||1,k=b/m,N=v/w;e?.(b,v,k,N,m,w)};document.addEventListener("mouseup",p),document.addEventListener("mousemove",g)};return a.addEventListener("mousedown",d),()=>{a.removeEventListener("mousedown",d)}},[a,o,e,t,n,r]),{isDragging:i,dragRef:h}}/**
61
61
  * @license lucide-react v0.542.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const gy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),my=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),_l=e=>{const t=my(e);return t.charAt(0).toUpperCase()+t.slice(1)},El=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),yy=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
65
+ */const rx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ix=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),Sl=e=>{const t=ix(e);return t.charAt(0).toUpperCase()+t.slice(1)},Cl=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),sx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
66
66
  * @license lucide-react v0.542.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
- */var xy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
70
+ */var ax={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
71
  * @license lucide-react v0.542.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const wy=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:s,...a},l)=>T.createElement("svg",{ref:l,...xy,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:El("lucide",r),...!i&&!yy(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,d])=>T.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
75
+ */const cx=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:s,...a},c)=>O.createElement("svg",{ref:c,...ax,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Cl("lucide",r),...!i&&!sx(a)&&{"aria-hidden":"true"},...a},[...s.map(([l,u])=>O.createElement(l,u)),...Array.isArray(i)?i:[i]]));/**
76
76
  * @license lucide-react v0.542.0 - ISC
77
77
  *
78
78
  * This source code is licensed under the ISC license.
79
79
  * See the LICENSE file in the root directory of this source tree.
80
- */const rn=(e,t)=>{const n=T.forwardRef(({className:o,...r},i)=>T.createElement(wy,{ref:i,iconNode:t,className:El(`lucide-${gy(_l(e))}`,`lucide-${e}`,o),...r}));return n.displayName=_l(e),n};/**
80
+ */const Cn=(e,t)=>{const n=O.forwardRef(({className:o,...r},i)=>O.createElement(cx,{ref:i,iconNode:t,className:Cl(`lucide-${rx(Sl(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Sl(e),n};/**
81
81
  * @license lucide-react v0.542.0 - ISC
82
82
  *
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
- */const by=rn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
85
+ */const lx=Cn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
86
86
  * @license lucide-react v0.542.0 - ISC
87
87
  *
88
88
  * This source code is licensed under the ISC license.
89
89
  * See the LICENSE file in the root directory of this source tree.
90
- */const vy=rn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
90
+ */const ux=Cn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
91
91
  * @license lucide-react v0.542.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
- */const Sl=rn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
95
+ */const Nl=Cn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
96
96
  * @license lucide-react v0.542.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
- */const _y=rn("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
100
+ */const dx=Cn("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
101
101
  * @license lucide-react v0.542.0 - ISC
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const Ey=rn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),so=T.forwardRef(({name:e="Input",value:t,onChange:n=()=>{},className:o,min:r,max:i,step:s},a)=>{const[l,c]=T.useState(t??0),[d,f]=T.useState(!1),u=T.useRef(0),h=T.useRef(0),p=t??l,g=T.useRef(0);T.useEffect(()=>{g.current=Math.abs(s??parseFloat(i===void 0||r===void 0?(p||1).toString():(i-r).toString()))},[p,s,i,r]);const{isDragging:y,dragRef:w}=vl({onMove:(V,j,D,L,b)=>{const I=V/(b+60);u.current+=I,Math.abs(u.current)>.05&&Date.now()-h.current>50&&(h.current=Date.now(),_(g.current*u.current),u.current=0)},onClick:C,clickThreshold:2});function _(V){c(j=>{let D=j+V;return r!==void 0&&D<=r?D=r:i!==void 0&&D>=i&&(D=i),n(D),D})}function m(V=.1){_(g.current*V)}function x(V=.1){_(-g.current*V)}function C(){f(!0)}function E(V){_(V-p),f(!1)}const M=y,N=r!==void 0&&i!==void 0&&p!==void 0&&i!==r?(p-r)/(i-r)*100:-1,z=N!==-1?`linear-gradient(90deg,#4772b3 ${N}%, #545454 ${N}%)`:"";return d?v.jsx(on,{className:"w-full",placeholder:e,value:p,allowOnlyNumbers:!0,onChange:V=>E(V),ref:a}):v.jsxs("div",{className:ie("flex items-center gap-0 group/lightParentGroupBasedHover w-max rounded-md bg-primary-gray",o),style:z!==""?{background:z}:{},ref:a,children:[v.jsx(st,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-r-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>x(.1),"aria-label":`Decrement ${e}`,applyHoverStyles:!M,children:v.jsx(vy,{})}),v.jsxs(st,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-none pl-1.5 pr-0 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent",applyHoverStyles:!M,ref:w,children:[v.jsx("span",{className:"truncate text-left",children:e}),v.jsx("span",{className:"truncate",children:p.toFixed(4)})]}),v.jsx(st,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-l-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>m(.1),"aria-label":`Increment ${e}`,applyHoverStyles:!M,children:v.jsx(Sl,{})})]})});so.displayName="SliderNumberInput";const Nl=({subItems:e,onItemClick:t,className:n})=>{const[o,r]=T.useState(null),i=s=>{s.onClick&&s.onClick(),t&&t(s)};return v.jsx("ul",{className:ie("min-w-48 bg-[#181818] border border-none rounded-md shadow-lg py-1",n),children:e.map((s,a)=>v.jsxs("li",{className:"relative",children:[s.separator&&a>0&&v.jsx("div",{className:"border-t border-gray-600 m-0"}),v.jsxs("div",{className:ie("flex items-center justify-between gap-2 px-3 py-1.25 hover:bg-[#3F3F3F] cursor-pointer","transition-colors duration-150"),onClick:()=>i(s),onMouseEnter:()=>r(s.id),onMouseLeave:()=>r(null),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[s.icon&&v.jsx("span",{className:"text-primary-white w-3 h-3 flex items-center justify-center",children:s.icon}),v.jsx("span",{className:"text-sm leading-3.5 text-primary-white font-main",children:s.label})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[s.shortcut&&v.jsx("span",{className:"text-sm leading-3.5 text-gray-400 font-mono",children:s.shortcut}),s.subItems&&s.subItems.length>0&&v.jsx(Sl,{className:"w-3 h-3 text-gray-400"})]})]}),s.subItems&&s.subItems.length>0&&o===s.id&&v.jsx("div",{className:"absolute left-full top-0 z-50",onMouseEnter:()=>r(s.id),onMouseLeave:()=>r(null),children:v.jsx(Nl,{subItems:s.subItems,onItemClick:t,className:"ml-1"})})]},s.id))})},Cl=({subItems:e,className:t,onItemClick:n})=>v.jsx("div",{className:ie("relative",t),children:v.jsx(Nl,{subItems:e,onItemClick:n})});function kl({typeOfNodes:e,dispatch:t,setContextMenu:n,contextMenuPosition:o}){const r=Object.keys(e);if(r.length===0)return[];const i=r.map(s=>({id:`add-${s}`,label:e[s].name,onClick:()=>{t({type:Pe.ADD_NODE_AND_SELECT,payload:{type:s,position:o}}),n({isOpen:!1,position:{x:0,y:0}})}}));return[{id:"add-node",label:"Add Node",icon:T.createElement(Ey,{className:"w-4 h-4"}),subItems:i}]}const se=["circle","square","rectangle","list","grid","diamond","trapezium","hexagon","star","cross","zigzag","sparkle","parallelogram"],fe={[se[0]]:se[0],[se[1]]:se[1],[se[2]]:se[2],[se[3]]:se[3],[se[4]]:se[4],[se[5]]:se[5],[se[6]]:se[6],[se[7]]:se[7],[se[8]]:se[8],[se[9]]:se[9],[se[10]]:se[10],[se[11]]:se[11],[se[12]]:se[12]},ao=(e,t,n,o="black",r=2)=>v.jsxs("div",{className:ie("relative",n),children:[v.jsx("div",{className:"absolute",style:{top:-r,left:-r,right:-r,bottom:-r,backgroundColor:o,clipPath:e}}),v.jsx("div",{className:"absolute inset-0",style:{backgroundColor:t,clipPath:e}})]}),Tl=(e=fe.circle,t="#A1A1A1",n)=>{const o="border-2 border-black",r="border-1 border-black",i={backgroundColor:t};switch(e){case fe.circle:return v.jsx("div",{className:ie("w-6 h-6 rounded-full",o,n),style:i});case fe.square:return v.jsx("div",{className:ie("w-6 h-6",o,n),style:i});case fe.rectangle:return v.jsx("div",{className:ie("w-4 h-8",o,n),style:i});case fe.list:return v.jsx("div",{className:ie("w-6 h-6 flex flex-col justify-center gap-0.5",n),children:[0,1,2].map(s=>v.jsx("div",{className:ie("w-full h-2",r),style:i},s))});case fe.grid:return v.jsx("div",{className:ie("w-6 h-6 grid grid-cols-2 gap-0.5",n),children:[0,1,2,3].map(s=>v.jsx("div",{className:ie("w-full h-full",r),style:i},s))});case fe.diamond:return v.jsx("div",{className:ie("w-6 h-6 rotate-45",o,n),style:i});case fe.trapezium:return ao("polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",t,ie("w-6 h-6",n));case fe.hexagon:return ao("polygon(-50% 50%,50% 100%,150% 50%,50% 0)",t,ie("w-5 h-6",n));case fe.star:return ao("polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",t,ie("w-6 h-6",n));case fe.cross:return v.jsxs("div",{className:ie("w-6 h-6 relative",n),children:[v.jsx("div",{className:ie("absolute top-1/2 left-0 w-full h-2 -translate-y-1/2",r),style:i}),v.jsx("div",{className:ie("absolute left-1/2 top-0 w-2 h-full -translate-x-1/2",r),style:i})]});case fe.zigzag:return v.jsx("div",{className:ie("w-6 h-6",n),style:{...i,width:"calc(4px + 24px/(2*tan(90deg/2)))",minHeight:"24px",mask:"4px 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg) exclude, 0 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg)",border:"2px solid black"}});case fe.sparkle:return v.jsx("div",{className:ie("w-6 h-6",n),style:{...i,mask:"radial-gradient(#0000 71%, #000 72%) 10000% 10000%/99.5% 99.5%",border:"2px solid black"}});case fe.parallelogram:return ao("polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)",t,ie("w-6 h-6",n));default:return v.jsx("div",{className:ie("w-6 h-6 rounded-full",o,n),style:i})}},lo=T.forwardRef(({type:e,position:t,id:n,color:o,shape:r=fe.circle,isCurrentlyInsideReactFlow:i=!1,className:s,...a},l)=>i?v.jsx(tn,{type:e,position:t,id:n,className:ie("!w-6 !h-6 !border-none !bg-transparent !pointer-events-auto",s),style:{backgroundColor:"transparent"},...a,ref:l,children:v.jsx("div",{className:ie("pointer-events-none flex justify-center"),children:Tl(r,o||"#A1A1A1",s)})}):v.jsx("div",{className:ie("absolute",t===q.Right&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",t===q.Left&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),...a,ref:l,children:Tl(r,o||"#A1A1A1",s)}));lo.displayName="ContextAwareHandle";const Ml=({input:e})=>{const t=en(),n=oo();return e.type==="string"?v.jsx(on,{placeholder:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:yl(e.id,i.data,{value:o})}:i))},allowOnlyNumbers:!1,className:"w-full"}):v.jsx(so,{name:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:yl(e.id,i.data,{value:o})}:i))},className:"w-full"})},Al=({input:e,isCurrentlyInsideReactFlow:t})=>t?v.jsx(Ml,{input:e}):e.type==="string"?v.jsx(on,{placeholder:e.name,value:e.value,onChange:e.onChange,allowOnlyNumbers:!1,className:"w-full"}):v.jsx(so,{name:e.name,value:e.value,onChange:e.onChange,className:"w-full"}),Tr=T.forwardRef(({input:e,isCurrentlyInsideReactFlow:t,hide:n=!1},o)=>{const r=t?Im({handleId:e.id}):[],i=t&&r.some(a=>a.targetHandle===e.id),s=e.allowInput&&!i;return v.jsxs("div",{ref:o,className:ie("text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row py-3",n&&"h-0 overflow-hidden py-0",s&&"py-1"),children:[v.jsx(lo,{type:"target",position:q.Left,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t}),v.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[!s&&v.jsx("div",{className:"truncate",children:e.name}),s&&v.jsx("div",{className:"flex-1 w-full",children:v.jsx(Al,{input:e,isCurrentlyInsideReactFlow:t})})]})]},e.id)});Tr.displayName="RenderInput";const Il=T.forwardRef(({output:e,isCurrentlyInsideReactFlow:t},n)=>v.jsxs("div",{ref:n,className:"text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row justify-end py-3",children:[v.jsx("div",{className:"truncate text-right",children:e.name}),v.jsx(lo,{type:"source",position:q.Right,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t})]},e.id));Il.displayName="RenderOutput";const Pl=T.forwardRef(({panel:e,isCurrentlyInsideReactFlow:t,isOpen:n,onToggle:o},r)=>v.jsxs("div",{ref:r,className:"flex flex-col",children:[v.jsxs(st,{onClick:i=>{i.stopPropagation(),i.preventDefault(),o()},className:"bg-transparent border-none hover:bg-primary-gray rounded-none justify-start",children:[n?v.jsx(_y,{className:"w-6 h-6 flex-shrink-0 mr-2"}):v.jsx(by,{className:"w-6 h-6 flex-shrink-0 mr-2"}),v.jsx("span",{className:"truncate",children:e.name})]}),v.jsx("div",{className:ie("flex flex-col bg-[#272727]",!n&&"h-0 overflow-hidden"),children:e.inputs.map(i=>v.jsx(Tr,{input:i,isCurrentlyInsideReactFlow:t,hide:!n},i.id))})]},e.id));Pl.displayName="RenderInputPanel";const Mr=T.forwardRef(({name:e="Node",headerColor:t="#79461D",inputs:n=[],outputs:o=[],isCurrentlyInsideReactFlow:r=!1,className:i,nodeResizerProps:s={},...a},l)=>{const[c,d]=T.useState(new Set),f=u=>{d(h=>{const p=new Set(h);return p.has(u)?p.delete(u):p.add(u),p})};return v.jsxs("div",{tabIndex:0,className:ie("flex flex-col gap-0 rounded-md w-max border-[1.5px] border-transparent focus:border-white","in-[.selected]:border-white",i),...a,ref:l,children:[v.jsx("div",{className:`text-primary-white text-left text-[27px] leading-[27px] font-main \\
106
- py-2 px-4 transition-all rounded-t-md truncate`,style:{backgroundColor:t},children:e}),v.jsxs("div",{className:"min-h-[50px] rounded-b-md bg-primary-dark-gray",children:[r&&v.jsx(bl,{...s}),v.jsx("div",{className:"flex flex-col py-4",children:o.map(u=>v.jsx(Il,{output:u,isCurrentlyInsideReactFlow:r},u.id))}),v.jsx("div",{className:"flex flex-col py-4",children:n.map(u=>{if("inputs"in u){const h=c.has(u.id);return v.jsx(Pl,{panel:u,isCurrentlyInsideReactFlow:r,isOpen:h,onToggle:()=>f(u.id)},u.id)}else return v.jsx(Tr,{input:u,isCurrentlyInsideReactFlow:r},u.id)})})]})]})});Mr.displayName="ConfigurableNode";const Ar=T.forwardRef(({data:e={}},t)=>v.jsx(Mr,{isCurrentlyInsideReactFlow:!0,className:"w-full",...e,ref:t}));Ar.displayName="ConfigurableNodeReactFlowWrapper";const Ol=({fromX:e,fromY:t,toX:n,toY:o,fromPosition:r,toPosition:i})=>{const{fromHandle:s}=tl(),a=vr(s?.nodeId||""),l=T.useMemo(()=>!s?.id||!a?.data?void 0:Nr(s?.id,a?.data)?.handleColor??"#A1A1A1",[s?.id,a?.data]),[c]=Gn({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:i});return v.jsx(_t,{path:c,className:"!stroke-7 in-[g.selected]:brightness-150",style:{stroke:l||"#A1A1A1"},focusable:!0})};Ol.displayName="ConfigurableConnection";const Sy={configurableNode:Ar},Ny={configurableEdge:kr};function Cy(e){const[t,n]=T.useReducer(ml,e);return{state:t,dispatch:n}}function ky({state:e,dispatch:t}){const[n,o]=T.useState({isOpen:!1,position:{x:0,y:0}}),{screenToFlowPosition:r}=en(),i=kl({typeOfNodes:e.typeOfNodes,dispatch:t,setContextMenu:o,contextMenuPosition:r(n.position)}),s=T.useCallback(l=>{l.preventDefault(),o({isOpen:!0,position:{x:l.clientX,y:l.clientY}})},[]),a=T.useCallback(()=>{o({isOpen:!1,position:{x:0,y:0}})},[]);return v.jsxs("div",{style:{width:"100%",height:"100%"},children:[v.jsxs(Mm,{nodes:e.nodes,edges:e.edges,onNodesChange:l=>t({type:Pe.UPDATE_NODE_BY_REACT_FLOW,payload:{changes:l}}),onEdgesChange:l=>t({type:Pe.UPDATE_EDGES_BY_REACT_FLOW,payload:{changes:l}}),onConnect:l=>t({type:Pe.ADD_EDGE_BY_REACT_FLOW,payload:{edge:l}}),fitView:!0,fitViewOptions:{maxZoom:.5,minZoom:.1},maxZoom:1,minZoom:.1,proOptions:{hideAttribution:!0},colorMode:"dark",selectNodesOnDrag:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectionMode:gt.Partial,nodeTypes:Sy,edgeTypes:Ny,deleteKeyCode:["Backspace","Delete","x"],connectionLineComponent:Ol,onContextMenu:s,onClick:a,children:[v.jsx(Fm,{}),v.jsx($m,{}),v.jsx(ny,{pannable:!0})]}),n.isOpen&&v.jsx("div",{style:{position:"absolute",top:n.position.y,left:n.position.x,zIndex:10},onClick:l=>l.stopPropagation(),children:v.jsx(Cl,{subItems:i})})]})}function Ty({state:e,dispatch:t}){return v.jsx(sl,{children:v.jsx(ky,{state:e,dispatch:t})})}Q.Button=st,Q.ConfigurableEdge=kr,Q.ConfigurableNode=Mr,Q.ConfigurableNodeReactFlowWrapper=Ar,Q.ContextAwareHandle=lo,Q.ContextAwareInput=Al,Q.ContextMenu=Cl,Q.FullGraph=Ty,Q.Input=on,Q.NodeResizerWithMoreControls=bl,Q.ReactFlowAwareInput=Ml,Q.SliderNumberInput=so,Q.actionTypesMap=Pe,Q.addEdgeWithTypeChecking=hl,Q.cn=ie,Q.constructInputOrOutputOfType=tt,Q.constructInputPanelOfType=dl,Q.constructNodeOfType=Sr,Q.constructTypeOfHandleFromIndices=fl,Q.convertStringToNumber=oi,Q.createNodeContextMenu=kl,Q.handleShapesMap=fe,Q.isCoordinateInBox=ni,Q.isNumberInRange=bo,Q.isSupportedUnderlyingType=jc,Q.isValidDataTypeId=Lc,Q.isValidNodeTypeUniqueId=Rc,Q.mainReducer=ml,Q.makeAllowedConversionsBetweenDataTypesWithAutoInfer=Fc,Q.makeDataTypeWithAutoInfer=Hc,Q.makeNodeIdToNodeTypeWithAutoInfer=Bc,Q.makeStateWithAutoInfer=Wc,Q.makeTypeOfNodeWithAutoInfer=Vc,Q.removeEdgeWithTypeChecking=pl,Q.sanitizeNumberToShowAsText=vo,Q.supportedUnderlyingTypesMap=ri,Q.useClickedOutside=wl,Q.useDrag=vl,Q.useFullGraph=Cy,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
105
+ */const fx=Cn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Mo=O.forwardRef(({name:e="Input",value:t,onChange:n=()=>{},className:o,min:r,max:i,step:s},a)=>{const[c,l]=O.useState(t??0),[u,h]=O.useState(!1),d=O.useRef(0),f=O.useRef(0),p=t??c,g=O.useRef(0);O.useEffect(()=>{g.current=Math.abs(s??parseFloat(i===void 0||r===void 0?(p||1).toString():(i-r).toString()))},[p,s,i,r]);const{isDragging:x,dragRef:b}=_l({onMove:(H,j,R,$,y)=>{const A=H/(y+60);d.current+=A,Math.abs(d.current)>.05&&Date.now()-f.current>50&&(f.current=Date.now(),v(g.current*d.current),d.current=0)},onClick:k,clickThreshold:2});function v(H){l(j=>{let R=j+H;return r!==void 0&&R<=r?R=r:i!==void 0&&R>=i&&(R=i),n(R),R})}function m(H=.1){v(g.current*H)}function w(H=.1){v(-g.current*H)}function k(){h(!0)}function N(H){v(H-p),h(!1)}const I=x,M=r!==void 0&&i!==void 0&&p!==void 0&&i!==r?(p-r)/(i-r)*100:-1,L=M!==-1?`linear-gradient(90deg,#4772b3 ${M}%, #545454 ${M}%)`:"";return u?C.jsx(Sn,{className:"w-full",placeholder:e,value:p,allowOnlyNumbers:!0,onChange:H=>N(H),ref:a}):C.jsxs("div",{className:se("flex items-center gap-0 group/lightParentGroupBasedHover w-max rounded-md bg-primary-gray",o),style:L!==""?{background:L}:{},ref:a,children:[C.jsx(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-r-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>w(.1),"aria-label":`Decrement ${e}`,applyHoverStyles:!I,children:C.jsx(ux,{})}),C.jsxs(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-none pl-1.5 pr-0 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent",applyHoverStyles:!I,ref:b,children:[C.jsx("span",{className:"truncate text-left",children:e}),C.jsx("span",{className:"truncate",children:p.toFixed(4)})]}),C.jsx(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-l-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>m(.1),"aria-label":`Increment ${e}`,applyHoverStyles:!I,children:C.jsx(Nl,{})})]})});Mo.displayName="SliderNumberInput";function Ao(){return typeof window<"u"}function Ht(e){return kl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(kl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kl(e){return Ao()?e instanceof Node||e instanceof Ee(e).Node:!1}function le(e){return Ao()?e instanceof Element||e instanceof Ee(e).Element:!1}function Ie(e){return Ao()?e instanceof HTMLElement||e instanceof Ee(e).HTMLElement:!1}function Io(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ee(e).ShadowRoot}const hx=new Set(["inline","contents"]);function Nn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!hx.has(r)}const px=new Set(["table","td","th"]);function gx(e){return px.has(Ht(e))}const mx=[":popover-open",":modal"];function Po(e){return mx.some(t=>{try{return e.matches(t)}catch{return!1}})}const yx=["transform","translate","scale","rotate","perspective"],xx=["transform","translate","scale","rotate","perspective","filter"],wx=["paint","layout","strict","content"];function hi(e){const t=Oo(),n=le(e)?Ce(e):e;return yx.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||xx.some(o=>(n.willChange||"").includes(o))||wx.some(o=>(n.contain||"").includes(o))}function bx(e){let t=Ge(e);for(;Ie(t)&&!Ue(t);){if(hi(t))return t;if(Po(t))return null;t=Ge(t)}return null}function Oo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vx=new Set(["html","body","#document"]);function Ue(e){return vx.has(Ht(e))}function Ce(e){return Ee(e).getComputedStyle(e)}function Do(e){return le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ht(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Io(e)&&e.host||He(e);return Io(t)?t.host:t}function Tl(e){const t=Ge(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ie(t)&&Nn(t)?t:Tl(t)}function et(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Tl(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Ee(r);if(i){const a=pi(s);return t.concat(s,s.visualViewport||[],Nn(r)?r:[],a&&n?et(a):[])}return t.concat(r,et(r,[],n))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Ro=Math.min,gt=Math.max,Lo=Math.round,$o=Math.floor,je=e=>({x:e,y:e}),Ex={left:"right",right:"left",bottom:"top",top:"bottom"},_x={start:"end",end:"start"};function Ml(e,t,n){return gt(e,Ro(t,n))}function zo(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function Al(e){return e==="x"?"y":"x"}function Il(e){return e==="y"?"height":"width"}const Sx=new Set(["top","bottom"]);function tt(e){return Sx.has(mt(e))?"y":"x"}function Pl(e){return Al(tt(e))}function Cx(e,t,n){n===void 0&&(n=!1);const o=Ho(e),r=Pl(e),i=Il(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=jo(s)),[s,jo(s)]}function Nx(e){const t=jo(e);return[gi(e),t,gi(t)]}function gi(e){return e.replace(/start|end/g,t=>_x[t])}const Ol=["left","right"],Dl=["right","left"],kx=["top","bottom"],Tx=["bottom","top"];function Mx(e,t,n){switch(e){case"top":case"bottom":return n?t?Dl:Ol:t?Ol:Dl;case"left":case"right":return t?kx:Tx;default:return[]}}function Ax(e,t,n,o){const r=Ho(e);let i=Mx(mt(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(gi)))),i}function jo(e){return e.replace(/left|right|bottom|top/g,t=>Ex[t])}function Ix(e){return{top:0,right:0,bottom:0,left:0,...e}}function Px(e){return typeof e!="number"?Ix(e):{top:e,right:e,bottom:e,left:e}}function Vo(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function mi(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Io(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function kn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function yi(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ox(e){return e.matches("html,body")}function jt(e){return e?.ownerDocument||document}function Fo(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Fo(e,r.id,n)])}function Dx(e){return"nativeEvent"in e}function xi(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var Rx=typeof document<"u",Lx=function(){},Vt=Rx?O.useLayoutEffect:Lx;const $x={...U};function Bo(e){const t=U.useRef(e);return Vt(()=>{t.current=e}),t}const zx=$x.useInsertionEffect||(e=>e());function Ve(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return zx(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Rl(e,t,n){let{reference:o,floating:r}=e;const i=tt(t),s=Pl(t),a=Il(s),c=mt(t),l=i==="y",u=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-r.width,y:h};break;default:f={x:o.x,y:o.y}}switch(Ho(t)){case"start":f[s]-=d*(n&&l?-1:1);break;case"end":f[s]+=d*(n&&l?-1:1);break}return f}const Hx=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:h}=Rl(l,o,c),d=o,f={},p=0;for(let g=0;g<a.length;g++){const{name:x,fn:b}=a[g],{x:v,y:m,data:w,reset:k}=await b({x:u,y:h,initialPlacement:o,placement:d,strategy:r,middlewareData:f,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,h=m??h,f={...f,[x]:{...f[x],...w}},k&&p<=50&&(p++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(l=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):k.rects),{x:u,y:h}=Rl(l,d,c)),g=-1)}return{x:u,y:h,placement:d,strategy:r,middlewareData:f}};async function Ll(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=zo(t,e),p=Px(f),x=a[d?h==="floating"?"reference":"floating":h],b=Vo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=h==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},k=Vo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:m,strategy:c}):v);return{top:(b.top-k.top+p.top)/w.y,bottom:(k.bottom-b.bottom+p.bottom)/w.y,left:(b.left-k.left+p.left)/w.x,right:(k.right-b.right+p.right)/w.x}}const jx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...x}=zo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=mt(r),v=tt(a),m=mt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=d||(m||!g?[jo(a)]:Nx(a)),N=p!=="none";!d&&N&&k.push(...Ax(a,g,p,w));const I=[a,...k],M=await Ll(t,x),L=[];let H=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push(M[b]),h){const y=Cx(r,s,w);L.push(M[y[0]],M[y[1]])}if(H=[...H,{placement:r,overflows:L}],!L.every(y=>y<=0)){var j,R;const y=(((j=i.flip)==null?void 0:j.index)||0)+1,A=I[y];if(A&&(!(h==="alignment"?v!==tt(A):!1)||H.every(E=>tt(E.placement)===v?E.overflows[0]>0:!0)))return{data:{index:y,overflows:H},reset:{placement:A}};let T=(R=H.filter(S=>S.overflows[0]<=0).sort((S,E)=>S.overflows[1]-E.overflows[1])[0])==null?void 0:R.placement;if(!T)switch(f){case"bestFit":{var $;const S=($=H.filter(E=>{if(N){const P=tt(E.placement);return P===v||P==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(P=>P>0).reduce((P,_)=>P+_,0)]).sort((E,P)=>E[1]-P[1])[0])==null?void 0:$[0];S&&(T=S);break}case"initialPlacement":T=a;break}if(r!==T)return{reset:{placement:T}}}return{}}}},Vx=new Set(["left","top"]);async function Fx(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=mt(n),a=Ho(n),c=tt(n)==="y",l=Vx.has(s)?-1:1,u=i&&c?-1:1,h=zo(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:d*l}:{x:d*l,y:f*u}}const Bx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await Fx(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},Wx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:b,y:v}=x;return{x:b,y:v}}},...c}=zo(e,t),l={x:n,y:o},u=await Ll(t,c),h=tt(mt(r)),d=Al(h);let f=l[d],p=l[h];if(i){const x=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=f+u[x],m=f-u[b];f=Ml(v,f,m)}if(s){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[x],m=p-u[b];p=Ml(v,p,m)}const g=a.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:i,[h]:s}}}}}};function $l(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ie(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Lo(n)!==i||Lo(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function wi(e){return le(e)?e:e.contextElement}function Ft(e){const t=wi(e);if(!Ie(t))return je(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=$l(t);let s=(i?Lo(n.width):n.width)/o,a=(i?Lo(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Yx=je(0);function zl(e){const t=Ee(e);return!Oo()||!t.visualViewport?Yx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ee(e)?!1:t}function yt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=wi(e);let s=je(1);t&&(o?le(o)&&(s=Ft(o)):s=Ft(e));const a=Xx(i,n,o)?zl(i):je(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,u=r.width/s.x,h=r.height/s.y;if(i){const d=Ee(i),f=o&&le(o)?Ee(o):o;let p=d,g=pi(p);for(;g&&o&&f!==p;){const x=Ft(g),b=g.getBoundingClientRect(),v=Ce(g),m=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,w=b.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,l*=x.y,u*=x.x,h*=x.y,c+=m,l+=w,p=Ee(g),g=pi(p)}}return Vo({width:u,height:h,x:c,y:l})}function Wo(e,t){const n=Do(e).scrollLeft;return t?t.left+n:yt(He(e)).left+n}function Hl(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Wo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ux(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=He(o),a=t?Po(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=je(1);const u=je(0),h=Ie(o);if((h||!h&&!i)&&((Ht(o)!=="body"||Nn(s))&&(c=Do(o)),Ie(o))){const f=yt(o);l=Ft(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const d=s&&!h&&!i?Hl(s,c):je(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-c.scrollTop*l.y+u.y+d.y}}function Gx(e){return Array.from(e.getClientRects())}function qx(e){const t=He(e),n=Do(e),o=e.ownerDocument.body,r=gt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=gt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Wo(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(s+=gt(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const jl=25;function Zx(e,t){const n=Ee(e),o=He(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const u=Oo();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=Wo(o);if(l<=0){const u=o.ownerDocument,h=u.body,d=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(o.clientWidth-h.clientWidth-f);p<=jl&&(i-=p)}else l<=jl&&(i+=l);return{width:i,height:s,x:a,y:c}}const Kx=new Set(["absolute","fixed"]);function Qx(e,t){const n=yt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Ie(e)?Ft(e):je(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function Vl(e,t,n){let o;if(t==="viewport")o=Zx(e,n);else if(t==="document")o=qx(He(e));else if(le(t))o=Qx(t,n);else{const r=zl(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vo(o)}function Fl(e,t){const n=Ge(e);return n===t||!le(n)||Ue(n)?!1:Ce(n).position==="fixed"||Fl(n,t)}function Jx(e,t){const n=t.get(e);if(n)return n;let o=et(e,[],!1).filter(a=>le(a)&&Ht(a)!=="body"),r=null;const i=Ce(e).position==="fixed";let s=i?Ge(e):e;for(;le(s)&&!Ue(s);){const a=Ce(s),c=hi(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&Kx.has(r.position)||Nn(s)&&!c&&Fl(e,s))?o=o.filter(u=>u!==s):r=a,s=Ge(s)}return t.set(e,o),o}function ew(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Po(t)?[]:Jx(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((l,u)=>{const h=Vl(t,u,r);return l.top=gt(h.top,l.top),l.right=Ro(h.right,l.right),l.bottom=Ro(h.bottom,l.bottom),l.left=gt(h.left,l.left),l},Vl(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tw(e){const{width:t,height:n}=$l(e);return{width:t,height:n}}function nw(e,t,n){const o=Ie(t),r=He(t),i=n==="fixed",s=yt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=je(0);function l(){c.x=Wo(r)}if(o||!o&&!i)if((Ht(t)!=="body"||Nn(r))&&(a=Do(t)),o){const f=yt(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&l();i&&!o&&r&&l();const u=r&&!o&&!i?Hl(r,a):je(0),h=s.left+a.scrollLeft-c.x-u.x,d=s.top+a.scrollTop-c.y-u.y;return{x:h,y:d,width:s.width,height:s.height}}function bi(e){return Ce(e).position==="static"}function Bl(e,t){if(!Ie(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function Wl(e,t){const n=Ee(e);if(Po(e))return n;if(!Ie(e)){let r=Ge(e);for(;r&&!Ue(r);){if(le(r)&&!bi(r))return r;r=Ge(r)}return n}let o=Bl(e,t);for(;o&&gx(o)&&bi(o);)o=Bl(o,t);return o&&Ue(o)&&bi(o)&&!hi(o)?n:o||bx(e)||n}const ow=async function(e){const t=this.getOffsetParent||Wl,n=this.getDimensions,o=await n(e.floating);return{reference:nw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rw(e){return Ce(e).direction==="rtl"}const iw={convertOffsetParentRelativeRectToViewportRelativeRect:Ux,getDocumentElement:He,getClippingRect:ew,getOffsetParent:Wl,getElementRects:ow,getClientRects:Gx,getDimensions:tw,getScale:Ft,isElement:le,isRTL:rw};function Yl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sw(e,t){let n=null,o;const r=He(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:h,width:d,height:f}=l;if(a||t(),!d||!f)return;const p=$o(h),g=$o(r.clientWidth-(u+d)),x=$o(r.clientHeight-(h+f)),b=$o(u),m={rootMargin:-p+"px "+-g+"px "+-x+"px "+-b+"px",threshold:gt(0,Ro(1,c))||1};let w=!0;function k(N){const I=N[0].intersectionRatio;if(I!==c){if(!w)return s();I?s(!1,I):o=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Yl(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(k,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(k,m)}n.observe(e)}return s(!0),i}function Xl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=wi(e),u=r||i?[...l?et(l):[],...et(t)]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=l&&a?sw(l,n):null;let d=-1,f=null;s&&(f=new ResizeObserver(b=>{let[v]=b;v&&v.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var m;(m=f)==null||m.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let p,g=c?yt(e):null;c&&x();function x(){const b=yt(e);g&&!Yl(g,b)&&n(),g=b,p=requestAnimationFrame(x)}return n(),()=>{var b;u.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(b=f)==null||b.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const aw=Bx,cw=Wx,lw=jx,uw=(e,t,n)=>{const o=new Map,r={platform:iw,...n},i={...r.platform,_c:o};return Hx(e,t,{...r,platform:i})};var dw=typeof document<"u",fw=function(){},Yo=dw?O.useLayoutEffect:fw;function Xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Xo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Xo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ul(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gl(e,t){const n=Ul(e);return Math.round(t*n)/n}function vi(e){const t=U.useRef(e);return Yo(()=>{t.current=e}),t}function hw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,h]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=U.useState(o);Xo(d,o)||f(o);const[p,g]=U.useState(null),[x,b]=U.useState(null),v=U.useCallback(E=>{E!==N.current&&(N.current=E,g(E))},[]),m=U.useCallback(E=>{E!==I.current&&(I.current=E,b(E))},[]),w=i||p,k=s||x,N=U.useRef(null),I=U.useRef(null),M=U.useRef(u),L=c!=null,H=vi(c),j=vi(r),R=vi(l),$=U.useCallback(()=>{if(!N.current||!I.current)return;const E={placement:t,strategy:n,middleware:d};j.current&&(E.platform=j.current),uw(N.current,I.current,E).then(P=>{const _={...P,isPositioned:R.current!==!1};y.current&&!Xo(M.current,_)&&(M.current=_,Mu.flushSync(()=>{h(_)}))})},[d,t,n,j,R]);Yo(()=>{l===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(E=>({...E,isPositioned:!1})))},[l]);const y=U.useRef(!1);Yo(()=>(y.current=!0,()=>{y.current=!1}),[]),Yo(()=>{if(w&&(N.current=w),k&&(I.current=k),w&&k){if(H.current)return H.current(w,k,$);$()}},[w,k,$,H,L]);const A=U.useMemo(()=>({reference:N,floating:I,setReference:v,setFloating:m}),[v,m]),T=U.useMemo(()=>({reference:w,floating:k}),[w,k]),S=U.useMemo(()=>{const E={position:n,left:0,top:0};if(!T.floating)return E;const P=Gl(T.floating,u.x),_=Gl(T.floating,u.y);return a?{...E,transform:"translate("+P+"px, "+_+"px)",...Ul(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:_}},[n,a,T.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:$,refs:A,elements:T,floatingStyles:S}),[u,$,A,T,S])}const ql=(e,t)=>({...aw(e),options:[e,t]}),Zl=(e,t)=>({...cw(e),options:[e,t]}),Kl=(e,t)=>({...lw(e),options:[e,t]}),pw="data-floating-ui-focusable",Ql="active",Jl="selected",gw={...U};let eu=!1,mw=0;const tu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+mw++;function yw(){const[e,t]=U.useState(()=>eu?tu():void 0);return Vt(()=>{e==null&&t(tu())},[]),U.useEffect(()=>{eu=!0},[]),e}const xw=gw.useId||yw;let Ei;process.env.NODE_ENV!=="production"&&(Ei=new Set);function ww(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Ei)!=null&&e.has(r))){var i;(i=Ei)==null||i.add(r),console.error(r)}}function bw(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const vw=U.createContext(null),Ew=U.createContext(null),nu=()=>{var e;return((e=U.useContext(vw))==null?void 0:e.id)||null},_i=()=>U.useContext(Ew);function ou(e){return"data-floating-ui-"+e}function _e(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const ru=ou("safe-polygon");function Si(e,t,n){if(n&&!xi(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Ci(e){return typeof e=="function"?e():e}function _w(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:s}=e,{enabled:a=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:h=0,move:d=!0}=t,f=_i(),p=nu(),g=Bo(l),x=Bo(c),b=Bo(n),v=Bo(h),m=U.useRef(),w=U.useRef(-1),k=U.useRef(),N=U.useRef(-1),I=U.useRef(!0),M=U.useRef(!1),L=U.useRef(()=>{}),H=U.useRef(!1),j=Ve(()=>{var S;const E=(S=r.current.openEvent)==null?void 0:S.type;return E?.includes("mouse")&&E!=="mousedown"});U.useEffect(()=>{if(!a)return;function S(E){let{open:P}=E;P||(_e(w),_e(N),I.current=!0,H.current=!1)}return i.on("openchange",S),()=>{i.off("openchange",S)}},[a,i]),U.useEffect(()=>{if(!a||!g.current||!n)return;function S(P){j()&&o(!1,P,"hover")}const E=jt(s.floating).documentElement;return E.addEventListener("mouseleave",S),()=>{E.removeEventListener("mouseleave",S)}},[s.floating,n,o,a,g,j]);const R=U.useCallback(function(S,E,P){E===void 0&&(E=!0),P===void 0&&(P="hover");const _=Si(x.current,"close",m.current);_&&!k.current?(_e(w),w.current=window.setTimeout(()=>o(!1,S,P),_)):E&&(_e(w),o(!1,S,P))},[x,o]),$=Ve(()=>{L.current(),k.current=void 0}),y=Ve(()=>{if(M.current){const S=jt(s.floating).body;S.style.pointerEvents="",S.removeAttribute(ru),M.current=!1}}),A=Ve(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);U.useEffect(()=>{if(!a)return;function S(z){if(_e(w),I.current=!1,u&&!xi(m.current)||Ci(v.current)>0&&!Si(x.current,"open"))return;const F=Si(x.current,"open",m.current);F?w.current=window.setTimeout(()=>{b.current||o(!0,z,"hover")},F):n||o(!0,z,"hover")}function E(z){if(A()){y();return}L.current();const F=jt(s.floating);if(_e(N),H.current=!1,g.current&&r.current.floatingContext){n||_e(w),k.current=g.current({...r.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){y(),$(),A()||R(z,!0,"safe-polygon")}});const Y=k.current;F.addEventListener("mousemove",Y),L.current=()=>{F.removeEventListener("mousemove",Y)};return}(m.current==="touch"?!mi(s.floating,z.relatedTarget):!0)&&R(z)}function P(z){A()||r.current.floatingContext&&(g.current==null||g.current({...r.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){y(),$(),A()||R(z)}})(z))}function _(){_e(w)}function D(z){A()||R(z,!1)}if(le(s.domReference)){const z=s.domReference,F=s.floating;return n&&z.addEventListener("mouseleave",P),d&&z.addEventListener("mousemove",S,{once:!0}),z.addEventListener("mouseenter",S),z.addEventListener("mouseleave",E),F&&(F.addEventListener("mouseleave",P),F.addEventListener("mouseenter",_),F.addEventListener("mouseleave",D)),()=>{n&&z.removeEventListener("mouseleave",P),d&&z.removeEventListener("mousemove",S),z.removeEventListener("mouseenter",S),z.removeEventListener("mouseleave",E),F&&(F.removeEventListener("mouseleave",P),F.removeEventListener("mouseenter",_),F.removeEventListener("mouseleave",D))}}},[s,a,e,u,d,R,$,y,o,n,b,f,x,g,r,A,v]),Vt(()=>{var S;if(a&&n&&(S=g.current)!=null&&(S=S.__options)!=null&&S.blockPointerEvents&&j()){M.current=!0;const P=s.floating;if(le(s.domReference)&&P){var E;const _=jt(s.floating).body;_.setAttribute(ru,"");const D=s.domReference,z=f==null||(E=f.nodesRef.current.find(F=>F.id===p))==null||(E=E.context)==null?void 0:E.elements.floating;return z&&(z.style.pointerEvents=""),_.style.pointerEvents="none",D.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{_.style.pointerEvents="",D.style.pointerEvents="",P.style.pointerEvents=""}}}},[a,n,p,s,f,g,j]),Vt(()=>{n||(m.current=void 0,H.current=!1,$(),y())},[n,$,y]),U.useEffect(()=>()=>{$(),_e(w),_e(N),y()},[a,s.domReference,$,y]);const T=U.useMemo(()=>{function S(E){m.current=E.pointerType}return{onPointerDown:S,onPointerEnter:S,onMouseMove(E){const{nativeEvent:P}=E;function _(){!I.current&&!b.current&&o(!0,P,"hover")}u&&!xi(m.current)||n||Ci(v.current)===0||H.current&&E.movementX**2+E.movementY**2<2||(_e(N),m.current==="touch"?_():(H.current=!0,N.current=window.setTimeout(_,Ci(v.current))))}}},[u,o,n,b,v]);return U.useMemo(()=>a?{reference:T}:{},[a,T])}function Ni(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Io(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Sw(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Cw={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Nw={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},iu=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function kw(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:h="pointerdown",ancestorScroll:d=!1,bubbles:f,capture:p}=t,g=_i(),x=Ve(typeof c=="function"?c:()=>!1),b=typeof c=="function"?x:c,v=U.useRef(!1),{escapeKey:m,outsidePress:w}=iu(f),{escapeKey:k,outsidePress:N}=iu(p),I=U.useRef(!1),M=Ve(y=>{var A;if(!n||!s||!a||y.key!=="Escape"||I.current)return;const T=(A=i.current.floatingContext)==null?void 0:A.nodeId,S=g?Fo(g.nodesRef.current,T):[];if(!m&&(y.stopPropagation(),S.length>0)){let E=!0;if(S.forEach(P=>{var _;if((_=P.context)!=null&&_.open&&!P.context.dataRef.current.__escapeKeyBubbles){E=!1;return}}),!E)return}o(!1,Dx(y)?y.nativeEvent:y,"escape-key")}),L=Ve(y=>{var A;const T=()=>{var S;M(y),(S=kn(y))==null||S.removeEventListener("keydown",T)};(A=kn(y))==null||A.addEventListener("keydown",T)}),H=Ve(y=>{var A;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const S=v.current;if(v.current=!1,l==="click"&&S||T||typeof b=="function"&&!b(y))return;const E=kn(y),P="["+ou("inert")+"]",_=jt(r.floating).querySelectorAll(P);let D=le(E)?E:null;for(;D&&!Ue(D);){const Y=Ge(D);if(Ue(Y)||!le(Y))break;D=Y}if(_.length&&le(E)&&!Ox(E)&&!mi(E,r.floating)&&Array.from(_).every(Y=>!mi(D,Y)))return;if(Ie(E)&&$){const Y=Ue(E),K=Ce(E),W=/auto|scroll/,V=Y||W.test(K.overflowX),X=Y||W.test(K.overflowY),J=V&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,te=X&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,Z=K.direction==="rtl",oe=te&&(Z?y.offsetX<=E.offsetWidth-E.clientWidth:y.offsetX>E.clientWidth),ne=J&&y.offsetY>E.clientHeight;if(oe||ne)return}const z=(A=i.current.floatingContext)==null?void 0:A.nodeId,F=g&&Fo(g.nodesRef.current,z).some(Y=>{var K;return yi(y,(K=Y.context)==null?void 0:K.elements.floating)});if(yi(y,r.floating)||yi(y,r.domReference)||F)return;const B=g?Fo(g.nodesRef.current,z):[];if(B.length>0){let Y=!0;if(B.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}o(!1,y,"outside-press")}),j=Ve(y=>{var A;const T=()=>{var S;H(y),(S=kn(y))==null||S.removeEventListener(l,T)};(A=kn(y))==null||A.addEventListener(l,T)});U.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=m,i.current.__outsidePressBubbles=w;let y=-1;function A(_){o(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(y),I.current=!0}function S(){y=window.setTimeout(()=>{I.current=!1},Oo()?5:0)}const E=jt(r.floating);a&&(E.addEventListener("keydown",k?L:M,k),E.addEventListener("compositionstart",T),E.addEventListener("compositionend",S)),b&&E.addEventListener(l,N?j:H,N);let P=[];return d&&(le(r.domReference)&&(P=et(r.domReference)),le(r.floating)&&(P=P.concat(et(r.floating))),!le(r.reference)&&r.reference&&r.reference.contextElement&&(P=P.concat(et(r.reference.contextElement)))),P=P.filter(_=>{var D;return _!==((D=E.defaultView)==null?void 0:D.visualViewport)}),P.forEach(_=>{_.addEventListener("scroll",A,{passive:!0})}),()=>{a&&(E.removeEventListener("keydown",k?L:M,k),E.removeEventListener("compositionstart",T),E.removeEventListener("compositionend",S)),b&&E.removeEventListener(l,N?j:H,N),P.forEach(_=>{_.removeEventListener("scroll",A)}),window.clearTimeout(y)}},[i,r,a,b,l,n,o,d,s,m,w,M,k,L,H,N,j]),U.useEffect(()=>{i.current.insideReactTree=!1},[i,b,l]);const R=U.useMemo(()=>({onKeyDown:M,...u&&{[Cw[h]]:y=>{o(!1,y.nativeEvent,"reference-press")},...h!=="click"&&{onClick(y){o(!1,y.nativeEvent,"reference-press")}}}}),[M,o,u,h]),$=U.useMemo(()=>({onKeyDown:M,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[Nw[l]]:()=>{i.current.insideReactTree=!0}}),[M,l,i]);return U.useMemo(()=>s?{reference:R,floating:$}:{},[s,R,$])}function Tw(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=xw(),i=U.useRef({}),[s]=U.useState(()=>bw()),a=nu()!=null;if(process.env.NODE_ENV!=="production"){const f=o.reference;f&&!le(f)&&ww("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=U.useState(o.reference),u=Ve((f,p,g)=>{i.current.openEvent=f?p:void 0,s.emit("openchange",{open:f,event:p,reason:g,nested:a}),n?.(f,p,g)}),h=U.useMemo(()=>({setPositionReference:l}),[]),d=U.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return U.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:r,refs:h}),[t,u,d,s,r,h])}function su(e){e===void 0&&(e={});const{nodeId:t}=e,n=Tw({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,s]=U.useState(null),[a,c]=U.useState(null),u=r?.domReference||i,h=U.useRef(null),d=_i();Vt(()=>{u&&(h.current=u)},[u]);const f=hw({...e,elements:{...r,...a&&{reference:a}}}),p=U.useCallback(m=>{const w=le(m)?{getBoundingClientRect:()=>m.getBoundingClientRect(),getClientRects:()=>m.getClientRects(),contextElement:m}:m;c(w),f.refs.setReference(w)},[f.refs]),g=U.useCallback(m=>{(le(m)||m===null)&&(h.current=m,s(m)),(le(f.refs.reference.current)||f.refs.reference.current===null||m!==null&&!le(m))&&f.refs.setReference(m)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:g,setPositionReference:p,domReference:h}),[f.refs,g,p]),b=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),v=U.useMemo(()=>({...f,...o,refs:x,elements:b,nodeId:t}),[f,x,b,t,o]);return Vt(()=>{o.dataRef.current.floatingContext=v;const m=d?.nodesRef.current.find(w=>w.id===t);m&&(m.context=v)}),U.useMemo(()=>({...f,context:v,refs:x,elements:b}),[f,x,b,v])}function ki(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Ql]:s,[Jl]:a,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[pw]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(r&&[Ql,Jl].includes(l)))if(l.indexOf("on")===0){if(o.has(l)||o.set(l,[]),typeof u=="function"){var h;(h=o.get(l))==null||h.push(u),s[l]=function(){for(var d,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return(d=o.get(l))==null?void 0:d.map(x=>x(...p)).find(x=>x!==void 0)}}}else s[l]=u}),s),{})}}function au(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),o=e.map(a=>a?.item),r=U.useCallback(a=>ki(a,e,"reference"),t),i=U.useCallback(a=>ki(a,e,"floating"),n),s=U.useCallback(a=>ki(a,e,"item"),o);return U.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function cu(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...cu(e,r.id,n)])}function lu(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[c,l]=t[s]||[0,0],[u,h]=t[a]||[0,0];l>=o!=h>=o&&n<=(u-c)*(o-l)/(h-l)+c&&(r=!r)}return r}function Mw(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Aw(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,s=null,a=null,c=typeof performance<"u"?performance.now():0;function l(h,d){const f=performance.now(),p=f-c;if(s===null||a===null||p===0)return s=h,a=d,c=f,null;const g=h-s,x=d-a,v=Math.sqrt(g*g+x*x)/p;return s=h,a=d,c=f,v}const u=h=>{let{x:d,y:f,placement:p,elements:g,onClose:x,nodeId:b,tree:v}=h;return function(w){function k(){_e(r),x()}if(_e(r),!g.domReference||!g.floating||p==null||d==null||f==null)return;const{clientX:N,clientY:I}=w,M=[N,I],L=Sw(w),H=w.type==="mouseleave",j=Ni(g.floating,L),R=Ni(g.domReference,L),$=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),A=p.split("-")[0],T=d>y.right-y.width/2,S=f>y.bottom-y.height/2,E=Mw(M,$),P=y.width>$.width,_=y.height>$.height,D=(P?$:y).left,z=(P?$:y).right,F=(_?$:y).top,B=(_?$:y).bottom;if(j&&(i=!0,!H))return;if(R&&(i=!1),R&&!H){i=!0;return}if(H&&le(w.relatedTarget)&&Ni(g.floating,w.relatedTarget)||v&&cu(v.nodesRef.current,b).length)return;if(A==="top"&&f>=$.bottom-1||A==="bottom"&&f<=$.top+1||A==="left"&&d>=$.right-1||A==="right"&&d<=$.left+1)return k();let Y=[];switch(A){case"top":Y=[[D,$.top+1],[D,y.bottom-1],[z,y.bottom-1],[z,$.top+1]];break;case"bottom":Y=[[D,y.top+1],[D,$.bottom-1],[z,$.bottom-1],[z,y.top+1]];break;case"left":Y=[[y.right-1,B],[y.right-1,F],[$.left+1,F],[$.left+1,B]];break;case"right":Y=[[$.right-1,B],[$.right-1,F],[y.left+1,F],[y.left+1,B]];break}function K(W){let[V,X]=W;switch(A){case"top":{const J=[P?V+t/2:T?V+t*4:V-t*4,X+t+1],te=[P?V-t/2:T?V+t*4:V-t*4,X+t+1],Z=[[y.left,T||P?y.bottom-t:y.top],[y.right,T?P?y.bottom-t:y.top:y.bottom-t]];return[J,te,...Z]}case"bottom":{const J=[P?V+t/2:T?V+t*4:V-t*4,X-t],te=[P?V-t/2:T?V+t*4:V-t*4,X-t],Z=[[y.left,T||P?y.top+t:y.bottom],[y.right,T?P?y.top+t:y.bottom:y.top+t]];return[J,te,...Z]}case"left":{const J=[V+t+1,_?X+t/2:S?X+t*4:X-t*4],te=[V+t+1,_?X-t/2:S?X+t*4:X-t*4];return[...[[S||_?y.right-t:y.left,y.top],[S?_?y.right-t:y.left:y.right-t,y.bottom]],J,te]}case"right":{const J=[V-t,_?X+t/2:S?X+t*4:X-t*4],te=[V-t,_?X-t/2:S?X+t*4:X-t*4],Z=[[S||_?y.left+t:y.right,y.top],[S?_?y.left+t:y.right:y.left+t,y.bottom]];return[J,te,...Z]}}}if(!lu([N,I],Y)){if(i&&!E)return k();if(!H&&o){const W=l(w.clientX,w.clientY);if(W!==null&&W<.1)return k()}lu([N,I],K([d,f]))?!i&&o&&(r.current=window.setTimeout(k,40)):k()}}};return u.__options={blockPointerEvents:n},u}const uu=({subItems:e,onItemClick:t,className:n})=>{const[,o]=O.useState(null),r=i=>{i.onClick&&i.onClick(),t&&t(i)};return C.jsx("ul",{className:se("min-w-48 bg-[#181818] border border-none rounded-md shadow-lg py-1",n),children:e.map((i,s)=>C.jsx(Iw,{item:i,index:s,onItemClick:r,onItemClickCallback:t,setHoveredItemId:o},i.id))})},Iw=({item:e,index:t,onItemClick:n,onItemClickCallback:o,setHoveredItemId:r})=>{const[i,s]=O.useState(!1),{refs:a,floatingStyles:c,context:l}=su({open:i,onOpenChange:s,placement:"right-start",middleware:[ql(5),Kl({fallbackPlacements:["left-start"]}),Zl({padding:8})],whileElementsMounted:Xl}),u=_w(l,{handleClose:Aw(),delay:{open:75,close:75}}),{getReferenceProps:h,getFloatingProps:d}=au([u]),f=()=>{r(e.id),e.subItems&&e.subItems.length>0&&s(!0)},p=()=>{};return C.jsxs("li",{className:"relative",children:[e.separator&&t>0&&C.jsx("div",{className:"border-t border-gray-600 m-0"}),C.jsxs("div",{ref:a.setReference,className:se("flex items-center justify-between gap-2 px-3 py-1.25 hover:bg-[#3F3F3F] cursor-pointer","transition-colors duration-150"),onClick:()=>n(e),onMouseEnter:f,onMouseLeave:p,...h(),children:[C.jsxs("div",{className:"flex items-center gap-2",children:[e.icon&&C.jsx("span",{className:"text-primary-white w-3 h-3 flex items-center justify-center",children:e.icon}),C.jsx("span",{className:"text-sm leading-3.5 text-primary-white font-main",children:e.label})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[e.shortcut&&C.jsx("span",{className:"text-sm leading-3.5 text-gray-400 font-mono",children:e.shortcut}),e.subItems&&e.subItems.length>0&&C.jsx(Nl,{className:"w-3 h-3 text-gray-400"})]})]}),e.subItems&&e.subItems.length>0&&i&&C.jsx("div",{ref:a.setFloating,style:{...c,contain:"layout",willChange:"transform"},className:"z-50",...d(),children:C.jsx(uu,{subItems:e.subItems,onItemClick:o,className:"ml-1"})})]})},du=({subItems:e,className:t,onItemClick:n})=>C.jsx("div",{className:se("relative",t),children:C.jsx(uu,{subItems:e,onItemClick:n})});function fu({typeOfNodes:e,dispatch:t,setContextMenu:n,contextMenuPosition:o}){const r=Object.keys(e);if(r.length===0)return[];const i=r.map(s=>({id:`add-${s}`,label:e[s].name,onClick:()=>{t({type:ze.ADD_NODE_AND_SELECT,payload:{type:s,position:o}}),n({isOpen:!1,position:{x:0,y:0}})}}));return[{id:"add-node",label:"Add Node",icon:O.createElement(fx,{className:"w-4 h-4"}),subItems:i}]}const ae=["circle","square","rectangle","list","grid","diamond","trapezium","hexagon","star","cross","zigzag","sparkle","parallelogram"],pe={[ae[0]]:ae[0],[ae[1]]:ae[1],[ae[2]]:ae[2],[ae[3]]:ae[3],[ae[4]]:ae[4],[ae[5]]:ae[5],[ae[6]]:ae[6],[ae[7]]:ae[7],[ae[8]]:ae[8],[ae[9]]:ae[9],[ae[10]]:ae[10],[ae[11]]:ae[11],[ae[12]]:ae[12]},Uo=(e,t,n,o="black",r=2)=>C.jsxs("div",{className:se("relative",n),children:[C.jsx("div",{className:"absolute",style:{top:-r,left:-r,right:-r,bottom:-r,backgroundColor:o,clipPath:e}}),C.jsx("div",{className:"absolute inset-0",style:{backgroundColor:t,clipPath:e}})]}),hu=(e=pe.circle,t="#A1A1A1",n)=>{const o="border-2 border-black",r="border-1 border-black",i={backgroundColor:t};switch(e){case pe.circle:return C.jsx("div",{className:se("w-6 h-6 rounded-full",o,n),style:i});case pe.square:return C.jsx("div",{className:se("w-6 h-6",o,n),style:i});case pe.rectangle:return C.jsx("div",{className:se("w-4 h-8",o,n),style:i});case pe.list:return C.jsx("div",{className:se("w-6 h-6 flex flex-col justify-center gap-0.5",n),children:[0,1,2].map(s=>C.jsx("div",{className:se("w-full h-2",r),style:i},s))});case pe.grid:return C.jsx("div",{className:se("w-6 h-6 grid grid-cols-2 gap-0.5",n),children:[0,1,2,3].map(s=>C.jsx("div",{className:se("w-full h-full",r),style:i},s))});case pe.diamond:return C.jsx("div",{className:se("w-6 h-6 rotate-45",o,n),style:i});case pe.trapezium:return Uo("polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",t,se("w-6 h-6",n));case pe.hexagon:return Uo("polygon(-50% 50%,50% 100%,150% 50%,50% 0)",t,se("w-5 h-6",n));case pe.star:return Uo("polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",t,se("w-6 h-6",n));case pe.cross:return C.jsxs("div",{className:se("w-6 h-6 relative",n),children:[C.jsx("div",{className:se("absolute top-1/2 left-0 w-full h-2 -translate-y-1/2",r),style:i}),C.jsx("div",{className:se("absolute left-1/2 top-0 w-2 h-full -translate-x-1/2",r),style:i})]});case pe.zigzag:return C.jsx("div",{className:se("w-6 h-6",n),style:{...i,width:"calc(4px + 24px/(2*tan(90deg/2)))",minHeight:"24px",mask:"4px 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg) exclude, 0 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg)",border:"2px solid black"}});case pe.sparkle:return C.jsx("div",{className:se("w-6 h-6",n),style:{...i,mask:"radial-gradient(#0000 71%, #000 72%) 10000% 10000%/99.5% 99.5%",border:"2px solid black"}});case pe.parallelogram:return Uo("polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)",t,se("w-6 h-6",n));default:return C.jsx("div",{className:se("w-6 h-6 rounded-full",o,n),style:i})}},Go=O.forwardRef(({type:e,position:t,id:n,color:o,shape:r=pe.circle,isCurrentlyInsideReactFlow:i=!1,className:s,...a},c)=>i?C.jsx(vn,{type:e,position:t,id:n,className:se("!w-6 !h-6 !border-none !bg-transparent !pointer-events-auto",s),style:{backgroundColor:"transparent"},...a,ref:c,children:C.jsx("div",{className:se("pointer-events-none flex justify-center"),children:hu(r,o||"#A1A1A1",s)})}):C.jsx("div",{className:se("absolute",t===Q.Right&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",t===Q.Left&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),...a,ref:c,children:hu(r,o||"#A1A1A1",s)}));Go.displayName="ContextAwareHandle";const pu=({input:e})=>{const t=bn(),n=No();return e.type==="string"?C.jsx(Sn,{placeholder:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:wl(e.id,i.data,{value:o})}:i))},allowOnlyNumbers:!1,className:"w-full"}):C.jsx(Mo,{name:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:wl(e.id,i.data,{value:o})}:i))},className:"w-full"})},gu=({input:e,isCurrentlyInsideReactFlow:t})=>t?C.jsx(pu,{input:e}):e.type==="string"?C.jsx(Sn,{placeholder:e.name,value:e.value,onChange:e.onChange,allowOnlyNumbers:!1,className:"w-full"}):C.jsx(Mo,{name:e.name,value:e.value,onChange:e.onChange,className:"w-full"}),Ti=O.forwardRef(({input:e,isCurrentlyInsideReactFlow:t,hide:n=!1},o)=>{const r=t?x0({handleId:e.id}):[],i=t&&r.some(a=>a.targetHandle===e.id),s=e.allowInput&&!i;return C.jsxs("div",{ref:o,className:se("text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row py-3",n&&"h-0 overflow-hidden py-0",s&&"py-1"),children:[C.jsx(Go,{type:"target",position:Q.Left,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t}),C.jsxs("div",{className:"flex-1 flex items-center gap-3 w-full",children:[!s&&C.jsx("div",{className:"truncate",children:e.name}),s&&C.jsx("div",{className:"flex-1 w-full",children:C.jsx(gu,{input:e,isCurrentlyInsideReactFlow:t})})]})]},e.id)});Ti.displayName="RenderInput";const mu=O.forwardRef(({output:e,isCurrentlyInsideReactFlow:t},n)=>C.jsxs("div",{ref:n,className:"text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row justify-end py-3",children:[C.jsx("div",{className:"truncate text-right",children:e.name}),C.jsx(Go,{type:"source",position:Q.Right,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t})]},e.id));mu.displayName="RenderOutput";const yu=O.forwardRef(({panel:e,isCurrentlyInsideReactFlow:t,isOpen:n,onToggle:o},r)=>C.jsxs("div",{ref:r,className:"flex flex-col",children:[C.jsxs(vt,{onClick:i=>{i.stopPropagation(),i.preventDefault(),o()},className:"bg-transparent border-none hover:bg-primary-gray rounded-none justify-start",children:[n?C.jsx(dx,{className:"w-6 h-6 flex-shrink-0 mr-2"}):C.jsx(lx,{className:"w-6 h-6 flex-shrink-0 mr-2"}),C.jsx("span",{className:"truncate",children:e.name})]}),C.jsx("div",{className:se("flex flex-col bg-[#272727]",!n&&"h-0 overflow-hidden"),children:e.inputs.map(i=>C.jsx(Ti,{input:i,isCurrentlyInsideReactFlow:t,hide:!n},i.id))})]},e.id));yu.displayName="RenderInputPanel";const Mi=O.forwardRef(({name:e="Node",headerColor:t="#79461D",inputs:n=[],outputs:o=[],isCurrentlyInsideReactFlow:r=!1,className:i,nodeResizerProps:s={},...a},c)=>{const[l,u]=O.useState(new Set),h=d=>{u(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return C.jsxs("div",{tabIndex:0,className:se("flex flex-col gap-0 rounded-md w-max border-[1.5px] border-transparent focus:border-white","in-[.selected]:border-white",i),...a,ref:c,children:[C.jsx("div",{className:`text-primary-white text-left text-[27px] leading-[27px] font-main \\
106
+ py-2 px-4 transition-all rounded-t-md truncate`,style:{backgroundColor:t},children:e}),C.jsxs("div",{className:"min-h-[50px] rounded-b-md bg-primary-dark-gray",children:[r&&C.jsx(El,{...s}),C.jsx("div",{className:"flex flex-col py-4",children:o.map(d=>C.jsx(mu,{output:d,isCurrentlyInsideReactFlow:r},d.id))}),C.jsx("div",{className:"flex flex-col py-4",children:n.map(d=>{if("inputs"in d){const f=l.has(d.id);return C.jsx(yu,{panel:d,isCurrentlyInsideReactFlow:r,isOpen:f,onToggle:()=>h(d.id)},d.id)}else return C.jsx(Ti,{input:d,isCurrentlyInsideReactFlow:r},d.id)})})]})]})});Mi.displayName="ConfigurableNode";const Ai=O.forwardRef(({data:e={}},t)=>C.jsx(Mi,{isCurrentlyInsideReactFlow:!0,className:"w-full",...e,ref:t}));Ai.displayName="ConfigurableNodeReactFlowWrapper";const xu=({fromX:e,fromY:t,toX:n,toY:o,fromPosition:r,toPosition:i})=>{const{fromHandle:s}=nl(),a=si(s?.nodeId||""),c=O.useMemo(()=>!s?.id||!a?.data?void 0:ui(s?.id,a?.data)?.handleColor??"#A1A1A1",[s?.id,a?.data]),[l]=mo({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:i});return C.jsx($t,{path:l,className:"!stroke-7 in-[g.selected]:brightness-150",style:{stroke:c||"#A1A1A1"},focusable:!0})};xu.displayName="ConfigurableConnection";const Pw={configurableNode:Ai},Ow={configurableEdge:fi};function Dw(e){const[t,n]=O.useReducer(xl,e);return{state:t,dispatch:n}}function Rw({state:e,dispatch:t}){const[n,o]=O.useState({isOpen:!1,position:{x:0,y:0}}),{screenToFlowPosition:r}=bn(),{refs:i,floatingStyles:s,context:a}=su({open:n.isOpen,onOpenChange:f=>{f||o({isOpen:!1,position:{x:0,y:0}})},placement:"bottom-start",middleware:[ql(5),Kl({fallbackPlacements:["top-start"]}),Zl({padding:8})],whileElementsMounted:Xl}),c=kw(a),{getFloatingProps:l}=au([c]),u=fu({typeOfNodes:e.typeOfNodes,dispatch:t,setContextMenu:o,contextMenuPosition:r(n.position)}),h=O.useCallback(f=>{f.preventDefault();const p={x:f.clientX,y:f.clientY};i.setReference&&i.setReference({getBoundingClientRect:()=>({x:p.x,y:p.y,width:1,height:1,top:p.y,right:p.x+1,bottom:p.y+1,left:p.x})}),o({isOpen:!0,position:p})},[i]),d=O.useCallback(()=>{o({isOpen:!1,position:{x:0,y:0}})},[]);return C.jsxs("div",{style:{width:"100%",height:"100%"},children:[C.jsxs(m0,{nodes:e.nodes,edges:e.edges,onNodesChange:f=>t({type:ze.UPDATE_NODE_BY_REACT_FLOW,payload:{changes:f}}),onEdgesChange:f=>t({type:ze.UPDATE_EDGES_BY_REACT_FLOW,payload:{changes:f}}),onConnect:f=>t({type:ze.ADD_EDGE_BY_REACT_FLOW,payload:{edge:f}}),fitView:!0,fitViewOptions:{maxZoom:.5,minZoom:.1},maxZoom:1,minZoom:.1,proOptions:{hideAttribution:!0},colorMode:"dark",selectNodesOnDrag:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectionMode:At.Partial,nodeTypes:Pw,edgeTypes:Ow,deleteKeyCode:["Backspace","Delete","x"],connectionLineComponent:xu,onContextMenu:h,onClick:d,children:[C.jsx(A0,{}),C.jsx(_0,{}),C.jsx(B0,{pannable:!0})]}),n.isOpen&&C.jsx("div",{ref:i.setFloating,style:{...s,contain:"layout",willChange:"transform"},className:"z-50",onClick:f=>f.stopPropagation(),...l(),children:C.jsx(du,{subItems:u})})]})}function Lw({state:e,dispatch:t}){return C.jsx(al,{children:C.jsx(Rw,{state:e,dispatch:t})})}ee.Button=vt,ee.ConfigurableEdge=fi,ee.ConfigurableNode=Mi,ee.ConfigurableNodeReactFlowWrapper=Ai,ee.ContextAwareHandle=Go,ee.ContextAwareInput=gu,ee.ContextMenu=du,ee.FullGraph=Lw,ee.Input=Sn,ee.NodeResizerWithMoreControls=El,ee.ReactFlowAwareInput=pu,ee.SliderNumberInput=Mo,ee.actionTypesMap=ze,ee.addEdgeWithTypeChecking=pl,ee.cn=se,ee.constructInputOrOutputOfType=pt,ee.constructInputPanelOfType=fl,ee.constructNodeOfType=li,ee.constructTypeOfHandleFromIndices=hl,ee.convertStringToNumber=rs,ee.createNodeContextMenu=fu,ee.getResultantDataTypeOfHandleConsideringInferredType=En,ee.handleShapesMap=pe,ee.isCoordinateInBox=os,ee.isNumberInRange=ir,ee.isSupportedUnderlyingType=_d,ee.isValidDataTypeId=Cd,ee.isValidNodeTypeUniqueId=kd,ee.mainReducer=xl,ee.makeAllowedConversionsBetweenDataTypesWithAutoInfer=Md,ee.makeDataTypeWithAutoInfer=Sd,ee.makeNodeIdToNodeTypeWithAutoInfer=Td,ee.makeStateWithAutoInfer=Ad,ee.makeTypeOfNodeWithAutoInfer=Nd,ee.removeEdgeWithTypeChecking=gl,ee.sanitizeNumberToShowAsText=sr,ee.supportedUnderlyingTypesMap=is,ee.useClickedOutside=vl,ee.useDrag=_l,ee.useFullGraph=Dw,ee.willAddingEdgeCreateCycle=ml,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
107
107
  //# sourceMappingURL=react-blender-nodes.umd.js.map