@theclearsky/react-blender-nodes 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +619 -0
- package/README.md +312 -77
- package/dist/contract-DxqU738Q.js +514 -0
- package/dist/contract.d.ts +1119 -0
- package/dist/index.d.ts +3636 -523
- package/dist/react-blender-nodes-contract.es.js +9 -0
- package/dist/react-blender-nodes.css +1 -1
- package/dist/react-blender-nodes.es.js +34971 -22422
- package/package.json +34 -13
- package/dist/react-blender-nodes.umd.js +0 -305
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
(function(fe,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):(fe=typeof globalThis<"u"?globalThis:fe||self,T(fe["react-blender-nodes"]={},fe.React,fe.ReactDOM))})(this,function(fe,T,Fh){"use strict";function zh(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const V=zh(T),_o=zh(Fh);var oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ia={exports:{}},Ni={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Wh;function S_(){if(Wh)return Ni;Wh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Ni.Fragment=t,Ni.jsx=n,Ni.jsxs=n,Ni}var Ii={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Gh;function __(){return Gh||(Gh=1,process.env.NODE_ENV!=="production"&&function(){function e(z){if(z==null)return null;if(typeof z=="function")return z.$$typeof===q?null:z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case k:return"Suspense";case A:return"SuspenseList";case U:return"Activity"}if(typeof z=="object")switch(typeof z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case x:return"Portal";case w:return(z.displayName||"Context")+".Provider";case N:return(z._context.displayName||"Context")+".Consumer";case I:var Y=z.render;return z=z.displayName,z||(z=Y.displayName||Y.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case M:return Y=z.displayName||null,Y!==null?Y:e(z.type)||"Memo";case B:Y=z._payload,z=z._init;try{return e(z(Y))}catch{}}return null}function t(z){return""+z}function n(z){try{t(z);var Y=!1}catch{Y=!0}if(Y){Y=console;var J=Y.error,ie=typeof Symbol=="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return J.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ie),t(z)}}function r(z){if(z===v)return"<>";if(typeof z=="object"&&z!==null&&z.$$typeof===B)return"<...>";try{var Y=e(z);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function i(){var z=D.A;return z===null?null:z.getOwner()}function s(){return Error("react-stack-top-frame")}function a(z){if($.call(z,"key")){var Y=Object.getOwnPropertyDescriptor(z,"key").get;if(Y&&Y.isReactWarning)return!1}return z.key!==void 0}function l(z,Y){function J(){P||(P=!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)",Y))}J.isReactWarning=!0,Object.defineProperty(z,"key",{get:J,configurable:!0})}function u(){var z=e(this.type);return L[z]||(L[z]=!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.")),z=this.props.ref,z!==void 0?z:null}function d(z,Y,J,ie,ee,ce,ge,Q){return J=ce.ref,z={$$typeof:m,type:z,key:Y,props:ce,_owner:ee},(J!==void 0?J:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:u}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function f(z,Y,J,ie,ee,ce,ge,Q){var te=Y.children;if(te!==void 0)if(ie)if(F(te)){for(ie=0;ie<te.length;ie++)g(te[ie]);Object.freeze&&Object.freeze(te)}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 g(te);if($.call(Y,"key")){te=e(z);var ne=Object.keys(Y).filter(function(pe){return pe!=="key"});ie=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",W[te+ie]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,ie,te,ne,te),W[te+ie]=!0)}if(te=null,J!==void 0&&(n(J),te=""+J),a(Y)&&(n(Y.key),te=""+Y.key),"key"in Y){J={};for(var oe in Y)oe!=="key"&&(J[oe]=Y[oe])}else J=Y;return te&&l(J,typeof z=="function"?z.displayName||z.name||"Unknown":z),d(z,te,ce,ee,i(),J,ge,Q)}function g(z){typeof z=="object"&&z!==null&&z.$$typeof===m&&z._store&&(z._store.validated=1)}var h=T,m=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),w=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),D=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,F=Array.isArray,E=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(z){return z()}};var P,L={},j=h.react_stack_bottom_frame.bind(h,s)(),O=E(r(s)),W={};Ii.Fragment=v,Ii.jsx=function(z,Y,J,ie,ee){var ce=1e4>D.recentlyCreatedOwnerStacks++;return f(z,Y,J,!1,ie,ee,ce?Error("react-stack-top-frame"):j,ce?E(r(z)):O)},Ii.jsxs=function(z,Y,J,ie,ee){var ce=1e4>D.recentlyCreatedOwnerStacks++;return f(z,Y,J,!0,ie,ee,ce?Error("react-stack-top-frame"):j,ce?E(r(z)):O)}}()),Ii}var qh;function N_(){return qh||(qh=1,process.env.NODE_ENV==="production"?ia.exports=S_():ia.exports=__()),ia.exports}var y=N_();/**
|
|
23
|
-
* @license lucide-react v0.542.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const I_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),E_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Yh=e=>{const t=E_(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),T_=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
28
|
-
* @license lucide-react v0.542.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var C_={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"};/**
|
|
33
|
-
* @license lucide-react v0.542.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const A_=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},u)=>T.createElement("svg",{ref:u,...C_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Xh("lucide",i),...!s&&!T_(l)&&{"aria-hidden":"true"},...l},[...a.map(([d,f])=>T.createElement(d,f)),...Array.isArray(s)?s:[s]]));/**
|
|
38
|
-
* @license lucide-react v0.542.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const Ye=(e,t)=>{const n=T.forwardRef(({className:r,...i},s)=>T.createElement(A_,{ref:s,iconNode:t,className:Xh(`lucide-${I_(Yh(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Yh(e),n};/**
|
|
43
|
-
* @license lucide-react v0.542.0 - ISC
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the ISC license.
|
|
46
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const k_=Ye("arrow-down-up",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
|
|
48
|
-
* @license lucide-react v0.542.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const M_=Ye("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
53
|
-
* @license lucide-react v0.542.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const sa=Ye("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
58
|
-
* @license lucide-react v0.542.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const Ei=Ye("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
63
|
-
* @license lucide-react v0.542.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const iu=Ye("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
68
|
-
* @license lucide-react v0.542.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const zr=Ye("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
73
|
-
* @license lucide-react v0.542.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const su=Ye("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
78
|
-
* @license lucide-react v0.542.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const O_=Ye("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
83
|
-
* @license lucide-react v0.542.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const P_=Ye("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
88
|
-
* @license lucide-react v0.542.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const R_=Ye("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
93
|
-
* @license lucide-react v0.542.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const Kh=Ye("file-input",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
98
|
-
* @license lucide-react v0.542.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const Zh=Ye("file-output",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
|
|
103
|
-
* @license lucide-react v0.542.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const L_=Ye("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
108
|
-
* @license lucide-react v0.542.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const D_=Ye("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
113
|
-
* @license lucide-react v0.542.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const j_=Ye("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
|
|
118
|
-
* @license lucide-react v0.542.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const $_=Ye("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
123
|
-
* @license lucide-react v0.542.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const H_=Ye("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);/**
|
|
128
|
-
* @license lucide-react v0.542.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const au=Ye("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/**
|
|
133
|
-
* @license lucide-react v0.542.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Jh=Ye("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
138
|
-
* @license lucide-react v0.542.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const Qh=Ye("repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
143
|
-
* @license lucide-react v0.542.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const B_=Ye("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
148
|
-
* @license lucide-react v0.542.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const V_=Ye("skip-forward",[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]);/**
|
|
153
|
-
* @license lucide-react v0.542.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const eg=Ye("square-mouse-pointer",[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]]);/**
|
|
158
|
-
* @license lucide-react v0.542.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const tg=Ye("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
163
|
-
* @license lucide-react v0.542.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const F_=Ye("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
168
|
-
* @license lucide-react v0.542.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const ng=Ye("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
173
|
-
* @license lucide-react v0.542.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const aa=Ye("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
178
|
-
* @license lucide-react v0.542.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const z_=Ye("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
|
|
183
|
-
* @license lucide-react v0.542.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const U_=Ye("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
188
|
-
* @license lucide-react v0.542.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const W_=Ye("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function rg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function og(...e){return t=>{let n=!1;const r=e.map(i=>{const s=rg(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():rg(e[i],null)}}}}function ut(...e){return V.useCallback(og(...e),e)}function Ti(e){const t=q_(e),n=V.forwardRef((r,i)=>{const{children:s,...a}=r,l=V.Children.toArray(s),u=l.find(X_);if(u){const d=u.props.children,f=l.map(g=>g===u?V.Children.count(d)>1?V.Children.only(null):V.isValidElement(d)?d.props.children:null:g);return y.jsx(t,{...a,ref:i,children:V.isValidElement(d)?V.cloneElement(d,void 0,f):null})}return y.jsx(t,{...a,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var G_=Ti("Slot");function q_(e){const t=V.forwardRef((n,r)=>{const{children:i,...s}=n;if(V.isValidElement(i)){const a=Z_(i),l=K_(s,i.props);return i.type!==V.Fragment&&(l.ref=r?og(r,a):a),V.cloneElement(i,l)}return V.Children.count(i)>1?V.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Y_=Symbol("radix.slottable");function X_(e){return V.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Y_}function K_(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Z_(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)}var J_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=J_.reduce((e,t)=>{const n=Ti(`Primitive.${t}`),r=V.forwardRef((i,s)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Q_(e,t){e&&_o.flushSync(()=>e.dispatchEvent(t))}var ig=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eN="VisuallyHidden",tN=V.forwardRef((e,t)=>y.jsx(Ke.span,{...e,ref:t,style:{...ig,...e.style}}));tN.displayName=eN;function No(e,t=[]){let n=[];function r(s,a){const l=V.createContext(a),u=n.length;n=[...n,a];const d=g=>{const{scope:h,children:m,...x}=g,v=h?.[e]?.[u]||l,b=V.useMemo(()=>x,Object.values(x));return y.jsx(v.Provider,{value:b,children:m})};d.displayName=s+"Provider";function f(g,h){const m=h?.[e]?.[u]||l,x=V.useContext(m);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[d,f]}const i=()=>{const s=n.map(a=>V.createContext(a));return function(l){const u=l?.[e]||s;return V.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,nN(i,...t)]}function nN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const g=u(s)[`__scope${d}`];return{...l,...g}},{});return V.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function sg(e){const t=e+"CollectionProvider",[n,r]=No(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:S}=v,N=T.useRef(null),w=T.useRef(new Map).current;return y.jsx(i,{scope:b,itemMap:w,collectionRef:N,children:S})};a.displayName=t;const l=e+"CollectionSlot",u=Ti(l),d=T.forwardRef((v,b)=>{const{scope:S,children:N}=v,w=s(l,S),I=ut(b,w.collectionRef);return y.jsx(u,{ref:I,children:N})});d.displayName=l;const f=e+"CollectionItemSlot",g="data-radix-collection-item",h=Ti(f),m=T.forwardRef((v,b)=>{const{scope:S,children:N,...w}=v,I=T.useRef(null),k=ut(b,I),A=s(f,S);return T.useEffect(()=>(A.itemMap.set(I,{ref:I,...w}),()=>void A.itemMap.delete(I))),y.jsx(h,{[g]:"",ref:k,children:N})});m.displayName=f;function x(v){const b=s(e+"CollectionConsumer",v);return T.useCallback(()=>{const N=b.collectionRef.current;if(!N)return[];const w=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((A,M)=>w.indexOf(A.ref.current)-w.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},x,r]}function it(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var _t=globalThis?.document?V.useLayoutEffect:()=>{},rN=V[" useInsertionEffect ".trim().toString()]||_t;function Io({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,a]=oN({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const f=V.useRef(e!==void 0);V.useEffect(()=>{const g=f.current;g!==l&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,r])}const d=V.useCallback(f=>{if(l){const g=iN(f)?f(e):f;g!==e&&a.current?.(g)}else s(f)},[l,e,s,a]);return[u,d]}function oN({defaultProp:e,onChange:t}){const[n,r]=V.useState(e),i=V.useRef(n),s=V.useRef(t);return rN(()=>{s.current=t},[t]),V.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function iN(e){return typeof e=="function"}function sN(e,t){return V.useReducer((n,r)=>t[n][r]??n,e)}var cu=e=>{const{present:t,children:n}=e,r=aN(t),i=typeof n=="function"?n({present:r.isPresent}):V.Children.only(n),s=ut(r.ref,cN(i));return typeof n=="function"||r.isPresent?V.cloneElement(i,{ref:s}):null};cu.displayName="Presence";function aN(e){const[t,n]=V.useState(),r=V.useRef(null),i=V.useRef(e),s=V.useRef("none"),a=e?"mounted":"unmounted",[l,u]=sN(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V.useEffect(()=>{const d=ca(r.current);s.current=l==="mounted"?d:"none"},[l]),_t(()=>{const d=r.current,f=i.current;if(f!==e){const h=s.current,m=ca(d);e?u("MOUNT"):m==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),_t(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,g=m=>{const v=ca(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=m=>{m.target===t&&(s.current=ca(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:V.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function ca(e){return e?.animationName||"none"}function cN(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)}var lN=V[" useId ".trim().toString()]||(()=>{}),uN=0;function Ci(e){const[t,n]=V.useState(lN());return _t(()=>{n(r=>r??String(uN++))},[e]),t?`radix-${t}`:""}var la="Collapsible",[dN,ag]=No(la),[fN,lu]=dN(la),cg=V.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...l}=e,[u,d]=Io({prop:r,defaultProp:i??!1,onChange:a,caller:la});return y.jsx(fN,{scope:n,disabled:s,contentId:Ci(),open:u,onOpenToggle:V.useCallback(()=>d(f=>!f),[d]),children:y.jsx(Ke.div,{"data-state":du(u),"data-disabled":s?"":void 0,...l,ref:t})})});cg.displayName=la;var lg="CollapsibleTrigger",ug=V.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=lu(lg,n);return y.jsx(Ke.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":du(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:it(e.onClick,i.onOpenToggle)})});ug.displayName=lg;var uu="CollapsibleContent",dg=V.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=lu(uu,e.__scopeCollapsible);return y.jsx(cu,{present:n||i.open,children:({present:s})=>y.jsx(pN,{...r,ref:t,present:s})})});dg.displayName=uu;var pN=V.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,a=lu(uu,n),[l,u]=V.useState(r),d=V.useRef(null),f=ut(t,d),g=V.useRef(0),h=g.current,m=V.useRef(0),x=m.current,v=a.open||l,b=V.useRef(v),S=V.useRef(void 0);return V.useEffect(()=>{const N=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(N)},[]),_t(()=>{const N=d.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const w=N.getBoundingClientRect();g.current=w.height,m.current=w.width,b.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),u(r)}},[a.open,r]),y.jsx(Ke.div,{"data-state":du(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...s,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:v&&i})});function du(e){return e?"open":"closed"}var hN=cg,gN=ug,mN=dg,yN=V.createContext(void 0);function fg(e){const t=V.useContext(yN);return e||t||"ltr"}var vn="Accordion",vN=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[fu,xN,wN]=sg(vn),[ua,CF]=No(vn,[wN,ag]),pu=ag(),pg=T.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,s=r;return y.jsx(fu.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?y.jsx(NN,{...s,ref:t}):y.jsx(_N,{...i,ref:t})})});pg.displayName=vn;var[hg,bN]=ua(vn),[gg,SN]=ua(vn,{collapsible:!1}),_N=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=e,[l,u]=Io({prop:n,defaultProp:r??"",onChange:i,caller:vn});return y.jsx(hg,{scope:e.__scopeAccordion,value:T.useMemo(()=>l?[l]:[],[l]),onItemOpen:u,onItemClose:T.useCallback(()=>s&&u(""),[s,u]),children:y.jsx(gg,{scope:e.__scopeAccordion,collapsible:s,children:y.jsx(mg,{...a,ref:t})})})}),NN=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[a,l]=Io({prop:n,defaultProp:r??[],onChange:i,caller:vn}),u=T.useCallback(f=>l((g=[])=>[...g,f]),[l]),d=T.useCallback(f=>l((g=[])=>g.filter(h=>h!==f)),[l]);return y.jsx(hg,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:y.jsx(gg,{scope:e.__scopeAccordion,collapsible:!0,children:y.jsx(mg,{...s,ref:t})})})}),[IN,da]=ua(vn),mg=T.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...a}=e,l=T.useRef(null),u=ut(l,t),d=xN(n),g=fg(i)==="ltr",h=it(e.onKeyDown,m=>{if(!vN.includes(m.key))return;const x=m.target,v=d().filter(B=>!B.ref.current?.disabled),b=v.findIndex(B=>B.ref.current===x),S=v.length;if(b===-1)return;m.preventDefault();let N=b;const w=0,I=S-1,k=()=>{N=b+1,N>I&&(N=w)},A=()=>{N=b-1,N<w&&(N=I)};switch(m.key){case"Home":N=w;break;case"End":N=I;break;case"ArrowRight":s==="horizontal"&&(g?k():A());break;case"ArrowDown":s==="vertical"&&k();break;case"ArrowLeft":s==="horizontal"&&(g?A():k());break;case"ArrowUp":s==="vertical"&&A();break}const M=N%S;v[M].ref.current?.focus()});return y.jsx(IN,{scope:n,disabled:r,direction:i,orientation:s,children:y.jsx(fu.Slot,{scope:n,children:y.jsx(Ke.div,{...a,"data-orientation":s,ref:u,onKeyDown:r?void 0:h})})})}),fa="AccordionItem",[EN,hu]=ua(fa),yg=T.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,s=da(fa,n),a=bN(fa,n),l=pu(n),u=Ci(),d=r&&a.value.includes(r)||!1,f=s.disabled||e.disabled;return y.jsx(EN,{scope:n,open:d,disabled:f,triggerId:u,children:y.jsx(hN,{"data-orientation":s.orientation,"data-state":_g(d),...l,...i,ref:t,disabled:f,open:d,onOpenChange:g=>{g?a.onItemOpen(r):a.onItemClose(r)}})})});yg.displayName=fa;var vg="AccordionHeader",xg=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=da(vn,n),s=hu(vg,n);return y.jsx(Ke.h3,{"data-orientation":i.orientation,"data-state":_g(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});xg.displayName=vg;var gu="AccordionTrigger",wg=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=da(vn,n),s=hu(gu,n),a=SN(gu,n),l=pu(n);return y.jsx(fu.ItemSlot,{scope:n,children:y.jsx(gN,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...l,...r,ref:t})})});wg.displayName=gu;var bg="AccordionContent",Sg=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=da(vn,n),s=hu(bg,n),a=pu(n);return y.jsx(mN,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Sg.displayName=bg;function _g(e){return e?"open":"closed"}var TN=pg,CN=yg,AN=xg,kN=wg,MN=Sg;function Ur(e){const t=V.useRef(e);return V.useEffect(()=>{t.current=e}),V.useMemo(()=>(...n)=>t.current?.(...n),[])}function ON(e,t=globalThis?.document){const n=Ur(e);V.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PN="DismissableLayer",mu="dismissableLayer.update",RN="dismissableLayer.pointerDownOutside",LN="dismissableLayer.focusOutside",Ng,Ig=V.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Eg=V.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=e,d=V.useContext(Ig),[f,g]=V.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=V.useState({}),x=ut(t,M=>g(M)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=v.indexOf(b),N=f?v.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,I=N>=S,k=$N(M=>{const B=M.target,U=[...d.branches].some(q=>q.contains(B));!I||U||(i?.(M),a?.(M),M.defaultPrevented||l?.())},h),A=HN(M=>{const B=M.target;[...d.branches].some(q=>q.contains(B))||(s?.(M),a?.(M),M.defaultPrevented||l?.())},h);return ON(M=>{N===d.layers.size-1&&(r?.(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},h),V.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ng=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Tg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ng)}},[f,h,n,d]),V.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Tg())},[f,d]),V.useEffect(()=>{const M=()=>m({});return document.addEventListener(mu,M),()=>document.removeEventListener(mu,M)},[]),y.jsx(Ke.div,{...u,ref:x,style:{pointerEvents:w?I?"auto":"none":void 0,...e.style},onFocusCapture:it(e.onFocusCapture,A.onFocusCapture),onBlurCapture:it(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:it(e.onPointerDownCapture,k.onPointerDownCapture)})});Eg.displayName=PN;var DN="DismissableLayerBranch",jN=V.forwardRef((e,t)=>{const n=V.useContext(Ig),r=V.useRef(null),i=ut(t,r);return V.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),y.jsx(Ke.div,{...e,ref:i})});jN.displayName=DN;function $N(e,t=globalThis?.document){const n=Ur(e),r=V.useRef(!1),i=V.useRef(()=>{});return V.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let u=function(){Cg(RN,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function HN(e,t=globalThis?.document){const n=Ur(e),r=V.useRef(!1);return V.useEffect(()=>{const i=s=>{s.target&&!r.current&&Cg(LN,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Tg(){const e=new CustomEvent(mu);document.dispatchEvent(e)}function Cg(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Q_(i,s):i.dispatchEvent(s)}var yu="focusScope.autoFocusOnMount",vu="focusScope.autoFocusOnUnmount",Ag={bubbles:!1,cancelable:!0},BN="FocusScope",kg=V.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,u]=V.useState(null),d=Ur(i),f=Ur(s),g=V.useRef(null),h=ut(t,v=>u(v)),m=V.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V.useEffect(()=>{if(r){let v=function(w){if(m.paused||!l)return;const I=w.target;l.contains(I)?g.current=I:mr(g.current,{select:!0})},b=function(w){if(m.paused||!l)return;const I=w.relatedTarget;I!==null&&(l.contains(I)||mr(g.current,{select:!0}))},S=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&mr(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const N=new MutationObserver(S);return l&&N.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),N.disconnect()}}},[r,l,m.paused]),V.useEffect(()=>{if(l){Pg.add(m);const v=document.activeElement;if(!l.contains(v)){const S=new CustomEvent(yu,Ag);l.addEventListener(yu,d),l.dispatchEvent(S),S.defaultPrevented||(VN(GN(Mg(l)),{select:!0}),document.activeElement===v&&mr(l))}return()=>{l.removeEventListener(yu,d),setTimeout(()=>{const S=new CustomEvent(vu,Ag);l.addEventListener(vu,f),l.dispatchEvent(S),S.defaultPrevented||mr(v??document.body,{select:!0}),l.removeEventListener(vu,f),Pg.remove(m)},0)}}},[l,d,f,m]);const x=V.useCallback(v=>{if(!n&&!r||m.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,S=document.activeElement;if(b&&S){const N=v.currentTarget,[w,I]=FN(N);w&&I?!v.shiftKey&&S===I?(v.preventDefault(),n&&mr(w,{select:!0})):v.shiftKey&&S===w&&(v.preventDefault(),n&&mr(I,{select:!0})):S===N&&v.preventDefault()}},[n,r,m.paused]);return y.jsx(Ke.div,{tabIndex:-1,...a,ref:h,onKeyDown:x})});kg.displayName=BN;function VN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mr(r,{select:t}),document.activeElement!==n)return}function FN(e){const t=Mg(e),n=Og(t,e),r=Og(t.reverse(),e);return[n,r]}function Mg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Og(e,t){for(const n of e)if(!zN(n,{upTo:t}))return n}function zN(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function UN(e){return e instanceof HTMLInputElement&&"select"in e}function mr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&UN(e)&&t&&e.select()}}var Pg=WN();function WN(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Rg(e,t),e.unshift(t)},remove(t){e=Rg(e,t),e[0]?.resume()}}}function Rg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function GN(e){return e.filter(t=>t.tagName!=="A")}var qN="Portal",Lg=V.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=V.useState(!1);_t(()=>s(!0),[]);const a=n||i&&globalThis?.document?.body;return a?Fh.createPortal(y.jsx(Ke.div,{...r,ref:t}),a):null});Lg.displayName=qN;var xu=0;function YN(){V.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dg()),document.body.insertAdjacentElement("beforeend",e[1]??Dg()),xu++,()=>{xu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xu--}},[])}function Dg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pn=function(){return Pn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Pn.apply(this,arguments)};function jg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function XN(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var pa="right-scroll-bar-position",ha="width-before-scroll-bar",KN="with-scroll-bars-hidden",ZN="--removed-body-scroll-bar-size";function wu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function JN(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var QN=typeof window<"u"?V.useLayoutEffect:V.useEffect,$g=new WeakMap;function eI(e,t){var n=JN(null,function(r){return e.forEach(function(i){return wu(i,r)})});return QN(function(){var r=$g.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(l){s.has(l)||wu(l,null)}),s.forEach(function(l){i.has(l)||wu(l,a)})}$g.set(n,e)},[e]),n}function tI(e){return e}function nI(e,t){t===void 0&&(t=tI);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return i}function rI(e){e===void 0&&(e={});var t=nI(null);return t.options=Pn({async:!0,ssr:!1},e),t}var Hg=function(e){var t=e.sideCar,n=jg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return V.createElement(r,Pn({},n))};Hg.isSideCarExport=!0;function oI(e,t){return e.useMedium(t),Hg}var Bg=rI(),bu=function(){},ga=V.forwardRef(function(e,t){var n=V.useRef(null),r=V.useState({onScrollCapture:bu,onWheelCapture:bu,onTouchMoveCapture:bu}),i=r[0],s=r[1],a=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,g=e.shards,h=e.sideCar,m=e.noRelative,x=e.noIsolation,v=e.inert,b=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,w=e.gapMode,I=jg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,A=eI([n,t]),M=Pn(Pn({},I),i);return V.createElement(V.Fragment,null,f&&V.createElement(k,{sideCar:Bg,removeScrollBar:d,shards:g,noRelative:m,noIsolation:x,inert:v,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?V.cloneElement(V.Children.only(l),Pn(Pn({},M),{ref:A})):V.createElement(N,Pn({},M,{className:u,ref:A}),l))});ga.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ga.classNames={fullWidth:ha,zeroRight:pa};var iI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iI();return t&&e.setAttribute("nonce",t),e}function aI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sI())&&(aI(t,n),cI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uI=function(){var e=lI();return function(t,n){V.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vg=function(){var e=uI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},dI={left:0,top:0,right:0,gap:0},Su=function(e){return parseInt(e||"",10)||0},fI=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Su(n),Su(r),Su(i)]},pI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dI;var t=fI(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},hI=Vg(),Eo="data-scroll-locked",gI=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
193
|
-
.`.concat(KN,` {
|
|
194
|
-
overflow: hidden `).concat(r,`;
|
|
195
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
196
|
-
}
|
|
197
|
-
body[`).concat(Eo,`] {
|
|
198
|
-
overflow: hidden `).concat(r,`;
|
|
199
|
-
overscroll-behavior: contain;
|
|
200
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
201
|
-
padding-left: `.concat(i,`px;
|
|
202
|
-
padding-top: `).concat(s,`px;
|
|
203
|
-
padding-right: `).concat(a,`px;
|
|
204
|
-
margin-left:0;
|
|
205
|
-
margin-top:0;
|
|
206
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
207
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.`).concat(pa,` {
|
|
211
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.`).concat(ha,` {
|
|
215
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.`).concat(pa," .").concat(pa,` {
|
|
219
|
-
right: 0 `).concat(r,`;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.`).concat(ha," .").concat(ha,` {
|
|
223
|
-
margin-right: 0 `).concat(r,`;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
body[`).concat(Eo,`] {
|
|
227
|
-
`).concat(ZN,": ").concat(l,`px;
|
|
228
|
-
}
|
|
229
|
-
`)},Fg=function(){var e=parseInt(document.body.getAttribute(Eo)||"0",10);return isFinite(e)?e:0},mI=function(){V.useEffect(function(){return document.body.setAttribute(Eo,(Fg()+1).toString()),function(){var e=Fg()-1;e<=0?document.body.removeAttribute(Eo):document.body.setAttribute(Eo,e.toString())}},[])},yI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;mI();var s=V.useMemo(function(){return pI(i)},[i]);return V.createElement(hI,{styles:gI(s,!t,i,n?"":"!important")})},_u=!1;if(typeof window<"u")try{var ma=Object.defineProperty({},"passive",{get:function(){return _u=!0,!0}});window.addEventListener("test",ma,ma),window.removeEventListener("test",ma,ma)}catch{_u=!1}var To=_u?{passive:!1}:!1,vI=function(e){return e.tagName==="TEXTAREA"},zg=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vI(e)&&n[t]==="visible")},xI=function(e){return zg(e,"overflowY")},wI=function(e){return zg(e,"overflowX")},Ug=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Wg(e,r);if(i){var s=Gg(e,r),a=s[1],l=s[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bI=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},SI=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Wg=function(e,t){return e==="v"?xI(t):wI(t)},Gg=function(e,t){return e==="v"?bI(t):SI(t)},_I=function(e,t){return e==="h"&&t==="rtl"?-1:1},NI=function(e,t,n,r,i){var s=_I(e,window.getComputedStyle(t).direction),a=s*r,l=n.target,u=t.contains(l),d=!1,f=a>0,g=0,h=0;do{if(!l)break;var m=Gg(e,l),x=m[0],v=m[1],b=m[2],S=v-b-s*x;(x||S)&&Wg(e,l)&&(g+=S,h+=x);var N=l.parentNode;l=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(f&&Math.abs(g)<1||!f&&Math.abs(h)<1)&&(d=!0),d},ya=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qg=function(e){return[e.deltaX,e.deltaY]},Yg=function(e){return e&&"current"in e?e.current:e},II=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EI=function(e){return`
|
|
230
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
231
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
232
|
-
`)},TI=0,Co=[];function CI(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),i=V.useState(TI++)[0],s=V.useState(Vg)[0],a=V.useRef(e);V.useEffect(function(){a.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=XN([e.lockRef.current],(e.shards||[]).map(Yg),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=V.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var S=ya(v),N=n.current,w="deltaX"in v?v.deltaX:N[0]-S[0],I="deltaY"in v?v.deltaY:N[1]-S[1],k,A=v.target,M=Math.abs(w)>Math.abs(I)?"h":"v";if("touches"in v&&M==="h"&&A.type==="range")return!1;var B=Ug(M,A);if(!B)return!0;if(B?k=M:(k=M==="v"?"h":"v",B=Ug(M,A)),!B)return!1;if(!r.current&&"changedTouches"in v&&(w||I)&&(r.current=k),!k)return!0;var U=r.current||k;return NI(U,b,v,U==="h"?w:I)},[]),u=V.useCallback(function(v){var b=v;if(!(!Co.length||Co[Co.length-1]!==s)){var S="deltaY"in b?qg(b):ya(b),N=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&II(k.delta,S)})[0];if(N&&N.should){b.cancelable&&b.preventDefault();return}if(!N){var w=(a.current.shards||[]).map(Yg).filter(Boolean).filter(function(k){return k.contains(b.target)}),I=w.length>0?l(b,w[0]):!a.current.noIsolation;I&&b.cancelable&&b.preventDefault()}}},[]),d=V.useCallback(function(v,b,S,N){var w={name:v,delta:b,target:S,should:N,shadowParent:AI(S)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(I){return I!==w})},1)},[]),f=V.useCallback(function(v){n.current=ya(v),r.current=void 0},[]),g=V.useCallback(function(v){d(v.type,qg(v),v.target,l(v,e.lockRef.current))},[]),h=V.useCallback(function(v){d(v.type,ya(v),v.target,l(v,e.lockRef.current))},[]);V.useEffect(function(){return Co.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:h}),document.addEventListener("wheel",u,To),document.addEventListener("touchmove",u,To),document.addEventListener("touchstart",f,To),function(){Co=Co.filter(function(v){return v!==s}),document.removeEventListener("wheel",u,To),document.removeEventListener("touchmove",u,To),document.removeEventListener("touchstart",f,To)}},[]);var m=e.removeScrollBar,x=e.inert;return V.createElement(V.Fragment,null,x?V.createElement(s,{styles:EI(i)}):null,m?V.createElement(yI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function AI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kI=oI(Bg,CI);var Xg=V.forwardRef(function(e,t){return V.createElement(ga,Pn({},e,{ref:t,sideCar:kI}))});Xg.classNames=ga.classNames;var MI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ao=new WeakMap,va=new WeakMap,xa={},Nu=0,Kg=function(e){return e&&(e.host||Kg(e.parentNode))},OI=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Kg(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},PI=function(e,t,n,r){var i=OI(t,Array.isArray(e)?e:[e]);xa[n]||(xa[n]=new WeakMap);var s=xa[n],a=[],l=new Set,u=new Set(i),d=function(g){!g||l.has(g)||(l.add(g),d(g.parentNode))};i.forEach(d);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(h){if(l.has(h))f(h);else try{var m=h.getAttribute(r),x=m!==null&&m!=="false",v=(Ao.get(h)||0)+1,b=(s.get(h)||0)+1;Ao.set(h,v),s.set(h,b),a.push(h),v===1&&x&&va.set(h,!0),b===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",h,S)}})};return f(t),l.clear(),Nu++,function(){a.forEach(function(g){var h=Ao.get(g)-1,m=s.get(g)-1;Ao.set(g,h),s.set(g,m),h||(va.has(g)||g.removeAttribute(r),va.delete(g)),m||g.removeAttribute(n)}),Nu--,Nu||(Ao=new WeakMap,Ao=new WeakMap,va=new WeakMap,xa={})}},RI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=MI(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),PI(r,i,n,"aria-hidden")):function(){return null}},wa={exports:{}},Iu={};/**
|
|
233
|
-
* @license React
|
|
234
|
-
* use-sync-external-store-shim.production.js
|
|
235
|
-
*
|
|
236
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the MIT license found in the
|
|
239
|
-
* LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/var Zg;function LI(){if(Zg)return Iu;Zg=1;var e=T;function t(g,h){return g===h&&(g!==0||1/g===1/h)||g!==g&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function l(g,h){var m=h(),x=r({inst:{value:m,getSnapshot:h}}),v=x[0].inst,b=x[1];return s(function(){v.value=m,v.getSnapshot=h,u(v)&&b({inst:v})},[g,m,h]),i(function(){return u(v)&&b({inst:v}),g(function(){u(v)&&b({inst:v})})},[g]),a(m),m}function u(g){var h=g.getSnapshot;g=g.value;try{var m=h();return!n(g,m)}catch{return!0}}function d(g,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Iu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Iu}var Eu={};/**
|
|
241
|
-
* @license React
|
|
242
|
-
* use-sync-external-store-shim.development.js
|
|
243
|
-
*
|
|
244
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the MIT license found in the
|
|
247
|
-
* LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/var Jg;function DI(){return Jg||(Jg=1,process.env.NODE_ENV!=="production"&&function(){function e(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}function t(m,x){f||i.startTransition===void 0||(f=!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 v=x();if(!g){var b=x();s(v,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}b=a({inst:{value:v,getSnapshot:x}});var S=b[0].inst,N=b[1];return u(function(){S.value=v,S.getSnapshot=x,n(S)&&N({inst:S})},[m,v,x]),l(function(){return n(S)&&N({inst:S}),m(function(){n(S)&&N({inst:S})})},[m]),d(v),v}function n(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!s(m,v)}catch{return!0}}function r(m,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=T,s=typeof Object.is=="function"?Object.is:e,a=i.useState,l=i.useEffect,u=i.useLayoutEffect,d=i.useDebugValue,f=!1,g=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Eu.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Eu}var Qg;function em(){return Qg||(Qg=1,process.env.NODE_ENV==="production"?wa.exports=LI():wa.exports=DI()),wa.exports}function tm(e){const t=V.useRef({value:e,previous:e});return V.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function nm(e){const[t,n]=V.useState(void 0);return _t(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,l=d.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ba="Checkbox",[jI,AF]=No(ba),[$I,Tu]=jI(ba);function HI(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:s,form:a,name:l,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:g}=e,[h,m]=Io({prop:n,defaultProp:i??!1,onChange:u,caller:ba}),[x,v]=V.useState(null),[b,S]=V.useState(null),N=V.useRef(!1),w=x?!!a||!!x.closest("form"):!0,I={checked:h,disabled:s,setChecked:m,control:x,setControl:v,name:l,form:a,value:f,hasConsumerStoppedPropagationRef:N,required:d,defaultChecked:yr(i)?!1:i,isFormControl:w,bubbleInput:b,setBubbleInput:S};return y.jsx($I,{scope:t,...I,children:BI(g)?g(I):r})}var rm="CheckboxTrigger",om=V.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:s,value:a,disabled:l,checked:u,required:d,setControl:f,setChecked:g,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:x}=Tu(rm,e),v=ut(i,f),b=V.useRef(u);return V.useEffect(()=>{const S=s?.form;if(S){const N=()=>g(b.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[s,g]),y.jsx(Ke.button,{type:"button",role:"checkbox","aria-checked":yr(u)?"mixed":u,"aria-required":d,"data-state":lm(u),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:v,onKeyDown:it(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:it(n,S=>{g(N=>yr(N)?!0:!N),x&&m&&(h.current=S.isPropagationStopped(),h.current||S.stopPropagation())})})});om.displayName=rm;var Cu=V.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:l,value:u,onCheckedChange:d,form:f,...g}=e;return y.jsx(HI,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:l,required:a,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:h})=>y.jsxs(y.Fragment,{children:[y.jsx(om,{...g,ref:t,__scopeCheckbox:n}),h&&y.jsx(cm,{__scopeCheckbox:n})]})})});Cu.displayName=ba;var im="CheckboxIndicator",sm=V.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=Tu(im,n);return y.jsx(cu,{present:r||yr(s.checked)||s.checked===!0,children:y.jsx(Ke.span,{"data-state":lm(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});sm.displayName=im;var am="CheckboxBubbleInput",cm=V.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:l,disabled:u,name:d,value:f,form:g,bubbleInput:h,setBubbleInput:m}=Tu(am,e),x=ut(n,m),v=tm(s),b=nm(r);V.useEffect(()=>{const N=h;if(!N)return;const w=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(w,"checked").set,A=!i.current;if(v!==s&&k){const M=new Event("click",{bubbles:A});N.indeterminate=yr(s),k.call(N,yr(s)?!1:s),N.dispatchEvent(M)}},[h,v,s,i]);const S=V.useRef(yr(s)?!1:s);return y.jsx(Ke.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??S.current,required:l,disabled:u,name:d,value:f,form:g,...t,tabIndex:-1,ref:x,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});cm.displayName=am;function BI(e){return typeof e=="function"}function yr(e){return e==="indeterminate"}function lm(e){return yr(e)?"indeterminate":e?"checked":"unchecked"}const VI=["top","right","bottom","left"],vr=Math.min,zt=Math.max,Sa=Math.round,_a=Math.floor,Rn=e=>({x:e,y:e}),FI={left:"right",right:"left",bottom:"top",top:"bottom"},zI={start:"end",end:"start"};function Au(e,t,n){return zt(e,vr(t,n))}function Yn(e,t){return typeof e=="function"?e(t):e}function Xn(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function ku(e){return e==="x"?"y":"x"}function Mu(e){return e==="y"?"height":"width"}const UI=new Set(["top","bottom"]);function Ln(e){return UI.has(Xn(e))?"y":"x"}function Ou(e){return ku(Ln(e))}function WI(e,t,n){n===void 0&&(n=!1);const r=ko(e),i=Ou(e),s=Mu(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Na(a)),[a,Na(a)]}function GI(e){const t=Na(e);return[Pu(e),t,Pu(t)]}function Pu(e){return e.replace(/start|end/g,t=>zI[t])}const um=["left","right"],dm=["right","left"],qI=["top","bottom"],YI=["bottom","top"];function XI(e,t,n){switch(e){case"top":case"bottom":return n?t?dm:um:t?um:dm;case"left":case"right":return t?qI:YI;default:return[]}}function KI(e,t,n,r){const i=ko(e);let s=XI(Xn(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(Pu)))),s}function Na(e){return e.replace(/left|right|bottom|top/g,t=>FI[t])}function ZI(e){return{top:0,right:0,bottom:0,left:0,...e}}function fm(e){return typeof e!="number"?ZI(e):{top:e,right:e,bottom:e,left:e}}function Ia(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pm(e,t,n){let{reference:r,floating:i}=e;const s=Ln(t),a=Ou(t),l=Mu(a),u=Xn(t),d=s==="y",f=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let m;switch(u){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-i.width,y:g};break;default:m={x:r.x,y:r.y}}switch(ko(t)){case"start":m[a]-=h*(n&&d?-1:1);break;case"end":m[a]+=h*(n&&d?-1:1);break}return m}const JI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:g}=pm(d,r,u),h=r,m={},x=0;for(let v=0;v<l.length;v++){const{name:b,fn:S}=l[v],{x:N,y:w,data:I,reset:k}=await S({x:f,y:g,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});f=N??f,g=w??g,m={...m,[b]:{...m[b],...I}},k&&x<=50&&(x++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(d=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:g}=pm(d,h,u)),v=-1)}return{x:f,y:g,placement:h,strategy:i,middlewareData:m}};async function Ai(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:h=!1,padding:m=0}=Yn(t,e),x=fm(m),b=l[h?g==="floating"?"reference":"floating":g],S=Ia(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),N=g==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),I=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Ia(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:w,strategy:u}):N);return{top:(S.top-k.top+x.top)/I.y,bottom:(k.bottom-S.bottom+x.bottom)/I.y,left:(S.left-k.left+x.left)/I.x,right:(k.right-S.right+x.right)/I.x}}const QI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:u}=t,{element:d,padding:f=0}=Yn(e,t)||{};if(d==null)return{};const g=fm(f),h={x:n,y:r},m=Ou(i),x=Mu(m),v=await a.getDimensions(d),b=m==="y",S=b?"top":"left",N=b?"bottom":"right",w=b?"clientHeight":"clientWidth",I=s.reference[x]+s.reference[m]-h[m]-s.floating[x],k=h[m]-s.reference[m],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let M=A?A[w]:0;(!M||!await(a.isElement==null?void 0:a.isElement(A)))&&(M=l.floating[w]||s.floating[x]);const B=I/2-k/2,U=M/2-v[x]/2-1,q=vr(g[S],U),D=vr(g[N],U),$=q,F=M-v[x]-D,E=M/2-v[x]/2+B,P=Au($,E,F),L=!u.arrow&&ko(i)!=null&&E!==P&&s.reference[x]/2-(E<$?q:D)-v[x]/2<0,j=L?E<$?E-$:E-F:0;return{[m]:h[m]+j,data:{[m]:P,centerOffset:E-P-j,...L&&{alignmentOffset:j}},reset:L}}}),eE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=Yn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=Xn(i),N=Ln(l),w=Xn(l)===l,I=await(u.isRTL==null?void 0:u.isRTL(d.floating)),k=h||(w||!v?[Na(l)]:GI(l)),A=x!=="none";!h&&A&&k.push(...KI(l,v,x,I));const M=[l,...k],B=await Ai(t,b),U=[];let q=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&U.push(B[S]),g){const E=WI(i,a,I);U.push(B[E[0]],B[E[1]])}if(q=[...q,{placement:i,overflows:U}],!U.every(E=>E<=0)){var D,$;const E=(((D=s.flip)==null?void 0:D.index)||0)+1,P=M[E];if(P&&(!(g==="alignment"?N!==Ln(P):!1)||q.every(O=>Ln(O.placement)===N?O.overflows[0]>0:!0)))return{data:{index:E,overflows:q},reset:{placement:P}};let L=($=q.filter(j=>j.overflows[0]<=0).sort((j,O)=>j.overflows[1]-O.overflows[1])[0])==null?void 0:$.placement;if(!L)switch(m){case"bestFit":{var F;const j=(F=q.filter(O=>{if(A){const W=Ln(O.placement);return W===N||W==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(W=>W>0).reduce((W,z)=>W+z,0)]).sort((O,W)=>O[1]-W[1])[0])==null?void 0:F[0];j&&(L=j);break}case"initialPlacement":L=l;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function hm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gm(e){return VI.some(t=>e[t]>=0)}const tE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Yn(e,t);switch(r){case"referenceHidden":{const s=await Ai(t,{...i,elementContext:"reference"}),a=hm(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:gm(a)}}}case"escaped":{const s=await Ai(t,{...i,altBoundary:!0}),a=hm(s,n.floating);return{data:{escapedOffsets:a,escaped:gm(a)}}}default:return{}}}}},mm=new Set(["left","top"]);async function nE(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Xn(n),l=ko(n),u=Ln(n)==="y",d=mm.has(a)?-1:1,f=s&&u?-1:1,g=Yn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof x=="number"&&(m=l==="end"?x*-1:x),u?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const rE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=t,u=await nE(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},oE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:S,y:N}=b;return{x:S,y:N}}},...u}=Yn(e,t),d={x:n,y:r},f=await Ai(t,u),g=Ln(Xn(i)),h=ku(g);let m=d[h],x=d[g];if(s){const b=h==="y"?"top":"left",S=h==="y"?"bottom":"right",N=m+f[b],w=m-f[S];m=Au(N,m,w)}if(a){const b=g==="y"?"top":"left",S=g==="y"?"bottom":"right",N=x+f[b],w=x-f[S];x=Au(N,x,w)}const v=l.fn({...t,[h]:m,[g]:x});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:s,[g]:a}}}}}},iE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Yn(e,t),f={x:n,y:r},g=Ln(i),h=ku(g);let m=f[h],x=f[g];const v=Yn(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const w=h==="y"?"height":"width",I=s.reference[h]-s.floating[w]+b.mainAxis,k=s.reference[h]+s.reference[w]-b.mainAxis;m<I?m=I:m>k&&(m=k)}if(d){var S,N;const w=h==="y"?"width":"height",I=mm.has(Xn(i)),k=s.reference[g]-s.floating[w]+(I&&((S=a.offset)==null?void 0:S[g])||0)+(I?0:b.crossAxis),A=s.reference[g]+s.reference[w]+(I?0:((N=a.offset)==null?void 0:N[g])||0)-(I?b.crossAxis:0);x<k?x=k:x>A&&(x=A)}return{[h]:m,[g]:x}}}},sE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:l}=t,{apply:u=()=>{},...d}=Yn(e,t),f=await Ai(t,d),g=Xn(i),h=ko(i),m=Ln(i)==="y",{width:x,height:v}=s.floating;let b,S;g==="top"||g==="bottom"?(b=g,S=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(S=g,b=h==="end"?"top":"bottom");const N=v-f.top-f.bottom,w=x-f.left-f.right,I=vr(v-f[b],N),k=vr(x-f[S],w),A=!t.middlewareData.shift;let M=I,B=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=N),A&&!h){const q=zt(f.left,0),D=zt(f.right,0),$=zt(f.top,0),F=zt(f.bottom,0);m?B=x-2*(q!==0||D!==0?q+D:zt(f.left,f.right)):M=v-2*($!==0||F!==0?$+F:zt(f.top,f.bottom))}await u({...t,availableWidth:B,availableHeight:M});const U=await a.getDimensions(l.floating);return x!==U.width||v!==U.height?{reset:{rects:!0}}:{}}}};function Ea(){return typeof window<"u"}function Mo(e){return Ru(e)?(e.nodeName||"").toLowerCase():"#document"}function Ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dn(e){var t;return(t=(Ru(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ru(e){return Ea()?e instanceof Node||e instanceof Ut(e).Node:!1}function st(e){return Ea()?e instanceof Element||e instanceof Ut(e).Element:!1}function xn(e){return Ea()?e instanceof HTMLElement||e instanceof Ut(e).HTMLElement:!1}function Lu(e){return!Ea()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ut(e).ShadowRoot}const aE=new Set(["inline","contents"]);function ki(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aE.has(i)}const cE=new Set(["table","td","th"]);function lE(e){return cE.has(Mo(e))}const uE=[":popover-open",":modal"];function Ta(e){return uE.some(t=>{try{return e.matches(t)}catch{return!1}})}const dE=["transform","translate","scale","rotate","perspective"],fE=["transform","translate","scale","rotate","perspective","filter"],pE=["paint","layout","strict","content"];function Du(e){const t=Ca(),n=st(e)?Wt(e):e;return dE.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fE.some(r=>(n.willChange||"").includes(r))||pE.some(r=>(n.contain||"").includes(r))}function hE(e){let t=Zn(e);for(;xn(t)&&!Kn(t);){if(Du(t))return t;if(Ta(t))return null;t=Zn(t)}return null}function Ca(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gE=new Set(["html","body","#document"]);function Kn(e){return gE.has(Mo(e))}function Wt(e){return Ut(e).getComputedStyle(e)}function Aa(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zn(e){if(Mo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lu(e)&&e.host||Dn(e);return Lu(t)?t.host:t}function ym(e){const t=Zn(e);return Kn(t)?e.ownerDocument?e.ownerDocument.body:e.body:xn(t)&&ki(t)?t:ym(t)}function xr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ym(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ut(i);if(s){const l=ju(a);return t.concat(a,a.visualViewport||[],ki(i)?i:[],l&&n?xr(l):[])}return t.concat(i,xr(i,[],n))}function ju(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vm(e){const t=Wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xn(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=Sa(n)!==s||Sa(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function $u(e){return st(e)?e:e.contextElement}function Oo(e){const t=$u(e);if(!xn(t))return Rn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=vm(t);let a=(s?Sa(n.width):n.width)/r,l=(s?Sa(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const mE=Rn(0);function xm(e){const t=Ut(e);return!Ca()||!t.visualViewport?mE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ut(e)?!1:t}function Wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=$u(e);let a=Rn(1);t&&(r?st(r)&&(a=Oo(r)):a=Oo(e));const l=yE(s,n,r)?xm(s):Rn(0);let u=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,f=i.width/a.x,g=i.height/a.y;if(s){const h=Ut(s),m=r&&st(r)?Ut(r):r;let x=h,v=ju(x);for(;v&&r&&m!==x;){const b=Oo(v),S=v.getBoundingClientRect(),N=Wt(v),w=S.left+(v.clientLeft+parseFloat(N.paddingLeft))*b.x,I=S.top+(v.clientTop+parseFloat(N.paddingTop))*b.y;u*=b.x,d*=b.y,f*=b.x,g*=b.y,u+=w,d+=I,x=Ut(v),v=ju(x)}}return Ia({width:f,height:g,x:u,y:d})}function ka(e,t){const n=Aa(e).scrollLeft;return t?t.left+n:Wr(Dn(e)).left+n}function wm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ka(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function vE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=Dn(r),l=t?Ta(t.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Rn(1);const f=Rn(0),g=xn(r);if((g||!g&&!s)&&((Mo(r)!=="body"||ki(a))&&(u=Aa(r)),xn(r))){const m=Wr(r);d=Oo(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=a&&!g&&!s?wm(a,u):Rn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:n.y*d.y-u.scrollTop*d.y+f.y+h.y}}function xE(e){return Array.from(e.getClientRects())}function wE(e){const t=Dn(e),n=Aa(e),r=e.ownerDocument.body,i=zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ka(e);const l=-n.scrollTop;return Wt(r).direction==="rtl"&&(a+=zt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}const bm=25;function bE(e,t){const n=Ut(e),r=Dn(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;const f=Ca();(!f||f&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const d=ka(r);if(d<=0){const f=r.ownerDocument,g=f.body,h=getComputedStyle(g),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(r.clientWidth-g.clientWidth-m);x<=bm&&(s-=x)}else d<=bm&&(s+=d);return{width:s,height:a,x:l,y:u}}const SE=new Set(["absolute","fixed"]);function _E(e,t){const n=Wr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=xn(e)?Oo(e):Rn(1),a=e.clientWidth*s.x,l=e.clientHeight*s.y,u=i*s.x,d=r*s.y;return{width:a,height:l,x:u,y:d}}function Sm(e,t,n){let r;if(t==="viewport")r=bE(e,n);else if(t==="document")r=wE(Dn(e));else if(st(t))r=_E(t,n);else{const i=xm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ia(r)}function _m(e,t){const n=Zn(e);return n===t||!st(n)||Kn(n)?!1:Wt(n).position==="fixed"||_m(n,t)}function NE(e,t){const n=t.get(e);if(n)return n;let r=xr(e,[],!1).filter(l=>st(l)&&Mo(l)!=="body"),i=null;const s=Wt(e).position==="fixed";let a=s?Zn(e):e;for(;st(a)&&!Kn(a);){const l=Wt(a),u=Du(a);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&SE.has(i.position)||ki(a)&&!u&&_m(e,a))?r=r.filter(f=>f!==a):i=l,a=Zn(a)}return t.set(e,r),r}function IE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Ta(t)?[]:NE(t,this._c):[].concat(n),r],l=a[0],u=a.reduce((d,f)=>{const g=Sm(t,f,i);return d.top=zt(g.top,d.top),d.right=vr(g.right,d.right),d.bottom=vr(g.bottom,d.bottom),d.left=zt(g.left,d.left),d},Sm(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function EE(e){const{width:t,height:n}=vm(e);return{width:t,height:n}}function TE(e,t,n){const r=xn(t),i=Dn(t),s=n==="fixed",a=Wr(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Rn(0);function d(){u.x=ka(i)}if(r||!r&&!s)if((Mo(t)!=="body"||ki(i))&&(l=Aa(t)),r){const m=Wr(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else i&&d();s&&!r&&i&&d();const f=i&&!r&&!s?wm(i,l):Rn(0),g=a.left+l.scrollLeft-u.x-f.x,h=a.top+l.scrollTop-u.y-f.y;return{x:g,y:h,width:a.width,height:a.height}}function Hu(e){return Wt(e).position==="static"}function Nm(e,t){if(!xn(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dn(e)===n&&(n=n.ownerDocument.body),n}function Im(e,t){const n=Ut(e);if(Ta(e))return n;if(!xn(e)){let i=Zn(e);for(;i&&!Kn(i);){if(st(i)&&!Hu(i))return i;i=Zn(i)}return n}let r=Nm(e,t);for(;r&&lE(r)&&Hu(r);)r=Nm(r,t);return r&&Kn(r)&&Hu(r)&&!Du(r)?n:r||hE(e)||n}const CE=async function(e){const t=this.getOffsetParent||Im,n=this.getDimensions,r=await n(e.floating);return{reference:TE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AE(e){return Wt(e).direction==="rtl"}const kE={convertOffsetParentRelativeRectToViewportRelativeRect:vE,getDocumentElement:Dn,getClippingRect:IE,getOffsetParent:Im,getElementRects:CE,getClientRects:xE,getDimensions:EE,getScale:Oo,isElement:st,isRTL:AE};function Em(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ME(e,t){let n=null,r;const i=Dn(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:g,width:h,height:m}=d;if(l||t(),!h||!m)return;const x=_a(g),v=_a(i.clientWidth-(f+h)),b=_a(i.clientHeight-(g+m)),S=_a(f),w={rootMargin:-x+"px "+-v+"px "+-b+"px "+-S+"px",threshold:zt(0,vr(1,u))||1};let I=!0;function k(A){const M=A[0].intersectionRatio;if(M!==u){if(!I)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!Em(d,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return a(!0),s}function Mi(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=$u(e),f=i||s?[...d?xr(d):[],...xr(t)]:[];f.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const g=d&&l?ME(d,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(S=>{let[N]=S;N&&N.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),d&&!u&&m.observe(d),m.observe(t));let x,v=u?Wr(e):null;u&&b();function b(){const S=Wr(e);v&&!Em(v,S)&&n(),v=S,x=requestAnimationFrame(b)}return n(),()=>{var S;f.forEach(N=>{i&&N.removeEventListener("scroll",n),s&&N.removeEventListener("resize",n)}),g?.(),(S=m)==null||S.disconnect(),m=null,u&&cancelAnimationFrame(x)}}const OE=rE,PE=oE,RE=eE,LE=sE,DE=tE,Tm=QI,jE=iE,$E=(e,t,n)=>{const r=new Map,i={platform:kE,...n},s={...i.platform,_c:r};return JI(e,t,{...i,platform:s})};var HE=typeof document<"u",BE=function(){},Ma=HE?T.useLayoutEffect:BE;function Oa(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,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Oa(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Oa(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Cm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Am(e,t){const n=Cm(e);return Math.round(t*n)/n}function Bu(e){const t=V.useRef(e);return Ma(()=>{t.current=e}),t}function km(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,g]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=V.useState(r);Oa(h,r)||m(r);const[x,v]=V.useState(null),[b,S]=V.useState(null),N=V.useCallback(O=>{O!==A.current&&(A.current=O,v(O))},[]),w=V.useCallback(O=>{O!==M.current&&(M.current=O,S(O))},[]),I=s||x,k=a||b,A=V.useRef(null),M=V.useRef(null),B=V.useRef(f),U=u!=null,q=Bu(u),D=Bu(i),$=Bu(d),F=V.useCallback(()=>{if(!A.current||!M.current)return;const O={placement:t,strategy:n,middleware:h};D.current&&(O.platform=D.current),$E(A.current,M.current,O).then(W=>{const z={...W,isPositioned:$.current!==!1};E.current&&!Oa(B.current,z)&&(B.current=z,_o.flushSync(()=>{g(z)}))})},[h,t,n,D,$]);Ma(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[d]);const E=V.useRef(!1);Ma(()=>(E.current=!0,()=>{E.current=!1}),[]),Ma(()=>{if(I&&(A.current=I),k&&(M.current=k),I&&k){if(q.current)return q.current(I,k,F);F()}},[I,k,F,q,U]);const P=V.useMemo(()=>({reference:A,floating:M,setReference:N,setFloating:w}),[N,w]),L=V.useMemo(()=>({reference:I,floating:k}),[I,k]),j=V.useMemo(()=>{const O={position:n,left:0,top:0};if(!L.floating)return O;const W=Am(L.floating,f.x),z=Am(L.floating,f.y);return l?{...O,transform:"translate("+W+"px, "+z+"px)",...Cm(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:z}},[n,l,L.floating,f.x,f.y]);return V.useMemo(()=>({...f,update:F,refs:P,elements:L,floatingStyles:j}),[f,F,P,L,j])}const VE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Tm({element:r.current,padding:i}).fn(n):{}:r?Tm({element:r,padding:i}).fn(n):{}}}},Oi=(e,t)=>({...OE(e),options:[e,t]}),Pi=(e,t)=>({...PE(e),options:[e,t]}),FE=(e,t)=>({...jE(e),options:[e,t]}),Ri=(e,t)=>({...RE(e),options:[e,t]}),zE=(e,t)=>({...LE(e),options:[e,t]}),UE=(e,t)=>({...DE(e),options:[e,t]}),Vu=(e,t)=>({...VE(e),options:[e,t]});var WE="Arrow",Mm=V.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return y.jsx(Ke.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Mm.displayName=WE;var GE=Mm,Fu="Popper",[Om,Pm]=No(Fu),[qE,Rm]=Om(Fu),Lm=e=>{const{__scopePopper:t,children:n}=e,[r,i]=V.useState(null);return y.jsx(qE,{scope:t,anchor:r,onAnchorChange:i,children:n})};Lm.displayName=Fu;var Dm="PopperAnchor",jm=V.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=Rm(Dm,n),a=V.useRef(null),l=ut(t,a),u=V.useRef(null);return V.useEffect(()=>{const d=u.current;u.current=r?.current||a.current,d!==u.current&&s.onAnchorChange(u.current)}),r?null:y.jsx(Ke.div,{...i,ref:l})});jm.displayName=Dm;var zu="PopperContent",[YE,XE]=Om(zu),$m=V.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:x,...v}=e,b=Rm(zu,n),[S,N]=V.useState(null),w=ut(t,Q=>N(Q)),[I,k]=V.useState(null),A=nm(I),M=A?.width??0,B=A?.height??0,U=r+(s!=="center"?"-"+s:""),q=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(d)?d:[d],$=D.length>0,F={padding:q,boundary:D.filter(ZE),altBoundary:$},{refs:E,floatingStyles:P,placement:L,isPositioned:j,middlewareData:O}=km({strategy:"fixed",placement:U,whileElementsMounted:(...Q)=>Mi(...Q,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[Oi({mainAxis:i+B,alignmentAxis:a}),u&&Pi({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?FE():void 0,...F}),u&&Ri({...F}),zE({...F,apply:({elements:Q,rects:te,availableWidth:ne,availableHeight:oe})=>{const{width:pe,height:le}=te.reference,ve=Q.floating.style;ve.setProperty("--radix-popper-available-width",`${ne}px`),ve.setProperty("--radix-popper-available-height",`${oe}px`),ve.setProperty("--radix-popper-anchor-width",`${pe}px`),ve.setProperty("--radix-popper-anchor-height",`${le}px`)}}),I&&Vu({element:I,padding:l}),JE({arrowWidth:M,arrowHeight:B}),h&&UE({strategy:"referenceHidden",...F})]}),[W,z]=Vm(L),Y=Ur(x);_t(()=>{j&&Y?.()},[j,Y]);const J=O.arrow?.x,ie=O.arrow?.y,ee=O.arrow?.centerOffset!==0,[ce,ge]=V.useState();return _t(()=>{S&&ge(window.getComputedStyle(S).zIndex)},[S]),y.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:j?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(" "),...O.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(YE,{scope:n,placedSide:W,onArrowChange:k,arrowX:J,arrowY:ie,shouldHideArrow:ee,children:y.jsx(Ke.div,{"data-side":W,"data-align":z,...v,ref:w,style:{...v.style,animation:j?void 0:"none"}})})})});$m.displayName=zu;var Hm="PopperArrow",KE={top:"bottom",right:"left",bottom:"top",left:"right"},Bm=V.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=XE(Hm,r),a=KE[s.placedSide];return y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:y.jsx(GE,{...i,ref:n,style:{...i.style,display:"block"}})})});Bm.displayName=Hm;function ZE(e){return e!==null}var JE=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,f]=Vm(n),g={start:"0%",center:"50%",end:"100%"}[f],h=(i.arrow?.x??0)+l/2,m=(i.arrow?.y??0)+u/2;let x="",v="";return d==="bottom"?(x=a?g:`${h}px`,v=`${-u}px`):d==="top"?(x=a?g:`${h}px`,v=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,v=a?g:`${m}px`):d==="left"&&(x=`${r.floating.width+u}px`,v=a?g:`${m}px`),{data:{x,y:v}}}});function Vm(e){const[t,n="center"]=e.split("-");return[t,n]}var QE=Lm,eT=jm,tT=$m,nT=Bm;function Fm(e,[t,n]){return Math.min(n,Math.max(t,e))}var rT=[" ","Enter","ArrowUp","ArrowDown"],oT=[" ","Enter"],Gr="Select",[Pa,Ra,iT]=sg(Gr),[Po,kF]=No(Gr,[iT,Pm]),La=Pm(),[sT,wr]=Po(Gr),[aT,cT]=Po(Gr),zm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:g,disabled:h,required:m,form:x}=e,v=La(t),[b,S]=V.useState(null),[N,w]=V.useState(null),[I,k]=V.useState(!1),A=fg(d),[M,B]=Io({prop:r,defaultProp:i??!1,onChange:s,caller:Gr}),[U,q]=Io({prop:a,defaultProp:l,onChange:u,caller:Gr}),D=V.useRef(null),$=b?x||!!b.closest("form"):!0,[F,E]=V.useState(new Set),P=Array.from(F).map(L=>L.props.value).join(";");return y.jsx(QE,{...v,children:y.jsxs(sT,{required:m,scope:t,trigger:b,onTriggerChange:S,valueNode:N,onValueNodeChange:w,valueNodeHasChildren:I,onValueNodeHasChildrenChange:k,contentId:Ci(),value:U,onValueChange:q,open:M,onOpenChange:B,dir:A,triggerPointerDownPosRef:D,disabled:h,children:[y.jsx(Pa.Provider,{scope:t,children:y.jsx(aT,{scope:e.__scopeSelect,onNativeOptionAdd:V.useCallback(L=>{E(j=>new Set(j).add(L))},[]),onNativeOptionRemove:V.useCallback(L=>{E(j=>{const O=new Set(j);return O.delete(L),O})},[]),children:n})}),$?y.jsxs(hy,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:g,value:U,onChange:L=>q(L.target.value),disabled:h,form:x,children:[U===void 0?y.jsx("option",{value:""}):null,Array.from(F)]},P):null]})})};zm.displayName=Gr;var Um="SelectTrigger",Wm=V.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=La(n),a=wr(Um,n),l=a.disabled||r,u=ut(t,a.onTriggerChange),d=Ra(n),f=V.useRef("touch"),[g,h,m]=my(v=>{const b=d().filter(w=>!w.disabled),S=b.find(w=>w.value===a.value),N=yy(b,v,S);N!==void 0&&a.onValueChange(N.value)}),x=v=>{l||(a.onOpenChange(!0),m()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return y.jsx(eT,{asChild:!0,...s,children:y.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":gy(a.value)?"":void 0,...i,ref:u,onClick:it(i.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&x(v)}),onPointerDown:it(i.onPointerDown,v=>{f.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(x(v),v.preventDefault())}),onKeyDown:it(i.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(b&&v.key===" ")&&rT.includes(v.key)&&(x(),v.preventDefault())})})})});Wm.displayName=Um;var Gm="SelectValue",qm=V.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...l}=e,u=wr(Gm,n),{onValueNodeHasChildrenChange:d}=u,f=s!==void 0,g=ut(t,u.onValueNodeChange);return _t(()=>{d(f)},[d,f]),y.jsx(Ke.span,{...l,ref:g,style:{pointerEvents:"none"},children:gy(u.value)?y.jsx(y.Fragment,{children:a}):s})});qm.displayName=Gm;var lT="SelectIcon",Ym=V.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return y.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Ym.displayName=lT;var uT="SelectPortal",Xm=e=>y.jsx(Lg,{asChild:!0,...e});Xm.displayName=uT;var qr="SelectContent",Km=V.forwardRef((e,t)=>{const n=wr(qr,e.__scopeSelect),[r,i]=V.useState();if(_t(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?_o.createPortal(y.jsx(Zm,{scope:e.__scopeSelect,children:y.jsx(Pa.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),s):null}return y.jsx(Jm,{...e,ref:t})});Km.displayName=qr;var wn=10,[Zm,br]=Po(qr),dT="SelectContentImpl",fT=Ti("SelectContent.RemoveScroll"),Jm=V.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:b,...S}=e,N=wr(qr,n),[w,I]=V.useState(null),[k,A]=V.useState(null),M=ut(t,Q=>I(Q)),[B,U]=V.useState(null),[q,D]=V.useState(null),$=Ra(n),[F,E]=V.useState(!1),P=V.useRef(!1);V.useEffect(()=>{if(w)return RI(w)},[w]),YN();const L=V.useCallback(Q=>{const[te,...ne]=$().map(le=>le.ref.current),[oe]=ne.slice(-1),pe=document.activeElement;for(const le of Q)if(le===pe||(le?.scrollIntoView({block:"nearest"}),le===te&&k&&(k.scrollTop=0),le===oe&&k&&(k.scrollTop=k.scrollHeight),le?.focus(),document.activeElement!==pe))return},[$,k]),j=V.useCallback(()=>L([B,w]),[L,B,w]);V.useEffect(()=>{F&&j()},[F,j]);const{onOpenChange:O,triggerPointerDownPosRef:W}=N;V.useEffect(()=>{if(w){let Q={x:0,y:0};const te=oe=>{Q={x:Math.abs(Math.round(oe.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(W.current?.y??0))}},ne=oe=>{Q.x<=10&&Q.y<=10?oe.preventDefault():w.contains(oe.target)||O(!1),document.removeEventListener("pointermove",te),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ne,{capture:!0})}}},[w,O,W]),V.useEffect(()=>{const Q=()=>O(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[O]);const[z,Y]=my(Q=>{const te=$().filter(pe=>!pe.disabled),ne=te.find(pe=>pe.ref.current===document.activeElement),oe=yy(te,Q,ne);oe&&setTimeout(()=>oe.ref.current.focus())}),J=V.useCallback((Q,te,ne)=>{const oe=!P.current&&!ne;(N.value!==void 0&&N.value===te||oe)&&(U(Q),oe&&(P.current=!0))},[N.value]),ie=V.useCallback(()=>w?.focus(),[w]),ee=V.useCallback((Q,te,ne)=>{const oe=!P.current&&!ne;(N.value!==void 0&&N.value===te||oe)&&D(Q)},[N.value]),ce=r==="popper"?Uu:Qm,ge=ce===Uu?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:b}:{};return y.jsx(Zm,{scope:n,content:w,viewport:k,onViewportChange:A,itemRefCallback:J,selectedItem:B,onItemLeave:ie,itemTextRefCallback:ee,focusSelectedItem:j,selectedItemText:q,position:r,isPositioned:F,searchRef:z,children:y.jsx(Xg,{as:fT,allowPinchZoom:!0,children:y.jsx(kg,{asChild:!0,trapped:N.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:it(i,Q=>{N.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:y.jsx(Eg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:y.jsx(ce,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:Q=>Q.preventDefault(),...S,...ge,onPlaced:()=>E(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:it(S.onKeyDown,Q=>{const te=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!te&&Q.key.length===1&&Y(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let oe=$().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const pe=Q.target,le=oe.indexOf(pe);oe=oe.slice(le+1)}setTimeout(()=>L(oe)),Q.preventDefault()}})})})})})})});Jm.displayName=dT;var pT="SelectItemAlignedPosition",Qm=V.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=wr(qr,n),a=br(qr,n),[l,u]=V.useState(null),[d,f]=V.useState(null),g=ut(t,M=>f(M)),h=Ra(n),m=V.useRef(!1),x=V.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:S,focusSelectedItem:N}=a,w=V.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&v&&b&&S){const M=s.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),U=s.valueNode.getBoundingClientRect(),q=S.getBoundingClientRect();if(s.dir!=="rtl"){const pe=q.left-B.left,le=U.left-pe,ve=M.left-le,me=M.width+ve,Oe=Math.max(me,B.width),Ce=window.innerWidth-wn,ae=Fm(le,[wn,Math.max(wn,Ce-Oe)]);l.style.minWidth=me+"px",l.style.left=ae+"px"}else{const pe=B.right-q.right,le=window.innerWidth-U.right-pe,ve=window.innerWidth-M.right-le,me=M.width+ve,Oe=Math.max(me,B.width),Ce=window.innerWidth-wn,ae=Fm(le,[wn,Math.max(wn,Ce-Oe)]);l.style.minWidth=me+"px",l.style.right=ae+"px"}const D=h(),$=window.innerHeight-wn*2,F=v.scrollHeight,E=window.getComputedStyle(d),P=parseInt(E.borderTopWidth,10),L=parseInt(E.paddingTop,10),j=parseInt(E.borderBottomWidth,10),O=parseInt(E.paddingBottom,10),W=P+L+F+O+j,z=Math.min(b.offsetHeight*5,W),Y=window.getComputedStyle(v),J=parseInt(Y.paddingTop,10),ie=parseInt(Y.paddingBottom,10),ee=M.top+M.height/2-wn,ce=$-ee,ge=b.offsetHeight/2,Q=b.offsetTop+ge,te=P+L+Q,ne=W-te;if(te<=ee){const pe=D.length>0&&b===D[D.length-1].ref.current;l.style.bottom="0px";const le=d.clientHeight-v.offsetTop-v.offsetHeight,ve=Math.max(ce,ge+(pe?ie:0)+le+j),me=te+ve;l.style.height=me+"px"}else{const pe=D.length>0&&b===D[0].ref.current;l.style.top="0px";const ve=Math.max(ee,P+v.offsetTop+(pe?J:0)+ge)+ne;l.style.height=ve+"px",v.scrollTop=te-ee+v.offsetTop}l.style.margin=`${wn}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=$+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,l,d,v,b,S,s.dir,r]);_t(()=>w(),[w]);const[I,k]=V.useState();_t(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const A=V.useCallback(M=>{M&&x.current===!0&&(w(),N?.(),x.current=!1)},[w,N]);return y.jsx(gT,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:A,children:y.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:y.jsx(Ke.div,{...i,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Qm.displayName=pT;var hT="SelectPopperPosition",Uu=V.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=wn,...s}=e,a=La(n);return y.jsx(tT,{...a,...s,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Uu.displayName=hT;var[gT,Wu]=Po(qr,{}),Gu="SelectViewport",ey=V.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=br(Gu,n),a=Wu(Gu,n),l=ut(t,s.onViewportChange),u=V.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(Pa.Slot,{scope:n,children:y.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:it(i.onScroll,d=>{const f=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:h}=a;if(h?.current&&g){const m=Math.abs(u.current-f.scrollTop);if(m>0){const x=window.innerHeight-wn*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),S=Math.max(v,b);if(S<x){const N=S+m,w=Math.min(x,N),I=N-w;g.style.height=w+"px",g.style.bottom==="0px"&&(f.scrollTop=I>0?I:0,g.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});ey.displayName=Gu;var ty="SelectGroup",[mT,yT]=Po(ty),ny=V.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ci();return y.jsx(mT,{scope:n,id:i,children:y.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:t})})});ny.displayName=ty;var ry="SelectLabel",oy=V.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yT(ry,n);return y.jsx(Ke.div,{id:i.id,...r,ref:t})});oy.displayName=ry;var Da="SelectItem",[vT,iy]=Po(Da),sy=V.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,l=wr(Da,n),u=br(Da,n),d=l.value===r,[f,g]=V.useState(s??""),[h,m]=V.useState(!1),x=ut(t,N=>u.itemRefCallback?.(N,r,i)),v=Ci(),b=V.useRef("touch"),S=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(vT,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:V.useCallback(N=>{g(w=>w||(N?.textContent??"").trim())},[]),children:y.jsx(Pa.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:y.jsx(Ke.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:x,onFocus:it(a.onFocus,()=>m(!0)),onBlur:it(a.onBlur,()=>m(!1)),onClick:it(a.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:it(a.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:it(a.onPointerDown,N=>{b.current=N.pointerType}),onPointerMove:it(a.onPointerMove,N=>{b.current=N.pointerType,i?u.onItemLeave?.():b.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:it(a.onPointerLeave,N=>{N.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:it(a.onKeyDown,N=>{u.searchRef?.current!==""&&N.key===" "||(oT.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});sy.displayName=Da;var Li="SelectItemText",ay=V.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=wr(Li,n),l=br(Li,n),u=iy(Li,n),d=cT(Li,n),[f,g]=V.useState(null),h=ut(t,S=>g(S),u.onItemTextChange,S=>l.itemTextRefCallback?.(S,u.value,u.disabled)),m=f?.textContent,x=V.useMemo(()=>y.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=d;return _t(()=>(v(x),()=>b(x)),[v,b,x]),y.jsxs(y.Fragment,{children:[y.jsx(Ke.span,{id:u.textId,...s,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?_o.createPortal(s.children,a.valueNode):null]})});ay.displayName=Li;var cy="SelectItemIndicator",ly=V.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return iy(cy,n).isSelected?y.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});ly.displayName=cy;var qu="SelectScrollUpButton",uy=V.forwardRef((e,t)=>{const n=br(qu,e.__scopeSelect),r=Wu(qu,e.__scopeSelect),[i,s]=V.useState(!1),a=ut(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?y.jsx(fy,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});uy.displayName=qu;var Yu="SelectScrollDownButton",dy=V.forwardRef((e,t)=>{const n=br(Yu,e.__scopeSelect),r=Wu(Yu,e.__scopeSelect),[i,s]=V.useState(!1),a=ut(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<d;s(f)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?y.jsx(fy,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});dy.displayName=Yu;var fy=V.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=br("SelectScrollButton",n),a=V.useRef(null),l=Ra(n),u=V.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return V.useEffect(()=>()=>u(),[u]),_t(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),y.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:it(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:it(i.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:it(i.onPointerLeave,()=>{u()})})}),xT="SelectSeparator",py=V.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});py.displayName=xT;var Xu="SelectArrow",wT=V.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=La(n),s=wr(Xu,n),a=br(Xu,n);return s.open&&a.position==="popper"?y.jsx(nT,{...i,...r,ref:t}):null});wT.displayName=Xu;var bT="SelectBubbleInput",hy=V.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=V.useRef(null),s=ut(r,i),a=tm(t);return V.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const g=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(g)}},[a,t]),y.jsx(Ke.select,{...n,style:{...ig,...n.style},ref:s,defaultValue:t})});hy.displayName=bT;function gy(e){return e===""||e===void 0}function my(e){const t=Ur(e),n=V.useRef(""),r=V.useRef(0),i=V.useCallback(a=>{const l=n.current+a;t(l),function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),s=V.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return V.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function yy(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=ST(e,Math.max(s,0));i.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function ST(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _T=zm,vy=Wm,xy=qm,NT=Ym,IT=Xm,wy=Km,ET=ey,TT=ny,by=oy,Sy=sy,CT=ay,AT=ly,_y=uy,Ny=dy,Iy=py;function Ey(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ey(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ty(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ey(e))&&(r&&(r+=" "),r+=t);return r}const Ku="-",kT=e=>{const t=OT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(Ku);return l[0]===""&&l.length!==1&&l.shift(),Cy(l,t)||MT(a)},getConflictingClassGroupIds:(a,l)=>{const u=n[a]||[];return l&&r[a]?[...u,...r[a]]:u}}},Cy=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Cy(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Ku);return t.validators.find(({validator:a})=>a(s))?.classGroupId},Ay=/^\[(.+)\]$/,MT=e=>{if(Ay.test(e)){const t=Ay.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},OT=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Zu(n[i],r,i,t);return r},Zu=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:ky(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(PT(i)){Zu(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Zu(a,ky(t,s),n,r)})})},ky=(e,t)=>{let n=e;return t.split(Ku).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},PT=e=>e.isThemeGetter,RT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},Ju="!",Qu=":",LT=Qu.length,DT=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,l=0,u=0,d;for(let x=0;x<i.length;x++){let v=i[x];if(a===0&&l===0){if(v===Qu){s.push(i.slice(u,x)),u=x+LT;continue}if(v==="/"){d=x;continue}}v==="["?a++:v==="]"?a--:v==="("?l++:v===")"&&l--}const f=s.length===0?i:i.substring(u),g=jT(f),h=g!==f,m=d&&d>u?d-u:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const i=t+Qu,s=r;r=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},jT=e=>e.endsWith(Ju)?e.substring(0,e.length-1):e.startsWith(Ju)?e.substring(1):e,$T=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},HT=e=>({cache:RT(e.cacheSize),parseClassName:DT(e),sortModifiers:$T(e),...kT(e)}),BT=/\s+/,VT=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],l=e.trim().split(BT);let u="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{isExternal:g,modifiers:h,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:v}=n(f);if(g){u=f+(u.length>0?" "+u:u);continue}let b=!!v,S=r(b?x.substring(0,v):x);if(!S){if(!b){u=f+(u.length>0?" "+u:u);continue}if(S=r(x),!S){u=f+(u.length>0?" "+u:u);continue}b=!1}const N=s(h).join(":"),w=m?N+Ju:N,I=w+S;if(a.includes(I))continue;a.push(I);const k=i(S,b);for(let A=0;A<k.length;++A){const M=k[A];a.push(w+M)}u=f+(u.length>0?" "+u:u)}return u};function FT(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=My(t))&&(r&&(r+=" "),r+=n);return r}const My=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=My(e[r]))&&(n&&(n+=" "),n+=t);return n};function zT(e,...t){let n,r,i,s=a;function a(u){const d=t.reduce((f,g)=>g(f),e());return n=HT(d),r=n.cache.get,i=n.cache.set,s=l,l(u)}function l(u){const d=r(u);if(d)return d;const f=VT(u,n);return i(u,f),f}return function(){return s(FT.apply(null,arguments))}}const vt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Oy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Py=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UT=/^\d+\/\d+$/,WT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GT=/\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$/,qT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ro=e=>UT.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),Sr=e=>!!e&&Number.isInteger(Number(e)),ed=e=>e.endsWith("%")&&$e(e.slice(0,-1)),Jn=e=>WT.test(e),KT=()=>!0,ZT=e=>GT.test(e)&&!qT.test(e),Ry=()=>!1,JT=e=>YT.test(e),QT=e=>XT.test(e),eC=e=>!be(e)&&!Se(e),tC=e=>Lo(e,Hy,Ry),be=e=>Oy.test(e),Yr=e=>Lo(e,By,ZT),td=e=>Lo(e,sC,$e),Ly=e=>Lo(e,jy,Ry),nC=e=>Lo(e,$y,QT),ja=e=>Lo(e,Vy,JT),Se=e=>Py.test(e),Di=e=>Do(e,By),rC=e=>Do(e,aC),Dy=e=>Do(e,jy),oC=e=>Do(e,Hy),iC=e=>Do(e,$y),$a=e=>Do(e,Vy,!0),Lo=(e,t,n)=>{const r=Oy.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Do=(e,t,n=!1)=>{const r=Py.exec(e);return r?r[1]?t(r[1]):n:!1},jy=e=>e==="position"||e==="percentage",$y=e=>e==="image"||e==="url",Hy=e=>e==="length"||e==="size"||e==="bg-size",By=e=>e==="length",sC=e=>e==="number",aC=e=>e==="family-name",Vy=e=>e==="shadow",cC=zT(()=>{const e=vt("color"),t=vt("font"),n=vt("text"),r=vt("font-weight"),i=vt("tracking"),s=vt("leading"),a=vt("breakpoint"),l=vt("container"),u=vt("spacing"),d=vt("radius"),f=vt("shadow"),g=vt("inset-shadow"),h=vt("text-shadow"),m=vt("drop-shadow"),x=vt("blur"),v=vt("perspective"),b=vt("aspect"),S=vt("ease"),N=vt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...I(),Se,be],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],B=()=>[Se,be,u],U=()=>[Ro,"full","auto",...B()],q=()=>[Sr,"none","subgrid",Se,be],D=()=>["auto",{span:["full",Sr,Se,be]},Sr,Se,be],$=()=>[Sr,"auto",Se,be],F=()=>["auto","min","max","fr",Se,be],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...B()],j=()=>[Ro,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],O=()=>[e,Se,be],W=()=>[...I(),Dy,Ly,{position:[Se,be]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",oC,tC,{size:[Se,be]}],J=()=>[ed,Di,Yr],ie=()=>["","none","full",d,Se,be],ee=()=>["",$e,Di,Yr],ce=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[$e,ed,Dy,Ly],te=()=>["","none",x,Se,be],ne=()=>["none",$e,Se,be],oe=()=>["none",$e,Se,be],pe=()=>[$e,Se,be],le=()=>[Ro,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jn],breakpoint:[Jn],color:[KT],container:[Jn],"drop-shadow":[Jn],ease:["in","out","in-out"],font:[eC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jn],shadow:[Jn],spacing:["px",$e],text:[Jn],"text-shadow":[Jn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ro,be,Se,b]}],container:["container"],columns:[{columns:[$e,be,Se,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Sr,"auto",Se,be]}],basis:[{basis:[Ro,"full","auto",l,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,Ro,"auto","initial","none",be]}],grow:[{grow:["",$e,Se,be]}],shrink:[{shrink:["",$e,Se,be]}],order:[{order:[Sr,"first","last","none",Se,be]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[l,"screen",...j()]}],"min-w":[{"min-w":[l,"screen","none",...j()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",n,Di,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Se,td]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ed,be]}],"font-family":[{font:[rC,be,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:[i,Se,be]}],"line-clamp":[{"line-clamp":[$e,"none",Se,td]}],leading:[{leading:[s,...B()]}],"list-image":[{"list-image":["none",Se,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",Se,Yr]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[$e,"auto",Se,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,be]}],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",Se,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sr,Se,be],radial:["",Se,be],conic:[Sr,Se,be]},iC,nC]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,Se,be]}],"outline-w":[{outline:["",$e,Di,Yr]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",f,$a,ja]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",g,$a,ja]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[$e,Yr]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",h,$a,ja]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[$e,Se,be]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Se,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":I()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,be]}],filter:[{filter:["","none",Se,be]}],blur:[{blur:te()}],brightness:[{brightness:[$e,Se,be]}],contrast:[{contrast:[$e,Se,be]}],"drop-shadow":[{"drop-shadow":["","none",m,$a,ja]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",$e,Se,be]}],"hue-rotate":[{"hue-rotate":[$e,Se,be]}],invert:[{invert:["",$e,Se,be]}],saturate:[{saturate:[$e,Se,be]}],sepia:[{sepia:["",$e,Se,be]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,be]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[$e,Se,be]}],"backdrop-contrast":[{"backdrop-contrast":[$e,Se,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,Se,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,Se,be]}],"backdrop-invert":[{"backdrop-invert":["",$e,Se,be]}],"backdrop-opacity":[{"backdrop-opacity":[$e,Se,be]}],"backdrop-saturate":[{"backdrop-saturate":[$e,Se,be]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,Se,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",Se,be]}],ease:[{ease:["linear","initial",S,Se,be]}],delay:[{delay:[$e,Se,be]}],animate:[{animate:["none",N,Se,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Se,be]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[Se,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",Se,be]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Se,be]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[$e,Di,Yr,td]}],stroke:[{stroke:["none",...O()]}],"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 ye(...e){return cC(Ty(e))}function Fy({...e}){return y.jsx(TN,{"data-slot":"accordion",...e})}function nd({className:e,...t}){return y.jsx(CN,{"data-slot":"accordion-item",className:ye("border-b border-secondary-dark-gray last:border-b-0",e),...t})}function rd({className:e,children:t,...n}){return y.jsx(AN,{className:"flex",children:y.jsxs(kN,{"data-slot":"accordion-trigger",className:ye("flex flex-1 items-center gap-2 rounded-md py-2.5 px-4 text-left text-sm font-medium transition-all outline-none bg-runner-section-header-bg text-primary-white hover:no-underline focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[y.jsx(Ei,{className:"pointer-events-none size-4 shrink-0 text-secondary-light-gray transition-transform duration-200",strokeWidth:3}),t]})})}function od({className:e,children:t,...n}){return y.jsx(MN,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:y.jsx("div",{className:ye("pt-0 pb-4",e),children:t})})}const zy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Uy=Ty,lC=((e,t)=>n=>{var r;if(t?.variants==null)return Uy(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(d=>{const f=n?.[d],g=s?.[d];if(f===null)return null;const h=zy(f)||zy(g);return i[d][h]}),l=n&&Object.entries(n).reduce((d,f)=>{let[g,h]=f;return h===void 0||(d[g]=h),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:g,className:h,...m}=f;return Object.entries(m).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...s,...l}[v]):{...s,...l}[v]===b})?[...d,g,h]:d},[]);return Uy(e,a,u,n?.class,n?.className)})("inline-flex items-center justify-center gap-2 cursor-pointer py-2 px-4 rounded-md transition-all text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white disabled:cursor-not-allowed disabled:bg-secondary-dark-gray disabled:opacity-50 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"}]}),Qn=T.forwardRef(({className:e,color:t,asChild:n=!1,applyHoverStyles:r,...i},s)=>{const a=n?G_:"button";return y.jsx(a,{ref:s,"data-slot":"button",className:ye(lC({color:t,className:e,applyHoverStyles:r})),...i})});Qn.displayName="Button";function id(e,t,n,r=!1,i=!1){if(t>n){const s=t;t=n,n=s}return(r?e>=t:e>t)&&(i?e<=n:e<n)}function Wy(e,t,n=!1,r=!1){return id(e.x,t.left,t.right,n)&&id(e.y,t.top,t.bottom,r)}function Gy(e){const t=e.startsWith("-"),n=e.replaceAll(/[^0-9\.]/g,""),r=n.indexOf(".");let i=0;if(r===-1)i=Number(n);else{const s=n.substring(0,r).replaceAll(/[^0-9]/g,""),a=n.substring(r+1).replaceAll(/[^0-9]/g,"");i=+(s+"."+a)}return t&&(i=-i),i}function sd(e,t){return e.toFixed(t).replace(/[0]+$/,"").replace(/\.$/,"")}const nn=["string","number","boolean","complex","noEquivalent","inferFromConnection"],qy={[nn[0]]:nn[0],[nn[1]]:nn[1],[nn[2]]:nn[2],[nn[3]]:nn[3],[nn[4]]:nn[4],[nn[5]]:nn[5]};function uC(e){return!!qy[e]}function dC(e){return e}function fC(e,t){return e in t}function pC(e){return e}function hC(e){return e}function gC(e){return e}var Yy=Symbol.for("immer-nothing"),Xy=Symbol.for("immer-draftable"),Gt=Symbol.for("immer-state"),mC=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 Lt(e,...t){if(process.env.NODE_ENV!=="production"){const n=mC[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jo=Object.getPrototypeOf;function $o(e){return!!e&&!!e[Gt]}function Xr(e){return e?Ky(e)||Array.isArray(e)||!!e[Xy]||!!e.constructor?.[Xy]||ji(e)||Va(e):!1}var yC=Object.prototype.constructor.toString();function Ky(e){if(!e||typeof e!="object")return!1;const t=jo(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)===yC}function Ha(e,t){Ba(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ba(e){const t=e[Gt];return t?t.type_:Array.isArray(e)?1:ji(e)?2:Va(e)?3:0}function ad(e,t){return Ba(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Zy(e,t,n){const r=Ba(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vC(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ji(e){return e instanceof Map}function Va(e){return e instanceof Set}function Kr(e){return e.copy_||e.base_}function cd(e,t){if(ji(e))return new Map(e);if(Va(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Ky(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Gt];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const a=i[s],l=r[a];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[a]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[a]})}return Object.create(jo(e),r)}else{const r=jo(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function ld(e,t=!1){return za(e)||$o(e)||!Xr(e)||(Ba(e)>1&&Object.defineProperties(e,{set:{value:Fa},add:{value:Fa},clear:{value:Fa},delete:{value:Fa}}),Object.freeze(e),t&&Object.values(e).forEach(n=>ld(n,!0))),e}function Fa(){Lt(2)}function za(e){return Object.isFrozen(e)}var xC={};function Zr(e){const t=xC[e];return t||Lt(0,e),t}var $i;function Jy(){return $i}function wC(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qy(e,t){t&&(Zr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ud(e){dd(e),e.drafts_.forEach(bC),e.drafts_=null}function dd(e){e===$i&&($i=e.parent_)}function ev(e){return $i=wC($i,e)}function bC(e){const t=e[Gt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tv(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Gt].modified_&&(ud(t),Lt(4)),Xr(e)&&(e=Ua(t,e),t.parent_||Wa(t,e)),t.patches_&&Zr("Patches").generateReplacementPatches_(n[Gt].base_,e,t.patches_,t.inversePatches_)):e=Ua(t,n,[]),ud(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yy?e:void 0}function Ua(e,t,n){if(za(t))return t;const r=t[Gt];if(!r)return Ha(t,(i,s)=>nv(e,r,t,i,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Wa(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let s=i,a=!1;r.type_===3&&(s=new Set(i),i.clear(),a=!0),Ha(s,(l,u)=>nv(e,r,i,l,u,n,a)),Wa(e,i,!1),n&&e.patches_&&Zr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function nv(e,t,n,r,i,s,a){if(process.env.NODE_ENV!=="production"&&i===n&&Lt(5),$o(i)){const l=s&&t&&t.type_!==3&&!ad(t.assigned_,r)?s.concat(r):void 0,u=Ua(e,i,l);if(Zy(n,r,u),$o(u))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(Xr(i)&&!za(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ua(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ji(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Wa(e,i)}}function Wa(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ld(t,n)}function SC(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Jy(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=fd;n&&(i=[r],s=Hi);const{revoke:a,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=a,l}var fd={get(e,t){if(t===Gt)return e;const n=Kr(e);if(!ad(n,t))return _C(e,n,t);const r=n[t];return e.finalized_||!Xr(r)?r:r===pd(e.base_,t)?(gd(e),e.copy_[t]=md(r,e)):r},has(e,t){return t in Kr(e)},ownKeys(e){return Reflect.ownKeys(Kr(e))},set(e,t,n){const r=rv(Kr(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=pd(Kr(e),t),s=i?.[Gt];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(vC(n,i)&&(n!==void 0||ad(e.base_,t)))return!0;gd(e),hd(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 pd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gd(e),hd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Kr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Lt(11)},getPrototypeOf(e){return jo(e.base_)},setPrototypeOf(){Lt(12)}},Hi={};Ha(fd,(e,t)=>{Hi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Hi.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Lt(13),Hi.set.call(this,e,t,void 0)},Hi.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Lt(14),fd.set.call(this,e[0],t,n,e[0])};function pd(e,t){const n=e[Gt];return(n?Kr(n):e)[t]}function _C(e,t,n){const r=rv(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function rv(e,t){if(!(t in e))return;let n=jo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=jo(n)}}function hd(e){e.modified_||(e.modified_=!0,e.parent_&&hd(e.parent_))}function gd(e){e.copy_||(e.copy_=cd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var NC=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const a=this;return function(u=s,...d){return a.produce(u,f=>n.call(this,f,...d))}}typeof n!="function"&&Lt(6),r!==void 0&&typeof r!="function"&&Lt(7);let i;if(Xr(t)){const s=ev(this),a=md(t,void 0);let l=!0;try{i=n(a),l=!1}finally{l?ud(s):dd(s)}return Qy(s,r),tv(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Yy&&(i=void 0),this.autoFreeze_&&ld(i,!0),r){const s=[],a=[];Zr("Patches").generateReplacementPatches_(t,i,s,a),r(s,a)}return i}else Lt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...l)=>this.produceWithPatches(a,u=>t(u,...l));let r,i;return[this.produce(t,n,(a,l)=>{r=a,i=l}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xr(e)||Lt(8),$o(e)&&(e=IC(e));const t=ev(this),n=md(e,void 0);return n[Gt].isManual_=!0,dd(t),n}finishDraft(e,t){const n=e&&e[Gt];(!n||!n.isManual_)&&Lt(9);const{scope_:r}=n;return Qy(r,t),tv(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Zr("Patches").applyPatches_;return $o(e)?r(e,t):this.produce(e,i=>r(i,t))}};function md(e,t){const n=ji(e)?Zr("MapSet").proxyMap_(e,t):Va(e)?Zr("MapSet").proxySet_(e,t):SC(e,t);return(t?t.scope_:Jy()).drafts_.push(n),n}function IC(e){return $o(e)||Lt(10,e),ov(e)}function ov(e){if(!Xr(e)||za(e))return e;const t=e[Gt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cd(e,t.scope_.immer_.useStrictShallowCopy_)}else n=cd(e,!0);return Ha(n,(r,i)=>{Zy(n,r,ov(i))}),t&&(t.finalized_=!1),n}var EC=new NC,Bi=EC.produce;function rn(e){const t=[];for(let r=0;r<Math.floor(e/8);r++)t.push(Math.random().toString(36).substring(2,10));return e%8>0&&t.push(Math.random().toString(36).substring(2,e%8+2)),t.join("")}function yt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=yt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var TC={value:()=>{}};function Ga(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new qa(n)}function qa(e){this._=e}function CC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}qa.prototype=Ga.prototype={constructor:qa,on:function(e,t){var n=this._,r=CC(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=AC(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=iv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=iv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new qa(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function AC(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function iv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=TC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yd="http://www.w3.org/1999/xhtml";const sv={svg:"http://www.w3.org/2000/svg",xhtml:yd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ya(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),sv.hasOwnProperty(t)?{space:sv[t],local:e}:e}function kC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yd&&t.documentElement.namespaceURI===yd?t.createElement(e):t.createElementNS(n,e)}}function MC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function av(e){var t=Ya(e);return(t.local?MC:kC)(t)}function OC(){}function vd(e){return e==null?OC:function(){return this.querySelector(e)}}function PC(e){typeof e!="function"&&(e=vd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=new Array(a),u,d,f=0;f<a;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&("__data__"in u&&(d.__data__=u.__data__),l[f]=d);return new qt(r,this._parents)}function RC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function LC(){return[]}function cv(e){return e==null?LC:function(){return this.querySelectorAll(e)}}function DC(e){return function(){return RC(e.apply(this,arguments))}}function jC(e){typeof e=="function"?e=DC(e):e=cv(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,u,d=0;d<l;++d)(u=a[d])&&(r.push(e.call(u,u.__data__,d,a)),i.push(u));return new qt(r,i)}function lv(e){return function(){return this.matches(e)}}function uv(e){return function(t){return t.matches(e)}}var $C=Array.prototype.find;function HC(e){return function(){return $C.call(this.children,e)}}function BC(){return this.firstElementChild}function VC(e){return this.select(e==null?BC:HC(typeof e=="function"?e:uv(e)))}var FC=Array.prototype.filter;function zC(){return Array.from(this.children)}function UC(e){return function(){return FC.call(this.children,e)}}function WC(e){return this.selectAll(e==null?zC:UC(typeof e=="function"?e:uv(e)))}function GC(e){typeof e!="function"&&(e=lv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],u,d=0;d<a;++d)(u=s[d])&&e.call(u,u.__data__,d,s)&&l.push(u);return new qt(r,this._parents)}function dv(e){return new Array(e.length)}function qC(){return new qt(this._enter||this._groups.map(dv),this._parents)}function Xa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xa.prototype={constructor:Xa,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 YC(e){return function(){return e}}function XC(e,t,n,r,i,s){for(var a=0,l,u=t.length,d=s.length;a<d;++a)(l=t[a])?(l.__data__=s[a],r[a]=l):n[a]=new Xa(e,s[a]);for(;a<u;++a)(l=t[a])&&(i[a]=l)}function KC(e,t,n,r,i,s,a){var l,u,d=new Map,f=t.length,g=s.length,h=new Array(f),m;for(l=0;l<f;++l)(u=t[l])&&(h[l]=m=a.call(u,u.__data__,l,t)+"",d.has(m)?i[l]=u:d.set(m,u));for(l=0;l<g;++l)m=a.call(e,s[l],l,s)+"",(u=d.get(m))?(r[l]=u,u.__data__=s[l],d.delete(m)):n[l]=new Xa(e,s[l]);for(l=0;l<f;++l)(u=t[l])&&d.get(h[l])===u&&(i[l]=u)}function ZC(e){return e.__data__}function JC(e,t){if(!arguments.length)return Array.from(this,ZC);var n=t?KC:XC,r=this._parents,i=this._groups;typeof e!="function"&&(e=YC(e));for(var s=i.length,a=new Array(s),l=new Array(s),u=new Array(s),d=0;d<s;++d){var f=r[d],g=i[d],h=g.length,m=QC(e.call(f,f&&f.__data__,d,r)),x=m.length,v=l[d]=new Array(x),b=a[d]=new Array(x),S=u[d]=new Array(h);n(f,g,v,b,S,m,t);for(var N=0,w=0,I,k;N<x;++N)if(I=v[N]){for(N>=w&&(w=N+1);!(k=b[w])&&++w<x;);I._next=k||null}}return a=new qt(a,r),a._enter=l,a._exit=u,a}function QC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eA(){return new qt(this._exit||this._groups.map(dv),this._parents)}function tA(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function nA(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),u=0;u<a;++u)for(var d=n[u],f=r[u],g=d.length,h=l[u]=new Array(g),m,x=0;x<g;++x)(m=d[x]||f[x])&&(h[x]=m);for(;u<i;++u)l[u]=n[u];return new qt(l,this._parents)}function rA(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function oA(e){e||(e=iA);function t(g,h){return g&&h?e(g.__data__,h.__data__):!g-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,u=i[s]=new Array(l),d,f=0;f<l;++f)(d=a[f])&&(u[f]=d);u.sort(t)}return new qt(i,this._parents).order()}function iA(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sA(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function aA(){return Array.from(this)}function cA(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function lA(){let e=0;for(const t of this)++e;return e}function uA(){return!this.node()}function dA(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function fA(e){return function(){this.removeAttribute(e)}}function pA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hA(e,t){return function(){this.setAttribute(e,t)}}function gA(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yA(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 vA(e,t){var n=Ya(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?pA:fA:typeof t=="function"?n.local?yA:mA:n.local?gA:hA)(n,t))}function fv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xA(e){return function(){this.style.removeProperty(e)}}function wA(e,t,n){return function(){this.style.setProperty(e,t,n)}}function bA(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function SA(e,t,n){return arguments.length>1?this.each((t==null?xA:typeof t=="function"?bA:wA)(e,t,n??"")):Ho(this.node(),e)}function Ho(e,t){return e.style.getPropertyValue(t)||fv(e).getComputedStyle(e,null).getPropertyValue(t)}function _A(e){return function(){delete this[e]}}function NA(e,t){return function(){this[e]=t}}function IA(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function EA(e,t){return arguments.length>1?this.each((t==null?_A:typeof t=="function"?IA:NA)(e,t)):this.node()[e]}function pv(e){return e.trim().split(/^|\s+/)}function xd(e){return e.classList||new hv(e)}function hv(e){this._node=e,this._names=pv(e.getAttribute("class")||"")}hv.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 gv(e,t){for(var n=xd(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function mv(e,t){for(var n=xd(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function TA(e){return function(){gv(this,e)}}function CA(e){return function(){mv(this,e)}}function AA(e,t){return function(){(t.apply(this,arguments)?gv:mv)(this,e)}}function kA(e,t){var n=pv(e+"");if(arguments.length<2){for(var r=xd(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?AA:t?TA:CA)(n,t))}function MA(){this.textContent=""}function OA(e){return function(){this.textContent=e}}function PA(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function RA(e){return arguments.length?this.each(e==null?MA:(typeof e=="function"?PA:OA)(e)):this.node().textContent}function LA(){this.innerHTML=""}function DA(e){return function(){this.innerHTML=e}}function jA(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $A(e){return arguments.length?this.each(e==null?LA:(typeof e=="function"?jA:DA)(e)):this.node().innerHTML}function HA(){this.nextSibling&&this.parentNode.appendChild(this)}function BA(){return this.each(HA)}function VA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function FA(){return this.each(VA)}function zA(e){var t=typeof e=="function"?e:av(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function UA(){return null}function WA(e,t){var n=typeof e=="function"?e:av(e),r=t==null?UA:typeof t=="function"?t:vd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function GA(){var e=this.parentNode;e&&e.removeChild(this)}function qA(){return this.each(GA)}function YA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function XA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KA(e){return this.select(e?XA:YA)}function ZA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function JA(e){return function(t){e.call(this,t,this.__data__)}}function QA(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ek(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function tk(e,t,n){return function(){var r=this.__on,i,s=JA(t);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function nk(e,t,n){var r=QA(e+""),i,s=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,d=l.length,f;u<d;++u)for(i=0,f=l[u];i<s;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(l=t?tk:ek,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function yv(e,t,n){var r=fv(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function rk(e,t){return function(){return yv(this,e,t)}}function ok(e,t){return function(){return yv(this,e,t.apply(this,arguments))}}function ik(e,t){return this.each((typeof t=="function"?ok:rk)(e,t))}function*sk(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var vv=[null];function qt(e,t){this._groups=e,this._parents=t}function Vi(){return new qt([[document.documentElement]],vv)}function ak(){return this}qt.prototype=Vi.prototype={constructor:qt,select:PC,selectAll:jC,selectChild:VC,selectChildren:WC,filter:GC,data:JC,enter:qC,exit:eA,join:tA,merge:nA,selection:ak,order:rA,sort:oA,call:sA,nodes:aA,node:cA,size:lA,empty:uA,each:dA,attr:vA,style:SA,property:EA,classed:kA,text:RA,html:$A,raise:BA,lower:FA,append:zA,insert:WA,remove:qA,clone:KA,datum:ZA,on:nk,dispatch:ik,[Symbol.iterator]:sk};function Yt(e){return typeof e=="string"?new qt([[document.querySelector(e)]],[document.documentElement]):new qt([[e]],vv)}function ck(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bn(e,t){if(e=ck(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const lk={passive:!1},Fi={capture:!0,passive:!1};function wd(e){e.stopImmediatePropagation()}function Bo(e){e.preventDefault(),e.stopImmediatePropagation()}function xv(e){var t=e.document.documentElement,n=Yt(e).on("dragstart.drag",Bo,Fi);"onselectstart"in t?n.on("selectstart.drag",Bo,Fi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function wv(e,t){var n=e.document.documentElement,r=Yt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Bo,Fi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ka=e=>()=>e;function bd(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:l,dx:u,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:f}})}bd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uk(e){return!e.ctrlKey&&!e.button}function dk(){return this.parentNode}function fk(e,t){return t??{x:e.x,y:e.y}}function pk(){return navigator.maxTouchPoints||"ontouchstart"in this}function bv(){var e=uk,t=dk,n=fk,r=pk,i={},s=Ga("start","drag","end"),a=0,l,u,d,f,g=0;function h(I){I.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",S,lk).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(I,k){if(!(f||!e.call(this,I,k))){var A=w(this,t.call(this,I,k),I,k,"mouse");A&&(Yt(I.view).on("mousemove.drag",x,Fi).on("mouseup.drag",v,Fi),xv(I.view),wd(I),d=!1,l=I.clientX,u=I.clientY,A("start",I))}}function x(I){if(Bo(I),!d){var k=I.clientX-l,A=I.clientY-u;d=k*k+A*A>g}i.mouse("drag",I)}function v(I){Yt(I.view).on("mousemove.drag mouseup.drag",null),wv(I.view,d),Bo(I),i.mouse("end",I)}function b(I,k){if(e.call(this,I,k)){var A=I.changedTouches,M=t.call(this,I,k),B=A.length,U,q;for(U=0;U<B;++U)(q=w(this,M,I,k,A[U].identifier,A[U]))&&(wd(I),q("start",I,A[U]))}}function S(I){var k=I.changedTouches,A=k.length,M,B;for(M=0;M<A;++M)(B=i[k[M].identifier])&&(Bo(I),B("drag",I,k[M]))}function N(I){var k=I.changedTouches,A=k.length,M,B;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),M=0;M<A;++M)(B=i[k[M].identifier])&&(wd(I),B("end",I,k[M]))}function w(I,k,A,M,B,U){var q=s.copy(),D=bn(U||A,k),$,F,E;if((E=n.call(I,new bd("beforestart",{sourceEvent:A,target:h,identifier:B,active:a,x:D[0],y:D[1],dx:0,dy:0,dispatch:q}),M))!=null)return $=E.x-D[0]||0,F=E.y-D[1]||0,function P(L,j,O){var W=D,z;switch(L){case"start":i[B]=P,z=a++;break;case"end":delete i[B],--a;case"drag":D=bn(O||j,k),z=a;break}q.call(L,I,new bd(L,{sourceEvent:j,subject:E,target:h,identifier:B,active:z,x:D[0]+$,y:D[1]+F,dx:D[0]-W[0],dy:D[1]-W[1],dispatch:q}),M)}}return h.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Ka(!!I),h):e},h.container=function(I){return arguments.length?(t=typeof I=="function"?I:Ka(I),h):t},h.subject=function(I){return arguments.length?(n=typeof I=="function"?I:Ka(I),h):n},h.touchable=function(I){return arguments.length?(r=typeof I=="function"?I:Ka(!!I),h):r},h.on=function(){var I=s.on.apply(s,arguments);return I===s?h:I},h.clickDistance=function(I){return arguments.length?(g=(I=+I)*I,h):Math.sqrt(g)},h}function Sd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zi(){}var Ui=.7,Za=1/Ui,Vo="\\s*([+-]?\\d+)\\s*",Wi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hk=/^#([0-9a-f]{3,8})$/,gk=new RegExp(`^rgb\\(${Vo},${Vo},${Vo}\\)$`),mk=new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`),yk=new RegExp(`^rgba\\(${Vo},${Vo},${Vo},${Wi}\\)$`),vk=new RegExp(`^rgba\\(${jn},${jn},${jn},${Wi}\\)$`),xk=new RegExp(`^hsl\\(${Wi},${jn},${jn}\\)$`),wk=new RegExp(`^hsla\\(${Wi},${jn},${jn},${Wi}\\)$`),_v={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};Sd(zi,Jr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nv,formatHex:Nv,formatHex8:bk,formatHsl:Sk,formatRgb:Iv,toString:Iv});function Nv(){return this.rgb().formatHex()}function bk(){return this.rgb().formatHex8()}function Sk(){return kv(this).formatHsl()}function Iv(){return this.rgb().formatRgb()}function Jr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hk.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ev(t):n===3?new Dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ja(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ja(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=gk.exec(e))?new Dt(t[1],t[2],t[3],1):(t=mk.exec(e))?new Dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yk.exec(e))?Ja(t[1],t[2],t[3],t[4]):(t=vk.exec(e))?Ja(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xk.exec(e))?Av(t[1],t[2]/100,t[3]/100,1):(t=wk.exec(e))?Av(t[1],t[2]/100,t[3]/100,t[4]):_v.hasOwnProperty(e)?Ev(_v[e]):e==="transparent"?new Dt(NaN,NaN,NaN,0):null}function Ev(e){return new Dt(e>>16&255,e>>8&255,e&255,1)}function Ja(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dt(e,t,n,r)}function _k(e){return e instanceof zi||(e=Jr(e)),e?(e=e.rgb(),new Dt(e.r,e.g,e.b,e.opacity)):new Dt}function _d(e,t,n,r){return arguments.length===1?_k(e):new Dt(e,t,n,r??1)}function Dt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Sd(Dt,_d,Sv(zi,{brighter(e){return e=e==null?Za:Math.pow(Za,e),new Dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new Dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dt(Qr(this.r),Qr(this.g),Qr(this.b),Qa(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:Tv,formatHex:Tv,formatHex8:Nk,formatRgb:Cv,toString:Cv}));function Tv(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}`}function Nk(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}${eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cv(){const e=Qa(this.opacity);return`${e===1?"rgb(":"rgba("}${Qr(this.r)}, ${Qr(this.g)}, ${Qr(this.b)}${e===1?")":`, ${e})`}`}function Qa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eo(e){return e=Qr(e),(e<16?"0":"")+e.toString(16)}function Av(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Sn(e,t,n,r)}function kv(e){if(e instanceof Sn)return new Sn(e.h,e.s,e.l,e.opacity);if(e instanceof zi||(e=Jr(e)),!e)return new Sn;if(e instanceof Sn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,l=s-i,u=(s+i)/2;return l?(t===s?a=(n-r)/l+(n<r)*6:n===s?a=(r-t)/l+2:a=(t-n)/l+4,l/=u<.5?s+i:2-s-i,a*=60):l=u>0&&u<1?0:a,new Sn(a,l,u,e.opacity)}function Ik(e,t,n,r){return arguments.length===1?kv(e):new Sn(e,t,n,r??1)}function Sn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Sd(Sn,Ik,Sv(zi,{brighter(e){return e=e==null?Za:Math.pow(Za,e),new Sn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new Sn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Dt(Nd(e>=240?e-240:e+120,i,r),Nd(e,i,r),Nd(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Sn(Mv(this.h),ec(this.s),ec(this.l),Qa(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=Qa(this.opacity);return`${e===1?"hsl(":"hsla("}${Mv(this.h)}, ${ec(this.s)*100}%, ${ec(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Mv(e){return e=(e||0)%360,e<0?e+360:e}function ec(e){return Math.max(0,Math.min(1,e||0))}function Nd(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 Id=e=>()=>e;function Ek(e,t){return function(n){return e+n*t}}function Tk(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ck(e){return(e=+e)==1?Ov:function(t,n){return n-t?Tk(t,n,e):Id(isNaN(t)?n:t)}}function Ov(e,t){var n=t-e;return n?Ek(e,n):Id(isNaN(e)?t:e)}const tc=function e(t){var n=Ck(t);function r(i,s){var a=n((i=_d(i)).r,(s=_d(s)).r),l=n(i.g,s.g),u=n(i.b,s.b),d=Ov(i.opacity,s.opacity);return function(f){return i.r=a(f),i.g=l(f),i.b=u(f),i.opacity=d(f),i+""}}return r.gamma=e,r}(1);function Ak(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function kk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mk(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Gi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(l){for(a=0;a<r;++a)s[a]=i[a](l);return s}}function Ok(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function $n(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pk(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Gi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Ed=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Td=new RegExp(Ed.source,"g");function Rk(e){return function(){return e}}function Lk(e){return function(t){return e(t)+""}}function Pv(e,t){var n=Ed.lastIndex=Td.lastIndex=0,r,i,s,a=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Ed.exec(e))&&(i=Td.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(r=r[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,u.push({i:a,x:$n(r,i)})),n=Td.lastIndex;return n<t.length&&(s=t.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?u[0]?Lk(u[0].x):Rk(t):(t=u.length,function(d){for(var f=0,g;f<t;++f)l[(g=u[f]).i]=g.x(d);return l.join("")})}function Gi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Id(t):(n==="number"?$n:n==="string"?(r=Jr(t))?(t=r,tc):Pv:t instanceof Jr?tc:t instanceof Date?Ok:kk(t)?Ak:Array.isArray(t)?Mk:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Pk:$n)(e,t)}var Rv=180/Math.PI,Cd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lv(e,t,n,r,i,s){var a,l,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Rv,skewX:Math.atan(u)*Rv,scaleX:a,scaleY:l}}var nc;function Dk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cd:Lv(t.a,t.b,t.c,t.d,t.e,t.f)}function jk(e){return e==null||(nc||(nc=document.createElementNS("http://www.w3.org/2000/svg","g")),nc.setAttribute("transform",e),!(e=nc.transform.baseVal.consolidate()))?Cd:(e=e.matrix,Lv(e.a,e.b,e.c,e.d,e.e,e.f))}function Dv(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function s(d,f,g,h,m,x){if(d!==g||f!==h){var v=m.push("translate(",null,t,null,n);x.push({i:v-4,x:$n(d,g)},{i:v-2,x:$n(f,h)})}else(g||h)&&m.push("translate("+g+t+h+n)}function a(d,f,g,h){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),h.push({i:g.push(i(g)+"rotate(",null,r)-2,x:$n(d,f)})):f&&g.push(i(g)+"rotate("+f+r)}function l(d,f,g,h){d!==f?h.push({i:g.push(i(g)+"skewX(",null,r)-2,x:$n(d,f)}):f&&g.push(i(g)+"skewX("+f+r)}function u(d,f,g,h,m,x){if(d!==g||f!==h){var v=m.push(i(m)+"scale(",null,",",null,")");x.push({i:v-4,x:$n(d,g)},{i:v-2,x:$n(f,h)})}else(g!==1||h!==1)&&m.push(i(m)+"scale("+g+","+h+")")}return function(d,f){var g=[],h=[];return d=e(d),f=e(f),s(d.translateX,d.translateY,f.translateX,f.translateY,g,h),a(d.rotate,f.rotate,g,h),l(d.skewX,f.skewX,g,h),u(d.scaleX,d.scaleY,f.scaleX,f.scaleY,g,h),d=f=null,function(m){for(var x=-1,v=h.length,b;++x<v;)g[(b=h[x]).i]=b.x(m);return g.join("")}}}var $k=Dv(Dk,"px, ","px)","deg)"),Hk=Dv(jk,", ",")",")"),Bk=1e-12;function jv(e){return((e=Math.exp(e))+1/e)/2}function Vk(e){return((e=Math.exp(e))-1/e)/2}function Fk(e){return((e=Math.exp(2*e))-1)/(e+1)}const rc=function e(t,n,r){function i(s,a){var l=s[0],u=s[1],d=s[2],f=a[0],g=a[1],h=a[2],m=f-l,x=g-u,v=m*m+x*x,b,S;if(v<Bk)S=Math.log(h/d)/t,b=function(M){return[l+M*m,u+M*x,d*Math.exp(t*M*S)]};else{var N=Math.sqrt(v),w=(h*h-d*d+r*v)/(2*d*n*N),I=(h*h-d*d-r*v)/(2*h*n*N),k=Math.log(Math.sqrt(w*w+1)-w),A=Math.log(Math.sqrt(I*I+1)-I);S=(A-k)/t,b=function(M){var B=M*S,U=jv(k),q=d/(n*N)*(U*Fk(t*B+k)-Vk(k));return[l+q*m,u+q*x,d*U/jv(t*B+k)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,u=l*l;return e(a,l,u)},i}(Math.SQRT2,2,4);var Fo=0,qi=0,Yi=0,$v=1e3,oc,Xi,ic=0,to=0,sc=0,Ki=typeof performance=="object"&&performance.now?performance:Date,Hv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ad(){return to||(Hv(zk),to=Ki.now()+sc)}function zk(){to=0}function ac(){this._call=this._time=this._next=null}ac.prototype=Bv.prototype={constructor:ac,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ad():+n)+(t==null?0:+t),!this._next&&Xi!==this&&(Xi?Xi._next=this:oc=this,Xi=this),this._call=e,this._time=n,kd()},stop:function(){this._call&&(this._call=null,this._time=1/0,kd())}};function Bv(e,t,n){var r=new ac;return r.restart(e,t,n),r}function Uk(){Ad(),++Fo;for(var e=oc,t;e;)(t=to-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Fo}function Vv(){to=(ic=Ki.now())+sc,Fo=qi=0;try{Uk()}finally{Fo=0,Gk(),to=0}}function Wk(){var e=Ki.now(),t=e-ic;t>$v&&(sc-=t,ic=e)}function Gk(){for(var e,t=oc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:oc=n);Xi=e,kd(r)}function kd(e){if(!Fo){qi&&(qi=clearTimeout(qi));var t=e-to;t>24?(e<1/0&&(qi=setTimeout(Vv,e-Ki.now()-sc)),Yi&&(Yi=clearInterval(Yi))):(Yi||(ic=Ki.now(),Yi=setInterval(Wk,$v)),Fo=1,Hv(Vv))}}function Fv(e,t,n){var r=new ac;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var qk=Ga("start","end","cancel","interrupt"),Yk=[],zv=0,Uv=1,Md=2,cc=3,Wv=4,Od=5,lc=6;function uc(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Xk(e,n,{name:t,index:r,group:i,on:qk,tween:Yk,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:zv})}function Pd(e,t){var n=_n(e,t);if(n.state>zv)throw new Error("too late; already scheduled");return n}function Hn(e,t){var n=_n(e,t);if(n.state>cc)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Xk(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bv(s,0,n.time);function s(d){n.state=Uv,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var f,g,h,m;if(n.state!==Uv)return u();for(f in r)if(m=r[f],m.name===n.name){if(m.state===cc)return Fv(a);m.state===Wv?(m.state=lc,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=lc,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(Fv(function(){n.state===cc&&(n.state=Wv,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=Md,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Md){for(n.state=cc,i=new Array(h=n.tween.length),f=0,g=-1;f<h;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++g]=m);i.length=g+1}}function l(d){for(var f=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=Od,1),g=-1,h=i.length;++g<h;)i[g].call(e,f);n.state===Od&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=lc,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function dc(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Md&&r.state<Od,r.state=lc,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function Kk(e){return this.each(function(){dc(this,e)})}function Zk(e,t){var n,r;return function(){var i=Hn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Jk(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Hn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},u=0,d=i.length;u<d;++u)if(i[u].name===t){i[u]=l;break}u===d&&i.push(l)}s.tween=i}}function Qk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=_n(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Zk:Jk)(n,e,t))}function Rd(e,t,n){var r=e._id;return e.each(function(){var i=Hn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _n(i,r).value[t]}}function Gv(e,t){var n;return(typeof t=="number"?$n:t instanceof Jr?tc:(n=Jr(t))?(t=n,tc):Pv)(e,t)}function eM(e){return function(){this.removeAttribute(e)}}function tM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nM(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function rM(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function oM(e,t,n){var r,i,s;return function(){var a,l=n(this),u;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=l+"",a===u?null:a===r&&u===i?s:(i=u,s=t(r=a,l)))}}function iM(e,t,n){var r,i,s;return function(){var a,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=l+"",a===u?null:a===r&&u===i?s:(i=u,s=t(r=a,l)))}}function sM(e,t){var n=Ya(e),r=n==="transform"?Hk:Gv;return this.attrTween(e,typeof t=="function"?(n.local?iM:oM)(n,r,Rd(this,"attr."+e,t)):t==null?(n.local?tM:eM)(n):(n.local?rM:nM)(n,r,t))}function aM(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function cM(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lM(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&cM(e,s)),n}return i._value=t,i}function uM(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&aM(e,s)),n}return i._value=t,i}function dM(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ya(e);return this.tween(n,(r.local?lM:uM)(r,t))}function fM(e,t){return function(){Pd(this,e).delay=+t.apply(this,arguments)}}function pM(e,t){return t=+t,function(){Pd(this,e).delay=t}}function hM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fM:pM)(t,e)):_n(this.node(),t).delay}function gM(e,t){return function(){Hn(this,e).duration=+t.apply(this,arguments)}}function mM(e,t){return t=+t,function(){Hn(this,e).duration=t}}function yM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gM:mM)(t,e)):_n(this.node(),t).duration}function vM(e,t){if(typeof t!="function")throw new Error;return function(){Hn(this,e).ease=t}}function xM(e){var t=this._id;return arguments.length?this.each(vM(t,e)):_n(this.node(),t).ease}function wM(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Hn(this,e).ease=n}}function bM(e){if(typeof e!="function")throw new Error;return this.each(wM(this._id,e))}function SM(e){typeof e!="function"&&(e=lv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],u,d=0;d<a;++d)(u=s[d])&&e.call(u,u.__data__,d,s)&&l.push(u);return new er(r,this._parents,this._name,this._id)}function _M(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var u=t[l],d=n[l],f=u.length,g=a[l]=new Array(f),h,m=0;m<f;++m)(h=u[m]||d[m])&&(g[m]=h);for(;l<r;++l)a[l]=t[l];return new er(a,this._parents,this._name,this._id)}function NM(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 IM(e,t,n){var r,i,s=NM(t)?Pd:Hn;return function(){var a=s(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}function EM(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(IM(n,e,t))}function TM(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CM(){return this.on("end.remove",TM(this._id))}function AM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vd(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],u=l.length,d=s[a]=new Array(u),f,g,h=0;h<u;++h)(f=l[h])&&(g=e.call(f,f.__data__,h,l))&&("__data__"in f&&(g.__data__=f.__data__),d[h]=g,uc(d[h],t,n,h,d,_n(f,n)));return new er(s,this._parents,t,n)}function kM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cv(e));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var u=r[l],d=u.length,f,g=0;g<d;++g)if(f=u[g]){for(var h=e.call(f,f.__data__,g,u),m,x=_n(f,n),v=0,b=h.length;v<b;++v)(m=h[v])&&uc(m,t,n,v,h,x);s.push(h),a.push(f)}return new er(s,a,t,n)}var MM=Vi.prototype.constructor;function OM(){return new MM(this._groups,this._parents)}function PM(e,t){var n,r,i;return function(){var s=Ho(this,e),a=(this.style.removeProperty(e),Ho(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function qv(e){return function(){this.style.removeProperty(e)}}function RM(e,t,n){var r,i=n+"",s;return function(){var a=Ho(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function LM(e,t,n){var r,i,s;return function(){var a=Ho(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Ho(this,e))),a===u?null:a===r&&u===i?s:(i=u,s=t(r=a,l))}}function DM(e,t){var n,r,i,s="style."+t,a="end."+s,l;return function(){var u=Hn(this,e),d=u.on,f=u.value[s]==null?l||(l=qv(t)):void 0;(d!==n||i!==f)&&(r=(n=d).copy()).on(a,i=f),u.on=r}}function jM(e,t,n){var r=(e+="")=="transform"?$k:Gv;return t==null?this.styleTween(e,PM(e,r)).on("end.style."+e,qv(e)):typeof t=="function"?this.styleTween(e,LM(e,r,Rd(this,"style."+e,t))).each(DM(this._id,e)):this.styleTween(e,RM(e,r,t),n).on("end.style."+e,null)}function $M(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function HM(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&$M(e,a,n)),r}return s._value=t,s}function BM(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,HM(e,t,n??""))}function VM(e){return function(){this.textContent=e}}function FM(e){return function(){var t=e(this);this.textContent=t??""}}function zM(e){return this.tween("text",typeof e=="function"?FM(Rd(this,"text",e)):VM(e==null?"":e+""))}function UM(e){return function(t){this.textContent=e.call(this,t)}}function WM(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&UM(i)),t}return r._value=e,r}function GM(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,WM(e))}function qM(){for(var e=this._name,t=this._id,n=Yv(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,u,d=0;d<l;++d)if(u=a[d]){var f=_n(u,t);uc(u,e,n,d,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new er(r,this._parents,e,n)}function YM(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},u={value:function(){--i===0&&s()}};n.each(function(){var d=Hn(this,r),f=d.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),d.on=t}),i===0&&s()})}var XM=0;function er(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Yv(){return++XM}var tr=Vi.prototype;er.prototype={constructor:er,select:AM,selectAll:kM,selectChild:tr.selectChild,selectChildren:tr.selectChildren,filter:SM,merge:_M,selection:OM,transition:qM,call:tr.call,nodes:tr.nodes,node:tr.node,size:tr.size,empty:tr.empty,each:tr.each,on:EM,attr:sM,attrTween:dM,style:jM,styleTween:BM,text:zM,textTween:GM,remove:CM,tween:Qk,delay:hM,duration:yM,ease:xM,easeVarying:bM,end:YM,[Symbol.iterator]:tr[Symbol.iterator]};function KM(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ZM={time:null,delay:0,duration:250,ease:KM};function JM(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 QM(e){var t,n;e instanceof er?(t=e._id,e=e._name):(t=Yv(),(n=ZM).time=Ad(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,u,d=0;d<l;++d)(u=a[d])&&uc(u,e,t,d,a,n||JM(u,t));return new er(r,this._parents,e,t)}Vi.prototype.interrupt=Kk,Vi.prototype.transition=QM;const fc=e=>()=>e;function eO(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function nr(e,t,n){this.k=e,this.x=t,this.y=n}nr.prototype={constructor:nr,scale:function(e){return e===1?this:new nr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nr(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 pc=new nr(1,0,0);Xv.prototype=nr.prototype;function Xv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return pc;return e.__zoom}function Ld(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function tO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nO(){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 Kv(){return this.__zoom||pc}function rO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function oO(){return navigator.maxTouchPoints||"ontouchstart"in this}function iO(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function Zv(){var e=tO,t=nO,n=iO,r=rO,i=oO,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=rc,d=Ga("start","zoom","end"),f,g,h,m=500,x=150,v=0,b=10;function S(E){E.property("__zoom",Kv).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(E,P,L,j){var O=E.selection?E.selection():E;O.property("__zoom",Kv),E!==O?k(E,P,L,j):O.interrupt().each(function(){A(this,arguments).event(j).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},S.scaleBy=function(E,P,L,j){S.scaleTo(E,function(){var O=this.__zoom.k,W=typeof P=="function"?P.apply(this,arguments):P;return O*W},L,j)},S.scaleTo=function(E,P,L,j){S.transform(E,function(){var O=t.apply(this,arguments),W=this.__zoom,z=L==null?I(O):typeof L=="function"?L.apply(this,arguments):L,Y=W.invert(z),J=typeof P=="function"?P.apply(this,arguments):P;return n(w(N(W,J),z,Y),O,a)},L,j)},S.translateBy=function(E,P,L,j){S.transform(E,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),a)},null,j)},S.translateTo=function(E,P,L,j,O){S.transform(E,function(){var W=t.apply(this,arguments),z=this.__zoom,Y=j==null?I(W):typeof j=="function"?j.apply(this,arguments):j;return n(pc.translate(Y[0],Y[1]).scale(z.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof L=="function"?-L.apply(this,arguments):-L),W,a)},j,O)};function N(E,P){return P=Math.max(s[0],Math.min(s[1],P)),P===E.k?E:new nr(P,E.x,E.y)}function w(E,P,L){var j=P[0]-L[0]*E.k,O=P[1]-L[1]*E.k;return j===E.x&&O===E.y?E:new nr(E.k,j,O)}function I(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,P,L,j){E.on("start.zoom",function(){A(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(j).end()}).tween("zoom",function(){var O=this,W=arguments,z=A(O,W).event(j),Y=t.apply(O,W),J=L==null?I(Y):typeof L=="function"?L.apply(O,W):L,ie=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ee=O.__zoom,ce=typeof P=="function"?P.apply(O,W):P,ge=u(ee.invert(J).concat(ie/ee.k),ce.invert(J).concat(ie/ce.k));return function(Q){if(Q===1)Q=ce;else{var te=ge(Q),ne=ie/te[2];Q=new nr(ne,J[0]-te[0]*ne,J[1]-te[1]*ne)}z.zoom(null,Q)}})}function A(E,P,L){return!L&&E.__zooming||new M(E,P)}function M(E,P){this.that=E,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,P),this.taps=0}M.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,P){return this.mouse&&E!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var P=Yt(this.that).datum();d.call(E,this.that,new eO(E,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:d}),P)}};function B(E,...P){if(!e.apply(this,arguments))return;var L=A(this,P).event(E),j=this.__zoom,O=Math.max(s[0],Math.min(s[1],j.k*Math.pow(2,r.apply(this,arguments)))),W=bn(E);if(L.wheel)(L.mouse[0][0]!==W[0]||L.mouse[0][1]!==W[1])&&(L.mouse[1]=j.invert(L.mouse[0]=W)),clearTimeout(L.wheel);else{if(j.k===O)return;L.mouse=[W,j.invert(W)],dc(this),L.start()}Zi(E),L.wheel=setTimeout(z,x),L.zoom("mouse",n(w(N(j,O),L.mouse[0],L.mouse[1]),L.extent,a));function z(){L.wheel=null,L.end()}}function U(E,...P){if(h||!e.apply(this,arguments))return;var L=E.currentTarget,j=A(this,P,!0).event(E),O=Yt(E.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",ie,!0),W=bn(E,L),z=E.clientX,Y=E.clientY;xv(E.view),Ld(E),j.mouse=[W,this.__zoom.invert(W)],dc(this),j.start();function J(ee){if(Zi(ee),!j.moved){var ce=ee.clientX-z,ge=ee.clientY-Y;j.moved=ce*ce+ge*ge>v}j.event(ee).zoom("mouse",n(w(j.that.__zoom,j.mouse[0]=bn(ee,L),j.mouse[1]),j.extent,a))}function ie(ee){O.on("mousemove.zoom mouseup.zoom",null),wv(ee.view,j.moved),Zi(ee),j.event(ee).end()}}function q(E,...P){if(e.apply(this,arguments)){var L=this.__zoom,j=bn(E.changedTouches?E.changedTouches[0]:E,this),O=L.invert(j),W=L.k*(E.shiftKey?.5:2),z=n(w(N(L,W),j,O),t.apply(this,P),a);Zi(E),l>0?Yt(this).transition().duration(l).call(k,z,j,E):Yt(this).call(S.transform,z,j,E)}}function D(E,...P){if(e.apply(this,arguments)){var L=E.touches,j=L.length,O=A(this,P,E.changedTouches.length===j).event(E),W,z,Y,J;for(Ld(E),z=0;z<j;++z)Y=L[z],J=bn(Y,this),J=[J,this.__zoom.invert(J),Y.identifier],O.touch0?!O.touch1&&O.touch0[2]!==J[2]&&(O.touch1=J,O.taps=0):(O.touch0=J,W=!0,O.taps=1+!!f);f&&(f=clearTimeout(f)),W&&(O.taps<2&&(g=J[0],f=setTimeout(function(){f=null},m)),dc(this),O.start())}}function $(E,...P){if(this.__zooming){var L=A(this,P).event(E),j=E.changedTouches,O=j.length,W,z,Y,J;for(Zi(E),W=0;W<O;++W)z=j[W],Y=bn(z,this),L.touch0&&L.touch0[2]===z.identifier?L.touch0[0]=Y:L.touch1&&L.touch1[2]===z.identifier&&(L.touch1[0]=Y);if(z=L.that.__zoom,L.touch1){var ie=L.touch0[0],ee=L.touch0[1],ce=L.touch1[0],ge=L.touch1[1],Q=(Q=ce[0]-ie[0])*Q+(Q=ce[1]-ie[1])*Q,te=(te=ge[0]-ee[0])*te+(te=ge[1]-ee[1])*te;z=N(z,Math.sqrt(Q/te)),Y=[(ie[0]+ce[0])/2,(ie[1]+ce[1])/2],J=[(ee[0]+ge[0])/2,(ee[1]+ge[1])/2]}else if(L.touch0)Y=L.touch0[0],J=L.touch0[1];else return;L.zoom("touch",n(w(z,Y,J),L.extent,a))}}function F(E,...P){if(this.__zooming){var L=A(this,P).event(E),j=E.changedTouches,O=j.length,W,z;for(Ld(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),W=0;W<O;++W)z=j[W],L.touch0&&L.touch0[2]===z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(z=bn(z,this),Math.hypot(g[0]-z[0],g[1]-z[1])<b)){var Y=Yt(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return S.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:fc(+E),S):r},S.filter=function(E){return arguments.length?(e=typeof E=="function"?E:fc(!!E),S):e},S.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:fc(!!E),S):i},S.extent=function(E){return arguments.length?(t=typeof E=="function"?E:fc([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),S):t},S.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],S):[s[0],s[1]]},S.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(E){return arguments.length?(n=E,S):n},S.duration=function(E){return arguments.length?(l=+E,S):l},S.interpolate=function(E){return arguments.length?(u=E,S):u},S.on=function(){var E=d.on.apply(d,arguments);return E===d?S:E},S.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,S):Math.sqrt(v)},S.tapDistance=function(E){return arguments.length?(b=+E,S):b},S}const jt={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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ji=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Jv=["Enter"," ","Escape"],Qv={"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 zo;(function(e){e.Strict="strict",e.Loose="loose"})(zo||(zo={}));var no;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(no||(no={}));var Uo;(function(e){e.Partial="partial",e.Full="full"})(Uo||(Uo={}));const ex={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var _r;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_r||(_r={}));var hc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(hc||(hc={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const tx={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function sO(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 nx(e,t,n){if(!n)return;const r=[];e.forEach((i,s)=>{t?.has(s)||r.push(i)}),r.length&&n(r)}function rx(e){return e===null?null:e?"valid":"invalid"}const ox=e=>"id"in e&&"source"in e&&"target"in e,aO=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Dd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Qi=(e,t,n)=>{if(!e.id)return[];const r=new Set;return n.forEach(i=>{i.source===e.id&&r.add(i.target)}),t.filter(i=>r.has(i.id))},gc=(e,t,n)=>{if(!e.id)return[];const r=new Set;return n.forEach(i=>{i.target===e.id&&r.add(i.source)}),t.filter(i=>r.has(i.id))},es=(e,t=[0,0])=>{const{width:n,height:r}=rr(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},cO=(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((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):Dd(i)?i:t.nodeLookup.get(i.id));const l=a?vc(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return mc(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yc(n)},ts=(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(r=>{if(t.filter===void 0||t.filter(r)){const i=vc(r);n=mc(n,i)}}),yc(n)},jd=(e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const l={...os(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const d of e.values()){const{measured:f,selectable:g=!0,hidden:h=!1}=d;if(a&&!g||h)continue;const m=f.width??d.width??d.initialWidth??null,x=f.height??d.height??d.initialHeight??null,v=ns(l,Go(d)),b=(m??0)*(x??0),S=s&&v>0;(!d.internals.handleBounds||S||v>=b||d.dragging)&&u.push(d)}return u},$d=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lO(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&(t?.includeHiddenNodes||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function uO({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return Promise.resolve(!0);const l=lO(e,a),u=ts(l),d=Bd(u,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(d,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}function ix({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:u,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},f=a.origin??r;let g=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",jt.error005());else{const m=l.measured.width,x=l.measured.height;m&&x&&(g=[[u,d],[u+m,d+x]])}else l&&Yo(a.extent)&&(g=[[a.extent[0][0]+u,a.extent[0][1]+d],[a.extent[1][0]+u,a.extent[1][1]+d]]);const h=Yo(g)?ro(t,g,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",jt.error015()),{position:{x:h.x-u+(a.measured.width??0)*f[0],y:h.y-d+(a.measured.height??0)*f[1]},positionAbsolute:h}}async function dO({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),x=!m&&h.parentId&&a.find(v=>v.id===h.parentId);(m||x)&&a.push(h)}const l=new Set(t.map(h=>h.id)),u=r.filter(h=>h.deletable!==!1),f=$d(a,u);for(const h of u)l.has(h.id)&&!f.find(x=>x.id===h.id)&&f.push(h);if(!i)return{edges:f,nodes:a};const g=await i({nodes:a,edges:f});return typeof g=="boolean"?g?{edges:f,nodes:a}:{edges:[],nodes:[]}:g}const Wo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ro=(e={x:0,y:0},t,n)=>({x:Wo(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Wo(e.y,t[0][1],t[1][1]-(n?.height??0))});function sx(e,t,n){const{width:r,height:i}=rr(n),{x:s,y:a}=n.internals.positionAbsolute;return ro(e,[[s,a],[s+r,a+i]],t)}const ax=(e,t,n)=>e<t?Wo(Math.abs(e-t),1,t)/t:e>n?-Wo(Math.abs(e-n),1,t)/t:0,cx=(e,t,n=15,r=40)=>{const i=ax(e.x,r,t.width-r)*n,s=ax(e.y,r,t.height-r)*n;return[i,s]},mc=(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)}),Hd=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),yc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Go=(e,t=[0,0])=>{const{x:n,y:r}=Dd(e)?e.internals.positionAbsolute:es(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},vc=(e,t=[0,0])=>{const{x:n,y:r}=Dd(e)?e.internals.positionAbsolute:es(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},lx=(e,t)=>yc(mc(Hd(e),Hd(t))),ns=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},ux=e=>Nn(e.width)&&Nn(e.height)&&Nn(e.x)&&Nn(e.y),Nn=e=>!isNaN(e)&&isFinite(e),dx=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},rs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),os=({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return s?rs(l,a):l},xc=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function qo(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 fO(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=qo(e,n),i=qo(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=qo(e.top??e.y??0,n),i=qo(e.bottom??e.y??0,n),s=qo(e.left??e.x??0,t),a=qo(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pO(e,t,n,r,i,s){const{x:a,y:l}=xc(e,[t,n,r]),{x:u,y:d}=xc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=i-u,g=s-d;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(f),bottom:Math.floor(g)}}const Bd=(e,t,n,r,i,s)=>{const a=fO(s,t,n),l=(t-a.x)/e.width,u=(n-a.y)/e.height,d=Math.min(l,u),f=Wo(d,r,i),g=e.x+e.width/2,h=e.y+e.height/2,m=t/2-g*f,x=n/2-h*f,v=pO(e,m,x,f,t,n),b={left:Math.min(v.left-a.left,0),top:Math.min(v.top-a.top,0),right:Math.min(v.right-a.right,0),bottom:Math.min(v.bottom-a.bottom,0)};return{x:m-b.left+b.right,y:x-b.top+b.bottom,zoom:f}},is=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Yo(e){return e!=null&&e!=="parent"}function rr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function fx(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function px(e,t={width:0,height:0},n,r,i){const s={...e},a=r.get(n);if(a){const l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function hx(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hO(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function gO(e){return{...Qv,...e||{}}}function ss(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=Bn(e),l=os({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:u,y:d}=n?rs(l,t):l;return{xSnapped:u,ySnapped:d,...l}}const Vd=e=>({width:e.offsetWidth,height:e.offsetHeight}),gx=e=>e?.getRootNode?.()||window?.document,mO=["INPUT","SELECT","TEXTAREA"];function mx(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:mO.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const yx=e=>"clientX"in e,Bn=(e,t)=>{const n=yx(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},vx=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Vd(a)}})};function xx({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){const u=e*.125+i*.375+a*.375+n*.125,d=t*.125+s*.375+l*.375+r*.125,f=Math.abs(u-e),g=Math.abs(d-t);return[u,d,f,g]}function wc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function wx({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Ne.Left:return[t-wc(t-r,s),n];case Ne.Right:return[t+wc(r-t,s),n];case Ne.Top:return[t,n-wc(n-i,s)];case Ne.Bottom:return[t,n+wc(i-n,s)]}}function bc({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:i,targetPosition:s=Ne.Top,curvature:a=.25}){const[l,u]=wx({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[d,f]=wx({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[g,h,m,x]=xx({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:f});return[`M${e},${t} C${l},${u} ${d},${f} ${r},${i}`,g,h,m,x]}function bx({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,l=r<t?r+a:r-a;return[s,l,i,a]}function yO({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:i=!1}){if(r!==void 0)return r;const s=i&&n?1e3:0,a=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return s+a}function vO({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=mc(vc(e),vc(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return ns(a,yc(s))>0}const xO=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,wO=(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)),Sx=(e,t)=>{if(!e.source||!e.target)return dx("006",jt.error006()),t;let n;return ox(e)?n={...e}:n={...e,id:xO(e)},wO(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function _x({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,a,l]=bx({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,l]}const Nx={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},bO=({source:e,sourcePosition:t=Ne.Bottom,target:n})=>t===Ne.Left||t===Ne.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},Ix=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function SO({source:e,sourcePosition:t=Ne.Bottom,target:n,targetPosition:r=Ne.Top,center:i,offset:s,stepPosition:a}){const l=Nx[t],u=Nx[r],d={x:e.x+l.x*s,y:e.y+l.y*s},f={x:n.x+u.x*s,y:n.y+u.y*s},g=bO({source:d,sourcePosition:t,target:f}),h=g.x!==0?"x":"y",m=g[h];let x=[],v,b;const S={x:0,y:0},N={x:0,y:0},[,,w,I]=bx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*u[h]===-1){h==="x"?(v=i.x??d.x+(f.x-d.x)*a,b=i.y??(d.y+f.y)/2):(v=i.x??(d.x+f.x)/2,b=i.y??d.y+(f.y-d.y)*a);const A=[{x:v,y:d.y},{x:v,y:f.y}],M=[{x:d.x,y:b},{x:f.x,y:b}];l[h]===m?x=h==="x"?A:M:x=h==="x"?M:A}else{const A=[{x:d.x,y:f.y}],M=[{x:f.x,y:d.y}];if(h==="x"?x=l.x===m?M:A:x=l.y===m?A:M,t===r){const $=Math.abs(e[h]-n[h]);if($<=s){const F=Math.min(s-1,s-$);l[h]===m?S[h]=(d[h]>e[h]?-1:1)*F:N[h]=(f[h]>n[h]?-1:1)*F}}if(t!==r){const $=h==="x"?"y":"x",F=l[h]===u[$],E=d[$]>f[$],P=d[$]<f[$];(l[h]===1&&(!F&&E||F&&P)||l[h]!==1&&(!F&&P||F&&E))&&(x=h==="x"?A:M)}const B={x:d.x+S.x,y:d.y+S.y},U={x:f.x+N.x,y:f.y+N.y},q=Math.max(Math.abs(B.x-x[0].x),Math.abs(U.x-x[0].x)),D=Math.max(Math.abs(B.y-x[0].y),Math.abs(U.y-x[0].y));q>=D?(v=(B.x+U.x)/2,b=x[0].y):(v=x[0].x,b=(B.y+U.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...x,{x:f.x+N.x,y:f.y+N.y},n],v,b,w,I]}function _O(e,t,n,r){const i=Math.min(Ix(e,t)/2,Ix(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const d=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${s+i*d},${a}Q ${s},${a} ${s},${a+i*f}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${s},${a+i*u}Q ${s},${a} ${s+i*l},${a}`}function Fd({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:i,targetPosition:s=Ne.Top,borderRadius:a=5,centerX:l,centerY:u,offset:d=20,stepPosition:f=.5}){const[g,h,m,x,v]=SO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:u},offset:d,stepPosition:f});return[g.reduce((S,N,w)=>{let I="";return w>0&&w<g.length-1?I=_O(g[w-1],N,g[w+1],a):I=`${w===0?"M":"L"}${N.x} ${N.y}`,S+=I,S},""),h,m,x,v]}function Ex(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function NO(e){const{sourceNode:t,targetNode:n}=e;if(!Ex(t)||!Ex(n))return null;const r=t.internals.handleBounds||Tx(t.handles),i=n.internals.handleBounds||Tx(n.handles),s=Cx(r?.source??[],e.sourceHandle),a=Cx(e.connectionMode===zo.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",jt.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=s?.position||Ne.Bottom,u=a?.position||Ne.Top,d=as(t,s,l),f=as(n,a,u);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:u}}function Tx(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function as(e,t,n=Ne.Left,r=!1){const i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??rr(e);if(r)return{x:i+a/2,y:s+l/2};switch(t?.position??n){case Ne.Top:return{x:i+a/2,y:s};case Ne.Right:return{x:i+a,y:s+l/2};case Ne.Bottom:return{x:i+a/2,y:s+l};case Ne.Left:return{x:i,y:s+l/2}}}function Cx(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function zd(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function IO(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=zd(u,t);s.has(d)||(a.push({id:d,color:u.color||n,...u}),s.add(d))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const Ud={nodeOrigin:[0,0],nodeExtent:Ji,elevateNodesOnSelect:!0,defaults:{}},EO={...Ud,checkEquality:!0};function Wd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function TO(e,t,n){const r=Wd(Ud,n);for(const i of e.values())if(i.parentId)qd(i,e,t,r);else{const s=es(i,r.nodeOrigin),a=Yo(i.extent)?i.extent:r.nodeExtent,l=ro(s,a,rr(i));i.internals.positionAbsolute=l}}function Gd(e,t,n,r){const i=Wd(EO,r);let s=e.length>0;const a=new Map(t),l=i?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=a.get(u.id);if(i.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const f=es(u,i.nodeOrigin),g=Yo(u.extent)?u.extent:i.nodeExtent,h=ro(f,g,rr(u));d={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:h,handleBounds:u.measured?d?.internals.handleBounds:void 0,z:Ax(u,l),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(s=!1),u.parentId&&qd(d,t,n,r)}return s}function CO(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 qd(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a}=Wd(Ud,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}CO(e,n);const d=i?1e3:0,{x:f,y:g,z:h}=AO(e,u,s,a,d),{positionAbsolute:m}=e.internals,x=f!==m.x||g!==m.y;(x||h!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:g}:m,z:h}})}function Ax(e,t){return(Nn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function AO(e,t,n,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=rr(e),u=es(e,n),d=Yo(e.extent)?ro(u,e.extent,l):u;let f=ro({x:s+d.x,y:a+d.y},r,l);e.extent==="parent"&&(f=sx(f,l,t));const g=Ax(e,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=g?h+1:g}}function Yd(e,t,n,r=[0,0]){const i=[],s=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=s.get(a.parentId)?.expandedRect??Go(l),d=lx(u,a.rect);s.set(a.parentId,{expandedRect:d,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},u)=>{const d=l.internals.positionAbsolute,f=rr(l),g=l.origin??r,h=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,m=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,x=Math.max(f.width,Math.round(a.width)),v=Math.max(f.height,Math.round(a.height)),b=(x-f.width)*g[0],S=(v-f.height)*g[1];(h>0||m>0||b||S)&&(i.push({id:u,type:"position",position:{x:l.position.x-h+b,y:l.position.y-m+S}}),n.get(u)?.forEach(N=>{e.some(w=>w.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+h,y:N.position.y+m}})})),(f.width<a.width||f.height<a.height||h||m)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?g[0]*h-b:0),height:v+(m?g[1]*m-S:0)}})}),i}function kO(e,t,n,r,i,s){const a=r?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(d.transform),g=[];for(const h of e.values()){const m=t.get(h.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}const x=Vd(h.nodeElement),v=m.measured.width!==x.width||m.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!m.internals.handleBounds||h.force))){const S=h.nodeElement.getBoundingClientRect(),N=Yo(m.extent)?m.extent:s;let{positionAbsolute:w}=m.internals;m.parentId&&m.extent==="parent"?w=sx(w,x,t.get(m.parentId)):N&&(w=ro(w,N,x));const I={...m,measured:x,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:vx("source",h.nodeElement,S,f,m.id),target:vx("target",h.nodeElement,S,f,m.id)}}};t.set(m.id,I),m.parentId&&qd(I,t,n,{nodeOrigin:i}),l=!0,v&&(u.push({id:m.id,type:"dimensions",dimensions:x}),m.expandParent&&m.parentId&&g.push({id:m.id,parentId:m.parentId,rect:Go(I,i)}))}}if(g.length>0){const h=Yd(g,t,n,i);u.push(...h)}return{changes:u,updatedInternals:l}}async function MO({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),l=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(l)}function kx(e,t,n,r,i,s){let a=i;const l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),s){a=`${i}-${e}-${s}`;const d=r.get(a)||new Map;r.set(a,d.set(n,t))}}function Mx(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:l},d=`${i}-${a}--${s}-${l}`,f=`${s}-${l}--${i}-${a}`;kx("source",u,f,e,i,a),kx("target",u,d,e,s,l),t.set(r.id,r)}}function OO(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i].id!==r[i].id||n[i].type!==r[i].type||!Object.is(n[i].data,r[i].data))return!1;return!0}function Ox(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ox(n,t):!1}function Px(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function PO(e,t,n,r){const i=new Map;for(const[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!Ox(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&i.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Xd({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const i=[];for(const[a,l]of t){const u=n.get(a)?.internals.userNode;u&&i.push({...u,position:l.position,dragging:r})}if(!e)return[i[0],i];const s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}function RO({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=rs(s,t);return{x:a.x-s.x,y:a.y-s.y}}function LO({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,u=!1,d={x:0,y:0},f=null,g=!1,h=null,m=!1,x=!1,v=null;function b({noDragClassName:N,handleSelector:w,domNode:I,isSelectable:k,nodeId:A,nodeClickDistance:M=0}){h=Yt(I);function B({x:$,y:F}){const{nodeLookup:E,nodeExtent:P,snapGrid:L,snapToGrid:j,nodeOrigin:O,onNodeDrag:W,onSelectionDrag:z,onError:Y,updateNodePositions:J}=t();s={x:$,y:F};let ie=!1;const ee=l.size>1,ce=ee&&P?Hd(ts(l)):null,ge=ee&&j?RO({dragItems:l,snapGrid:L,x:$,y:F}):null;for(const[Q,te]of l){if(!E.has(Q))continue;let ne={x:$-te.distance.x,y:F-te.distance.y};j&&(ne=ge?{x:Math.round(ne.x+ge.x),y:Math.round(ne.y+ge.y)}:rs(ne,L));let oe=null;if(ee&&P&&!te.extent&&ce){const{positionAbsolute:ve}=te.internals,me=ve.x-ce.x+P[0][0],Oe=ve.x+te.measured.width-ce.x2+P[1][0],Ce=ve.y-ce.y+P[0][1],ae=ve.y+te.measured.height-ce.y2+P[1][1];oe=[[me,Ce],[Oe,ae]]}const{position:pe,positionAbsolute:le}=ix({nodeId:Q,nextPosition:ne,nodeLookup:E,nodeExtent:oe||P,nodeOrigin:O,onError:Y});ie=ie||te.position.x!==pe.x||te.position.y!==pe.y,te.position=pe,te.internals.positionAbsolute=le}if(x=x||ie,!!ie&&(J(l,!0),v&&(r||W||!A&&z))){const[Q,te]=Xd({nodeId:A,dragItems:l,nodeLookup:E});r?.(v,l,Q,te),W?.(v,Q,te),A||z?.(v,te)}}async function U(){if(!f)return;const{transform:$,panBy:F,autoPanSpeed:E,autoPanOnNodeDrag:P}=t();if(!P){u=!1,cancelAnimationFrame(a);return}const[L,j]=cx(d,f,E);(L!==0||j!==0)&&(s.x=(s.x??0)-L/$[2],s.y=(s.y??0)-j/$[2],await F({x:L,y:j})&&B(s)),a=requestAnimationFrame(U)}function q($){const{nodeLookup:F,multiSelectionActive:E,nodesDraggable:P,transform:L,snapGrid:j,snapToGrid:O,selectNodesOnDrag:W,onNodeDragStart:z,onSelectionDragStart:Y,unselectNodesAndEdges:J}=t();g=!0,(!W||!k)&&!E&&A&&(F.get(A)?.selected||J()),k&&W&&A&&e?.(A);const ie=ss($.sourceEvent,{transform:L,snapGrid:j,snapToGrid:O,containerBounds:f});if(s=ie,l=PO(F,P,ie,A),l.size>0&&(n||z||!A&&Y)){const[ee,ce]=Xd({nodeId:A,dragItems:l,nodeLookup:F});n?.($.sourceEvent,l,ee,ce),z?.($.sourceEvent,ee,ce),A||Y?.($.sourceEvent,ce)}}const D=bv().clickDistance(M).on("start",$=>{const{domNode:F,nodeDragThreshold:E,transform:P,snapGrid:L,snapToGrid:j}=t();f=F?.getBoundingClientRect()||null,m=!1,x=!1,v=$.sourceEvent,E===0&&q($),s=ss($.sourceEvent,{transform:P,snapGrid:L,snapToGrid:j,containerBounds:f}),d=Bn($.sourceEvent,f)}).on("drag",$=>{const{autoPanOnNodeDrag:F,transform:E,snapGrid:P,snapToGrid:L,nodeDragThreshold:j,nodeLookup:O}=t(),W=ss($.sourceEvent,{transform:E,snapGrid:P,snapToGrid:L,containerBounds:f});if(v=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||A&&!O.has(A))&&(m=!0),!m){if(!u&&F&&g&&(u=!0,U()),!g){const z=W.xSnapped-(s.x??0),Y=W.ySnapped-(s.y??0);Math.sqrt(z*z+Y*Y)>j&&q($)}(s.x!==W.xSnapped||s.y!==W.ySnapped)&&l&&g&&(d=Bn($.sourceEvent,f),B(W))}}).on("end",$=>{if(!(!g||m)&&(u=!1,g=!1,cancelAnimationFrame(a),l.size>0)){const{nodeLookup:F,updateNodePositions:E,onNodeDragStop:P,onSelectionDragStop:L}=t();if(x&&(E(l,!1),x=!1),i||P||!A&&L){const[j,O]=Xd({nodeId:A,dragItems:l,nodeLookup:F,dragging:!1});i?.($.sourceEvent,l,j,O),P?.($.sourceEvent,j,O),A||L?.($.sourceEvent,O)}}}).filter($=>{const F=$.target;return!$.button&&(!N||!Px(F,`.${N}`,I))&&(!w||Px(F,w,I))});h.call(D)}function S(){h?.on(".drag",null)}return{update:b,destroy:S}}function DO(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())ns(i,Go(s))>0&&r.push(s);return r}const jO=250;function $O(e,t,n,r){let i=[],s=1/0;const a=DO(e,n,t+jO);for(const l of a){const u=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(const d of u){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=as(l,d,d.position,!0),h=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));h>t||(h<s?(i=[{...d,x:f,y:g}],s=h):h===s&&i.push({...d,x:f,y:g}))}}if(!i.length)return null;if(i.length>1){const l=r.type==="source"?"target":"source";return i.find(u=>u.type===l)??i[0]}return i[0]}function Rx(e,t,n,r,i,s=!1){const a=r.get(e);if(!a)return null;const l=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],u=(n?l?.find(d=>d.id===n):l?.[0])??null;return u&&s?{...u,...as(a,u,u.position,!0)}:u}function Lx(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function HO(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Dx=()=>!0;function BO(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:u,lib:d,autoPanOnConnect:f,flowId:g,panBy:h,cancelConnection:m,onConnectStart:x,onConnect:v,onConnectEnd:b,isValidConnection:S=Dx,onReconnectEnd:N,updateConnection:w,getTransform:I,getFromHandle:k,autoPanSpeed:A,dragThreshold:M=1,handleDomNode:B}){const U=gx(e.target);let q=0,D;const{x:$,y:F}=Bn(e),E=Lx(s,B),P=l?.getBoundingClientRect();let L=!1;if(!P||!E)return;const j=Rx(i,E,r,u,t);if(!j)return;let O=Bn(e,P),W=!1,z=null,Y=!1,J=null;function ie(){if(!f||!P)return;const[pe,le]=cx(O,P,A);h({x:pe,y:le}),q=requestAnimationFrame(ie)}const ee={...j,nodeId:i,type:E,position:j.position},ce=u.get(i);let Q={inProgress:!0,isValid:null,from:as(ce,ee,Ne.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ce,to:O,toHandle:null,toPosition:tx[ee.position],toNode:null};function te(){L=!0,w(Q),x?.(e,{nodeId:i,handleId:r,handleType:E})}M===0&&te();function ne(pe){if(!L){const{x:Oe,y:Ce}=Bn(pe),ae=Oe-$,Ie=Ce-F;if(!(ae*ae+Ie*Ie>M*M))return;te()}if(!k()||!ee){oe(pe);return}const le=I();O=Bn(pe,P),D=$O(os(O,le,!1,[1,1]),n,u,ee),W||(ie(),W=!0);const ve=jx(pe,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:U,lib:d,flowId:g,nodeLookup:u});J=ve.handleDomNode,z=ve.connection,Y=HO(!!D,ve.isValid);const me={...Q,isValid:Y,to:ve.toHandle&&Y?xc({x:ve.toHandle.x,y:ve.toHandle.y},le):O,toHandle:ve.toHandle,toPosition:Y&&ve.toHandle?ve.toHandle.position:tx[ee.position],toNode:ve.toHandle?u.get(ve.toHandle.nodeId):null};Y&&D&&Q.toHandle&&me.toHandle&&Q.toHandle.type===me.toHandle.type&&Q.toHandle.nodeId===me.toHandle.nodeId&&Q.toHandle.id===me.toHandle.id&&Q.to.x===me.to.x&&Q.to.y===me.to.y||(w(me),Q=me)}function oe(pe){if(L){(D||J)&&z&&Y&&v?.(z);const{inProgress:le,...ve}=Q,me={...ve,toPosition:Q.toHandle?Q.toPosition:null};b?.(pe,me),s&&N?.(pe,me)}m(),cancelAnimationFrame(q),W=!1,Y=!1,z=null,J=null,U.removeEventListener("mousemove",ne),U.removeEventListener("mouseup",oe),U.removeEventListener("touchmove",ne),U.removeEventListener("touchend",oe)}U.addEventListener("mousemove",ne),U.addEventListener("mouseup",oe),U.addEventListener("touchmove",ne),U.addEventListener("touchend",oe)}function jx(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:u,isValidConnection:d=Dx,nodeLookup:f}){const g=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${u}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:x}=Bn(e),v=a.elementFromPoint(m,x),b=v?.classList.contains(`${l}-flow__handle`)?v:h,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const N=Lx(void 0,b),w=b.getAttribute("data-nodeid"),I=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),A=b.classList.contains("connectableend");if(!w||!N)return S;const M={source:g?w:r,sourceHandle:g?I:i,target:g?r:w,targetHandle:g?i:I};S.connection=M;const U=k&&A&&(n===zo.Strict?g&&N==="source"||!g&&N==="target":w!==r||I!==i);S.isValid=U&&d(M),S.toHandle=Rx(w,N,I,f,n,!0)}return S}const Kd={onPointerDown:BO,isValid:jx};function VO({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Yt(e);function s({translateExtent:l,width:u,height:d,zoomStep:f=1,pannable:g=!0,zoomable:h=!0,inversePan:m=!1}){const x=w=>{if(w.sourceEvent.type!=="wheel"||!t)return;const I=n(),k=w.sourceEvent.ctrlKey&&is()?10:1,A=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*f,M=I[2]*Math.pow(2,A*k);t.scaleTo(M)};let v=[0,0];const b=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(v=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},S=w=>{const I=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const k=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],A=[k[0]-v[0],k[1]-v[1]];v=k;const M=r()*Math.max(I[2],Math.log(I[2]))*(m?-1:1),B={x:I[0]-A[0]*M,y:I[1]-A[1]*M},U=[[0,0],[u,d]];t.setViewportConstrained({x:B.x,y:B.y,zoom:I[2]},U,l)},N=Zv().on("start",b).on("zoom",g?S:null).on("zoom.wheel",h?x:null);i.call(N,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:bn}}const FO=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Sc=e=>({x:e.x,y:e.y,zoom:e.k}),Zd=({x:e,y:t,zoom:n})=>pc.translate(e,t).scale(n),Xo=(e,t)=>e.target.closest(`.${t}`),$x=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),zO=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Jd=(e,t=0,n=zO,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Hx=e=>{const t=e.ctrlKey&&is()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function UO({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:d}){return f=>{if(Xo(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(f.ctrlKey&&a){const b=bn(f),S=Hx(f),N=g*Math.pow(2,S);r.scaleTo(n,N,b,f);return}const h=f.deltaMode===1?20:1;let m=i===no.Vertical?0:f.deltaX*h,x=i===no.Horizontal?0:f.deltaY*h;!is()&&f.shiftKey&&i!==no.Vertical&&(m=f.deltaY*h,x=0),r.translateBy(n,-(m/g)*s,-(x/g)*s,{internal:!0});const v=Sc(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l?.(f,v)),e.isPanScrolling&&(u?.(f,v),e.panScrollTimeout=setTimeout(()=>{d?.(f,v),e.isPanScrolling=!1},150))}}function WO({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,l=Xo(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}function GO({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const i=Sc(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}function qO({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&$x(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Sc(s.transform))}}function YO({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&$x(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&FO(e.prevViewport,a.transform))){const l=Sc(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,l)},n?150:0)}}}function XO({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:u,lib:d}){return f=>{const g=e||t,h=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(Xo(f,`${d}-flow__node`)||Xo(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!s&&!n||a||Xo(f,l)&&f.type==="wheel"||Xo(f,u)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!g&&!i&&!h&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const m=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&m}}function KO({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:s,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),h=Zv().clickDistance(!Nn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),m=Yt(e).call(h);w({x:s.x,y:s.y,zoom:Wo(s.zoom,t,n)},[[0,0],[g.width,g.height]],i);const x=m.on("wheel.zoom"),v=m.on("dblclick.zoom");h.wheelDelta(Hx);function b($,F){return m?new Promise(E=>{h?.interpolate(F?.interpolate==="linear"?Gi:rc).transform(Jd(m,F?.duration,F?.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function S({noWheelClassName:$,noPanClassName:F,onPaneContextMenu:E,userSelectionActive:P,panOnScroll:L,panOnDrag:j,panOnScrollMode:O,panOnScrollSpeed:W,preventScrolling:z,zoomOnPinch:Y,zoomOnScroll:J,zoomOnDoubleClick:ie,zoomActivationKeyPressed:ee,lib:ce,onTransformChange:ge}){P&&!f.isZoomingOrPanning&&N();const te=L&&!ee&&!P?UO({zoomPanValues:f,noWheelClassName:$,d3Selection:m,d3Zoom:h,panOnScrollMode:O,panOnScrollSpeed:W,zoomOnPinch:Y,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}):WO({noWheelClassName:$,preventScrolling:z,d3ZoomHandler:x});if(m.on("wheel.zoom",te,{passive:!1}),!P){const oe=GO({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});h.on("start",oe);const pe=qO({zoomPanValues:f,panOnDrag:j,onPaneContextMenu:!!E,onPanZoom:a,onTransformChange:ge});h.on("zoom",pe);const le=YO({zoomPanValues:f,panOnDrag:j,panOnScroll:L,onPaneContextMenu:E,onPanZoomEnd:u,onDraggingChange:d});h.on("end",le)}const ne=XO({zoomActivationKeyPressed:ee,panOnDrag:j,zoomOnScroll:J,panOnScroll:L,zoomOnDoubleClick:ie,zoomOnPinch:Y,userSelectionActive:P,noPanClassName:F,noWheelClassName:$,lib:ce});h.filter(ne),ie?m.on("dblclick.zoom",v):m.on("dblclick.zoom",null)}function N(){h.on("zoom",null)}async function w($,F,E){const P=Zd($),L=h?.constrain()(P,F,E);return L&&await b(L),new Promise(j=>j(L))}async function I($,F){const E=Zd($);return await b(E,F),new Promise(P=>P(E))}function k($){if(m){const F=Zd($),E=m.property("__zoom");(E.k!==$.zoom||E.x!==$.x||E.y!==$.y)&&h?.transform(m,F,null,{sync:!0})}}function A(){const $=m?Xv(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function M($,F){return m?new Promise(E=>{h?.interpolate(F?.interpolate==="linear"?Gi:rc).scaleTo(Jd(m,F?.duration,F?.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function B($,F){return m?new Promise(E=>{h?.interpolate(F?.interpolate==="linear"?Gi:rc).scaleBy(Jd(m,F?.duration,F?.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function U($){h?.scaleExtent($)}function q($){h?.translateExtent($)}function D($){const F=!Nn($)||$<0?0:$;h?.clickDistance(F)}return{update:S,destroy:N,setViewport:I,setViewportConstrained:w,getViewport:A,scaleTo:M,scaleBy:B,setScaleExtent:U,setTranslateExtent:q,syncViewport:k,setClickDistance:D}}var oo;(function(e){e.Line="line",e.Handle="handle"})(oo||(oo={}));function ZO({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=e-t,l=n-r,u=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(u[0]=u[0]*-1),l&&s&&(u[1]=u[1]*-1),u}function JO(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Nr(e,t){return Math.max(0,t-e)}function Ir(e,t){return Math.max(0,e-t)}function _c(e,t,n){return Math.max(0,t-e,e-n)}function Bx(e,t){return e?!t:t}function QO(e,t,n,r,i,s,a,l){let{affectsX:u,affectsY:d}=t;const{isHorizontal:f,isVertical:g}=t,h=f&&g,{xSnapped:m,ySnapped:x}=n,{minWidth:v,maxWidth:b,minHeight:S,maxHeight:N}=r,{x:w,y:I,width:k,height:A,aspectRatio:M}=e;let B=Math.floor(f?m-e.pointerX:0),U=Math.floor(g?x-e.pointerY:0);const q=k+(u?-B:B),D=A+(d?-U:U),$=-s[0]*k,F=-s[1]*A;let E=_c(q,v,b),P=_c(D,S,N);if(a){let O=0,W=0;u&&B<0?O=Nr(w+B+$,a[0][0]):!u&&B>0&&(O=Ir(w+q+$,a[1][0])),d&&U<0?W=Nr(I+U+F,a[0][1]):!d&&U>0&&(W=Ir(I+D+F,a[1][1])),E=Math.max(E,O),P=Math.max(P,W)}if(l){let O=0,W=0;u&&B>0?O=Ir(w+B,l[0][0]):!u&&B<0&&(O=Nr(w+q,l[1][0])),d&&U>0?W=Ir(I+U,l[0][1]):!d&&U<0&&(W=Nr(I+D,l[1][1])),E=Math.max(E,O),P=Math.max(P,W)}if(i){if(f){const O=_c(q/M,S,N)*M;if(E=Math.max(E,O),a){let W=0;!u&&!d||u&&!d&&h?W=Ir(I+F+q/M,a[1][1])*M:W=Nr(I+F+(u?B:-B)/M,a[0][1])*M,E=Math.max(E,W)}if(l){let W=0;!u&&!d||u&&!d&&h?W=Nr(I+q/M,l[1][1])*M:W=Ir(I+(u?B:-B)/M,l[0][1])*M,E=Math.max(E,W)}}if(g){const O=_c(D*M,v,b)/M;if(P=Math.max(P,O),a){let W=0;!u&&!d||d&&!u&&h?W=Ir(w+D*M+$,a[1][0])/M:W=Nr(w+(d?U:-U)*M+$,a[0][0])/M,P=Math.max(P,W)}if(l){let W=0;!u&&!d||d&&!u&&h?W=Nr(w+D*M,l[1][0])/M:W=Ir(w+(d?U:-U)*M,l[0][0])/M,P=Math.max(P,W)}}}U=U+(U<0?P:-P),B=B+(B<0?E:-E),i&&(h?q>D*M?U=(Bx(u,d)?-B:B)/M:B=(Bx(u,d)?-U:U)*M:f?(U=B/M,d=u):(B=U*M,u=d));const L=u?w+B:w,j=d?I+U:I;return{width:k+(u?-B:B),height:A+(d?-U:U),x:s[0]*B*(u?-1:1)+L,y:s[1]*U*(d?-1:1)+j}}const Vx={width:0,height:0,x:0,y:0},eP={...Vx,pointerX:0,pointerY:0,aspectRatio:1};function tP(e){return[[0,0],[e.measured.width,e.measured.height]]}function nP(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,u=n[1]*a;return[[r-l,i-u],[r+s-l,i+a-u]]}function rP({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=Yt(e);function a({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:g,onResizeStart:h,onResize:m,onResizeEnd:x,shouldResize:v}){let b={...Vx},S={...eP};const N=JO(u);let w,I=null,k=[],A,M,B;const U=bv().on("start",q=>{const{nodeLookup:D,transform:$,snapGrid:F,snapToGrid:E,nodeOrigin:P,paneDomNode:L}=n();if(w=D.get(t),!w)return;I=L?.getBoundingClientRect()??null;const{xSnapped:j,ySnapped:O}=ss(q.sourceEvent,{transform:$,snapGrid:F,snapToGrid:E,containerBounds:I});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},S={...b,pointerX:j,pointerY:O,aspectRatio:b.width/b.height},A=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(A=D.get(w.parentId),M=A&&w.extent==="parent"?tP(A):void 0),k=[],B=void 0;for(const[W,z]of D)if(z.parentId===t&&(k.push({id:W,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const Y=nP(z,w,z.origin??P);B?B=[[Math.min(Y[0][0],B[0][0]),Math.min(Y[0][1],B[0][1])],[Math.max(Y[1][0],B[1][0]),Math.max(Y[1][1],B[1][1])]]:B=Y}h?.(q,{...b})}).on("drag",q=>{const{transform:D,snapGrid:$,snapToGrid:F,nodeOrigin:E}=n(),P=ss(q.sourceEvent,{transform:D,snapGrid:$,snapToGrid:F,containerBounds:I}),L=[];if(!w)return;const{x:j,y:O,width:W,height:z}=b,Y={},J=w.origin??E,{width:ie,height:ee,x:ce,y:ge}=QO(S,N,P,d,f,J,M,B),Q=ie!==W,te=ee!==z,ne=ce!==j&&Q,oe=ge!==O&&te;if(!ne&&!oe&&!Q&&!te)return;if((ne||oe||J[0]===1||J[1]===1)&&(Y.x=ne?ce:b.x,Y.y=oe?ge:b.y,b.x=Y.x,b.y=Y.y,k.length>0)){const me=ce-j,Oe=ge-O;for(const Ce of k)Ce.position={x:Ce.position.x-me+J[0]*(ie-W),y:Ce.position.y-Oe+J[1]*(ee-z)},L.push(Ce)}if((Q||te)&&(Y.width=Q&&(!g||g==="horizontal")?ie:b.width,Y.height=te&&(!g||g==="vertical")?ee:b.height,b.width=Y.width,b.height=Y.height),A&&w.expandParent){const me=J[0]*(Y.width??0);Y.x&&Y.x<me&&(b.x=me,S.x=S.x-(Y.x-me));const Oe=J[1]*(Y.height??0);Y.y&&Y.y<Oe&&(b.y=Oe,S.y=S.y-(Y.y-Oe))}const pe=ZO({width:b.width,prevWidth:W,height:b.height,prevHeight:z,affectsX:N.affectsX,affectsY:N.affectsY}),le={...b,direction:pe};v?.(q,le)!==!1&&(m?.(q,le),r(Y,L))}).on("end",q=>{x?.(q,{...b}),i?.({...b})});s.call(U)}function l(){s.on(".drag",null)}return{update:a,destroy:l}}var Nc={exports:{}},Qd={};/**
|
|
249
|
-
* @license React
|
|
250
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
251
|
-
*
|
|
252
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the MIT license found in the
|
|
255
|
-
* LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/var Fx;function oP(){if(Fx)return Qd;Fx=1;var e=T,t=em();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Qd.useSyncExternalStoreWithSelector=function(d,f,g,h,m){var x=s(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=l(function(){function S(A){if(!N){if(N=!0,w=A,A=h(A),m!==void 0&&v.hasValue){var M=v.value;if(m(M,A))return I=M}return I=A}if(M=I,r(w,A))return M;var B=h(A);return m!==void 0&&m(M,B)?(w=A,M):(w=A,I=B)}var N=!1,w,I,k=g===void 0?null:g;return[function(){return S(f())},k===null?void 0:function(){return S(k())}]},[f,g,h,m]);var b=i(d,x[0],x[1]);return a(function(){v.hasValue=!0,v.value=b},[b]),u(b),b},Qd}var ef={};/**
|
|
257
|
-
* @license React
|
|
258
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
259
|
-
*
|
|
260
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the MIT license found in the
|
|
263
|
-
* LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/var zx;function iP(){return zx||(zx=1,process.env.NODE_ENV!=="production"&&function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=em(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,l=t.useMemo,u=t.useDebugValue;ef.useSyncExternalStoreWithSelector=function(d,f,g,h,m){var x=s(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=l(function(){function S(A){if(!N){if(N=!0,w=A,A=h(A),m!==void 0&&v.hasValue){var M=v.value;if(m(M,A))return I=M}return I=A}if(M=I,r(w,A))return M;var B=h(A);return m!==void 0&&m(M,B)?(w=A,M):(w=A,I=B)}var N=!1,w,I,k=g===void 0?null:g;return[function(){return S(f())},k===null?void 0:function(){return S(k())}]},[f,g,h,m]);var b=i(d,x[0],x[1]);return a(function(){v.hasValue=!0,v.value=b},[b]),u(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ef}var Ux;function sP(){return Ux||(Ux=1,process.env.NODE_ENV==="production"?Nc.exports=oP():Nc.exports=iP()),Nc.exports}var aP=sP();const cP=Uh(aP),lP={},Wx=e=>{let t;const n=new Set,r=(f,g)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const m=t;t=g??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(x=>x(t,m))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(lP?"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()}},d=t=e(r,i,u);return u},uP=e=>e?Wx(e):Wx,{useDebugValue:dP}=T,{useSyncExternalStoreWithSelector:fP}=cP,pP=e=>e;function Gx(e,t=pP,n){const r=fP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dP(r),r}const qx=(e,t)=>{const n=uP(e),r=(i,s=t)=>Gx(n,i,s);return Object.assign(r,n),r},hP=(e,t)=>e?qx(e,t):qx;function ct(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Ic=T.createContext(null),gP=Ic.Provider,Yx=jt.error001();function Fe(e,t){const n=T.useContext(Ic);if(n===null)throw new Error(Yx);return Gx(n,e,t)}function rt(){const e=T.useContext(Ic);if(e===null)throw new Error(Yx);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Xx={display:"none"},mP={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Kx="react-flow__node-desc",Zx="react-flow__edge-desc",yP="react-flow__aria-live",vP=e=>e.ariaLiveMessage,xP=e=>e.ariaLabelConfig;function wP({rfId:e}){const t=Fe(vP);return y.jsx("div",{id:`${yP}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mP,children:t})}function bP({rfId:e,disableKeyboardA11y:t}){const n=Fe(xP);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${Kx}-${e}`,style:Xx,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${Zx}-${e}`,style:Xx,children:n["edge.a11yDescription.default"]}),!t&&y.jsx(wP,{rfId:e})]})}const Ec=T.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const a=`${e}`.split("-");return y.jsx("div",{className:yt(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});Ec.displayName="Panel";function SP({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:y.jsx(Ec,{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:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const _P=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Tc=e=>e.id;function NP(e,t){return ct(e.selectedNodes.map(Tc),t.selectedNodes.map(Tc))&&ct(e.selectedEdges.map(Tc),t.selectedEdges.map(Tc))}function IP({onSelectionChange:e}){const t=rt(),{selectedNodes:n,selectedEdges:r}=Fe(_P,NP);return T.useEffect(()=>{const i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const EP=e=>!!e.onSelectionChangeHandlers;function TP({onSelectionChange:e}){const t=Fe(EP);return e||t?y.jsx(IP,{onSelectionChange:e}):null}const Jx=[0,0],CP={x:0,y:0,zoom:1},Qx=[...["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"],AP=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}),e0={translateExtent:Ji,nodeOrigin:Jx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function kP(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:u,setPaneClickDistance:d}=Fe(AP,ct),f=rt();T.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{g.current=e0,l()}),[]);const g=T.useRef(e0);return T.useEffect(()=>{for(const h of Qx){const m=e[h],x=g.current[h];m!==x&&(typeof e[h]>"u"||(h==="nodes"?t(m):h==="edges"?n(m):h==="minZoom"?r(m):h==="maxZoom"?i(m):h==="translateExtent"?s(m):h==="nodeExtent"?a(m):h==="paneClickDistance"?d(m):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:gO(m)}):h==="fitView"?f.setState({fitViewQueued:m}):h==="fitViewOptions"?f.setState({fitViewOptions:m}):f.setState({[h]:m})))}g.current=e},Qx.map(h=>e[h])),null}function t0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function MP(e){const[t,n]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){n(e);return}const r=t0(),i=()=>n(r?.matches?"dark":"light");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:t0()?.matches?"dark":"light"}const n0=typeof document<"u"?document:null;function cs(e=null,t={target:n0,actInsideInputWithModifier:!0}){const[n,r]=T.useState(!1),i=T.useRef(!1),s=T.useRef(new Set([])),[a,l]=T.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
265
|
-
`).replace(`
|
|
266
|
-
|
|
267
|
-
`,`
|
|
268
|
-
+`).split(`
|
|
269
|
-
`)),f=d.reduce((g,h)=>g.concat(...h),[]);return[d,f]}return[[],[]]},[e]);return T.useEffect(()=>{const u=t?.target??n0,d=t?.actInsideInputWithModifier??!0;if(e!==null){const f=m=>{if(i.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!i.current||i.current&&!d)&&mx(m))return!1;const v=o0(m.code,l);if(s.current.add(m[v]),r0(a,s.current,!1)){const b=m.composedPath?.()?.[0]||m.target,S=b?.nodeName==="BUTTON"||b?.nodeName==="A";t.preventDefault!==!1&&(i.current||!S)&&m.preventDefault(),r(!0)}},g=m=>{const x=o0(m.code,l);r0(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(m[x]),m.key==="Meta"&&s.current.clear(),i.current=!1},h=()=>{s.current.clear(),r(!1)};return u?.addEventListener("keydown",f),u?.addEventListener("keyup",g),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{u?.removeEventListener("keydown",f),u?.removeEventListener("keyup",g),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function r0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function o0(e,t){return t.includes(e)?"code":"key"}const OP=()=>{const e=rt();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:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),u=Bd(t,r,i,s,a,n?.padding??.1);return l?(await l.setViewport(u,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:l,y:u}=a.getBoundingClientRect(),d={x:t.x-l,y:t.y-u},f=n.snapGrid??i,g=n.snapToGrid??s;return os(d,r,g,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),a=xc(t,n);return{x:a.x+i,y:a.y+s}}}),[])};function i0(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of t){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const u of a)PP(u,l);n.push(l)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function PP(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 s0(e,t){return i0(e,t)}function ls(e,t){return i0(e,t)}function io(e,t){return{id:e,type:"select",selected:t}}function Ko(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(io(s.id,a)))}return r}function a0({items:e=[],lookup:t}){const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const a=t.get(s.id),l=a?.internals?.userNode??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function c0(e){return{id:e.id,type:"remove"}}const l0=e=>aO(e),RP=e=>ox(e);function u0(e){return T.forwardRef(e)}const LP=typeof window<"u"?T.useLayoutEffect:T.useEffect;function d0(e){const[t,n]=T.useState(BigInt(0)),[r]=T.useState(()=>DP(()=>n(i=>i+BigInt(1))));return LP(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function DP(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const f0=T.createContext(null);function jP({children:e}){const t=rt(),n=T.useCallback(l=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:f,onNodesChange:g,nodeLookup:h,fitViewQueued:m}=t.getState();let x=u;for(const b of l)x=typeof b=="function"?b(x):b;const v=a0({items:x,lookup:h});f&&d(x),v.length>0?g?.(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:S,setNodes:N}=t.getState();b&&N(S)})},[]),r=d0(n),i=T.useCallback(l=>{const{edges:u=[],setEdges:d,hasDefaultEdges:f,onEdgesChange:g,edgeLookup:h}=t.getState();let m=u;for(const x of l)m=typeof x=="function"?x(m):x;f?d(m):g&&g(a0({items:m,lookup:h}))},[]),s=d0(i),a=T.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return y.jsx(f0.Provider,{value:a,children:e})}function $P(){const e=T.useContext(f0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const HP=e=>!!e.panZoom;function Zo(){const e=OP(),t=rt(),n=$P(),r=Fe(HP),i=T.useMemo(()=>{const s=g=>t.getState().nodeLookup.get(g),a=g=>{n.nodeQueue.push(g)},l=g=>{n.edgeQueue.push(g)},u=g=>{const{nodeLookup:h,nodeOrigin:m}=t.getState(),x=l0(g)?g:h.get(g.id),v=x.parentId?px(x.position,x.measured,x.parentId,h,m):x.position,b={...x,position:v,width:x.measured?.width??x.width,height:x.measured?.height??x.height};return Go(b)},d=(g,h,m={replace:!1})=>{a(x=>x.map(v=>{if(v.id===g){const b=typeof h=="function"?h(v):h;return m.replace&&l0(b)?b:{...v,...b}}return v}))},f=(g,h,m={replace:!1})=>{l(x=>x.map(v=>{if(v.id===g){const b=typeof h=="function"?h(v):h;return m.replace&&RP(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>s(g)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(h=>({...h}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:a,setEdges:l,addNodes:g=>{const h=Array.isArray(g)?g:[g];n.nodeQueue.push(m=>[...m,...h])},addEdges:g=>{const h=Array.isArray(g)?g:[g];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:g=[],edges:h=[],transform:m}=t.getState(),[x,v,b]=m;return{nodes:g.map(S=>({...S})),edges:h.map(S=>({...S})),viewport:{x,y:v,zoom:b}}},deleteElements:async({nodes:g=[],edges:h=[]})=>{const{nodes:m,edges:x,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:N,onDelete:w,onBeforeDelete:I}=t.getState(),{nodes:k,edges:A}=await dO({nodesToRemove:g,edgesToRemove:h,nodes:m,edges:x,onBeforeDelete:I}),M=A.length>0,B=k.length>0;if(M){const U=A.map(c0);b?.(A),N(U)}if(B){const U=k.map(c0);v?.(k),S(U)}return(B||M)&&w?.({nodes:k,edges:A}),{deletedNodes:k,deletedEdges:A}},getIntersectingNodes:(g,h=!0,m)=>{const x=ux(g),v=x?g:u(g),b=m!==void 0;return v?(m||t.getState().nodes).filter(S=>{const N=t.getState().nodeLookup.get(S.id);if(N&&!x&&(S.id===g.id||!N.internals.positionAbsolute))return!1;const w=Go(b?S:N),I=ns(w,v);return h&&I>0||I>=w.width*w.height||I>=v.width*v.height}):[]},isNodeIntersecting:(g,h,m=!0)=>{const v=ux(g)?g:u(g);if(!v)return!1;const b=ns(v,h);return m&&b>0||b>=v.width*v.height},updateNode:d,updateNodeData:(g,h,m={replace:!1})=>{d(g,x=>{const v=typeof h=="function"?h(x):h;return m.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},m)},updateEdge:f,updateEdgeData:(g,h,m={replace:!1})=>{f(g,x=>{const v=typeof h=="function"?h(x):h;return m.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},m)},getNodesBounds:g=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return cO(g,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:g,id:h,nodeId:m})=>Array.from(t.getState().connectionLookup.get(`${m}-${g}${h?`-${h}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:h,nodeId:m})=>Array.from(t.getState().connectionLookup.get(`${m}${g?h?`-${g}-${h}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const h=t.getState().fitViewResolver??hO();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return T.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const p0=e=>e.selected,BP=typeof window<"u"?window:void 0;function VP({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=rt(),{deleteElements:r}=Zo(),i=cs(e,{actInsideInputWithModifier:!1}),s=cs(t,{target:BP});T.useEffect(()=>{if(i){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(p0),edges:a.filter(p0)}),n.setState({nodesSelectionActive:!1})}},[i]),T.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function FP(e){const t=rt();T.useEffect(()=>{const n=()=>{if(!e.current)return!1;const r=Vd(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",jt.error004()),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Cc={position:"absolute",width:"100%",height:"100%",top:0,left:0},zP=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function UP({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=no.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:g,zoomActivationKeyCode:h,preventScrolling:m=!0,children:x,noWheelClassName:v,noPanClassName:b,onViewportChange:S,isControlledViewport:N,paneClickDistance:w}){const I=rt(),k=T.useRef(null),{userSelectionActive:A,lib:M}=Fe(zP,ct),B=cs(h),U=T.useRef();FP(k);const q=T.useCallback(D=>{S?.({x:D[0],y:D[1],zoom:D[2]}),N||I.setState({transform:D})},[S,N]);return T.useEffect(()=>{if(k.current){U.current=KO({domNode:k.current,minZoom:f,maxZoom:g,translateExtent:d,viewport:u,paneClickDistance:w,onDraggingChange:E=>I.setState({paneDragging:E}),onPanZoomStart:(E,P)=>{const{onViewportChangeStart:L,onMoveStart:j}=I.getState();j?.(E,P),L?.(P)},onPanZoom:(E,P)=>{const{onViewportChange:L,onMove:j}=I.getState();j?.(E,P),L?.(P)},onPanZoomEnd:(E,P)=>{const{onViewportChangeEnd:L,onMoveEnd:j}=I.getState();j?.(E,P),L?.(P)}});const{x:D,y:$,zoom:F}=U.current.getViewport();return I.setState({panZoom:U.current,transform:[D,$,F],domNode:k.current.closest(".react-flow")}),()=>{U.current?.destroy()}}},[]),T.useEffect(()=>{U.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:B,preventScrolling:m,noPanClassName:b,userSelectionActive:A,noWheelClassName:v,lib:M,onTransformChange:q})},[e,t,n,r,i,s,a,l,B,m,b,A,v,M,q]),y.jsx("div",{className:"react-flow__renderer",ref:k,style:Cc,children:x})}const WP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function GP(){const{userSelectionActive:e,userSelectionRect:t}=Fe(WP,ct);return e&&t?y.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 tf=(e,t)=>n=>{n.target===t.current&&e?.(n)},qP=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function YP({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Uo.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:h,children:m}){const x=rt(),{userSelectionActive:v,elementsSelectable:b,dragging:S,connectionInProgress:N}=Fe(qP,ct),w=b&&(e||v),I=T.useRef(null),k=T.useRef(),A=T.useRef(new Set),M=T.useRef(new Set),B=T.useRef(!1),U=T.useRef(!1),q=j=>{if(B.current||N){B.current=!1;return}l?.(j),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},D=j=>{if(Array.isArray(r)&&r?.includes(2)){j.preventDefault();return}u?.(j)},$=d?j=>d(j):void 0,F=j=>{const{resetSelectedElements:O,domNode:W}=x.getState();if(k.current=W?.getBoundingClientRect(),!b||!e||j.button!==0||j.target!==I.current||!k.current)return;j.target?.setPointerCapture?.(j.pointerId),U.current=!0,B.current=!1;const{x:z,y:Y}=Bn(j.nativeEvent,k.current);O(),x.setState({userSelectionRect:{width:0,height:0,startX:z,startY:Y,x:z,y:Y}}),s?.(j)},E=j=>{const{userSelectionRect:O,transform:W,nodeLookup:z,edgeLookup:Y,connectionLookup:J,triggerNodeChanges:ie,triggerEdgeChanges:ee,defaultEdgeOptions:ce}=x.getState();if(!k.current||!O)return;B.current=!0;const{x:ge,y:Q}=Bn(j.nativeEvent,k.current),{startX:te,startY:ne}=O,oe={startX:te,startY:ne,x:ge<te?ge:te,y:Q<ne?Q:ne,width:Math.abs(ge-te),height:Math.abs(Q-ne)},pe=A.current,le=M.current;A.current=new Set(jd(z,oe,W,n===Uo.Partial,!0).map(me=>me.id)),M.current=new Set;const ve=ce?.selectable??!0;for(const me of A.current){const Oe=J.get(me);if(Oe)for(const{edgeId:Ce}of Oe.values()){const ae=Y.get(Ce);ae&&(ae.selectable??ve)&&M.current.add(Ce)}}if(!hx(pe,A.current)){const me=Ko(z,A.current,!0);ie(me)}if(!hx(le,M.current)){const me=Ko(Y,M.current);ee(me)}x.setState({userSelectionRect:oe,userSelectionActive:!0,nodesSelectionActive:!1})},P=j=>{if(j.button!==0||!U.current)return;j.target?.releasePointerCapture?.(j.pointerId);const{userSelectionRect:O}=x.getState();!v&&O&&j.target===I.current&&q?.(j),x.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:A.current.size>0}),a?.(j),(t||i)&&(B.current=!1),U.current=!1},L=r===!0||Array.isArray(r)&&r.includes(0);return y.jsxs("div",{className:yt(["react-flow__pane",{draggable:L,dragging:S,selection:e}]),onClick:w?void 0:tf(q,I),onContextMenu:tf(D,I),onWheel:tf($,I),onPointerEnter:w?void 0:f,onPointerDown:w?F:g,onPointerMove:w?E:g,onPointerUp:w?P:void 0,onPointerLeave:h,ref:I,style:Cc,children:[m,y.jsx(GP,{})]})}function nf({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:u}=t.getState(),d=l.get(e);if(!d){u?.("012",jt.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function h0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const l=rt(),[u,d]=T.useState(!1),f=T.useRef();return T.useEffect(()=>{f.current=LO({getStoreItems:()=>l.getState(),onNodeMouseDown:g=>{nf({id:g,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),T.useEffect(()=>{if(t)f.current?.destroy();else if(e.current)return f.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a}),()=>{f.current?.destroy()}},[n,r,t,s,e,i]),u}const XP=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function g0(){const e=rt();return T.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:u,nodeLookup:d,nodeOrigin:f}=e.getState(),g=new Map,h=XP(a),m=i?s[0]:5,x=i?s[1]:5,v=n.direction.x*m*n.factor,b=n.direction.y*x*n.factor;for(const[,S]of d){if(!h(S))continue;let N={x:S.internals.positionAbsolute.x+v,y:S.internals.positionAbsolute.y+b};i&&(N=rs(N,s));const{position:w,positionAbsolute:I}=ix({nodeId:S.id,nextPosition:N,nodeLookup:d,nodeExtent:r,nodeOrigin:f,onError:l});S.position=w,S.internals.positionAbsolute=I,g.set(S.id,S)}u(g)},[])}const rf=T.createContext(null),KP=rf.Provider;rf.Consumer;const us=()=>T.useContext(rf),ZP=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),JP=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:l,toHandle:u,isValid:d}=a,f=u?.nodeId===e&&u?.id===t&&u?.type===n;return{connectingFrom:l?.nodeId===e&&l?.id===t&&l?.type===n,connectingTo:f,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:s===zo.Strict?l?.type!==n:e!==l?.nodeId||t!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:f&&d}};function QP({type:e="source",position:t=Ne.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:g,...h},m){const x=a||null,v=e==="target",b=rt(),S=us(),{connectOnClick:N,noPanClassName:w,rfId:I}=Fe(ZP,ct),{connectingFrom:k,connectingTo:A,clickConnecting:M,isPossibleEndHandle:B,connectionInProcess:U,clickConnectionInProcess:q,valid:D}=Fe(JP(S,x,e),ct);S||b.getState().onError?.("010",jt.error010());const $=P=>{const{defaultEdgeOptions:L,onConnect:j,hasDefaultEdges:O}=b.getState(),W={...L,...P};if(O){const{edges:z,setEdges:Y}=b.getState();Y(Sx(W,z))}j?.(W),l?.(W)},F=P=>{if(!S)return;const L=yx(P.nativeEvent);if(i&&(L&&P.button===0||!L)){const j=b.getState();Kd.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:v,handleId:x,nodeId:S,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:j.onConnectEnd,updateConnection:j.updateConnection,onConnect:$,isValidConnection:n||j.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}L?f?.(P):g?.(P)},E=P=>{const{onClickConnectStart:L,onClickConnectEnd:j,connectionClickStartHandle:O,connectionMode:W,isValidConnection:z,lib:Y,rfId:J,nodeLookup:ie,connection:ee}=b.getState();if(!S||!O&&!i)return;if(!O){L?.(P.nativeEvent,{nodeId:S,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:x}});return}const ce=gx(P.target),ge=n||z,{connection:Q,isValid:te}=Kd.isValid(P.nativeEvent,{handle:{nodeId:S,id:x,type:e},connectionMode:W,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:ge,flowId:J,doc:ce,lib:Y,nodeLookup:ie});te&&Q&&$(Q);const ne=structuredClone(ee);delete ne.inProgress,ne.toPosition=ne.toHandle?ne.toHandle.position:null,j?.(P,ne),b.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":x,"data-nodeid":S,"data-handlepos":t,"data-id":`${I}-${S}-${x}-${e}`,className:yt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,d,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:s,clickconnecting:M,connectingfrom:k,connectingto:A,valid:D,connectionindicator:r&&(!U||B)&&(U||q?s:i)}]),onMouseDown:F,onTouchStart:F,onClick:N?E:void 0,ref:m,...h,children:u})}const ds=T.memo(u0(QP));function eR({data:e,isConnectable:t,sourcePosition:n=Ne.Bottom}){return y.jsxs(y.Fragment,{children:[e?.label,y.jsx(ds,{type:"source",position:n,isConnectable:t})]})}function tR({data:e,isConnectable:t,targetPosition:n=Ne.Top,sourcePosition:r=Ne.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(ds,{type:"target",position:n,isConnectable:t}),e?.label,y.jsx(ds,{type:"source",position:r,isConnectable:t})]})}function nR(){return null}function rR({data:e,isConnectable:t,targetPosition:n=Ne.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(ds,{type:"target",position:n,isConnectable:t}),e?.label]})}const Ac={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},m0={input:eR,default:tR,output:rR,group:nR};function oR(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 iR=e=>{const{width:t,height:n,x:r,y:i}=ts(e.nodeLookup,{filter:s=>!!s.selected});return{width:Nn(t)?t:null,height:Nn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function sR({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=rt(),{width:i,height:s,transformString:a,userSelectionActive:l}=Fe(iR,ct),u=g0(),d=T.useRef(null);if(T.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),h0({nodeRef:d}),l||!i||!s)return null;const f=e?h=>{const m=r.getState().nodes.filter(x=>x.selected);e(h,m)}:void 0,g=h=>{Object.prototype.hasOwnProperty.call(Ac,h.key)&&(h.preventDefault(),u({direction:Ac[h.key],factor:h.shiftKey?4:1}))};return y.jsx("div",{className:yt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:y.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:s}})})}const y0=typeof window<"u"?window:void 0,aR=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function v0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:g,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:w,panOnScroll:I,panOnScrollSpeed:k,panOnScrollMode:A,zoomOnDoubleClick:M,panOnDrag:B,defaultViewport:U,translateExtent:q,minZoom:D,maxZoom:$,preventScrolling:F,onSelectionContextMenu:E,noWheelClassName:P,noPanClassName:L,disableKeyboardA11y:j,onViewportChange:O,isControlledViewport:W}){const{nodesSelectionActive:z,userSelectionActive:Y}=Fe(aR),J=cs(d,{target:y0}),ie=cs(v,{target:y0}),ee=ie||B,ce=ie||I,ge=f&&ee!==!0,Q=J||Y||ge;return VP({deleteKeyCode:u,multiSelectionKeyCode:x}),y.jsx(UP,{onPaneContextMenu:s,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:w,panOnScroll:ce,panOnScrollSpeed:k,panOnScrollMode:A,zoomOnDoubleClick:M,panOnDrag:!J&&ee,defaultViewport:U,translateExtent:q,minZoom:D,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:F,noWheelClassName:P,noPanClassName:L,onViewportChange:O,isControlledViewport:W,paneClickDistance:l,children:y.jsxs(YP,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:ee,isSelecting:!!Q,selectionMode:g,selectionKeyPressed:J,selectionOnDrag:ge,children:[e,z&&y.jsx(sR,{onSelectionContextMenu:E,noPanClassName:L,disableKeyboardA11y:j})]})})}v0.displayName="FlowRenderer";const cR=T.memo(v0),lR=e=>t=>e?jd(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 uR(e){return Fe(T.useCallback(lR(e),[e]),ct)}const dR=e=>e.updateNodeInternals;function fR(){const e=Fe(dR),[t]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{t?.disconnect()},[t]),t}function pR({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=rt(),s=T.useRef(null),a=T.useRef(null),l=T.useRef(e.sourcePosition),u=T.useRef(e.targetPosition),d=T.useRef(t),f=n&&!!e.internals.handleBounds;return T.useEffect(()=>{s.current&&!e.hidden&&(!f||a.current!==s.current)&&(a.current&&r?.unobserve(a.current),r?.observe(s.current),a.current=s.current)},[f,e.hidden]),T.useEffect(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),T.useEffect(()=>{if(s.current){const g=d.current!==t,h=l.current!==e.sourcePosition,m=u.current!==e.targetPosition;(g||h||m)&&(d.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function hR({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:f,resizeObserver:g,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:x,rfId:v,nodeTypes:b,nodeClickDistance:S,onError:N}){const{node:w,internals:I,isParent:k}=Fe(te=>{const ne=te.nodeLookup.get(e),oe=te.parentLookup.has(e);return{node:ne,internals:ne.internals,isParent:oe}},ct);let A=w.type||"default",M=b?.[A]||m0[A];M===void 0&&(N?.("003",jt.error003(A)),A="default",M=b?.default||m0.default);const B=!!(w.draggable||l&&typeof w.draggable>"u"),U=!!(w.selectable||u&&typeof w.selectable>"u"),q=!!(w.connectable||d&&typeof w.connectable>"u"),D=!!(w.focusable||f&&typeof w.focusable>"u"),$=rt(),F=fx(w),E=pR({node:w,nodeType:A,hasDimensions:F,resizeObserver:g}),P=h0({nodeRef:E,disabled:w.hidden||!B,noDragClassName:h,handleSelector:w.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:S}),L=g0();if(w.hidden)return null;const j=rr(w),O=oR(w),W=U||B||t||n||r||i,z=n?te=>n(te,{...I.userNode}):void 0,Y=r?te=>r(te,{...I.userNode}):void 0,J=i?te=>i(te,{...I.userNode}):void 0,ie=s?te=>s(te,{...I.userNode}):void 0,ee=a?te=>a(te,{...I.userNode}):void 0,ce=te=>{const{selectNodesOnDrag:ne,nodeDragThreshold:oe}=$.getState();U&&(!ne||!B||oe>0)&&nf({id:e,store:$,nodeRef:E}),t&&t(te,{...I.userNode})},ge=te=>{if(!(mx(te.nativeEvent)||x)){if(Jv.includes(te.key)&&U){const ne=te.key==="Escape";nf({id:e,store:$,unselect:ne,nodeRef:E})}else if(B&&w.selected&&Object.prototype.hasOwnProperty.call(Ac,te.key)){te.preventDefault();const{ariaLabelConfig:ne}=$.getState();$.setState({ariaLiveMessage:ne["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~I.positionAbsolute.x,y:~~I.positionAbsolute.y})}),L({direction:Ac[te.key],factor:te.shiftKey?4:1})}}},Q=()=>{if(x||!E.current?.matches(":focus-visible"))return;const{transform:te,width:ne,height:oe,autoPanOnNodeFocus:pe,setCenter:le}=$.getState();if(!pe)return;jd(new Map([[e,w]]),{x:0,y:0,width:ne,height:oe},te,!0).length>0||le(w.position.x+j.width/2,w.position.y+j.height/2,{zoom:te[2]})};return y.jsx("div",{className:yt(["react-flow__node",`react-flow__node-${A}`,{[m]:B},w.className,{selected:w.selected,selectable:U,parent:k,draggable:B,dragging:P}]),ref:E,style:{zIndex:I.z,transform:`translate(${I.positionAbsolute.x}px,${I.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:F?"visible":"hidden",...w.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:Y,onMouseLeave:J,onContextMenu:ie,onClick:ce,onDoubleClick:ee,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,onFocus:D?Q:void 0,role:w.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${Kx}-${v}`,"aria-label":w.ariaLabel,...w.domAttributes,children:y.jsx(KP,{value:e,children:y.jsx(M,{id:e,data:w.data,type:A,positionAbsoluteX:I.positionAbsolute.x,positionAbsoluteY:I.positionAbsolute.y,selected:w.selected??!1,selectable:U,draggable:B,deletable:w.deletable??!0,isConnectable:q,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:P,dragHandle:w.dragHandle,zIndex:I.z,parentId:w.parentId,...j})})})}const gR=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function x0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=Fe(gR,ct),a=uR(e.onlyRenderVisibleElements),l=fR();return y.jsx("div",{className:"react-flow__nodes",style:Cc,children:a.map(u=>y.jsx(hR,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:s},u))})}x0.displayName="NodeRenderer";const mR=T.memo(x0);function yR(e){return Fe(T.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&vO({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ct)}const vR=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xR=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},w0={[hc.Arrow]:vR,[hc.ArrowClosed]:xR};function wR(e){const t=rt();return T.useMemo(()=>Object.prototype.hasOwnProperty.call(w0,e)?w0[e]:(t.getState().onError?.("009",jt.error009(e)),null),[e])}const bR=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const u=wR(t);return u?y.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:y.jsx(u,{color:n,strokeWidth:a})}):null},b0=({defaultColor:e,rfId:t})=>{const n=Fe(s=>s.edges),r=Fe(s=>s.defaultEdgeOptions),i=T.useMemo(()=>IO(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:i.map(s=>y.jsx(bR,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};b0.displayName="MarkerDefinitions";var SR=T.memo(b0);function S0({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...f}){const[g,h]=T.useState({x:1,y:0,width:0,height:0}),m=yt(["react-flow__edge-textwrapper",d]),x=T.useRef(null);return T.useEffect(()=>{if(x.current){const v=x.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?y.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:m,visibility:g.width?"visible":"hidden",...f,children:[i&&y.jsx("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),y.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:x,style:r,children:n}),u]}):null}S0.displayName="EdgeText";const _R=T.memo(S0);function Jo({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:d=20,...f}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...f,d:e,fill:"none",className:yt(["react-flow__edge-path",f.className])}),d?y.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Nn(t)&&Nn(n)?y.jsx(_R,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function _0({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ne.Left||e===Ne.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function N0({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:i,targetPosition:s=Ne.Top}){const[a,l]=_0({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,d]=_0({pos:s,x1:r,y1:i,x2:e,y2:t}),[f,g,h,m]=xx({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${r},${i}`,f,g,h,m]}function I0(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:g,labelBgPadding:h,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:S})=>{const[N,w,I]=N0({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return y.jsx(Jo,{id:k,path:N,labelX:w,labelY:I,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:g,labelBgPadding:h,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:S})})}const NR=I0({isInternal:!1}),E0=I0({isInternal:!0});NR.displayName="SimpleBezierEdge",E0.displayName="SimpleBezierEdgeInternal";function T0(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:h,sourcePosition:m=Ne.Bottom,targetPosition:x=Ne.Top,markerEnd:v,markerStart:b,pathOptions:S,interactionWidth:N})=>{const[w,I,k]=Fd({sourceX:n,sourceY:r,sourcePosition:m,targetX:i,targetY:s,targetPosition:x,borderRadius:S?.borderRadius,offset:S?.offset,stepPosition:S?.stepPosition}),A=e.isInternal?void 0:t;return y.jsx(Jo,{id:A,path:w,labelX:I,labelY:k,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:h,markerEnd:v,markerStart:b,interactionWidth:N})})}const C0=T0({isInternal:!1}),A0=T0({isInternal:!0});C0.displayName="SmoothStepEdge",A0.displayName="SmoothStepEdgeInternal";function k0(e){return T.memo(({id:t,...n})=>{const r=e.isInternal?void 0:t;return y.jsx(C0,{...n,id:r,pathOptions:T.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const IR=k0({isInternal:!1}),M0=k0({isInternal:!0});IR.displayName="StepEdge",M0.displayName="StepEdgeInternal";function O0(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:h,markerEnd:m,markerStart:x,interactionWidth:v})=>{const[b,S,N]=_x({sourceX:n,sourceY:r,targetX:i,targetY:s}),w=e.isInternal?void 0:t;return y.jsx(Jo,{id:w,path:b,labelX:S,labelY:N,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:h,markerEnd:m,markerStart:x,interactionWidth:v})})}const ER=O0({isInternal:!1}),P0=O0({isInternal:!0});ER.displayName="StraightEdge",P0.displayName="StraightEdgeInternal";function R0(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=Ne.Bottom,targetPosition:l=Ne.Top,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:g,labelBgPadding:h,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,pathOptions:S,interactionWidth:N})=>{const[w,I,k]=bc({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l,curvature:S?.curvature}),A=e.isInternal?void 0:t;return y.jsx(Jo,{id:A,path:w,labelX:I,labelY:k,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:g,labelBgPadding:h,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:N})})}const TR=R0({isInternal:!1}),L0=R0({isInternal:!0});TR.displayName="BezierEdge",L0.displayName="BezierEdgeInternal";const D0={default:L0,straight:P0,step:M0,smoothstep:A0,simplebezier:E0},j0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},CR=(e,t,n)=>n===Ne.Left?e-t:n===Ne.Right?e+t:e,AR=(e,t,n)=>n===Ne.Top?e-t:n===Ne.Bottom?e+t:e,$0="react-flow__edgeupdater";function H0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:l}){return y.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:yt([$0,`${$0}-${l}`]),cx:CR(t,r,e),cy:AR(n,r,e),r,stroke:"transparent",fill:"transparent"})}function kR({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,setReconnecting:h,setUpdateHover:m}){const x=rt(),v=(I,k)=>{if(I.button!==0)return;const{autoPanOnConnect:A,domNode:M,isValidConnection:B,connectionMode:U,connectionRadius:q,lib:D,onConnectStart:$,onConnectEnd:F,cancelConnection:E,nodeLookup:P,rfId:L,panBy:j,updateConnection:O}=x.getState(),W=k.type==="target",z=(ie,ee)=>{h(!1),g?.(ie,n,k.type,ee)},Y=ie=>d?.(n,ie),J=(ie,ee)=>{h(!0),f?.(I,n,k.type),$?.(ie,ee)};Kd.onPointerDown(I.nativeEvent,{autoPanOnConnect:A,connectionMode:U,connectionRadius:q,domNode:M,handleId:k.id,nodeId:k.nodeId,nodeLookup:P,isTarget:W,edgeUpdaterType:k.type,lib:D,flowId:L,cancelConnection:E,panBy:j,isValidConnection:B,onConnect:Y,onConnectStart:J,onConnectEnd:F,onReconnectEnd:z,updateConnection:O,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:I.currentTarget})},b=I=>v(I,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=I=>v(I,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>m(!0),w=()=>m(!1);return y.jsxs(y.Fragment,{children:[(e===!0||e==="source")&&y.jsx(H0,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:N,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&y.jsx(H0,{position:u,centerX:s,centerY:a,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:w,type:"target"})]})}function MR({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:f,onReconnect:g,onReconnectStart:h,onReconnectEnd:m,rfId:x,edgeTypes:v,noPanClassName:b,onError:S,disableKeyboardA11y:N}){let w=Fe(le=>le.edgeLookup.get(e));const I=Fe(le=>le.defaultEdgeOptions);w=I?{...I,...w}:w;let k=w.type||"default",A=v?.[k]||D0[k];A===void 0&&(S?.("011",jt.error011(k)),k="default",A=v?.default||D0.default);const M=!!(w.focusable||t&&typeof w.focusable>"u"),B=typeof g<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),U=!!(w.selectable||r&&typeof w.selectable>"u"),q=T.useRef(null),[D,$]=T.useState(!1),[F,E]=T.useState(!1),P=rt(),{zIndex:L,sourceX:j,sourceY:O,targetX:W,targetY:z,sourcePosition:Y,targetPosition:J}=Fe(T.useCallback(le=>{const ve=le.nodeLookup.get(w.source),me=le.nodeLookup.get(w.target);if(!ve||!me)return{zIndex:w.zIndex,...j0};const Oe=NO({id:e,sourceNode:ve,targetNode:me,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:le.connectionMode,onError:S});return{zIndex:yO({selected:w.selected,zIndex:w.zIndex,sourceNode:ve,targetNode:me,elevateOnSelect:le.elevateEdgesOnSelect}),...Oe||j0}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),ct),ie=T.useMemo(()=>w.markerStart?`url('#${zd(w.markerStart,x)}')`:void 0,[w.markerStart,x]),ee=T.useMemo(()=>w.markerEnd?`url('#${zd(w.markerEnd,x)}')`:void 0,[w.markerEnd,x]);if(w.hidden||j===null||O===null||W===null||z===null)return null;const ce=le=>{const{addSelectedEdges:ve,unselectNodesAndEdges:me,multiSelectionActive:Oe}=P.getState();U&&(P.setState({nodesSelectionActive:!1}),w.selected&&Oe?(me({nodes:[],edges:[w]}),q.current?.blur()):ve([e])),i&&i(le,w)},ge=s?le=>{s(le,{...w})}:void 0,Q=a?le=>{a(le,{...w})}:void 0,te=l?le=>{l(le,{...w})}:void 0,ne=u?le=>{u(le,{...w})}:void 0,oe=d?le=>{d(le,{...w})}:void 0,pe=le=>{if(!N&&Jv.includes(le.key)&&U){const{unselectNodesAndEdges:ve,addSelectedEdges:me}=P.getState();le.key==="Escape"?(q.current?.blur(),ve({edges:[w]})):me([e])}};return y.jsx("svg",{style:{zIndex:L},children:y.jsxs("g",{className:yt(["react-flow__edge",`react-flow__edge-${k}`,w.className,b,{selected:w.selected,animated:w.animated,inactive:!U&&!i,updating:D,selectable:U}]),onClick:ce,onDoubleClick:ge,onContextMenu:Q,onMouseEnter:te,onMouseMove:ne,onMouseLeave:oe,onKeyDown:M?pe:void 0,tabIndex:M?0:void 0,role:w.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":M?`${Zx}-${x}`:void 0,ref:q,...w.domAttributes,children:[!F&&y.jsx(A,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:U,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:j,sourceY:O,targetX:W,targetY:z,sourcePosition:Y,targetPosition:J,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ie,markerEnd:ee,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),B&&y.jsx(kR,{edge:w,isReconnectable:B,reconnectRadius:f,onReconnect:g,onReconnectStart:h,onReconnectEnd:m,sourceX:j,sourceY:O,targetX:W,targetY:z,sourcePosition:Y,targetPosition:J,setUpdateHover:$,setReconnecting:E})]})})}const OR=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function B0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:g,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:N,onError:w}=Fe(OR,ct),I=yR(t);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(SR,{defaultColor:e,rfId:n}),I.map(k=>y.jsx(MR,{id:k,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:N,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:f,reconnectRadius:g,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:x,rfId:n,onError:w,edgeTypes:r,disableKeyboardA11y:v},k))]})}B0.displayName="EdgeRenderer";const PR=T.memo(B0),RR=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LR({children:e}){const t=Fe(RR);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function DR(e){const t=Zo(),n=T.useRef(!1);T.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const jR=e=>e.panZoom?.syncViewport;function $R(e){const t=Fe(jR),n=rt();return T.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function HR(e){return e.connection.inProgress?{...e.connection,to:os(e.connection.to,e.transform)}:{...e.connection}}function BR(e){return HR}function V0(e){const t=BR();return Fe(t,ct)}const VR=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function FR({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:l,inProgress:u}=Fe(VR,ct);return!(s&&i&&u)?null:y.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:yt(["react-flow__connection",rx(l)]),children:y.jsx(F0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const F0=({style:e,type:t=_r.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:l,fromPosition:u,to:d,toNode:f,toHandle:g,toPosition:h}=V0();if(!i)return;if(n)return y.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:h,connectionStatus:rx(r),toNode:f,toHandle:g});let m="";const x={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:h};switch(t){case _r.Bezier:[m]=bc(x);break;case _r.SimpleBezier:[m]=N0(x);break;case _r.Step:[m]=Fd({...x,borderRadius:0});break;case _r.SmoothStep:[m]=Fd(x);break;default:[m]=_x(x)}return y.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};F0.displayName="ConnectionLine";const zR={};function z0(e=zR){const t=T.useRef(e),n=rt();T.useEffect(()=>{if(process.env.NODE_ENV==="development"){const r=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const i of r)if(t.current[i]!==e[i]){n.getState().onError?.("002",jt.error002());break}t.current=e}},[e])}function UR(){const e=rt(),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",jt.error013("react")),t.current=!0}},[])}function U0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:g,onSelectionStart:h,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:N,selectionOnDrag:w,selectionMode:I,multiSelectionKeyCode:k,panActivationKeyCode:A,zoomActivationKeyCode:M,deleteKeyCode:B,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:D,translateExtent:$,minZoom:F,maxZoom:E,preventScrolling:P,defaultMarkerColor:L,zoomOnScroll:j,zoomOnPinch:O,panOnScroll:W,panOnScrollSpeed:z,panOnScrollMode:Y,zoomOnDoubleClick:J,panOnDrag:ie,onPaneClick:ee,onPaneMouseEnter:ce,onPaneMouseMove:ge,onPaneMouseLeave:Q,onPaneScroll:te,onPaneContextMenu:ne,paneClickDistance:oe,nodeClickDistance:pe,onEdgeContextMenu:le,onEdgeMouseEnter:ve,onEdgeMouseMove:me,onEdgeMouseLeave:Oe,reconnectRadius:Ce,onReconnect:ae,onReconnectStart:Ie,onReconnectEnd:Be,noDragClassName:Qe,noWheelClassName:Ue,noPanClassName:Ze,disableKeyboardA11y:pt,nodeExtent:Cn,rfId:cn,viewport:Nt,onViewportChange:$t}){return z0(e),z0(t),UR(),DR(n),$R(Nt),y.jsx(cR,{onPaneClick:ee,onPaneMouseEnter:ce,onPaneMouseMove:ge,onPaneMouseLeave:Q,onPaneContextMenu:ne,onPaneScroll:te,paneClickDistance:oe,deleteKeyCode:B,selectionKeyCode:N,selectionOnDrag:w,selectionMode:I,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:A,zoomActivationKeyCode:M,elementsSelectable:q,zoomOnScroll:j,zoomOnPinch:O,zoomOnDoubleClick:J,panOnScroll:W,panOnScrollSpeed:z,panOnScrollMode:Y,panOnDrag:ie,defaultViewport:D,translateExtent:$,minZoom:F,maxZoom:E,onSelectionContextMenu:g,preventScrolling:P,noDragClassName:Qe,noWheelClassName:Ue,noPanClassName:Ze,disableKeyboardA11y:pt,onViewportChange:$t,isControlledViewport:!!Nt,children:y.jsxs(LR,{children:[y.jsx(PR,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:ae,onReconnectStart:Ie,onReconnectEnd:Be,onlyRenderVisibleElements:U,onEdgeContextMenu:le,onEdgeMouseEnter:ve,onEdgeMouseMove:me,onEdgeMouseLeave:Oe,reconnectRadius:Ce,defaultMarkerColor:L,noPanClassName:Ze,disableKeyboardA11y:pt,rfId:cn}),y.jsx(FR,{style:v,type:x,component:b,containerStyle:S}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(mR,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:pe,onlyRenderVisibleElements:U,noPanClassName:Ze,noDragClassName:Qe,disableKeyboardA11y:pt,nodeExtent:Cn,rfId:cn}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}U0.displayName="GraphView";const WR=T.memo(U0),W0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u=.5,maxZoom:d=2,nodeOrigin:f,nodeExtent:g}={})=>{const h=new Map,m=new Map,x=new Map,v=new Map,b=r??t??[],S=n??e??[],N=f??[0,0],w=g??Ji;Mx(x,v,b);const I=Gd(S,h,m,{nodeOrigin:N,nodeExtent:w,elevateNodesOnSelect:!1});let k=[0,0,1];if(a&&i&&s){const A=ts(h,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:M,y:B,zoom:U}=Bd(A,i,s,u,d,l?.padding??.1);k=[M,B,U]}return{rfId:"1",width:0,height:0,transform:k,nodes:S,nodesInitialized:I,nodeLookup:h,parentLookup:m,edges:b,edgeLookup:v,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:Ji,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:zo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...ex},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:dx,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Qv}},GR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:g})=>hP((h,m)=>{async function x(){const{nodeLookup:v,panZoom:b,fitViewOptions:S,fitViewResolver:N,width:w,height:I,minZoom:k,maxZoom:A}=m();b&&(await uO({nodes:v,width:w,height:I,panZoom:b,minZoom:k,maxZoom:A},S),N?.resolve(!0),h({fitViewResolver:null}))}return{...W0({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:g,defaultNodes:n,defaultEdges:r}),setNodes:v=>{const{nodeLookup:b,parentLookup:S,nodeOrigin:N,elevateNodesOnSelect:w,fitViewQueued:I}=m(),k=Gd(v,b,S,{nodeOrigin:N,nodeExtent:g,elevateNodesOnSelect:w,checkEquality:!0});I&&k?(x(),h({nodes:v,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:v,nodesInitialized:k})},setEdges:v=>{const{connectionLookup:b,edgeLookup:S}=m();Mx(b,S,v),h({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:S}=m();S(v),h({hasDefaultNodes:!0})}if(b){const{setEdges:S}=m();S(b),h({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:S,parentLookup:N,domNode:w,nodeOrigin:I,nodeExtent:k,debug:A,fitViewQueued:M}=m(),{changes:B,updatedInternals:U}=kO(v,S,N,w,I,k);U&&(TO(S,N,{nodeOrigin:I,nodeExtent:k}),M?(x(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),B?.length>0&&(A&&console.log("React Flow: trigger node changes",B),b?.(B)))},updateNodePositions:(v,b=!1)=>{const S=[],N=[],{nodeLookup:w,triggerNodeChanges:I}=m();for(const[k,A]of v){const M=w.get(k),B=!!(M?.expandParent&&M?.parentId&&A?.position),U={id:k,type:"position",position:B?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:b};B&&M.parentId&&S.push({id:k,parentId:M.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),N.push(U)}if(S.length>0){const{parentLookup:k,nodeOrigin:A}=m(),M=Yd(S,w,k,A);N.push(...M)}I(N)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:S,nodes:N,hasDefaultNodes:w,debug:I}=m();if(v?.length){if(w){const k=s0(v,N);S(k)}I&&console.log("React Flow: trigger node changes",v),b?.(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:S,edges:N,hasDefaultEdges:w,debug:I}=m();if(v?.length){if(w){const k=ls(v,N);S(k)}I&&console.log("React Flow: trigger edge changes",v),b?.(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:S,nodeLookup:N,triggerNodeChanges:w,triggerEdgeChanges:I}=m();if(b){const k=v.map(A=>io(A,!0));w(k);return}w(Ko(N,new Set([...v]),!0)),I(Ko(S))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:S,nodeLookup:N,triggerNodeChanges:w,triggerEdgeChanges:I}=m();if(b){const k=v.map(A=>io(A,!0));I(k);return}I(Ko(S,new Set([...v]))),w(Ko(N,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:S,nodes:N,nodeLookup:w,triggerNodeChanges:I,triggerEdgeChanges:k}=m(),A=v||N,M=b||S,B=A.map(q=>{const D=w.get(q.id);return D&&(D.selected=!1),io(q.id,!1)}),U=M.map(q=>io(q.id,!1));I(B),k(U)},setMinZoom:v=>{const{panZoom:b,maxZoom:S}=m();b?.setScaleExtent([v,S]),h({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:S}=m();b?.setScaleExtent([S,v]),h({maxZoom:v})},setTranslateExtent:v=>{m().panZoom?.setTranslateExtent(v),h({translateExtent:v})},setPaneClickDistance:v=>{m().panZoom?.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:S,triggerEdgeChanges:N,elementsSelectable:w}=m();if(!w)return;const I=b.reduce((A,M)=>M.selected?[...A,io(M.id,!1)]:A,[]),k=v.reduce((A,M)=>M.selected?[...A,io(M.id,!1)]:A,[]);S(I),N(k)},setNodeExtent:v=>{const{nodes:b,nodeLookup:S,parentLookup:N,nodeOrigin:w,elevateNodesOnSelect:I,nodeExtent:k}=m();v[0][0]===k[0][0]&&v[0][1]===k[0][1]&&v[1][0]===k[1][0]&&v[1][1]===k[1][1]||(Gd(b,S,N,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:I,checkEquality:!1}),h({nodeExtent:v}))},panBy:v=>{const{transform:b,width:S,height:N,panZoom:w,translateExtent:I}=m();return MO({delta:v,panZoom:w,transform:b,translateExtent:I,width:S,height:N})},setCenter:async(v,b,S)=>{const{width:N,height:w,maxZoom:I,panZoom:k}=m();if(!k)return Promise.resolve(!1);const A=typeof S?.zoom<"u"?S.zoom:I;return await k.setViewport({x:N/2-v*A,y:w/2-b*A,zoom:A},{duration:S?.duration,ease:S?.ease,interpolate:S?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...ex}})},updateConnection:v=>{h({connection:v})},reset:()=>h({...W0()})}},Object.is);function G0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:f,nodeExtent:g,children:h}){const[m]=T.useState(()=>GR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:d,minZoom:a,maxZoom:l,fitViewOptions:u,nodeOrigin:f,nodeExtent:g}));return y.jsx(gP,{value:m,children:y.jsx(jP,{children:h})})}function qR({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:h}){return T.useContext(Ic)?y.jsx(y.Fragment,{children:e}):y.jsx(G0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:g,nodeExtent:h,children:e})}const YR={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function XR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:g,onMoveEnd:h,onConnect:m,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:N,onNodeMouseMove:w,onNodeMouseLeave:I,onNodeContextMenu:k,onNodeDoubleClick:A,onNodeDragStart:M,onNodeDrag:B,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:D,onDelete:$,onSelectionChange:F,onSelectionDragStart:E,onSelectionDrag:P,onSelectionDragStop:L,onSelectionContextMenu:j,onSelectionStart:O,onSelectionEnd:W,onBeforeDelete:z,connectionMode:Y,connectionLineType:J=_r.Bezier,connectionLineStyle:ie,connectionLineComponent:ee,connectionLineContainerStyle:ce,deleteKeyCode:ge="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:te=!1,selectionMode:ne=Uo.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:pe=is()?"Meta":"Control",zoomActivationKeyCode:le=is()?"Meta":"Control",snapToGrid:ve,snapGrid:me,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:Ce,nodesDraggable:ae,autoPanOnNodeFocus:Ie,nodesConnectable:Be,nodesFocusable:Qe,nodeOrigin:Ue=Jx,edgesFocusable:Ze,edgesReconnectable:pt,elementsSelectable:Cn=!0,defaultViewport:cn=CP,minZoom:Nt=.5,maxZoom:$t=2,translateExtent:ln=Ji,preventScrolling:Or=!0,nodeExtent:Un,defaultMarkerColor:fo="#b1b1b7",zoomOnScroll:po=!0,zoomOnPinch:Pr=!0,panOnScroll:Ps=!1,panOnScrollSpeed:Rs=.5,panOnScrollMode:Ls=no.Free,zoomOnDoubleClick:Ds=!0,panOnDrag:op=!0,onPaneClick:ip,onPaneMouseEnter:sp,onPaneMouseMove:rl,onPaneMouseLeave:ol,onPaneScroll:ap,onPaneContextMenu:cp,paneClickDistance:il=0,nodeClickDistance:lp=0,children:sl,onReconnect:up,onReconnectStart:dp,onReconnectEnd:fp,onEdgeContextMenu:js,onEdgeDoubleClick:pp,onEdgeMouseEnter:$s,onEdgeMouseMove:hp,onEdgeMouseLeave:gp,reconnectRadius:mp=10,onNodesChange:yp,onEdgesChange:vp,noDragClassName:xp="nodrag",noWheelClassName:wp="nowheel",noPanClassName:al="nopan",fitView:Hs,fitViewOptions:cl,connectOnClick:bp,attributionPosition:Sp,proOptions:_p,defaultEdgeOptions:Np,elevateNodesOnSelect:Ip,elevateEdgesOnSelect:si,disableKeyboardA11y:ll=!1,autoPanOnConnect:ai,autoPanOnNodeDrag:Ep,autoPanSpeed:Tp,connectionRadius:Cp,isValidConnection:ul,onError:dl,style:fl,id:pl,nodeDragThreshold:Ap,connectionDragThreshold:kp,viewport:Mp,onViewportChange:hl,width:gl,height:ml,colorMode:Bs="light",debug:Op,onScroll:Vs,ariaLabelConfig:ci,...yl},Pp){const li=pl||"1",vl=MP(Bs),Fs=T.useCallback(xl=>{xl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vs?.(xl)},[Vs]);return y.jsx("div",{"data-testid":"rf__wrapper",...yl,onScroll:Fs,style:{...fl,...YR},ref:Pp,className:yt(["react-flow",i,vl]),id:pl,role:"application",children:y.jsxs(qR,{nodes:e,edges:t,width:gl,height:ml,fitView:Hs,fitViewOptions:cl,minZoom:Nt,maxZoom:$t,nodeOrigin:Ue,nodeExtent:Un,children:[y.jsx(WR,{onInit:d,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:N,onNodeMouseMove:w,onNodeMouseLeave:I,onNodeContextMenu:k,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:a,connectionLineType:J,connectionLineStyle:ie,connectionLineComponent:ee,connectionLineContainerStyle:ce,selectionKeyCode:Q,selectionOnDrag:te,selectionMode:ne,deleteKeyCode:ge,multiSelectionKeyCode:pe,panActivationKeyCode:oe,zoomActivationKeyCode:le,onlyRenderVisibleElements:Oe,defaultViewport:cn,translateExtent:ln,minZoom:Nt,maxZoom:$t,preventScrolling:Or,zoomOnScroll:po,zoomOnPinch:Pr,zoomOnDoubleClick:Ds,panOnScroll:Ps,panOnScrollSpeed:Rs,panOnScrollMode:Ls,panOnDrag:op,onPaneClick:ip,onPaneMouseEnter:sp,onPaneMouseMove:rl,onPaneMouseLeave:ol,onPaneScroll:ap,onPaneContextMenu:cp,paneClickDistance:il,nodeClickDistance:lp,onSelectionContextMenu:j,onSelectionStart:O,onSelectionEnd:W,onReconnect:up,onReconnectStart:dp,onReconnectEnd:fp,onEdgeContextMenu:js,onEdgeDoubleClick:pp,onEdgeMouseEnter:$s,onEdgeMouseMove:hp,onEdgeMouseLeave:gp,reconnectRadius:mp,defaultMarkerColor:fo,noDragClassName:xp,noWheelClassName:wp,noPanClassName:al,rfId:li,disableKeyboardA11y:ll,nodeExtent:Un,viewport:Mp,onViewportChange:hl}),y.jsx(kP,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:ae,autoPanOnNodeFocus:Ie,nodesConnectable:Be,nodesFocusable:Qe,edgesFocusable:Ze,edgesReconnectable:pt,elementsSelectable:Cn,elevateNodesOnSelect:Ip,elevateEdgesOnSelect:si,minZoom:Nt,maxZoom:$t,nodeExtent:Un,onNodesChange:yp,onEdgesChange:vp,snapToGrid:ve,snapGrid:me,connectionMode:Y,translateExtent:ln,connectOnClick:bp,defaultEdgeOptions:Np,fitView:Hs,fitViewOptions:cl,onNodesDelete:q,onEdgesDelete:D,onDelete:$,onNodeDragStart:M,onNodeDrag:B,onNodeDragStop:U,onSelectionDrag:P,onSelectionDragStart:E,onSelectionDragStop:L,onMove:f,onMoveStart:g,onMoveEnd:h,noPanClassName:al,nodeOrigin:Ue,rfId:li,autoPanOnConnect:ai,autoPanOnNodeDrag:Ep,autoPanSpeed:Tp,onError:dl,connectionRadius:Cp,isValidConnection:ul,selectNodesOnDrag:Ce,nodeDragThreshold:Ap,connectionDragThreshold:kp,onBeforeDelete:z,paneClickDistance:il,debug:Op,ariaLabelConfig:ci}),y.jsx(TP,{onSelectionChange:F}),sl,y.jsx(SP,{proOptions:_p,position:Sp}),y.jsx(bP,{rfId:li,disableKeyboardA11y:ll})]})})}var KR=u0(XR);const ZR=jt.error014();function q0({id:e,handleType:t,handleId:n,onConnect:r,onDisconnect:i}={}){const s=us(),a=e??s;if(!a)throw new Error(ZR);const l=T.useRef(null),u=Fe(d=>d.connectionLookup.get(`${a}${t?n?`-${t}-${n}`:`-${t}`:""}`),sO);return T.useEffect(()=>{if(l.current&&l.current!==u){const d=u??new Map;nx(l.current,d,i),nx(d,l.current,r)}l.current=u??new Map},[u,r,i]),T.useMemo(()=>Array.from(u?.values()??[]),[u])}function of(e){return Fe(T.useCallback(n=>{const r=[],i=Array.isArray(e),s=i?e:[e];for(const a of s){const l=n.nodeLookup.get(a);l&&r.push({id:l.id,type:l.type,data:l.data})}return i?r:r[0]??null},[e]),OO)}function JR({dimensions:e,lineWidth:t,variant:n,className:r}){return y.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:yt(["react-flow__background-pattern",n,r])})}function QR({radius:e,className:t}){return y.jsx("circle",{cx:e,cy:e,r:e,className:yt(["react-flow__background-pattern","dots",t])})}var Er;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Er||(Er={}));const eL={[Er.Dots]:1,[Er.Lines]:1,[Er.Cross]:6},tL=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Y0({id:e,variant:t=Er.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:l,style:u,className:d,patternClassName:f}){const g=T.useRef(null),{transform:h,patternId:m}=Fe(tL,ct),x=r||eL[t],v=t===Er.Dots,b=t===Er.Cross,S=Array.isArray(n)?n:[n,n],N=[S[0]*h[2]||1,S[1]*h[2]||1],w=x*h[2],I=Array.isArray(s)?s:[s,s],k=b?[w,w]:N,A=[I[0]*h[2]||1+k[0]/2,I[1]*h[2]||1+k[1]/2],M=`${m}${e||""}`;return y.jsxs("svg",{className:yt(["react-flow__background",d]),style:{...u,...Cc,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:g,"data-testid":"rf__background",children:[y.jsx("pattern",{id:M,x:h[0]%N[0],y:h[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:v?y.jsx(QR,{radius:w/2,className:f}):y.jsx(JR,{dimensions:k,lineWidth:i,variant:t,className:f})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}Y0.displayName="Background";const nL=T.memo(Y0);function rL(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function oL(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function iL(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.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 sL(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 aL(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 kc({children:e,className:t,...n}){return y.jsx("button",{type:"button",className:yt(["react-flow__controls-button",t]),...n,children:e})}const cL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function X0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:u,className:d,children:f,position:g="bottom-left",orientation:h="vertical","aria-label":m}){const x=rt(),{isInteractive:v,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:N}=Fe(cL,ct),{zoomIn:w,zoomOut:I,fitView:k}=Zo(),A=()=>{w(),s?.()},M=()=>{I(),a?.()},B=()=>{k(i),l?.()},U=()=>{x.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u?.(!v)},q=h==="horizontal"?"horizontal":"vertical";return y.jsxs(Ec,{className:yt(["react-flow__controls",q,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":m??N["controls.ariaLabel"],children:[t&&y.jsxs(y.Fragment,{children:[y.jsx(kc,{onClick:A,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:S,children:y.jsx(rL,{})}),y.jsx(kc,{onClick:M,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:b,children:y.jsx(oL,{})})]}),n&&y.jsx(kc,{className:"react-flow__controls-fitview",onClick:B,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:y.jsx(iL,{})}),r&&y.jsx(kc,{className:"react-flow__controls-interactive",onClick:U,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:v?y.jsx(aL,{}):y.jsx(sL,{})}),f]})}X0.displayName="Controls";const lL=T.memo(X0);function uL({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:l,strokeWidth:u,className:d,borderRadius:f,shapeRendering:g,selected:h,onClick:m}){const{background:x,backgroundColor:v}=s||{},b=a||x||v;return y.jsx("rect",{className:yt(["react-flow__minimap-node",{selected:h},d]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:b,stroke:l,strokeWidth:u},shapeRendering:g,onClick:m?S=>m(S,e):void 0})}const dL=T.memo(uL),fL=e=>e.nodes.map(t=>t.id),sf=e=>e instanceof Function?e:()=>e;function pL({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=dL,onClick:a}){const l=Fe(fL,ct),u=sf(t),d=sf(e),f=sf(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:l.map(h=>y.jsx(gL,{id:h,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:g},h))})}function hL({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:u}){const{node:d,x:f,y:g,width:h,height:m}=Fe(x=>{const{internals:v}=x.nodeLookup.get(e),b=v.userNode,{x:S,y:N}=v.positionAbsolute,{width:w,height:I}=rr(b);return{node:b,x:S,y:N,width:w,height:I}},ct);return!d||d.hidden||!fx(d)?null:y.jsx(l,{x:f,y:g,width:h,height:m,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:s,shapeRendering:a,onClick:u,id:d.id})}const gL=T.memo(hL);var mL=T.memo(pL);const yL=200,vL=150,xL=e=>!e.hidden,wL=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?lx(ts(e.nodeLookup,{filter:xL}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},bL="react-flow__minimap-desc";function K0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:f,maskStrokeWidth:g,position:h="bottom-right",onClick:m,onNodeClick:x,pannable:v=!1,zoomable:b=!1,ariaLabel:S,inversePan:N,zoomStep:w=1,offsetScale:I=5}){const k=rt(),A=T.useRef(null),{boundingRect:M,viewBB:B,rfId:U,panZoom:q,translateExtent:D,flowWidth:$,flowHeight:F,ariaLabelConfig:E}=Fe(wL,ct),P=e?.width??yL,L=e?.height??vL,j=M.width/P,O=M.height/L,W=Math.max(j,O),z=W*P,Y=W*L,J=I*W,ie=M.x-(z-M.width)/2-J,ee=M.y-(Y-M.height)/2-J,ce=z+J*2,ge=Y+J*2,Q=`${bL}-${U}`,te=T.useRef(0),ne=T.useRef();te.current=W,T.useEffect(()=>{if(A.current&&q)return ne.current=VO({domNode:A.current,panZoom:q,getTransform:()=>k.getState().transform,getViewScale:()=>te.current}),()=>{ne.current?.destroy()}},[q]),T.useEffect(()=>{ne.current?.update({translateExtent:D,width:$,height:F,inversePan:N,pannable:v,zoomStep:w,zoomable:b})},[v,b,N,w,D,$,F]);const oe=m?ve=>{const[me,Oe]=ne.current?.pointer(ve)||[0,0];m(ve,{x:me,y:Oe})}:void 0,pe=x?T.useCallback((ve,me)=>{const Oe=k.getState().nodeLookup.get(me).internals.userNode;x(ve,Oe)},[]):void 0,le=S??E["minimap.ariaLabel"];return y.jsx(Ec,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*W:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:yt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:P,height:L,viewBox:`${ie} ${ee} ${ce} ${ge}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:A,onClick:oe,children:[le&&y.jsx("title",{id:Q,children:le}),y.jsx(mL,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-J},${ee-J}h${ce+J*2}v${ge+J*2}h${-ce-J*2}z
|
|
270
|
-
M${B.x},${B.y}h${B.width}v${B.height}h${-B.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}K0.displayName="MiniMap";const SL=T.memo(K0),_L=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,NL={[oo.Line]:"right",[oo.Handle]:"bottom-right"};function IL({nodeId:e,position:t,variant:n=oo.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:h,autoScale:m=!0,shouldResize:x,onResizeStart:v,onResize:b,onResizeEnd:S}){const N=us(),w=typeof e=="string"?e:N,I=rt(),k=T.useRef(null),A=n===oo.Handle,M=Fe(T.useCallback(_L(A&&m),[A,m]),ct),B=T.useRef(null),U=t??NL[n];T.useEffect(()=>{if(!(!k.current||!w))return B.current||(B.current=rP({domNode:k.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:D,transform:$,snapGrid:F,snapToGrid:E,nodeOrigin:P,domNode:L}=I.getState();return{nodeLookup:D,transform:$,snapGrid:F,snapToGrid:E,nodeOrigin:P,paneDomNode:L}},onChange:(D,$)=>{const{triggerNodeChanges:F,nodeLookup:E,parentLookup:P,nodeOrigin:L}=I.getState(),j=[],O={x:D.x,y:D.y},W=E.get(w);if(W&&W.expandParent&&W.parentId){const z=W.origin??L,Y=D.width??W.measured.width??0,J=D.height??W.measured.height??0,ie={id:W.id,parentId:W.parentId,rect:{width:Y,height:J,...px({x:D.x??W.position.x,y:D.y??W.position.y},{width:Y,height:J},W.parentId,E,z)}},ee=Yd([ie],E,P,L);j.push(...ee),O.x=D.x?Math.max(z[0]*Y,D.x):void 0,O.y=D.y?Math.max(z[1]*J,D.y):void 0}if(O.x!==void 0&&O.y!==void 0){const z={id:w,type:"position",position:{...O}};j.push(z)}if(D.width!==void 0&&D.height!==void 0){const Y={id:w,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};j.push(Y)}for(const z of $){const Y={...z,type:"position"};j.push(Y)}F(j)},onEnd:({width:D,height:$})=>{const F={id:w,type:"dimensions",resizing:!1,dimensions:{width:D,height:$}};I.getState().triggerNodeChanges([F])}})),B.current.update({controlPosition:U,boundaries:{minWidth:l,minHeight:u,maxWidth:d,maxHeight:f},keepAspectRatio:g,resizeDirection:h,onResizeStart:v,onResize:b,onResizeEnd:S,shouldResize:x}),()=>{B.current?.destroy()}},[U,l,u,d,f,g,v,b,S,x]);const q=U.split("-");return y.jsx("div",{className:yt(["react-flow__resize-control","nodrag",...q,n,r]),ref:k,style:{...i,scale:M,...a&&{[A?"backgroundColor":"borderColor"]:a}},children:s})}const Z0=T.memo(IL),fs=20;function Tr(e,t){const n=t[e.dataType],r=e.allowInput??n.allowInput,i=e.maxConnections??n.maxConnections;return n.underlyingType==="number"?{id:rn(fs),name:e.name,handleColor:n.color,allowInput:r,maxConnections:i,type:"number",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:n.underlyingType==="string"?{id:rn(fs),name:e.name,handleColor:n.color,allowInput:r,maxConnections:i,type:"string",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:n.underlyingType==="boolean"?{id:rn(fs),name:e.name,handleColor:n.color,allowInput:r,maxConnections:i,type:"boolean",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:{id:rn(fs),name:e.name,handleColor:n.color,allowInput:r,maxConnections:i,type:"unsupportedDirectly",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}}function J0(e,t){const n=rn(fs),r=e.inputs.map(i=>Tr(i,t));return{id:n,name:e.name,inputs:r}}function ps(e,t,n,r,i){const s=n[t],a=s.inputs.map(u=>"inputs"in u?J0(u,e):Tr(u,e)),l=s.outputs.map(u=>Tr(u,e));return{id:r,position:i,sourcePosition:Ne.Right,targetPosition:Ne.Left,type:"configurableNode",width:400,data:{name:s.name,headerColor:s.headerColor,inputs:a,outputs:l,nodeTypeUniqueId:t,showNodeOpenButton:s.subtree!==void 0}}}function Cr(e,t,n,r){const i=n[t];if(r)if(r.type==="input"){const s=i?.inputs?.[r.index1];if(!s)return;if(r.index2!==void 0&&"inputs"in s)return Tr(s.inputs?.[r.index2],e);if(r.index2===void 0&&!("inputs"in s))return Tr(s,e)}else return Tr(i?.outputs?.[r.index1],e)}function Mt(e){const t=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!t)return{nodes:e.nodes,edges:e.edges};const n=e.typeOfNodes[t.nodeType].subtree;return n?{nodes:n.nodes,edges:n.edges,inputNodeId:n.inputNodeId,outputNodeId:n.outputNodeId}:{nodes:e.nodes,edges:e.edges}}function so(e,t,n){const r=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!r)return t&&(e.nodes=[...t]),n&&(e.edges=[...n]),e;const i=e.typeOfNodes[r.nodeType].subtree,s=e.typeOfNodes[r.nodeType].subtree?.numberOfReferences;return!i||s!==0?(t&&(e.nodes=[...t]),n&&(e.edges=[...n]),e):(t&&(i.nodes=[...t]),n&&(i.edges=[...n]),e)}function hs(e){const t={},n={};for(const r of Object.keys(e.typeOfNodes)){const s=e.typeOfNodes[r].subtree;if(!(!s||s.nodes.length===0))for(const a of s.nodes){const l=a.data.nodeTypeUniqueId;l&&(n[r]=n[r]||new Set,n[r]?.add(l),t[l]=t[l]||new Set,t[l]?.add(r))}}return{nodeToNodeDependents:t,nodeToNodeDependencies:n}}function af(e,t){return("typeOfNodes"in e?hs(e).nodeToNodeDependents:e)[t]||new Set}function Q0(e,t){return("typeOfNodes"in e?hs(e).nodeToNodeDependencies:e)[t]||new Set}function ew(e,t){const n="typeOfNodes"in e?hs(e).nodeToNodeDependents:e,r=new Set,i=[t];for(;i.length>0;){const s=i.shift();if(!s)continue;r.add(s);const a=af(n,s);for(const l of a)r.has(l)||i.push(l)}return r}function EL(e,t){const n="typeOfNodes"in e?hs(e).nodeToNodeDependencies:e,r=new Set,i=[t];for(;i.length>0;){const s=i.shift();if(!s)continue;r.add(s);const a=Q0(n,s);for(const l of a)r.has(l)||i.push(l)}return r}function or(e,t){return e>=0?e:e+t}function cf(e){return e>=0?e+1:e-1}function lf(e,t){const n=or(e,t);return n>=0&&n<t}function ao(e,t,n=void 0){let r=n?.index1??0,i=n?.index2??0;return Iterator.from({next:function(){if(!lf(r,e.length))return{value:{value:void 0,handleIndices:{type:t,index1:r,index2:void 0},parentArray:e,parentArrayIndex:r},done:!0};const a=e[or(r,e.length)];if("inputs"in a){if(!lf(i,a.inputs.length))return{value:{value:void 0,handleIndices:{type:"input",index1:r,index2:i},parentArray:a.inputs,parentArrayIndex:i},done:!0};const l=a.inputs[or(i,a.inputs.length)],u=r,d=i;let f=!1;for(;;){f?(i=i>=0?0:-1,f=!1):i=cf(i);const m=e[or(r,e.length)];if(!m||!("inputs"in m)){i=0;break}if(lf(i,m.inputs.length))break;r=cf(r),f=!0}const g=l,h=e[or(u,e.length)];return{value:{value:g,handleIndices:{type:"input",index1:u,index2:d},parentArray:h,parentArrayIndex:d},done:!1}}else{const l=r;return r=cf(r),i=0,{value:{value:a,handleIndices:{type:t,index1:l,index2:void 0},parentArray:e,parentArrayIndex:l},done:!1}}}})}function tw(e,t,n=!0,r=!0){if(n){const i=e?.inputs instanceof Array?e?.inputs:[];ao(i,"input").every(({value:a,handleIndices:l})=>t(a,l)!==!1)}if(r){const i=e?.outputs instanceof Array?e?.outputs:[];ao(i,"output").forEach(({value:a,handleIndices:l})=>{t(a,l)})}return e}function uf(e,t,n,r=!0,i=!0,s=!0){if(s){const a=on(t,e,r,i)?.value;return a&&Object.assign(a,n),e}else return Bi(e,a=>{const l=on(t,a,r,i)?.value;return l&&Object.assign(l,n),a})}function co(e,t,n=0,r,i=!0,s="before"){if(i){const a=bt(t,e);if(a){const l=a.parentArray,u=s==="before"?or(a.parentArrayIndex,l.length):or(a.parentArrayIndex,l.length)+1;l.splice(u,n,r)}return e}else return Bi(e,a=>{const l=bt(t,a);if(l){const u=l.parentArray,d=s==="before"?or(l.parentArrayIndex,u.length):or(l.parentArrayIndex,u.length)+1;u.splice(d,n,r)}return a})}var gs={exports:{}};/**
|
|
271
|
-
* @license
|
|
272
|
-
* Lodash <https://lodash.com/>
|
|
273
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
274
|
-
* Released under MIT license <https://lodash.com/license>
|
|
275
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
276
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
277
|
-
*/var TL=gs.exports,nw;function CL(){return nw||(nw=1,function(e,t){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",d=500,f="__lodash_placeholder__",g=1,h=2,m=4,x=1,v=2,b=1,S=2,N=4,w=8,I=16,k=32,A=64,M=128,B=256,U=512,q=30,D="...",$=800,F=16,E=1,P=2,L=3,j=1/0,O=9007199254740991,W=17976931348623157e292,z=NaN,Y=4294967295,J=Y-1,ie=Y>>>1,ee=[["ary",M],["bind",b],["bindKey",S],["curry",w],["curryRight",I],["flip",U],["partial",k],["partialRight",A],["rearg",B]],ce="[object Arguments]",ge="[object Array]",Q="[object AsyncFunction]",te="[object Boolean]",ne="[object Date]",oe="[object DOMException]",pe="[object Error]",le="[object Function]",ve="[object GeneratorFunction]",me="[object Map]",Oe="[object Number]",Ce="[object Null]",ae="[object Object]",Ie="[object Promise]",Be="[object Proxy]",Qe="[object RegExp]",Ue="[object Set]",Ze="[object String]",pt="[object Symbol]",Cn="[object Undefined]",cn="[object WeakMap]",Nt="[object WeakSet]",$t="[object ArrayBuffer]",ln="[object DataView]",Or="[object Float32Array]",Un="[object Float64Array]",fo="[object Int8Array]",po="[object Int16Array]",Pr="[object Int32Array]",Ps="[object Uint8Array]",Rs="[object Uint8ClampedArray]",Ls="[object Uint16Array]",Ds="[object Uint32Array]",op=/\b__p \+= '';/g,ip=/\b(__p \+=) '' \+/g,sp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rl=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,ap=RegExp(rl.source),cp=RegExp(ol.source),il=/<%-([\s\S]+?)%>/g,lp=/<%([\s\S]+?)%>/g,sl=/<%=([\s\S]+?)%>/g,up=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dp=/^\w*$/,fp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,js=/[\\^$.*+?()[\]{}|]/g,pp=RegExp(js.source),$s=/^\s+/,hp=/\s/,gp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mp=/\{\n\/\* \[wrapped with (.+)\] \*/,yp=/,? & /,vp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xp=/[()=,{}\[\]\/\s]/,wp=/\\(\\)?/g,al=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hs=/\w*$/,cl=/^[-+]0x[0-9a-f]+$/i,bp=/^0b[01]+$/i,Sp=/^\[object .+?Constructor\]$/,_p=/^0o[0-7]+$/i,Np=/^(?:0|[1-9]\d*)$/,Ip=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,si=/($^)/,ll=/['\n\r\u2028\u2029\\]/g,ai="\\ud800-\\udfff",Ep="\\u0300-\\u036f",Tp="\\ufe20-\\ufe2f",Cp="\\u20d0-\\u20ff",ul=Ep+Tp+Cp,dl="\\u2700-\\u27bf",fl="a-z\\xdf-\\xf6\\xf8-\\xff",pl="\\xac\\xb1\\xd7\\xf7",Ap="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kp="\\u2000-\\u206f",Mp=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hl="A-Z\\xc0-\\xd6\\xd8-\\xde",gl="\\ufe0e\\ufe0f",ml=pl+Ap+kp+Mp,Bs="['’]",Op="["+ai+"]",Vs="["+ml+"]",ci="["+ul+"]",yl="\\d+",Pp="["+dl+"]",li="["+fl+"]",vl="[^"+ai+ml+yl+dl+fl+hl+"]",Fs="\\ud83c[\\udffb-\\udfff]",xl="(?:"+ci+"|"+Fs+")",aS="[^"+ai+"]",Rp="(?:\\ud83c[\\udde6-\\uddff]){2}",Lp="[\\ud800-\\udbff][\\udc00-\\udfff]",ui="["+hl+"]",cS="\\u200d",lS="(?:"+li+"|"+vl+")",tj="(?:"+ui+"|"+vl+")",uS="(?:"+Bs+"(?:d|ll|m|re|s|t|ve))?",dS="(?:"+Bs+"(?:D|LL|M|RE|S|T|VE))?",fS=xl+"?",pS="["+gl+"]?",nj="(?:"+cS+"(?:"+[aS,Rp,Lp].join("|")+")"+pS+fS+")*",rj="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oj="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hS=pS+fS+nj,ij="(?:"+[Pp,Rp,Lp].join("|")+")"+hS,sj="(?:"+[aS+ci+"?",ci,Rp,Lp,Op].join("|")+")",aj=RegExp(Bs,"g"),cj=RegExp(ci,"g"),Dp=RegExp(Fs+"(?="+Fs+")|"+sj+hS,"g"),lj=RegExp([ui+"?"+li+"+"+uS+"(?="+[Vs,ui,"$"].join("|")+")",tj+"+"+dS+"(?="+[Vs,ui+lS,"$"].join("|")+")",ui+"?"+lS+"+"+uS,ui+"+"+dS,oj,rj,yl,ij].join("|"),"g"),uj=RegExp("["+cS+ai+ul+gl+"]"),dj=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fj=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],pj=-1,ot={};ot[Or]=ot[Un]=ot[fo]=ot[po]=ot[Pr]=ot[Ps]=ot[Rs]=ot[Ls]=ot[Ds]=!0,ot[ce]=ot[ge]=ot[$t]=ot[te]=ot[ln]=ot[ne]=ot[pe]=ot[le]=ot[me]=ot[Oe]=ot[ae]=ot[Qe]=ot[Ue]=ot[Ze]=ot[cn]=!1;var nt={};nt[ce]=nt[ge]=nt[$t]=nt[ln]=nt[te]=nt[ne]=nt[Or]=nt[Un]=nt[fo]=nt[po]=nt[Pr]=nt[me]=nt[Oe]=nt[ae]=nt[Qe]=nt[Ue]=nt[Ze]=nt[pt]=nt[Ps]=nt[Rs]=nt[Ls]=nt[Ds]=!0,nt[pe]=nt[le]=nt[cn]=!1;var hj={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},gj={"&":"&","<":"<",">":">",'"':""","'":"'"},mj={"&":"&","<":"<",">":">",""":'"',"'":"'"},yj={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vj=parseFloat,xj=parseInt,gS=typeof oa=="object"&&oa&&oa.Object===Object&&oa,wj=typeof self=="object"&&self&&self.Object===Object&&self,It=gS||wj||Function("return this")(),jp=t&&!t.nodeType&&t,ho=jp&&!0&&e&&!e.nodeType&&e,mS=ho&&ho.exports===jp,$p=mS&&gS.process,un=function(){try{var K=ho&&ho.require&&ho.require("util").types;return K||$p&&$p.binding&&$p.binding("util")}catch{}}(),yS=un&&un.isArrayBuffer,vS=un&&un.isDate,xS=un&&un.isMap,wS=un&&un.isRegExp,bS=un&&un.isSet,SS=un&&un.isTypedArray;function Kt(K,se,re){switch(re.length){case 0:return K.call(se);case 1:return K.call(se,re[0]);case 2:return K.call(se,re[0],re[1]);case 3:return K.call(se,re[0],re[1],re[2])}return K.apply(se,re)}function bj(K,se,re,we){for(var Re=-1,qe=K==null?0:K.length;++Re<qe;){var xt=K[Re];se(we,xt,re(xt),K)}return we}function dn(K,se){for(var re=-1,we=K==null?0:K.length;++re<we&&se(K[re],re,K)!==!1;);return K}function Sj(K,se){for(var re=K==null?0:K.length;re--&&se(K[re],re,K)!==!1;);return K}function _S(K,se){for(var re=-1,we=K==null?0:K.length;++re<we;)if(!se(K[re],re,K))return!1;return!0}function Rr(K,se){for(var re=-1,we=K==null?0:K.length,Re=0,qe=[];++re<we;){var xt=K[re];se(xt,re,K)&&(qe[Re++]=xt)}return qe}function wl(K,se){var re=K==null?0:K.length;return!!re&&di(K,se,0)>-1}function Hp(K,se,re){for(var we=-1,Re=K==null?0:K.length;++we<Re;)if(re(se,K[we]))return!0;return!1}function at(K,se){for(var re=-1,we=K==null?0:K.length,Re=Array(we);++re<we;)Re[re]=se(K[re],re,K);return Re}function Lr(K,se){for(var re=-1,we=se.length,Re=K.length;++re<we;)K[Re+re]=se[re];return K}function Bp(K,se,re,we){var Re=-1,qe=K==null?0:K.length;for(we&&qe&&(re=K[++Re]);++Re<qe;)re=se(re,K[Re],Re,K);return re}function _j(K,se,re,we){var Re=K==null?0:K.length;for(we&&Re&&(re=K[--Re]);Re--;)re=se(re,K[Re],Re,K);return re}function Vp(K,se){for(var re=-1,we=K==null?0:K.length;++re<we;)if(se(K[re],re,K))return!0;return!1}var Nj=Fp("length");function Ij(K){return K.split("")}function Ej(K){return K.match(vp)||[]}function NS(K,se,re){var we;return re(K,function(Re,qe,xt){if(se(Re,qe,xt))return we=qe,!1}),we}function bl(K,se,re,we){for(var Re=K.length,qe=re+(we?1:-1);we?qe--:++qe<Re;)if(se(K[qe],qe,K))return qe;return-1}function di(K,se,re){return se===se?$j(K,se,re):bl(K,IS,re)}function Tj(K,se,re,we){for(var Re=re-1,qe=K.length;++Re<qe;)if(we(K[Re],se))return Re;return-1}function IS(K){return K!==K}function ES(K,se){var re=K==null?0:K.length;return re?Up(K,se)/re:z}function Fp(K){return function(se){return se==null?n:se[K]}}function zp(K){return function(se){return K==null?n:K[se]}}function TS(K,se,re,we,Re){return Re(K,function(qe,xt,et){re=we?(we=!1,qe):se(re,qe,xt,et)}),re}function Cj(K,se){var re=K.length;for(K.sort(se);re--;)K[re]=K[re].value;return K}function Up(K,se){for(var re,we=-1,Re=K.length;++we<Re;){var qe=se(K[we]);qe!==n&&(re=re===n?qe:re+qe)}return re}function Wp(K,se){for(var re=-1,we=Array(K);++re<K;)we[re]=se(re);return we}function Aj(K,se){return at(se,function(re){return[re,K[re]]})}function CS(K){return K&&K.slice(0,OS(K)+1).replace($s,"")}function Zt(K){return function(se){return K(se)}}function Gp(K,se){return at(se,function(re){return K[re]})}function zs(K,se){return K.has(se)}function AS(K,se){for(var re=-1,we=K.length;++re<we&&di(se,K[re],0)>-1;);return re}function kS(K,se){for(var re=K.length;re--&&di(se,K[re],0)>-1;);return re}function kj(K,se){for(var re=K.length,we=0;re--;)K[re]===se&&++we;return we}var Mj=zp(hj),Oj=zp(gj);function Pj(K){return"\\"+yj[K]}function Rj(K,se){return K==null?n:K[se]}function fi(K){return uj.test(K)}function Lj(K){return dj.test(K)}function Dj(K){for(var se,re=[];!(se=K.next()).done;)re.push(se.value);return re}function qp(K){var se=-1,re=Array(K.size);return K.forEach(function(we,Re){re[++se]=[Re,we]}),re}function MS(K,se){return function(re){return K(se(re))}}function Dr(K,se){for(var re=-1,we=K.length,Re=0,qe=[];++re<we;){var xt=K[re];(xt===se||xt===f)&&(K[re]=f,qe[Re++]=re)}return qe}function Sl(K){var se=-1,re=Array(K.size);return K.forEach(function(we){re[++se]=we}),re}function jj(K){var se=-1,re=Array(K.size);return K.forEach(function(we){re[++se]=[we,we]}),re}function $j(K,se,re){for(var we=re-1,Re=K.length;++we<Re;)if(K[we]===se)return we;return-1}function Hj(K,se,re){for(var we=re+1;we--;)if(K[we]===se)return we;return we}function pi(K){return fi(K)?Vj(K):Nj(K)}function An(K){return fi(K)?Fj(K):Ij(K)}function OS(K){for(var se=K.length;se--&&hp.test(K.charAt(se)););return se}var Bj=zp(mj);function Vj(K){for(var se=Dp.lastIndex=0;Dp.test(K);)++se;return se}function Fj(K){return K.match(Dp)||[]}function zj(K){return K.match(lj)||[]}var Uj=function K(se){se=se==null?It:hi.defaults(It.Object(),se,hi.pick(It,fj));var re=se.Array,we=se.Date,Re=se.Error,qe=se.Function,xt=se.Math,et=se.Object,Yp=se.RegExp,Wj=se.String,fn=se.TypeError,_l=re.prototype,Gj=qe.prototype,gi=et.prototype,Nl=se["__core-js_shared__"],Il=Gj.toString,Je=gi.hasOwnProperty,qj=0,PS=function(){var o=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),El=gi.toString,Yj=Il.call(et),Xj=It._,Kj=Yp("^"+Il.call(Je).replace(js,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tl=mS?se.Buffer:n,jr=se.Symbol,Cl=se.Uint8Array,RS=Tl?Tl.allocUnsafe:n,Al=MS(et.getPrototypeOf,et),LS=et.create,DS=gi.propertyIsEnumerable,kl=_l.splice,jS=jr?jr.isConcatSpreadable:n,Us=jr?jr.iterator:n,go=jr?jr.toStringTag:n,Ml=function(){try{var o=wo(et,"defineProperty");return o({},"",{}),o}catch{}}(),Zj=se.clearTimeout!==It.clearTimeout&&se.clearTimeout,Jj=we&&we.now!==It.Date.now&&we.now,Qj=se.setTimeout!==It.setTimeout&&se.setTimeout,Ol=xt.ceil,Pl=xt.floor,Xp=et.getOwnPropertySymbols,e$=Tl?Tl.isBuffer:n,$S=se.isFinite,t$=_l.join,n$=MS(et.keys,et),wt=xt.max,At=xt.min,r$=we.now,o$=se.parseInt,HS=xt.random,i$=_l.reverse,Kp=wo(se,"DataView"),Ws=wo(se,"Map"),Zp=wo(se,"Promise"),mi=wo(se,"Set"),Gs=wo(se,"WeakMap"),qs=wo(et,"create"),Rl=Gs&&new Gs,yi={},s$=bo(Kp),a$=bo(Ws),c$=bo(Zp),l$=bo(mi),u$=bo(Gs),Ll=jr?jr.prototype:n,Ys=Ll?Ll.valueOf:n,BS=Ll?Ll.toString:n;function R(o){if(ht(o)&&!Le(o)&&!(o instanceof We)){if(o instanceof pn)return o;if(Je.call(o,"__wrapped__"))return V1(o)}return new pn(o)}var vi=function(){function o(){}return function(c){if(!lt(c))return{};if(LS)return LS(c);o.prototype=c;var p=new o;return o.prototype=n,p}}();function Dl(){}function pn(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}R.templateSettings={escape:il,evaluate:lp,interpolate:sl,variable:"",imports:{_:R}},R.prototype=Dl.prototype,R.prototype.constructor=R,pn.prototype=vi(Dl.prototype),pn.prototype.constructor=pn;function We(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Y,this.__views__=[]}function d$(){var o=new We(this.__wrapped__);return o.__actions__=Ht(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ht(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ht(this.__views__),o}function f$(){if(this.__filtered__){var o=new We(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function p$(){var o=this.__wrapped__.value(),c=this.__dir__,p=Le(o),_=c<0,C=p?o.length:0,H=IH(0,C,this.__views__),G=H.start,X=H.end,Z=X-G,ue=_?X:G-1,de=this.__iteratees__,he=de.length,xe=0,_e=At(Z,this.__takeCount__);if(!p||!_&&C==Z&&_e==Z)return u1(o,this.__actions__);var ke=[];e:for(;Z--&&xe<_e;){ue+=c;for(var je=-1,Me=o[ue];++je<he;){var Ve=de[je],Ge=Ve.iteratee,en=Ve.type,Rt=Ge(Me);if(en==P)Me=Rt;else if(!Rt){if(en==E)continue e;break e}}ke[xe++]=Me}return ke}We.prototype=vi(Dl.prototype),We.prototype.constructor=We;function mo(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function h$(){this.__data__=qs?qs(null):{},this.size=0}function g$(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function m$(o){var c=this.__data__;if(qs){var p=c[o];return p===u?n:p}return Je.call(c,o)?c[o]:n}function y$(o){var c=this.__data__;return qs?c[o]!==n:Je.call(c,o)}function v$(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=qs&&c===n?u:c,this}mo.prototype.clear=h$,mo.prototype.delete=g$,mo.prototype.get=m$,mo.prototype.has=y$,mo.prototype.set=v$;function ar(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function x$(){this.__data__=[],this.size=0}function w$(o){var c=this.__data__,p=jl(c,o);if(p<0)return!1;var _=c.length-1;return p==_?c.pop():kl.call(c,p,1),--this.size,!0}function b$(o){var c=this.__data__,p=jl(c,o);return p<0?n:c[p][1]}function S$(o){return jl(this.__data__,o)>-1}function _$(o,c){var p=this.__data__,_=jl(p,o);return _<0?(++this.size,p.push([o,c])):p[_][1]=c,this}ar.prototype.clear=x$,ar.prototype.delete=w$,ar.prototype.get=b$,ar.prototype.has=S$,ar.prototype.set=_$;function cr(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function N$(){this.size=0,this.__data__={hash:new mo,map:new(Ws||ar),string:new mo}}function I$(o){var c=Xl(this,o).delete(o);return this.size-=c?1:0,c}function E$(o){return Xl(this,o).get(o)}function T$(o){return Xl(this,o).has(o)}function C$(o,c){var p=Xl(this,o),_=p.size;return p.set(o,c),this.size+=p.size==_?0:1,this}cr.prototype.clear=N$,cr.prototype.delete=I$,cr.prototype.get=E$,cr.prototype.has=T$,cr.prototype.set=C$;function yo(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new cr;++c<p;)this.add(o[c])}function A$(o){return this.__data__.set(o,u),this}function k$(o){return this.__data__.has(o)}yo.prototype.add=yo.prototype.push=A$,yo.prototype.has=k$;function kn(o){var c=this.__data__=new ar(o);this.size=c.size}function M$(){this.__data__=new ar,this.size=0}function O$(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function P$(o){return this.__data__.get(o)}function R$(o){return this.__data__.has(o)}function L$(o,c){var p=this.__data__;if(p instanceof ar){var _=p.__data__;if(!Ws||_.length<i-1)return _.push([o,c]),this.size=++p.size,this;p=this.__data__=new cr(_)}return p.set(o,c),this.size=p.size,this}kn.prototype.clear=M$,kn.prototype.delete=O$,kn.prototype.get=P$,kn.prototype.has=R$,kn.prototype.set=L$;function VS(o,c){var p=Le(o),_=!p&&So(o),C=!p&&!_&&Fr(o),H=!p&&!_&&!C&&Si(o),G=p||_||C||H,X=G?Wp(o.length,Wj):[],Z=X.length;for(var ue in o)(c||Je.call(o,ue))&&!(G&&(ue=="length"||C&&(ue=="offset"||ue=="parent")||H&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||fr(ue,Z)))&&X.push(ue);return X}function FS(o){var c=o.length;return c?o[ch(0,c-1)]:n}function D$(o,c){return Kl(Ht(o),vo(c,0,o.length))}function j$(o){return Kl(Ht(o))}function Jp(o,c,p){(p!==n&&!Mn(o[c],p)||p===n&&!(c in o))&&lr(o,c,p)}function Xs(o,c,p){var _=o[c];(!(Je.call(o,c)&&Mn(_,p))||p===n&&!(c in o))&&lr(o,c,p)}function jl(o,c){for(var p=o.length;p--;)if(Mn(o[p][0],c))return p;return-1}function $$(o,c,p,_){return $r(o,function(C,H,G){c(_,C,p(C),G)}),_}function zS(o,c){return o&&Gn(c,St(c),o)}function H$(o,c){return o&&Gn(c,Vt(c),o)}function lr(o,c,p){c=="__proto__"&&Ml?Ml(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function Qp(o,c){for(var p=-1,_=c.length,C=re(_),H=o==null;++p<_;)C[p]=H?n:Ph(o,c[p]);return C}function vo(o,c,p){return o===o&&(p!==n&&(o=o<=p?o:p),c!==n&&(o=o>=c?o:c)),o}function hn(o,c,p,_,C,H){var G,X=c&g,Z=c&h,ue=c&m;if(p&&(G=C?p(o,_,C,H):p(o)),G!==n)return G;if(!lt(o))return o;var de=Le(o);if(de){if(G=TH(o),!X)return Ht(o,G)}else{var he=kt(o),xe=he==le||he==ve;if(Fr(o))return p1(o,X);if(he==ae||he==ce||xe&&!C){if(G=Z||xe?{}:O1(o),!X)return Z?mH(o,H$(G,o)):gH(o,zS(G,o))}else{if(!nt[he])return C?o:{};G=CH(o,he,X)}}H||(H=new kn);var _e=H.get(o);if(_e)return _e;H.set(o,G),a_(o)?o.forEach(function(Me){G.add(hn(Me,c,p,Me,o,H))}):i_(o)&&o.forEach(function(Me,Ve){G.set(Ve,hn(Me,c,p,Ve,o,H))});var ke=ue?Z?xh:vh:Z?Vt:St,je=de?n:ke(o);return dn(je||o,function(Me,Ve){je&&(Ve=Me,Me=o[Ve]),Xs(G,Ve,hn(Me,c,p,Ve,o,H))}),G}function B$(o){var c=St(o);return function(p){return US(p,o,c)}}function US(o,c,p){var _=p.length;if(o==null)return!_;for(o=et(o);_--;){var C=p[_],H=c[C],G=o[C];if(G===n&&!(C in o)||!H(G))return!1}return!0}function WS(o,c,p){if(typeof o!="function")throw new fn(a);return na(function(){o.apply(n,p)},c)}function Ks(o,c,p,_){var C=-1,H=wl,G=!0,X=o.length,Z=[],ue=c.length;if(!X)return Z;p&&(c=at(c,Zt(p))),_?(H=Hp,G=!1):c.length>=i&&(H=zs,G=!1,c=new yo(c));e:for(;++C<X;){var de=o[C],he=p==null?de:p(de);if(de=_||de!==0?de:0,G&&he===he){for(var xe=ue;xe--;)if(c[xe]===he)continue e;Z.push(de)}else H(c,he,_)||Z.push(de)}return Z}var $r=v1(Wn),GS=v1(th,!0);function V$(o,c){var p=!0;return $r(o,function(_,C,H){return p=!!c(_,C,H),p}),p}function $l(o,c,p){for(var _=-1,C=o.length;++_<C;){var H=o[_],G=c(H);if(G!=null&&(X===n?G===G&&!Qt(G):p(G,X)))var X=G,Z=H}return Z}function F$(o,c,p,_){var C=o.length;for(p=De(p),p<0&&(p=-p>C?0:C+p),_=_===n||_>C?C:De(_),_<0&&(_+=C),_=p>_?0:l_(_);p<_;)o[p++]=c;return o}function qS(o,c){var p=[];return $r(o,function(_,C,H){c(_,C,H)&&p.push(_)}),p}function Et(o,c,p,_,C){var H=-1,G=o.length;for(p||(p=kH),C||(C=[]);++H<G;){var X=o[H];c>0&&p(X)?c>1?Et(X,c-1,p,_,C):Lr(C,X):_||(C[C.length]=X)}return C}var eh=x1(),YS=x1(!0);function Wn(o,c){return o&&eh(o,c,St)}function th(o,c){return o&&YS(o,c,St)}function Hl(o,c){return Rr(c,function(p){return pr(o[p])})}function xo(o,c){c=Br(c,o);for(var p=0,_=c.length;o!=null&&p<_;)o=o[qn(c[p++])];return p&&p==_?o:n}function XS(o,c,p){var _=c(o);return Le(o)?_:Lr(_,p(o))}function Ot(o){return o==null?o===n?Cn:Ce:go&&go in et(o)?NH(o):jH(o)}function nh(o,c){return o>c}function z$(o,c){return o!=null&&Je.call(o,c)}function U$(o,c){return o!=null&&c in et(o)}function W$(o,c,p){return o>=At(c,p)&&o<wt(c,p)}function rh(o,c,p){for(var _=p?Hp:wl,C=o[0].length,H=o.length,G=H,X=re(H),Z=1/0,ue=[];G--;){var de=o[G];G&&c&&(de=at(de,Zt(c))),Z=At(de.length,Z),X[G]=!p&&(c||C>=120&&de.length>=120)?new yo(G&&de):n}de=o[0];var he=-1,xe=X[0];e:for(;++he<C&&ue.length<Z;){var _e=de[he],ke=c?c(_e):_e;if(_e=p||_e!==0?_e:0,!(xe?zs(xe,ke):_(ue,ke,p))){for(G=H;--G;){var je=X[G];if(!(je?zs(je,ke):_(o[G],ke,p)))continue e}xe&&xe.push(ke),ue.push(_e)}}return ue}function G$(o,c,p,_){return Wn(o,function(C,H,G){c(_,p(C),H,G)}),_}function Zs(o,c,p){c=Br(c,o),o=D1(o,c);var _=o==null?o:o[qn(mn(c))];return _==null?n:Kt(_,o,p)}function KS(o){return ht(o)&&Ot(o)==ce}function q$(o){return ht(o)&&Ot(o)==$t}function Y$(o){return ht(o)&&Ot(o)==ne}function Js(o,c,p,_,C){return o===c?!0:o==null||c==null||!ht(o)&&!ht(c)?o!==o&&c!==c:X$(o,c,p,_,Js,C)}function X$(o,c,p,_,C,H){var G=Le(o),X=Le(c),Z=G?ge:kt(o),ue=X?ge:kt(c);Z=Z==ce?ae:Z,ue=ue==ce?ae:ue;var de=Z==ae,he=ue==ae,xe=Z==ue;if(xe&&Fr(o)){if(!Fr(c))return!1;G=!0,de=!1}if(xe&&!de)return H||(H=new kn),G||Si(o)?A1(o,c,p,_,C,H):SH(o,c,Z,p,_,C,H);if(!(p&x)){var _e=de&&Je.call(o,"__wrapped__"),ke=he&&Je.call(c,"__wrapped__");if(_e||ke){var je=_e?o.value():o,Me=ke?c.value():c;return H||(H=new kn),C(je,Me,p,_,H)}}return xe?(H||(H=new kn),_H(o,c,p,_,C,H)):!1}function K$(o){return ht(o)&&kt(o)==me}function oh(o,c,p,_){var C=p.length,H=C,G=!_;if(o==null)return!H;for(o=et(o);C--;){var X=p[C];if(G&&X[2]?X[1]!==o[X[0]]:!(X[0]in o))return!1}for(;++C<H;){X=p[C];var Z=X[0],ue=o[Z],de=X[1];if(G&&X[2]){if(ue===n&&!(Z in o))return!1}else{var he=new kn;if(_)var xe=_(ue,de,Z,o,c,he);if(!(xe===n?Js(de,ue,x|v,_,he):xe))return!1}}return!0}function ZS(o){if(!lt(o)||OH(o))return!1;var c=pr(o)?Kj:Sp;return c.test(bo(o))}function Z$(o){return ht(o)&&Ot(o)==Qe}function J$(o){return ht(o)&&kt(o)==Ue}function Q$(o){return ht(o)&&nu(o.length)&&!!ot[Ot(o)]}function JS(o){return typeof o=="function"?o:o==null?Ft:typeof o=="object"?Le(o)?t1(o[0],o[1]):e1(o):w_(o)}function ih(o){if(!ta(o))return n$(o);var c=[];for(var p in et(o))Je.call(o,p)&&p!="constructor"&&c.push(p);return c}function eH(o){if(!lt(o))return DH(o);var c=ta(o),p=[];for(var _ in o)_=="constructor"&&(c||!Je.call(o,_))||p.push(_);return p}function sh(o,c){return o<c}function QS(o,c){var p=-1,_=Bt(o)?re(o.length):[];return $r(o,function(C,H,G){_[++p]=c(C,H,G)}),_}function e1(o){var c=bh(o);return c.length==1&&c[0][2]?R1(c[0][0],c[0][1]):function(p){return p===o||oh(p,o,c)}}function t1(o,c){return _h(o)&&P1(c)?R1(qn(o),c):function(p){var _=Ph(p,o);return _===n&&_===c?Rh(p,o):Js(c,_,x|v)}}function Bl(o,c,p,_,C){o!==c&&eh(c,function(H,G){if(C||(C=new kn),lt(H))tH(o,c,G,p,Bl,_,C);else{var X=_?_(Ih(o,G),H,G+"",o,c,C):n;X===n&&(X=H),Jp(o,G,X)}},Vt)}function tH(o,c,p,_,C,H,G){var X=Ih(o,p),Z=Ih(c,p),ue=G.get(Z);if(ue){Jp(o,p,ue);return}var de=H?H(X,Z,p+"",o,c,G):n,he=de===n;if(he){var xe=Le(Z),_e=!xe&&Fr(Z),ke=!xe&&!_e&&Si(Z);de=Z,xe||_e||ke?Le(X)?de=X:gt(X)?de=Ht(X):_e?(he=!1,de=p1(Z,!0)):ke?(he=!1,de=h1(Z,!0)):de=[]:ra(Z)||So(Z)?(de=X,So(X)?de=u_(X):(!lt(X)||pr(X))&&(de=O1(Z))):he=!1}he&&(G.set(Z,de),C(de,Z,_,H,G),G.delete(Z)),Jp(o,p,de)}function n1(o,c){var p=o.length;if(p)return c+=c<0?p:0,fr(c,p)?o[c]:n}function r1(o,c,p){c.length?c=at(c,function(H){return Le(H)?function(G){return xo(G,H.length===1?H[0]:H)}:H}):c=[Ft];var _=-1;c=at(c,Zt(Ae()));var C=QS(o,function(H,G,X){var Z=at(c,function(ue){return ue(H)});return{criteria:Z,index:++_,value:H}});return Cj(C,function(H,G){return hH(H,G,p)})}function nH(o,c){return o1(o,c,function(p,_){return Rh(o,_)})}function o1(o,c,p){for(var _=-1,C=c.length,H={};++_<C;){var G=c[_],X=xo(o,G);p(X,G)&&Qs(H,Br(G,o),X)}return H}function rH(o){return function(c){return xo(c,o)}}function ah(o,c,p,_){var C=_?Tj:di,H=-1,G=c.length,X=o;for(o===c&&(c=Ht(c)),p&&(X=at(o,Zt(p)));++H<G;)for(var Z=0,ue=c[H],de=p?p(ue):ue;(Z=C(X,de,Z,_))>-1;)X!==o&&kl.call(X,Z,1),kl.call(o,Z,1);return o}function i1(o,c){for(var p=o?c.length:0,_=p-1;p--;){var C=c[p];if(p==_||C!==H){var H=C;fr(C)?kl.call(o,C,1):dh(o,C)}}return o}function ch(o,c){return o+Pl(HS()*(c-o+1))}function oH(o,c,p,_){for(var C=-1,H=wt(Ol((c-o)/(p||1)),0),G=re(H);H--;)G[_?H:++C]=o,o+=p;return G}function lh(o,c){var p="";if(!o||c<1||c>O)return p;do c%2&&(p+=o),c=Pl(c/2),c&&(o+=o);while(c);return p}function He(o,c){return Eh(L1(o,c,Ft),o+"")}function iH(o){return FS(_i(o))}function sH(o,c){var p=_i(o);return Kl(p,vo(c,0,p.length))}function Qs(o,c,p,_){if(!lt(o))return o;c=Br(c,o);for(var C=-1,H=c.length,G=H-1,X=o;X!=null&&++C<H;){var Z=qn(c[C]),ue=p;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return o;if(C!=G){var de=X[Z];ue=_?_(de,Z,X):n,ue===n&&(ue=lt(de)?de:fr(c[C+1])?[]:{})}Xs(X,Z,ue),X=X[Z]}return o}var s1=Rl?function(o,c){return Rl.set(o,c),o}:Ft,aH=Ml?function(o,c){return Ml(o,"toString",{configurable:!0,enumerable:!1,value:Dh(c),writable:!0})}:Ft;function cH(o){return Kl(_i(o))}function gn(o,c,p){var _=-1,C=o.length;c<0&&(c=-c>C?0:C+c),p=p>C?C:p,p<0&&(p+=C),C=c>p?0:p-c>>>0,c>>>=0;for(var H=re(C);++_<C;)H[_]=o[_+c];return H}function lH(o,c){var p;return $r(o,function(_,C,H){return p=c(_,C,H),!p}),!!p}function Vl(o,c,p){var _=0,C=o==null?_:o.length;if(typeof c=="number"&&c===c&&C<=ie){for(;_<C;){var H=_+C>>>1,G=o[H];G!==null&&!Qt(G)&&(p?G<=c:G<c)?_=H+1:C=H}return C}return uh(o,c,Ft,p)}function uh(o,c,p,_){var C=0,H=o==null?0:o.length;if(H===0)return 0;c=p(c);for(var G=c!==c,X=c===null,Z=Qt(c),ue=c===n;C<H;){var de=Pl((C+H)/2),he=p(o[de]),xe=he!==n,_e=he===null,ke=he===he,je=Qt(he);if(G)var Me=_||ke;else ue?Me=ke&&(_||xe):X?Me=ke&&xe&&(_||!_e):Z?Me=ke&&xe&&!_e&&(_||!je):_e||je?Me=!1:Me=_?he<=c:he<c;Me?C=de+1:H=de}return At(H,J)}function a1(o,c){for(var p=-1,_=o.length,C=0,H=[];++p<_;){var G=o[p],X=c?c(G):G;if(!p||!Mn(X,Z)){var Z=X;H[C++]=G===0?0:G}}return H}function c1(o){return typeof o=="number"?o:Qt(o)?z:+o}function Jt(o){if(typeof o=="string")return o;if(Le(o))return at(o,Jt)+"";if(Qt(o))return BS?BS.call(o):"";var c=o+"";return c=="0"&&1/o==-j?"-0":c}function Hr(o,c,p){var _=-1,C=wl,H=o.length,G=!0,X=[],Z=X;if(p)G=!1,C=Hp;else if(H>=i){var ue=c?null:wH(o);if(ue)return Sl(ue);G=!1,C=zs,Z=new yo}else Z=c?[]:X;e:for(;++_<H;){var de=o[_],he=c?c(de):de;if(de=p||de!==0?de:0,G&&he===he){for(var xe=Z.length;xe--;)if(Z[xe]===he)continue e;c&&Z.push(he),X.push(de)}else C(Z,he,p)||(Z!==X&&Z.push(he),X.push(de))}return X}function dh(o,c){return c=Br(c,o),o=D1(o,c),o==null||delete o[qn(mn(c))]}function l1(o,c,p,_){return Qs(o,c,p(xo(o,c)),_)}function Fl(o,c,p,_){for(var C=o.length,H=_?C:-1;(_?H--:++H<C)&&c(o[H],H,o););return p?gn(o,_?0:H,_?H+1:C):gn(o,_?H+1:0,_?C:H)}function u1(o,c){var p=o;return p instanceof We&&(p=p.value()),Bp(c,function(_,C){return C.func.apply(C.thisArg,Lr([_],C.args))},p)}function fh(o,c,p){var _=o.length;if(_<2)return _?Hr(o[0]):[];for(var C=-1,H=re(_);++C<_;)for(var G=o[C],X=-1;++X<_;)X!=C&&(H[C]=Ks(H[C]||G,o[X],c,p));return Hr(Et(H,1),c,p)}function d1(o,c,p){for(var _=-1,C=o.length,H=c.length,G={};++_<C;){var X=_<H?c[_]:n;p(G,o[_],X)}return G}function ph(o){return gt(o)?o:[]}function hh(o){return typeof o=="function"?o:Ft}function Br(o,c){return Le(o)?o:_h(o,c)?[o]:B1(Xe(o))}var uH=He;function Vr(o,c,p){var _=o.length;return p=p===n?_:p,!c&&p>=_?o:gn(o,c,p)}var f1=Zj||function(o){return It.clearTimeout(o)};function p1(o,c){if(c)return o.slice();var p=o.length,_=RS?RS(p):new o.constructor(p);return o.copy(_),_}function gh(o){var c=new o.constructor(o.byteLength);return new Cl(c).set(new Cl(o)),c}function dH(o,c){var p=c?gh(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function fH(o){var c=new o.constructor(o.source,Hs.exec(o));return c.lastIndex=o.lastIndex,c}function pH(o){return Ys?et(Ys.call(o)):{}}function h1(o,c){var p=c?gh(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function g1(o,c){if(o!==c){var p=o!==n,_=o===null,C=o===o,H=Qt(o),G=c!==n,X=c===null,Z=c===c,ue=Qt(c);if(!X&&!ue&&!H&&o>c||H&&G&&Z&&!X&&!ue||_&&G&&Z||!p&&Z||!C)return 1;if(!_&&!H&&!ue&&o<c||ue&&p&&C&&!_&&!H||X&&p&&C||!G&&C||!Z)return-1}return 0}function hH(o,c,p){for(var _=-1,C=o.criteria,H=c.criteria,G=C.length,X=p.length;++_<G;){var Z=g1(C[_],H[_]);if(Z){if(_>=X)return Z;var ue=p[_];return Z*(ue=="desc"?-1:1)}}return o.index-c.index}function m1(o,c,p,_){for(var C=-1,H=o.length,G=p.length,X=-1,Z=c.length,ue=wt(H-G,0),de=re(Z+ue),he=!_;++X<Z;)de[X]=c[X];for(;++C<G;)(he||C<H)&&(de[p[C]]=o[C]);for(;ue--;)de[X++]=o[C++];return de}function y1(o,c,p,_){for(var C=-1,H=o.length,G=-1,X=p.length,Z=-1,ue=c.length,de=wt(H-X,0),he=re(de+ue),xe=!_;++C<de;)he[C]=o[C];for(var _e=C;++Z<ue;)he[_e+Z]=c[Z];for(;++G<X;)(xe||C<H)&&(he[_e+p[G]]=o[C++]);return he}function Ht(o,c){var p=-1,_=o.length;for(c||(c=re(_));++p<_;)c[p]=o[p];return c}function Gn(o,c,p,_){var C=!p;p||(p={});for(var H=-1,G=c.length;++H<G;){var X=c[H],Z=_?_(p[X],o[X],X,p,o):n;Z===n&&(Z=o[X]),C?lr(p,X,Z):Xs(p,X,Z)}return p}function gH(o,c){return Gn(o,Sh(o),c)}function mH(o,c){return Gn(o,k1(o),c)}function zl(o,c){return function(p,_){var C=Le(p)?bj:$$,H=c?c():{};return C(p,o,Ae(_,2),H)}}function xi(o){return He(function(c,p){var _=-1,C=p.length,H=C>1?p[C-1]:n,G=C>2?p[2]:n;for(H=o.length>3&&typeof H=="function"?(C--,H):n,G&&Pt(p[0],p[1],G)&&(H=C<3?n:H,C=1),c=et(c);++_<C;){var X=p[_];X&&o(c,X,_,H)}return c})}function v1(o,c){return function(p,_){if(p==null)return p;if(!Bt(p))return o(p,_);for(var C=p.length,H=c?C:-1,G=et(p);(c?H--:++H<C)&&_(G[H],H,G)!==!1;);return p}}function x1(o){return function(c,p,_){for(var C=-1,H=et(c),G=_(c),X=G.length;X--;){var Z=G[o?X:++C];if(p(H[Z],Z,H)===!1)break}return c}}function yH(o,c,p){var _=c&b,C=ea(o);function H(){var G=this&&this!==It&&this instanceof H?C:o;return G.apply(_?p:this,arguments)}return H}function w1(o){return function(c){c=Xe(c);var p=fi(c)?An(c):n,_=p?p[0]:c.charAt(0),C=p?Vr(p,1).join(""):c.slice(1);return _[o]()+C}}function wi(o){return function(c){return Bp(v_(y_(c).replace(aj,"")),o,"")}}function ea(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=vi(o.prototype),_=o.apply(p,c);return lt(_)?_:p}}function vH(o,c,p){var _=ea(o);function C(){for(var H=arguments.length,G=re(H),X=H,Z=bi(C);X--;)G[X]=arguments[X];var ue=H<3&&G[0]!==Z&&G[H-1]!==Z?[]:Dr(G,Z);if(H-=ue.length,H<p)return I1(o,c,Ul,C.placeholder,n,G,ue,n,n,p-H);var de=this&&this!==It&&this instanceof C?_:o;return Kt(de,this,G)}return C}function b1(o){return function(c,p,_){var C=et(c);if(!Bt(c)){var H=Ae(p,3);c=St(c),p=function(X){return H(C[X],X,C)}}var G=o(c,p,_);return G>-1?C[H?c[G]:G]:n}}function S1(o){return dr(function(c){var p=c.length,_=p,C=pn.prototype.thru;for(o&&c.reverse();_--;){var H=c[_];if(typeof H!="function")throw new fn(a);if(C&&!G&&Yl(H)=="wrapper")var G=new pn([],!0)}for(_=G?_:p;++_<p;){H=c[_];var X=Yl(H),Z=X=="wrapper"?wh(H):n;Z&&Nh(Z[0])&&Z[1]==(M|w|k|B)&&!Z[4].length&&Z[9]==1?G=G[Yl(Z[0])].apply(G,Z[3]):G=H.length==1&&Nh(H)?G[X]():G.thru(H)}return function(){var ue=arguments,de=ue[0];if(G&&ue.length==1&&Le(de))return G.plant(de).value();for(var he=0,xe=p?c[he].apply(this,ue):de;++he<p;)xe=c[he].call(this,xe);return xe}})}function Ul(o,c,p,_,C,H,G,X,Z,ue){var de=c&M,he=c&b,xe=c&S,_e=c&(w|I),ke=c&U,je=xe?n:ea(o);function Me(){for(var Ve=arguments.length,Ge=re(Ve),en=Ve;en--;)Ge[en]=arguments[en];if(_e)var Rt=bi(Me),tn=kj(Ge,Rt);if(_&&(Ge=m1(Ge,_,C,_e)),H&&(Ge=y1(Ge,H,G,_e)),Ve-=tn,_e&&Ve<ue){var mt=Dr(Ge,Rt);return I1(o,c,Ul,Me.placeholder,p,Ge,mt,X,Z,ue-Ve)}var On=he?p:this,gr=xe?On[o]:o;return Ve=Ge.length,X?Ge=$H(Ge,X):ke&&Ve>1&&Ge.reverse(),de&&Z<Ve&&(Ge.length=Z),this&&this!==It&&this instanceof Me&&(gr=je||ea(gr)),gr.apply(On,Ge)}return Me}function _1(o,c){return function(p,_){return G$(p,o,c(_),{})}}function Wl(o,c){return function(p,_){var C;if(p===n&&_===n)return c;if(p!==n&&(C=p),_!==n){if(C===n)return _;typeof p=="string"||typeof _=="string"?(p=Jt(p),_=Jt(_)):(p=c1(p),_=c1(_)),C=o(p,_)}return C}}function mh(o){return dr(function(c){return c=at(c,Zt(Ae())),He(function(p){var _=this;return o(c,function(C){return Kt(C,_,p)})})})}function Gl(o,c){c=c===n?" ":Jt(c);var p=c.length;if(p<2)return p?lh(c,o):c;var _=lh(c,Ol(o/pi(c)));return fi(c)?Vr(An(_),0,o).join(""):_.slice(0,o)}function xH(o,c,p,_){var C=c&b,H=ea(o);function G(){for(var X=-1,Z=arguments.length,ue=-1,de=_.length,he=re(de+Z),xe=this&&this!==It&&this instanceof G?H:o;++ue<de;)he[ue]=_[ue];for(;Z--;)he[ue++]=arguments[++X];return Kt(xe,C?p:this,he)}return G}function N1(o){return function(c,p,_){return _&&typeof _!="number"&&Pt(c,p,_)&&(p=_=n),c=hr(c),p===n?(p=c,c=0):p=hr(p),_=_===n?c<p?1:-1:hr(_),oH(c,p,_,o)}}function ql(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=yn(c),p=yn(p)),o(c,p)}}function I1(o,c,p,_,C,H,G,X,Z,ue){var de=c&w,he=de?G:n,xe=de?n:G,_e=de?H:n,ke=de?n:H;c|=de?k:A,c&=~(de?A:k),c&N||(c&=-4);var je=[o,c,C,_e,he,ke,xe,X,Z,ue],Me=p.apply(n,je);return Nh(o)&&j1(Me,je),Me.placeholder=_,$1(Me,o,c)}function yh(o){var c=xt[o];return function(p,_){if(p=yn(p),_=_==null?0:At(De(_),292),_&&$S(p)){var C=(Xe(p)+"e").split("e"),H=c(C[0]+"e"+(+C[1]+_));return C=(Xe(H)+"e").split("e"),+(C[0]+"e"+(+C[1]-_))}return c(p)}}var wH=mi&&1/Sl(new mi([,-0]))[1]==j?function(o){return new mi(o)}:Hh;function E1(o){return function(c){var p=kt(c);return p==me?qp(c):p==Ue?jj(c):Aj(c,o(c))}}function ur(o,c,p,_,C,H,G,X){var Z=c&S;if(!Z&&typeof o!="function")throw new fn(a);var ue=_?_.length:0;if(ue||(c&=-97,_=C=n),G=G===n?G:wt(De(G),0),X=X===n?X:De(X),ue-=C?C.length:0,c&A){var de=_,he=C;_=C=n}var xe=Z?n:wh(o),_e=[o,c,p,_,C,de,he,H,G,X];if(xe&&LH(_e,xe),o=_e[0],c=_e[1],p=_e[2],_=_e[3],C=_e[4],X=_e[9]=_e[9]===n?Z?0:o.length:wt(_e[9]-ue,0),!X&&c&(w|I)&&(c&=-25),!c||c==b)var ke=yH(o,c,p);else c==w||c==I?ke=vH(o,c,X):(c==k||c==(b|k))&&!C.length?ke=xH(o,c,p,_):ke=Ul.apply(n,_e);var je=xe?s1:j1;return $1(je(ke,_e),o,c)}function T1(o,c,p,_){return o===n||Mn(o,gi[p])&&!Je.call(_,p)?c:o}function C1(o,c,p,_,C,H){return lt(o)&<(c)&&(H.set(c,o),Bl(o,c,n,C1,H),H.delete(c)),o}function bH(o){return ra(o)?n:o}function A1(o,c,p,_,C,H){var G=p&x,X=o.length,Z=c.length;if(X!=Z&&!(G&&Z>X))return!1;var ue=H.get(o),de=H.get(c);if(ue&&de)return ue==c&&de==o;var he=-1,xe=!0,_e=p&v?new yo:n;for(H.set(o,c),H.set(c,o);++he<X;){var ke=o[he],je=c[he];if(_)var Me=G?_(je,ke,he,c,o,H):_(ke,je,he,o,c,H);if(Me!==n){if(Me)continue;xe=!1;break}if(_e){if(!Vp(c,function(Ve,Ge){if(!zs(_e,Ge)&&(ke===Ve||C(ke,Ve,p,_,H)))return _e.push(Ge)})){xe=!1;break}}else if(!(ke===je||C(ke,je,p,_,H))){xe=!1;break}}return H.delete(o),H.delete(c),xe}function SH(o,c,p,_,C,H,G){switch(p){case ln:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case $t:return!(o.byteLength!=c.byteLength||!H(new Cl(o),new Cl(c)));case te:case ne:case Oe:return Mn(+o,+c);case pe:return o.name==c.name&&o.message==c.message;case Qe:case Ze:return o==c+"";case me:var X=qp;case Ue:var Z=_&x;if(X||(X=Sl),o.size!=c.size&&!Z)return!1;var ue=G.get(o);if(ue)return ue==c;_|=v,G.set(o,c);var de=A1(X(o),X(c),_,C,H,G);return G.delete(o),de;case pt:if(Ys)return Ys.call(o)==Ys.call(c)}return!1}function _H(o,c,p,_,C,H){var G=p&x,X=vh(o),Z=X.length,ue=vh(c),de=ue.length;if(Z!=de&&!G)return!1;for(var he=Z;he--;){var xe=X[he];if(!(G?xe in c:Je.call(c,xe)))return!1}var _e=H.get(o),ke=H.get(c);if(_e&&ke)return _e==c&&ke==o;var je=!0;H.set(o,c),H.set(c,o);for(var Me=G;++he<Z;){xe=X[he];var Ve=o[xe],Ge=c[xe];if(_)var en=G?_(Ge,Ve,xe,c,o,H):_(Ve,Ge,xe,o,c,H);if(!(en===n?Ve===Ge||C(Ve,Ge,p,_,H):en)){je=!1;break}Me||(Me=xe=="constructor")}if(je&&!Me){var Rt=o.constructor,tn=c.constructor;Rt!=tn&&"constructor"in o&&"constructor"in c&&!(typeof Rt=="function"&&Rt instanceof Rt&&typeof tn=="function"&&tn instanceof tn)&&(je=!1)}return H.delete(o),H.delete(c),je}function dr(o){return Eh(L1(o,n,U1),o+"")}function vh(o){return XS(o,St,Sh)}function xh(o){return XS(o,Vt,k1)}var wh=Rl?function(o){return Rl.get(o)}:Hh;function Yl(o){for(var c=o.name+"",p=yi[c],_=Je.call(yi,c)?p.length:0;_--;){var C=p[_],H=C.func;if(H==null||H==o)return C.name}return c}function bi(o){var c=Je.call(R,"placeholder")?R:o;return c.placeholder}function Ae(){var o=R.iteratee||jh;return o=o===jh?JS:o,arguments.length?o(arguments[0],arguments[1]):o}function Xl(o,c){var p=o.__data__;return MH(c)?p[typeof c=="string"?"string":"hash"]:p.map}function bh(o){for(var c=St(o),p=c.length;p--;){var _=c[p],C=o[_];c[p]=[_,C,P1(C)]}return c}function wo(o,c){var p=Rj(o,c);return ZS(p)?p:n}function NH(o){var c=Je.call(o,go),p=o[go];try{o[go]=n;var _=!0}catch{}var C=El.call(o);return _&&(c?o[go]=p:delete o[go]),C}var Sh=Xp?function(o){return o==null?[]:(o=et(o),Rr(Xp(o),function(c){return DS.call(o,c)}))}:Bh,k1=Xp?function(o){for(var c=[];o;)Lr(c,Sh(o)),o=Al(o);return c}:Bh,kt=Ot;(Kp&&kt(new Kp(new ArrayBuffer(1)))!=ln||Ws&&kt(new Ws)!=me||Zp&&kt(Zp.resolve())!=Ie||mi&&kt(new mi)!=Ue||Gs&&kt(new Gs)!=cn)&&(kt=function(o){var c=Ot(o),p=c==ae?o.constructor:n,_=p?bo(p):"";if(_)switch(_){case s$:return ln;case a$:return me;case c$:return Ie;case l$:return Ue;case u$:return cn}return c});function IH(o,c,p){for(var _=-1,C=p.length;++_<C;){var H=p[_],G=H.size;switch(H.type){case"drop":o+=G;break;case"dropRight":c-=G;break;case"take":c=At(c,o+G);break;case"takeRight":o=wt(o,c-G);break}}return{start:o,end:c}}function EH(o){var c=o.match(mp);return c?c[1].split(yp):[]}function M1(o,c,p){c=Br(c,o);for(var _=-1,C=c.length,H=!1;++_<C;){var G=qn(c[_]);if(!(H=o!=null&&p(o,G)))break;o=o[G]}return H||++_!=C?H:(C=o==null?0:o.length,!!C&&nu(C)&&fr(G,C)&&(Le(o)||So(o)))}function TH(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Je.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function O1(o){return typeof o.constructor=="function"&&!ta(o)?vi(Al(o)):{}}function CH(o,c,p){var _=o.constructor;switch(c){case $t:return gh(o);case te:case ne:return new _(+o);case ln:return dH(o,p);case Or:case Un:case fo:case po:case Pr:case Ps:case Rs:case Ls:case Ds:return h1(o,p);case me:return new _;case Oe:case Ze:return new _(o);case Qe:return fH(o);case Ue:return new _;case pt:return pH(o)}}function AH(o,c){var p=c.length;if(!p)return o;var _=p-1;return c[_]=(p>1?"& ":"")+c[_],c=c.join(p>2?", ":" "),o.replace(gp,`{
|
|
278
|
-
/* [wrapped with `+c+`] */
|
|
279
|
-
`)}function kH(o){return Le(o)||So(o)||!!(jS&&o&&o[jS])}function fr(o,c){var p=typeof o;return c=c??O,!!c&&(p=="number"||p!="symbol"&&Np.test(o))&&o>-1&&o%1==0&&o<c}function Pt(o,c,p){if(!lt(p))return!1;var _=typeof c;return(_=="number"?Bt(p)&&fr(c,p.length):_=="string"&&c in p)?Mn(p[c],o):!1}function _h(o,c){if(Le(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Qt(o)?!0:dp.test(o)||!up.test(o)||c!=null&&o in et(c)}function MH(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Nh(o){var c=Yl(o),p=R[c];if(typeof p!="function"||!(c in We.prototype))return!1;if(o===p)return!0;var _=wh(p);return!!_&&o===_[0]}function OH(o){return!!PS&&PS in o}var PH=Nl?pr:Vh;function ta(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||gi;return o===p}function P1(o){return o===o&&!lt(o)}function R1(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in et(p))}}function RH(o){var c=eu(o,function(_){return p.size===d&&p.clear(),_}),p=c.cache;return c}function LH(o,c){var p=o[1],_=c[1],C=p|_,H=C<(b|S|M),G=_==M&&p==w||_==M&&p==B&&o[7].length<=c[8]||_==(M|B)&&c[7].length<=c[8]&&p==w;if(!(H||G))return o;_&b&&(o[2]=c[2],C|=p&b?0:N);var X=c[3];if(X){var Z=o[3];o[3]=Z?m1(Z,X,c[4]):X,o[4]=Z?Dr(o[3],f):c[4]}return X=c[5],X&&(Z=o[5],o[5]=Z?y1(Z,X,c[6]):X,o[6]=Z?Dr(o[5],f):c[6]),X=c[7],X&&(o[7]=X),_&M&&(o[8]=o[8]==null?c[8]:At(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=C,o}function DH(o){var c=[];if(o!=null)for(var p in et(o))c.push(p);return c}function jH(o){return El.call(o)}function L1(o,c,p){return c=wt(c===n?o.length-1:c,0),function(){for(var _=arguments,C=-1,H=wt(_.length-c,0),G=re(H);++C<H;)G[C]=_[c+C];C=-1;for(var X=re(c+1);++C<c;)X[C]=_[C];return X[c]=p(G),Kt(o,this,X)}}function D1(o,c){return c.length<2?o:xo(o,gn(c,0,-1))}function $H(o,c){for(var p=o.length,_=At(c.length,p),C=Ht(o);_--;){var H=c[_];o[_]=fr(H,p)?C[H]:n}return o}function Ih(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var j1=H1(s1),na=Qj||function(o,c){return It.setTimeout(o,c)},Eh=H1(aH);function $1(o,c,p){var _=c+"";return Eh(o,AH(_,HH(EH(_),p)))}function H1(o){var c=0,p=0;return function(){var _=r$(),C=F-(_-p);if(p=_,C>0){if(++c>=$)return arguments[0]}else c=0;return o.apply(n,arguments)}}function Kl(o,c){var p=-1,_=o.length,C=_-1;for(c=c===n?_:c;++p<c;){var H=ch(p,C),G=o[H];o[H]=o[p],o[p]=G}return o.length=c,o}var B1=RH(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(fp,function(p,_,C,H){c.push(C?H.replace(wp,"$1"):_||p)}),c});function qn(o){if(typeof o=="string"||Qt(o))return o;var c=o+"";return c=="0"&&1/o==-j?"-0":c}function bo(o){if(o!=null){try{return Il.call(o)}catch{}try{return o+""}catch{}}return""}function HH(o,c){return dn(ee,function(p){var _="_."+p[0];c&p[1]&&!wl(o,_)&&o.push(_)}),o.sort()}function V1(o){if(o instanceof We)return o.clone();var c=new pn(o.__wrapped__,o.__chain__);return c.__actions__=Ht(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function BH(o,c,p){(p?Pt(o,c,p):c===n)?c=1:c=wt(De(c),0);var _=o==null?0:o.length;if(!_||c<1)return[];for(var C=0,H=0,G=re(Ol(_/c));C<_;)G[H++]=gn(o,C,C+=c);return G}function VH(o){for(var c=-1,p=o==null?0:o.length,_=0,C=[];++c<p;){var H=o[c];H&&(C[_++]=H)}return C}function FH(){var o=arguments.length;if(!o)return[];for(var c=re(o-1),p=arguments[0],_=o;_--;)c[_-1]=arguments[_];return Lr(Le(p)?Ht(p):[p],Et(c,1))}var zH=He(function(o,c){return gt(o)?Ks(o,Et(c,1,gt,!0)):[]}),UH=He(function(o,c){var p=mn(c);return gt(p)&&(p=n),gt(o)?Ks(o,Et(c,1,gt,!0),Ae(p,2)):[]}),WH=He(function(o,c){var p=mn(c);return gt(p)&&(p=n),gt(o)?Ks(o,Et(c,1,gt,!0),n,p):[]});function GH(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:De(c),gn(o,c<0?0:c,_)):[]}function qH(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:De(c),c=_-c,gn(o,0,c<0?0:c)):[]}function YH(o,c){return o&&o.length?Fl(o,Ae(c,3),!0,!0):[]}function XH(o,c){return o&&o.length?Fl(o,Ae(c,3),!0):[]}function KH(o,c,p,_){var C=o==null?0:o.length;return C?(p&&typeof p!="number"&&Pt(o,c,p)&&(p=0,_=C),F$(o,c,p,_)):[]}function F1(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var C=p==null?0:De(p);return C<0&&(C=wt(_+C,0)),bl(o,Ae(c,3),C)}function z1(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var C=_-1;return p!==n&&(C=De(p),C=p<0?wt(_+C,0):At(C,_-1)),bl(o,Ae(c,3),C,!0)}function U1(o){var c=o==null?0:o.length;return c?Et(o,1):[]}function ZH(o){var c=o==null?0:o.length;return c?Et(o,j):[]}function JH(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:De(c),Et(o,c)):[]}function QH(o){for(var c=-1,p=o==null?0:o.length,_={};++c<p;){var C=o[c];_[C[0]]=C[1]}return _}function W1(o){return o&&o.length?o[0]:n}function e5(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var C=p==null?0:De(p);return C<0&&(C=wt(_+C,0)),di(o,c,C)}function t5(o){var c=o==null?0:o.length;return c?gn(o,0,-1):[]}var n5=He(function(o){var c=at(o,ph);return c.length&&c[0]===o[0]?rh(c):[]}),r5=He(function(o){var c=mn(o),p=at(o,ph);return c===mn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?rh(p,Ae(c,2)):[]}),o5=He(function(o){var c=mn(o),p=at(o,ph);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?rh(p,n,c):[]});function i5(o,c){return o==null?"":t$.call(o,c)}function mn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function s5(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var C=_;return p!==n&&(C=De(p),C=C<0?wt(_+C,0):At(C,_-1)),c===c?Hj(o,c,C):bl(o,IS,C,!0)}function a5(o,c){return o&&o.length?n1(o,De(c)):n}var c5=He(G1);function G1(o,c){return o&&o.length&&c&&c.length?ah(o,c):o}function l5(o,c,p){return o&&o.length&&c&&c.length?ah(o,c,Ae(p,2)):o}function u5(o,c,p){return o&&o.length&&c&&c.length?ah(o,c,n,p):o}var d5=dr(function(o,c){var p=o==null?0:o.length,_=Qp(o,c);return i1(o,at(c,function(C){return fr(C,p)?+C:C}).sort(g1)),_});function f5(o,c){var p=[];if(!(o&&o.length))return p;var _=-1,C=[],H=o.length;for(c=Ae(c,3);++_<H;){var G=o[_];c(G,_,o)&&(p.push(G),C.push(_))}return i1(o,C),p}function Th(o){return o==null?o:i$.call(o)}function p5(o,c,p){var _=o==null?0:o.length;return _?(p&&typeof p!="number"&&Pt(o,c,p)?(c=0,p=_):(c=c==null?0:De(c),p=p===n?_:De(p)),gn(o,c,p)):[]}function h5(o,c){return Vl(o,c)}function g5(o,c,p){return uh(o,c,Ae(p,2))}function m5(o,c){var p=o==null?0:o.length;if(p){var _=Vl(o,c);if(_<p&&Mn(o[_],c))return _}return-1}function y5(o,c){return Vl(o,c,!0)}function v5(o,c,p){return uh(o,c,Ae(p,2),!0)}function x5(o,c){var p=o==null?0:o.length;if(p){var _=Vl(o,c,!0)-1;if(Mn(o[_],c))return _}return-1}function w5(o){return o&&o.length?a1(o):[]}function b5(o,c){return o&&o.length?a1(o,Ae(c,2)):[]}function S5(o){var c=o==null?0:o.length;return c?gn(o,1,c):[]}function _5(o,c,p){return o&&o.length?(c=p||c===n?1:De(c),gn(o,0,c<0?0:c)):[]}function N5(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:De(c),c=_-c,gn(o,c<0?0:c,_)):[]}function I5(o,c){return o&&o.length?Fl(o,Ae(c,3),!1,!0):[]}function E5(o,c){return o&&o.length?Fl(o,Ae(c,3)):[]}var T5=He(function(o){return Hr(Et(o,1,gt,!0))}),C5=He(function(o){var c=mn(o);return gt(c)&&(c=n),Hr(Et(o,1,gt,!0),Ae(c,2))}),A5=He(function(o){var c=mn(o);return c=typeof c=="function"?c:n,Hr(Et(o,1,gt,!0),n,c)});function k5(o){return o&&o.length?Hr(o):[]}function M5(o,c){return o&&o.length?Hr(o,Ae(c,2)):[]}function O5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Hr(o,n,c):[]}function Ch(o){if(!(o&&o.length))return[];var c=0;return o=Rr(o,function(p){if(gt(p))return c=wt(p.length,c),!0}),Wp(c,function(p){return at(o,Fp(p))})}function q1(o,c){if(!(o&&o.length))return[];var p=Ch(o);return c==null?p:at(p,function(_){return Kt(c,n,_)})}var P5=He(function(o,c){return gt(o)?Ks(o,c):[]}),R5=He(function(o){return fh(Rr(o,gt))}),L5=He(function(o){var c=mn(o);return gt(c)&&(c=n),fh(Rr(o,gt),Ae(c,2))}),D5=He(function(o){var c=mn(o);return c=typeof c=="function"?c:n,fh(Rr(o,gt),n,c)}),j5=He(Ch);function $5(o,c){return d1(o||[],c||[],Xs)}function H5(o,c){return d1(o||[],c||[],Qs)}var B5=He(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,q1(o,p)});function Y1(o){var c=R(o);return c.__chain__=!0,c}function V5(o,c){return c(o),o}function Zl(o,c){return c(o)}var F5=dr(function(o){var c=o.length,p=c?o[0]:0,_=this.__wrapped__,C=function(H){return Qp(H,o)};return c>1||this.__actions__.length||!(_ instanceof We)||!fr(p)?this.thru(C):(_=_.slice(p,+p+(c?1:0)),_.__actions__.push({func:Zl,args:[C],thisArg:n}),new pn(_,this.__chain__).thru(function(H){return c&&!H.length&&H.push(n),H}))});function z5(){return Y1(this)}function U5(){return new pn(this.value(),this.__chain__)}function W5(){this.__values__===n&&(this.__values__=c_(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function G5(){return this}function q5(o){for(var c,p=this;p instanceof Dl;){var _=V1(p);_.__index__=0,_.__values__=n,c?C.__wrapped__=_:c=_;var C=_;p=p.__wrapped__}return C.__wrapped__=o,c}function Y5(){var o=this.__wrapped__;if(o instanceof We){var c=o;return this.__actions__.length&&(c=new We(this)),c=c.reverse(),c.__actions__.push({func:Zl,args:[Th],thisArg:n}),new pn(c,this.__chain__)}return this.thru(Th)}function X5(){return u1(this.__wrapped__,this.__actions__)}var K5=zl(function(o,c,p){Je.call(o,p)?++o[p]:lr(o,p,1)});function Z5(o,c,p){var _=Le(o)?_S:V$;return p&&Pt(o,c,p)&&(c=n),_(o,Ae(c,3))}function J5(o,c){var p=Le(o)?Rr:qS;return p(o,Ae(c,3))}var Q5=b1(F1),e3=b1(z1);function t3(o,c){return Et(Jl(o,c),1)}function n3(o,c){return Et(Jl(o,c),j)}function r3(o,c,p){return p=p===n?1:De(p),Et(Jl(o,c),p)}function X1(o,c){var p=Le(o)?dn:$r;return p(o,Ae(c,3))}function K1(o,c){var p=Le(o)?Sj:GS;return p(o,Ae(c,3))}var o3=zl(function(o,c,p){Je.call(o,p)?o[p].push(c):lr(o,p,[c])});function i3(o,c,p,_){o=Bt(o)?o:_i(o),p=p&&!_?De(p):0;var C=o.length;return p<0&&(p=wt(C+p,0)),ru(o)?p<=C&&o.indexOf(c,p)>-1:!!C&&di(o,c,p)>-1}var s3=He(function(o,c,p){var _=-1,C=typeof c=="function",H=Bt(o)?re(o.length):[];return $r(o,function(G){H[++_]=C?Kt(c,G,p):Zs(G,c,p)}),H}),a3=zl(function(o,c,p){lr(o,p,c)});function Jl(o,c){var p=Le(o)?at:QS;return p(o,Ae(c,3))}function c3(o,c,p,_){return o==null?[]:(Le(c)||(c=c==null?[]:[c]),p=_?n:p,Le(p)||(p=p==null?[]:[p]),r1(o,c,p))}var l3=zl(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function u3(o,c,p){var _=Le(o)?Bp:TS,C=arguments.length<3;return _(o,Ae(c,4),p,C,$r)}function d3(o,c,p){var _=Le(o)?_j:TS,C=arguments.length<3;return _(o,Ae(c,4),p,C,GS)}function f3(o,c){var p=Le(o)?Rr:qS;return p(o,tu(Ae(c,3)))}function p3(o){var c=Le(o)?FS:iH;return c(o)}function h3(o,c,p){(p?Pt(o,c,p):c===n)?c=1:c=De(c);var _=Le(o)?D$:sH;return _(o,c)}function g3(o){var c=Le(o)?j$:cH;return c(o)}function m3(o){if(o==null)return 0;if(Bt(o))return ru(o)?pi(o):o.length;var c=kt(o);return c==me||c==Ue?o.size:ih(o).length}function y3(o,c,p){var _=Le(o)?Vp:lH;return p&&Pt(o,c,p)&&(c=n),_(o,Ae(c,3))}var v3=He(function(o,c){if(o==null)return[];var p=c.length;return p>1&&Pt(o,c[0],c[1])?c=[]:p>2&&Pt(c[0],c[1],c[2])&&(c=[c[0]]),r1(o,Et(c,1),[])}),Ql=Jj||function(){return It.Date.now()};function x3(o,c){if(typeof c!="function")throw new fn(a);return o=De(o),function(){if(--o<1)return c.apply(this,arguments)}}function Z1(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,ur(o,M,n,n,n,n,c)}function J1(o,c){var p;if(typeof c!="function")throw new fn(a);return o=De(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var Ah=He(function(o,c,p){var _=b;if(p.length){var C=Dr(p,bi(Ah));_|=k}return ur(o,_,c,p,C)}),Q1=He(function(o,c,p){var _=b|S;if(p.length){var C=Dr(p,bi(Q1));_|=k}return ur(c,_,o,p,C)});function e_(o,c,p){c=p?n:c;var _=ur(o,w,n,n,n,n,n,c);return _.placeholder=e_.placeholder,_}function t_(o,c,p){c=p?n:c;var _=ur(o,I,n,n,n,n,n,c);return _.placeholder=t_.placeholder,_}function n_(o,c,p){var _,C,H,G,X,Z,ue=0,de=!1,he=!1,xe=!0;if(typeof o!="function")throw new fn(a);c=yn(c)||0,lt(p)&&(de=!!p.leading,he="maxWait"in p,H=he?wt(yn(p.maxWait)||0,c):H,xe="trailing"in p?!!p.trailing:xe);function _e(mt){var On=_,gr=C;return _=C=n,ue=mt,G=o.apply(gr,On),G}function ke(mt){return ue=mt,X=na(Ve,c),de?_e(mt):G}function je(mt){var On=mt-Z,gr=mt-ue,b_=c-On;return he?At(b_,H-gr):b_}function Me(mt){var On=mt-Z,gr=mt-ue;return Z===n||On>=c||On<0||he&&gr>=H}function Ve(){var mt=Ql();if(Me(mt))return Ge(mt);X=na(Ve,je(mt))}function Ge(mt){return X=n,xe&&_?_e(mt):(_=C=n,G)}function en(){X!==n&&f1(X),ue=0,_=Z=C=X=n}function Rt(){return X===n?G:Ge(Ql())}function tn(){var mt=Ql(),On=Me(mt);if(_=arguments,C=this,Z=mt,On){if(X===n)return ke(Z);if(he)return f1(X),X=na(Ve,c),_e(Z)}return X===n&&(X=na(Ve,c)),G}return tn.cancel=en,tn.flush=Rt,tn}var w3=He(function(o,c){return WS(o,1,c)}),b3=He(function(o,c,p){return WS(o,yn(c)||0,p)});function S3(o){return ur(o,U)}function eu(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new fn(a);var p=function(){var _=arguments,C=c?c.apply(this,_):_[0],H=p.cache;if(H.has(C))return H.get(C);var G=o.apply(this,_);return p.cache=H.set(C,G)||H,G};return p.cache=new(eu.Cache||cr),p}eu.Cache=cr;function tu(o){if(typeof o!="function")throw new fn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function _3(o){return J1(2,o)}var N3=uH(function(o,c){c=c.length==1&&Le(c[0])?at(c[0],Zt(Ae())):at(Et(c,1),Zt(Ae()));var p=c.length;return He(function(_){for(var C=-1,H=At(_.length,p);++C<H;)_[C]=c[C].call(this,_[C]);return Kt(o,this,_)})}),kh=He(function(o,c){var p=Dr(c,bi(kh));return ur(o,k,n,c,p)}),r_=He(function(o,c){var p=Dr(c,bi(r_));return ur(o,A,n,c,p)}),I3=dr(function(o,c){return ur(o,B,n,n,n,c)});function E3(o,c){if(typeof o!="function")throw new fn(a);return c=c===n?c:De(c),He(o,c)}function T3(o,c){if(typeof o!="function")throw new fn(a);return c=c==null?0:wt(De(c),0),He(function(p){var _=p[c],C=Vr(p,0,c);return _&&Lr(C,_),Kt(o,this,C)})}function C3(o,c,p){var _=!0,C=!0;if(typeof o!="function")throw new fn(a);return lt(p)&&(_="leading"in p?!!p.leading:_,C="trailing"in p?!!p.trailing:C),n_(o,c,{leading:_,maxWait:c,trailing:C})}function A3(o){return Z1(o,1)}function k3(o,c){return kh(hh(c),o)}function M3(){if(!arguments.length)return[];var o=arguments[0];return Le(o)?o:[o]}function O3(o){return hn(o,m)}function P3(o,c){return c=typeof c=="function"?c:n,hn(o,m,c)}function R3(o){return hn(o,g|m)}function L3(o,c){return c=typeof c=="function"?c:n,hn(o,g|m,c)}function D3(o,c){return c==null||US(o,c,St(c))}function Mn(o,c){return o===c||o!==o&&c!==c}var j3=ql(nh),$3=ql(function(o,c){return o>=c}),So=KS(function(){return arguments}())?KS:function(o){return ht(o)&&Je.call(o,"callee")&&!DS.call(o,"callee")},Le=re.isArray,H3=yS?Zt(yS):q$;function Bt(o){return o!=null&&nu(o.length)&&!pr(o)}function gt(o){return ht(o)&&Bt(o)}function B3(o){return o===!0||o===!1||ht(o)&&Ot(o)==te}var Fr=e$||Vh,V3=vS?Zt(vS):Y$;function F3(o){return ht(o)&&o.nodeType===1&&!ra(o)}function z3(o){if(o==null)return!0;if(Bt(o)&&(Le(o)||typeof o=="string"||typeof o.splice=="function"||Fr(o)||Si(o)||So(o)))return!o.length;var c=kt(o);if(c==me||c==Ue)return!o.size;if(ta(o))return!ih(o).length;for(var p in o)if(Je.call(o,p))return!1;return!0}function U3(o,c){return Js(o,c)}function W3(o,c,p){p=typeof p=="function"?p:n;var _=p?p(o,c):n;return _===n?Js(o,c,n,p):!!_}function Mh(o){if(!ht(o))return!1;var c=Ot(o);return c==pe||c==oe||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function G3(o){return typeof o=="number"&&$S(o)}function pr(o){if(!lt(o))return!1;var c=Ot(o);return c==le||c==ve||c==Q||c==Be}function o_(o){return typeof o=="number"&&o==De(o)}function nu(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=O}function lt(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ht(o){return o!=null&&typeof o=="object"}var i_=xS?Zt(xS):K$;function q3(o,c){return o===c||oh(o,c,bh(c))}function Y3(o,c,p){return p=typeof p=="function"?p:n,oh(o,c,bh(c),p)}function X3(o){return s_(o)&&o!=+o}function K3(o){if(PH(o))throw new Re(s);return ZS(o)}function Z3(o){return o===null}function J3(o){return o==null}function s_(o){return typeof o=="number"||ht(o)&&Ot(o)==Oe}function ra(o){if(!ht(o)||Ot(o)!=ae)return!1;var c=Al(o);if(c===null)return!0;var p=Je.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Il.call(p)==Yj}var Oh=wS?Zt(wS):Z$;function Q3(o){return o_(o)&&o>=-O&&o<=O}var a_=bS?Zt(bS):J$;function ru(o){return typeof o=="string"||!Le(o)&&ht(o)&&Ot(o)==Ze}function Qt(o){return typeof o=="symbol"||ht(o)&&Ot(o)==pt}var Si=SS?Zt(SS):Q$;function eB(o){return o===n}function tB(o){return ht(o)&&kt(o)==cn}function nB(o){return ht(o)&&Ot(o)==Nt}var rB=ql(sh),oB=ql(function(o,c){return o<=c});function c_(o){if(!o)return[];if(Bt(o))return ru(o)?An(o):Ht(o);if(Us&&o[Us])return Dj(o[Us]());var c=kt(o),p=c==me?qp:c==Ue?Sl:_i;return p(o)}function hr(o){if(!o)return o===0?o:0;if(o=yn(o),o===j||o===-j){var c=o<0?-1:1;return c*W}return o===o?o:0}function De(o){var c=hr(o),p=c%1;return c===c?p?c-p:c:0}function l_(o){return o?vo(De(o),0,Y):0}function yn(o){if(typeof o=="number")return o;if(Qt(o))return z;if(lt(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=lt(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=CS(o);var p=bp.test(o);return p||_p.test(o)?xj(o.slice(2),p?2:8):cl.test(o)?z:+o}function u_(o){return Gn(o,Vt(o))}function iB(o){return o?vo(De(o),-O,O):o===0?o:0}function Xe(o){return o==null?"":Jt(o)}var sB=xi(function(o,c){if(ta(c)||Bt(c)){Gn(c,St(c),o);return}for(var p in c)Je.call(c,p)&&Xs(o,p,c[p])}),d_=xi(function(o,c){Gn(c,Vt(c),o)}),ou=xi(function(o,c,p,_){Gn(c,Vt(c),o,_)}),aB=xi(function(o,c,p,_){Gn(c,St(c),o,_)}),cB=dr(Qp);function lB(o,c){var p=vi(o);return c==null?p:zS(p,c)}var uB=He(function(o,c){o=et(o);var p=-1,_=c.length,C=_>2?c[2]:n;for(C&&Pt(c[0],c[1],C)&&(_=1);++p<_;)for(var H=c[p],G=Vt(H),X=-1,Z=G.length;++X<Z;){var ue=G[X],de=o[ue];(de===n||Mn(de,gi[ue])&&!Je.call(o,ue))&&(o[ue]=H[ue])}return o}),dB=He(function(o){return o.push(n,C1),Kt(f_,n,o)});function fB(o,c){return NS(o,Ae(c,3),Wn)}function pB(o,c){return NS(o,Ae(c,3),th)}function hB(o,c){return o==null?o:eh(o,Ae(c,3),Vt)}function gB(o,c){return o==null?o:YS(o,Ae(c,3),Vt)}function mB(o,c){return o&&Wn(o,Ae(c,3))}function yB(o,c){return o&&th(o,Ae(c,3))}function vB(o){return o==null?[]:Hl(o,St(o))}function xB(o){return o==null?[]:Hl(o,Vt(o))}function Ph(o,c,p){var _=o==null?n:xo(o,c);return _===n?p:_}function wB(o,c){return o!=null&&M1(o,c,z$)}function Rh(o,c){return o!=null&&M1(o,c,U$)}var bB=_1(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=El.call(c)),o[c]=p},Dh(Ft)),SB=_1(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=El.call(c)),Je.call(o,c)?o[c].push(p):o[c]=[p]},Ae),_B=He(Zs);function St(o){return Bt(o)?VS(o):ih(o)}function Vt(o){return Bt(o)?VS(o,!0):eH(o)}function NB(o,c){var p={};return c=Ae(c,3),Wn(o,function(_,C,H){lr(p,c(_,C,H),_)}),p}function IB(o,c){var p={};return c=Ae(c,3),Wn(o,function(_,C,H){lr(p,C,c(_,C,H))}),p}var EB=xi(function(o,c,p){Bl(o,c,p)}),f_=xi(function(o,c,p,_){Bl(o,c,p,_)}),TB=dr(function(o,c){var p={};if(o==null)return p;var _=!1;c=at(c,function(H){return H=Br(H,o),_||(_=H.length>1),H}),Gn(o,xh(o),p),_&&(p=hn(p,g|h|m,bH));for(var C=c.length;C--;)dh(p,c[C]);return p});function CB(o,c){return p_(o,tu(Ae(c)))}var AB=dr(function(o,c){return o==null?{}:nH(o,c)});function p_(o,c){if(o==null)return{};var p=at(xh(o),function(_){return[_]});return c=Ae(c),o1(o,p,function(_,C){return c(_,C[0])})}function kB(o,c,p){c=Br(c,o);var _=-1,C=c.length;for(C||(C=1,o=n);++_<C;){var H=o==null?n:o[qn(c[_])];H===n&&(_=C,H=p),o=pr(H)?H.call(o):H}return o}function MB(o,c,p){return o==null?o:Qs(o,c,p)}function OB(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:Qs(o,c,p,_)}var h_=E1(St),g_=E1(Vt);function PB(o,c,p){var _=Le(o),C=_||Fr(o)||Si(o);if(c=Ae(c,4),p==null){var H=o&&o.constructor;C?p=_?new H:[]:lt(o)?p=pr(H)?vi(Al(o)):{}:p={}}return(C?dn:Wn)(o,function(G,X,Z){return c(p,G,X,Z)}),p}function RB(o,c){return o==null?!0:dh(o,c)}function LB(o,c,p){return o==null?o:l1(o,c,hh(p))}function DB(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:l1(o,c,hh(p),_)}function _i(o){return o==null?[]:Gp(o,St(o))}function jB(o){return o==null?[]:Gp(o,Vt(o))}function $B(o,c,p){return p===n&&(p=c,c=n),p!==n&&(p=yn(p),p=p===p?p:0),c!==n&&(c=yn(c),c=c===c?c:0),vo(yn(o),c,p)}function HB(o,c,p){return c=hr(c),p===n?(p=c,c=0):p=hr(p),o=yn(o),W$(o,c,p)}function BB(o,c,p){if(p&&typeof p!="boolean"&&Pt(o,c,p)&&(c=p=n),p===n&&(typeof c=="boolean"?(p=c,c=n):typeof o=="boolean"&&(p=o,o=n)),o===n&&c===n?(o=0,c=1):(o=hr(o),c===n?(c=o,o=0):c=hr(c)),o>c){var _=o;o=c,c=_}if(p||o%1||c%1){var C=HS();return At(o+C*(c-o+vj("1e-"+((C+"").length-1))),c)}return ch(o,c)}var VB=wi(function(o,c,p){return c=c.toLowerCase(),o+(p?m_(c):c)});function m_(o){return Lh(Xe(o).toLowerCase())}function y_(o){return o=Xe(o),o&&o.replace(Ip,Mj).replace(cj,"")}function FB(o,c,p){o=Xe(o),c=Jt(c);var _=o.length;p=p===n?_:vo(De(p),0,_);var C=p;return p-=c.length,p>=0&&o.slice(p,C)==c}function zB(o){return o=Xe(o),o&&cp.test(o)?o.replace(ol,Oj):o}function UB(o){return o=Xe(o),o&&pp.test(o)?o.replace(js,"\\$&"):o}var WB=wi(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),GB=wi(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),qB=w1("toLowerCase");function YB(o,c,p){o=Xe(o),c=De(c);var _=c?pi(o):0;if(!c||_>=c)return o;var C=(c-_)/2;return Gl(Pl(C),p)+o+Gl(Ol(C),p)}function XB(o,c,p){o=Xe(o),c=De(c);var _=c?pi(o):0;return c&&_<c?o+Gl(c-_,p):o}function KB(o,c,p){o=Xe(o),c=De(c);var _=c?pi(o):0;return c&&_<c?Gl(c-_,p)+o:o}function ZB(o,c,p){return p||c==null?c=0:c&&(c=+c),o$(Xe(o).replace($s,""),c||0)}function JB(o,c,p){return(p?Pt(o,c,p):c===n)?c=1:c=De(c),lh(Xe(o),c)}function QB(){var o=arguments,c=Xe(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var eV=wi(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function tV(o,c,p){return p&&typeof p!="number"&&Pt(o,c,p)&&(c=p=n),p=p===n?Y:p>>>0,p?(o=Xe(o),o&&(typeof c=="string"||c!=null&&!Oh(c))&&(c=Jt(c),!c&&fi(o))?Vr(An(o),0,p):o.split(c,p)):[]}var nV=wi(function(o,c,p){return o+(p?" ":"")+Lh(c)});function rV(o,c,p){return o=Xe(o),p=p==null?0:vo(De(p),0,o.length),c=Jt(c),o.slice(p,p+c.length)==c}function oV(o,c,p){var _=R.templateSettings;p&&Pt(o,c,p)&&(c=n),o=Xe(o),c=ou({},c,_,T1);var C=ou({},c.imports,_.imports,T1),H=St(C),G=Gp(C,H),X,Z,ue=0,de=c.interpolate||si,he="__p += '",xe=Yp((c.escape||si).source+"|"+de.source+"|"+(de===sl?al:si).source+"|"+(c.evaluate||si).source+"|$","g"),_e="//# sourceURL="+(Je.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pj+"]")+`
|
|
280
|
-
`;o.replace(xe,function(Me,Ve,Ge,en,Rt,tn){return Ge||(Ge=en),he+=o.slice(ue,tn).replace(ll,Pj),Ve&&(X=!0,he+=`' +
|
|
281
|
-
__e(`+Ve+`) +
|
|
282
|
-
'`),Rt&&(Z=!0,he+=`';
|
|
283
|
-
`+Rt+`;
|
|
284
|
-
__p += '`),Ge&&(he+=`' +
|
|
285
|
-
((__t = (`+Ge+`)) == null ? '' : __t) +
|
|
286
|
-
'`),ue=tn+Me.length,Me}),he+=`';
|
|
287
|
-
`;var ke=Je.call(c,"variable")&&c.variable;if(!ke)he=`with (obj) {
|
|
288
|
-
`+he+`
|
|
289
|
-
}
|
|
290
|
-
`;else if(xp.test(ke))throw new Re(l);he=(Z?he.replace(op,""):he).replace(ip,"$1").replace(sp,"$1;"),he="function("+(ke||"obj")+`) {
|
|
291
|
-
`+(ke?"":`obj || (obj = {});
|
|
292
|
-
`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(Z?`, __j = Array.prototype.join;
|
|
293
|
-
function print() { __p += __j.call(arguments, '') }
|
|
294
|
-
`:`;
|
|
295
|
-
`)+he+`return __p
|
|
296
|
-
}`;var je=x_(function(){return qe(H,_e+"return "+he).apply(n,G)});if(je.source=he,Mh(je))throw je;return je}function iV(o){return Xe(o).toLowerCase()}function sV(o){return Xe(o).toUpperCase()}function aV(o,c,p){if(o=Xe(o),o&&(p||c===n))return CS(o);if(!o||!(c=Jt(c)))return o;var _=An(o),C=An(c),H=AS(_,C),G=kS(_,C)+1;return Vr(_,H,G).join("")}function cV(o,c,p){if(o=Xe(o),o&&(p||c===n))return o.slice(0,OS(o)+1);if(!o||!(c=Jt(c)))return o;var _=An(o),C=kS(_,An(c))+1;return Vr(_,0,C).join("")}function lV(o,c,p){if(o=Xe(o),o&&(p||c===n))return o.replace($s,"");if(!o||!(c=Jt(c)))return o;var _=An(o),C=AS(_,An(c));return Vr(_,C).join("")}function uV(o,c){var p=q,_=D;if(lt(c)){var C="separator"in c?c.separator:C;p="length"in c?De(c.length):p,_="omission"in c?Jt(c.omission):_}o=Xe(o);var H=o.length;if(fi(o)){var G=An(o);H=G.length}if(p>=H)return o;var X=p-pi(_);if(X<1)return _;var Z=G?Vr(G,0,X).join(""):o.slice(0,X);if(C===n)return Z+_;if(G&&(X+=Z.length-X),Oh(C)){if(o.slice(X).search(C)){var ue,de=Z;for(C.global||(C=Yp(C.source,Xe(Hs.exec(C))+"g")),C.lastIndex=0;ue=C.exec(de);)var he=ue.index;Z=Z.slice(0,he===n?X:he)}}else if(o.indexOf(Jt(C),X)!=X){var xe=Z.lastIndexOf(C);xe>-1&&(Z=Z.slice(0,xe))}return Z+_}function dV(o){return o=Xe(o),o&&ap.test(o)?o.replace(rl,Bj):o}var fV=wi(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Lh=w1("toUpperCase");function v_(o,c,p){return o=Xe(o),c=p?n:c,c===n?Lj(o)?zj(o):Ej(o):o.match(c)||[]}var x_=He(function(o,c){try{return Kt(o,n,c)}catch(p){return Mh(p)?p:new Re(p)}}),pV=dr(function(o,c){return dn(c,function(p){p=qn(p),lr(o,p,Ah(o[p],o))}),o});function hV(o){var c=o==null?0:o.length,p=Ae();return o=c?at(o,function(_){if(typeof _[1]!="function")throw new fn(a);return[p(_[0]),_[1]]}):[],He(function(_){for(var C=-1;++C<c;){var H=o[C];if(Kt(H[0],this,_))return Kt(H[1],this,_)}})}function gV(o){return B$(hn(o,g))}function Dh(o){return function(){return o}}function mV(o,c){return o==null||o!==o?c:o}var yV=S1(),vV=S1(!0);function Ft(o){return o}function jh(o){return JS(typeof o=="function"?o:hn(o,g))}function xV(o){return e1(hn(o,g))}function wV(o,c){return t1(o,hn(c,g))}var bV=He(function(o,c){return function(p){return Zs(p,o,c)}}),SV=He(function(o,c){return function(p){return Zs(o,p,c)}});function $h(o,c,p){var _=St(c),C=Hl(c,_);p==null&&!(lt(c)&&(C.length||!_.length))&&(p=c,c=o,o=this,C=Hl(c,St(c)));var H=!(lt(p)&&"chain"in p)||!!p.chain,G=pr(o);return dn(C,function(X){var Z=c[X];o[X]=Z,G&&(o.prototype[X]=function(){var ue=this.__chain__;if(H||ue){var de=o(this.__wrapped__),he=de.__actions__=Ht(this.__actions__);return he.push({func:Z,args:arguments,thisArg:o}),de.__chain__=ue,de}return Z.apply(o,Lr([this.value()],arguments))})}),o}function _V(){return It._===this&&(It._=Xj),this}function Hh(){}function NV(o){return o=De(o),He(function(c){return n1(c,o)})}var IV=mh(at),EV=mh(_S),TV=mh(Vp);function w_(o){return _h(o)?Fp(qn(o)):rH(o)}function CV(o){return function(c){return o==null?n:xo(o,c)}}var AV=N1(),kV=N1(!0);function Bh(){return[]}function Vh(){return!1}function MV(){return{}}function OV(){return""}function PV(){return!0}function RV(o,c){if(o=De(o),o<1||o>O)return[];var p=Y,_=At(o,Y);c=Ae(c),o-=Y;for(var C=Wp(_,c);++p<o;)c(p);return C}function LV(o){return Le(o)?at(o,qn):Qt(o)?[o]:Ht(B1(Xe(o)))}function DV(o){var c=++qj;return Xe(o)+c}var jV=Wl(function(o,c){return o+c},0),$V=yh("ceil"),HV=Wl(function(o,c){return o/c},1),BV=yh("floor");function VV(o){return o&&o.length?$l(o,Ft,nh):n}function FV(o,c){return o&&o.length?$l(o,Ae(c,2),nh):n}function zV(o){return ES(o,Ft)}function UV(o,c){return ES(o,Ae(c,2))}function WV(o){return o&&o.length?$l(o,Ft,sh):n}function GV(o,c){return o&&o.length?$l(o,Ae(c,2),sh):n}var qV=Wl(function(o,c){return o*c},1),YV=yh("round"),XV=Wl(function(o,c){return o-c},0);function KV(o){return o&&o.length?Up(o,Ft):0}function ZV(o,c){return o&&o.length?Up(o,Ae(c,2)):0}return R.after=x3,R.ary=Z1,R.assign=sB,R.assignIn=d_,R.assignInWith=ou,R.assignWith=aB,R.at=cB,R.before=J1,R.bind=Ah,R.bindAll=pV,R.bindKey=Q1,R.castArray=M3,R.chain=Y1,R.chunk=BH,R.compact=VH,R.concat=FH,R.cond=hV,R.conforms=gV,R.constant=Dh,R.countBy=K5,R.create=lB,R.curry=e_,R.curryRight=t_,R.debounce=n_,R.defaults=uB,R.defaultsDeep=dB,R.defer=w3,R.delay=b3,R.difference=zH,R.differenceBy=UH,R.differenceWith=WH,R.drop=GH,R.dropRight=qH,R.dropRightWhile=YH,R.dropWhile=XH,R.fill=KH,R.filter=J5,R.flatMap=t3,R.flatMapDeep=n3,R.flatMapDepth=r3,R.flatten=U1,R.flattenDeep=ZH,R.flattenDepth=JH,R.flip=S3,R.flow=yV,R.flowRight=vV,R.fromPairs=QH,R.functions=vB,R.functionsIn=xB,R.groupBy=o3,R.initial=t5,R.intersection=n5,R.intersectionBy=r5,R.intersectionWith=o5,R.invert=bB,R.invertBy=SB,R.invokeMap=s3,R.iteratee=jh,R.keyBy=a3,R.keys=St,R.keysIn=Vt,R.map=Jl,R.mapKeys=NB,R.mapValues=IB,R.matches=xV,R.matchesProperty=wV,R.memoize=eu,R.merge=EB,R.mergeWith=f_,R.method=bV,R.methodOf=SV,R.mixin=$h,R.negate=tu,R.nthArg=NV,R.omit=TB,R.omitBy=CB,R.once=_3,R.orderBy=c3,R.over=IV,R.overArgs=N3,R.overEvery=EV,R.overSome=TV,R.partial=kh,R.partialRight=r_,R.partition=l3,R.pick=AB,R.pickBy=p_,R.property=w_,R.propertyOf=CV,R.pull=c5,R.pullAll=G1,R.pullAllBy=l5,R.pullAllWith=u5,R.pullAt=d5,R.range=AV,R.rangeRight=kV,R.rearg=I3,R.reject=f3,R.remove=f5,R.rest=E3,R.reverse=Th,R.sampleSize=h3,R.set=MB,R.setWith=OB,R.shuffle=g3,R.slice=p5,R.sortBy=v3,R.sortedUniq=w5,R.sortedUniqBy=b5,R.split=tV,R.spread=T3,R.tail=S5,R.take=_5,R.takeRight=N5,R.takeRightWhile=I5,R.takeWhile=E5,R.tap=V5,R.throttle=C3,R.thru=Zl,R.toArray=c_,R.toPairs=h_,R.toPairsIn=g_,R.toPath=LV,R.toPlainObject=u_,R.transform=PB,R.unary=A3,R.union=T5,R.unionBy=C5,R.unionWith=A5,R.uniq=k5,R.uniqBy=M5,R.uniqWith=O5,R.unset=RB,R.unzip=Ch,R.unzipWith=q1,R.update=LB,R.updateWith=DB,R.values=_i,R.valuesIn=jB,R.without=P5,R.words=v_,R.wrap=k3,R.xor=R5,R.xorBy=L5,R.xorWith=D5,R.zip=j5,R.zipObject=$5,R.zipObjectDeep=H5,R.zipWith=B5,R.entries=h_,R.entriesIn=g_,R.extend=d_,R.extendWith=ou,$h(R,R),R.add=jV,R.attempt=x_,R.camelCase=VB,R.capitalize=m_,R.ceil=$V,R.clamp=$B,R.clone=O3,R.cloneDeep=R3,R.cloneDeepWith=L3,R.cloneWith=P3,R.conformsTo=D3,R.deburr=y_,R.defaultTo=mV,R.divide=HV,R.endsWith=FB,R.eq=Mn,R.escape=zB,R.escapeRegExp=UB,R.every=Z5,R.find=Q5,R.findIndex=F1,R.findKey=fB,R.findLast=e3,R.findLastIndex=z1,R.findLastKey=pB,R.floor=BV,R.forEach=X1,R.forEachRight=K1,R.forIn=hB,R.forInRight=gB,R.forOwn=mB,R.forOwnRight=yB,R.get=Ph,R.gt=j3,R.gte=$3,R.has=wB,R.hasIn=Rh,R.head=W1,R.identity=Ft,R.includes=i3,R.indexOf=e5,R.inRange=HB,R.invoke=_B,R.isArguments=So,R.isArray=Le,R.isArrayBuffer=H3,R.isArrayLike=Bt,R.isArrayLikeObject=gt,R.isBoolean=B3,R.isBuffer=Fr,R.isDate=V3,R.isElement=F3,R.isEmpty=z3,R.isEqual=U3,R.isEqualWith=W3,R.isError=Mh,R.isFinite=G3,R.isFunction=pr,R.isInteger=o_,R.isLength=nu,R.isMap=i_,R.isMatch=q3,R.isMatchWith=Y3,R.isNaN=X3,R.isNative=K3,R.isNil=J3,R.isNull=Z3,R.isNumber=s_,R.isObject=lt,R.isObjectLike=ht,R.isPlainObject=ra,R.isRegExp=Oh,R.isSafeInteger=Q3,R.isSet=a_,R.isString=ru,R.isSymbol=Qt,R.isTypedArray=Si,R.isUndefined=eB,R.isWeakMap=tB,R.isWeakSet=nB,R.join=i5,R.kebabCase=WB,R.last=mn,R.lastIndexOf=s5,R.lowerCase=GB,R.lowerFirst=qB,R.lt=rB,R.lte=oB,R.max=VV,R.maxBy=FV,R.mean=zV,R.meanBy=UV,R.min=WV,R.minBy=GV,R.stubArray=Bh,R.stubFalse=Vh,R.stubObject=MV,R.stubString=OV,R.stubTrue=PV,R.multiply=qV,R.nth=a5,R.noConflict=_V,R.noop=Hh,R.now=Ql,R.pad=YB,R.padEnd=XB,R.padStart=KB,R.parseInt=ZB,R.random=BB,R.reduce=u3,R.reduceRight=d3,R.repeat=JB,R.replace=QB,R.result=kB,R.round=YV,R.runInContext=K,R.sample=p3,R.size=m3,R.snakeCase=eV,R.some=y3,R.sortedIndex=h5,R.sortedIndexBy=g5,R.sortedIndexOf=m5,R.sortedLastIndex=y5,R.sortedLastIndexBy=v5,R.sortedLastIndexOf=x5,R.startCase=nV,R.startsWith=rV,R.subtract=XV,R.sum=KV,R.sumBy=ZV,R.template=oV,R.times=RV,R.toFinite=hr,R.toInteger=De,R.toLength=l_,R.toLower=iV,R.toNumber=yn,R.toSafeInteger=iB,R.toString=Xe,R.toUpper=sV,R.trim=aV,R.trimEnd=cV,R.trimStart=lV,R.truncate=uV,R.unescape=dV,R.uniqueId=DV,R.upperCase=fV,R.upperFirst=Lh,R.each=X1,R.eachRight=K1,R.first=W1,$h(R,function(){var o={};return Wn(R,function(c,p){Je.call(R.prototype,p)||(o[p]=c)}),o}(),{chain:!1}),R.VERSION=r,dn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){R[o].placeholder=R}),dn(["drop","take"],function(o,c){We.prototype[o]=function(p){p=p===n?1:wt(De(p),0);var _=this.__filtered__&&!c?new We(this):this.clone();return _.__filtered__?_.__takeCount__=At(p,_.__takeCount__):_.__views__.push({size:At(p,Y),type:o+(_.__dir__<0?"Right":"")}),_},We.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),dn(["filter","map","takeWhile"],function(o,c){var p=c+1,_=p==E||p==L;We.prototype[o]=function(C){var H=this.clone();return H.__iteratees__.push({iteratee:Ae(C,3),type:p}),H.__filtered__=H.__filtered__||_,H}}),dn(["head","last"],function(o,c){var p="take"+(c?"Right":"");We.prototype[o]=function(){return this[p](1).value()[0]}}),dn(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");We.prototype[o]=function(){return this.__filtered__?new We(this):this[p](1)}}),We.prototype.compact=function(){return this.filter(Ft)},We.prototype.find=function(o){return this.filter(o).head()},We.prototype.findLast=function(o){return this.reverse().find(o)},We.prototype.invokeMap=He(function(o,c){return typeof o=="function"?new We(this):this.map(function(p){return Zs(p,o,c)})}),We.prototype.reject=function(o){return this.filter(tu(Ae(o)))},We.prototype.slice=function(o,c){o=De(o);var p=this;return p.__filtered__&&(o>0||c<0)?new We(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=De(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},We.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},We.prototype.toArray=function(){return this.take(Y)},Wn(We.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),_=/^(?:head|last)$/.test(c),C=R[_?"take"+(c=="last"?"Right":""):c],H=_||/^find/.test(c);C&&(R.prototype[c]=function(){var G=this.__wrapped__,X=_?[1]:arguments,Z=G instanceof We,ue=X[0],de=Z||Le(G),he=function(Ve){var Ge=C.apply(R,Lr([Ve],X));return _&&xe?Ge[0]:Ge};de&&p&&typeof ue=="function"&&ue.length!=1&&(Z=de=!1);var xe=this.__chain__,_e=!!this.__actions__.length,ke=H&&!xe,je=Z&&!_e;if(!H&&de){G=je?G:new We(this);var Me=o.apply(G,X);return Me.__actions__.push({func:Zl,args:[he],thisArg:n}),new pn(Me,xe)}return ke&&je?o.apply(this,X):(Me=this.thru(he),ke?_?Me.value()[0]:Me.value():Me)})}),dn(["pop","push","shift","sort","splice","unshift"],function(o){var c=_l[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",_=/^(?:pop|shift)$/.test(o);R.prototype[o]=function(){var C=arguments;if(_&&!this.__chain__){var H=this.value();return c.apply(Le(H)?H:[],C)}return this[p](function(G){return c.apply(Le(G)?G:[],C)})}}),Wn(We.prototype,function(o,c){var p=R[c];if(p){var _=p.name+"";Je.call(yi,_)||(yi[_]=[]),yi[_].push({name:c,func:p})}}),yi[Ul(n,S).name]=[{name:"wrapper",func:n}],We.prototype.clone=d$,We.prototype.reverse=f$,We.prototype.value=p$,R.prototype.at=F5,R.prototype.chain=z5,R.prototype.commit=U5,R.prototype.next=W5,R.prototype.plant=q5,R.prototype.reverse=Y5,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=X5,R.prototype.first=R.prototype.head,Us&&(R.prototype[Us]=G5),R},hi=Uj();ho?((ho.exports=hi)._=hi,jp._=hi):It._=hi}).call(TL)}(gs,gs.exports)),gs.exports}var AL=CL();const kL=Uh(AL);function rw(e,t,n=!0){let r;if(t?.handle){const{id:a,name:l,dataType:u,inferredDataType:d,...f}=t.handle;r=f}const i=(t?.handle?.inferredDataType||t?.handle?.dataType)&&!t?.resetInferredType?t?.handle?.inferredDataType||t?.handle?.dataType:void 0,s=kL.cloneDeep({inferredDataType:i,...t?.overrideDataType?{dataType:i}:{},...t?.handle?.dataType?.dataTypeObject&&t?.handle?.dataType?.dataTypeUniqueId&&r?r:{},...t?.overrideName&&t?.handle?.name?{name:t.handle.name}:{}});return n?(Object.assign(e,s),e):Bi(e,a=>(Object.assign(a,s),a))}function df(e,t,n,r=!0){return r?tw(e,i=>{i.dataType?.dataTypeUniqueId===t&&rw(i,n)}):Bi(e,i=>(tw(i,s=>{s.dataType?.dataTypeUniqueId===t&&rw(s,n)}),i))}const Qo={locationInContextMenu:["Standard Nodes"],priorityInContextMenu:200},ow={locationInContextMenu:["Group Nodes"],priorityInContextMenu:100},ir=["groupInfer","loopInfer","condition","bindLoopNodes"],ze={[ir[0]]:ir[0],[ir[1]]:ir[1],[ir[2]]:ir[2],[ir[3]]:ir[3]},In=["groupInput","groupOutput","loopStart","loopEnd","loopStop"],Te={[In[0]]:In[0],[In[1]]:In[1],[In[2]]:In[2],[In[3]]:In[3],[In[4]]:In[4]},ML={[ze.groupInfer]:{name:"Group Infer",underlyingType:"inferFromConnection",color:"#333333"},[ze.loopInfer]:{name:"Loop Infer",underlyingType:"inferFromConnection",color:"#333333"},[ze.condition]:{name:"Condition",underlyingType:"boolean",color:"#cca6d6",allowInput:!0},[ze.bindLoopNodes]:{name:"Bind Loop Nodes",underlyingType:"noEquivalent",color:"#8c52d1",maxConnections:1}},OL={[Te.groupInput]:{name:"Group Input",headerColor:"#1d1d1d",...Qo,inputs:[],outputs:[{name:"",dataType:ze.groupInfer}]},[Te.groupOutput]:{name:"Group Output",headerColor:"#1d1d1d",...Qo,inputs:[{name:"",dataType:ze.groupInfer}],outputs:[]},[Te.loopStart]:{name:"Loop Start",headerColor:"#1d1d1d",...Qo,inputs:[{name:"",dataType:ze.loopInfer}],outputs:[{name:"Bind Loop Nodes",dataType:ze.bindLoopNodes},{name:"",dataType:ze.loopInfer}]},[Te.loopStop]:{name:"Loop Stop",headerColor:"#1d1d1d",...Qo,inputs:[{name:"Bind Loop Nodes",dataType:ze.bindLoopNodes},{name:"Continue If Condition Is True",dataType:ze.condition},{name:"",dataType:ze.loopInfer}],outputs:[{name:"Bind Loop Nodes",dataType:ze.bindLoopNodes},{name:"",dataType:ze.loopInfer}]},[Te.loopEnd]:{name:"Loop End",headerColor:"#1d1d1d",...Qo,inputs:[{name:"Bind Loop Nodes",dataType:ze.bindLoopNodes},{name:"",dataType:ze.loopInfer}],outputs:[{name:"",dataType:ze.loopInfer}]}},Mc=0,Oc=1,Pc=2,Rc=1,Lc=1,Dc=0;function PL(e,t,n,r,i,s,a,l,u,d,f){//!== is basically xor for boolean, we are checking if one is true and the other is false
|
|
297
|
-
if(f&&(a&&u)!==(l&&d)){const g=d?n:t,h=d?"input":"output",m=Cr(e.dataTypes,e.nodes[g].data.nodeTypeUniqueId,e.typeOfNodes,{type:h,index1:0,index2:void 0}),x=d?i.name:r.name,v=d?i.inferredDataType?.dataTypeUniqueId:r.inferredDataType?.dataTypeUniqueId,b=d?i.inferredDataType?.dataTypeObject.allowInput:r.inferredDataType?.dataTypeObject.allowInput,S=d?i.inferredDataType?.dataTypeObject.maxConnections:r.inferredDataType?.dataTypeObject.maxConnections;if(!x||!v)return{validation:{isValid:!1,reason:"Handle to add name, data type, or allow input not found"}};if(!m)return{validation:{isValid:!1,reason:"New duplicate handle not found"}};co(e.nodes[g].data,{type:h,index1:-1,index2:void 0},0,m,!0,"after"),dw(s,f.nodeType,{name:x,dataType:v,allowInput:b,maxConnections:S},{type:d?"output":"input",index1:-1,index2:void 0},"after")}return{validation:{isValid:!0}}}function jc(e){return e===Te.groupInput||e===Te.groupOutput}function $c(e,t){return e===Te.loopStart?t==="input"?Mc:Oc:e===Te.loopStop?t==="input"?Pc:Rc:t==="input"?Lc:Dc}function Tt(e){return e===Te.loopStart||e===Te.loopEnd||e===Te.loopStop}function RL(e,t,n,r,i){const s=e.nodes[t],a=e.nodes[n],l=s.data.nodeTypeUniqueId,u=a.data.nodeTypeUniqueId;if(!l||!u)return{validation:{isValid:!1,reason:"Source or target node type not found"}};const d=Tt(l),f=Tt(u);if(!d&&!f)return{validation:{isValid:!0}};if(d&&r){const g=Cr(e.dataTypes,l,e.typeOfNodes,{type:"input",index1:$c(l,"input"),index2:void 0});if(!g)return{validation:{isValid:!1,reason:"New duplicate input handle not found for source loop node"}};co(s.data,{type:"input",index1:-1,index2:void 0},0,g,!0,"after");const h=Cr(e.dataTypes,l,e.typeOfNodes,{type:"output",index1:$c(l,"output"),index2:void 0});if(!h)return{validation:{isValid:!1,reason:"New duplicate output handle not found for source loop node"}};co(s.data,{type:"output",index1:-1,index2:void 0},0,h,!0,"after")}if(f&&i){const g=Cr(e.dataTypes,u,e.typeOfNodes,{type:"input",index1:$c(u,"input"),index2:void 0});if(!g)return{validation:{isValid:!1,reason:"New duplicate input handle not found for target loop node"}};co(a.data,{type:"input",index1:-1,index2:void 0},0,g,!0,"after");const h=Cr(e.dataTypes,u,e.typeOfNodes,{type:"output",index1:$c(u,"output"),index2:void 0});if(!h)return{validation:{isValid:!1,reason:"New duplicate output handle not found for target loop node"}};co(a.data,{type:"output",index1:-1,index2:void 0},0,h,!0,"after")}return{validation:{isValid:!0}}}function iw(e,t){const n=[t],r=new Set;for(;n.length>0;){const i=n.shift();if(!i||r.has(i))continue;r.add(i);const s=e.nodes.find(u=>u.id===i);if(!s)continue;const a=Qi(s,e.nodes,e.edges);for(const u of a)r.has(u.id)||n.push(u.id);const l=gc(s,e.nodes,e.edges);for(const u of l)r.has(u.id)||n.push(u.id)}return r}function ff(e,t){const n=new Set,r=new Set;{const i=[t.loopStart.id,t.loopStop.id],s=new Set;for(;i.length>0;){const a=i.shift();if(!a||s.has(a))continue;s.add(a),a!==t.loopStart.id&&a!==t.loopStop.id&&n.add(a);const l=e.nodes.find(f=>f.id===a);if(!l)continue;const u=l.id!==t.loopStop.id?Qi(l,e.nodes,e.edges):[];for(const f of u)f.id===t.loopStart.id||f.id===t.loopStop.id||f.id===t.loopEnd.id||s.has(f.id)||i.push(f.id);const d=l.id!==t.loopStart.id?gc(l,e.nodes,e.edges):[];for(const f of d)f.id===t.loopStart.id||f.id===t.loopStop.id||f.id===t.loopEnd.id||s.has(f.id)||i.push(f.id)}}{const i=[t.loopStop.id,t.loopEnd.id],s=new Set;for(;i.length>0;){const a=i.shift();if(!a||s.has(a))continue;s.add(a),a!==t.loopStop.id&&a!==t.loopEnd.id&&r.add(a);const l=e.nodes.find(f=>f.id===a);if(!l)continue;const u=l.id!==t.loopEnd.id?Qi(l,e.nodes,e.edges):[];for(const f of u)f.id===t.loopStart.id||f.id===t.loopStop.id||f.id===t.loopEnd.id||s.has(f.id)||i.push(f.id);const d=l.id!==t.loopStop.id?gc(l,e.nodes,e.edges):[];for(const f of d)f.id===t.loopStart.id||f.id===t.loopStop.id||f.id===t.loopEnd.id||s.has(f.id)||i.push(f.id)}}return{nodesInRegionStartToStop:n,nodesInRegionStopToEnd:r}}function sw(e,t,n=[],r="none"){const i={},s=new Set(n),a=[t.id+"-"+r],l=new Set;for(;a.length>0;){const u=a.shift();if(!u)continue;const[d,f]=u.split("-");if(!d||l.has(d))continue;l.add(d);const g=e.nodes.find(m=>m.id===d);if(!g)continue;const h=g.data.nodeTypeUniqueId&&Tt(g.data.nodeTypeUniqueId)&&!s.has(g.id);if(h&&(i[g.id+"-"+f]=g),!h||f==="output"){const m=Qi(g,e.nodes,e.edges);for(const x of m)l.has(x.id)||a.push(x.id+"-input")}if(!h||f==="input"){const m=gc(g,e.nodes,e.edges);for(const x of m)l.has(x.id)||a.push(x.id+"-output")}}return{boundaryLoopNodes:i}}function ei(e,t){let n,r,i;if(t.data.nodeTypeUniqueId===Te.loopStart){n=t;const s=bt({type:"output",index1:0,index2:void 0},t.data)?.value?.id;if(!s)return;const a=e.edges.find(g=>g.sourceHandle===s);if(!a)return;const l=e.nodes.find(g=>g.id===a.target);if(!l||l.data.nodeTypeUniqueId!==Te.loopStop)return;r=l;const u=bt({type:"output",index1:0,index2:void 0},l.data)?.value?.id;if(!u)return;const d=e.edges.find(g=>g.sourceHandle===u);if(!d)return;const f=e.nodes.find(g=>g.id===d.target);if(!f||f.data.nodeTypeUniqueId!==Te.loopEnd)return;i=f}else if(t.data.nodeTypeUniqueId===Te.loopStop){r=t;const s=bt({type:"input",index1:0,index2:void 0},t.data)?.value?.id;if(!s)return;const a=e.edges.find(g=>g.targetHandle===s);if(!a)return;const l=e.nodes.find(g=>g.id===a.source);if(!l||l.data.nodeTypeUniqueId!==Te.loopStart)return;n=l;const u=bt({type:"output",index1:0,index2:void 0},t.data)?.value?.id;if(!u)return;const d=e.edges.find(g=>g.sourceHandle===u);if(!d)return;const f=e.nodes.find(g=>g.id===d.target);if(!f||f.data.nodeTypeUniqueId!==Te.loopEnd)return;i=f}else if(t.data.nodeTypeUniqueId===Te.loopEnd){i=t;const s=bt({type:"input",index1:0,index2:void 0},t.data)?.value?.id;if(!s)return;const a=e.edges.find(g=>g.targetHandle===s);if(!a)return;const l=e.nodes.find(g=>g.id===a.source);if(!l||l.data.nodeTypeUniqueId!==Te.loopStop)return;r=l;const u=bt({type:"input",index1:0,index2:void 0},l.data)?.value?.id;if(!u)return;const d=e.edges.find(g=>g.targetHandle===u);if(!d)return;const f=e.nodes.find(g=>g.id===d.source);if(!f||f.data.nodeTypeUniqueId!==Te.loopStart)return;n=f}if(n&&r&&i)return{loopStart:n,loopStop:r,loopEnd:i}}function pf(e,t,n,r,i){const s=e.loopStart,a=e.loopStop,l=e.loopEnd,u=xs(s.data),d=xs(a.data),f=xs(l.data),g=u.inputsAndIndices.length-(Mc+1),h=u.outputsAndIndices.length-(Oc+1),m=d.inputsAndIndices.length-(Pc+1),x=d.outputsAndIndices.length-(Rc+1),v=f.inputsAndIndices.length-(Lc+1),b=f.outputsAndIndices.length-(Dc+1),S=[g,h,m,x,v,b],N=Math.max(...S);if(!S.every(A=>A===N||A===N-1))return{validation:{isValid:!1,reason:"Loop structure has too different number of inferred handles, complete the connections"}};const I=S.map(A=>A===N),k=[e.loopStart.id===i&&n===ze.loopInfer,e.loopStart.id===r&&t===ze.loopInfer,e.loopStop.id===i&&n===ze.loopInfer,e.loopStop.id===r&&t===ze.loopInfer,e.loopEnd.id===i&&n===ze.loopInfer,e.loopEnd.id===r&&t===ze.loopInfer];if(!I.every(A=>A)&&I.map((A,M)=>A?k[M]:!1).some(A=>A))return{validation:{isValid:!1,reason:"Can't add a new connection to loops before older conenctions are synced across"}};for(let A=0;A<N;A++){const M=u.inputsAndIndices[A+Mc],B=u.outputsAndIndices[A+Oc],U=d.inputsAndIndices[A+Pc],q=d.outputsAndIndices[A+Rc],D=f.inputsAndIndices[A+Lc],$=f.outputsAndIndices[A+Dc],F=[M,B,U,q,D,$],E=F.find(L=>L?.value?.dataType?.dataTypeUniqueId&&L?.value?.dataType?.dataTypeUniqueId!==ze.loopInfer);if(!E)return{validation:{isValid:!1,reason:"This is a system error, this should never happen, please notify report this on https://github.com/TheClearSky/react-blender-nodes/issues"}};if(!F.every((L,j)=>{const O=L.value.dataType?.dataTypeUniqueId;return O&&(O===E.value?.dataType?.dataTypeUniqueId||(A===N-1?O===ze.loopInfer&&(k[j]?(j%2===0?t:n)===E.value?.dataType?.dataTypeUniqueId:!0):!1))}))return{validation:{isValid:!1,reason:"Loop structure has different handle types"}}}return{validation:{isValid:!0}}}function ms(e,t,n,r=[]){const i=t.data.nodeTypeUniqueId,s=n.data.nodeTypeUniqueId;if(!i||!s)return{validation:{isValid:!1,reason:"Source or target node type not found"}};const a=sw(e,t,r,"output"),l=sw(e,n,r,"input"),u=Object.keys(a.boundaryLoopNodes).length===0,d=Object.keys(l.boundaryLoopNodes).length===0;if(u||d)return{validation:{isValid:!0}};const f=jc(i)||Object.keys(a.boundaryLoopNodes).every(h=>{const m=a.boundaryLoopNodes[h],[x,v]=h.split("-");return m.data.nodeTypeUniqueId!==Te.loopStop&&(v==="input"?m.data.nodeTypeUniqueId!==Te.loopEnd:m.data.nodeTypeUniqueId!==Te.loopStart)}),g=jc(s)||Object.keys(l.boundaryLoopNodes).every(h=>{const m=l.boundaryLoopNodes[h],[x,v]=h.split("-");return m.data.nodeTypeUniqueId!==Te.loopStop&&(v==="input"?m.data.nodeTypeUniqueId!==Te.loopEnd:m.data.nodeTypeUniqueId!==Te.loopStart)});return f!==g?{validation:{isValid:!1,reason:"Can't connect a node from inside the loop to a node from outside the loop"}}:!f&&!g&&!(Object.keys(a.boundaryLoopNodes).every(m=>!!l.boundaryLoopNodes[m])&&Object.keys(a.boundaryLoopNodes).length===Object.keys(l.boundaryLoopNodes).length)?{validation:{isValid:!1,reason:"Can't connect 2 nodes of different regions of loop nodes"}}:{validation:{isValid:!0}}}function LL(e,t,n,r,i){const s=t.id,a=n.id,l=t.data.nodeTypeUniqueId,u=n.data.nodeTypeUniqueId;if(!l||!u)return{validation:{isValid:!1,reason:"Source or target node type not found"}};const d=bt(r,t.data)?.value,f=bt(i,n.data)?.value,g=d?.dataType,h=f?.dataType;if(!g||!h)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const m=lo(d,!0),x=lo(f,!0);if(!m||!x)return{validation:{isValid:!1,reason:"Source or target resultant handle data type not found"}};const v=Tt(l),b=Tt(u);if(v&&b){if(g.dataTypeUniqueId===ze.bindLoopNodes||h.dataTypeUniqueId===ze.bindLoopNodes){if(!(l===Te.loopStart&&u===Te.loopStop||l===Te.loopStop&&u===Te.loopEnd))return{validation:{isValid:!1,reason:"Loop nodes can only bind in order: loopStart<->loopStop<->loopEnd"}}}else{const N=ei(e,t),w=ei(e,n);if(!N||!w)return{validation:{isValid:!1,reason:`${N?"Target":"Source"} loop structure not found`}};const I=pf(N,m.dataTypeUniqueId,x.dataTypeUniqueId,s,a),k=pf(N,m.dataTypeUniqueId,x.dataTypeUniqueId,s,a);if(!I.validation.isValid||!k.validation.isValid)return{validation:{isValid:!1,reason:`${I.validation.isValid?"Target":"Source"} loop structure is invalid because of reason: ${I.validation.isValid?k.validation.reason:I.validation.reason}`}};if(N.loopStart.id!==w.loopStart.id)if(l===Te.loopEnd&&u===Te.loopStart){const M=ms(e,t,n,[N.loopStart.id,N.loopStop.id,N.loopEnd.id,w.loopStart.id,w.loopStop.id,w.loopEnd.id]);if(!M.validation.isValid)return M}else{const[M,B]=l===Te.loopEnd?[N,w]:u===Te.loopStart?[w,N]:[void 0,void 0];if(!M||!B)return{validation:{isValid:!1,reason:"Can't connect one loop structure's inner region to another loop structure's inner region"}};const U=ms(e,t,n,[M.loopStart.id,M.loopStop.id,M.loopEnd.id]);if(!U.validation.isValid)return U}else if(!(l===Te.loopStart&&u===Te.loopStop||l===Te.loopStop&&u===Te.loopEnd))return{validation:{isValid:!1,reason:"Loop nodes can only bind in order: loopStart<->loopStop<->loopEnd"}}}return{validation:{isValid:!0}}}else if(v||b){const S=ei(e,v?t:n);if(!S)return{validation:{isValid:!1,reason:"Can't connect to incomplete loop structure"}};const N=pf(S,m.dataTypeUniqueId,x.dataTypeUniqueId,s,a);if(!N.validation.isValid)return{validation:{isValid:!1,reason:`Loop structure is invalid because of reason: ${N.validation.reason}`}};if(v){const{nodesInRegionStartToStop:w,nodesInRegionStopToEnd:I}=ff(e,S),k=iw(e,s),A=w.has(a),M=I.has(a),B=k.has(a)&&!A&&!M,U=jc(u),q=S.loopStart.id===s,D=S.loopStop.id===s,$=S.loopEnd.id===s;if(U&&!$)return{validation:{isValid:!1,reason:"Group output node can only connect to loop end not inside the loop"}};if(A&&!q)return{validation:{isValid:!1,reason:"Loop nodes inside the LoopStart<->LoopStop region can only connect to LoopStart, LoopStop, other nodes in the same region or unreachable nodes"}};if(M&&!D)return{validation:{isValid:!1,reason:"Loop nodes inside the LoopStop<->LoopEnd region can only connect to LoopStop, LoopEnd, other nodes in the same region or unreachable nodes"}};if(B&&!$)return{validation:{isValid:!1,reason:"Loop nodes outside the Loop region can only connect to LoopStart, LoopStop or other nodes outside the loop"}};const F=ms(e,t,n,[S.loopStart.id,S.loopStop.id,S.loopEnd.id]);return F.validation.isValid?{validation:{isValid:!0}}:F}else if(b){const{nodesInRegionStartToStop:w,nodesInRegionStopToEnd:I}=ff(e,S),k=iw(e,a),A=w.has(s),M=I.has(s),B=k.has(s)&&!A&&!M,U=jc(l),q=S.loopStart.id===a,D=S.loopStop.id===a,$=S.loopEnd.id===a;if(U&&!q)return{validation:{isValid:!1,reason:"Group input node can only connect to loop start not inside the loop"}};if(A&&!D)return{validation:{isValid:!1,reason:"Loop nodes inside the LoopStart<->LoopStop region can only connect to LoopStart, LoopStop, other nodes in the same region or unreachable nodes"}};if(M&&!$)return{validation:{isValid:!1,reason:"Loop nodes inside the LoopStop<->LoopEnd region can only connect to LoopStop, LoopEnd, other nodes in the same region or unreachable nodes"}};if(B&&!q)return{validation:{isValid:!1,reason:"Loop nodes outside the Loop region can only connect to LoopStart, LoopStop or other nodes outside the loop"}};const F=ms(e,t,n,[S.loopStart.id,S.loopStop.id,S.loopEnd.id]);return F.validation.isValid?{validation:{isValid:!0}}:F}return{validation:{isValid:!0}}}else{const S=ms(e,t,n);return S.validation.isValid?{validation:{isValid:!0}}:S}}function DL(e,t,n){let r=[];if(t.every(l=>typeof l=="string")){const l=new Set(t);r=e.nodes.filter(u=>l.has(u.id))}else r=t;const i={};for(const l of r)i[l.id]={node:l,alreadyChecked:!1};const s=Object.keys(i);for(const l of s){const u=i[l].node;if(i[l].alreadyChecked||(i[l].alreadyChecked=!0,!u)||!u.data.nodeTypeUniqueId||!Tt(u.data.nodeTypeUniqueId))continue;const d=ei(e,u);if(d){if(i[d.loopStart.id]===void 0||i[d.loopStop.id]===void 0||i[d.loopEnd.id]===void 0)return{validation:{isValid:!1,reason:"Loop nodes all need to be removed together, can't partially remove them"}};i[d.loopStart.id].alreadyChecked=!0,i[d.loopStop.id].alreadyChecked=!0,i[d.loopEnd.id].alreadyChecked=!0}}let a=[];if(n.every(l=>typeof l=="string")){const l=new Set(n);a=e.edges.filter(u=>l.has(u.id))}else a=n;for(const l of a){const u=e.nodes.find(w=>w.id===l.source),d=e.nodes.find(w=>w.id===l.target),f=l.sourceHandle,g=l.targetHandle;if(!f||!g||!u||!d)continue;const h=u.data.nodeTypeUniqueId,m=d.data.nodeTypeUniqueId;if(!h||!m||!Tt(h)||!Tt(m))continue;const x=on(f,u.data)?.value,v=on(g,d.data)?.value,b=x?.dataType?.dataTypeUniqueId,S=v?.dataType?.dataTypeUniqueId;if(b!==ze.bindLoopNodes||S!==ze.bindLoopNodes)continue;const N=ei(e,u);if(N&&(i[N.loopStart.id]===void 0||i[N.loopStop.id]===void 0||i[N.loopEnd.id]===void 0))return{validation:{isValid:!1,reason:"Cannot disconnect loop nodes bind edges once fully connected, to delete, select all connected loop nodes and delete them at once"}}}return{validation:{isValid:!0}}}function jL(e,t,n,r,i,s,a,l,u){if(!s.sourceHandle||!s.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const d=e.nodes[t].data,f=e.nodes[n].data,g=bt(r,d)?.value,h=bt(i,f)?.value,m=g?.dataType,x=h?.dataType,v=g?.inferredDataType,b=h?.inferredDataType,S=m?.dataTypeObject.underlyingType==="inferFromConnection",N=x?.dataTypeObject.underlyingType==="inferFromConnection";if(!m||!x)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const w=!!a&&s.source===a,I=!!l&&s.target===l,k=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!d.nodeTypeUniqueId||!f.nodeTypeUniqueId)return{validation:{isValid:!1,reason:"Source or target node type not found"}};const A=Tt(d.nodeTypeUniqueId),M=Tt(f.nodeTypeUniqueId);if(!S&&!N)return{validation:{isValid:!0}};let B,U,q,D=!1,$=!1,F=!1;if(S&&N){if(!v&&!b)return{validation:{isValid:!1,reason:"None of the handles are inferred, inference has no information to work with"}};if(v&&b)return{validation:{isValid:!0}};v?(B=n,U=x.dataTypeUniqueId,q=g,D=!1,$=I||M,F=I||M):b&&(B=t,U=m.dataTypeUniqueId,q=h,D=!1,$=w||A,F=w||A)}else if(S){if(v)return{validation:{isValid:!0}};B=t,U=m.dataTypeUniqueId,q=h,D=!1,$=w||A,F=w||A}else if(N){if(b)return{validation:{isValid:!0}};B=n,U=x.dataTypeUniqueId,q=g,D=!1,$=I||M,F=I||M}if(B===void 0||U===void 0||q===void 0)return{validation:{isValid:!1,reason:"Index of node to update, data type to infer for, or connected handle not found"}};df(e.nodes[B].data,U,{handle:q,resetInferredType:D,overrideDataType:$,overrideName:F});const E=PL(e,t,n,g,h,u,S,N,w,I,k);if(!E.validation.isValid)return E;const P=RL(e,t,n,S,N);return P.validation.isValid?{validation:{isValid:!0}}:P}function $L(e,t,n,r,i,s){if(!s.sourceHandle||!s.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const a=e.nodes[t].data,l=e.nodes[n].data,u=bt(r,a)?.value,d=bt(i,l)?.value,f=lo(u),g=lo(d);if(!f||!g)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const h=f?.dataTypeObject.underlyingType==="complex",m=g?.dataTypeObject.underlyingType==="complex";return!h&&!m?{validation:{isValid:!0}}:h!==m?{validation:{isValid:!1,reason:"Can't connect complex types with non-complex types"}}:h&&m?f.dataTypeUniqueId===g.dataTypeUniqueId||JSON.stringify(f.dataTypeObject.complexSchema)===JSON.stringify(g.dataTypeObject.complexSchema)?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:"Can't connect complex types with different types"}}:{validation:{isValid:!0}}}function HL(e,t,n,r,i,s){if(!s.sourceHandle||!s.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const a=e.nodes[t].data,l=e.nodes[n].data,u=bt(r,a)?.value,d=bt(i,l)?.value,f=lo(u),g=lo(d);if(!f||!g)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(f.dataTypeUniqueId===g.dataTypeUniqueId)return{validation:{isValid:!0}};const m=e.allowedConversionsBetweenDataTypes?.[f.dataTypeUniqueId]?.[g.dataTypeUniqueId],x=f.dataTypeObject.underlyingType==="complex"&&g.dataTypeObject.underlyingType==="complex";return m||x&&e.allowConversionBetweenComplexTypesUnlessDisallowedByComplexTypeChecking?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:`${f.dataTypeUniqueId} to ${g.dataTypeUniqueId} conversion is not allowed`}}}function BL(e,t,n,r,i,s){const a=e.nodes[t],l=e.nodes[n],u=bt(r,a.data)?.value,d=bt(i,l.data)?.value,f=u?.dataType,g=d?.dataType;if(!f||!g)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(f.dataTypeObject.underlyingType!=="inferFromConnection"&&g.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};let h=e.nodes;if(f.dataTypeObject.underlyingType==="inferFromConnection"){const m=$d([a],e.edges),{inputsAndIndices:x,outputsAndIndices:v}=xs(a.data),b={};for(const N of x)N.value.dataType?.dataTypeUniqueId===f.dataTypeUniqueId&&(b[N.value.id]=!0);for(const N of v)N.value.dataType?.dataTypeUniqueId===f.dataTypeUniqueId&&(b[N.value.id]=!0);let S=!1;for(const N of m)if(N.id!==s.id&&!(!N.sourceHandle||!N.targetHandle)){if(b[N.sourceHandle]){S=!0;break}if(b[N.targetHandle]){S=!0;break}}S||(h=[...h],h[t]={...h[t],data:df(h[t].data,f.dataTypeUniqueId,{handle:Cr(e.dataTypes,h[t].data.nodeTypeUniqueId,e.typeOfNodes,r),resetInferredType:!0})})}if(g.dataTypeObject.underlyingType==="inferFromConnection"){const m=$d([l],e.edges),{inputsAndIndices:x,outputsAndIndices:v}=xs(l.data),b={};for(const N of x)N.value.dataType?.dataTypeUniqueId===g.dataTypeUniqueId&&(b[N.value.id]=!0);for(const N of v)N.value.dataType?.dataTypeUniqueId===g.dataTypeUniqueId&&(b[N.value.id]=!0);let S=!1;for(const N of m)if(N.id!==s.id&&!(!N.sourceHandle||!N.targetHandle)){if(b[N.sourceHandle]){S=!0;break}if(b[N.targetHandle]){S=!0;break}}S||(h=[...h],h[n]={...h[n],data:df(h[n].data,g.dataTypeUniqueId,{handle:Cr(e.dataTypes,h[n].data.nodeTypeUniqueId,e.typeOfNodes,i),resetInferredType:!0})})}return{updatedNodes:h,validation:{isValid:!0}}}const VL=20;function aw(e,t,n,r,i,s,a,l){const u={id:rn(VL),source:e,target:n,sourceHandle:t,targetHandle:r,type:"configurableEdge"};if(Sx(u,i.edges)===i.edges)return{validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(i.enableTypeInference||i.enableComplexTypeChecking||i.allowedConversionsBetweenDataTypes))return i.edges.push(u),{validation:{isValid:!0}};const f=i.nodes.findIndex(N=>N.id===e),g=i.nodes.findIndex(N=>N.id===n);if(f===-1||g===-1)return{validation:{isValid:!1,reason:"Source or target node not found"}};const h=i.nodes[f],m=i.nodes[g],x=on(t,h.data)?.handleIndices,v=on(r,m.data)?.handleIndices;if(!x||!v)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const b=LL(i,h,m,x,v);if(!b.validation.isValid)return b;let S={isValid:!0};if(i.enableTypeInference){const{validation:N}=jL(i,f,g,x,v,u,s,a,l);S=N}if(i.enableComplexTypeChecking&&S.isValid){const{validation:N}=$L({...i,nodes:i.nodes},f,g,x,v,u);S=N}if(i.allowedConversionsBetweenDataTypes&&S.isValid){const{validation:N}=HL({...i,nodes:i.nodes},f,g,x,v,u);S=N}return S.isValid?(i.edges.push(u),{validation:S}):{validation:S}}function cw(e,t,n){if(ls([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:ls([n],t.edges),validation:{isValid:!0}};const i=t.nodes.findIndex(h=>h.id===e.source),s=t.nodes.findIndex(h=>h.id===e.target);if(i===-1||s===-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 a=t.nodes[i],l=t.nodes[s],u=on(e.sourceHandle,a.data)?.handleIndices,d=on(e.targetHandle,l.data)?.handleIndices;if(!u||!d)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let f=t.nodes,g={isValid:!0};if(t.enableTypeInference){const{updatedNodes:h,validation:m}=BL(t,i,s,u,d,e);f=h,g=m}return{updatedNodes:f,updatedEdges:ls([n],t.edges),validation:g}}function lo(e,t=!1){const n=e?.dataType,r=e?.inferredDataType;if(n)return n.dataTypeObject.underlyingType!=="inferFromConnection"?n:r||(t?n:void 0)}function lw(e,t,n){const r=e.nodes.find(s=>s.id===n);if(!r)return!1;if(r.id===t)return!0;const i=(s,a=new Set)=>{if(a.has(s.id))return!1;a.add(s.id);for(const l of Qi(s,e.nodes,e.edges))if(l.id===t||i(l,a))return!0;return!1};return i(r)}function uw(e,t,n,r,i,s){const a=[],l=[];for(const u of t.nodes){if(u.data.nodeTypeUniqueId!==n){a.push(u);continue}co(u.data,i,0,Tr(r,e),void 0,s),a.push(u)}for(const u of t.edges)l.push(u);return{...t,nodes:a,edges:l}}function dw(e,t,n,r,i="before"){const s=e.typeOfNodes[t];if(!s)return e;co(s,r,0,n,void 0,i);const a=af(e,t);for(const d of a){const f=e.typeOfNodes[d];f&&f.subtree&&(e.typeOfNodes[d]={...f,subtree:{...f.subtree,...uw(e.dataTypes,f.subtree,t,n,r,i)}})}const{nodes:l,edges:u}=uw(e.dataTypes,{nodes:e.nodes,edges:e.edges},t,n,r,i);return{typeOfNodes:e.typeOfNodes,nodes:l,edges:u}}const ys=20,dt=["ADD_NODE","ADD_NODE_AND_SELECT","UPDATE_NODE_BY_REACT_FLOW","UPDATE_EDGES_BY_REACT_FLOW","ADD_EDGE_BY_REACT_FLOW","UPDATE_INPUT_VALUE","OPEN_NODE_GROUP","CLOSE_NODE_GROUP","ADD_NODE_GROUP","SET_VIEWPORT","REPLACE_STATE"],ft={[dt[0]]:dt[0],[dt[1]]:dt[1],[dt[2]]:dt[2],[dt[3]]:dt[3],[dt[4]]:dt[4],[dt[5]]:dt[5],[dt[6]]:dt[6],[dt[7]]:dt[7],[dt[8]]:dt[8],[dt[9]]:dt[9],[dt[10]]:dt[10]};function fw(e,t){return Bi(e,r=>{switch(t.type){case ft.ADD_NODE:const i=t.payload.type,s=rn(ys),a=t.payload.position,l=ps(r.dataTypes,i,r.typeOfNodes,s,a);r=so(r,[...Mt(r).nodes,l]);break;case ft.ADD_NODE_AND_SELECT:const u=t.payload.type,d=rn(ys),f=t.payload.position,g=ps(r.dataTypes,u,r.typeOfNodes,d,f);r=so(r,Mt(r).nodes.map(E=>({...E,selected:!1}))),r=so(r,[...Mt(r).nodes,{...g,selected:!0}]);break;case ft.UPDATE_NODE_BY_REACT_FLOW:const h=t.payload.changes;for(const E of h)r=so(r,s0([E],Mt(r).nodes));break;case ft.UPDATE_EDGES_BY_REACT_FLOW:const m=t.payload.changes;for(const E of m){if(E.type!=="remove"){r=so(r,void 0,ls([E],Mt(r).edges));continue}const{id:P}=E,L=Mt(r).edges.find(O=>O.id===P);if(!L)continue;const j=cw(L,{...r,nodes:Mt(r).nodes,edges:Mt(r).edges},E);j.validation.isValid&&(r=so(r,j.updatedNodes,j.updatedEdges))}break;case ft.ADD_EDGE_BY_REACT_FLOW:const x=t.payload.edge,{sourceHandle:v,targetHandle:b,source:S,target:N}=x,w=Mt(r);if(r.enableCycleChecking&&lw({...r,nodes:w.nodes,edges:w.edges},S,N)||!S||!N||!v||!b)break;const I=Mt(r);if(!aw(S,v,N,b,{...r,nodes:I.nodes,edges:I.edges},I.inputNodeId,I.outputNodeId,r).validation.isValid)break;break;case ft.OPEN_NODE_GROUP:if("nodeId"in t.payload){const E=t.payload.nodeId,P=Mt(r).nodes.find(O=>O.id===E);if(!P)break;const L=P.data.nodeTypeUniqueId;if(!L)break;const j=r.typeOfNodes[L];if(!j||!j.subtree)break;r.openedNodeGroupStack=[...r.openedNodeGroupStack||[],{nodeType:L,nodeId:E,previousViewport:r.viewport}]}else{const E=t.payload.nodeType,P=r.typeOfNodes[E];if(!P||!P.subtree)break;r.openedNodeGroupStack=[{nodeType:E,previousViewport:r.openedNodeGroupStack?.[0]?.previousViewport||r.viewport}]}r.viewport=void 0;break;case ft.CLOSE_NODE_GROUP:const A=r.openedNodeGroupStack?.[r.openedNodeGroupStack.length-1];A&&"previousViewport"in A&&(r.viewport=A.previousViewport),r.openedNodeGroupStack=r.openedNodeGroupStack?.slice(0,-1);break;case ft.ADD_NODE_GROUP:const M=rn(ys),B=rn(ys),U=ps(r.dataTypes,Te.groupInput,r.typeOfNodes,B,{x:-500,y:0}),q=rn(ys),D=ps(r.dataTypes,Te.groupOutput,r.typeOfNodes,q,{x:500,y:0}),F={name:"Node Group "+(Object.keys(r.typeOfNodes).filter(E=>r.typeOfNodes[E].subtree).length+1).toString(),headerColor:"#344621",...ow,inputs:[],outputs:[],subtree:{nodes:[U,D],edges:[],numberOfReferences:0,inputNodeId:B,outputNodeId:q}};r.typeOfNodes[M]=F,r.openedNodeGroupStack=[{nodeType:M,previousViewport:r.openedNodeGroupStack?.[0]?.previousViewport||r.viewport}],r.viewport=void 0;break;case ft.SET_VIEWPORT:r.viewport=t.payload.viewport;break;case ft.REPLACE_STATE:return t.payload.state}})}function Ee(e,t,n="error"){return{path:e,message:t,severity:n}}function Pe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pw(e){const t=[];if(!Pe(e))return t.push(Ee("","Root must be an object")),t;if(e.version!==1&&t.push(Ee("version",`Expected version 1, got ${JSON.stringify(e.version)}`)),typeof e.exportedAt!="string"&&t.push(Ee("exportedAt","Expected ISO date string","warning")),!Pe(e.state))return t.push(Ee("state","Expected state object")),t;const n=e.state;if(!Pe(n.dataTypes))t.push(Ee("state.dataTypes","Expected dataTypes object"));else for(const[r,i]of Object.entries(n.dataTypes)){if(!Pe(i)){t.push(Ee(`state.dataTypes.${r}`,"Expected data type object"));continue}typeof i.name!="string"&&t.push(Ee(`state.dataTypes.${r}.name`,"Expected string name")),typeof i.underlyingType!="string"&&t.push(Ee(`state.dataTypes.${r}.underlyingType`,"Expected string underlyingType"))}if(!Pe(n.typeOfNodes))t.push(Ee("state.typeOfNodes","Expected typeOfNodes object"));else for(const[r,i]of Object.entries(n.typeOfNodes)){if(!Pe(i)){t.push(Ee(`state.typeOfNodes.${r}`,"Expected node type object"));continue}const s=i;typeof s.name!="string"&&t.push(Ee(`state.typeOfNodes.${r}.name`,"Expected string name")),Array.isArray(s.inputs)||t.push(Ee(`state.typeOfNodes.${r}.inputs`,"Expected inputs array")),Array.isArray(s.outputs)||t.push(Ee(`state.typeOfNodes.${r}.outputs`,"Expected outputs array"))}if(!Array.isArray(n.nodes))t.push(Ee("state.nodes","Expected nodes array"));else{const r=new Set;for(let i=0;i<n.nodes.length;i++){const s=n.nodes[i],a=`state.nodes[${i}]`;if(!Pe(s)){t.push(Ee(a,"Expected node object"));continue}const l=s;if(typeof l.id!="string"?t.push(Ee(`${a}.id`,"Expected string id")):(r.has(l.id)&&t.push(Ee(`${a}.id`,`Duplicate node ID: "${l.id}"`,"warning")),r.add(l.id)),typeof l.type!="string"&&l.type!==void 0&&t.push(Ee(`${a}.type`,"Expected string type")),!Pe(l.position))t.push(Ee(`${a}.position`,"Expected position object"));else{const u=l.position;typeof u.x!="number"&&t.push(Ee(`${a}.position.x`,"Expected number x")),typeof u.y!="number"&&t.push(Ee(`${a}.position.y`,"Expected number y"))}}}if(!Array.isArray(n.edges))t.push(Ee("state.edges","Expected edges array"));else{const r=new Set,i=new Set;if(Array.isArray(n.nodes))for(const s of n.nodes)Pe(s)&&typeof s.id=="string"&&i.add(s.id);for(let s=0;s<n.edges.length;s++){const a=n.edges[s],l=`state.edges[${s}]`;if(!Pe(a)){t.push(Ee(l,"Expected edge object"));continue}const u=a;typeof u.id!="string"?t.push(Ee(`${l}.id`,"Expected string id")):(r.has(u.id)&&t.push(Ee(`${l}.id`,`Duplicate edge ID: "${u.id}"`,"warning")),r.add(u.id)),typeof u.source!="string"?t.push(Ee(`${l}.source`,"Expected string source")):i.size>0&&!i.has(u.source)&&t.push(Ee(`${l}.source`,`Source node "${u.source}" not found`,"warning")),typeof u.target!="string"?t.push(Ee(`${l}.target`,"Expected string target")):i.size>0&&!i.has(u.target)&&t.push(Ee(`${l}.target`,`Target node "${u.target}" not found`,"warning")),typeof u.sourceHandle!="string"&&t.push(Ee(`${l}.sourceHandle`,"Expected string sourceHandle")),typeof u.targetHandle!="string"&&t.push(Ee(`${l}.targetHandle`,"Expected string targetHandle"))}}return t}const hw=["completed","errored","cancelled"],gw=["completed","errored","skipped"];function mw(e){const t=[];if(!Pe(e))return t.push(Ee("","Root must be an object")),t;if(e.version!==1&&t.push(Ee("version",`Expected version 1, got ${JSON.stringify(e.version)}`)),typeof e.exportedAt!="string"&&t.push(Ee("exportedAt","Expected ISO date string","warning")),!Pe(e.record))return t.push(Ee("record","Expected record object")),t;const n=e.record;if(typeof n.id!="string"&&t.push(Ee("record.id","Expected string id")),typeof n.startTime!="number"&&t.push(Ee("record.startTime","Expected number startTime")),typeof n.endTime!="number"&&t.push(Ee("record.endTime","Expected number endTime")),typeof n.totalDuration!="number"&&t.push(Ee("record.totalDuration","Expected number totalDuration")),(typeof n.status!="string"||!hw.includes(n.status))&&t.push(Ee("record.status",`Expected one of: ${hw.join(", ")}`)),!Array.isArray(n.steps))t.push(Ee("record.steps","Expected steps array"));else for(let r=0;r<n.steps.length;r++){const i=n.steps[r],s=`record.steps[${r}]`;if(!Pe(i)){t.push(Ee(s,"Expected step object"));continue}const a=i;typeof a.stepIndex!="number"&&t.push(Ee(`${s}.stepIndex`,"Expected number stepIndex")),typeof a.nodeId!="string"&&t.push(Ee(`${s}.nodeId`,"Expected string nodeId")),typeof a.nodeTypeId!="string"&&t.push(Ee(`${s}.nodeTypeId`,"Expected string nodeTypeId")),(typeof a.status!="string"||!gw.includes(a.status))&&t.push(Ee(`${s}.status`,`Expected one of: ${gw.join(", ")}`)),Pe(a.inputValues)||t.push(Ee(`${s}.inputValues`,"Expected inputValues object")),Pe(a.outputValues)||t.push(Ee(`${s}.outputValues`,"Expected outputValues object"))}return Array.isArray(n.errors)||t.push(Ee("record.errors","Expected errors array","warning")),Array.isArray(n.concurrencyLevels)||t.push(Ee("record.concurrencyLevels","Expected concurrencyLevels array","warning")),n.loopRecords!==void 0&&!Pe(n.loopRecords)&&t.push(Ee("record.loopRecords","Expected loopRecords object","warning")),n.groupRecords!==void 0&&!Pe(n.groupRecords)&&t.push(Ee("record.groupRecords","Expected groupRecords object","warning")),n.finalValues!==void 0&&!Pe(n.finalValues)&&t.push(Ee("record.finalValues","Expected finalValues object","warning")),t}function hf(e){const t={};for(const[n,r]of e)t[n]=r;return t}function vs(e){const t=new Map;if(e==null)return t;for(const[n,r]of Object.entries(e))t.set(n,r);return t}function Vn(e){if(e==null)return e;const t=typeof e;if(t==="string"||t==="number"||t==="boolean")return e;if(t==="function")return"[Function]";if(t==="symbol")return`[Symbol: ${e.toString()}]`;if(t==="bigint")return e.toString();if(e instanceof Map){const n={};for(const[r,i]of e)n[String(r)]=Vn(i);return n}if(e instanceof Set)return[...e].map(Vn);if(e instanceof Error)return{__type:"Error",name:e.name,message:e.message,stack:e.stack};if(Array.isArray(e))return e.map(Vn);if(Pe(e)){const n={};for(const[r,i]of Object.entries(e))n[r]=Vn(i);return n}return String(e)}function gf(e){return{...e,path:[...e.path],originalError:Vn(e.originalError)}}function mf(e){return{...e,path:Array.isArray(e.path)?e.path:[],originalError:e.originalError}}function FL(e){return{...e,connections:e.connections.map(t=>({...t,value:Vn(t.value)})),defaultValue:Vn(e.defaultValue)}}function zL(e){return{...e,value:Vn(e.value)}}function yw(e){const t={};for(const[r,i]of e.inputValues)t[r]=FL(i);const n={};for(const[r,i]of e.outputValues)n[r]=zL(i);return{...e,inputValues:t,outputValues:n,error:e.error?gf(e.error):void 0}}function vw(e){return{...e,inputValues:vs(e.inputValues??{}),outputValues:vs(e.outputValues??{}),error:e.error?mf(e.error):void 0}}function UL(e){const t={};for(const[n,r]of e.nestedLoopRecords)t[n]=xw(r);return{...e,stepRecords:e.stepRecords.map(yw),nestedLoopRecords:Object.keys(t).length>0?t:void 0}}function WL(e){const t=new Map;if(e.nestedLoopRecords)for(const[n,r]of Object.entries(e.nestedLoopRecords))t.set(n,ww(r));return{...e,stepRecords:(e.stepRecords??[]).map(n=>vw(n)),nestedLoopRecords:t}}function xw(e){return{...e,iterations:e.iterations.map(UL)}}function ww(e){return{...e,iterations:(e.iterations??[]).map(t=>WL(t))}}function GL(e){return{...e,innerRecord:yf(e.innerRecord),inputMapping:hf(e.inputMapping),outputMapping:hf(e.outputMapping)}}function qL(e){return{...e,innerRecord:vf(e.innerRecord),inputMapping:vs(e.inputMapping??{}),outputMapping:vs(e.outputMapping??{})}}function yf(e){const t={};for(const[i,s]of e.loopRecords)t[i]=xw(s);const n={};for(const[i,s]of e.groupRecords)n[i]=GL(s);const r={};for(const[i,s]of e.finalValues)r[i]=Vn(s);return{id:e.id,startTime:e.startTime,endTime:e.endTime,totalDuration:e.totalDuration,compilationDuration:e.compilationDuration,totalPauseDuration:e.totalPauseDuration,status:e.status,steps:e.steps.map(yw),errors:e.errors.map(gf),concurrencyLevels:[...e.concurrencyLevels],loopRecords:t,groupRecords:n,finalValues:r,...e.viewState?{viewState:e.viewState}:{}}}function vf(e){const t=new Map;if(e.loopRecords)for(const[i,s]of Object.entries(e.loopRecords))t.set(i,ww(s));const n=new Map;if(e.groupRecords)for(const[i,s]of Object.entries(e.groupRecords))n.set(i,qL(s));const r=new Map;if(e.finalValues)for(const[i,s]of Object.entries(e.finalValues))r.set(i,s);return{id:e.id,startTime:e.startTime,endTime:e.endTime,totalDuration:e.totalDuration,compilationDuration:e.compilationDuration??0,totalPauseDuration:e.totalPauseDuration??0,status:e.status,steps:(e.steps??[]).map(i=>vw(i)),errors:(e.errors??[]).map(i=>mf(i)),concurrencyLevels:e.concurrencyLevels??[],loopRecords:t,groupRecords:n,finalValues:r,...e.viewState?{viewState:e.viewState}:{}}}function YL(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e,(t,n)=>{if(typeof n!="function"&&typeof n!="symbol")return n}))}function xf(e){const{complexSchema:t,...n}=e;return n}function Hc(e){const t={...e};delete t.onChange;const n=t.dataType;Pe(n)&&Pe(n.dataTypeObject)&&(t.dataType={...n,dataTypeObject:xf(n.dataTypeObject)});const r=t.inferredDataType;return Pe(r)&&Pe(r.dataTypeObject)&&(t.inferredDataType={...r,dataTypeObject:xf(r.dataTypeObject)}),t}function wf(e,t){const n=e.dataType;if(Pe(n)){const i=n.dataTypeUniqueId;typeof i=="string"&&Pe(t[i])&&(e.dataType={...n,dataTypeObject:t[i]})}const r=e.inferredDataType;if(Pe(r)){const i=r.dataTypeUniqueId;typeof i=="string"&&Pe(t[i])&&(e.inferredDataType={...r,dataTypeObject:t[i]})}return e}function XL(e){return typeof e.id=="string"&&typeof e.status=="string"&&Array.isArray(e.steps)&&Array.isArray(e.errors)}function bw(e,t){const n=YL(e);if(n.dataTypes)for(const i of Object.keys(n.dataTypes))n.dataTypes[i]=xf(n.dataTypes[i]);if(n.typeOfNodes)for(const i of Object.keys(n.typeOfNodes)){const s=n.typeOfNodes[i];s.inputs&&(s.inputs=s.inputs.map(Sw)),s.outputs&&(s.outputs=s.outputs.map(Hc)),s.subtree?.nodes&&(s.subtree.nodes=s.subtree.nodes.map(_w))}n.nodes&&(n.nodes=n.nodes.map(_w));const r={version:1,exportedAt:new Date().toISOString(),state:n};return JSON.stringify(r,null,t?.pretty?2:void 0)}function Sw(e){return e.inputs&&Array.isArray(e.inputs)?{...e,inputs:e.inputs.map(Hc)}:Hc(e)}function _w(e){if(!e.data)return e;const t={...e.data};return t.inputs&&Array.isArray(t.inputs)&&(t.inputs=t.inputs.map(Sw)),t.outputs&&Array.isArray(t.outputs)&&(t.outputs=t.outputs.map(Hc)),{...e,data:t}}function Nw(e,t){const n=yf(e),r={version:1,exportedAt:new Date().toISOString(),record:n};return JSON.stringify(r,null,t?.pretty?2:void 0)}function KL(e){return"nodes"in e&&"edges"in e&&"dataTypes"in e&&"typeOfNodes"in e}function ZL(e,t){if(!Pe(e.data))return e;const n={...e.data};if(Array.isArray(n.inputs)){const r=n.inputs;n.inputs=r.map(i=>{if(!Pe(i))return i;if(Array.isArray(i.inputs)){const s=i.inputs;return{...i,inputs:s.map(a=>Pe(a)?wf(a,t):a)}}return wf(i,t)})}if(Array.isArray(n.outputs)){const r=n.outputs;n.outputs=r.map(i=>Pe(i)?wf(i,t):i)}return{...e,data:n}}function Iw(e,t){const n=[],r=[];let i;try{i=JSON.parse(e)}catch(g){const h=g instanceof Error?g.message:String(g);return r.push({path:"",message:`Invalid JSON: ${h}`,severity:"error"}),{success:!1,errors:r,warnings:n}}const s=pw(i);for(const g of s)t.onValidationError?.(g),g.severity==="error"?r.push(g):n.push(g);const a=t.repair??{},l=Object.values(a).some(Boolean);if(r.length>0&&!l)return{success:!1,errors:r,warnings:n};if(!Pe(i))return{success:!1,errors:[{path:"",message:"Root must be an object",severity:"error"}],warnings:n};const u=i.state;if(!Pe(u))return{success:!1,errors:[{path:"state",message:"Missing state object",severity:"error"}],warnings:n};if(a.removeDuplicateNodeIds&&Array.isArray(u.nodes)){const g=new Set,h=u.nodes;u.nodes=h.filter(m=>!Pe(m)||typeof m.id!="string"?!0:g.has(m.id)?!1:(g.add(m.id),!0))}if(a.removeDuplicateEdgeIds&&Array.isArray(u.edges)){const g=new Set,h=u.edges;u.edges=h.filter(m=>!Pe(m)||typeof m.id!="string"?!0:g.has(m.id)?!1:(g.add(m.id),!0))}if(a.removeOrphanEdges&&Array.isArray(u.nodes)&&Array.isArray(u.edges)){const g=new Set,h=u.nodes;for(const S of h)Pe(S)&&typeof S.id=="string"&&g.add(S.id);const m=u.edges,x=m.length,v=m.filter(S=>Pe(S)&&typeof S.source=="string"&&typeof S.target=="string"&&g.has(S.source)&&g.has(S.target));u.edges=v;const b=x-v.length;b>0&&n.push({path:"state.edges",message:`Removed ${b} orphan edge(s)`,severity:"warning"})}a.fillMissingDefaults&&u.viewport===void 0&&(u.viewport={x:0,y:0,zoom:1});const d=t.dataTypes;if(Pe(u.dataTypes))for(const g of Object.keys(u.dataTypes)){const h=d[g],m=u.dataTypes[g];h&&Pe(h)&&Pe(m)&&"complexSchema"in h&&h.complexSchema&&(m.complexSchema=h.complexSchema)}if(Array.isArray(u.nodes)){const g=u.nodes;u.nodes=g.map(h=>Pe(h)?ZL(h,d):h)}const f=r.filter(g=>!(a.removeDuplicateNodeIds&&g.message.includes("Duplicate node ID")||a.removeDuplicateEdgeIds&&g.message.includes("Duplicate edge ID")||a.removeOrphanEdges&&g.message.includes("not found")||a.fillMissingDefaults&&g.path.includes("viewport")));return f.length>0?{success:!1,errors:f,warnings:n}:KL(u)?{success:!0,data:u,warnings:n}:{success:!1,errors:[{path:"state",message:"Invalid state structure",severity:"error"}],warnings:n}}function Ew(e,t){const n=[],r=[];let i;try{i=JSON.parse(e)}catch(g){const h=g instanceof Error?g.message:String(g);return r.push({path:"",message:`Invalid JSON: ${h}`,severity:"error"}),{success:!1,errors:r,warnings:n}}const s=mw(i);for(const g of s)t?.onValidationError?.(g),g.severity==="error"?r.push(g):n.push(g);const a=t?.repair??{},l=Object.values(a).some(Boolean);if(r.length>0&&!l)return{success:!1,errors:r,warnings:n};if(!Pe(i))return{success:!1,errors:[{path:"",message:"Root must be an object",severity:"error"}],warnings:n};const u=i.record;if(!Pe(u))return{success:!1,errors:[{path:"record",message:"Missing record object",severity:"error"}],warnings:n};if(a.removeOrphanSteps&&Array.isArray(u.steps)){const g=u.steps,h=g.filter(x=>Pe(x)&&typeof x.nodeId=="string"&&typeof x.nodeTypeId=="string"&&typeof x.stepIndex=="number"),m=g.length-h.length;m>0&&(u.steps=h,n.push({path:"record.steps",message:`Removed ${m} malformed step(s)`,severity:"warning"}))}a.sanitizeNonSerializableValues&&Array.isArray(u.steps);const d=r.filter(g=>!(a.removeOrphanSteps&&g.path.includes("steps")));return d.length>0?{success:!1,errors:d,warnings:n}:XL(u)?{success:!0,data:vf(u),warnings:n}:{success:!1,errors:[{path:"record",message:"Record structure does not match expected shape",severity:"error"}],warnings:n}}function on(e,t,n=!0,r=!0){if(n){const i=t?.inputs instanceof Array?t?.inputs:[],a=ao(i,"input").find(({value:l})=>l?.id===e);if(a)return a}if(r){const i=t?.outputs instanceof Array?t?.outputs:[],a=ao(i,"output").find(({value:l})=>l?.id===e);if(a)return a}}function bt(e,t){if(!e)return;const n=e.type==="input"?t.inputs:t.outputs;if(!n)return;const i=ao(n,e.type,{index1:e.index1,index2:e.index2}).next();return i.value&&i.value.handleIndices.index1===e.index1&&i.value.handleIndices.index2===e.index2?i.value:{value:void 0,handleIndices:e,parentArray:n,parentArrayIndex:i.value.parentArrayIndex}}function xs(e,t=!0,n=!0){let r=[],i=[];return t&&e.inputs&&(r=Array.from(ao(e.inputs,"input"))),n&&e.outputs&&(i=Array.from(ao(e.outputs,"output"))),{inputsAndIndices:r,outputsAndIndices:i}}const uo=T.createContext(null),bf=T.createContext({executionRecord:null,setExecutionRecord:()=>{}});function Tw(){return T.useContext(bf)}function JL(e){const[t,n]=T.useReducer(fw,e);return{state:t,dispatch:n}}function Sf(e,t,n,r){return{allProps:e,nodeRunnerStates:t,selectedStepRecord:n,edgeValuesAnimated:r}}const Cw=12;function QL(e){return e===void 0?"undefined":e===null?"null":typeof e=="boolean"?e?"true":"false":typeof e=="number"?String(e):typeof e=="string"?e.length>Cw?`"${e.slice(0,Cw-1)}…"`:`"${e}"`:e instanceof Map?`Map(${e.size})`:Array.isArray(e)?`[${e.length}]`:typeof e=="object"?`{${Object.keys(e).length}}`:String(e)}const _f=T.forwardRef(({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,...l},u)=>{const[d,f,g]=bc({sourceX:t,sourceY:n,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),h=rt(),[m,x]=T.useState(!0),v=T.useRef(null);T.useEffect(()=>{const O=h.getState().domNode;if(!O)return;const W=document.getElementById(e);if(!W)return;const z=new IntersectionObserver(Y=>{const J=Y.find(ie=>ie.target.id===e);J&&x(ie=>J.isIntersecting)},{root:O,threshold:1,rootMargin:"20px"});return z.observe(W),v.current=z,()=>{v.current&&(v.current.disconnect(),v.current=null)}},[h.getState().domNode]);const b=of(l.source||""),S=T.useMemo(()=>!l.source||!b?void 0:on(l.sourceHandleId||"",b?.data)?.value?.handleColor??"#A1A1A1",[l.source,b]),N=of(l.target||""),w=T.useMemo(()=>!l.target||!N?void 0:on(l.targetHandleId||"",N?.data)?.value?.handleColor??"#A1A1A1",[l.target,N]),{label:I,labelStyle:k,markerStart:A,markerEnd:M,interactionWidth:B}=l,U=T.useContext(uo),q=T.useMemo(()=>{const O=U?.selectedStepRecord;if(!O||l.target!==O.nodeId)return{found:!1};for(const[,W]of O.inputValues)for(const z of W.connections)if(z.sourceNodeId===l.source&&z.sourceHandleId===(l.sourceHandleId??""))return{found:!0,value:z.value};return{found:!1}},[U?.selectedStepRecord,l.target,l.source,l.sourceHandleId]),D=T.useMemo(()=>{const O=U?.selectedStepRecord;if(!O||l.source!==O.nodeId||!b?.data)return{found:!1};const W=on(l.sourceHandleId||"",b.data,!1);if(!W)return{found:!1};const z=O.outputValues.get(W.value.name);return z?{found:!0,value:z.value}:{found:!1}},[U?.selectedStepRecord,l.source,l.sourceHandleId,b]),$=q.found?q:D,F=U?.edgeValuesAnimated??!0,E=$.found?QL($.value):null,P=E?.length??0,L=Math.max(40,P*7.5+20),j=22;return y.jsxs(y.Fragment,{children:[y.jsx("defs",{children:y.jsxs("linearGradient",{id:`linear-gradient-edge-${e}`,x1:t,y1:n,x2:r,y2:i,gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{stopColor:S,offset:"0"}),y.jsx("stop",{stopColor:w,offset:"1"})]})}),y.jsx(Jo,{id:e,path:d,label:I,labelStyle:k,markerEnd:M,markerStart:A,interactionWidth:B,className:ye("stroke-7! in-[g.selected]:brightness-150",!m&&"opacity-25",E!==null&&"animate-[edge-brightness-pulse_1.5s_ease-in-out_infinite]"),style:{stroke:`url(#${`linear-gradient-edge-${e}`})`},focusable:!0}),E!==null&&y.jsx(y.Fragment,{children:F?y.jsxs("g",{pointerEvents:"none",children:[y.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:d}),y.jsx("rect",{x:-L/2,y:-j/2,width:L,height:j,rx:6,fill:"#282828",stroke:"#444444",strokeWidth:1}),y.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:"#e6e6e6",fontSize:11,fontFamily:"var(--font-main)",children:E})]}):y.jsxs("g",{transform:`translate(${f}, ${g})`,pointerEvents:"none",children:[y.jsx("rect",{x:-L/2,y:-j/2,width:L,height:j,rx:6,fill:"#282828",stroke:"#444444",strokeWidth:1}),y.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:"#e6e6e6",fontSize:11,fontFamily:"var(--font-main)",children:E})]})})]})});_f.displayName="ConfigurableEdge";function Aw(e,t,n=!0,r=!1){const i=e!==null?"current"in e?e.current:e:null,s=T.useCallback(a=>{if(!i)return;let l=!0;if(n&&a.target instanceof Node&&!i.contains(a.target))l=!1;else if(r){const u="clientX"in a?{x:a.clientX,y:a.clientY}:{x:a.touches[0].clientX,y:a.touches[0].clientY},d=i.getBoundingClientRect();Wy(u,d)||(l=!1)}l||t()},[i,t,n,r]);T.useEffect(()=>(document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}),[i,s])}const ws=T.forwardRef(({placeholder:e="Input",className:t,...n},r)=>{const i=T.useMemo(()=>n.allowOnlyNumbers&&n.value!==void 0?sd(n.value,n.numberOfDecimals??5):n.value?.toString(),[n.value,n.allowOnlyNumbers,n.numberOfDecimals]),[s,a]=T.useState(i??""),[l,u]=T.useState(null),d=n.value??s,[f,g]=T.useState(d.toString());function h(x){n.allowOnlyNumbers&&/[^0-9\.\-]/.test(x)||g(x)}function m(){if(n.allowOnlyNumbers){const x=Gy(f||d.toString()),v=sd(x,n.numberOfDecimals??5);a(v),n.onChange?.(x),g(v)}else a(f),n.onChange?.(f),g(f)}return Aw(l,()=>m()),y.jsx("input",{type:"text",className:ye("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:x=>{u(x),typeof r=="function"?r(x):r&&(r.current=x)},value:f,onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&m()},onMouseMove:x=>{x.preventDefault(),x.stopPropagation()},onBlur:x=>{x.preventDefault(),x.stopPropagation(),m()}})});ws.displayName="Input";function kw({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:i,lineStyle:s,color:a,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:h=!0,shouldResize:m,onResizeStart:x,onResize:v,onResizeEnd:b,linePosition:S=["left","right"],handlePosition:N=[],resizeDirection:w="horizontal"}){return t?y.jsxs(y.Fragment,{children:[S.map(I=>y.jsx(Z0,{className:ye("!border-none",I==="left"||I==="right"?"!w-4":"!h-4",i),style:s,nodeId:e,position:I,variant:oo.Line,color:a,minWidth:l,minHeight:u,maxWidth:d,maxHeight:f,onResizeStart:x,keepAspectRatio:g,autoScale:h,shouldResize:m,onResize:v,onResizeEnd:b,resizeDirection:w},I)),N.map(I=>y.jsx(Z0,{className:n,style:r,nodeId:e,position:I,color:a,minWidth:l,minHeight:u,maxWidth:d,maxHeight:f,onResizeStart:x,keepAspectRatio:g,autoScale:h,shouldResize:m,onResize:v,onResizeEnd:b,resizeDirection:w},I))]}):null}/*!
|
|
298
|
-
* tabbable 6.2.0
|
|
299
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
300
|
-
*/var e2=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Nf=e2.join(","),Mw=typeof Element>"u",bs=Mw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bc=!Mw&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Vc=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",a=s||n&&t&&e(t.parentNode);return a},t2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},n2=function(t,n,r){if(Vc(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Nf));return n&&bs.call(t,Nf)&&i.unshift(t),i=i.filter(r),i},r2=function e(t,n,r){for(var i=[],s=Array.from(t);s.length;){var a=s.shift();if(!Vc(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,d=e(u,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d})}else{var f=bs.call(a,Nf);f&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var g=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),h=!Vc(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(g&&h){var m=e(g===!0?a.children:g.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:a,candidates:m})}else s.unshift.apply(s,a.children)}}return i},Ow=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Pw=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t2(t))&&!Ow(t)?0:t.tabIndex},o2=function(t,n){var r=Pw(t);return r<0&&n&&!Ow(t)?0:r},i2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Rw=function(t){return t.tagName==="INPUT"},s2=function(t){return Rw(t)&&t.type==="hidden"},a2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},c2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},l2=function(t){if(!t.name)return!0;var n=t.form||Bc(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=c2(i,t.form);return!s||s===t},u2=function(t){return Rw(t)&&t.type==="radio"},d2=function(t){return u2(t)&&!l2(t)},f2=function(t){var n,r=t&&Bc(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var a,l,u;for(s=!!((a=i)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(i)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&i;){var d,f,g;r=Bc(i),i=(d=r)===null||d===void 0?void 0:d.host,s=!!((f=i)!==null&&f!==void 0&&(g=f.ownerDocument)!==null&&g!==void 0&&g.contains(i))}}return s},Lw=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},p2=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=bs.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(bs.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,d=Bc(t);if(u&&!u.shadowRoot&&i(u)===!0)return Lw(t);t.assignedSlot?t=t.assignedSlot:!u&&d!==t.ownerDocument?t=d.host:t=u}t=l}if(f2(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Lw(t);return!1},h2=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return bs.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},g2=function(t,n){return!(n.disabled||Vc(n)||s2(n)||p2(n,t)||a2(n)||h2(n))},Dw=function(t,n){return!(d2(n)||Pw(n)<0||!g2(t,n))},m2=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},y2=function e(t){var n=[],r=[];return t.forEach(function(i,s){var a=!!i.scopeParent,l=a?i.scopeParent:i,u=o2(l,a),d=a?e(i.candidates):l;u===0?a?n.push.apply(n,d):n.push(l):r.push({documentOrder:s,tabIndex:u,item:i,isScope:a,content:d})}),r.sort(i2).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},jw=function(t,n){n=n||{};var r;return n.getShadowRoot?r=r2([t],n.includeContainer,{filter:Dw.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:m2}):r=n2(t,n.includeContainer,Dw.bind(null,n)),y2(r)};function v2(){return/apple/i.test(navigator.vendor)}function x2(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Fc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lu(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ss(e){return"composedPath"in e?e.composedPath()[0]:e.target}function If(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 w2(e){return e.matches("html,body")}function sr(e){return e?.ownerDocument||document}function zc(e,t,n){return n===void 0&&(n=!0),e.filter(i=>{var s;return i.parentId===t&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...zc(e,i.id,n)])}function b2(e){return"nativeEvent"in e}function Ef(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var S2=typeof document<"u",_2=function(){},Xt=S2?T.useLayoutEffect:_2;const N2={...V};function Ar(e){const t=V.useRef(e);return Xt(()=>{t.current=e}),t}const I2=N2.useInsertionEffect||(e=>e());function Fn(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return I2(()=>{t.current=e}),V.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const $w=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Hw(e,t){const n=jw(e,$w()),r=n.length;if(r===0)return;const i=x2(sr(e)),s=n.indexOf(i),a=s===-1?t===1?0:r-1:s+t;return n[a]}function E2(e){return Hw(sr(e).body,1)||e}function T2(e){return Hw(sr(e).body,-1)||e}function Tf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fc(n,r)}function C2(e){jw(e,$w()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bw(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const A2="data-floating-ui-focusable",Vw="active",Fw="selected",k2={...V};let zw=!1,M2=0;const Uw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+M2++;function O2(){const[e,t]=V.useState(()=>zw?Uw():void 0);return Xt(()=>{e==null&&t(Uw())},[]),V.useEffect(()=>{zw=!0},[]),e}const Cf=k2.useId||O2;let _s;process.env.NODE_ENV!=="production"&&(_s=new Set);function P2(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var s;(s=_s)==null||s.add(i),console.warn(i)}}function R2(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var s;(s=_s)==null||s.add(i),console.error(i)}}const Ww=V.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:i},middlewareData:{arrow:s,shift:a}},width:l=14,height:u=7,tipRadius:d=0,strokeWidth:f=0,staticOffset:g,stroke:h,d:m,style:{transform:x,...v}={},...b}=t;process.env.NODE_ENV!=="production"&&(n||P2("The `ref` prop is required for `FloatingArrow`."));const S=Cf(),[N,w]=V.useState(!1);if(Xt(()=>{if(!i)return;Wt(i).direction==="rtl"&&w(!0)},[i]),!i)return null;const[I,k]=r.split("-"),A=I==="top"||I==="bottom";let M=g;(A&&a!=null&&a.x||!A&&a!=null&&a.y)&&(M=null);const B=f*2,U=B/2,q=l/2*(d/-8+1),D=u/2*d/4,$=!!m,F=M&&k==="end"?"bottom":"top";let E=M&&k==="end"?"right":"left";M&&N&&(E=k==="end"?"left":"right");const P=s?.x!=null?M||s.x:"",L=s?.y!=null?M||s.y:"",j=m||"M0,0"+(" H"+l)+(" L"+(l-q)+","+(u-D))+(" Q"+l/2+","+u+" "+q+","+(u-D))+" Z",O={top:$?"rotate(180deg)":"",left:$?"rotate(90deg)":"rotate(-90deg)",bottom:$?"":"rotate(180deg)",right:$?"rotate(-90deg)":"rotate(90deg)"}[I];return y.jsxs("svg",{...b,"aria-hidden":!0,ref:n,width:$?l:l+B,height:l,viewBox:"0 0 "+l+" "+(u>l?u:l),style:{position:"absolute",pointerEvents:"none",[E]:P,[F]:L,[I]:A||$?"100%":"calc(100% - "+B/2+"px)",transform:[O,x].filter(W=>!!W).join(" "),...v},children:[B>0&&y.jsx("path",{clipPath:"url(#"+S+")",fill:"none",stroke:h,strokeWidth:B+(m?0:1),d:j}),y.jsx("path",{stroke:B&&!m?b.fill:"none",d:j}),y.jsx("clipPath",{id:S,children:y.jsx("rect",{x:-U,y:U*($?-1:1),width:l+B,height:l})})]})});function L2(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const D2=V.createContext(null),j2=V.createContext(null),Gw=()=>{var e;return((e=V.useContext(D2))==null?void 0:e.id)||null},Af=()=>V.useContext(j2);function Uc(e){return"data-floating-ui-"+e}function En(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const qw=Uc("safe-polygon");function kf(e,t,n){if(n&&!Ef(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Mf(e){return typeof e=="function"?e():e}function $2(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:a}=e,{enabled:l=!0,delay:u=0,handleClose:d=null,mouseOnly:f=!1,restMs:g=0,move:h=!0}=t,m=Af(),x=Gw(),v=Ar(d),b=Ar(u),S=Ar(n),N=Ar(g),w=V.useRef(),I=V.useRef(-1),k=V.useRef(),A=V.useRef(-1),M=V.useRef(!0),B=V.useRef(!1),U=V.useRef(()=>{}),q=V.useRef(!1),D=Fn(()=>{var j;const O=(j=i.current.openEvent)==null?void 0:j.type;return O?.includes("mouse")&&O!=="mousedown"});V.useEffect(()=>{if(!l)return;function j(O){let{open:W}=O;W||(En(I),En(A),M.current=!0,q.current=!1)}return s.on("openchange",j),()=>{s.off("openchange",j)}},[l,s]),V.useEffect(()=>{if(!l||!v.current||!n)return;function j(W){D()&&r(!1,W,"hover")}const O=sr(a.floating).documentElement;return O.addEventListener("mouseleave",j),()=>{O.removeEventListener("mouseleave",j)}},[a.floating,n,r,l,v,D]);const $=V.useCallback(function(j,O,W){O===void 0&&(O=!0),W===void 0&&(W="hover");const z=kf(b.current,"close",w.current);z&&!k.current?(En(I),I.current=window.setTimeout(()=>r(!1,j,W),z)):O&&(En(I),r(!1,j,W))},[b,r]),F=Fn(()=>{U.current(),k.current=void 0}),E=Fn(()=>{if(B.current){const j=sr(a.floating).body;j.style.pointerEvents="",j.removeAttribute(qw),B.current=!1}}),P=Fn(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);V.useEffect(()=>{if(!l)return;function j(J){if(En(I),M.current=!1,f&&!Ef(w.current)||Mf(N.current)>0&&!kf(b.current,"open"))return;const ie=kf(b.current,"open",w.current);ie?I.current=window.setTimeout(()=>{S.current||r(!0,J,"hover")},ie):n||r(!0,J,"hover")}function O(J){if(P()){E();return}U.current();const ie=sr(a.floating);if(En(A),q.current=!1,v.current&&i.current.floatingContext){n||En(I),k.current=v.current({...i.current.floatingContext,tree:m,x:J.clientX,y:J.clientY,onClose(){E(),F(),P()||$(J,!0,"safe-polygon")}});const ce=k.current;ie.addEventListener("mousemove",ce),U.current=()=>{ie.removeEventListener("mousemove",ce)};return}(w.current==="touch"?!Fc(a.floating,J.relatedTarget):!0)&&$(J)}function W(J){P()||i.current.floatingContext&&(v.current==null||v.current({...i.current.floatingContext,tree:m,x:J.clientX,y:J.clientY,onClose(){E(),F(),P()||$(J)}})(J))}function z(){En(I)}function Y(J){P()||$(J,!1)}if(st(a.domReference)){const J=a.domReference,ie=a.floating;return n&&J.addEventListener("mouseleave",W),h&&J.addEventListener("mousemove",j,{once:!0}),J.addEventListener("mouseenter",j),J.addEventListener("mouseleave",O),ie&&(ie.addEventListener("mouseleave",W),ie.addEventListener("mouseenter",z),ie.addEventListener("mouseleave",Y)),()=>{n&&J.removeEventListener("mouseleave",W),h&&J.removeEventListener("mousemove",j),J.removeEventListener("mouseenter",j),J.removeEventListener("mouseleave",O),ie&&(ie.removeEventListener("mouseleave",W),ie.removeEventListener("mouseenter",z),ie.removeEventListener("mouseleave",Y))}}},[a,l,e,f,h,$,F,E,r,n,S,m,b,v,i,P,N]),Xt(()=>{var j;if(l&&n&&(j=v.current)!=null&&(j=j.__options)!=null&&j.blockPointerEvents&&D()){B.current=!0;const W=a.floating;if(st(a.domReference)&&W){var O;const z=sr(a.floating).body;z.setAttribute(qw,"");const Y=a.domReference,J=m==null||(O=m.nodesRef.current.find(ie=>ie.id===x))==null||(O=O.context)==null?void 0:O.elements.floating;return J&&(J.style.pointerEvents=""),z.style.pointerEvents="none",Y.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{z.style.pointerEvents="",Y.style.pointerEvents="",W.style.pointerEvents=""}}}},[l,n,x,a,m,v,D]),Xt(()=>{n||(w.current=void 0,q.current=!1,F(),E())},[n,F,E]),V.useEffect(()=>()=>{F(),En(I),En(A),E()},[l,a.domReference,F,E]);const L=V.useMemo(()=>{function j(O){w.current=O.pointerType}return{onPointerDown:j,onPointerEnter:j,onMouseMove(O){const{nativeEvent:W}=O;function z(){!M.current&&!S.current&&r(!0,W,"hover")}f&&!Ef(w.current)||n||Mf(N.current)===0||q.current&&O.movementX**2+O.movementY**2<2||(En(A),w.current==="touch"?z():(q.current=!0,A.current=window.setTimeout(z,Mf(N.current))))}}},[f,r,n,S,N]);return V.useMemo(()=>l?{reference:L}:{},[l,L])}const Yw={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Xw=V.forwardRef(function(t,n){const[r,i]=V.useState();Xt(()=>{v2()&&i("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Uc("focus-guard")]:"",style:Yw};return y.jsx("span",{...t,...s})}),Kw=V.createContext(null),Zw=Uc("portal");function H2(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Cf(),i=B2(),[s,a]=V.useState(null),l=V.useRef(null);return Xt(()=>()=>{s?.remove(),queueMicrotask(()=>{l.current=null})},[s]),Xt(()=>{if(!r||l.current)return;const u=t?document.getElementById(t):null;if(!u)return;const d=document.createElement("div");d.id=r,d.setAttribute(Zw,""),u.appendChild(d),l.current=d,a(d)},[t,r]),Xt(()=>{if(n===null||!r||l.current)return;let u=n||i?.portalNode;u&&!Ru(u)&&(u=u.current),u=u||document.body;let d=null;t&&(d=document.createElement("div"),d.id=t,u.appendChild(d));const f=document.createElement("div");f.id=r,f.setAttribute(Zw,""),u=d||u,u.appendChild(f),l.current=f,a(f)},[t,n,r,i]),s}function Jw(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,s=H2({id:n,root:r}),[a,l]=V.useState(null),u=V.useRef(null),d=V.useRef(null),f=V.useRef(null),g=V.useRef(null),h=a?.modal,m=a?.open,x=!!a&&!a.modal&&a.open&&i&&!!(r||s);return V.useEffect(()=>{if(!s||!i||h)return;function v(b){s&&Tf(b)&&(b.type==="focusin"?Bw:C2)(s)}return s.addEventListener("focusin",v,!0),s.addEventListener("focusout",v,!0),()=>{s.removeEventListener("focusin",v,!0),s.removeEventListener("focusout",v,!0)}},[s,i,h]),V.useEffect(()=>{s&&(m||Bw(s))},[m,s]),y.jsxs(Kw.Provider,{value:V.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:g,portalNode:s,setFocusManagerState:l}),[i,s]),children:[x&&s&&y.jsx(Xw,{"data-type":"outside",ref:u,onFocus:v=>{if(Tf(v,s)){var b;(b=f.current)==null||b.focus()}else{const S=a?a.domReference:null,N=T2(S);N?.focus()}}}),x&&s&&y.jsx("span",{"aria-owns":s.id,style:Yw}),s&&_o.createPortal(t,s),x&&s&&y.jsx(Xw,{"data-type":"outside",ref:d,onFocus:v=>{if(Tf(v,s)){var b;(b=g.current)==null||b.focus()}else{const S=a?a.domReference:null,N=E2(S);N?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,v.nativeEvent,"focus-out")}}})]})}const B2=()=>V.useContext(Kw),V2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},F2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Qw=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 eb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:d="pointerdown",referencePress:f=!1,referencePressEvent:g="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:x}=t,v=Af(),b=Fn(typeof u=="function"?u:()=>!1),S=typeof u=="function"?b:u,N=V.useRef(!1),{escapeKey:w,outsidePress:I}=Qw(m),{escapeKey:k,outsidePress:A}=Qw(x),M=V.useRef(!1),B=Fn(E=>{var P;if(!n||!a||!l||E.key!=="Escape"||M.current)return;const L=(P=s.current.floatingContext)==null?void 0:P.nodeId,j=v?zc(v.nodesRef.current,L):[];if(!w&&(E.stopPropagation(),j.length>0)){let O=!0;if(j.forEach(W=>{var z;if((z=W.context)!=null&&z.open&&!W.context.dataRef.current.__escapeKeyBubbles){O=!1;return}}),!O)return}r(!1,b2(E)?E.nativeEvent:E,"escape-key")}),U=Fn(E=>{var P;const L=()=>{var j;B(E),(j=Ss(E))==null||j.removeEventListener("keydown",L)};(P=Ss(E))==null||P.addEventListener("keydown",L)}),q=Fn(E=>{var P;const L=s.current.insideReactTree;s.current.insideReactTree=!1;const j=N.current;if(N.current=!1,d==="click"&&j||L||typeof S=="function"&&!S(E))return;const O=Ss(E),W="["+Uc("inert")+"]",z=sr(i.floating).querySelectorAll(W);let Y=st(O)?O:null;for(;Y&&!Kn(Y);){const ce=Zn(Y);if(Kn(ce)||!st(ce))break;Y=ce}if(z.length&&st(O)&&!w2(O)&&!Fc(O,i.floating)&&Array.from(z).every(ce=>!Fc(Y,ce)))return;if(xn(O)&&F){const ce=Kn(O),ge=Wt(O),Q=/auto|scroll/,te=ce||Q.test(ge.overflowX),ne=ce||Q.test(ge.overflowY),oe=te&&O.clientWidth>0&&O.scrollWidth>O.clientWidth,pe=ne&&O.clientHeight>0&&O.scrollHeight>O.clientHeight,le=ge.direction==="rtl",ve=pe&&(le?E.offsetX<=O.offsetWidth-O.clientWidth:E.offsetX>O.clientWidth),me=oe&&E.offsetY>O.clientHeight;if(ve||me)return}const J=(P=s.current.floatingContext)==null?void 0:P.nodeId,ie=v&&zc(v.nodesRef.current,J).some(ce=>{var ge;return If(E,(ge=ce.context)==null?void 0:ge.elements.floating)});if(If(E,i.floating)||If(E,i.domReference)||ie)return;const ee=v?zc(v.nodesRef.current,J):[];if(ee.length>0){let ce=!0;if(ee.forEach(ge=>{var Q;if((Q=ge.context)!=null&&Q.open&&!ge.context.dataRef.current.__outsidePressBubbles){ce=!1;return}}),!ce)return}r(!1,E,"outside-press")}),D=Fn(E=>{var P;const L=()=>{var j;q(E),(j=Ss(E))==null||j.removeEventListener(d,L)};(P=Ss(E))==null||P.addEventListener(d,L)});V.useEffect(()=>{if(!n||!a)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=I;let E=-1;function P(z){r(!1,z,"ancestor-scroll")}function L(){window.clearTimeout(E),M.current=!0}function j(){E=window.setTimeout(()=>{M.current=!1},Ca()?5:0)}const O=sr(i.floating);l&&(O.addEventListener("keydown",k?U:B,k),O.addEventListener("compositionstart",L),O.addEventListener("compositionend",j)),S&&O.addEventListener(d,A?D:q,A);let W=[];return h&&(st(i.domReference)&&(W=xr(i.domReference)),st(i.floating)&&(W=W.concat(xr(i.floating))),!st(i.reference)&&i.reference&&i.reference.contextElement&&(W=W.concat(xr(i.reference.contextElement)))),W=W.filter(z=>{var Y;return z!==((Y=O.defaultView)==null?void 0:Y.visualViewport)}),W.forEach(z=>{z.addEventListener("scroll",P,{passive:!0})}),()=>{l&&(O.removeEventListener("keydown",k?U:B,k),O.removeEventListener("compositionstart",L),O.removeEventListener("compositionend",j)),S&&O.removeEventListener(d,A?D:q,A),W.forEach(z=>{z.removeEventListener("scroll",P)}),window.clearTimeout(E)}},[s,i,l,S,d,n,r,h,a,w,I,B,k,U,q,A,D]),V.useEffect(()=>{s.current.insideReactTree=!1},[s,S,d]);const $=V.useMemo(()=>({onKeyDown:B,...f&&{[V2[g]]:E=>{r(!1,E.nativeEvent,"reference-press")},...g!=="click"&&{onClick(E){r(!1,E.nativeEvent,"reference-press")}}}}),[B,r,f,g]),F=V.useMemo(()=>({onKeyDown:B,onMouseDown(){N.current=!0},onMouseUp(){N.current=!0},[F2[d]]:()=>{s.current.insideReactTree=!0}}),[B,d,s]);return V.useMemo(()=>a?{reference:$,floating:F}:{},[a,$,F])}function z2(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Cf(),s=V.useRef({}),[a]=V.useState(()=>L2()),l=Gw()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!st(m)&&R2("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,d]=V.useState(r.reference),f=Fn((m,x,v)=>{s.current.openEvent=m?x:void 0,a.emit("openchange",{open:m,event:x,reason:v,nested:l}),n?.(m,x,v)}),g=V.useMemo(()=>({setPositionReference:d}),[]),h=V.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return V.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:h,events:a,floatingId:i,refs:g}),[t,f,h,a,i,g])}function Wc(e){e===void 0&&(e={});const{nodeId:t}=e,n=z2({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=V.useState(null),[l,u]=V.useState(null),f=i?.domReference||s,g=V.useRef(null),h=Af();Xt(()=>{f&&(g.current=f)},[f]);const m=km({...e,elements:{...i,...l&&{reference:l}}}),x=V.useCallback(w=>{const I=st(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;u(I),m.refs.setReference(I)},[m.refs]),v=V.useCallback(w=>{(st(w)||w===null)&&(g.current=w,a(w)),(st(m.refs.reference.current)||m.refs.reference.current===null||w!==null&&!st(w))&&m.refs.setReference(w)},[m.refs]),b=V.useMemo(()=>({...m.refs,setReference:v,setPositionReference:x,domReference:g}),[m.refs,v,x]),S=V.useMemo(()=>({...m.elements,domReference:f}),[m.elements,f]),N=V.useMemo(()=>({...m,...r,refs:b,elements:S,nodeId:t}),[m,b,S,t,r]);return Xt(()=>{r.dataRef.current.floatingContext=N;const w=h?.nodesRef.current.find(I=>I.id===t);w&&(w.context=N)}),V.useMemo(()=>({...m,context:N,refs:b,elements:S}),[m,b,S,N])}function Of(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[Vw]:a,[Fw]:l,...u}=e;s=u}return{...n==="floating"&&{tabIndex:-1,[A2]:""},...s,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(u=>{let[d,f]=u;if(!(i&&[Vw,Fw].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof f=="function"){var g;(g=r.get(d))==null||g.push(f),a[d]=function(){for(var h,m=arguments.length,x=new Array(m),v=0;v<m;v++)x[v]=arguments[v];return(h=r.get(d))==null?void 0:h.map(b=>b(...x)).find(b=>b!==void 0)}}}else a[d]=f}),a),{})}}function tb(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),i=V.useCallback(l=>Of(l,e,"reference"),t),s=V.useCallback(l=>Of(l,e,"floating"),n),a=V.useCallback(l=>Of(l,e,"item"),r);return V.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a}),[i,s,a])}const nb=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function ti(e,t){return typeof e=="function"?e(t):e}function U2(e,t){const[n,r]=V.useState(e);return e&&!n&&r(!0),V.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function W2(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i=="number"?i:i.close)||0,[l,u]=V.useState("unmounted"),d=U2(n,a);return!d&&l==="close"&&u("unmounted"),Xt(()=>{if(r){if(n){u("initial");const f=requestAnimationFrame(()=>{_o.flushSync(()=>{u("open")})});return()=>{cancelAnimationFrame(f)}}u("close")}},[n,r]),{isMounted:d,status:l}}function rb(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,u=l.split("-")[0],d=V.useMemo(()=>({side:u,placement:l}),[u,l]),f=typeof a=="number",g=(f?a:a.open)||0,h=(f?a:a.close)||0,[m,x]=V.useState(()=>({...ti(s,d),...ti(n,d)})),{isMounted:v,status:b}=W2(e,{duration:a}),S=Ar(n),N=Ar(r),w=Ar(i),I=Ar(s);return Xt(()=>{const k=ti(S.current,d),A=ti(w.current,d),M=ti(I.current,d),B=ti(N.current,d)||Object.keys(k).reduce((U,q)=>(U[q]="",U),{});if(b==="initial"&&x(U=>({transitionProperty:U.transitionProperty,...M,...k})),b==="open"&&x({transitionProperty:Object.keys(B).map(nb).join(","),transitionDuration:g+"ms",...M,...B}),b==="close"){const U=A||k;x({transitionProperty:Object.keys(U).map(nb).join(","),transitionDuration:h+"ms",...M,...U})}},[h,w,S,N,I,g,b,d]),{isMounted:v,styles:m}}function ob({placement:e="top",offsetPx:t=10,hoverDelay:n={open:150,close:0},transitionDuration:r=150,withArrow:i=!0,initialTransition:s={opacity:0,transform:"translateY(4px)"}}={}){const[a,l]=T.useState(!1),u=T.useRef(null),d=[Oi(t),Ri(),Pi({padding:8}),...i?[Vu({element:u})]:[]],{refs:f,floatingStyles:g,context:h}=Wc({open:a,onOpenChange:l,middleware:d,whileElementsMounted:Mi,placement:e}),m=$2(h,{delay:n}),x=eb(h),{getReferenceProps:v,getFloatingProps:b}=tb([m,x]),{isMounted:S,styles:N}=rb(h,{duration:r,initial:s});return{isOpen:a,setIsOpen:l,refs:f,floatingStyles:g,context:h,arrowRef:u,getReferenceProps:v,getFloatingProps:b,isMounted:S,transitionStyles:N}}function G2(e){return e instanceof Error?e.message:typeof e=="string"?e:"Unknown error"}function zn(e){return{message:G2(e.error),nodeId:e.nodeId,nodeTypeId:e.nodeTypeId,nodeTypeName:e.nodeTypeName,handleId:e.handleId,path:e.path,loopContext:e.loopContext,groupContext:e.groupContext,timestamp:e.timestamp,duration:e.duration,originalError:e.error}}function Pf(e,t,n){const r=[],i=new Set,s=[{nodeId:e}];for(;s.length>0;){const a=s.shift();if(!a||i.has(a.nodeId))continue;i.add(a.nodeId);const l=n.get(a.nodeId);l&&r.push({nodeId:a.nodeId,nodeTypeId:l.nodeTypeId,nodeTypeName:l.nodeTypeName,handleId:a.handleId,concurrencyLevel:l.concurrencyLevel});for(const[u,d]of t){const f=u.indexOf(":");if(!(f===-1||u.substring(0,f)!==a.nodeId))for(const h of d)i.has(h.sourceNodeId)||s.push({nodeId:h.sourceNodeId,handleId:h.sourceHandleId})}}return r.reverse(),r}function ib(e){const t=[];if(t.push(`Error in "${e.nodeTypeName}" (${e.nodeId})`),t.push(`Message: ${e.message}`),e.path.length>0){const n=e.path.map(r=>r.nodeTypeName).join(" → ");t.push(`Path: ${n}`)}return e.loopContext&&t.push(`Loop: iteration ${e.loopContext.iteration} of ${e.loopContext.maxIterations}`),e.groupContext&&t.push(`Group: ${e.groupContext.groupNodeTypeId} (depth ${e.groupContext.depth})`),t.push(`Duration: ${e.duration.toFixed(2)}ms`),t.join(`
|
|
301
|
-
`)}function sb({icon:e,content:t,iconClassName:n}){const{refs:r,floatingStyles:i,context:s,arrowRef:a,getReferenceProps:l,getFloatingProps:u,isMounted:d,transitionStyles:f}=ob({placement:"top",offsetPx:10,hoverDelay:{open:150,close:0},transitionDuration:150});return y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:r.setReference,className:ye("absolute top-1 right-1 z-10 cursor-pointer pointer-events-auto",n),...l(),children:e}),d&&y.jsx("div",{ref:r.setFloating,style:{...i,zIndex:50},...u(),children:y.jsxs("div",{style:f,className:"max-w-xs rounded-md bg-[#181818] border border-secondary-dark-gray px-3 py-2 text-[14px] leading-[18px] font-main text-primary-white shadow-lg whitespace-pre-wrap pointer-events-auto",children:[t,y.jsx(Ww,{ref:a,context:s,width:10,height:5,fill:"#181818",strokeWidth:1,stroke:"var(--color-secondary-dark-gray)"})]})})]})}function ab({visualState:e,errors:t,warnings:n,children:r}){const i=t&&t.length>0?t.map(a=>ib(a)).join(`
|
|
302
|
-
|
|
303
|
-
`):void 0,s=n&&n.length>0?n.join(`
|
|
304
|
-
`):void 0;return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:ye("absolute inset-0 rounded-md pointer-events-none z-10 transition-[outline-color,box-shadow,opacity] duration-200",e==="idle"&&"[outline:5px_solid_transparent] shadow-none",e==="running"&&"[outline:5px_dashed_var(--color-primary-blue)] animate-[running-glow_2s_ease-in-out_infinite]",e==="completed"&&"[outline:5px_solid_var(--color-status-completed)] shadow-[0_0_12px_rgba(76,175,80,0.3)]",e==="errored"&&"[outline:5px_solid_var(--color-status-errored)] shadow-[0_0_12px_rgba(255,68,68,0.3)]",e==="skipped"&&"[outline:5px_dashed_var(--color-secondary-dark-gray)] opacity-50",e==="warning"&&"[outline:5px_solid_var(--color-status-warning)] shadow-[0_0_12px_rgba(255,165,0,0.3)]")}),e==="errored"&&i&&y.jsx(sb,{icon:y.jsx(R_,{className:"w-5 h-5 text-[#FF4444]"}),content:i}),e==="warning"&&s&&y.jsx(sb,{icon:y.jsx(ng,{className:"w-5 h-5 text-[#FFA500]"}),content:s}),e==="skipped"&&y.jsx("div",{className:"absolute inset-0 rounded-md bg-black/30 pointer-events-none z-10"}),r]})}function cb({orientation:e="horizontal",disabled:t=!1,scrollSpeedPxPerFrame:n=14,observeChildren:r=!0}={}){const i=T.useRef(null),[s,a]=T.useState(!1),[l,u]=T.useState(!1),d=T.useRef(null),f=T.useRef(null),g=T.useCallback(()=>e==="vertical"?{pos:"scrollTop",size:"clientHeight",full:"scrollHeight"}:{pos:"scrollLeft",size:"clientWidth",full:"scrollWidth"},[e]),h=T.useCallback(()=>{const b=i.current;if(!b||t){a(!1),u(!1);return}const S=g(),N=b[S.pos],w=b[S.size],I=b[S.full];a(N>0),u(N+w<I-1)},[t,g]),m=T.useCallback(()=>{d.current!==null&&(cancelAnimationFrame(d.current),d.current=null),f.current=null},[]),x=T.useCallback(()=>{const b=i.current;if(!b||!f.current||t){m();return}const S=g(),N=f.current==="start"?-1:1;if(S.pos==="scrollLeft"?b.scrollLeft+=N*n:b.scrollTop+=N*n,h(),N<0&&!s||N>0&&!l){m();return}d.current=requestAnimationFrame(x)},[l,s,t,g,n,m,h]),v=T.useCallback(b=>{t||f.current!==b&&(f.current=b,d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(x))},[t,x]);return T.useEffect(()=>{h();const b=i.current;if(!b)return;const S=()=>h();b.addEventListener("scroll",S,{passive:!0});let N=null;"ResizeObserver"in window&&(N=new ResizeObserver(()=>h()),N.observe(b));const w=()=>h();window.addEventListener("resize",w);const I=()=>m();return window.addEventListener("pointerup",I),window.addEventListener("touchend",I),()=>{b.removeEventListener("scroll",S),window.removeEventListener("resize",w),window.removeEventListener("pointerup",I),window.removeEventListener("touchend",I),N&&N.disconnect()}},[h,m]),T.useEffect(()=>{const b=requestAnimationFrame(h);return()=>cancelAnimationFrame(b)},[h]),T.useEffect(()=>{if(!r)return;const b=i.current;if(!b)return;const S=new MutationObserver(()=>h());return S.observe(b,{childList:!0,subtree:!0}),()=>S.disconnect()},[r,h]),{listRef:i,canScrollStart:s,canScrollEnd:l,startAutoScroll:v,stopAutoScroll:m}}const Rf=T.forwardRef(({children:e,orientation:t="horizontal",className:n,scrollAreaClassName:r,showArrows:i=!0,disabled:s=!1,ariaLabel:a,scrollSpeedPxPerFrame:l=14,observeChildren:u=!0},d)=>{const{listRef:f,canScrollStart:g,canScrollEnd:h,startAutoScroll:m,stopAutoScroll:x}=cb({orientation:t,disabled:s,scrollSpeedPxPerFrame:l,observeChildren:u});T.useImperativeHandle(d,()=>f.current);const v=i&&g&&!s,b=i&&h&&!s,S=t==="horizontal"?"overflow-x-scroll overflow-y-hidden flex items-center gap-2 whitespace-nowrap":"overflow-y-scroll overflow-x-hidden flex flex-col items-start gap-2";return y.jsxs("div",{className:ye("relative w-full h-full",n),children:[v&&y.jsx(Qn,{className:ye("h-[44px] border-secondary-dark-gray bg-primary-black absolute z-10",t==="horizontal"?"left-0 top-1/2 -translate-y-1/2":"top-0 left-1/2 -translate-x-1/2"),disabled:!v,onMouseDown:()=>m("start"),onMouseUp:x,onMouseLeave:x,onTouchStart:()=>m("start"),onTouchEnd:x,children:t==="horizontal"?y.jsx(iu,{}):y.jsx(su,{})}),y.jsx("div",{ref:f,"aria-label":a,className:ye("no-scrollbar w-full h-full",S,r),children:e}),b&&y.jsx(Qn,{className:ye("h-[44px] border-secondary-dark-gray bg-primary-black absolute z-10",t==="horizontal"?"right-0 top-1/2 -translate-y-1/2":"bottom-0 left-1/2 -translate-x-1/2"),disabled:!b,onMouseDown:()=>m("end"),onMouseUp:x,onMouseLeave:x,onTouchStart:()=>m("end"),onTouchEnd:x,children:t==="horizontal"?y.jsx(zr,{}):y.jsx(Ei,{})})]})});Rf.displayName="ScrollableButtonContainer";function sn({content:e,children:t,infoIcon:n=!1,placement:r="bottom",maxWidth:i=240,className:s,style:a,as:l="span",triggerProps:u}){const[d,f]=T.useState(!1),g=T.useRef(null),h=T.useRef(null),{refs:m,floatingStyles:x,context:v}=Wc({open:d,onOpenChange:f,middleware:[Oi(6),Ri(),Pi({padding:8}),Vu({element:h})],whileElementsMounted:Mi,placement:r});T.useEffect(()=>{g.current&&m.setPositionReference(g.current)},[m]);const{isMounted:b,styles:S}=rb(v,{duration:120,initial:{opacity:0,transform:"translateY(-3px)"}});return y.jsxs(y.Fragment,{children:[y.jsxs(l,{ref:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:ye("inline-flex items-center gap-1.5",s),style:a,...u,children:[n&&y.jsx(L_,{className:"h-3.5 w-3.5 shrink-0 text-primary-white"}),t]}),b&&y.jsx(Jw,{children:y.jsx("div",{ref:m.setFloating,style:{...x,pointerEvents:"none",zIndex:50},children:y.jsxs("div",{style:{...S,maxWidth:`${i}px`},className:"rounded-md border-[1.25px] border-primary-white/60 bg-tooltip-bg px-3 py-2 text-[12px] text-primary-white shadow-2xl backdrop-blur-sm",children:[e,y.jsx(Ww,{ref:h,context:v,width:8,height:4,fill:"var(--color-tooltip-bg)",strokeWidth:1,stroke:"var(--color-secondary-dark-gray)"})]})})})]})}function lb({onMove:e,onClick:t,clickThreshold:n=2,enabled:r=!0,preventDefaultAndStopPropagation:i=!0}={}){const[s,a]=T.useState(!1),[l,u]=T.useState(null),d=T.useRef(null),f=T.useRef(null),g=T.useCallback(h=>{u(h)},[]);return T.useEffect(()=>{if(!l||!r)return;const h=m=>{i&&(m.preventDefault(),m.stopPropagation()),d.current={x:m.clientX,y:m.clientY},f.current={width:l.clientWidth,height:l.clientHeight},a(!0);const x=b=>{i&&(b.preventDefault(),b.stopPropagation()),document.removeEventListener("mouseup",x),document.removeEventListener("mousemove",v),a(!1),d.current&&Math.sqrt((b.clientX-d.current.x)**2+(b.clientY-d.current.y)**2)<n&&t?.()},v=b=>{i&&(b.preventDefault(),b.stopPropagation());const S=b.movementX,N=b.movementY,w=f.current?.width||1,I=f.current?.height||1,k=S/w,A=N/I;e?.(S,N,k,A,w,I)};document.addEventListener("mouseup",x),document.addEventListener("mousemove",v)};return l.addEventListener("mousedown",h),()=>{l.removeEventListener("mousedown",h)}},[l,r,e,t,n,i]),{isDragging:s,dragRef:g}}const ni=T.forwardRef(({name:e="Input",value:t,onChange:n=()=>{},className:r,min:i,max:s,step:a,size:l="normal",decimals:u},d)=>{const f=l==="small",g=u??(f?1:4),[h,m]=T.useState(t??0),[x,v]=T.useState(!1),b=T.useRef(0),S=T.useRef(0),N=t??h,w=T.useRef(0);T.useEffect(()=>{if(a!==void 0)w.current=Math.abs(a);else if(i!==void 0&&s!==void 0)w.current=Math.abs(s-i);else{const W=Math.pow(10,-g);w.current=Math.max(Math.abs(parseFloat((N||1).toString())),W)}},[N,a,g,s,i]);const{isDragging:I,dragRef:k}=lb({onMove:(W,z,Y,J,ie)=>{const ee=W/(ie+60);b.current+=ee,Math.abs(b.current)>.05&&Date.now()-S.current>50&&(S.current=Date.now(),A(w.current*b.current),b.current=0)},onClick:U,clickThreshold:2});function A(W){m(z=>{let Y=z+W;return i!==void 0&&Y<=i?Y=i:s!==void 0&&Y>=s&&(Y=s),n(Y),Y})}function M(W=.1){A(w.current*W)}function B(W=.1){A(-w.current*W)}function U(){v(!0)}function q(W){A(W-N),v(!1)}const D=I,$=i!==void 0&&s!==void 0&&N!==void 0&&s!==i?(N-i)/(s-i)*100:-1,F=$!==-1?`linear-gradient(90deg,#4772b3 ${$}%, #545454 ${$}%)`:"",E=f?"h-[22px]":"h-[44px]",P=f?`${E} w-[18px]`:`${E} w-[30px]`,L=f?"h-3 w-3":"",j=f?"text-[10px]":"",O=f?`${E} rounded-none px-1.5 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent gap-1`:`${E} rounded-none pl-1.5 pr-0 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent`;return x?y.jsx(ws,{className:ye("w-full",f&&"h-[22px] text-[11px] px-1.5"),placeholder:e,value:N,allowOnlyNumbers:!0,numberOfDecimals:g,onChange:W=>q(W),ref:d}):y.jsxs("div",{className:ye("flex items-center gap-0 group/lightParentGroupBasedHover w-max bg-primary-gray",f?"rounded-sm":"rounded-md",r),style:F!==""?{background:F}:{},ref:d,children:[y.jsx(Qn,{color:"lightParentGroupBasedHover",className:ye(P,"rounded-r-none p-0 shrink-0 bg-transparent",j),onClick:()=>B(.1),"aria-label":`Decrement ${e}`,applyHoverStyles:!D,children:y.jsx(iu,{className:L||void 0})}),y.jsxs(Qn,{color:"lightParentGroupBasedHover",className:ye(O,j),applyHoverStyles:!D,ref:k,children:[y.jsx("span",{className:"truncate text-left",children:e}),y.jsx("span",{className:"truncate tabular-nums",children:N.toFixed(g)})]}),y.jsx(Qn,{color:"lightParentGroupBasedHover",className:ye(P,"rounded-l-none p-0 shrink-0 bg-transparent",j),onClick:()=>M(.1),"aria-label":`Increment ${e}`,applyHoverStyles:!D,children:y.jsx(zr,{className:L||void 0})})]})});ni.displayName="SliderNumberInput";const ub=100,db=100,Lf=75,fb=100;function q2(e,t){const[n,r]=T.useState(null),i=T.useRef(new Map),s=T.useRef(null),a=T.useRef(!1),l=T.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),[u,d]=T.useState(null),[f,g]=T.useState(null),h=T.useRef(null),m=T.useRef(null),x=T.useRef(null),[v,b]=T.useState(null),S=T.useRef(null),N=T.useRef(null),w=T.useRef(!1),I=T.useRef(!1),[k,A]=T.useState(null),M=T.useRef(null),B=T.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null)},[]),U=T.useCallback(ee=>{const ce=x.current;if(ee!==ce){if(x.current=ee,B(),ce!==null&&ee!==null){I.current=!0;const ge=e.find(Q=>Q.id===ce);ge?.subItems&&d(ge.subItems),g("initial")}else if(I.current=!1,g(null),d(null),ee===null){const ge=e.find(Q=>Q.id===ce);ge?.subItems?(A(ge.subItems),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{A(null),w.current=!1,b(null),M.current=null},ub)):(w.current=!1,b(null))}else M.current&&(clearTimeout(M.current),M.current=null),A(null);r(ee)}},[e,B]);T.useEffect(()=>{if(f==="initial")return m.current=requestAnimationFrame(()=>{m.current=requestAnimationFrame(()=>{g("animating"),m.current=null,h.current=setTimeout(()=>{g(null),d(null),I.current=!1,h.current=null},db)})}),B},[f,B]);const D=(n?e.find(ee=>ee.id===n):null)?.subItems??null;T.useLayoutEffect(()=>{N.current&&N.current.disconnect();const ee=S.current;if(!ee||!n)return;const ce=new ResizeObserver(ge=>{const Q=ge[0];if(!Q)return;const{width:te,height:ne}=Q.contentRect;te>0&&ne>0&&(w.current=!0,b({w:te,h:ne}))});return ce.observe(ee),N.current=ce,()=>ce.disconnect()},[n]);const $=n?i.current.get(n):null,{refs:F,floatingStyles:E,placement:P}=Wc({open:n!==null,onOpenChange:ee=>{ee||U(null)},strategy:"fixed",placement:"right-start",middleware:[Oi(5),Ri({fallbackPlacements:["left-start"]}),Pi({padding:8})],whileElementsMounted:Mi});T.useLayoutEffect(()=>{$&&F.setReference($)},[$,F]);const L=T.useCallback(ee=>{ee.onClick&&ee.onClick(),t&&t(ee)},[t]),j=T.useCallback(ee=>{l(),ee!==n&&(n===null?ee!==null&&(s.current=setTimeout(()=>{U(ee),s.current=null},Lf)):ee!==null?s.current=setTimeout(()=>{U(ee),s.current=null},fb):s.current=setTimeout(()=>{a.current||U(null),s.current=null},fb))},[n,l,U]),O=T.useCallback(()=>{a.current=!0,l()},[l]),W=T.useCallback(()=>{a.current=!1,l(),s.current=setTimeout(()=>{U(null),s.current=null},Lf)},[l,U]),z=T.useCallback(()=>{a.current||(l(),s.current=setTimeout(()=>{a.current||U(null),s.current=null},Lf))},[l,U]),Y=T.useCallback(ee=>ce=>{ce?i.current.set(ee,ce):i.current.delete(ee)},[]),J=n!==null,ie=v!==null?{width:v.w,height:v.h,overflow:"hidden"}:{};return{activeSubmenuId:n,activeSubItems:D,prevSubItems:u,exitSubItems:k,crossfadePhase:f,containerSize:v,isSwitching:I.current,isOpen:J,panelSizeStyles:ie,incomingRef:S,floatingRefs:F,floatingStyles:E,placement:P,handleItemClick:L,handleHover:j,handleFloatingMouseEnter:O,handleFloatingMouseLeave:W,handleListMouseLeave:z,makeItemRef:Y,SUBMENU_DURATION_MS:ub,CONTENT_FADE_DURATION_MS:db}}const Y2=({item:e,index:t,onItemClick:n,onHover:r,itemRef:i,itemTransitionStyle:s})=>{const a=e.subItems&&e.subItems.length>0;return y.jsxs("li",{className:"relative",children:[e.separator&&t>0&&y.jsx("div",{className:"border-t border-gray-600 m-0"}),y.jsxs("div",{ref:i,className:ye("flex items-center justify-between gap-2 px-3 py-1.25 hover:bg-[#3F3F3F] cursor-pointer","transition-colors duration-150"),style:s,onClick:()=>n(e),onMouseEnter:()=>r(a?e.id:null),children:[y.jsxs("div",{className:"flex items-center gap-2",children:[e.icon&&y.jsx("span",{className:"text-primary-white w-3 h-3 flex items-center justify-center",children:e.icon}),y.jsx("span",{className:"text-sm leading-3.5 text-primary-white font-main",children:e.label})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[e.shortcut&&y.jsx("span",{className:"text-sm leading-3.5 text-gray-400 font-mono",children:e.shortcut}),a&&y.jsx(zr,{className:"w-3 h-3 text-gray-400"})]})]})]})},Gc=({subItems:e,onItemClick:t,className:n,bare:r=!1,itemTransitionStyle:i})=>{const{activeSubItems:s,prevSubItems:a,exitSubItems:l,crossfadePhase:u,isSwitching:d,isOpen:f,panelSizeStyles:g,incomingRef:h,floatingRefs:m,floatingStyles:x,placement:v,handleItemClick:b,handleHover:S,handleFloatingMouseEnter:N,handleFloatingMouseLeave:w,handleListMouseLeave:I,makeItemRef:k,SUBMENU_DURATION_MS:A,CONTENT_FADE_DURATION_MS:M}=q2(e,t),B=e.some(U=>U.subItems&&U.subItems.length>0);return y.jsxs(y.Fragment,{children:[y.jsx("ul",{className:ye("min-w-48 py-1",!r&&"bg-[#181818] border border-none rounded-md shadow-lg",n),onMouseLeave:I,children:e.map((U,q)=>y.jsx(Y2,{item:U,index:q,onItemClick:b,onHover:S,itemRef:k(U.id),itemTransitionStyle:i},U.id))}),B&&y.jsx(Jw,{children:y.jsx("div",{ref:m.setFloating,style:{...x,transitionProperty:d?"opacity, transform, translate":"opacity, translate",transitionDuration:`${A}ms`,transitionTimingFunction:"ease-out"},className:ye("z-50",f?"opacity-100 translate-x-0":ye("opacity-0 pointer-events-none",v.startsWith("right")?"-translate-x-[20px]":"translate-x-[20px]")),onMouseEnter:N,onMouseLeave:w,children:y.jsx("div",{className:"bg-[#181818] rounded-md shadow-lg ml-1",style:{...g,transitionProperty:"opacity, translate, width, height",transitionDuration:`${A}ms`,transitionTimingFunction:"ease-out"},children:y.jsxs("div",{className:"relative",children:[u!==null&&a&&y.jsx("div",{className:"absolute inset-0",style:{pointerEvents:"none"},children:y.jsx(Gc,{subItems:a,onItemClick:t,bare:!0,itemTransitionStyle:u==="initial"?{opacity:1,transform:"translateX(0)"}:{opacity:0,transform:"translateX(10%)",transition:`opacity ${M}ms ease-out, transform ${M}ms ease-out`}})}),s&&y.jsx("div",{ref:h,children:y.jsx(Gc,{subItems:s,onItemClick:t,bare:!0,itemTransitionStyle:u==="initial"?{opacity:0,transform:"translateX(-10%)"}:u==="animating"?{opacity:1,transform:"translateX(0)",transition:`opacity ${M}ms ease-out, transform ${M}ms ease-out`}:void 0})}),!s&&l&&y.jsx(Gc,{subItems:l,onItemClick:t,bare:!0})]})})})})]})},pb=({subItems:e,className:t,onItemClick:n})=>y.jsx("div",{className:ye("relative",t),children:y.jsx(Gc,{subItems:e,onItemClick:n})});function Df(e){return e.kind==="leaf"?e.priority:e.children.length===0?0:Math.max(...e.children.map(Df))}function jf(e){return e.kind==="leaf"?e.insertionIndex:e.children.length===0?1/0:Math.min(...e.children.map(jf))}function hb(e){e.sort((t,n)=>{const r=Df(n)-Df(t);return r!==0?r:jf(t)-jf(n)});for(const t of e)t.kind==="folder"&&hb(t.children)}function gb(e){const t=[];for(const n of e)if(n.kind==="leaf")t.push(n.item);else{const r=gb(n.children);r.length>0&&t.push({id:`folder-${n.label}`,label:n.label,subItems:r})}return t}function mb({typeOfNodes:e,dispatch:t,setContextMenu:n,contextMenuPosition:r,isRecursionAllowed:i=!0,currentNodeType:s}){const a=Object.keys(e);if(a.length===0)return[];function l(g,h){if(h||!s)return g;const m=ew({typeOfNodes:e},s);return g.filter(x=>!m.has(x))}const u=l(a,i),d=[];for(let g=0;g<u.length;g++){const h=u[g],m=e[h],x=m.locationInContextMenu??[],v=m.priorityInContextMenu??0,b={kind:"leaf",item:{id:`add-${String(h)}`,label:m.name,onClick:()=>{t({type:ft.ADD_NODE_AND_SELECT,payload:{type:h,position:r}}),n({isOpen:!1,position:{x:0,y:0}})}},priority:v,insertionIndex:g};if(x.length===0)d.push(b);else{let S=d;for(const N of x){let w=S.find(I=>I.kind==="folder"&&I.label===N);w||(w={kind:"folder",label:N,children:[]},S.push(w)),S=w.children}S.push(b)}}hb(d);const f=gb(d);return[{id:"add-node",label:"Add Node",icon:T.createElement(Jh,{className:"w-4 h-4"}),subItems:f}]}const yb=_T,$f=T.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(vy,{ref:r,className:ye("flex h-[44px] w-full items-center justify-between rounded-md border cursor-pointer border-secondary-dark-gray bg-primary-black px-4 py-2 text-[27px] leading-[27px] font-main text-primary-white data-[placeholder]:text-[#6B6B6B] focus:outline-none focus-visible:ring-1 focus-visible:ring-white disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[y.jsx("span",{className:"text-left truncate",children:t}),y.jsx(NT,{asChild:!0,children:y.jsx(Ei,{className:"h-6 w-6 shrink-0 ml-2"})})]}));$f.displayName=vy.displayName;const Hf=T.forwardRef(({className:e,...t},n)=>y.jsx(_y,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(su,{className:"h-4 w-4"})}));Hf.displayName=_y.displayName;const Bf=T.forwardRef(({className:e,...t},n)=>y.jsx(Ny,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(Ei,{className:"h-4 w-4"})}));Bf.displayName=Ny.displayName;const Vf=T.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>y.jsx(IT,{children:y.jsxs(wy,{ref:i,className:ye("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-secondary-dark-gray bg-[#181818] text-primary-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[y.jsx(Hf,{}),y.jsx(ET,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(Bf,{})]})}));Vf.displayName=wy.displayName;const vb=T.forwardRef(({className:e,...t},n)=>y.jsx(by,{ref:n,className:ye("py-1.5 px-2 text-[27px] leading-[27px] font-main font-semibold text-primary-white",e),...t}));vb.displayName=by.displayName;const qc=T.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(Sy,{ref:r,className:ye("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-4 pr-2 text-[27px] leading-[27px] font-main text-primary-white outline-none focus:bg-[#3F3F3F] focus:text-primary-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx(CT,{children:t}),y.jsx("span",{className:"ml-auto",children:y.jsx(AT,{children:y.jsx(sa,{className:"h-5 w-5 ml-2 mr-1",strokeWidth:2.5})})})]}));qc.displayName=Sy.displayName;const xb=T.forwardRef(({className:e,...t},n)=>y.jsx(Iy,{ref:n,className:ye("-mx-1 my-1 h-px bg-secondary-dark-gray",e),...t}));xb.displayName=Iy.displayName;const X2=TT,Ff=T.forwardRef(({className:e,...t},n)=>y.jsx(xy,{ref:n,className:ye(e),...t}));Ff.displayName=xy.displayName;const K2={small:{wrapper:"rounded-sm border border-secondary-dark-gray/80",button:"px-2.5 py-0.5 text-[12px]",divider:"border-l border-secondary-dark-gray/50",activeBg:"bg-primary-blue text-white",inactiveBg:"bg-[#1a1a1a] text-secondary-light-gray hover:bg-primary-dark-gray hover:text-primary-white"},normal:{wrapper:"rounded-md border border-runner-timeline-box-border bg-runner-inset-bg p-[3px]",button:"rounded px-3.5 py-1 text-[13px]",divider:"",activeBg:"bg-primary-blue text-white",inactiveBg:"bg-[#1a1a1a] text-secondary-light-gray"}};function zf({options:e,value:t,onChange:n,disabled:r=!1,size:i="normal",className:s}){const a=K2[i];return y.jsx("div",{className:ye("flex overflow-hidden",a.wrapper,s),children:e.map((l,u)=>y.jsx("button",{type:"button",onClick:()=>n(l.value),disabled:r,className:ye("btn-press font-medium transition-all duration-100",a.button,u>0&&a.divider,t===l.value?a.activeBg:a.inactiveBg,r&&t!==l.value&&"cursor-not-allowed opacity-50",!r&&t!==l.value&&i==="normal"&&"hover:text-primary-white"),children:l.label},l.value))})}const Z2=[{value:"instant",label:"Instant"},{value:"stepByStep",label:"Step-by-Step"}],J2={idle:{color:"bg-secondary-dark-gray",pulse:!1,label:"Idle"},compiling:{color:"bg-primary-blue",pulse:!0,label:"Compiling"},running:{color:"bg-status-completed",pulse:!0,label:"Running"},paused:{color:"bg-status-warning",pulse:!1,label:"Paused"},completed:{color:"bg-status-completed",pulse:!1,label:"Completed"},errored:{color:"bg-status-errored",pulse:!1,label:"Error"}};function Ns({icon:e,onClick:t,disabled:n,active:r=!1,variant:i="default",title:s}){const a=i==="play";return y.jsx("button",{type:"button",onClick:t,disabled:n,title:s,className:ye("btn-press flex items-center justify-center transition-all duration-100",a?"h-8 w-8 rounded-md bg-primary-blue text-white shadow-[0_0_12px_rgba(74,120,194,0.4)]":"h-7 w-7 rounded",n&&"cursor-not-allowed opacity-30",!n&&!r&&!a&&"hover:bg-primary-dark-gray hover:text-white",!n&&a&&"hover:brightness-110",r&&!a&&"bg-primary-blue shadow-[0_0_8px_rgba(71,114,179,0.5)]",!n&&"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-blue"),children:e})}function wb({runnerState:e,onRun:t,onPause:n,onStep:r,onStop:i,onReset:s,mode:a,onModeChange:l,maxLoopIterations:u,onMaxLoopIterationsChange:d}){const f=J2[e],g=e==="idle"||e==="completed"||e==="errored",h=e==="idle"||e==="errored",m=e==="running",x=e==="paused"||e==="idle"||e==="errored",v=e==="running"||e==="paused",b=e==="completed"||e==="errored";return y.jsxs("div",{className:"flex h-11 w-full items-center gap-2 border-b border-secondary-dark-gray bg-runner-toolbar-bg px-3",children:[y.jsxs("div",{className:"flex w-[140px] items-center gap-2.5",children:[y.jsxs("div",{className:"relative flex items-center justify-center",children:[y.jsx("div",{className:ye("h-2.5 w-2.5 rounded-full transition-colors duration-200",f.color,f.pulse&&"animate-pulse",f.pulse&&"shadow-[0_0_8px_currentColor]")}),f.pulse&&y.jsx("div",{className:ye("absolute h-2.5 w-2.5 animate-ping rounded-full opacity-50",f.color)})]}),y.jsx("span",{className:"text-[14px] text-primary-white",children:f.label})]}),y.jsx("div",{className:"mx-3 h-6 w-px bg-secondary-dark-gray"}),y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx(Ns,{icon:y.jsx(au,{className:"h-3.5 w-3.5 fill-current"}),onClick:t,disabled:!h,active:e==="running",variant:"play",title:"Run"}),y.jsx(Ns,{icon:y.jsx(H_,{className:"h-4 w-4 text-primary-white"}),onClick:n,disabled:!m,title:"Pause"}),y.jsx(Ns,{icon:y.jsx(V_,{className:"h-4 w-4 text-primary-white"}),onClick:r,disabled:!x,title:"Step"}),y.jsx(Ns,{icon:y.jsx(tg,{className:"h-4 w-4 text-primary-white"}),onClick:i,disabled:!v,title:"Stop"}),y.jsx(Ns,{icon:y.jsx(B_,{className:"h-4 w-4 text-primary-white"}),onClick:s,disabled:!b,title:"Reset"})]}),y.jsx("div",{className:"mx-3 h-6 w-px bg-secondary-dark-gray"}),y.jsx(sn,{content:"Instant runs the entire graph at once, then enables replay. Step-by-Step pauses after each node so you can inspect intermediate values.",children:y.jsx(zf,{options:Z2,value:a,onChange:l,disabled:!g,size:"small"})}),y.jsx(sn,{content:"Maximum loop iterations before the runner throws an error. Protects against infinite loops.",children:y.jsx("div",{className:ye("ml-4",!g&&"pointer-events-none opacity-50"),children:y.jsx(ni,{name:"Max Loops",value:u,onChange:S=>d(Math.max(1,Math.round(S))),size:"small",decimals:0})})})]})}const bb=T.createContext(null);function Q2({children:e}){const[t,n]=T.useState(null),[r,i]=T.useState(!0),[s,a]=T.useState(!0),[l,u]=T.useState(!0),[d,f]=T.useState("execution"),[g,h]=T.useState(!1),[m,x]=T.useState(new Map),[v,b]=T.useState(2),S=T.useCallback(()=>{const I={};for(const[k,A]of m)I[k]=A;return{selectedStepIndex:t,edgeValuesAnimated:r,panelOpen:s,autoScroll:l,timeMode:d,timelineCollapsed:g,selectedIterations:I,autoplayIntervalSec:v}},[t,r,s,l,d,g,m,v]),N=T.useCallback(I=>{I.selectedStepIndex!==void 0&&n(I.selectedStepIndex),I.edgeValuesAnimated!==void 0&&i(I.edgeValuesAnimated),I.panelOpen!==void 0&&a(I.panelOpen),I.autoScroll!==void 0&&u(I.autoScroll),I.timeMode!==void 0&&f(I.timeMode),I.timelineCollapsed!==void 0&&h(I.timelineCollapsed),I.selectedIterations&&x(new Map(Object.entries(I.selectedIterations).map(([k,A])=>[k,A]))),I.autoplayIntervalSec!==void 0&&b(I.autoplayIntervalSec)},[]),w=T.useMemo(()=>({selectedStepIndex:t,setSelectedStepIndex:n,edgeValuesAnimated:r,setEdgeValuesAnimated:i,isRunnerPanelOpen:s,setIsRunnerPanelOpen:a,autoScroll:l,setAutoScroll:u,timeMode:d,setTimeMode:f,timelineCollapsed:g,setTimelineCollapsed:h,selectedIterations:m,setSelectedIterations:x,autoplayIntervalSec:v,setAutoplayIntervalSec:b,getViewState:S,restoreViewState:N}),[t,r,s,l,d,g,m,v,S,N]);return y.jsx(bb.Provider,{value:w,children:e})}function Uf(){const e=T.useContext(bb);if(!e)throw new Error("useRecordingViewState must be used within a RecordingViewStateProvider");return e}const Is=.5,Wf=1e4,eD=.003,Sb=3;function tD({adjustedTotalDuration:e,timePadRightMs:t,gutterWidth:n}){const r=T.useRef(null),i=T.useRef(!1),s=T.useRef(0),a=T.useRef(0),[l,u]=T.useState(0),d=T.useRef(null),f=T.useRef(null),g=r.current;if(g!==f.current&&(d.current&&(d.current.disconnect(),d.current=null),f.current=g,g)){u(g.clientWidth);const P=new ResizeObserver(L=>{const j=L[0];j&&u(j.contentRect.width)});P.observe(g),d.current=P}T.useEffect(()=>()=>{d.current?.disconnect()},[]);const[h,m]=T.useState(!0),[x,v]=T.useState(Is),b=T.useMemo(()=>{const P=l-n;return P<=0||e<=0?Is:Math.max(Is,Math.min(Wf,P/(e*(1+t))))},[l,n,e,t]),S=h?b:x,N=T.useRef(b);T.useLayoutEffect(()=>{if(!h||N.current===b)return;N.current=b;const P=r.current;P&&(P.scrollLeft=0)},[h,b]);const w=T.useRef(null);T.useLayoutEffect(()=>{w.current!==null&&r.current&&(r.current.scrollLeft=w.current,w.current=null)});const I=T.useCallback(()=>{m(!0);const P=r.current;P&&(P.scrollLeft=0)},[]),k=T.useCallback(P=>{const L=r.current;if(!L)return;const j=L.scrollLeft+(L.clientWidth-n)/2,O=h?b:x,W=j/O,z=Math.max(Is,Math.min(Wf,O*P));w.current=W*z-(L.clientWidth-n)/2,m(!1),v(z)},[n,h,b,x]),A=T.useRef(S);A.current=S;const M=T.useRef(n);M.current=n;const B=T.useRef(h);B.current=h;const U=T.useRef(null);U.current||(U.current=P=>{if(!P.shiftKey)return;P.preventDefault();const L=r.current;if(!L)return;const j=M.current,O=L.getBoundingClientRect(),W=P.clientX-O.left+L.scrollLeft-j,z=A.current,Y=W/z,J=-P.deltaY*eD,ie=Math.pow(2,J),ee=Math.max(Is,Math.min(Wf,z*ie));w.current=Y*ee-(P.clientX-O.left-j),m(!1),v(ee)});const q=T.useRef(null);T.useEffect(()=>{const P=r.current,L=U.current;if(P!==q.current)return q.current&&q.current.removeEventListener("wheel",L),q.current=P,P&&P.addEventListener("wheel",L,{passive:!1}),()=>{q.current&&(q.current.removeEventListener("wheel",L),q.current=null)}});const D=T.useRef(0),$=T.useRef(0),F=T.useRef(!1),E=T.useCallback(P=>{if(P.button!==0&&P.button!==1)return;const L=r.current;if(!L)return;P.preventDefault(),i.current=!0,F.current=!1,s.current=P.clientX,D.current=P.clientY,a.current=L.scrollLeft,$.current=L.scrollTop,L.style.cursor="grabbing",document.body.style.userSelect="none";const j=W=>{if(!i.current)return;W.preventDefault();const z=W.clientX-s.current,Y=W.clientY-D.current;(Math.abs(z)>Sb||Math.abs(Y)>Sb)&&(F.current=!0),L.scrollLeft=a.current-z,L.scrollTop=$.current-Y},O=()=>{i.current=!1,L.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",O),document.removeEventListener("mouseleave",O),requestAnimationFrame(()=>{F.current=!1})};document.addEventListener("mousemove",j),document.addEventListener("mouseup",O),document.addEventListener("mouseleave",O)},[]);return{timeScale:S,scrollContainerRef:r,fitToView:I,zoomBy:k,handlePanStart:E,didPanMoveRef:F}}const nD=6;function _b(e,t){const n=e.startTime*t,r=Math.max(e.duration*t,nD);return n+r/2}function Nb(e,t,n){if(t.length===0)return null;let r=t[0].stepIndex,i=1/0;for(const s of t){const a=_b(s,n),l=Math.abs(a-e);l<i&&(i=l,r=s.stepIndex)}return r}function rD({steps:e,timeScale:t,contentWidth:n,currentStepIndex:r,scrollContainerRef:i,gutterWidth:s,onScrubTo:a}){const[l,u]=T.useState(null),[d,f]=T.useState(null),g=T.useRef(null),h=l!==null,m=T.useRef(!1),x=T.useRef(r);x.current!==r&&!h&&(m.current=!0),x.current=r;const v=e[r],b=v?_b(v,t):0,S=l??b,N=T.useCallback(A=>{const M=i.current;if(!M||e.length===0)return;const B=M.getBoundingClientRect(),U=A-B.left+M.scrollLeft-s,q=Math.max(0,Math.min(U,n));u(q);const D=Nb(q,e,t);g.current=D,f(D),D!==null&&a(D);const $=E=>{const P=M.getBoundingClientRect(),L=E.clientX-P.left+M.scrollLeft-s,j=Math.max(0,Math.min(L,n));u(j);const O=Nb(j,e,t);O!==g.current&&O!==null&&a(O),g.current=O,f(O)},F=()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",F),g.current!==null&&a(g.current),g.current=null,u(null),f(null),m.current=!0,setTimeout(()=>{m.current=!1},200)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",F)},[e,t,n,s,i,a]),w=T.useCallback(A=>{A.stopPropagation(),N(A.clientX)},[N]),I=T.useCallback(A=>{A.stopPropagation(),A.preventDefault(),N(A.clientX)},[N]),k=T.useCallback(()=>{m.current=!1},[]);return{scrubberPx:S,isDraggingScrubber:h,nearestDragStepIndex:d,isSnapping:m.current,startScrubDrag:N,handleRulerScrubDown:w,handleScrubberMouseDown:I,onSnapTransitionEnd:k}}const Es=28,Ts=3,Yc=4,oD=32,Gf=6,Ib=0,Eb=.15,Tb=48,Cb=50,Ab=18,iD=[{value:"execution",label:"Execution"},{value:"wallClock",label:"Wall Clock"}],sD={completed:"bg-runner-bar-completed",errored:"bg-runner-bar-errored",skipped:"bg-status-skipped"},aD={completed:"text-status-completed",errored:"text-status-errored",skipped:"text-secondary-light-gray"},cD={completed:"Done",errored:"Error",skipped:"Skipped"};function kb(e){const t=Math.pow(10,Math.floor(Math.log10(e))),n=e/t;return n<=1?t:n<=2?2*t:n<=5?5*t:10*t}function Mb(e){return e===0||e<0?"0":e<1?`${(e*1e3).toFixed(0)}µs`:e<1e3?`${e.toFixed(e<10?1:0)}ms`:`${(e/1e3).toFixed(2)}s`}function lD(e){return e.estimatedTiming?"< 0.1ms":`${e.duration.toFixed(2)}ms`}function uD(e){const t=new Map;for(const n of e){const r=t.get(n.concurrencyLevel);r?r.push(n):t.set(n.concurrencyLevel,[n])}return t}const Ob={loopStart:0,preStop:1,loopStop:2,postStop:3,loopEnd:4};function dD(e,t){const n=e.loopPhase?Ob[e.loopPhase]:1,r=t.loopPhase?Ob[t.loopPhase]:1;return n!==r?n-r:e.startTime-t.startTime}function Pb(e,t,n){const r=t.iterations.map(i=>{const s=i.stepRecords;if(s.length===0)return{...i,adjustedStartTime:i.startTime,adjustedEndTime:i.endTime,adjustedDuration:i.duration};let a=1/0,l=-1/0;for(const u of s){const d=n?u.startTime-u.pauseAdjustment:u.startTime,f=n?u.endTime-u.pauseAdjustment:u.endTime;d<a&&(a=d),f>l&&(l=f)}return{...i,adjustedStartTime:a,adjustedEndTime:l,adjustedDuration:l-a}});return{kind:"loop",loopStructureId:e,loopRecord:t,adjustedIterations:r,iterations:t.iterations.map(i=>({iteration:i.iteration,conditionValue:i.conditionValue,steps:[...i.stepRecords].sort(dD).map(s=>({...s,startTime:n?s.startTime-s.pauseAdjustment:s.startTime,endTime:n?s.endTime-s.pauseAdjustment:s.endTime,loopStructureId:void 0,loopIteration:void 0})),nestedLoopRecords:i.nestedLoopRecords}))}}function Rb(e,t,n){const r=[];let i=[];const s=new Map;for(const a of e)if(a.loopStructureId!==void 0&&a.loopIteration!==void 0){const u=a.loopStructureId,d=t.get(u);if(!d)continue;if(!s.has(u)&&i.length>0&&(r.push({kind:"flat",steps:i}),i=[]),!s.has(u)){const f=Pb(u,d,n);s.set(u,f),r.push(f)}}else{if(a.loopStructureId!==void 0&&!t.has(a.loopStructureId))continue;i.push(a)}i.length>0&&r.push({kind:"flat",steps:i});for(const[a,l]of t){if(s.has(a))continue;const u=Pb(a,l,n),d=l.iterations[0]?.startTime??0;let f=r.length;for(let g=r.length-1;g>=0;g--){const h=r[g];if((h.kind==="flat"?h.steps[0]?.startTime??0:h.loopRecord.iterations[0]?.startTime??0)<=d){if(h.kind==="flat"){const x=h.steps.filter(b=>b.startTime<=d),v=h.steps.filter(b=>b.startTime>d);if(x.length>0&&v.length>0){r.splice(g,1,{kind:"flat",steps:x},u,{kind:"flat",steps:v}),f=-1;break}}f=g+1;break}}f>=0&&r.splice(f,0,u)}return r}function fD({step:e}){return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-[12px] font-semibold text-primary-white",children:e.nodeTypeName}),y.jsx("span",{className:ye("text-[10px] font-medium",aD[e.status]),children:cD[e.status]})]}),y.jsxs("div",{className:"mt-1 flex items-center gap-2 text-[10px] text-secondary-light-gray",children:[y.jsx("span",{className:"font-mono tabular-nums",children:lD(e)}),y.jsx("span",{className:"text-secondary-dark-gray",children:"·"}),y.jsxs("span",{children:["Step ",e.stepIndex]}),e.loopIteration!==void 0&&y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"text-secondary-dark-gray",children:"·"}),y.jsxs("span",{children:["Iter ",e.loopIteration]})]})]})]})}function pD({step:e,timeScale:t,timeOffset:n=0,isSelected:r,isSnapped:i,isNearestDragTarget:s,onClick:a,onScrubTo:l,subRowTop:u,subRowHeight:d}){const f=(e.startTime-n)*t,g=Math.max(e.duration*t,Gf),h=g>Cb&&d>=Ab;return y.jsx(sn,{as:"div",placement:"top",content:y.jsx(fD,{step:e}),className:ye("timeline-block absolute cursor-pointer rounded-[2px]",sD[e.status],r&&"z-10 ring-1 ring-white ring-offset-0",!r&&i&&!s&&"z-10 ring-2 ring-primary-blue ring-offset-0 shadow-[0_0_12px_rgba(71,114,179,0.4)]",!r&&s&&"z-10 ring-1 ring-white/70 ring-offset-0 brightness-125 shadow-[0_0_20px_rgba(71,114,179,0.7)]"),style:{left:`${f}px`,width:`${g}px`,top:`${u}px`,height:`${d}px`},triggerProps:{"data-step-index":e.stepIndex,onClick:m=>{m.stopPropagation(),a()},onContextMenu:m=>{m.preventDefault(),m.stopPropagation(),l()}},children:h&&y.jsx("span",{className:"block truncate px-2 text-[12px] font-normal text-[#eee] drop-shadow-sm select-none",style:{lineHeight:`${d}px`},children:e.nodeTypeName})})}function hD({steps:e,timeScale:t,timeOffset:n=0,contentWidth:r,selectedStepIndex:i,currentStepIndex:s,nearestDragStepIndex:a,onStepClick:l,onScrubTo:u}){const d=e.length,f=d>1?(d-1)*Yc:0,g=d>1?Es+(d-1)*(Es-Ts*2)+f:Es,h=g-Ts*2-f,m=d>0?h/d:h;return y.jsx("div",{className:"relative",style:{height:`${g}px`,width:`${r}px`,marginBottom:`${Yc}px`},children:e.map((x,v)=>y.jsx(pD,{step:x,timeScale:t,timeOffset:n,isSelected:i===x.stepIndex,isSnapped:s===x.stepIndex,isNearestDragTarget:a===x.stepIndex,onClick:()=>l(x),onScrubTo:()=>u(x.stepIndex),subRowTop:Ts+v*(m+Yc),subRowHeight:m},`${x.nodeId}-${x.stepIndex}`))})}function Lb({steps:e,timeScale:t,contentWidth:n,selectedStepIndex:r,currentStepIndex:i,nearestDragStepIndex:s,onStepClick:a,onScrubTo:l}){const u=T.useMemo(()=>uD(e),[e]),d=T.useMemo(()=>Array.from(u.keys()).sort((f,g)=>f-g),[u]);return e.length===0?null:y.jsx(y.Fragment,{children:d.map(f=>{const g=u.get(f);return g?y.jsx(hD,{steps:g,timeScale:t,contentWidth:n,selectedStepIndex:r,currentStepIndex:i,nearestDragStepIndex:s,onStepClick:a,onScrubTo:l},`flat-${f}`):null})})}function gD({iterRecord:e,iterDisplay:t,loopRecord:n}){const r=e.iteration===n.totalIterations-1&&e.conditionValue===!0;return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("span",{className:"text-[12px] font-semibold text-primary-white",children:["Loop Iteration ",e.iteration]}),r?y.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-status-errored",children:[y.jsx(ng,{className:"h-2.5 w-2.5"})," max exceeded"]}):e.conditionValue?y.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-status-completed",children:[y.jsx(sa,{className:"h-2.5 w-2.5"})," continues"]}):y.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-secondary-light-gray",children:[y.jsx(aa,{className:"h-2.5 w-2.5"})," exits"]})]}),y.jsxs("div",{className:"mt-1 flex items-center gap-2 text-[10px] text-secondary-light-gray",children:[y.jsxs("span",{className:"font-mono tabular-nums",children:[e.duration.toFixed(2),"ms"]}),y.jsx("span",{className:"text-secondary-dark-gray",children:"·"}),y.jsxs("span",{children:[t.steps.length," steps"]})]})]})}function mD({segment:e,timeScale:t,contentWidth:n,selectedIteration:r,onSelectIteration:i,selectedStepIndex:s}){const{loopRecord:a,iterations:l}=e,u=a.iterations.length>0&&a.iterations[a.iterations.length-1].conditionValue===!0;return y.jsx("div",{className:"relative",style:{height:`${Es}px`,width:`${n}px`,marginBottom:`${Yc}px`},children:e.adjustedIterations.map((d,f)=>{const g=l[f];if(!g)return null;const h=d.adjustedStartTime*t,m=Math.max(d.adjustedDuration*t,Gf),x=r===d.iteration,v=u&&f===a.iterations.length-1,b=s!==null&&g.steps.some(w=>w.stepIndex===s),S=Es-Ts*2,N=m>Cb&&S>=Ab;return y.jsx(yD,{iterRecord:d,iterDisplay:g,loopRecord:a,left:h,width:m,blockHeight:S,showLabel:N,isSelected:x,isLastAndError:v,hasSelectedStep:b,onSelect:()=>i(d.iteration)},d.iteration)})})}function yD({iterRecord:e,iterDisplay:t,loopRecord:n,left:r,width:i,blockHeight:s,showLabel:a,isSelected:l,isLastAndError:u,hasSelectedStep:d,onSelect:f}){return y.jsx(sn,{as:"div",placement:"top",content:y.jsx(gD,{iterRecord:e,iterDisplay:t,loopRecord:n}),className:ye("absolute cursor-pointer rounded-[2px] bg-[#8c52d1]/60",l&&"z-10 ring-1 ring-[#8c52d1] ring-offset-0 bg-[#8c52d1]/80",!l&&d&&"z-10 ring-1 ring-white/50 ring-offset-0",u&&"border border-status-errored/50"),style:{left:`${r}px`,width:`${i}px`,top:`${Ts}px`,height:`${s}px`},triggerProps:{onClick:g=>{g.stopPropagation(),f()}},children:a?y.jsxs("span",{className:"flex items-center gap-1 truncate px-2 text-[11px] font-normal text-[#eee] drop-shadow-sm select-none",style:{lineHeight:`${s}px`},children:[y.jsx(Qh,{className:"h-2.5 w-2.5 flex-shrink-0"}),"Iter ",e.iteration]}):y.jsx("span",{className:"flex items-center justify-center text-[9px] font-medium text-[#eee] select-none w-full",style:{lineHeight:`${s}px`},children:e.iteration})})}function vD({iteration:e,nestedLoopRecords:t,adjustForPause:n,selectedIterations:r,onSelectIteration:i,timeScale:s,contentWidth:a,selectedStepIndex:l,currentStepIndex:u,nearestDragStepIndex:d,onStepClick:f,onScrubTo:g}){const{steps:h}=e,m=T.useMemo(()=>Rb(h,t,n),[h,t,n]);return m.length===0?y.jsx("div",{className:"py-2 text-center text-[10px] text-secondary-light-gray",children:"No steps in this iteration"}):y.jsx("div",{className:"relative pb-1",style:{minHeight:"40px"},children:y.jsx("div",{className:"relative",style:{width:`${a}px`},children:m.map((x,v)=>{if(x.kind==="flat")return y.jsx(Lb,{steps:x.steps,timeScale:s,contentWidth:a,selectedStepIndex:l,currentStepIndex:u,nearestDragStepIndex:d,onStepClick:f,onScrubTo:g},`iter-${e.iteration}-flat-${v}`);const b=x.loopStructureId,S=r.get(b)??null;return y.jsx(Db,{segment:x,timeScale:s,contentWidth:a,selectedIteration:S,onSelectIteration:N=>{const w=r.get(b);i(b,w===N?null:N)},selectedStepIndex:l,currentStepIndex:u,nearestDragStepIndex:d,onStepClick:f,onScrubTo:g,adjustForPause:n,selectedIterations:r,onNestedSelectIteration:i},`iter-${e.iteration}-loop-${b}`)})})})}function Db({segment:e,timeScale:t,contentWidth:n,selectedIteration:r,onSelectIteration:i,selectedStepIndex:s,currentStepIndex:a,nearestDragStepIndex:l,onStepClick:u,onScrubTo:d,adjustForPause:f,selectedIterations:g,onNestedSelectIteration:h}){const{iterations:m}=e,x=r!==null?m[r]??null:null;return y.jsxs("div",{children:[y.jsx(mD,{segment:e,timeScale:t,contentWidth:n,selectedIteration:r,onSelectIteration:i,selectedStepIndex:s}),x&&y.jsxs("div",{className:"mb-1",children:[y.jsxs("div",{className:"sticky left-0 z-[5] ml-4 flex w-fit items-center gap-2 rounded-t-[3px] border border-b-0 border-[#8c52d1]/30 bg-runner-timeline-box-bg px-2 py-1 text-[10px]",children:[y.jsx(Qh,{className:"h-2.5 w-2.5 text-[#8c52d1]"}),y.jsxs("span",{className:"font-medium text-primary-white",children:["Iteration ",x.iteration]}),y.jsxs("span",{className:"text-secondary-light-gray",children:[x.steps.length," step",x.steps.length!==1?"s":""]}),x.conditionValue?y.jsxs("span",{className:"flex items-center gap-0.5 text-status-completed/70",children:[y.jsx(sa,{className:"h-2.5 w-2.5"})," continues"]}):y.jsxs("span",{className:"flex items-center gap-0.5 text-secondary-light-gray",children:[y.jsx(aa,{className:"h-2.5 w-2.5"})," exits"]})]}),y.jsx("div",{className:"-mt-px rounded-[3px] border border-[#8c52d1]/30 bg-runner-timeline-box-bg/50",children:y.jsx(vD,{iteration:x,nestedLoopRecords:x.nestedLoopRecords,adjustForPause:f,selectedIterations:g,onSelectIteration:h,timeScale:t,contentWidth:n,selectedStepIndex:s,currentStepIndex:a,nearestDragStepIndex:l,onStepClick:u,onScrubTo:d})})]})]})}function xD({timeScale:e,contentWidth:t,totalDuration:n,onScrubDown:r}){const i=Tb/e,s=kb(i),a=[];for(let l=0;l<=n+s;l+=s)a.push(l);return y.jsx("div",{className:"relative border-b border-[#3a3a3a] bg-runner-ruler-bg",style:{height:`${oD}px`,width:`${t}px`},children:y.jsx("div",{className:"relative h-full cursor-ew-resize select-none",onMouseDown:r,children:a.map(l=>{const u=l*e;return u>t?null:y.jsxs("div",{className:"absolute bottom-1 -translate-x-1/2",style:{left:`${u}px`},children:[y.jsx("span",{className:"font-mono text-[11px] tabular-nums text-[#9a9a9a] select-none whitespace-nowrap",children:Mb(l)}),y.jsx("div",{className:"absolute -bottom-1 left-1/2 h-1 w-px bg-[#555]"})]},l)})})})}function wD({timeScale:e,contentWidth:t,totalDuration:n}){const r=Tb/e,i=kb(r),s=[];for(let a=0;a<=n+i;a+=i){const l=a*e;l<=t&&s.push(l)}return y.jsx("div",{className:"pointer-events-none absolute inset-0",children:s.map(a=>y.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-runner-grid-line",style:{left:`${a}px`}},a))})}function bD({timeMs:e,isDragging:t}){return y.jsxs("div",{className:"flex flex-col items-center",children:[y.jsx("div",{className:ye("rounded px-1.5 py-0.5 font-mono text-[11px] text-white whitespace-nowrap",t?"bg-[#6a9be0]":"bg-runner-scrubber-blue"),children:Mb(e)}),y.jsx("div",{className:"h-0 w-0 border-l-[4px] border-r-[4px] border-t-[4px] border-l-transparent border-r-transparent border-t-runner-scrubber-blue"})]})}function jb({record:e,currentStepIndex:t,onScrubTo:n,onStepClick:r,selectedStepIndex:i,onNavigateToNode:s}){const{autoScroll:a,setAutoScroll:l,timeMode:u,setTimeMode:d,timelineCollapsed:f,setTimelineCollapsed:g,selectedIterations:h,setSelectedIterations:m,autoplayIntervalSec:x,setAutoplayIntervalSec:v}=Uf(),b=(e?.totalPauseDuration??0)>0,S=T.useMemo(()=>e?u==="wallClock"?e.steps:e.steps.map(ae=>({...ae,startTime:ae.startTime-ae.pauseAdjustment,endTime:ae.endTime-ae.pauseAdjustment})):[],[e,u]),N=e?u==="execution"?e.totalDuration-e.totalPauseDuration:e.totalDuration:0,w=T.useMemo(()=>e?Rb(S,e.loopRecords,u==="execution"):[],[S,e,u]),I=T.useRef(!1);T.useEffect(()=>{if(I.current||w.length===0)return;const ae=w.find(Ie=>Ie.kind==="loop");ae&&(I.current=!0,m(new Map([[ae.loopStructureId,0]])))},[w]),T.useEffect(()=>{if(i===null||!e)return;const ae=e.steps.find(Ie=>Ie.stepIndex===i);ae?.loopStructureId!==void 0&&ae.loopIteration!==void 0&&m(Ie=>{const Be=new Map(Ie);return Be.set(ae.loopStructureId,ae.loopIteration),Be})},[i,e]);const{timeScale:k,scrollContainerRef:A,fitToView:M,zoomBy:B,handlePanStart:U,didPanMoveRef:q}=tD({adjustedTotalDuration:N,timePadRightMs:Eb,gutterWidth:Ib}),D=N+N*Eb,$=D*k,{scrubberPx:F,isDraggingScrubber:E,nearestDragStepIndex:P,isSnapping:L,handleRulerScrubDown:j,handleScrubberMouseDown:O,onSnapTransitionEnd:W}=rD({steps:S,timeScale:k,contentWidth:$,currentStepIndex:t,scrollContainerRef:A,gutterWidth:Ib,onScrubTo:n}),z=T.useCallback(ae=>{q.current||r(ae)},[r,q]),Y=k>0?F/k:0,J=T.useRef(null),[ie,ee]=T.useState(!1),ce=T.useRef(null),ge=i??t,Q=e!==null&&ge>0,te=e!==null&&ge<e.steps.length-1,ne=T.useCallback(ae=>{const Ie=A.current;if(!Ie||k<=0)return;const Be=S.find(Nt=>Nt.stepIndex===ae.stepIndex),Ue=(Be?Be.startTime:ae.startTime-ae.pauseAdjustment)*k,Ze=Be?Be.endTime-Be.startTime:ae.duration,pt=Math.max(Ze*k,Gf),Cn=Ue+pt/2,cn=Math.max(0,Cn-Ie.clientWidth/2);setTimeout(()=>{const Nt=A.current;if(!Nt)return;let $t=Nt.scrollTop;const ln=Nt.querySelector(`[data-step-index="${ae.stepIndex}"]`);if(ln){const Or=Nt.getBoundingClientRect(),Un=ln.getBoundingClientRect(),fo=Un.top+Un.height/2,po=Or.top+Or.height/2,Pr=fo-po;Math.abs(Pr)>4&&($t=Nt.scrollTop+Pr)}Nt.scrollTo({left:cn,top:$t,behavior:"smooth"})},50)},[A,k,S]),oe=T.useCallback(ae=>{ae.loopStructureId!==void 0&&ae.loopIteration!==void 0&&m(Ie=>{if(Ie.get(ae.loopStructureId)===ae.loopIteration)return Ie;const Be=new Map(Ie);return Be.set(ae.loopStructureId,ae.loopIteration),Be})},[m]),pe=T.useCallback(()=>{if(!e||ge<=0)return;const ae=e.steps[ge-1];ae&&(oe(ae),r(ae),a&&(s?.(ae.nodeId),ne(ae)))},[e,ge,r,s,ne,a,oe]),le=T.useCallback(()=>{if(!e||ge>=e.steps.length-1)return;const ae=e.steps[ge+1];ae&&(oe(ae),r(ae),a&&(s?.(ae.nodeId),ne(ae)))},[e,ge,r,s,ne,a,oe]),ve=T.useCallback(()=>{if(!e||e.steps.length===0)return;ee(!1);const ae=e.steps[0];oe(ae),r(ae),a&&(s?.(ae.nodeId),ne(ae))},[e,r,s,ne,a,oe]),me=T.useCallback(()=>{if(!e||e.steps.length===0)return;ee(!1);const ae=e.steps[e.steps.length-1];oe(ae),r(ae),a&&(s?.(ae.nodeId),ne(ae))},[e,r,s,ne,a,oe]);T.useEffect(()=>{!ie||!e||ge>=e.steps.length-1&&ee(!1)},[ie,ge,e]),T.useEffect(()=>{if(ie&&e)return ce.current=setInterval(()=>{le()},x*1e3),()=>{ce.current&&clearInterval(ce.current)};ce.current&&(clearInterval(ce.current),ce.current=null)},[ie,x,e,le]);const Oe=T.useCallback(()=>{ee(ae=>!ae)},[]),Ce=T.useRef(t);return T.useEffect(()=>{if(Ce.current===t||(Ce.current=t,!a||!e||i!==null||E))return;const ae=e.steps[t];ae&&(oe(ae),s?.(ae.nodeId),ne(ae))},[t,a,e,i,E,oe,s,ne]),e?y.jsxs("div",{className:"flex h-full flex-col bg-runner-toolbar-bg",children:[y.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs("button",{type:"button",onClick:()=>g(!f),className:"btn-press flex items-center gap-2 rounded px-1.5 py-1 text-[14px] text-primary-white transition-colors hover:bg-primary-dark-gray/50",children:[y.jsx("span",{className:ye("transition-transform duration-150",!f&&"rotate-90"),children:y.jsx(zr,{className:"h-3 w-3 text-secondary-light-gray"})}),"Timeline"]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("div",{className:"flex items-center",children:[y.jsx("button",{type:"button",disabled:!Q,onClick:ve,className:ye("btn-press rounded-l-md border border-secondary-dark-gray/80 px-1 py-0.5 transition-colors",Q?"bg-primary-dark-gray text-primary-white hover:bg-primary-blue/80":"bg-secondary-black text-secondary-dark-gray pointer-events-none"),title:"Go to first step",children:y.jsx(O_,{className:"h-3.5 w-3.5"})}),y.jsx("button",{type:"button",disabled:!Q,onClick:pe,className:ye("btn-press border border-l-0 border-secondary-dark-gray/80 px-1 py-0.5 transition-colors",Q?"bg-primary-dark-gray text-primary-white hover:bg-primary-blue/80":"bg-secondary-black text-secondary-dark-gray pointer-events-none"),title:"Previous step",children:y.jsx(iu,{className:"h-3.5 w-3.5"})}),y.jsx("button",{type:"button",disabled:!e||e.steps.length===0,onClick:Oe,className:ye("btn-press border border-l-0 border-secondary-dark-gray/80 px-1.5 py-0.5 transition-colors",ie?"bg-primary-blue text-white hover:bg-primary-blue/80":e&&e.steps.length>0?"bg-primary-dark-gray text-primary-white hover:bg-primary-blue/80":"bg-secondary-black text-secondary-dark-gray pointer-events-none"),title:ie?"Stop autoplay":"Autoplay",children:ie?y.jsx(tg,{className:"h-3 w-3"}):y.jsx(au,{className:"h-3.5 w-3.5"})}),y.jsx("button",{type:"button",disabled:!te,onClick:le,className:ye("btn-press border border-l-0 border-secondary-dark-gray/80 px-1 py-0.5 transition-colors",te?"bg-primary-dark-gray text-primary-white hover:bg-primary-blue/80":"bg-secondary-black text-secondary-dark-gray pointer-events-none"),title:"Next step",children:y.jsx(zr,{className:"h-3.5 w-3.5"})}),y.jsx("button",{type:"button",disabled:!te,onClick:me,className:ye("btn-press rounded-r-md border border-l-0 border-secondary-dark-gray/80 px-1 py-0.5 transition-colors",te?"bg-primary-dark-gray text-primary-white hover:bg-primary-blue/80":"bg-secondary-black text-secondary-dark-gray pointer-events-none"),title:"Go to last step",children:y.jsx(P_,{className:"h-3.5 w-3.5"})})]}),y.jsx(sn,{content:"Seconds between each step during autoplay. Drag or click to adjust (0.5s–30s).",children:y.jsx(ni,{name:"Interval",value:x,onChange:ae=>v(Math.max(.5,ae)),min:.5,max:30,size:"small"})}),y.jsx(sn,{content:"Automatically scroll the timeline and canvas to follow the selected step",children:y.jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[12px] text-secondary-light-gray select-none",children:[y.jsx("input",{type:"checkbox",checked:a,onChange:ae=>l(ae.target.checked),className:"h-3 w-3 cursor-pointer rounded-sm accent-primary-blue"}),y.jsx("span",{className:"text-primary-white",children:"Auto-scroll"})]})})]})]}),y.jsxs("div",{className:"flex items-center gap-3",children:[b&&y.jsx(sn,{content:y.jsxs("div",{className:"space-y-1.5 text-[12px] leading-relaxed text-primary-white",children:[y.jsxs("div",{children:[y.jsx("span",{className:"font-semibold",children:"Execution"})," — Shows only computation time with pauses removed. Best for step-by-step mode."]}),y.jsxs("div",{children:[y.jsx("span",{className:"font-semibold",children:"Wall Clock"})," — Shows real elapsed time including pauses between steps."]})]}),children:y.jsx(zf,{options:iD,value:u,onChange:d,size:"small"})}),y.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px] text-primary-white",children:[y.jsx(sn,{content:"Total execution duration",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(F_,{className:"h-3.5 w-3.5"}),y.jsxs("span",{className:"tabular-nums",children:[N.toFixed(2),"ms"]})]})}),y.jsx("span",{children:"·"}),y.jsx(sn,{content:"Total number of executed steps",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(D_,{className:"h-3.5 w-3.5"}),y.jsxs("span",{children:[e.steps.length," steps"]})]})}),e.compilationDuration>0&&y.jsxs(y.Fragment,{children:[y.jsx("span",{children:"·"}),y.jsx(sn,{content:"JIT warmup time — absorbed before execution to ensure accurate step timings",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(z_,{className:"h-3.5 w-3.5"}),y.jsxs("span",{children:["JIT ",e.compilationDuration.toFixed(1),"ms"]})]})})]})]}),y.jsx("button",{type:"button",onClick:()=>B(1.5),className:"btn-press text-primary-white transition-colors hover:text-primary-blue",title:"Zoom In",children:y.jsx(U_,{className:"h-4 w-4"})}),y.jsx("button",{type:"button",onClick:()=>B(1/1.5),className:"btn-press text-primary-white transition-colors hover:text-primary-blue",title:"Zoom Out",children:y.jsx(W_,{className:"h-4 w-4"})}),y.jsx("button",{type:"button",onClick:M,className:"btn-press text-primary-white transition-colors hover:text-primary-blue",title:"Fit to View",children:y.jsx(j_,{className:"h-4 w-4"})})]})]}),!f&&y.jsx("div",{className:"min-h-0 flex-1 px-4 pb-4",children:y.jsx("div",{className:"flex h-full flex-col overflow-hidden rounded-md border border-runner-timeline-box-border bg-runner-timeline-box-bg",children:y.jsx("div",{ref:A,className:"timeline-scrollbar min-h-0 flex-1 overflow-x-auto overflow-y-auto",onMouseDown:U,children:y.jsxs("div",{className:"relative flex min-h-full flex-col",style:{minWidth:`${$}px`},children:[y.jsxs("div",{className:"sticky top-0 z-20",children:[y.jsx(xD,{timeScale:k,contentWidth:$,totalDuration:D,onScrubDown:j}),y.jsx("div",{className:"pointer-events-none absolute inset-y-0",style:{left:`${F}px`,transition:L?"left 150ms ease-out":"none"},children:y.jsx("div",{className:"pointer-events-auto absolute left-1/2 -translate-x-1/2 cursor-ew-resize",style:{top:"2px"},onMouseDown:O,children:y.jsx(bD,{timeMs:Y,isDragging:E})})})]}),y.jsxs("div",{ref:J,className:"relative",style:{minHeight:"120px"},children:[y.jsx(wD,{timeScale:k,contentWidth:$,totalDuration:D}),y.jsx("div",{className:"pt-3",children:w.map((ae,Ie)=>{if(ae.kind==="flat")return y.jsx(Lb,{steps:ae.steps,timeScale:k,contentWidth:$,selectedStepIndex:i,currentStepIndex:t,nearestDragStepIndex:P,onStepClick:z,onScrubTo:n},`flat-${Ie}`);const Be=ae.loopStructureId,Qe=h.get(Be)??null;return y.jsx(Db,{segment:ae,timeScale:k,contentWidth:$,selectedIteration:Qe,onSelectIteration:Ue=>{m(Ze=>{const pt=new Map(Ze);return Ze.get(Be)===Ue?pt.delete(Be):pt.set(Be,Ue),pt})},selectedStepIndex:i,currentStepIndex:t,nearestDragStepIndex:P,onStepClick:z,onScrubTo:n,adjustForPause:u==="execution",selectedIterations:h,onNestedSelectIteration:(Ue,Ze)=>{m(pt=>{const Cn=new Map(pt);return Ze===null?Cn.delete(Ue):Cn.set(Ue,Ze),Cn})}},`loop-${Be}`)})})]}),y.jsxs("div",{className:"pointer-events-none absolute inset-y-0 z-[15]",style:{left:`${F}px`,transition:L?"left 150ms ease-out":"none"},onTransitionEnd:W,children:[y.jsx("div",{className:"pointer-events-auto absolute left-1/2 top-0 bottom-0 w-0.5 -translate-x-1/2 cursor-ew-resize",onMouseDown:O}),y.jsx("div",{className:"pointer-events-none absolute left-1/2 top-0 bottom-0 w-px -translate-x-1/2",style:{backgroundColor:E?"rgba(74, 133, 255, 0.7)":"rgba(74, 133, 255, 0.5)"}})]})]})})})})]}):y.jsxs("div",{className:"flex h-full flex-col bg-runner-toolbar-bg",children:[y.jsx("div",{className:"flex h-12 items-center justify-between bg-runner-toolbar-bg px-4",children:y.jsxs("div",{className:"flex items-center gap-2 text-[14px] text-primary-white",children:[y.jsx(zr,{className:"h-3 w-3 text-secondary-light-gray"}),"Timeline"]})}),y.jsx("div",{className:"flex-1 p-4 pt-0",children:y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 rounded-md border border-runner-timeline-box-border bg-runner-timeline-box-bg",children:[y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx("div",{className:"h-1.5 w-6 rounded-full bg-secondary-dark-gray"}),y.jsx("div",{className:"h-1.5 w-10 rounded-full bg-secondary-dark-gray"}),y.jsx("div",{className:"h-1.5 w-4 rounded-full bg-secondary-dark-gray"})]}),y.jsx("span",{className:"text-[11px] text-secondary-light-gray",children:"No execution record to display"})]})})]})}function SD(e){return e===void 0?"undefined":e===null?"null":typeof e=="boolean"?"boolean":typeof e=="number"?"number":typeof e=="string"?"string":e instanceof Map?`Map(${e.size})`:Array.isArray(e)?`Array(${e.length})`:typeof e=="function"?"function":`Object(${Object.keys(e).length})`}function _D(e){if(e==null)return!1;const t=typeof e;return t==="object"||t==="function"}function Cs(e,t){if(t&&_D(e))return SD(e);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return`"${e}"`;if(e instanceof Map)return`Map { ${Array.from(e.entries()).map(([r,i])=>`${String(r)}: ${Cs(i,t)}`).join(", ")} }`;if(Array.isArray(e))return`[${e.map(n=>Cs(n,t)).join(", ")}]`;try{return JSON.stringify(e,null,2)}catch{return String(e)}}const ND={completed:{bg:"bg-runner-bar-completed",text:"text-[#e0f0e0]",label:"Completed"},errored:{bg:"bg-runner-bar-errored",text:"text-[#f0e0e0]",label:"Error"},skipped:{bg:"bg-[#888888]/30",text:"text-[#888888]",label:"Skipped"}};function ID({status:e}){const t=ND[e];return y.jsx("span",{className:ye("rounded-full px-3 py-1 text-[13px] font-medium",t.bg,t.text),children:t.label})}function ED({conn:e,hideComplex:t,debugMode:n}){return y.jsxs("div",{className:"flex flex-col gap-1.5",children:[y.jsxs("div",{className:"text-[13px]",children:[y.jsx("span",{className:"text-[#9a9a9a]",children:"Coming From–"})," ",y.jsxs("span",{className:"text-primary-white/80",children:[e.sourceNodeName," / ",e.sourceHandleName]})]}),n&&y.jsxs("div",{className:"text-[9px] text-secondary-dark-gray",children:["nodeId: ",e.sourceNodeId," · handleId: ",e.sourceHandleId]}),y.jsx("div",{className:"rounded-md border border-runner-value-border bg-runner-value-bg px-3 py-2 font-mono text-[14px] text-primary-white",children:Cs(e.value,t)})]})}function TD({handleName:e,handleValue:t,hideComplex:n,debugMode:r}){return y.jsxs("div",{className:"flex flex-col gap-1.5",children:[y.jsxs("div",{className:"text-[14px] text-primary-white",children:[e," ",y.jsxs("span",{className:"text-secondary-light-gray",children:["(",t.dataTypeId,")"]})]}),t.connections.length>0?t.connections.map((i,s)=>y.jsx(ED,{conn:i,hideComplex:n,debugMode:r},`${i.sourceNodeId}-${i.sourceHandleId}-${s}`)):t.isDefault?y.jsx("div",{className:"rounded-md border border-runner-value-border bg-runner-value-bg px-3 py-2 font-mono text-[14px] text-primary-white",children:Cs(t.defaultValue,n)}):y.jsx("span",{className:"text-[13px] italic text-secondary-light-gray",children:"No value"})]})}function CD({handleName:e,handleValue:t,hideComplex:n}){return y.jsxs("div",{className:"flex flex-col gap-1.5",children:[y.jsxs("div",{className:"text-[14px] text-primary-white",children:[e," ",y.jsxs("span",{className:"text-secondary-light-gray",children:["(",t.dataTypeId,")"]})]}),y.jsx("div",{className:"rounded-md border border-runner-value-border bg-runner-value-bg px-3 py-2 font-mono text-[14px] text-primary-white",children:Cs(t.value,n)})]})}function $b({stepRecord:e,onClose:t,loopRecords:n,hideComplexValues:r=!1,debugMode:i=!1,edgeValuesAnimated:s,onEdgeValuesAnimatedChange:a}){if(!e)return null;const l=Array.from(e.inputValues.entries()),u=Array.from(e.outputValues.entries());return y.jsxs("div",{className:"flex w-[340px] animate-slide-in-right flex-col bg-runner-panel-bg",children:[y.jsxs("div",{className:"flex items-center justify-between border-b border-secondary-dark-gray px-4 py-3",children:[y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx($_,{className:"h-5 w-5 text-primary-white"}),y.jsx("span",{className:"text-[15px] tracking-wide text-primary-white",children:e.nodeTypeName})]}),y.jsxs("div",{className:"flex items-center gap-3",children:[a&&y.jsx(sn,{content:"Animate edge value badges along the connection path instead of showing them statically",children:y.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[12px] text-secondary-light-gray select-none",children:[y.jsx("input",{type:"checkbox",checked:s??!0,onChange:d=>a(d.target.checked),className:"h-3 w-3 accent-primary-blue"}),y.jsx("span",{className:"text-primary-white",children:"Animate"})]})}),y.jsx("button",{type:"button",onClick:t,className:"btn-press rounded p-1 text-secondary-light-gray transition-colors hover:text-primary-white","aria-label":"Close",children:y.jsx(aa,{className:"h-3.5 w-3.5"})})]})]}),y.jsxs("div",{className:"flex flex-col gap-3 border-b border-secondary-dark-gray px-4 py-3.5",children:[y.jsxs("div",{className:"flex items-center justify-between rounded-md border border-runner-value-border px-3 py-2",children:[y.jsx(ID,{status:e.status}),y.jsx("span",{className:"font-mono text-[13px] text-secondary-light-gray",children:e.estimatedTiming?"< 0.1ms":`${e.duration.toFixed(2)}ms`})]}),y.jsxs("div",{className:"rounded-md border border-runner-value-border bg-runner-timeline-box-bg px-3 py-2.5",children:[y.jsxs("div",{className:"text-center text-[13px] text-secondary-light-gray",children:[e.startTime.toFixed(2),"ms"," ",y.jsx("span",{className:"text-secondary-dark-gray",children:"→"})," ",e.endTime.toFixed(2),"ms"]}),y.jsxs("div",{className:"relative mt-2 h-1.5 w-full overflow-hidden rounded-full bg-[#333]",children:[y.jsx("div",{className:"absolute h-full rounded-full bg-secondary-light-gray/50",style:{left:"20%",width:"55%"}}),y.jsx("div",{className:"absolute h-full w-0.5 bg-secondary-light-gray",style:{left:"77%"}})]})]}),(e.loopIteration!==void 0||e.groupNodeId)&&y.jsxs("div",{className:"flex flex-col gap-2",children:[e.loopIteration!==void 0&&(()=>{const d=e.loopStructureId&&n?n.get(e.loopStructureId):void 0,f=d?.iterations[e.loopIteration];return y.jsxs("div",{className:"rounded-md border border-runner-value-border px-3 py-2",children:[y.jsxs("div",{className:"text-[12px] text-primary-white",children:["Loop iteration ",e.loopIteration+1,d?` of ${d.totalIterations}`:""]}),f&&y.jsxs("div",{className:"mt-1 text-[10px] text-secondary-light-gray",children:["Condition:"," ",f.conditionValue?"true (continues)":"false (exits)"]})]})})(),e.groupNodeId&&y.jsxs("div",{className:"text-[11px] text-secondary-light-gray",children:["Group: ",e.groupNodeId,e.groupDepth!==void 0&&` (depth ${e.groupDepth})`]})]}),i&&y.jsxs("div",{className:"text-[9px] text-secondary-dark-gray",children:["nodeId: ",e.nodeId," · typeId: ",e.nodeTypeId]})]}),y.jsxs(Fy,{type:"multiple",defaultValue:["inputs","outputs"],className:"w-full",children:[y.jsxs(nd,{value:"inputs",className:"border-b border-secondary-dark-gray",children:[y.jsx(rd,{className:"gap-1.5 border-b border-secondary-dark-gray bg-runner-section-header-bg px-4 py-2.5 text-[14px] text-primary-white hover:no-underline [&>svg]:text-secondary-light-gray",children:"Inputs"}),y.jsx(od,{className:"p-4",children:y.jsx("div",{className:"flex flex-col gap-4 bg-runner-panel-bg",children:l.length>0?l.map(([d,f],g)=>y.jsxs("div",{children:[g>0&&y.jsx("div",{className:"-mx-4 mb-4 h-px bg-secondary-dark-gray"}),y.jsx(TD,{handleName:d,handleValue:f,hideComplex:r,debugMode:i})]},d)):y.jsx("div",{className:"text-[13px] italic text-secondary-light-gray",children:"No inputs"})})})]}),y.jsxs(nd,{value:"outputs",className:"border-b border-secondary-dark-gray",children:[y.jsx(rd,{className:"gap-1.5 border-b border-secondary-dark-gray bg-runner-section-header-bg px-4 py-2.5 text-[14px] text-primary-white hover:no-underline [&>svg]:text-secondary-light-gray",children:"Outputs"}),y.jsx(od,{className:"p-4",children:y.jsx("div",{className:"flex flex-col gap-4 bg-runner-panel-bg",children:u.length>0?u.map(([d,f],g)=>y.jsxs("div",{children:[g>0&&y.jsx("div",{className:"-mx-4 mb-4 h-px bg-secondary-dark-gray"}),y.jsx(CD,{handleName:d,handleValue:f,hideComplex:r})]},d)):y.jsx("div",{className:"text-[13px] italic text-secondary-light-gray",children:"No outputs"})})})]})]}),e.error&&y.jsx("div",{className:"p-4",children:y.jsxs("div",{className:"rounded-md border border-status-errored/30 bg-status-errored/10 p-2.5",children:[y.jsx("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-status-errored",children:"Error"}),y.jsx("div",{className:"whitespace-pre-wrap font-mono text-[11px] text-status-errored",children:ib(e.error)})]})})]})}const Hb=({fromX:e,fromY:t,toX:n,toY:r,fromPosition:i,toPosition:s})=>{const{fromHandle:a}=V0(),l=of(a?.nodeId||""),u=T.useMemo(()=>!a?.id||!l?.data?void 0:on(a?.id,l?.data)?.value?.handleColor??"#A1A1A1",[a?.id,l?.data]),[d]=bc({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:s});return y.jsx(Jo,{path:d,className:"stroke-7! in-[g.selected]:brightness-150",style:{stroke:u||"#A1A1A1"},focusable:!0})};Hb.displayName="ConfigurableConnection";const AD=150,kD=({isOpen:e,position:t,onClose:n,items:r})=>{const[i,s]=T.useState(!1),a=T.useRef(null);T.useEffect(()=>(a.current&&(clearTimeout(a.current),a.current=null),e?s(!0):i&&(a.current=setTimeout(()=>s(!1),AD)),()=>{a.current&&clearTimeout(a.current)}),[e]);const{refs:l,floatingStyles:u,context:d}=Wc({open:e,onOpenChange:h=>{h||n()},placement:"bottom-start",middleware:[Oi(5),Ri({fallbackPlacements:["top-start"]}),Pi({padding:8})],whileElementsMounted:Mi}),f=eb(d),{getFloatingProps:g}=tb([f]);return T.useEffect(()=>{e&&l.setReference({getBoundingClientRect:()=>({x:t.x,y:t.y,width:1,height:1,top:t.y,right:t.x+1,bottom:t.y+1,left:t.x})})},[e,t,l]),i?y.jsx("div",{ref:l.setFloating,style:{...u,contain:"layout"},className:ye("z-50 transition-opacity ease-out",e?"opacity-100 duration-100":"opacity-0 duration-150"),onClick:h=>h.stopPropagation(),...g(),children:y.jsx(pb,{subItems:r})}):null};function MD({onExportState:e,onImportState:t,onExportRecording:n,onImportRecording:r,closeMenu:i}){return[{id:"import-export",label:"Import/Export",icon:T.createElement(k_,{className:"w-4 h-4"}),separator:!0,subItems:[{id:"export-state",label:"Export State",icon:T.createElement(Zh,{className:"w-4 h-4"}),onClick:()=>{e(),i()}},{id:"import-state",label:"Import State",icon:T.createElement(Kh,{className:"w-4 h-4"}),onClick:()=>{t(),i()}},{id:"export-recording",label:"Export Recording",icon:T.createElement(Zh,{className:"w-4 h-4"}),separator:!0,onClick:()=>{n(),i()}},{id:"import-recording",label:"Import Recording",icon:T.createElement(Kh,{className:"w-4 h-4"}),onClick:()=>{r(),i()}}]}]}const Bb="add-new-node-group"+rn(10),OD=({value:e,setValue:t,nodeGroups:n,handleAddNewGroup:r,enableBackButton:i,handleBack:s,openedNodeGroupStack:a})=>{const l=u=>{if(u===Bb){r?.();return}t(u)};return y.jsxs("div",{className:"absolute top-0 left-0 scale-75 origin-top-left flex items-center gap-3 m-2 max-w-full",children:[y.jsx(Qn,{className:"h-[44px] border-secondary-dark-gray bg-primary-black shrink-0",disabled:!i,onClick:s,children:y.jsx(M_,{})}),y.jsxs(yb,{value:e,onValueChange:l,children:[y.jsx($f,{className:"hover:bg-primary-dark-gray shrink-0 w-fit",children:y.jsx(Ff,{placeholder:"Node Group"})}),y.jsxs(Vf,{className:"scale-75 origin-top-left",children:[y.jsx(qc,{value:Bb,className:"pl-2",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(Jh,{}),y.jsx("p",{className:"truncate",children:"Add New Node Group"})]})}),n.map(u=>y.jsx(qc,{value:u.id,children:u.name},u.id))]})]}),y.jsx(Rf,{orientation:"horizontal",className:"relative flex-1 min-w-0",scrollAreaClassName:"text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white flex gap-2 items-center overflow-x-scroll no-scrollbar overflow-y-hidden",children:a.map((u,d)=>y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{children:u.name}),d<a.length-1&&y.jsx(zr,{className:"shrink-0"})]},u.id))})]})},PD={configurableNode:rp},RD={configurableEdge:_f};function Vb(e,t,n){if(e.length===0)return[];const r=new Map;for(const l of e){const u=n.get(l);r.set(l,u?u.size:0)}let i=[];for(const l of e)r.get(l)===0&&i.push(l);const s=[];let a=0;for(;i.length>0;){const l=i;s.push(l),a+=l.length;const u=[];for(const d of l){const f=t.get(d);if(f)for(const g of f){if(!r.has(g))continue;const h=(r.get(g)??0)-1;r.set(g,h),h===0&&u.push(g)}}i=u}if(a<e.length){const l=new Set;for(const d of s)for(const f of d)l.add(f);const u=e.filter(d=>!l.has(d));u.length>0&&s.push(u)}return s}const Fb=20;function zb(e){const t=[];if(!e)return t;for(const n of e)if("inputs"in n&&n.inputs)for(const r of n.inputs)r.id&&t.push(r.id);else n.id&&t.push(n.id);return t}function Ub(e){const t=[];if(!e)return t;for(const n of e)n.id&&t.push(n.id);return t}function Wb(e,t,n,r,i,s=0){if(s>=Fb)return{groupScopes:[],groupNodeIds:new Set,warnings:[`Maximum group nesting depth (${Fb}) exceeded. Possible recursive group.`]};const a=[],l=new Set,u=[];for(const d of t){const f=d.data.nodeTypeUniqueId;if(!f)continue;const g=e.typeOfNodes[f];if(!g?.subtree)continue;l.add(d.id);const h=g.subtree;for(const w of h.nodes){const I=w.data.nodeTypeUniqueId;if(!I)continue;const k=e.typeOfNodes[I];if(!ri(I)&&(!kr(n,I)||!n[I])){const A=k?.name??I,M=g.name;u.push(`Node type "${A}" inside group "${M}" has no function implementation.`)}}const m={...e,nodes:h.nodes,edges:h.edges,openedNodeGroupStack:void 0},x=i(m,n,{maxLoopIterations:r},s+1);for(const w of x.warnings)u.push(`[Group "${g.name}"] ${w}`);const v=new Map,b=new Map,S=h.nodes.find(w=>w.data.nodeTypeUniqueId===Te.groupInput),N=h.nodes.find(w=>w.data.nodeTypeUniqueId===Te.groupOutput);if(S){const w=zb(d.data.inputs),I=Ub(S.data.outputs),k=Math.min(w.length,I.length);for(let A=0;A<k;A++)v.set(w[A],I[A])}if(N){const w=zb(N.data.inputs),I=Ub(d.data.outputs),k=Math.min(w.length,I.length);for(let A=0;A<k;A++)b.set(w[A],I[A])}a.push({kind:"group",groupNodeId:d.id,groupNodeTypeId:f,groupNodeTypeName:g.name,innerPlan:x,inputMapping:v,outputMapping:b,concurrencyLevel:0})}return{groupScopes:a,groupNodeIds:l,warnings:u}}function ri(e){return e===Te.loopStart||e===Te.loopStop||e===Te.loopEnd||e===Te.groupInput||e===Te.groupOutput}function Gb(e){return e===Te.groupInput||e===Te.groupOutput}function kr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LD(e,t,n,r,i,s,a=0){const l=t.filter(v=>v.data.nodeTypeUniqueId===Te.loopStart),u=[];for(const v of l){const b=ei(e,v);if(!b)continue;const{loopStart:S,loopStop:N,loopEnd:w}=b,{nodesInRegionStartToStop:I,nodesInRegionStopToEnd:k}=ff(e,b),A=new Set([...I,...k]);u.push({loopStartId:S.id,loopStopId:N.id,loopEndId:w.id,bodyNodeIds:I,postStopBodyNodeIds:k,allBodyNodeIds:A})}const d=new Set;for(const v of u)for(const b of u)v!==b&&b.allBodyNodeIds.has(v.loopStartId)&&d.add(v.loopStartId);const f=new Map;for(const v of u)f.set(v.loopStartId,v);function g(v,b,S,N){const w=new Set(b.map(E=>E.loopStartId)),I=new Map;for(const E of b){const P=E.loopStartId;I.set(E.loopStartId,P),I.set(E.loopStopId,P),I.set(E.loopEndId,P);for(const L of E.allBodyNodeIds)I.set(L,P)}const k=[...Array.from(v).filter(E=>!N.has(E)),...w];if(k.length===0)return[];const A=new Set(k),M=new Map,B=new Map;for(const E of k)M.set(E,new Set),B.set(E,new Set);for(const E of n){if(qf(E,t))continue;let P=E.source,L=E.target;const j=I.get(P);j&&(P=j);const O=I.get(L);O&&(L=O),P!==L&&A.has(P)&&A.has(L)&&(M.get(P)?.add(L),B.get(L)?.add(P))}const U=Vb(k,M,B),q=k.filter(E=>!w.has(E)).map(E=>t.find(P=>P.id===E)).filter(E=>E!=null),{groupScopes:D}=Wb(e,q,i,r,s,a+1),$=new Map(D.map(E=>[E.groupNodeId,E])),F=[];for(let E=0;E<U.length;E++){const P=U[E];for(const L of P){if(w.has(L)){const Y=S.get(L);Y&&F.push({...Y,concurrencyLevel:E});continue}const j=t.find(Y=>Y.id===L);if(!j)continue;const O=j.data.nodeTypeUniqueId;if(!O||Gb(O))continue;const W=$.get(L);if(W){F.push({...W,concurrencyLevel:E});continue}const z=e.typeOfNodes[O];F.push({kind:"standard",nodeId:L,nodeTypeId:O,nodeTypeName:z?.name??O,concurrencyLevel:E})}}return F}function h(v){const{loopStartId:b,loopStopId:S,loopEndId:N,bodyNodeIds:w,postStopBodyNodeIds:I,allBodyNodeIds:k}=v,A=[],M=new Set;for(const F of u)if(F!==v&&k.has(F.loopStartId)){A.push(F),M.add(F.loopStartId),M.add(F.loopStopId),M.add(F.loopEndId);for(const E of F.allBodyNodeIds)M.add(E)}const B=new Map;for(const F of A)B.set(F.loopStartId,h(F));const U=A.filter(F=>w.has(F.loopStartId)),q=A.filter(F=>I.has(F.loopStartId)),D=g(w,U,B,M),$=g(I,q,B,M);return{kind:"loop",loopStartNodeId:b,loopStopNodeId:S,loopEndNodeId:N,preStopSteps:D,postStopSteps:$,maxIterations:r,concurrencyLevel:0}}const m=[],x=new Set;for(const v of u)if(!d.has(v.loopStartId)){m.push(h(v)),x.add(v.loopStartId),x.add(v.loopStopId),x.add(v.loopEndId);for(const b of v.allBodyNodeIds)x.add(b)}return{loopBlocks:m,loopNodeIds:x}}function qf(e,t){if(!e.sourceHandle)return!1;const n=t.find(g=>g.id===e.source);if(!n)return!1;const r=n.data.nodeTypeUniqueId;if(!r||!Tt(r))return!1;const i=e.sourceHandle,s=n.data.outputs;if(!s)return!1;for(const g of s)if("id"in g&&g.id===i&&g.dataType?.dataTypeUniqueId===ze.bindLoopNodes)return!0;const a=t.find(g=>g.id===e.target);if(!a)return!1;const l=a.data.nodeTypeUniqueId;if(!l||!Tt(l))return!1;const u=e.targetHandle;if(!u)return!1;const d=a.data.inputs;if(!d)return!1;const f=d.flatMap(g=>"inputs"in g?g.inputs:[g]);for(const g of f)if("id"in g&&g.id===u&&g.dataType?.dataTypeUniqueId===ze.bindLoopNodes)return!0;return!1}const qb=100;function Yf(e,t,n,r){const i=n?.maxLoopIterations??qb,s=[],{nodes:a,edges:l}=Mt(e);if(a.length===0)return{levels:[],inputResolutionMap:new Map,outputDistributionMap:new Map,nodeCount:0,warnings:[]};const u=new Map,d=new Map;for(const D of l){const $=D.sourceHandle,F=D.targetHandle;if(!$||!F||qf(D,a))continue;const E=`${D.target}:${F}`;let P=u.get(E);P||(P=[],u.set(E,P)),P.push({edgeId:D.id,sourceNodeId:D.source,sourceHandleId:$});const L=`${D.source}:${$}`;let j=d.get(L);j||(j=[],d.set(L,j)),j.push({edgeId:D.id,targetNodeId:D.target,targetHandleId:F})}for(const D of a){const $=D.data.nodeTypeUniqueId;if(!$||Tt($)||ri($))continue;const F=e.typeOfNodes[$];if(!F?.subtree&&(!kr(t,$)||!t[$])){const E=F?.name??$;s.push(`Node type "${E}" (${$}) has no function implementation.`)}}const{loopBlocks:f,loopNodeIds:g}=LD(e,a,l,i,t,Yf,r??0),{groupScopes:h,groupNodeIds:m,warnings:x}=Wb(e,a,t,i,Yf,r??0);for(const D of x)s.push(D);const v=new Map(h.map(D=>[D.groupNodeId,D])),b=new Map(f.map(D=>[D.loopStartNodeId,D])),S=new Set;for(const D of a){const $=D.data.nodeTypeUniqueId;$&&Gb($)&&S.add(D.id)}const N=new Map;for(const D of f){const $=D.loopStartNodeId;N.set(D.loopStartNodeId,$),N.set(D.loopStopNodeId,$),N.set(D.loopEndNodeId,$);for(const F of[...D.preStopSteps,...D.postStopSteps])F.kind==="standard"&&N.set(F.nodeId,$)}const w=new Set(f.map(D=>D.loopStartNodeId)),I=[...a.map(D=>D.id).filter(D=>!g.has(D)&&!S.has(D)),...w],k=new Set(I),A=new Map,M=new Map;for(const D of I)A.set(D,new Set),M.set(D,new Set);for(const D of l){if(!D.sourceHandle||!D.targetHandle||qf(D,a))continue;let $=D.source,F=D.target;const E=N.get($);E&&($=E);const P=N.get(F);P&&(F=P),$!==F&&k.has($)&&k.has(F)&&(A.get($)?.add(F),M.get(F)?.add($))}const B=Vb(I,A,M),U=[];for(let D=0;D<B.length;D++){const $=B[D],F=[];for(const E of $){if(w.has(E)){const W=b.get(E);W&&F.push({...W,concurrencyLevel:D});continue}const P=v.get(E);if(P){F.push({...P,concurrencyLevel:D});continue}const L=a.find(W=>W.id===E);if(!L)continue;const j=L.data.nodeTypeUniqueId;if(!j)continue;const O=e.typeOfNodes[j];F.push({kind:"standard",nodeId:E,nodeTypeId:j,nodeTypeName:O?.name??j,concurrencyLevel:D})}F.length>0&&U.push(F)}let q=0;for(const D of U)for(const $ of D)$.kind==="standard"?q++:$.kind==="loop"?q+=3+$.preStopSteps.length+$.postStopSteps.length:$.kind==="group"&&(q+=1+$.innerPlan.nodeCount);return{levels:U,inputResolutionMap:u,outputDistributionMap:d,nodeCount:q,warnings:s}}function Tn(e,t){return`${e}:${t}`}function Xc(e){const t=[];if(!e)return t;for(const n of e)if("inputs"in n)for(const r of n.inputs)t.push(r);else t.push(n);return t}class Kc{store;prefix;parent;constructor(t="",n=null){this.store=new Map,this.prefix=t,this.parent=n}set(t,n,r){this.store.set(this.prefix+Tn(t,n),r)}get(t,n){const r=this.prefix+Tn(t,n);if(this.store.has(r))return this.store.get(r);if(this.parent)return this.parent.get(t,n)}has(t,n){const r=this.prefix+Tn(t,n);return this.store.has(r)?!0:this.parent?this.parent.has(t,n):!1}resolveInputs(t,n,r,i){const s=new Map,a=Xc(n.inputs);for(const l of a){if(!l.id||!l.name)continue;const u=l.id,d=l.name,f=l.inferredDataType?.dataTypeUniqueId??l.dataType?.dataTypeUniqueId??"",g=Tn(t,u),h=r.get(g);if(h&&h.length>0){const m=[];for(const x of h){const v=i.get(x.sourceNodeId),S=(v?.data.outputs??[]).find(N=>N.id===x.sourceHandleId);m.push({value:this.get(x.sourceNodeId,x.sourceHandleId),sourceNodeId:x.sourceNodeId,sourceNodeName:v?.typeOfNode?.name??"",sourceNodeTypeId:v?.data.nodeTypeUniqueId??"",sourceHandleId:x.sourceHandleId,sourceHandleName:S?.name??"",sourceDataTypeId:S?.inferredDataType?.dataTypeUniqueId??S?.dataType?.dataTypeUniqueId??"",edgeId:x.edgeId})}s.set(d,{connections:m,handleId:u,handleName:d,dataTypeId:f,isDefault:!1})}else l.allowInput&&l.value!==void 0?s.set(d,{connections:[],handleId:u,handleName:d,dataTypeId:f,isDefault:!0,defaultValue:l.value}):s.set(d,{connections:[],handleId:u,handleName:d,dataTypeId:f,isDefault:!0,defaultValue:void 0})}return s}buildOutputInfo(t,n,r){const i=new Map,s=n.outputs;if(!s)return i;for(const a of s){if(!a.id||!a.name)continue;const l=a.id,u=a.name,d=a.inferredDataType?.dataTypeUniqueId??a.dataType?.dataTypeUniqueId??"",f=Tn(t,l),g=r.get(f)??[];i.set(u,{handleId:l,handleName:u,dataTypeId:d,connections:g.map(h=>({targetNodeId:h.targetNodeId,targetHandleId:h.targetHandleId,edgeId:h.edgeId}))})}return i}snapshot(){return new Map(this.store)}createScope(t){return new Kc(`${t}>`,this)}clearScope(t){const n=`${t}>`;for(const r of this.store.keys())r.startsWith(n)&&this.store.delete(r)}}class DD{lastTimestamp=0;minIncrement;constructor(t=.001){this.minIncrement=t}now(){const t=performance.now(),n=Math.max(t,this.lastTimestamp+this.minIncrement);return this.lastTimestamp=n,n}}class Yb{startTime=0;steps=[];errors=[];concurrencyLevels=[];loopRecords=new Map;groupRecords=new Map;id;timer=new DD;rawStartTimes=new Map;pausedAt=null;totalPauseDuration=0;scopeStack=[];pendingLevelStart=0;pendingLevelNodeIds=[];pendingLoopIterations=new Map;pendingLoopStructures=new Map;loopNestingStack=[];pendingNestedLoopStructures=new Map;completedNestedLoopRecords=new Map;constructor(){this.id=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`run-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}start(){this.startTime=this.timer.now()}pause(){this.pausedAt===null&&(this.pausedAt=this.timer.now())}resume(){this.pausedAt!==null&&(this.totalPauseDuration+=this.timer.now()-this.pausedAt,this.pausedAt=null)}getEffectivePauseDuration(){return this.pausedAt!==null?this.totalPauseDuration+(this.timer.now()-this.pausedAt):this.totalPauseDuration}beginStep(t){this.resume();const n=this.steps.length,r=this.timer.now();return this.rawStartTimes.set(n,performance.now()),this.steps.push({stepIndex:n,nodeId:t.nodeId,nodeTypeId:t.nodeTypeId,nodeTypeName:t.nodeTypeName,concurrencyLevel:t.concurrencyLevel,startTime:r-this.startTime,endTime:0,duration:0,pauseAdjustment:this.totalPauseDuration,status:"completed",inputValues:new Map,outputValues:new Map,loopIteration:t.loopIteration,loopStructureId:t.loopStructureId,parentLoopStructureId:t.parentLoopStructureId,parentLoopIteration:t.parentLoopIteration,groupNodeId:t.groupNodeId,groupDepth:t.groupDepth,loopPhase:t.loopPhase,inputSource:t.inputSource}),n}addStepToPendingIteration(t){if(t.loopStructureId!==void 0){const n=this.pendingLoopIterations.get(t.loopStructureId);if(n){n.stepRecords.push(t);return}}if(this.loopNestingStack.length>0){const n=this.loopNestingStack[this.loopNestingStack.length-1],r=this.pendingLoopIterations.get(n.loopStructureId);r&&r.stepRecords.push(t)}}completeStep(t,n,r){const i=this.steps[t];if(!i)return;const s=performance.now(),a=this.timer.now();i.endTime=a-this.startTime,i.duration=i.endTime-i.startTime,i.status="completed",i.inputValues=n,i.outputValues=r;const l=this.rawStartTimes.get(t);l!==void 0&&s===l&&(i.estimatedTiming=!0),this.rawStartTimes.delete(t),this.addStepToPendingIteration(i)}errorStep(t,n,r){const i=this.steps[t];if(!i)return;const s=performance.now(),a=this.timer.now();i.endTime=a-this.startTime,i.duration=i.endTime-i.startTime,i.status="errored",i.inputValues=r,i.error=n;const l=this.rawStartTimes.get(t);l!==void 0&&s===l&&(i.estimatedTiming=!0),this.rawStartTimes.delete(t),this.errors.push(n),this.addStepToPendingIteration(i)}skipStep(t){const n=this.steps[t];if(!n)return;const r=this.timer.now();n.endTime=r-this.startTime,n.duration=0,n.status="skipped",this.rawStartTimes.delete(t),this.addStepToPendingIteration(n)}beginLevel(t,n){this.pendingLevelStart=this.timer.now(),this.pendingLevelNodeIds=n}completeLevel(t){const n=this.timer.now();this.concurrencyLevels.push({level:t,startTime:this.pendingLevelStart-this.startTime,endTime:n-this.startTime,duration:n-this.pendingLevelStart,nodeIds:this.pendingLevelNodeIds})}beginLoopStructure(t,n,r,i){const s={loopStartNodeId:n,loopStopNodeId:r,loopEndNodeId:i,iterations:[],startTime:this.timer.now()};if(this.loopNestingStack.length>0){const a=this.loopNestingStack[this.loopNestingStack.length-1],l=`${a.loopStructureId}:${a.iteration}:${t}`;this.pendingNestedLoopStructures.set(l,s)}else this.pendingLoopStructures.set(t,s)}beginLoopIteration(t,n){this.loopNestingStack.push({loopStructureId:t,iteration:n}),this.pendingLoopIterations.set(t,{iteration:n,startTime:this.timer.now(),stepRecords:[]})}completeLoopIteration(t,n,r){this.loopNestingStack.pop();const i=this.pendingLoopIterations.get(t);if(!i)return;const s=new Map,a=`${t}:${n}:`;for(const[f,g]of this.completedNestedLoopRecords)if(f.startsWith(a)){const h=f.slice(a.length);s.set(h,g)}for(const f of s.keys())this.completedNestedLoopRecords.delete(`${a}${f}`);const l=this.timer.now(),u={iteration:n,startTime:i.startTime-this.startTime,endTime:l-this.startTime,duration:l-i.startTime,conditionValue:r,stepRecords:i.stepRecords,nestedLoopRecords:s},d=this.pendingLoopStructures.get(t)??this.findPendingStructure(t);d&&d.iterations.push(u),this.pendingLoopIterations.delete(t)}findPendingStructure(t){for(const[n,r]of this.pendingNestedLoopStructures)if(n.endsWith(`:${t}`))return r}completeLoopStructure(t){let n=this.pendingLoopStructures.get(t),r=null;if(!n){for(const[a,l]of this.pendingNestedLoopStructures)if(a.endsWith(`:${t}`)){n=l,r=a;break}}if(!n)return;const i=this.timer.now(),s={loopStructureId:t,loopStartNodeId:n.loopStartNodeId,loopStopNodeId:n.loopStopNodeId,loopEndNodeId:n.loopEndNodeId,iterations:n.iterations,totalIterations:n.iterations.length,startTime:n.startTime-this.startTime,endTime:i-this.startTime,duration:i-n.startTime};r?(this.completedNestedLoopRecords.set(r,s),this.pendingNestedLoopStructures.delete(r)):(this.loopRecords.set(t,s),this.pendingLoopStructures.delete(t))}beginGroup(t,n){}completeGroup(t,n,r,i,s){this.groupRecords.set(t,{groupNodeId:t,groupNodeTypeId:n,innerRecord:r,inputMapping:i,outputMapping:s})}getLatestStep(){return this.steps.length>0?this.steps[this.steps.length-1]:void 0}stepCount(){return this.steps.length}getStep(t){return this.steps[t]}beginScope(){const t=[...this.loopNestingStack];this.loopNestingStack.length=0,this.scopeStack.push({startStepIndex:this.steps.length,startErrorIndex:this.errors.length,startLoopRecordKeys:new Set(this.loopRecords.keys()),startGroupRecordKeys:new Set(this.groupRecords.keys()),startNestedLoopKeys:new Set(this.completedNestedLoopRecords.keys()),savedNestingStack:t,startTime:this.timer.now()})}endScope(t,n){const r=this.scopeStack.pop();if(!r)throw new Error("ExecutionRecorder.endScope() called without matching beginScope()");this.loopNestingStack.length=0;for(const d of r.savedNestingStack)this.loopNestingStack.push(d);const i=this.timer.now(),s=this.steps.slice(r.startStepIndex),a=this.errors.slice(r.startErrorIndex),l=new Map;for(const[d,f]of this.loopRecords)r.startLoopRecordKeys.has(d)||l.set(d,f);const u=new Map;for(const[d,f]of this.groupRecords)r.startGroupRecordKeys.has(d)||u.set(d,f);return{id:`${this.id}-scope-${r.startStepIndex}`,startTime:r.startTime,endTime:i,totalDuration:i-r.startTime,compilationDuration:0,totalPauseDuration:this.getEffectivePauseDuration(),status:t,steps:s,errors:a,concurrencyLevels:[],loopRecords:l,groupRecords:u,finalValues:n}}snapshotPendingLoopRecords(t){const n=new Map(this.loopRecords),r=(i,s)=>{const a=this.pendingLoopIterations.get(i),l=[...s.iterations];if(a){const u=new Map,d=`${i}:${a.iteration}:`;for(const[f,g]of this.completedNestedLoopRecords)f.startsWith(d)&&u.set(f.slice(d.length),g);for(const[f,g]of this.pendingNestedLoopStructures)if(f.startsWith(d)){const h=f.slice(d.length);u.has(h)||u.set(h,r(h,g))}l.push({iteration:a.iteration,startTime:a.startTime-this.startTime,endTime:t-this.startTime,duration:t-a.startTime,conditionValue:!0,stepRecords:[...a.stepRecords],nestedLoopRecords:u})}return{loopStructureId:i,loopStartNodeId:s.loopStartNodeId,loopStopNodeId:s.loopStopNodeId,loopEndNodeId:s.loopEndNodeId,iterations:l,totalIterations:l.length,startTime:s.startTime-this.startTime,endTime:t-this.startTime,duration:t-s.startTime}};for(const[i,s]of this.pendingLoopStructures)n.has(i)||n.set(i,r(i,s));return n}snapshot(t,n){const r=this.timer.now();return{id:this.id,startTime:this.startTime,endTime:r,totalDuration:r-this.startTime,compilationDuration:0,totalPauseDuration:this.getEffectivePauseDuration(),status:t,steps:[...this.steps],errors:[...this.errors],concurrencyLevels:[...this.concurrencyLevels],loopRecords:this.snapshotPendingLoopRecords(r),groupRecords:new Map(this.groupRecords),finalValues:n}}finalize(t,n,r=0){const i=this.timer.now();return{id:this.id,startTime:this.startTime,endTime:i,totalDuration:i-this.startTime,compilationDuration:r,totalPauseDuration:this.getEffectivePauseDuration(),status:t,steps:this.steps,errors:this.errors,concurrencyLevels:this.concurrencyLevels,loopRecords:this.loopRecords,groupRecords:this.groupRecords,finalValues:n}}}class jD{pendingPayload=null;pendingPushResolve=null;pendingPullResolve=null;pendingPullReject=null;closed=!1;error=void 0;push(t){if(this.closed)return Promise.resolve();if(this.pendingPullResolve){const n=this.pendingPullResolve;return this.pendingPullResolve=null,this.pendingPullReject=null,n(t),new Promise(r=>{this.pendingPushResolve=r})}return this.pendingPayload=t,new Promise(n=>{this.pendingPushResolve=n})}pull(){if(this.error!==void 0)return Promise.reject(this.error);if(this.pendingPayload){const t=this.pendingPayload;if(this.pendingPayload=null,this.pendingPushResolve){const n=this.pendingPushResolve;this.pendingPushResolve=null,n()}return Promise.resolve(t)}return this.closed?Promise.resolve(null):new Promise((t,n)=>{if(this.pendingPullResolve=t,this.pendingPullReject=n,this.pendingPushResolve){const r=this.pendingPushResolve;this.pendingPushResolve=null,r()}})}close(){this.closed=!0,this.pendingPullResolve&&(this.pendingPullResolve(null),this.pendingPullResolve=null,this.pendingPullReject=null),this.pendingPushResolve&&(this.pendingPushResolve(),this.pendingPushResolve=null)}closeWithError(t){this.closed=!0,this.error=t,this.pendingPullReject&&(this.pendingPullReject(t),this.pendingPullResolve=null,this.pendingPullReject=null),this.pendingPushResolve&&(this.pendingPushResolve(),this.pendingPushResolve=null)}}function Xb(e,t){const n=new Map;function r(i){for(const s of i)if(s.kind==="standard"){const a=t.nodes.find(d=>d.id===s.nodeId);if(!a)continue;const l=a.data.nodeTypeUniqueId;if(!l)continue;const u=t.typeOfNodes[l];n.set(s.nodeId,{data:a.data,typeOfNode:u,nodeTypeId:s.nodeTypeId,nodeTypeName:s.nodeTypeName,concurrencyLevel:s.concurrencyLevel})}else if(s.kind==="loop"){for(const a of[s.loopStartNodeId,s.loopStopNodeId,s.loopEndNodeId]){const l=t.nodes.find(f=>f.id===a);if(!l)continue;const u=l.data.nodeTypeUniqueId;if(!u)continue;const d=t.typeOfNodes[u];n.set(a,{data:l.data,typeOfNode:d,nodeTypeId:u,nodeTypeName:d?.name??u,concurrencyLevel:s.concurrencyLevel})}r(s.preStopSteps),r(s.postStopSteps)}else if(s.kind==="group"){const a=t.nodes.find(d=>d.id===s.groupNodeId);if(!a)continue;const l=a.data.nodeTypeUniqueId;if(!l)continue;const u=t.typeOfNodes[l];n.set(s.groupNodeId,{data:a.data,typeOfNode:u,nodeTypeId:s.groupNodeTypeId,nodeTypeName:s.groupNodeTypeName,concurrencyLevel:s.concurrencyLevel})}}for(const i of e.levels)r(i);return n}function Mr(e){const t=new Map;for(const[n,r]of e){const i=r.connections.map(s=>({value:s.value,sourceNodeId:s.sourceNodeId,sourceNodeName:s.sourceNodeName,sourceHandleId:s.sourceHandleId,sourceHandleName:s.sourceHandleName,sourceDataTypeId:s.sourceDataTypeId}));t.set(n,{connections:i,dataTypeId:r.dataTypeId,isDefault:r.isDefault,defaultValue:r.defaultValue})}return t}function Zc(e,t){const n=new Map;for(const[r,i]of e){const s=t.get(r);n.set(r,{value:i,dataTypeId:s?.dataTypeId??"",targetCount:s?.connections.length??0})}return n}function Jc(e,t,n){for(const[r,i]of t){const s=r.indexOf(":");if(!(s===-1||r.substring(0,s)!==e)){for(const l of i)if(n.has(l.sourceNodeId))return!0}}return!1}function Kb(e){const t=[];for(const n of e)n.kind==="standard"?t.push(n.nodeId):n.kind==="loop"?t.push(n.loopStartNodeId):n.kind==="group"&&t.push(n.groupNodeId);return t}function Xf(e,t,n){const r=e.beginStep(t);n.status==="errored"?e.errorStep(r,n.error,new Map):e.completeStep(r,new Map,new Map)}async function As(e,t,n,r,i,s,a,l,u,d,f,g){const{nodeId:h,nodeTypeId:m,nodeTypeName:x,concurrencyLevel:v}=e;l(h,"running");const b=n.beginStep({nodeId:h,nodeTypeId:m,nodeTypeName:x,concurrencyLevel:v,loopIteration:d?.loopIteration,loopStructureId:d?.loopStructureId,groupNodeId:f?.groupNodeId,groupDepth:f?.groupDepth,loopPhase:g}),S=performance.now(),N=a.get(h);if(!N){const M=zn({error:new Error(`Node "${h}" not found in state`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:[],timestamp:performance.now()-S,duration:0});throw n.errorStep(b,M,new Map),l(h,"errored"),M}const w=t.resolveInputs(h,N.data,r.inputResolutionMap,a),I=t.buildOutputInfo(h,N.data,r.outputDistributionMap);if(ri(m)){n.completeStep(b,Mr(w),new Map),l(h,"completed");return}if(!kr(i,m)){const M=zn({error:new Error(`No function implementation for node type "${x}" (${m})`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:Pf(h,r.inputResolutionMap,a),timestamp:performance.now()-S,duration:performance.now()-S,loopContext:d?{loopStructureId:d.loopStructureId,iteration:d.loopIteration,maxIterations:d.maxIterations}:void 0,groupContext:f?{groupNodeId:f.groupNodeId,groupNodeTypeId:f.groupNodeTypeId,depth:f.groupDepth}:void 0});throw n.errorStep(b,M,Mr(w)),l(h,"errored"),M}const k=i[m];if(!k){const M=zn({error:new Error(`No function implementation for node type "${x}" (${m})`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:Pf(h,r.inputResolutionMap,a),timestamp:performance.now()-S,duration:performance.now()-S,loopContext:d?{loopStructureId:d.loopStructureId,iteration:d.loopIteration,maxIterations:d.maxIterations}:void 0,groupContext:f?{groupNodeId:f.groupNodeId,groupNodeTypeId:f.groupNodeTypeId,depth:f.groupDepth}:void 0});throw n.errorStep(b,M,Mr(w)),l(h,"errored"),M}const A={nodeId:h,nodeTypeId:m,nodeTypeName:x,state:s,loopIteration:d?.loopIteration,groupDepth:f?.groupDepth,abortSignal:u};try{const M=await k(w,I,A);if(!(M instanceof Map))throw new Error(`Function implementation for "${x}" must return a Map, got ${typeof M}`);for(const[B,U]of M){const q=I.get(B);q&&t.set(h,q.handleId,U)}n.completeStep(b,Mr(w),Zc(M,I)),l(h,"completed")}catch(M){const B=performance.now()-S,U=zn({error:M,nodeId:h,nodeTypeId:m,nodeTypeName:x,path:Pf(h,r.inputResolutionMap,a),timestamp:B,duration:B,loopContext:d?{loopStructureId:d.loopStructureId,iteration:d.loopIteration,maxIterations:d.maxIterations}:void 0,groupContext:f?{groupNodeId:f.groupNodeId,groupNodeTypeId:f.groupNodeTypeId,depth:f.groupDepth}:void 0});throw n.errorStep(b,U,Mr(w)),l(h,"errored"),U}}const $D=new Set([ze.bindLoopNodes,ze.loopInfer,ze.condition]);function Zb(e){return e.inferredDataType?.dataTypeUniqueId??e.dataType?.dataTypeUniqueId}function oi(e){return e.filter(t=>{const n=Zb(t);return t.id&&n&&!$D.has(n)}).map(t=>t.id)}function HD(e){return e.find(t=>Zb(t)===ze.condition)?.id}async function Kf(e,t,n,r,i,s,a,l,u,d,f,g){const{loopStartNodeId:h,loopStopNodeId:m,loopEndNodeId:x,preStopSteps:v,postStopSteps:b,maxIterations:S}=e,N=h,w=a.get(h),I=a.get(m),k=a.get(x);if(!w||!I||!k){const oe=zn({error:new Error("Loop structure nodes not found in state"),nodeId:h,nodeTypeId:"loop",nodeTypeName:"Loop",path:[],timestamp:0,duration:0,loopContext:{loopStructureId:N,iteration:0,maxIterations:S}}),pe=n.beginStep({nodeId:h,nodeTypeId:"loop",nodeTypeName:"Loop",concurrencyLevel:e.concurrencyLevel});throw n.errorStep(pe,oe,new Map),u(h,"errored"),u(m,"errored"),u(x,"errored"),l.add(h),l.add(m),l.add(x),oe}const A=Xc(w.data.inputs),M=w.data.outputs??[],B=Xc(I.data.inputs),U=I.data.outputs??[],q=Xc(k.data.inputs),D=k.data.outputs??[],$=oi(A),F=oi(M),E=oi(B),P=oi(U),L=oi(q),j=oi(D),O=HD(B),W=$.length;if(W===0||F.length!==W||E.length!==W||P.length!==W||L.length!==W||j.length!==W||!O){const oe=zn({error:new Error(`Loop structure has mismatched data handle counts (start in=${$.length}, start out=${F.length}, stop in=${E.length}, stop out=${P.length}, end in=${L.length}, end out=${j.length})`),nodeId:h,nodeTypeId:w.nodeTypeId,nodeTypeName:w.nodeTypeName,path:[],timestamp:0,duration:0,loopContext:{loopStructureId:N,iteration:0,maxIterations:S}}),pe=n.beginStep({nodeId:h,nodeTypeId:w.nodeTypeId,nodeTypeName:w.nodeTypeName,concurrencyLevel:e.concurrencyLevel});throw n.errorStep(pe,oe,new Map),u(h,"errored"),l.add(h),l.add(m),l.add(x),oe}const z=new Array(W);for(let oe=0;oe<W;oe++){const pe=Tn(h,$[oe]),ve=(r.inputResolutionMap.get(pe)??[]).filter(me=>me.sourceNodeId!==m);ve.length>0&&(z[oe]=t.get(ve[0].sourceNodeId,ve[0].sourceHandleId))}n.beginLoopStructure(N,h,m,x);const Y=f?{parentLoopStructureId:f.loopStructureId,parentLoopIteration:f.loopIteration}:{},J=t.buildOutputInfo(h,w.data,r.outputDistributionMap),ie=t.buildOutputInfo(m,I.data,r.outputDistributionMap);u(h,"running"),u(m,"running");function ee(oe){const pe=new Map;for(const le of oe){const ve=pe.get(le.concurrencyLevel);ve?ve.push(le):pe.set(le.concurrencyLevel,[le])}return[...pe.entries()].sort((le,ve)=>le[0]-ve[0])}const ce=ee(v),ge=ee(b),Q=t.buildOutputInfo(x,k.data,r.outputDistributionMap);async function te(oe,pe,le,ve){for(const[,me]of oe){if(d.aborted)break;const Oe=[],Ce=[];for(const ae of me){const Ie=an(ae);Jc(Ie,r.inputResolutionMap,pe)?Ce.push(ae):Oe.push(ae)}for(const ae of Ce){const Ie=an(ae);u(Ie,"skipped"),pe.add(Ie);const Be=n.beginStep({nodeId:Ie,nodeTypeId:Qc(ae),nodeTypeName:el(ae),concurrencyLevel:ae.concurrencyLevel,loopIteration:le,loopStructureId:N,loopPhase:ve,...Y});n.skipStep(Be),await g?.()}if(g)for(const ae of Oe){if(d.aborted)break;try{ae.kind==="standard"?(await As(ae,t,n,r,i,s,a,u,d,{loopIteration:le,loopStructureId:N,maxIterations:S},void 0,ve),await g()):await ks(ae,t,n,r,i,s,a,pe,u,d,{loopIteration:le,loopStructureId:N},g)}catch{pe.add(an(ae))}}else{const ae=await Promise.allSettled(Oe.map(Ie=>Ie.kind==="standard"?As(Ie,t,n,r,i,s,a,u,d,{loopIteration:le,loopStructureId:N,maxIterations:S},void 0,ve):ks(Ie,t,n,r,i,s,a,pe,u,d,{loopIteration:le,loopStructureId:N})));for(let Ie=0;Ie<ae.length;Ie++)ae[Ie].status==="rejected"&&pe.add(an(Oe[Ie]))}}}let ne=!1;for(let oe=0;oe<S&&!d.aborted;oe++){n.beginLoopIteration(N,oe);for(let Ce=0;Ce<W;Ce++)t.set(h,F[Ce],z[Ce]);const pe=oe===0?"upstream":"feedback";{const Ce=n.beginStep({nodeId:h,nodeTypeId:w.nodeTypeId,nodeTypeName:w.nodeTypeName,concurrencyLevel:e.concurrencyLevel,loopIteration:oe,loopStructureId:N,loopPhase:"loopStart",inputSource:pe,...Y}),ae=t.resolveInputs(h,w.data,r.inputResolutionMap,a),Ie=new Map;for(const[Qe,Ue]of ae)if(pe==="upstream"){const Ze=Ue.connections.filter(pt=>pt.sourceNodeId!==m);Ie.set(Qe,{...Ue,connections:Ze})}else{const Ze=Ue.connections.filter(pt=>pt.sourceNodeId===m);Ie.set(Qe,{...Ue,connections:Ze})}const Be=new Map;for(const[Qe,Ue]of J){const Ze=F.indexOf(Ue.handleId);Ze>=0&&Be.set(Qe,z[Ze])}n.completeStep(Ce,Mr(Ie),Zc(Be,J)),await g?.()}const le=new Set;await te(ce,le,oe,"preStop");const ve=Tn(m,O),me=r.inputResolutionMap.get(ve);let Oe=!1;me&&me.length>0&&(me.some(ae=>le.has(ae.sourceNodeId))||(Oe=!!t.get(me[0].sourceNodeId,me[0].sourceHandleId)));for(let Ce=0;Ce<W;Ce++){const ae=Tn(m,E[Ce]),Ie=r.inputResolutionMap.get(ae);let Be;Ie&&Ie.length>0&&(Be=t.get(Ie[0].sourceNodeId,Ie[0].sourceHandleId)),t.set(m,P[Ce],Be),z[Ce]=Be}{const Ce=n.beginStep({nodeId:m,nodeTypeId:I.nodeTypeId,nodeTypeName:I.nodeTypeName,concurrencyLevel:e.concurrencyLevel,loopIteration:oe,loopStructureId:N,loopPhase:"loopStop",...Y}),ae=t.resolveInputs(m,I.data,r.inputResolutionMap,a),Ie=new Map;for(const[Be,Qe]of ie){const Ue=P.indexOf(Qe.handleId);Ue>=0&&Ie.set(Be,z[Ue])}n.completeStep(Ce,Mr(ae),Zc(Ie,ie)),await g?.()}if(Oe&&ge.length>0){await te(ge,le,oe,"postStop");for(let Ce=0;Ce<W;Ce++){const ae=Tn(x,L[Ce]),Ie=r.inputResolutionMap.get(ae);Ie&&Ie.length>0&&(z[Ce]=t.get(Ie[0].sourceNodeId,Ie[0].sourceHandleId))}}{const Ce=!Oe;if(Ce)for(let Qe=0;Qe<W;Qe++)t.set(x,j[Qe],z[Qe]);const ae=n.beginStep({nodeId:x,nodeTypeId:k.nodeTypeId,nodeTypeName:k.nodeTypeName,concurrencyLevel:e.concurrencyLevel,loopIteration:oe,loopStructureId:N,loopPhase:"loopEnd",...Y}),Ie=t.resolveInputs(x,k.data,r.inputResolutionMap,a),Be=new Map;if(Ce)for(const[Qe,Ue]of Q){const Ze=j.indexOf(Ue.handleId);Ze>=0&&Be.set(Qe,z[Ze])}n.completeStep(ae,Mr(Ie),Zc(Be,Q)),await g?.()}if(ne=Oe,n.completeLoopIteration(N,oe,Oe),!Oe)break}if(ne&&S>0){const oe=zn({error:new Error(`Loop exceeded maximum iterations (${S})`),nodeId:m,nodeTypeId:I.nodeTypeId,nodeTypeName:I.nodeTypeName,path:[],timestamp:0,duration:0,loopContext:{loopStructureId:N,iteration:S-1,maxIterations:S}}),pe=n.beginStep({nodeId:m,nodeTypeId:I.nodeTypeId,nodeTypeName:I.nodeTypeName,concurrencyLevel:e.concurrencyLevel,loopStructureId:N,loopIteration:S-1,...Y});throw n.errorStep(pe,oe,new Map),Xf(n,{nodeId:x,nodeTypeId:k.nodeTypeId,nodeTypeName:k.nodeTypeName,concurrencyLevel:e.concurrencyLevel,loopStructureId:N,...Y},{status:"errored",error:oe}),u(m,"errored"),u(x,"errored"),l.add(h),l.add(m),l.add(x),n.completeLoopStructure(N),oe}u(h,"completed"),u(m,"completed"),u(x,"completed"),n.completeLoopStructure(N)}function BD(e,t){return{...e,nodes:t.nodes,edges:t.edges,openedNodeGroupStack:void 0}}async function Zf(e,t,n,r,i,s,a,l,u,d,f=1,g){const{groupNodeId:h,groupNodeTypeId:m,groupNodeTypeName:x,innerPlan:v}=e;if(u(h,"running"),!kr(s.typeOfNodes,m)){const D=zn({error:new Error(`Group node type "${x}" not found in type definitions`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:[],timestamp:0,duration:0,groupContext:{groupNodeId:h,groupNodeTypeId:m,depth:f}}),$=n.beginStep({nodeId:h,nodeTypeId:m,nodeTypeName:x,concurrencyLevel:e.concurrencyLevel,groupNodeId:h,groupDepth:f});throw n.errorStep($,D,new Map),u(h,"errored"),l.add(h),D}const S=s.typeOfNodes[m].subtree;if(!S){const D=zn({error:new Error(`Group node type "${x}" has no subtree definition`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:[],timestamp:0,duration:0,groupContext:{groupNodeId:h,groupNodeTypeId:m,depth:f}}),$=n.beginStep({nodeId:h,nodeTypeId:m,nodeTypeName:x,concurrencyLevel:e.concurrencyLevel,groupNodeId:h,groupDepth:f});throw n.errorStep($,D,new Map),u(h,"errored"),l.add(h),D}const N=BD(s,S),w=new Map;for(const D of S.nodes){const $=D.data.nodeTypeUniqueId;if(!$)continue;const F=kr(s.typeOfNodes,$)?s.typeOfNodes[$]:void 0;w.set(D.id,{data:D.data,typeOfNode:F,nodeTypeId:$,nodeTypeName:F?.name??$,concurrencyLevel:-1})}for(const D of v.levels)for(const $ of D)if($.kind==="standard"){const F=w.get($.nodeId);F&&(F.concurrencyLevel=$.concurrencyLevel)}const I=t.createScope(h),k=S.inputNodeId;if(k)for(const[D,$]of e.inputMapping){const F=Tn(h,D),E=r.inputResolutionMap.get(F);if(E&&E.length>0){const P=t.get(E[0].sourceNodeId,E[0].sourceHandleId);I.set(k,$,P)}}n.beginGroup(h,m),n.beginScope();let A=!1;const M=new Set;for(let D=0;D<v.levels.length&&!d.aborted;D++){const $=v.levels[D],F=[],E=[];for(const P of $){const L=an(P);Jc(L,v.inputResolutionMap,M)?E.push(P):F.push(P)}for(const P of E){const L=an(P);u(L,"skipped"),M.add(L);const j=n.beginStep({nodeId:L,nodeTypeId:Qc(P),nodeTypeName:el(P),concurrencyLevel:P.concurrencyLevel,groupNodeId:h,groupDepth:f});n.skipStep(j),await g?.()}if(g)for(const P of F){if(d.aborted)break;try{P.kind==="standard"?(await As(P,I,n,v,i,N,w,u,d,void 0,{groupNodeId:h,groupNodeTypeId:m,groupDepth:f}),await g()):P.kind==="group"?await Zf(P,I,n,v,i,N,w,M,u,d,f+1,g):await Kf(P,I,n,v,i,N,w,M,u,d,void 0,g)}catch{M.add(an(P))}}else{const P=await Promise.allSettled(F.map(L=>L.kind==="standard"?As(L,I,n,v,i,N,w,u,d,void 0,{groupNodeId:h,groupNodeTypeId:m,groupDepth:f}):L.kind==="group"?Zf(L,I,n,v,i,N,w,M,u,d,f+1):Kf(L,I,n,v,i,N,w,M,u,d)));for(let L=0;L<P.length;L++)P[L].status==="rejected"&&(A=!0,M.add(an(F[L])))}}const B=S.outputNodeId;if(B)for(const[D,$]of e.outputMapping){const F=Tn(B,D),E=v.inputResolutionMap.get(F);if(E&&E.length>0){const P=I.get(E[0].sourceNodeId,E[0].sourceHandleId);t.set(h,$,P)}}const U=n.endScope(A?"errored":"completed",I.snapshot());n.completeGroup(h,m,U,e.inputMapping,e.outputMapping);const q={nodeId:h,nodeTypeId:m,nodeTypeName:x,concurrencyLevel:e.concurrencyLevel,groupNodeId:h,groupDepth:f};if(A){const D=zn({error:new Error(`Group "${x}" inner execution had errors`),nodeId:h,nodeTypeId:m,nodeTypeName:x,path:[],timestamp:0,duration:0,groupContext:{groupNodeId:h,groupNodeTypeId:m,depth:f}});Xf(n,q,{status:"errored",error:D}),u(h,"errored"),l.add(h)}else Xf(n,q,{status:"completed"}),u(h,"completed")}async function ks(e,t,n,r,i,s,a,l,u,d,f,g){switch(e.kind){case"standard":await As(e,t,n,r,i,s,a,u,d),await g?.();return;case"loop":return Kf(e,t,n,r,i,s,a,l,u,d,f,g);case"group":return Zf(e,t,n,r,i,s,a,l,u,d,void 0,g)}}async function VD(e,t,n,r){const{onNodeStateChange:i,abortSignal:s}=r,a=new Kc,l=new Yb,u=new Set,d=Xb(e,n),f=performance.now();{const x="__jit_warmup__";a.set(x,x,0),a.get(x,x);const v=new Map;v.set(x,0),v.get(x),v.delete(x),await Promise.allSettled([Promise.resolve(0)]),a.set(x,x,void 0)}const g=performance.now()-f;l.start();let h=!1;for(let x=0;x<e.levels.length;x++){if(s.aborted)return l.finalize("cancelled",a.snapshot(),g);const v=e.levels[x],b=Kb(v);l.beginLevel(x,b);const S=[],N=[];for(const I of v){const k=an(I);Jc(k,e.inputResolutionMap,u)?N.push(I):S.push(I)}for(const I of N){const k=an(I);i(k,"skipped"),u.add(k);const A=l.beginStep({nodeId:k,nodeTypeId:Qc(I),nodeTypeName:el(I),concurrencyLevel:I.concurrencyLevel});l.skipStep(A)}const w=await Promise.allSettled(S.map(I=>ks(I,a,l,e,t,n,d,u,i,s)));for(let I=0;I<w.length;I++)if(w[I].status==="rejected"){h=!0;const A=an(S[I]);u.add(A)}l.completeLevel(x)}const m=s.aborted?"cancelled":h?"errored":"completed";return l.finalize(m,a.snapshot(),g)}async function*FD(e,t,n,r){const{onNodeStateChange:i,abortSignal:s}=r,a=new Kc,l=new Yb,u=new Set,d=Xb(e,n),f=performance.now();{const x="__jit_warmup__";a.set(x,x,0),a.get(x,x),await Promise.allSettled([Promise.resolve(0)]),a.set(x,x,void 0)}const g=performance.now()-f;l.start();let h=!1;for(let x=0;x<e.levels.length;x++){if(s.aborted)return l.resume(),l.finalize("cancelled",a.snapshot(),g);const v=e.levels[x],b=Kb(v);l.beginLevel(x,b);for(const S of v){if(s.aborted)return l.resume(),l.finalize("cancelled",a.snapshot(),g);const N=an(S);if(Jc(N,e.inputResolutionMap,u)){i(N,"skipped"),u.add(N);const w=l.beginStep({nodeId:N,nodeTypeId:Qc(S),nodeTypeName:el(S),concurrencyLevel:S.concurrencyLevel});l.skipStep(w);continue}if(S.kind==="standard"){try{await ks(S,a,l,e,t,n,d,u,i,s)}catch{h=!0,u.add(N)}const w=l.getLatestStep();w&&(l.pause(),yield{stepRecord:w,partialRecord:l.snapshot(h?"errored":"completed",a.snapshot())})}else{const w=new jD,k=ks(S,a,l,e,t,n,d,u,i,s,void 0,async()=>{const A=l.getLatestStep();A&&(l.pause(),await w.push({stepRecord:A,partialRecord:l.snapshot(h?"errored":"completed",a.snapshot())}))}).then(()=>w.close(),A=>{h=!0,u.add(N),w.closeWithError(A)});try{for(;;){const A=await w.pull();if(A===null)break;yield A}}catch{h=!0,u.add(N)}await k}}l.completeLevel(x)}l.resume();const m=s.aborted?"cancelled":h?"errored":"completed";return l.finalize(m,a.snapshot(),g)}function an(e){switch(e.kind){case"standard":return e.nodeId;case"loop":return e.loopStartNodeId;case"group":return e.groupNodeId}}function Qc(e){switch(e.kind){case"standard":return e.nodeTypeId;case"loop":return"loop";case"group":return e.groupNodeTypeId}}function el(e){switch(e.kind){case"standard":return e.nodeTypeName;case"loop":return"Loop";case"group":return e.groupNodeTypeName}}const Ms=new Map,zD=new Map,Os=new Map;function ii(e,t){const n=new Map;for(const r of e.steps)r.stepIndex<t?n.set(r.nodeId,r.status==="errored"?"errored":r.status==="skipped"?"skipped":"completed"):r.stepIndex===t?n.set(r.nodeId,"running"):n.has(r.nodeId)||n.set(r.nodeId,"idle");for(const[,r]of e.loopRecords){const i=[];for(const l of r.iterations)for(const u of l.stepRecords)i.push(u.stepIndex);if(i.length===0)continue;const s=Math.min(...i),a=Math.max(...i);t>=s&&t<=a&&(n.set(r.loopStartNodeId,"running"),n.set(r.loopStopNodeId,"running"))}for(const[r,i]of e.groupRecords){const s=i.innerRecord.steps;if(s.length===0)continue;const a=s.map(d=>d.stepIndex),l=Math.min(...a),u=Math.max(...a);t>=l&&t<=u&&n.set(r,"running")}return n}function UD(e,t){const n=new Map;for(const r of e.nodes){const i=r.data.nodeTypeUniqueId;if(!i)continue;const s=e.typeOfNodes[i];if(!ri(i)&&!Tt(i)&&!s?.subtree&&(!kr(t,i)||!t[i])){const a=s?.name??i,l=n.get(r.id);l?l.push(`No function implementation for node type "${a}"`):n.set(r.id,[`No function implementation for node type "${a}"`])}}return n}function Jf(e){const t=new Map;for(const n of e.errors){const r=t.get(n.nodeId);r?r.push(n):t.set(n.nodeId,[n])}return t}function WD(e,t){const n=[],r=[];if(e.steps.length===0)return r.push("Recording has no execution steps."),{valid:!1,warnings:n,errors:r};const i=new Set(t.nodes.map(f=>f.id)),s=new Set(Object.keys(t.typeOfNodes)),a=new Set,l=new Set;for(const f of e.steps)i.has(f.nodeId)||a.add(f.nodeId),!ri(f.nodeTypeId)&&!Tt(f.nodeTypeId)&&!s.has(f.nodeTypeId)&&l.add(f.nodeTypeId);a.size>0&&n.push(`Recording references ${a.size} node(s) not in the current graph: ${[...a].join(", ")}`),l.size>0&&n.push(`Recording references ${l.size} node type(s) not in the current graph: ${[...l].join(", ")}`);const u=new Set(e.steps.map(f=>f.nodeId)),d=[];for(const f of t.nodes){const g=f.data.nodeTypeUniqueId;g&&(ri(g)||Tt(g)||t.typeOfNodes[g]?.subtree||u.has(f.id)||d.push(f.id))}return d.length>0&&n.push(`${d.length} node(s) in the current graph were not in the recording: ${d.join(", ")}`),{valid:!0,warnings:n,errors:r}}function GD({state:e,functionImplementations:t,options:n,executionRecord:r,onExecutionRecordChange:i}){const s=r!==void 0,[a,l]=T.useState(null),u=s?r:a,d=T.useRef(u??null),f=T.useCallback(ne=>{d.current=ne,s||l(ne),i?.(ne)},[s,i]),[g,h]=T.useState(()=>u?"completed":"idle"),[m,x]=T.useState(()=>u?ii(u,Math.max(0,u.steps.length-1)):Ms),[v,b]=T.useState(zD),[S,N]=T.useState(()=>u?Jf(u):Os),[w,I]=T.useState(()=>u?Math.max(0,u.steps.length-1):0),[k,A]=T.useState("instant"),[M,B]=T.useState(n?.maxLoopIterations??qb),U=T.useRef(null),q=T.useRef(null),D=T.useRef(new Map),$=T.useRef(!1),F=T.useRef(!0);T.useEffect(()=>(F.current=!0,()=>{F.current=!1,U.current?.abort(),q.current=null,$.current=!1}),[]);const E=T.useRef(u);if(s&&u!==E.current&&u!==d.current)if(E.current=u,u){const ne=Math.max(0,u.steps.length-1);I(ne),N(Jf(u));const oe=ii(u,ne);D.current=new Map(oe),x(oe),h(u.status==="cancelled"||u.errors.length>0?"errored":"completed")}else I(0),N(Os),D.current=new Map,x(Ms),h("idle");else s&&u!==E.current&&(E.current=u);T.useEffect(()=>{const ne=UD(e,t);b(ne)},[e.nodes,e.typeOfNodes,t]);const P=T.useCallback(()=>{F.current&&x(new Map(D.current))},[]),L=T.useCallback((ne,oe)=>{D.current.set(ne,oe)},[]),j=T.useCallback(()=>{try{return Yf(e,t,{maxLoopIterations:M})}catch{return F.current&&h("errored"),null}},[e,t,M]),O=T.useCallback(ne=>{if(!F.current)return;f(ne),I(Math.max(0,ne.steps.length-1));const oe=Jf(ne);N(oe);const pe=new Map;for(const le of ne.steps)pe.set(le.nodeId,le.status==="errored"?"errored":le.status==="skipped"?"skipped":"completed");D.current=pe,x(pe),q.current=null,h(ne.status==="cancelled"||ne.errors.length>0?"errored":"completed")},[]),W=T.useCallback(async()=>{D.current=new Map,x(Ms),N(Os),f(null),I(0),U.current?.abort();const ne=new AbortController;U.current=ne,h("compiling");const oe=j();if(oe&&F.current){h("running");try{const pe=await VD(oe,t,e,{onNodeStateChange:L,abortSignal:ne.signal});if(!F.current)return;O(pe)}catch{F.current&&(P(),h("errored"))}}},[e,t,j,L,P,O]),z=T.useCallback(async()=>{D.current=new Map,x(Ms),N(Os),f(null),I(0),U.current?.abort();const ne=new AbortController;U.current=ne,h("compiling");const oe=j();if(!oe||!F.current)return;h("running");const pe=FD(oe,t,e,{onNodeStateChange:L,abortSignal:ne.signal});q.current=pe;try{const le=await pe.next();if(!F.current)return;if(le.done)O(le.value);else{const{stepRecord:ve,partialRecord:me}=le.value;f(me),I(ve.stepIndex),x(ii(me,ve.stepIndex)),h("paused")}}catch{F.current&&(P(),h("errored"),q.current=null)}},[e,t,j,L,P,O]),Y=T.useCallback(()=>{k==="instant"?W():z()},[k,W,z]),J=T.useCallback(()=>{const ne=q.current;if(!ne){z();return}h("running"),(async()=>{try{const oe=await ne.next();if(!F.current)return;if(oe.done)O(oe.value);else{const{stepRecord:pe,partialRecord:le}=oe.value;f(le),I(pe.stepIndex),x(ii(le,pe.stepIndex)),h("paused")}}catch{F.current&&(P(),h("errored"),q.current=null)}})()},[z,P,O]),ie=T.useCallback(()=>{$.current=!1,F.current&&h("paused")},[]),ee=T.useCallback(()=>{const ne=q.current;ne&&($.current=!0,h("running"),(async()=>{for(;$.current;)try{const oe=await ne.next();if(!F.current)return;if(oe.done){$.current=!1,O(oe.value);return}const{stepRecord:pe,partialRecord:le}=oe.value;f(le),I(pe.stepIndex),x(ii(le,pe.stepIndex))}catch{$.current=!1,F.current&&(P(),h("errored"),q.current=null);return}F.current&&h("paused")})())},[P,O]),ce=T.useCallback(()=>{$.current=!1,U.current?.abort(),q.current=null,F.current&&(P(),h("errored"))},[P]),ge=T.useCallback(()=>{$.current=!1,U.current?.abort(),q.current=null,F.current&&(D.current=new Map,h("idle"),x(Ms),N(Os),f(null),I(0))},[]),Q=T.useCallback(ne=>{if(!u)return;const oe=Math.max(0,Math.min(ne,u.steps.length-1));I(oe);const pe=ii(u,oe);D.current=new Map(pe),x(pe)},[u]),te=T.useCallback(ne=>{const oe=WD(ne,e);return oe.valid&&($.current=!1,U.current?.abort(),q.current=null,O(ne)),oe},[e,O]);return{runnerState:g,nodeVisualStates:m,nodeWarnings:v,nodeErrors:S,executionRecord:u,currentStepIndex:w,run:Y,pause:ie,resume:ee,step:J,stop:ce,reset:ge,replayTo:Q,loadRecord:te,mode:k,setMode:A,maxLoopIterations:M,setMaxLoopIterations:B}}const qD=250;function Qf(e,t={}){const{durationMs:n=qD,hiddenTransform:r="translateY(100%)",visibleTransform:i="translateY(0)",easing:s="cubic-bezier(0.32, 0.72, 0, 1)"}=t,[a,l]=T.useState(!1),u=T.useRef(null),d=T.useRef(null);return T.useEffect(()=>{e&&l(!0)},[e]),T.useEffect(()=>{const g=u.current;if(!g||!a)return;d.current&&(g.style.transform=getComputedStyle(g).transform,d.current.cancel(),d.current=null);const h=e?i:r,m=g.animate([{transform:h}],{duration:n,easing:s,fill:"forwards"});d.current=m,e||(m.onfinish=()=>l(!1))},[e,a,n,r,i,s]),{mounted:a,ref:u,style:{transform:r}}}function Jb({initialSize:e,minSize:t,maxSize:n,direction:r="up"}){const[i,s]=T.useState(e),a=T.useRef(!1),l=T.useRef(0),u=T.useRef(0),d=r==="up"||r==="down",f=d?"ns-resize":"ew-resize",g=r==="up"||r==="left"?-1:1,h=T.useCallback(m=>{m.preventDefault(),m.stopPropagation(),a.current=!0,l.current=d?m.clientY:m.clientX,u.current=i,document.body.style.userSelect="none",document.body.style.cursor=f;const x=b=>{if(!a.current)return;const N=((d?b.clientY:b.clientX)-l.current)*g,w=Math.max(t,Math.min(n,u.current+N));s(w)},v=()=>{a.current=!1,document.body.style.userSelect="",document.body.style.cursor="",document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",v)},[i,t,n,d,f,g]);return{size:i,onMouseDown:h}}const YD=220,XD=80,KD=600;function ZD({runnerState:e,record:t,currentStepIndex:n,onRun:r,onPause:i,onStep:s,onStop:a,onReset:l,mode:u,onModeChange:d,maxLoopIterations:f,onMaxLoopIterationsChange:g,onScrubTo:h,onNavigateToNode:m,panelRef:x,debugMode:v=!1,hideComplexValues:b=!1,className:S}){const{selectedStepIndex:N,setSelectedStepIndex:w,edgeValuesAnimated:I,setEdgeValuesAnimated:k,isRunnerPanelOpen:A,setIsRunnerPanelOpen:M}=Uf(),{size:B,onMouseDown:U}=Jb({initialSize:YD,minSize:XD,maxSize:KD,direction:"up"}),{mounted:q,ref:D,style:$}=Qf(A),F=T.useCallback(Y=>{D.current=Y,x&&(x.current=Y)},[D,x]);T.useEffect(()=>{A||w(null)},[A,w]);const E=N!==null&&t?t.steps.find(Y=>Y.stepIndex===N)??null:null,P=T.useRef(null);E&&(P.current=E);const j=Qf(E!==null,{durationMs:200,hiddenTransform:"translateX(100%)",visibleTransform:"translateX(0)"}),O=E??P.current,W=T.useCallback(Y=>{w(N===Y.stepIndex?null:Y.stepIndex)},[N,w]),z=T.useCallback(()=>{w(null)},[w]);return q?y.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 overflow-hidden pointer-events-none",children:y.jsxs("div",{ref:F,className:ye("pointer-events-auto","flex flex-col overflow-hidden rounded-t-lg border border-b-0 border-secondary-dark-gray/60 bg-runner-panel-bg shadow-xl",S),style:$,children:[y.jsx("div",{className:"group/resizer flex shrink-0 cursor-ns-resize items-center justify-center border-b border-runner-timeline-box-border bg-[#2b2b2b] py-2 transition-colors hover:bg-[#353535]",onMouseDown:U,children:y.jsxs("div",{className:"flex gap-1.5",children:[y.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-runner-handle-dot transition-colors group-hover/resizer:bg-primary-blue"}),y.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-runner-handle-dot transition-colors group-hover/resizer:bg-primary-blue"}),y.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-runner-handle-dot transition-colors group-hover/resizer:bg-primary-blue"})]})}),y.jsxs("div",{className:"flex shrink-0 items-center",children:[y.jsx("div",{className:"min-w-0 flex-1",children:y.jsx(wb,{runnerState:e,onRun:r,onPause:i,onStep:s,onStop:a,onReset:l,mode:u,onModeChange:d,maxLoopIterations:f,onMaxLoopIterationsChange:g})}),y.jsx("button",{type:"button",onClick:()=>M(!1),className:"btn-press mr-3 shrink-0 rounded p-1.5 text-secondary-light-gray transition-colors hover:bg-primary-dark-gray hover:text-primary-white",title:"Close panel",children:y.jsx(aa,{className:"h-4 w-4"})})]}),y.jsxs("div",{className:"flex min-h-0 overflow-hidden",style:{height:`${B}px`},children:[y.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:y.jsx(jb,{record:t,currentStepIndex:n,onScrubTo:h,onStepClick:W,selectedStepIndex:N,onNavigateToNode:m})}),j.mounted&&O&&y.jsx("div",{ref:j.ref,className:"node-runner-scrollbar shrink-0 overflow-y-auto border-l border-secondary-dark-gray",style:j.style,children:y.jsx($b,{stepRecord:O,onClose:z,loopRecords:t?.loopRecords,hideComplexValues:b,debugMode:v,edgeValuesAnimated:I,onEdgeValuesAnimatedChange:k})})]})]})}):null}function JD({state:e,dispatch:t,functionImplementations:n,children:r,onExecutionRecordRef:i,loadRecordRef:s}){const{executionRecord:a,setExecutionRecord:l}=Tw(),u=GD({state:e,functionImplementations:n,executionRecord:a,onExecutionRecordChange:l}),{getNode:d,setCenter:f,getViewport:g}=Zo(),h=T.useRef(null),m=Uf(),{selectedStepIndex:x,setSelectedStepIndex:v,edgeValuesAnimated:b,isRunnerPanelOpen:S,setIsRunnerPanelOpen:N,getViewState:w,restoreViewState:I}=m,k=T.useCallback(q=>{const D=d(q);if(!D)return;const $=D.position.x+(D.measured?.width??200)/2;let F=D.position.y+(D.measured?.height??100)/2;const E=g().zoom,P=h.current?.offsetHeight??0;P>0&&(F+=P/(2*E)),f($,F,{duration:300,zoom:E})},[d,f,g]);T.useEffect(()=>(s&&(s.current=q=>{const D=u.loadRecord(q);return D.valid&&q.viewState&&(I(q.viewState),q.viewState.runMode!==void 0&&u.setMode(q.viewState.runMode),q.viewState.maxLoopIterations!==void 0&&u.setMaxLoopIterations(q.viewState.maxLoopIterations)),D}),()=>{s&&(s.current=null)}),[s,u.loadRecord,u.setMode,u.setMaxLoopIterations,I]);const A=T.useMemo(()=>{const q=new Map;for(const[D,$]of u.nodeVisualStates)q.set(D,{visualState:$});for(const[D,$]of u.nodeWarnings){const F=q.get(D);F?q.set(D,{...F,warnings:$}):q.set(D,{visualState:"warning",warnings:$})}for(const[D,$]of u.nodeErrors){const F=q.get(D);F?q.set(D,{...F,errors:$}):q.set(D,{visualState:"errored",errors:$})}return q},[u.nodeVisualStates,u.nodeWarnings,u.nodeErrors]),M=T.useCallback(q=>{u.setMode(q)},[u.setMode]),B=T.useCallback(()=>{u.runnerState==="paused"?u.resume():u.run()},[u.runnerState,u.run,u.resume]);T.useEffect(()=>{(u.runnerState==="compiling"||u.runnerState==="idle")&&v(null)},[u.runnerState]),T.useEffect(()=>{x!==null&&u.replayTo(x)},[x,u.replayTo]);const U=T.useMemo(()=>x===null||!u.executionRecord?null:u.executionRecord.steps.find(q=>q.stepIndex===x)??null,[x,u.executionRecord]);return T.useEffect(()=>(i&&(i.current=()=>{const q=u.executionRecord;if(!q)return null;const D={...w(),runMode:u.mode,maxLoopIterations:u.maxLoopIterations};return{...q,viewState:D}}),()=>{i&&(i.current=null)}),[i,u.executionRecord,w,u.mode,u.maxLoopIterations]),y.jsxs(uo.Provider,{value:Sf({state:e,dispatch:t},A,U,b),children:[r,y.jsx(ZD,{runnerState:u.runnerState,record:u.executionRecord,currentStepIndex:u.currentStepIndex,onRun:B,onPause:u.pause,onStep:u.step,onStop:u.stop,onReset:u.reset,mode:u.mode,onModeChange:M,maxLoopIterations:u.maxLoopIterations,onMaxLoopIterationsChange:u.setMaxLoopIterations,onScrubTo:u.replayTo,onNavigateToNode:k,panelRef:h}),!S&&y.jsxs("button",{type:"button",onClick:()=>N(!0),className:"btn-press absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-lg border border-secondary-dark-gray/60 bg-secondary-black/90 px-4 py-2 text-[12px] font-medium text-primary-white shadow-xl backdrop-blur-sm transition-colors hover:bg-primary-dark-gray",title:"Open runner panel",children:[y.jsx(au,{className:"h-3.5 w-3.5"}),"Runner"]})]})}function Qb(e,t){const n=new Blob([e],{type:"application/json"}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function QD({state:e,dispatch:t,functionImplementations:n,onStateImported:r,onRecordingImported:i,onImportError:s}){const a=T.useRef(null),l=T.useRef(null),[u,d]=T.useState(0),f=T.useRef(null),g=T.useRef(null),h=T.useCallback(()=>{const D=bw(e,{pretty:!0});Qb(D,"graph-state.json")},[e]),m=T.useCallback(D=>{const $=Iw(D,{dataTypes:e.dataTypes,typeOfNodes:e.typeOfNodes,repair:{removeOrphanEdges:!0,removeDuplicateNodeIds:!0,removeDuplicateEdgeIds:!0,fillMissingDefaults:!0,rehydrateDataTypeObjects:!0}});if($.success){const F={...$.data,dataTypes:e.dataTypes,typeOfNodes:e.typeOfNodes};t({type:ft.REPLACE_STATE,payload:{state:F}}),d(E=>E+1),r?.(F)}else s?.($.errors.map(F=>`${F.path}: ${F.message}`))},[e.dataTypes,e.typeOfNodes,t,r,s]),x=T.useCallback(()=>{const D=a.current?.();if(!D)return;const $=Nw(D,{pretty:!0});Qb($,"execution-recording.json")},[]),v=T.useCallback(D=>{const $=Ew(D,{repair:{sanitizeNonSerializableValues:!0,removeOrphanSteps:!0}});if($.success){const F=l.current?.($.data);if(F&&!F.valid){s?.(F.errors);return}F?.warnings.length&&console.warn("Recording import warnings:",F.warnings),i?.($.data)}else s?.($.errors.map(F=>`${F.path}: ${F.message}`))},[i,s]),[b,S]=T.useState({isOpen:!1,position:{x:0,y:0}}),N=T.useMemo(()=>{const D=[];for(const $ of Object.keys(e.typeOfNodes)){if(!kr(e.typeOfNodes,$))continue;const F=e.typeOfNodes[$];F?.subtree!==void 0&&D.push({id:$,name:F.name})}return D},[e.typeOfNodes]),w=T.useMemo(()=>e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1],[e.openedNodeGroupStack]),{screenToFlowPosition:I,fitView:k}=Zo(),A=T.useCallback(()=>{S({isOpen:!1,position:{x:0,y:0}})},[]),M=T.useMemo(()=>[...mb({typeOfNodes:e.typeOfNodes,dispatch:t,setContextMenu:S,contextMenuPosition:I(b.position),currentNodeType:w?.nodeType,isRecursionAllowed:!e.enableRecursionChecking}),...MD({onExportState:h,onImportState:()=>f.current?.click(),onExportRecording:x,onImportRecording:()=>g.current?.click(),closeMenu:A})],[e.typeOfNodes,t,S,b.position,w?.nodeType,e.enableRecursionChecking,h,x,A,I]),B=T.useCallback(D=>{D.preventDefault();const $={x:D.clientX,y:D.clientY};S({isOpen:!0,position:$})},[]),U=T.useMemo(()=>Mt(e),[e.nodes,e.edges,e.openedNodeGroupStack,e.typeOfNodes]);T.useEffect(()=>{e.viewport===void 0&&(U.nodes.length>0?k({maxZoom:.5,minZoom:.1}):t({type:ft.SET_VIEWPORT,payload:{viewport:{x:0,y:0,zoom:.45}}}))},[e.viewport]);const q=y.jsxs(y.Fragment,{children:[y.jsxs(KR,{nodes:U.nodes,edges:U.edges,onNodesChange:D=>t({type:ft.UPDATE_NODE_BY_REACT_FLOW,payload:{changes:D}}),onEdgesChange:D=>t({type:ft.UPDATE_EDGES_BY_REACT_FLOW,payload:{changes:D}}),onConnect:D=>t({type:ft.ADD_EDGE_BY_REACT_FLOW,payload:{edge:D}}),maxZoom:1,minZoom:.1,proOptions:{hideAttribution:!0},colorMode:"dark",selectNodesOnDrag:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectionMode:Uo.Partial,nodeTypes:PD,edgeTypes:RD,deleteKeyCode:["Backspace","Delete","x"],connectionLineComponent:Hb,onContextMenu:B,onClick:A,viewport:e.viewport,onViewportChange:D=>t({type:ft.SET_VIEWPORT,payload:{viewport:D}}),onBeforeDelete:async({nodes:D,edges:$})=>{const F=Mt(e);return!!DL({...e,...F},D,$).validation.isValid},children:[y.jsx(lL,{}),y.jsx(nL,{}),y.jsx(SL,{pannable:!0})]},u),y.jsx(kD,{isOpen:b.isOpen,position:b.position,onClose:A,items:M}),y.jsx(OD,{nodeGroups:N,value:w?.nodeType??"",setValue:D=>{kr(e.typeOfNodes,D)&&t({type:ft.OPEN_NODE_GROUP,payload:{nodeType:D}})},handleAddNewGroup:()=>t({type:ft.ADD_NODE_GROUP}),enableBackButton:(e.openedNodeGroupStack?.length||0)>0,handleBack:()=>t({type:ft.CLOSE_NODE_GROUP}),openedNodeGroupStack:(e.openedNodeGroupStack||[]).map(D=>({id:D.nodeType+("nodeId"in D?D.nodeId:""),name:e.typeOfNodes[D.nodeType].name}))})]});return y.jsxs("div",{style:{width:"100%",height:"100%"},className:"relative",children:[n?y.jsx(Q2,{children:y.jsx(JD,{state:e,dispatch:t,functionImplementations:n,onExecutionRecordRef:a,loadRecordRef:l,children:q})}):q,y.jsx("input",{ref:f,type:"file",accept:".json",className:"hidden",onChange:D=>{const $=D.target.files?.[0];if(!$)return;const F=new FileReader;F.onload=E=>{const P=E.target?.result;typeof P=="string"&&m(P)},F.readAsText($),D.target.value=""}}),y.jsx("input",{ref:g,type:"file",accept:".json",className:"hidden",onChange:D=>{const $=D.target.files?.[0];if(!$)return;const F=new FileReader;F.onload=E=>{const P=E.target?.result;typeof P=="string"&&v(P)},F.readAsText($),D.target.value=""}})]})}function ej({state:e,dispatch:t,functionImplementations:n,onStateImported:r,onRecordingImported:i,onImportError:s,executionRecord:a,onExecutionRecordChange:l}){const u=T.useCallback(()=>{},[]),d=T.useMemo(()=>({executionRecord:a??null,setExecutionRecord:l??u}),[a,l,u]);return y.jsx(G0,{children:y.jsx(uo.Provider,{value:Sf({state:e,dispatch:t}),children:y.jsx(bf.Provider,{value:d,children:y.jsx(QD,{state:e,dispatch:t,functionImplementations:n,onStateImported:r,onRecordingImported:i,onImportError:s})})})})}const tt=["circle","square","rectangle","list","grid","diamond","trapezium","hexagon","star","cross","zigzag","sparkle","parallelogram"],Ct={[tt[0]]:tt[0],[tt[1]]:tt[1],[tt[2]]:tt[2],[tt[3]]:tt[3],[tt[4]]:tt[4],[tt[5]]:tt[5],[tt[6]]:tt[6],[tt[7]]:tt[7],[tt[8]]:tt[8],[tt[9]]:tt[9],[tt[10]]:tt[10],[tt[11]]:tt[11],[tt[12]]:tt[12]},tl=(e,t,n,r="black",i=2)=>y.jsxs("div",{className:ye("relative",n),children:[y.jsx("div",{className:"absolute",style:{top:-i,left:-i,right:-i,bottom:-i,backgroundColor:r,clipPath:e}}),y.jsx("div",{className:"absolute inset-0",style:{backgroundColor:t,clipPath:e}})]}),eS=(e=Ct.circle,t="#A1A1A1",n)=>{const r="border-2 border-black",i="border-1 border-black",s={backgroundColor:t};switch(e){case Ct.circle:return y.jsx("div",{className:ye("w-6 h-6 rounded-full",r,n),style:s});case Ct.square:return y.jsx("div",{className:ye("w-6 h-6",r,n),style:s});case Ct.rectangle:return y.jsx("div",{className:ye("w-4 h-8",r,n),style:s});case Ct.list:return y.jsx("div",{className:ye("w-6 h-6 flex flex-col justify-center gap-0.5",n),children:[0,1,2].map(a=>y.jsx("div",{className:ye("w-full h-2",i),style:s},a))});case Ct.grid:return y.jsx("div",{className:ye("w-6 h-6 grid grid-cols-2 gap-0.5",n),children:[0,1,2,3].map(a=>y.jsx("div",{className:ye("w-full h-full",i),style:s},a))});case Ct.diamond:return y.jsx("div",{className:ye("w-6 h-6 rotate-45",r,n),style:s});case Ct.trapezium:return tl("polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",t,ye("w-6 h-6",n));case Ct.hexagon:return tl("polygon(-50% 50%,50% 100%,150% 50%,50% 0)",t,ye("w-5 h-6",n));case Ct.star:return tl("polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",t,ye("w-6 h-6",n));case Ct.cross:return y.jsxs("div",{className:ye("w-6 h-6 relative",n),children:[y.jsx("div",{className:ye("absolute top-1/2 left-0 w-full h-2 -translate-y-1/2",i),style:s}),y.jsx("div",{className:ye("absolute left-1/2 top-0 w-2 h-full -translate-x-1/2",i),style:s})]});case Ct.zigzag:return y.jsx("div",{className:ye("w-6 h-6",n),style:{...s,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 Ct.sparkle:return y.jsx("div",{className:ye("w-6 h-6",n),style:{...s,mask:"radial-gradient(#0000 71%, #000 72%) 10000% 10000%/99.5% 99.5%",border:"2px solid black"}});case Ct.parallelogram:return tl("polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)",t,ye("w-6 h-6",n));default:return y.jsx("div",{className:ye("w-6 h-6 rounded-full",r,n),style:s})}},nl=T.forwardRef(({type:e,position:t,id:n,color:r,shape:i=Ct.circle,maxConnections:s,isCurrentlyInsideReactFlow:a=!1,className:l,...u},d)=>{const f=a?q0({handleId:n,handleType:e}):[];if(a){const g=s!==void 0?f.length<s:void 0;return y.jsx(ds,{type:e,position:t,id:n,className:ye("!w-6 !h-6 !border-none !bg-transparent !pointer-events-auto",l),style:{backgroundColor:"transparent"},isConnectable:g,isConnectableStart:g,isConnectableEnd:g,...u,ref:d,children:y.jsx("div",{className:ye("pointer-events-none flex justify-center"),children:eS(i,r||"#A1A1A1",l)})})}return y.jsx("div",{className:ye("absolute",t===Ne.Right&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",t===Ne.Left&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),...u,ref:d,children:eS(i,r||"#A1A1A1",l)})});nl.displayName="ContextAwareHandle";const ep=T.forwardRef(({className:e,...t},n)=>y.jsx(Cu,{"data-slot":"checkbox",className:ye("peer bg-primary-gray border-transparent data-[state=checked]:bg-primary-blue data-[state=checked]:text-primary-white focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-7 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:y.jsx(sm,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:y.jsx(sa,{className:"size-6",strokeWidth:3.5})})}));ep.displayName=Cu.displayName;const tS=({input:e})=>{const t=Zo(),n=us();return e.type==="string"?y.jsx(ws,{placeholder:e.name,value:e.value,onChange:r=>{e.onChange?.(r),t.setNodes(i=>i.map(s=>s.id===n?{...s,data:uf(s.data,e.id,{value:r},!0,!1,!1)}:s))},allowOnlyNumbers:!1,className:"w-full"}):e.type==="number"?y.jsx(ni,{name:e.name,value:e.value,onChange:r=>{e.onChange?.(r),t.setNodes(i=>i.map(s=>s.id===n?{...s,data:uf(s.data,e.id,{value:r},!0,!1,!1)}:s))},className:"w-full"}):e.type==="boolean"?y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[y.jsx(ep,{checked:e.value,onCheckedChange:r=>{r!=="indeterminate"&&(e.onChange?.(r),t.setNodes(i=>i.map(s=>s.id===n?{...s,data:uf(s.data,e.id,{value:r},!0,!1,!1)}:s)))}}),y.jsx("p",{className:"text-primary-white text-[27px] leading-[27px] font-main truncate",children:e.name})]}):null},nS=({input:e,isCurrentlyInsideReactFlow:t})=>t?y.jsx(tS,{input:e}):e.type==="string"?y.jsx(ws,{placeholder:e.name,value:e.value,onChange:e.onChange,allowOnlyNumbers:!1,className:"w-full"}):e.type==="number"?y.jsx(ni,{name:e.name,value:e.value,onChange:e.onChange,className:"w-full"}):e.type==="boolean"?y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[y.jsx(ep,{checked:e.value,onCheckedChange:n=>{n!=="indeterminate"&&e.onChange?.(n)}}),y.jsx("p",{className:"text-primary-white text-[27px] leading-[27px] font-main truncate",children:e.name})]}):null,rS=({})=>{const e=T.useContext(uo),t=us(),n=()=>{e?.allProps?.dispatch&&t&&e.allProps.dispatch({type:ft.OPEN_NODE_GROUP,payload:{nodeId:t}})};return y.jsx(eg,{strokeWidth:2.5,className:"shrink-0 w-7 h-7 aspect-square cursor-pointer hover:opacity-80",onClick:n})},oS=({showButton:e=!1,isCurrentlyInsideReactFlow:t})=>e?t?y.jsx(rS,{}):y.jsx(eg,{strokeWidth:2.5,className:"shrink-0 w-7 h-7 aspect-square cursor-pointer hover:opacity-80"}):y.jsx(y.Fragment,{}),tp=T.forwardRef(({input:e,isCurrentlyInsideReactFlow:t,hide:n=!1},r)=>{const i=t?q0({handleId:e.id}):[],s=t&&i.some(l=>l.targetHandle===e.id),a=e.allowInput&&!s;return y.jsxs("div",{ref:r,className:ye("text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row py-3",n&&"h-0 overflow-hidden py-0",a&&"py-1"),children:[y.jsx(nl,{type:"target",position:Ne.Left,id:e.id,color:e.handleColor,shape:e.handleShape,maxConnections:e.maxConnections,isCurrentlyInsideReactFlow:t}),y.jsxs("div",{className:"flex-1 flex items-center gap-3 w-full",children:[!a&&y.jsx("div",{className:"truncate",children:e.name||""}),a&&y.jsx("div",{className:"flex-1 w-full",children:y.jsx(nS,{input:e,isCurrentlyInsideReactFlow:t})})]})]},e.id)});tp.displayName="RenderInput";const iS=T.forwardRef(({output:e,isCurrentlyInsideReactFlow:t},n)=>y.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:[y.jsx("div",{className:"truncate text-right",children:e.name||""}),y.jsx(nl,{type:"source",position:Ne.Right,id:e.id,color:e.handleColor,shape:e.handleShape,maxConnections:e.maxConnections,isCurrentlyInsideReactFlow:t})]},e.id));iS.displayName="RenderOutput";const sS=T.forwardRef(({panel:e,isCurrentlyInsideReactFlow:t,isOpen:n,onToggle:r},i)=>y.jsxs("div",{ref:i,className:"flex flex-col",children:[y.jsxs(Qn,{onClick:s=>{s.stopPropagation(),s.preventDefault(),r()},className:"bg-transparent border-none hover:bg-primary-gray rounded-none justify-start",children:[n?y.jsx(su,{className:"w-6 h-6 shrink-0 mr-2"}):y.jsx(Ei,{className:"w-6 h-6 shrink-0 mr-2"}),y.jsx("span",{className:"truncate",children:e.name})]}),y.jsx("div",{className:ye("flex flex-col bg-[#272727]",!n&&"h-0 overflow-hidden"),children:e.inputs.map(s=>y.jsx(tp,{input:s,isCurrentlyInsideReactFlow:t,hide:!n},s.id))})]},e.id));sS.displayName="RenderInputPanel";const np=T.forwardRef(({id:e,name:t="Node",headerColor:n="#79461D",inputs:r=[],outputs:i=[],isCurrentlyInsideReactFlow:s=!1,className:a,nodeResizerProps:l={},nodeTypeUniqueId:u,showNodeOpenButton:d=!1,runnerVisualState:f,runnerErrors:g,runnerWarnings:h,...m},x)=>{const[v,b]=T.useState(new Set),S=T.useContext(uo),N=I=>{b(k=>{const A=new Set(k);return A.has(I)?A.delete(I):A.add(I),A})},w=y.jsxs("div",{tabIndex:0,className:ye("flex flex-col gap-0 rounded-md w-max border-[1.5px] border-transparent focus:border-white","in-[.selected]:border-white",a),...m,ref:x,children:[y.jsxs("div",{className:`text-primary-white text-left text-[27px] leading-[27px] font-main \\
|
|
305
|
-
px-4 transition-all rounded-t-md truncate flex justify-between items-center`,style:{backgroundColor:n},children:[y.jsx("p",{className:"truncate py-2",children:t}),S?.allProps?.state?.enableDebugMode&&y.jsx("p",{className:"shrink-0 py-2",children:e}),y.jsx(oS,{showButton:d,isCurrentlyInsideReactFlow:s})]}),y.jsxs("div",{className:"min-h-[50px] rounded-b-md bg-primary-dark-gray",children:[s&&y.jsx(kw,{...l}),y.jsx("div",{className:"flex flex-col py-4",children:i.map(I=>y.jsx(iS,{output:I,isCurrentlyInsideReactFlow:s},I.id))}),y.jsx("div",{className:"flex flex-col py-4",children:r.map(I=>{if("inputs"in I){const k=v.has(I.id);return y.jsx(sS,{panel:I,isCurrentlyInsideReactFlow:s,isOpen:k,onToggle:()=>N(I.id)},I.id)}else return y.jsx(tp,{input:I,isCurrentlyInsideReactFlow:s},I.id)})})]})]});return f!==void 0?y.jsx(ab,{visualState:f,errors:g,warnings:h,children:w}):w});np.displayName="ConfigurableNode";const rp=T.forwardRef(({data:e={},id:t},n)=>{const i=T.useContext(uo)?.nodeRunnerStates?.get(t);return y.jsx(np,{isCurrentlyInsideReactFlow:!0,id:t,className:"w-full",...e,runnerVisualState:i?.visualState,runnerErrors:i?.errors,runnerWarnings:i?.warnings,ref:n})});rp.displayName="ConfigurableNodeReactFlowWrapper",fe.Accordion=Fy,fe.AccordionContent=od,fe.AccordionItem=nd,fe.AccordionTrigger=rd,fe.Button=Qn,fe.ButtonToggle=zf,fe.ConfigurableEdge=_f,fe.ConfigurableNode=np,fe.ConfigurableNodeReactFlowWrapper=rp,fe.ContextAwareHandle=nl,fe.ContextAwareInput=nS,fe.ContextAwareOpenButton=oS,fe.ContextMenu=pb,fe.ExecutionStepInspector=$b,fe.ExecutionTimeline=jb,fe.FullGraph=ej,fe.FullGraphContext=uo,fe.Input=ws,fe.NodeResizerWithMoreControls=kw,fe.NodeStatusIndicator=ab,fe.ReactFlowAwareInput=tS,fe.ReactFlowAwareOpenButton=rS,fe.RecordContext=bf,fe.RunControls=wb,fe.ScrollableButtonContainer=Rf,fe.Select=yb,fe.SelectContent=Vf,fe.SelectGroup=X2,fe.SelectItem=qc,fe.SelectLabel=vb,fe.SelectScrollDownButton=Bf,fe.SelectScrollUpButton=Hf,fe.SelectSeparator=xb,fe.SelectTrigger=$f,fe.SelectValue=Ff,fe.SliderNumberInput=ni,fe.Tooltip=sn,fe.actionTypesMap=ft,fe.addAnInputOrOutputToAllNodesOfANodeTypeAcrossStateIncludingSubtrees=dw,fe.addEdgeWithTypeChecking=aw,fe.cn=ye,fe.constructInputOrOutputOfType=Tr,fe.constructInputPanelOfType=J0,fe.constructNodeOfType=ps,fe.constructTypeOfHandleFromIndices=Cr,fe.convertStringToNumber=Gy,fe.createContextValue=Sf,fe.createNodeContextMenu=mb,fe.deserializeExecutionRecord=vf,fe.deserializeGraphError=mf,fe.exportExecutionRecord=Nw,fe.exportGraphState=bw,fe.getAllDependenciesOfNodeTypeRecursively=EL,fe.getAllDependentsOfNodeTypeRecursively=ew,fe.getCurrentNodesAndEdgesFromState=Mt,fe.getDependencyGraphBetweenNodeTypes=hs,fe.getDirectDependenciesOfNodeType=Q0,fe.getDirectDependentsOfNodeType=af,fe.getResultantDataTypeOfHandleConsideringInferredType=lo,fe.groupNodeContextMenu=ow,fe.handleShapesMap=Ct,fe.importExecutionRecord=Ew,fe.importGraphState=Iw,fe.isCoordinateInBox=Wy,fe.isNumberInRange=id,fe.isSupportedUnderlyingType=uC,fe.isValidDataTypeId=fC,fe.loopEndInputInferHandleIndex=Lc,fe.loopEndOutputInferHandleIndex=Dc,fe.loopStartInputInferHandleIndex=Mc,fe.loopStartOutputInferHandleIndex=Oc,fe.loopStopInputInferHandleIndex=Pc,fe.loopStopOutputInferHandleIndex=Rc,fe.mainReducer=fw,fe.makeAllowedConversionsBetweenDataTypesWithAutoInfer=hC,fe.makeDataTypeWithAutoInfer=dC,fe.makeStateWithAutoInfer=gC,fe.makeTypeOfNodeWithAutoInfer=pC,fe.mapToRecord=hf,fe.recordToReadonlyMap=vs,fe.removeEdgeWithTypeChecking=cw,fe.safeSerializeValue=Vn,fe.sanitizeNumberToShowAsText=sd,fe.serializeExecutionRecord=yf,fe.serializeGraphError=gf,fe.setCurrentNodesAndEdgesToStateWithMutatingState=so,fe.standardDataTypeNames=ir,fe.standardDataTypeNamesMap=ze,fe.standardDataTypes=ML,fe.standardNodeContextMenu=Qo,fe.standardNodeTypeNames=In,fe.standardNodeTypeNamesMap=Te,fe.standardNodeTypes=OL,fe.supportedUnderlyingTypesMap=qy,fe.useAutoScroll=cb,fe.useClickedOutside=Aw,fe.useDrag=lb,fe.useFloatingTooltip=ob,fe.useFullGraph=JL,fe.useRecordContext=Tw,fe.useResizeHandle=Jb,fe.useSlideAnimation=Qf,fe.validateExecutionRecordStructure=mw,fe.validateGraphStateStructure=pw,fe.willAddingEdgeCreateCycle=lw,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
|