funcnodes-react-flow 0.3.10__py3-none-any.whl → 0.3.11__py3-none-any.whl

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.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var k=(g||(g=1,y.exports=function(){if(m)return v;m=1;var e=l(),t=x(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return v.useSyncExternalStoreWithSelector=function(e,t,l,c,u){var d=o(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=a((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,l,c,u]);var p=r(e,d[0],d[1]);return i((function(){f.hasValue=!0,f.value=p}),[p]),s(p),p},v}()),y.exports),S=t(k);const{useDebugValue:E}=c,{useSyncExternalStoreWithSelector:_}=S;let C=!1;const O=e=>e;const N=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?f(e):e,n=(e,n)=>function(e,t=O,n){n&&!C&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),C=!0);const r=_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(r),r}(t,e,n);return Object.assign(n,t),n},P=e=>e?N(e):N;function R(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(e.constructor===Object||e.constructor===Array){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){if(!r.includes(o))return!1;if(!M(e[o],t[o]))return!1}}return!(e instanceof Date&&t instanceof Date)||e.getTime()===t.getTime()}const T=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(R(i)&&R(a)){const{new_obj:e,change:t}=T(a,i);t&&(n=!0,r[o]=e)}else M(a,i)||(n=!0,r[o]=i)})),{new_obj:r,change:n}},A=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(void 0!==a||void 0!==i){if(void 0===a)return n=!0,void(r[o]=i);if(R(i)&&R(a)){const{new_obj:e,change:t}=A(a,i);t&&(n=!0,r[o]=e)}}})),{new_obj:r,change:n}},D={id:"dummy",name:"dummy",node:"dummy",full_id:"dummy",type:"any",value:void 0,is_input:!1,connected:!1,does_trigger:!0,fullvalue:void 0,try_get_full_value:void 0,render_options:{set_default:!0,type:"any"},set_hidden:void 0,hidden:!1},I=e=>{if(!e.id)throw new Error("IO must have an id but is missing for "+JSON.stringify(e));void 0===e.name&&(e.name=e.id);const{new_obj:t}=A(e,D);return"any"!==t.render_options.type&&void 0!==t.render_options.type||(t.render_options.type=t.type),t},L={id:"dummy",node_name:"dummy",frontend:{pos:[NaN,NaN],size:[200,100],collapsed:!1},io:{},name:"dummy",in_trigger:!1,io_order:[],progress:{ascii:!1,elapsed:0,initial:0,n:0,prefix:"idle",unit:"it",unit_divisor:1e3,unit_scale:!1}},z=JSON.stringify(L),F=e=>{if(!e.id)throw new Error("Node must have an id");const t=JSON.parse(z),{new_obj:n}=A(e,t);for(const e in n.io){if(void 0===n.io[e])continue;const t=I(n.io[e]);n.io[e]=t}return n},j=e=>{if(void 0===e.io&&(e.io={}),void 0===e.io_order)if(Array.isArray(e.io)){e.io_order=e.io.map((e=>e.id));const t={};for(const n of e.io)t[n.id]=n;e.io=t}else e.io_order=Object.keys(e.io);else if(Array.isArray(e.io)){const t={};for(const n of e.io)t[n.id]=n,e.io_order.includes(n.id)||e.io_order.push(n.id);e.io=t}else for(const t in e.io)e.io_order.includes(t)||e.io_order.push(t);return e};function $(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=$(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:B}=c,{useSyncExternalStoreWithSelector:V}=S,H=e=>e;function U(e,t=H,n){const r=V(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return B(r),r}const W=(e,t)=>{const n=f(e),r=(e,r=t)=>U(n,e,r);return Object.assign(r,n),r};function q(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var K={value:()=>{}};function X(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new Y(r)}function Y(e){this._=e}function G(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Q(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=K,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}Y.prototype=X.prototype={constructor:Y,on:function(e,t){var n,r=this._,o=function(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",r=e.indexOf(".");if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=Q(r[n],e.name,t);else if(null==t)for(n in r)r[n]=Q(r[n],e.name,null);return this}for(;++i<a;)if((n=(e=o[i]).type)&&(n=G(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Y(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var Z="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),J.hasOwnProperty(t)?{space:J[t],local:e}:e}function te(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Z&&t.documentElement.namespaceURI===Z?t.createElement(e):t.createElementNS(n,e)}}function ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function re(e){var t=ee(e);return(t.local?ne:te)(t)}function oe(){}function ie(e){return null==e?oe:function(){return this.querySelector(e)}}function ae(){return[]}function le(e){return null==e?ae:function(){return this.querySelectorAll(e)}}function se(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ce(e){return function(){return this.matches(e)}}function ue(e){return function(t){return t.matches(e)}}var de=Array.prototype.find;function fe(){return this.firstElementChild}var pe=Array.prototype.filter;function he(){return Array.from(this.children)}function me(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ye(e,t,n,r,o,i){for(var a,l=0,s=t.length,c=i.length;l<c;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new ge(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function ve(e,t,n,r,o,i,a){var l,s,c,u=new Map,d=t.length,f=i.length,p=new Array(d);for(l=0;l<d;++l)(s=t[l])&&(p[l]=c=a.call(s,s.__data__,l,t)+"",u.has(c)?o[l]=s:u.set(c,s));for(l=0;l<f;++l)c=a.call(e,i[l],l,i)+"",(s=u.get(c))?(r[l]=s,s.__data__=i[l],u.delete(c)):n[l]=new ge(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&u.get(p[l])===s&&(o[l]=s)}function be(e){return e.__data__}function we(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ke(e){return function(){this.removeAttribute(e)}}function Se(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ee(e,t){return function(){this.setAttribute(e,t)}}function _e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ce(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Oe(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ne(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Pe(e){return function(){this.style.removeProperty(e)}}function Re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Me(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Te(e,t){return e.style.getPropertyValue(t)||Ne(e).getComputedStyle(e,null).getPropertyValue(t)}function Ae(e){return function(){delete this[e]}}function De(e,t){return function(){this[e]=t}}function Ie(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Le(e){return e.trim().split(/^|\s+/)}function ze(e){return e.classList||new Fe(e)}function Fe(e){this._node=e,this._names=Le(e.getAttribute("class")||"")}function je(e,t){for(var n=ze(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function $e(e,t){for(var n=ze(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Be(e){return function(){je(this,e)}}function Ve(e){return function(){$e(this,e)}}function He(e,t){return function(){(t.apply(this,arguments)?je:$e)(this,e)}}function Ue(){this.textContent=""}function We(e){return function(){this.textContent=e}}function qe(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Ke(){this.innerHTML=""}function Xe(e){return function(){this.innerHTML=e}}function Ye(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ge(){this.nextSibling&&this.parentNode.appendChild(this)}function Qe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ze(){return null}function Je(){var e=this.parentNode;e&&e.removeChild(this)}function et(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nt(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function rt(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ot(e,t,n){var r=Ne(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function it(e,t){return function(){return ot(this,e,t)}}function at(e,t){return function(){return ot(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,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)}},Fe.prototype={add:function(e){this._names.indexOf(e)<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}};var lt=[null];function st(e,t){this._groups=e,this._parents=t}function ct(){return new st([[document.documentElement]],lt)}function ut(e){return"string"==typeof e?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],lt)}function dt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}st.prototype=ct.prototype={constructor:st,select:function(e){"function"!=typeof e&&(e=ie(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,c=r[o]=new Array(s),u=0;u<s;++u)(i=l[u])&&(a=e.call(i,i.__data__,u,l))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new st(r,this._parents)},selectAll:function(e){e="function"==typeof e?se(e):le(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,l=t[i],s=l.length,c=0;c<s;++c)(a=l[c])&&(r.push(e.call(a,a.__data__,c,l)),o.push(a));return new st(r,o)},selectChild:function(e){return this.select(null==e?fe:function(e){return function(){return de.call(this.children,e)}}("function"==typeof e?e:ue(e)))},selectChildren:function(e){return this.selectAll(null==e?he:function(e){return function(){return pe.call(this.children,e)}}("function"==typeof e?e:ue(e)))},filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new st(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,be);var n,r=t?ve:ye,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,l=new Array(a),s=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],f=i[u],p=f.length,h=we(e.call(d,d&&d.__data__,u,o)),m=h.length,g=s[u]=new Array(m),y=l[u]=new Array(m);r(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(l=new st(l,o))._enter=s,l._exit=c,l},enter:function(){return new st(this._enter||this._groups.map(me),this._parents)},exit:function(){return new st(this._exit||this._groups.map(me),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),l=new Array(o),s=0;s<a;++s)for(var c,u=n[s],d=r[s],f=u.length,p=l[s]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;s<o;++s)l[s]=n[s];return new st(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,c=o[i]=new Array(s),u=0;u<s;++u)(a=l[u])&&(c[u]=a);c.sort(t)}return new st(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Se:ke:"function"==typeof t?n.local?Oe:Ce:n.local?_e:Ee)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Pe:"function"==typeof t?Me:Re)(e,t,null==n?"":n)):Te(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Ae:"function"==typeof t?Ie:De)(e,t)):this.node()[e]},classed:function(e,t){var n=Le(e+"");if(arguments.length<2){for(var r=ze(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?He:t?Be:Ve)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ue:("function"==typeof e?qe:We)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Ke:("function"==typeof e?Ye:Xe)(e)):this.node().innerHTML},raise:function(){return this.each(Ge)},lower:function(){return this.each(Qe)},append:function(e){var t="function"==typeof e?e:re(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:re(e),r=null==t?Ze:"function"==typeof t?t:ie(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Je)},clone:function(e){return this.select(e?tt:et)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(l=t?rt:nt,r=0;r<a;++r)this.each(l(i[r],t,n));return this}var l=this.node().__on;if(l)for(var s,c=0,u=l.length;c<u;++c)for(r=0,s=l[c];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value},dispatch:function(e,t){return this.each(("function"==typeof t?at:it)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const ft={passive:!1},pt={capture:!0,passive:!1};function ht(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function gt(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",mt,pt);"onselectstart"in t?n.on("selectstart.drag",mt,pt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yt(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",mt,pt),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var vt=e=>()=>e;function bt(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:l,dx:s,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function wt(e){return!e.ctrlKey&&!e.button}function xt(){return this.parentNode}function kt(e,t){return null==t?{x:e.x,y:e.y}:t}function St(){return navigator.maxTouchPoints||"ontouchstart"in this}function Et(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _t(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ct(){}bt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Ot=.7,Nt=1/Ot,Pt="\\s*([+-]?\\d+)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tt=/^#([0-9a-f]{3,8})$/,At=new RegExp(`^rgb\\(${Pt},${Pt},${Pt}\\)$`),Dt=new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`),It=new RegExp(`^rgba\\(${Pt},${Pt},${Pt},${Rt}\\)$`),Lt=new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${Rt}\\)$`),zt=new RegExp(`^hsl\\(${Rt},${Mt},${Mt}\\)$`),Ft=new RegExp(`^hsla\\(${Rt},${Mt},${Mt},${Rt}\\)$`),jt={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};function $t(){return this.rgb().formatHex()}function Bt(){return this.rgb().formatRgb()}function Vt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ht(t):3===n?new qt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ut(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ut(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=At.exec(e))?new qt(t[1],t[2],t[3],1):(t=Dt.exec(e))?new qt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=It.exec(e))?Ut(t[1],t[2],t[3],t[4]):(t=Lt.exec(e))?Ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=zt.exec(e))?Zt(t[1],t[2]/100,t[3]/100,1):(t=Ft.exec(e))?Zt(t[1],t[2]/100,t[3]/100,t[4]):jt.hasOwnProperty(e)?Ht(jt[e]):"transparent"===e?new qt(NaN,NaN,NaN,0):null}function Ht(e){return new qt(e>>16&255,e>>8&255,255&e,1)}function Ut(e,t,n,r){return r<=0&&(e=t=n=NaN),new qt(e,t,n,r)}function Wt(e,t,n,r){return 1===arguments.length?((o=e)instanceof Ct||(o=Vt(o)),o?new qt((o=o.rgb()).r,o.g,o.b,o.opacity):new qt):new qt(e,t,n,null==r?1:r);var o}function qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Kt(){return`#${Qt(this.r)}${Qt(this.g)}${Qt(this.b)}`}function Xt(){const e=Yt(this.opacity);return`${1===e?"rgb(":"rgba("}${Gt(this.r)}, ${Gt(this.g)}, ${Gt(this.b)}${1===e?")":`, ${e})`}`}function Yt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qt(e){return((e=Gt(e))<16?"0":"")+e.toString(16)}function Zt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,r)}function Jt(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof Ct||(e=Vt(e)),!e)return new en;if(e instanceof en)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+6*(n<r):n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new en(a,l,s,e.opacity)}function en(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tn(e){return(e=(e||0)%360)<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Et(Ct,Vt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$t,formatHex:$t,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Jt(this).formatHsl()},formatRgb:Bt,toString:Bt}),Et(qt,Wt,_t(Ct,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ot:Math.pow(Ot,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qt(Gt(this.r),Gt(this.g),Gt(this.b),Yt(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:Kt,formatHex:Kt,formatHex8:function(){return`#${Qt(this.r)}${Qt(this.g)}${Qt(this.b)}${Qt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Xt,toString:Xt})),Et(en,(function(e,t,n,r){return 1===arguments.length?Jt(e):new en(e,t,n,null==r?1:r)}),_t(Ct,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ot:Math.pow(Ot,e),new en(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new qt(rn(e>=240?e-240:e+120,o,r),rn(e,o,r),rn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new en(tn(this.h),nn(this.s),nn(this.l),Yt(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=Yt(this.opacity);return`${1===e?"hsl(":"hsla("}${tn(this.h)}, ${100*nn(this.s)}%, ${100*nn(this.l)}%${1===e?")":`, ${e})`}`}}));var on=e=>()=>e;function an(e){return 1==(e=+e)?ln:function(t,n){return n-t?function(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)}}(t,n,e):on(isNaN(t)?n:t)}}function ln(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):on(isNaN(e)?t:e)}var sn=function e(t){var n=an(t);function r(e,t){var r=n((e=Wt(e)).r,(t=Wt(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=ln(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function cn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dn=new RegExp(un.source,"g");function fn(e,t){var n,r,o,i=un.lastIndex=dn.lastIndex=0,a=-1,l=[],s=[];for(e+="",t+="";(n=un.exec(e))&&(r=dn.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:cn(n,r)})),i=dn.lastIndex;return i<t.length&&(o=t.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var n,r=0;r<t;++r)l[(n=s[r]).i]=n.x(e);return l.join("")})}var pn,hn=180/Math.PI,mn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gn(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*hn,skewX:Math.atan(s)*hn,scaleX:a,scaleY:l}}function yn(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l=[],s=[];return i=e(i),a=e(a),function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:cn(e,o)},{i:s-2,x:cn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,l,s),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:cn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,l,s),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:cn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,l,s),function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:cn(e,n)},{i:l-2,x:cn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,l,s),i=a=null,function(e){for(var t,n=-1,r=s.length;++n<r;)l[(t=s[n]).i]=t.x(e);return l.join("")}}}var vn=yn((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mn:gn(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),bn=yn((function(e){return null==e?mn:(pn||(pn=document.createElementNS("http://www.w3.org/2000/svg","g")),pn.setAttribute("transform",e),(e=pn.transform.baseVal.consolidate())?gn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):mn)}),", ",")",")");function wn(e){return((e=Math.exp(e))+1/e)/2}var xn,kn,Sn=function e(t,n,r){function o(e,o){var i,a,l=e[0],s=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-l,h=d-s,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[l+e*p,s+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-b)/t,i=function(e){var r,o=e*a,i=wn(b),u=c/(n*g)*(i*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[l+u*p,s+u*h,c*i/wn(t*o+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),En=0,_n=0,Cn=0,On=0,Nn=0,Pn=0,Rn="object"==typeof performance&&performance.now?performance:Date,Mn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tn(){return Nn||(Mn(An),Nn=Rn.now()+Pn)}function An(){Nn=0}function Dn(){this._call=this._time=this._next=null}function In(e,t,n){var r=new Dn;return r.restart(e,t,n),r}function Ln(){Nn=(On=Rn.now())+Pn,En=_n=0;try{!function(){Tn(),++En;for(var e,t=xn;t;)(e=Nn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--En}()}finally{En=0,function(){var e,t,n=xn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:xn=t);kn=e,Fn(r)}(),Nn=0}}function zn(){var e=Rn.now(),t=e-On;t>1e3&&(Pn-=t,On=e)}function Fn(e){En||(_n&&(_n=clearTimeout(_n)),e-Nn>24?(e<1/0&&(_n=setTimeout(Ln,e-Rn.now()-Pn)),Cn&&(Cn=clearInterval(Cn))):(Cn||(On=Rn.now(),Cn=setInterval(zn,1e3)),En=1,Mn(Ln)))}function jn(e,t,n){var r=new Dn;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}Dn.prototype=In.prototype={constructor:Dn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Tn():+n)+(null==t?0:+t),this._next||kn===this||(kn?kn._next=this:xn=this,kn=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};var $n=X("start","end","cancel","interrupt"),Bn=[];function Vn(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,f;if(1!==n.state)return s();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return jn(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(jn((function(){3===n.state&&(n.state=4,n.timer.restart(l,n.delay,n.time),l(i))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function l(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=In(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:$n,tween:Bn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Hn(e,t){var n=Wn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Un(e,t){var n=Wn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Wn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function Kn(e,t){var n,r;return function(){var o=Un(this,e),i=o.tween;if(i!==n)for(var a=0,l=(r=n=i).length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Xn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Un(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,c=o.length;s<c;++s)if(o[s].name===t){o[s]=l;break}s===c&&o.push(l)}i.tween=o}}function Yn(e,t,n){var r=e._id;return e.each((function(){var e=Un(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return Wn(e,r).value[t]}}function Gn(e,t){var n;return("number"==typeof t?cn:t instanceof Vt?sn:(n=Vt(t))?(t=n,sn):fn)(e,t)}function Qn(e){return function(){this.removeAttribute(e)}}function Zn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function er(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function tr(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttribute(e)}}function nr(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttributeNS(e.space,e.local)}}function rr(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function or(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function ir(e,t){return function(){Hn(this,e).delay=+t.apply(this,arguments)}}function ar(e,t){return t=+t,function(){Hn(this,e).delay=t}}function lr(e,t){return function(){Un(this,e).duration=+t.apply(this,arguments)}}function sr(e,t){return t=+t,function(){Un(this,e).duration=t}}var cr=ct.prototype.constructor;function ur(e){return function(){this.style.removeProperty(e)}}var dr=0;function fr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function pr(){return++dr}var hr=ct.prototype;fr.prototype={constructor:fr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ie(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var l,s,c=r[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(l=c[f])&&(s=e.call(l,l.__data__,f,c))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,Vn(d[f],t,n,f,d,Wn(l,n)));return new fr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=le(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,c=r[l],u=c.length,d=0;d<u;++d)if(s=c[d]){for(var f,p=e.call(s,s.__data__,d,c),h=Wn(s,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Vn(f,t,n,m,p,h);i.push(p),a.push(s)}return new fr(i,a,t,n)},selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new fr(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),l=0;l<i;++l)for(var s,c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),p=0;p<d;++p)(s=c[p]||u[p])&&(f[p]=s);for(;l<r;++l)a[l]=t[l];return new fr(a,this._parents,this._name,this._id)},selection:function(){return new cr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=pr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)if(a=l[c]){var u=Wn(a,t);Vn(a,e,n,c,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fr(r,this._parents,e,n)},call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:function(e,t){var n=this._id;return arguments.length<2?Wn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Hn:Un;return function(){var a=i(this,e),l=a.on;l!==r&&(o=(r=l).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=ee(e),r="transform"===n?bn:Gn;return this.attrTween(e,"function"==typeof t?(n.local?nr:tr)(n,r,Yn(this,"attr."+e,t)):null==t?(n.local?Zn:Qn)(n):(n.local?er:Jn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=ee(e);return this.tween(n,(r.local?rr:or)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?vn:Gn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Te(this,e),a=(this.style.removeProperty(e),Te(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,ur(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Te(this,e),l=n(this),s=l+"";return null==l&&(this.style.removeProperty(e),s=l=Te(this,e)),a===s?null:a===r&&s===o?i:(o=s,i=t(r=a,l))}}(e,r,Yn(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,l="end."+a;return function(){var s=Un(this,e),c=s.on,u=null==s.value[a]?i||(i=ur(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(l,o=u),s.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Te(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Yn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Wn(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?Kn:Xn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ir:ar)(t,e)):Wn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?lr:sr)(t,e)):Wn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Un(this,e).ease=t}}(t,e)):Wn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Un(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each((function(){var n=Un(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t})),0===o&&i()}))},[Symbol.iterator]:hr[Symbol.iterator]};var mr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function gr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}ct.prototype.interrupt=function(e){return this.each((function(){qn(this,e)}))},ct.prototype.transition=function(e){var t,n;e instanceof fr?(t=e._id,e=e._name):(t=pr(),(n=mr).time=Tn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)(a=l[c])&&Vn(a,e,t,c,l,n||gr(a,t));return new fr(r,this._parents,e,t)};var yr=e=>()=>e;function vr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function br(e,t,n){this.k=e,this.x=t,this.y=n}br.prototype={constructor:br,scale:function(e){return 1===e?this:new br(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new br(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 wr=new br(1,0,0);function xr(e){e.stopImmediatePropagation()}function kr(e){e.preventDefault(),e.stopImmediatePropagation()}function Sr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Er(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 _r(){return this.__zoom||wr}function Cr(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Or(){return navigator.maxTouchPoints||"ontouchstart"in this}function Nr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Pr(){var e,t,n,r=Sr,o=Er,i=Nr,a=Cr,l=Or,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Sn,f=X("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",_r).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",E).filter(l).on("touchstart.zoom",_).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new br(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new br(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=w(e,i).event(r),l=o.apply(e,i),s=null==n?v(l):"function"==typeof n?n.apply(e,i):n,c=Math.max(l[1][0]-l[0][0],l[1][1]-l[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,p=d(u.invert(s).concat(c/u.k),f.invert(s).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new br(n,s[0]-t[0]*n,s[1]-t[1]*n)}a.zoom(null,e)}}))}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=dt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[u,o.invert(u)],qn(this),n.start()}kr(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",i(y(g(o,l),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),l=ut(e.view).on("mousemove.zoom",(function(e){if(kr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=dt(e,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(e){l.on("mousemove.zoom mouseup.zoom",null),yt(e.view,a.moved),kr(e),a.event(e).end()}),!0),s=dt(e,o),u=e.clientX,d=e.clientY;gt(e.view),xr(e),a.mouse=[s,this.__zoom.invert(s)],qn(this),a.start()}}function E(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=dt(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(y(g(n,s),a,l),o.apply(this,t),c);kr(e),u>0?ut(this).transition().duration(u).call(b,d,a,e):ut(this).call(m.transform,d,a,e)}}function _(n,...o){if(r.apply(this,arguments)){var i,a,l,s,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(xr(n),a=0;a<u;++a)s=[s=dt(l=c[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout((function(){e=null}),500)),qn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,r,o,a,l=w(this,t).event(e),s=e.changedTouches,u=s.length;for(kr(e),n=0;n<u;++n)o=dt(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],p=l.touch1[0],h=l.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(y(r,o,a),l.extent,c))}}function O(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),l=e.changedTouches,s=l.length;for(xr(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),o=0;o<s;++o)i=l[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=dt(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=ut(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",_r),e!==o?b(e,t,n,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,r){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,s),a,l),e,c)}),n,r)},m.translateBy=function(e,t,n,r){m.transform(e,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,(function(){var e=o.apply(this,arguments),a=this.__zoom,l=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return i(wr.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),r,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ut(this.that).datum();f.call(e,this.that,new vr(e,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:yr(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:yr(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:yr(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:yr([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}br.prototype;var Rr,Mr,Tr={exports:{}},Ar={};function Dr(){if(Rr)return Ar;Rr=1;var e=l();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return Ar.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ar.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},Ar.flushSync=function(e){var t=i.T,n=r.p;try{if(i.T=null,r.p=2,e)return e()}finally{i.T=t,r.p=n,r.d.f()}},Ar.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},Ar.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},Ar.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,l="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:l}):"script"===n&&r.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:l,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},Ar.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},Ar.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},Ar.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},Ar.requestFormReset=function(e){r.d.r(e)},Ar.unstable_batchedUpdates=function(e,t){return e(t)},Ar.useFormState=function(e,t,n){return i.H.useFormState(e,t,n)},Ar.useFormStatus=function(){return i.H.useHostTransitionStatus()},Ar.version="19.0.0",Ar}function Ir(){if(Mr)return Tr.exports;return Mr=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),Tr.exports=Dr(),Tr.exports}var Lr=Ir(),zr=t(Lr);const Fr=s.createContext(null),jr=Fr.Provider,$r=e=>`Node type "${e}" not found. Using fallback type "default".`,Br=()=>"The React Flow parent container needs a width and a height to render the graph.",Vr=()=>"Only child nodes can use a parent extent.",Hr=e=>`Marker type "${e}" doesn't exist.`,Ur=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Wr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",qr=e=>`Edge type "${e}" not found. Using fallback type "default".`,Kr=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.`,Xr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Yr(e,t){const n=s.useContext(Fr);if(null===n)throw new Error(Xr);return U(n,e,t)}const Gr=()=>{const e=s.useContext(Fr);if(null===e)throw new Error(Xr);return s.useMemo((()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy})),[e])},Qr=e=>e.userSelectionActive?"none":"all";function Zr({position:e,children:t,className:n,style:r,...o}){const i=Yr(Qr),a=`${e}`.split("-");return c.createElement("div",{className:$(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...o},t)}function Jr({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:c.createElement(Zr,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},c.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var eo=s.memo((({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...f})=>{const p=s.useRef(null),[h,m]=s.useState({x:0,y:0,width:0,height:0}),g=$(["react-flow__edge-textwrapper",d]);return s.useEffect((()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}}),[n]),void 0!==n&&n?c.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},o&&c.createElement("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),c.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},n),u):null}));const to=e=>({width:e.offsetWidth,height:e.offsetHeight}),no=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ro=(e={x:0,y:0},t)=>({x:no(e.x,t[0][0],t[1][0]),y:no(e.y,t[0][1],t[1][1])}),oo=(e,t,n)=>e<t?no(Math.abs(e-t),1,50)/50:e>n?-no(Math.abs(e-n),1,50)/50:0,io=(e,t)=>[20*oo(e.x,35,t.width-35),20*oo(e.y,35,t.height-35)],ao=e=>e.getRootNode?.()||window?.document,lo=(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)}),so=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),co=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),uo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),fo=(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)},po=e=>!isNaN(e)&&isFinite(e),ho=Symbol.for("internals"),mo=["Enter"," ","Escape"];function go(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const yo=e=>"clientX"in e,vo=(e,t)=>{const n=yo(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},bo=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,wo=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>c.createElement(c.Fragment,null,c.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&c.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&po(n)&&po(r)?c.createElement(eo,{x:n,y:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u}):null);function xo(e,t,n){return void 0===n?n:r=>{const o=t().edges.find((t=>t.id===e));o&&n(r,{...o})}}function ko({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function So({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:l}){const s=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*l+.125*r;return[s,c,Math.abs(s-e),Math.abs(c-t)]}var Eo,_o,Co,Oo,No,Po;function Ro({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Po.Left||e===Po.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Mo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top}){const[a,l]=Ro({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,c]=Ro({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=So({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${a},${l} ${s},${c} ${r},${o}`,u,d,f,p]}wo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Eo||(Eo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(_o||(_o={})),function(e){e.Partial="partial",e.Full="full"}(Co||(Co={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Oo||(Oo={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(No||(No={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(Po||(Po={}));const To=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Po.Bottom,targetPosition:i=Po.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=Mo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return c.createElement(wo,{path:y,labelX:v,labelY:b,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})}));To.displayName="SimpleBezierEdge";const Ao={[Po.Left]:{x:-1,y:0},[Po.Right]:{x:1,y:0},[Po.Top]:{x:0,y:-1},[Po.Bottom]:{x:0,y:1}},Do=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Io({source:e,sourcePosition:t=Po.Bottom,target:n,targetPosition:r=Po.Top,center:o,offset:i}){const a=Ao[t],l=Ao[r],s={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+l.x*i,y:n.y+l.y*i},u=(({source:e,sourcePosition:t=Po.Bottom,target:n})=>t===Po.Left||t===Po.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})({source:s,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=ko({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*l[d]==-1){p=o.x??v,h=o.y??b;const e=[{x:p,y:s.y},{x:p,y:c.y}],t=[{x:s.x,y:h},{x:c.x,y:h}];m=a[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:s.x,y:c.y}],u=[{x:c.x,y:s.y}];if(m="x"===d?a.x===f?u:o:a.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===f?g[d]=(s[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===l[e],n=s[e]>c[e],r=s[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const v={x:s.x+g.x,y:s.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:s.x+g.x,y:s.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function Lo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top,borderRadius:a=5,centerX:l,centerY:s,offset:c=20}){const[u,d,f,p,h]=Io({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:s},offset:c}),m=u.reduce(((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(Do(e,t)/2,Do(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const l=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*l},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r}),"");return[m,d,f,p,h]}const zo=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,sourcePosition:f=Po.Bottom,targetPosition:p=Po.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=Lo({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return c.createElement(wo,{path:v,labelX:b,labelY:w,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})}));zo.displayName="SmoothStepEdge";const Fo=s.memo((e=>c.createElement(zo,{...e,pathOptions:s.useMemo((()=>({borderRadius:0,offset:e.pathOptions?.offset})),[e.pathOptions?.offset])})));Fo.displayName="StepEdge";const jo=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,l]=ko({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,l]}({sourceX:e,sourceY:t,targetX:n,targetY:r});return c.createElement(wo,{path:m,labelX:g,labelY:y,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})}));function $o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Bo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Po.Left:return[t-$o(t-r,i),n];case Po.Right:return[t+$o(r-t,i),n];case Po.Top:return[t,n-$o(n-o,i)];case Po.Bottom:return[t,n+$o(o-n,i)]}}function Vo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top,curvature:a=.25}){const[l,s]=Bo({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=Bo({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,h]=So({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${s} ${c},${u} ${r},${o}`,d,f,p,h]}jo.displayName="StraightEdge";const Ho=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Po.Bottom,targetPosition:i=Po.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=Vo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:g?.curvature});return c.createElement(wo,{path:v,labelX:b,labelY:w,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})}));Ho.displayName="BezierEdge";const Uo=s.createContext(null),Wo=Uo.Provider;Uo.Consumer;const qo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ko=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`},Xo=({x:e,y:t},[n,r,o],i,[a,l])=>{const s={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(s.x/a),y:l*Math.round(s.y/l)}:s},Yo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Go=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Qo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce(((e,n)=>{const{x:r,y:o}=Go(n,t).positionAbsolute;return lo(e,so({x:r,y:o,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return co(n)},Zo=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const s={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach((e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Go(e,l),d={x:u.x,y:u.y,width:t||0,height:n||0},f=fo(s,d);(void 0===t||void 0===n||null===t||null===n||i&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)})),c},Jo=(e,t)=>{const n=e.map((e=>e.id));return t.filter((e=>n.includes(e.source)||n.includes(e.target)))},ei=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),l=n/(e.height*(1+i)),s=Math.min(a,l),c=no(s,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},ti=(e,t=0)=>e.transition().duration(t);function ni(e,t,n,r){return(t[n]||[]).reduce(((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t)),[])}const ri={source:null,target:null,sourceHandle:null,targetHandle:null},oi=()=>({handleDomNode:null,isValid:!1,connection:ri,endHandle:null});function ii(e,t,n,r,o,i,a){const l="target"===o,s=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...oi(),handleDomNode:s};if(s){const e=ai(void 0,s),o=s.getAttribute("data-nodeid"),a=s.getAttribute("data-handleid"),u=s.classList.contains("connectable"),d=s.classList.contains("connectableend"),f={source:l?o:n,sourceHandle:l?a:r,target:l?n:o,targetHandle:l?r:a};c.connection=f;u&&d&&(t===Eo.Strict?l&&"source"===e||!l&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(f))}return c}function ai(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function li(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function si(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function ci({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:c}){const u=ao(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=i();let b,w=0;const{x:x,y:k}=vo(e),S=u?.elementFromPoint(x,k),E=ai(s,S),_=f?.getBoundingClientRect();if(!_||!E)return;let C,O=vo(e,_),N=!1,P=null,R=!1,M=null;const T=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce(((e,o)=>{if(o[ho]){const{handleBounds:i}=o[ho];let a=[],l=[];i&&(a=ni(o,i,"source",`${t}-${n}-${r}`),l=ni(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...l)}return e}),[])}({nodes:y(),nodeId:n,handleId:t,handleType:E}),A=()=>{if(!p)return;const[e,t]=io(O,_);g({x:e,y:t}),w=requestAnimationFrame(A)};function D(e){const{transform:r}=i();O=vo(e,_);const{handle:s,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:l}=vo(e),s=t.elementsFromPoint(a,l).find((e=>e.classList.contains("react-flow__handle")));if(s){const e=s.getAttribute("data-nodeid");if(e){const t=ai(void 0,s),r=s.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find((n=>n.nodeId===e&&n.type===t&&n.id===r));return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach((e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}})),!c.length)return{handle:null,validHandleResult:oi()};if(1===c.length)return c[0];const d=c.some((({validHandleResult:e})=>e.isValid)),f=c.some((({handle:e})=>"target"===e.type));return c.find((({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid))||c[0]}(e,u,Xo(O,r,!1,[1,1]),h,T,(e=>ii(e,d,n,t,o?"target":"source",l,u)));if(b=s,N||(A(),N=!0),M=c.handleDomNode,P=c.connection,R=c.isValid,a({connectionPosition:b&&R?Yo({x:b.x,y:b.y},r):O,connectionStatus:si(!!b,R),connectionEndHandle:c.endHandle}),!b&&!R&&!M)return li(C);P.source!==P.target&&M&&(li(C),C=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",R),M.classList.toggle("react-flow__handle-valid",R))}function I(e){(b||M)&&P&&R&&r?.(P),i().onConnectEnd?.(e),s&&c?.(e),li(C),v(),cancelAnimationFrame(w),N=!1,R=!1,P=null,M=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",I)}a({connectionPosition:O,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:E,connectionStartHandle:{nodeId:n,handleId:t,type:E},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:E}),u.addEventListener("mousemove",D),u.addEventListener("mouseup",I),u.addEventListener("touchmove",D),u.addEventListener("touchend",I)}const ui=()=>!0,di=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),fi=s.forwardRef((({type:e="source",position:t=Po.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=a||null,y="target"===e,v=Gr(),b=s.useContext(Uo),{connectOnClick:w,noPanClassName:x}=Yr(di,q),{connecting:k,clickConnecting:S}=Yr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(b,g,e),q);b||v.getState().onError?.("010",Wr());const E=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=v.getState();t(((e,t)=>{if(!e.source||!e.target)return t;let n;return n=(e=>"id"in e&&"source"in e&&"target"in e)(e)?{...e}:{...e,id:qo(e)},((e,t)=>t.some((t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle)))))(n,t)?t:t.concat(n)})(o,e))}n?.(o),l?.(o)},_=e=>{if(!b)return;const t=yo(e);o&&(t&&0===e.button||!t)&&ci({event:e,handleId:g,nodeId:b,onConnect:E,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:n||v.getState().isValidConnection||ui}),t?f?.(e):p?.(e)};return c.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${g}-${e}`,className:$(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!y,target:y,connectable:r,connectablestart:o,connectableend:i,connecting:S,connectionindicator:r&&(o&&!k||i&&k)}]),onMouseDown:_,onTouchStart:_,onClick:w?t=>{const{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s}=v.getState();if(!b||!a&&!o)return;if(!a)return r?.(t,{nodeId:b,handleId:g,handleType:e}),void v.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:g}});const c=ao(t.target),u=n||s||ui,{connection:d,isValid:f}=ii({nodeId:b,id:g,type:e},l,a.nodeId,a.handleId||null,a.type,u,c);f&&E(d),i?.(t),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)}));fi.displayName="Handle";var pi=s.memo(fi);const hi=({data:e,isConnectable:t,targetPosition:n=Po.Top,sourcePosition:r=Po.Bottom})=>c.createElement(c.Fragment,null,c.createElement(pi,{type:"target",position:n,isConnectable:t}),e?.label,c.createElement(pi,{type:"source",position:r,isConnectable:t}));hi.displayName="DefaultNode";var mi=s.memo(hi);const gi=({data:e,isConnectable:t,sourcePosition:n=Po.Bottom})=>c.createElement(c.Fragment,null,e?.label,c.createElement(pi,{type:"source",position:n,isConnectable:t}));gi.displayName="InputNode";var yi=s.memo(gi);const vi=({data:e,isConnectable:t,targetPosition:n=Po.Top})=>c.createElement(c.Fragment,null,c.createElement(pi,{type:"target",position:n,isConnectable:t}),e?.label);vi.displayName="OutputNode";var bi=s.memo(vi);const wi=()=>null;wi.displayName="GroupNode";const xi=e=>({selectedNodes:e.getNodes().filter((e=>e.selected)),selectedEdges:e.edges.filter((e=>e.selected)).map((e=>({...e})))}),ki=e=>e.id;function Si(e,t){return q(e.selectedNodes.map(ki),t.selectedNodes.map(ki))&&q(e.selectedEdges.map(ki),t.selectedEdges.map(ki))}const Ei=s.memo((({onSelectionChange:e})=>{const t=Gr(),{selectedNodes:n,selectedEdges:r}=Yr(xi,Si);return s.useEffect((()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach((e=>e(o)))}),[n,r,e]),null}));Ei.displayName="SelectionListener";const _i=e=>!!e.onSelectionChange;function Ci({onSelectionChange:e}){const t=Yr(_i);return e||t?c.createElement(Ei,{onSelectionChange:e}):null}const Oi=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ni(e,t){s.useEffect((()=>{void 0!==e&&t(e)}),[e])}function Pi(e,t,n){s.useEffect((()=>{void 0!==t&&n({[e]:t})}),[t])}const Ri=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:k,snapGrid:S,snapToGrid:E,translateExtent:_,connectOnClick:C,defaultEdgeOptions:O,fitView:N,fitViewOptions:P,onNodesDelete:R,onEdgesDelete:M,onNodeDrag:T,onNodeDragStart:A,onNodeDragStop:D,onSelectionDrag:I,onSelectionDragStart:L,onSelectionDragStop:z,noPanClassName:F,nodeOrigin:j,rfId:$,autoPanOnConnect:B,autoPanOnNodeDrag:V,onError:H,connectionRadius:U,isValidConnection:W,nodeDragThreshold:K})=>{const{setNodes:X,setEdges:Y,setDefaultNodesAndEdges:G,setMinZoom:Q,setMaxZoom:Z,setTranslateExtent:J,setNodeExtent:ee,reset:te}=Yr(Oi,q),ne=Gr();return s.useEffect((()=>{const e=r?.map((e=>({...e,...O})));return G(n,e),()=>{te()}}),[]),Pi("defaultEdgeOptions",O,ne.setState),Pi("connectionMode",k,ne.setState),Pi("onConnect",o,ne.setState),Pi("onConnectStart",i,ne.setState),Pi("onConnectEnd",a,ne.setState),Pi("onClickConnectStart",l,ne.setState),Pi("onClickConnectEnd",c,ne.setState),Pi("nodesDraggable",u,ne.setState),Pi("nodesConnectable",d,ne.setState),Pi("nodesFocusable",f,ne.setState),Pi("edgesFocusable",p,ne.setState),Pi("edgesUpdatable",h,ne.setState),Pi("elementsSelectable",x,ne.setState),Pi("elevateNodesOnSelect",m,ne.setState),Pi("snapToGrid",E,ne.setState),Pi("snapGrid",S,ne.setState),Pi("onNodesChange",b,ne.setState),Pi("onEdgesChange",w,ne.setState),Pi("connectOnClick",C,ne.setState),Pi("fitViewOnInit",N,ne.setState),Pi("fitViewOnInitOptions",P,ne.setState),Pi("onNodesDelete",R,ne.setState),Pi("onEdgesDelete",M,ne.setState),Pi("onNodeDrag",T,ne.setState),Pi("onNodeDragStart",A,ne.setState),Pi("onNodeDragStop",D,ne.setState),Pi("onSelectionDrag",I,ne.setState),Pi("onSelectionDragStart",L,ne.setState),Pi("onSelectionDragStop",z,ne.setState),Pi("noPanClassName",F,ne.setState),Pi("nodeOrigin",j,ne.setState),Pi("rfId",$,ne.setState),Pi("autoPanOnConnect",B,ne.setState),Pi("autoPanOnNodeDrag",V,ne.setState),Pi("onError",H,ne.setState),Pi("connectionRadius",U,ne.setState),Pi("isValidConnection",W,ne.setState),Pi("nodeDragThreshold",K,ne.setState),Ni(e,X),Ni(t,Y),Ni(g,Q),Ni(y,Z),Ni(_,J),Ni(v,ee),null},Mi={display:"none"},Ti={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ai="react-flow__node-desc",Di="react-flow__edge-desc",Ii=e=>e.ariaLiveMessage;function Li({rfId:e}){const t=Yr(Ii);return c.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ti},t)}function zi({rfId:e,disableKeyboardA11y:t}){return c.createElement(c.Fragment,null,c.createElement("div",{id:`${Ai}-${e}`,style:Mi},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),c.createElement("div",{id:`${Di}-${e}`,style:Mi},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&c.createElement(Li,{rfId:e}))}var Fi=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=s.useState(!1),o=s.useRef(!1),i=s.useRef(new Set([])),[a,l]=s.useMemo((()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter((e=>"string"==typeof e)).map((e=>e.split("+"))),n=t.reduce(((e,t)=>e.concat(...t)),[]);return[t,n]}return[[],[]]}),[e]);return s.useEffect((()=>{const n="undefined"!=typeof document?document:null,s=t?.target||n;if(null!==e){const e=e=>{o.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!o.current||o.current&&!t.actInsideInputWithModifier)&&go(e))return!1;const n=$i(e.code,l);i.current.add(e[n]),ji(a,i.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&go(e))return!1;const n=$i(e.code,l);ji(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[n]),"Meta"===e.key&&i.current.clear(),o.current=!1},c=()=>{i.current.clear(),r(!1)};return s?.addEventListener("keydown",e),s?.addEventListener("keyup",n),window.addEventListener("blur",c),()=>{s?.removeEventListener("keydown",e),s?.removeEventListener("keyup",n),window.removeEventListener("blur",c)}}}),[e,r]),n};function ji(e,t,n){return e.filter((e=>n||e.length===t.size)).some((e=>e.every((e=>t.has(e)))))}function $i(e,t){return t.includes(e)?"code":"key"}function Bi(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Go(i,r);return Bi(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[ho]?.z??0)>(n.z??0)?i[ho]?.z??0:n.z??0},r)}function Vi(e,t,n){e.forEach((r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Bi(r,e,{...r.position,z:r[ho]?.z??0},t);r.positionAbsolute={x:o,y:i},r[ho].z=a,n?.[r.id]&&(r[ho].isParent=!0)}}))}function Hi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach((e=>{const n=(po(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),l={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},s=e.parentNode||e.parentId;s&&(i[s]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(l,ho,{enumerable:!1,value:{handleBounds:c?void 0:r?.[ho]?.handleBounds,z:n}}),o.set(e.id,l)})),Vi(o,n,i),o}function Ui(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:s,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(l&&s&&(f||!t.initial)){const e=n().filter((e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some((t=>t.id===e.id)):n})),c=e.every((e=>e.width&&e.height));if(e.length>0&&c){const n=Qo(e,d),{x:c,y:u,zoom:f}=ei(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),p=wr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?l.transform(ti(s,t.duration),p):l.transform(s,p),!0}}return!1}function Wi(e,t){return e.forEach((e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[ho]:n[ho],selected:e.selected})})),new Map(t)}function qi(e,t){return t.map((t=>{const n=e.find((e=>e.id===t.id));return n&&(t.selected=n.selected),t}))}function Ki({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:s,hasDefaultEdges:c}=n();e?.length&&(s&&r({nodeInternals:Wi(e,o)}),a?.(e)),t?.length&&(c&&r({edges:qi(t,i)}),l?.(t))}const Xi=()=>{},Yi={zoomIn:Xi,zoomOut:Xi,zoomTo:Xi,getZoom:()=>1,setViewport:Xi,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Xi,fitBounds:Xi,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Gi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Qi(){const e=(()=>{const e=Gr(),{d3Zoom:t,d3Selection:n}=Yr(Gi,q),r=s.useMemo((()=>n&&t?{zoomIn:e=>t.scaleBy(ti(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(ti(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(ti(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,a,l]=e.getState().transform,s=wr.translate(r.x??i,r.y??a).scale(r.zoom??l);t.transform(ti(n,o?.duration),s)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Ui(e.getState,t),setCenter:(r,o,i)=>{const{width:a,height:l,maxZoom:s}=e.getState(),c=void 0!==i?.zoom?i.zoom:s,u=a/2-r*c,d=l/2-o*c,f=wr.translate(u,d).scale(c);t.transform(ti(n,i?.duration),f)},fitBounds:(r,o)=>{const{width:i,height:a,minZoom:l,maxZoom:s}=e.getState(),{x:c,y:u,zoom:d}=ei(r,i,a,l,s,o?.padding??.1),f=wr.translate(c,u).scale(d);t.transform(ti(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Xo(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:a,y:l}=i.getBoundingClientRect(),s={x:t.x-a,y:t.y-l};return Xo(s,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),a=Yo(t,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:Yi),[t,n]);return r})(),t=Gr(),n=s.useCallback((()=>t.getState().getNodes().map((e=>({...e})))),[]),r=s.useCallback((e=>t.getState().nodeInternals.get(e)),[]),o=s.useCallback((()=>{const{edges:e=[]}=t.getState();return e.map((e=>({...e})))}),[]),i=s.useCallback((e=>{const{edges:n=[]}=t.getState();return n.find((t=>t.id===e))}),[]),a=s.useCallback((e=>{const{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=t.getState(),a=n(),l="function"==typeof e?e(a):e;if(o)r(l);else if(i){const e=0===l.length?a.map((e=>({type:"remove",id:e.id}))):l.map((e=>({item:e,type:"reset"})));i(e)}}),[]),l=s.useCallback((e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=t.getState(),a="function"==typeof e?e(n):e;if(o)r(a);else if(i){i(0===a.length?n.map((e=>({type:"remove",id:e.id}))):a.map((e=>({item:e,type:"reset"}))))}}),[]),c=s.useCallback((e=>{const n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=t.getState();if(i){o([...r(),...n])}else if(a){const e=n.map((e=>({item:e,type:"add"})));a(e)}}),[]),u=s.useCallback((e=>{const n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=t.getState();if(i)o([...r,...n]);else if(a){a(n.map((e=>({item:e,type:"add"}))))}}),[]),d=s.useCallback((()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e().map((e=>({...e}))),edges:n.map((e=>({...e}))),viewport:{x:o,y:i,zoom:a}}}),[]),f=s.useCallback((({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:l,onNodesDelete:s,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map((e=>e.id)),p=(n||[]).map((e=>e.id)),h=o().reduce(((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find((e=>e.id===n));return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e}),[]),m=i.filter((e=>"boolean"!=typeof e.deletable||e.deletable)),g=m.filter((e=>p.includes(e.id)));if(h||g){const e=Jo(h,m),n=[...g,...e],o=n.reduce(((e,t)=>(e.includes(t.id)||e.push(t.id),e)),[]);if((l||a)&&(l&&t.setState({edges:i.filter((e=>!o.includes(e.id)))}),a&&(h.forEach((e=>{r.delete(e.id)})),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.map((e=>({id:e,type:"remove"}))))),h.length>0&&(s?.(h),u)){u(h.map((e=>({id:e.id,type:"remove"}))))}}}),[]),p=s.useCallback((e=>{const n=po((r=e).width)&&po(r.height)&&po(r.x)&&po(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:uo(o),o,n]}),[]),h=s.useCallback(((e,n=!0,r)=>{const[o,i,a]=p(e);return o?(r||t.getState().getNodes()).filter((e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const t=uo(e),r=fo(t,o);return n&&r>0||r>=o.width*o.height})):[]}),[]),m=s.useCallback(((e,t,n=!0)=>{const[r]=p(e);if(!r)return!1;const o=fo(r,t);return n&&o>0||o>=r.width*r.height}),[]);return s.useMemo((()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m})),[e,n,r,o,i,a,l,c,u,d,f,h,m])}const Zi={actInsideInputWithModifier:!1};const Ji={position:"absolute",width:"100%",height:"100%",top:0,left:0},ea=e=>({x:e.x,y:e.y,zoom:e.k}),ta=(e,t)=>e.target.closest(`.${t}`),na=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),ra=e=>{const t=e.ctrlKey&&bo()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},oa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ia=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:u=_o.Free,zoomOnDoubleClick:d=!0,elementsSelectable:f,panOnDrag:p=!0,defaultViewport:h,translateExtent:m,minZoom:g,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:b=!0,children:w,noWheelClassName:x,noPanClassName:k})=>{const S=s.useRef(),E=Gr(),_=s.useRef(!1),C=s.useRef(!1),O=s.useRef(null),N=s.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:R,d3ZoomHandler:M,userSelectionActive:T}=Yr(oa,q),A=Fi(v),D=s.useRef(0),I=s.useRef(!1),L=s.useRef();return function(e){const t=Gr();s.useEffect((()=>{let n;const r=()=>{if(!e.current)return;const n=to(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",Br()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver((()=>r())),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}}),[])}(O),s.useEffect((()=>{if(O.current){const e=O.current.getBoundingClientRect(),t=Pr().scaleExtent([g,y]).translateExtent(m),n=ut(O.current).call(t),r=wr.translate(h.x,h.y).scale(no(h.zoom,g,y)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,m);t.transform(n,i),t.wheelDelta(ra),E.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:O.current.closest(".react-flow")})}}),[]),s.useEffect((()=>{R&&P&&(!a||A||T?void 0!==M&&R.on("wheel.zoom",(function(e,t){if(!b&&"wheel"===e.type&&!e.ctrlKey||ta(e,x))return null;e.preventDefault(),M.call(this,e,t)}),{passive:!1}):R.on("wheel.zoom",(r=>{if(ta(r,x))return!1;r.preventDefault(),r.stopImmediatePropagation();const o=R.property("__zoom").k||1;if(r.ctrlKey&&i){const e=dt(r),t=ra(r),n=o*Math.pow(2,t);return void P.scaleTo(R,n,e,r)}const a=1===r.deltaMode?20:1;let s=u===_o.Vertical?0:r.deltaX*a,c=u===_o.Horizontal?0:r.deltaY*a;!bo()&&r.shiftKey&&u!==_o.Vertical&&(s=r.deltaY*a,c=0),P.translateBy(R,-s/o*l,-c/o*l,{internal:!0});const d=ea(R.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=E.getState();clearTimeout(L.current),I.current||(I.current=!0,t?.(r,d),f?.(d)),I.current&&(e?.(r,d),p?.(d),L.current=setTimeout((()=>{n?.(r,d),h?.(d),I.current=!1}),150))}),{passive:!1}))}),[T,a,u,R,P,M,A,i,b,x,t,e,n]),s.useEffect((()=>{P&&P.on("start",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;D.current=e.sourceEvent?.button;const{onViewportChangeStart:n}=E.getState(),r=ea(e.transform);_.current=!0,N.current=r,"mousedown"===e.sourceEvent?.type&&E.setState({paneDragging:!0}),n?.(r),t?.(e.sourceEvent,r)}))}),[P,t]),s.useEffect((()=>{P&&(T&&!_.current?P.on("zoom",null):T||P.on("zoom",(t=>{const{onViewportChange:n}=E.getState();if(E.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),C.current=!(!r||!na(p,D.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=ea(t.transform);n?.(r),e?.(t.sourceEvent,r)}})))}),[T,P,e,p,r]),s.useEffect((()=>{P&&P.on("end",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=E.getState();if(_.current=!1,E.setState({paneDragging:!1}),r&&na(p,D.current??0)&&!C.current&&r(e.sourceEvent),C.current=!1,(n||t)&&(o=N.current,i=e.transform,o.x!==i.x||o.y!==i.y||o.zoom!==i.k)){const r=ea(e.transform);N.current=r,clearTimeout(S.current),S.current=setTimeout((()=>{t?.(r),n?.(e.sourceEvent,r)}),a?150:0)}var o,i}))}),[P,a,p,n,r]),s.useEffect((()=>{P&&P.filter((e=>{const t=A||o,n=i&&e.ctrlKey;if((!0===p||Array.isArray(p)&&p.includes(1))&&1===e.button&&"mousedown"===e.type&&(ta(e,"react-flow__node")||ta(e,"react-flow__edge")))return!0;if(!(p||t||a||d||i))return!1;if(T)return!1;if(!d&&"dblclick"===e.type)return!1;if(ta(e,x)&&"wheel"===e.type)return!1;if(ta(e,k)&&("wheel"!==e.type||a&&"wheel"===e.type&&!A))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!a&&!n&&"wheel"===e.type)return!1;if(!p&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(p)&&!p.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(p)&&p.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r}))}),[T,P,o,i,a,d,p,f,A]),c.createElement("div",{className:"react-flow__renderer",ref:O,style:Ji},w)},aa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function la(){const{userSelectionActive:e,userSelectionRect:t}=Yr(aa,q);return e&&t?c.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function sa(e,t){const n=t.parentNode||t.parentId,r=e.find((e=>e.id===n));if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function ca(e,t){if(e.some((e=>"reset"===e.type)))return e.filter((e=>"reset"===e.type)).map((e=>e.item));const n=e.filter((e=>"add"===e.type)).map((e=>e.item));return t.reduce(((t,n)=>{const r=e.filter((e=>e.id===n.id));if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&sa(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&sa(t,o);break;case"remove":return t}return t.push(o),t}),n)}function ua(e,t){return ca(e,t)}function da(e,t){return ca(e,t)}const fa=(e,t)=>({id:e,type:"select",selected:t});function pa(e,t){return e.reduce(((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(fa(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(fa(n.id,!1))),e}),[])}const ha=(e,t)=>n=>{n.target===t.current&&e?.(n)},ma=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ga=s.memo((({isSelecting:e,selectionMode:t=Co.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=s.useRef(null),m=Gr(),g=s.useRef(0),y=s.useRef(0),v=s.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=Yr(ma,q),k=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},E=l?e=>l(e):void 0,_=w&&(e||b);return c.createElement("div",{className:$(["react-flow__pane",{dragging:x,selection:e}]),onClick:_?void 0:ha(S,h),onContextMenu:ha((e=>{Array.isArray(n)&&n?.includes(2)?e.preventDefault():a?.(e)}),h),onWheel:ha(E,h),onMouseEnter:_?void 0:u,onMouseDown:_?t=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(v.current=o?.getBoundingClientRect(),!w||!e||0!==t.button||t.target!==h.current||!v.current)return;const{x:i,y:a}=vo(t,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),r?.(t)}:void 0,onMouseMove:_?n=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:l,onEdgesChange:s,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!v.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=vo(n,v.current),f=r.startX??0,p=r.startY??0,h={...r,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},b=u(),w=Zo(o,h,a,t===Co.Partial,!0,c),x=Jo(w,i).map((e=>e.id)),k=w.map((e=>e.id));if(g.current!==k.length){g.current=k.length;const e=pa(b,k);e.length&&l?.(e)}if(y.current!==x.length){y.current=x.length;const e=pa(i,x);e.length&&s?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:_?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),k(),o?.(e)}:void 0,onMouseLeave:_?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),o?.(e)),k()}:f,ref:h,style:Ji},p,c.createElement(la,null))}));function ya(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||ya(r,t))}function va(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function ba(e,t,n,r){return Array.from(e.values()).filter((n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!ya(n,e))&&(n.draggable||t&&void 0===n.draggable))).map((e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent})))}function wa(e,t,n,r,o=[0,0],i){const a=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let l=a;const s=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&s&&"parent"!==e.extent){const t=n.get(s),{x:r,y:i}=Go(t,o).positionAbsolute;l=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(s&&e.width&&e.height){const t=n.get(s),{x:r,y:i}=Go(t,o).positionAbsolute;l=t&&po(r)&&po(i)&&po(t.width)&&po(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:l}else i?.("005",Vr()),l=a;let c={x:0,y:0};if(s){const e=n.get(s);c=Go(e,o).positionAbsolute}const u=l&&"parent"!==l?ro(t,l):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function xa({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map((e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute})));return[e?r.find((t=>t.id===e)):r[0],r]}ga.displayName="Pane";const ka=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),l=a.width*r[0],s=a.height*r[1];return i.map((e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-l)/n,y:(t.top-a.top-s)/n,...to(e)}}))};function Sa(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Ea({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:s}=t.getState(),c=l.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame((()=>r?.current?.blur()))):o([e])):s?.("012",Kr(e))}function _a(e){return(t,n,r)=>e?.(t,r)}function Ca({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:a}){const l=Gr(),[c,u]=s.useState(!1),d=s.useRef([]),f=s.useRef({x:null,y:null}),p=s.useRef(0),h=s.useRef(null),m=s.useRef({x:0,y:0}),g=s.useRef(null),y=s.useRef(!1),v=s.useRef(!1),b=s.useRef(!1),w=function(){const e=Gr(),t=s.useCallback((({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=e.getState(),i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(l.x/r[0]):l.x,ySnapped:o?r[1]*Math.round(l.y/r[1]):l.y,...l}}),[]);return t}();return s.useEffect((()=>{if(e?.current){const s=ut(e.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:i,updateNodePositions:a,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Qo(d.current,h);v=so(e)}if(d.current=d.current.map((r=>{const o={x:e-r.distance.x,y:t-r.distance.y};p&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-v.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-v.x2+s[1][0],i[0][1]=r.positionAbsolute.y-v.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-v.y2+s[1][1]);const a=wa(r,o,n,i,h,m);return y=y||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r})),!y)return;a(d.current,!0,!0),u(!0);const b=o?r:_a(i);if(b&&g.current){const[e,t]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=io(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],r({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},k=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:s,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=o?u:_a(p);a&&i||r||!o||n.get(o)?.selected||c(),o&&i&&a&&Ea({id:o,store:l,nodeRef:e});const m=w(t);if(f.current=m,d.current=ba(n,s,m,o),h&&d.current){const[e,r]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});h(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=wt,i=xt,a=kt,l=St,s={},c=X("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",g).on("touchmove.drag",y,ft).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,l){if(!r&&o.call(this,a,l)){var s=b(this,i.call(this,a,l),a,l,"mouse");s&&(ut(a.view).on("mousemove.drag",h,pt).on("mouseup.drag",m,pt),gt(a.view),ht(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function h(r){if(mt(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}s.mouse("drag",r)}function m(e){ut(e.view).on("mousemove.drag mouseup.drag",null),yt(e.view,n),mt(e),s.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=b(this,l,e,t,a[n].identifier,a[n]))&&(ht(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(mt(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=s[o[t].identifier])&&(ht(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var l,d,p,h=c.copy(),m=dt(i||n,t);if(null!=(p=a.call(e,new bt("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return l=p.x-m[0]||0,d=p.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":s[o]=n,g=u++;break;case"end":delete s[o],--u;case"drag":m=dt(c||a,t),g=u}h.call(i,e,new bt(i,{sourceEvent:a,subject:p,target:f,identifier:o,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:vt(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:vt(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:vt(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:vt(!!e),f):l},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",(e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&k(e),b.current=!1;const r=w(e);f.current=r,h.current=t?.getBoundingClientRect()||null,m.current=vo(e.sourceEvent,h.current)})).on("drag",(e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),o=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+o*o)>r&&k(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=vo(e.sourceEvent,h.current),c(t))}})).on("end",(e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:i}=l.getState(),a=o?r:_a(i);if(t(d.current,!1,!1),a){const[t,r]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});a(e.sourceEvent,t,r)}}})).filter((t=>{const o=t.target;return!t.button&&(!n||!va(o,`.${n}`,e))&&(!r||va(o,r,e))}));return s.call(t),()=>{s.on(".drag",null)}}s.on(".drag",null)}}),[e,t,n,r,i,l,o,a,w]),c}function Oa(){const e=Gr(),t=s.useCallback((t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:l,onError:s,nodesDraggable:c}=e.getState(),u=i().filter((e=>e.selected&&(e.draggable||c&&void 0===e.draggable))),d=a?l[0]:5,f=a?l[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p,g=u.map((e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};a&&(t.x=l[0]*Math.round(t.x/l[0]),t.y=l[1]*Math.round(t.y/l[1]));const{positionAbsolute:o,position:i}=wa(e,t,n,r,void 0,s);e.position=i,e.positionAbsolute=o}return e}));o(g,!0,!1)}),[]);return t}const Na={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Pa=e=>{const t=({id:t,type:n,data:r,xPos:o,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:k,selectNodesOnDrag:S,sourcePosition:E,targetPosition:_,hidden:C,resizeObserver:O,dragHandle:N,zIndex:P,isParent:R,noDragClassName:M,noPanClassName:T,initialized:A,disableKeyboardA11y:D,ariaLabel:I,rfId:L,hasHandleBounds:z})=>{const F=Gr(),j=s.useRef(null),B=s.useRef(null),V=s.useRef(E),H=s.useRef(_),U=s.useRef(n),W=w||b||d||f||p||h,q=Oa(),K=Sa(t,F.getState,f),X=Sa(t,F.getState,p),Y=Sa(t,F.getState,h),G=Sa(t,F.getState,m),Q=Sa(t,F.getState,g);s.useEffect((()=>()=>{B.current&&(O?.unobserve(B.current),B.current=null)}),[]),s.useEffect((()=>{if(j.current&&!C){const e=j.current;A&&z&&B.current===e||(B.current&&O?.unobserve(B.current),O?.observe(e),B.current=e)}}),[C,A,z]),s.useEffect((()=>{const e=U.current!==n,r=V.current!==E,o=H.current!==_;j.current&&(e||r||o)&&(e&&(U.current=n),r&&(V.current=E),o&&(H.current=_),F.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))}),[t,n,E,_]);const Z=Ca({nodeRef:j,disabled:C||!b,noDragClassName:M,handleSelector:N,nodeId:t,isSelectable:w,selectNodesOnDrag:S});return C?null:c.createElement("div",{className:$(["react-flow__node",`react-flow__node-${n}`,{[T]:b},v,{selected:u,selectable:w,parent:R,dragging:Z}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:W?"all":"none",visibility:A?"visible":"hidden",...y},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:K,onMouseMove:X,onMouseLeave:Y,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:n}=F.getState();if(w&&(!S||!b||n>0)&&Ea({id:t,store:F,nodeRef:j}),d){const n=F.getState().nodeInternals.get(t);n&&d(e,{...n})}},onDoubleClick:Q,onKeyDown:k?e=>{if(!go(e)&&!D)if(mo.includes(e.key)&&w){const n="Escape"===e.key;Ea({id:t,store:F,unselect:n,nodeRef:j})}else b&&u&&Object.prototype.hasOwnProperty.call(Na,e.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~i}`}),q({x:Na[e.key].x,y:Na[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:k?0:void 0,role:k?"button":void 0,"aria-describedby":D?void 0:`${Ai}-${L}`,"aria-label":I},c.createElement(Wo,{value:t},c.createElement(e,{id:t,data:r,type:n,xPos:o,yPos:i,selected:u,isConnectable:x,sourcePosition:E,targetPosition:_,dragging:Z,dragHandle:N,zIndex:P})))};return t.displayName="NodeWrapper",s.memo(t)};const Ra=e=>{const t=e.getNodes().filter((e=>e.selected));return{...Qo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var Ma=s.memo((function({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Gr(),{width:o,height:i,x:a,y:l,transformString:u,userSelectionActive:d}=Yr(Ra,q),f=Oa(),p=s.useRef(null);if(s.useEffect((()=>{n||p.current?.focus({preventScroll:!0})}),[n]),Ca({nodeRef:p}),d||!o||!i)return null;const h=e?t=>{const n=r.getState().getNodes().filter((e=>e.selected));e(t,n)}:void 0;return c.createElement("div",{className:$(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u}},c.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Na,e.key)&&f({x:Na[e.key].x,y:Na[e.key].y,isShiftPressed:e.shiftKey})},style:{width:o,height:i,top:l,left:a}}))}));const Ta=e=>e.nodesSelectionActive,Aa=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:E,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:O,panOnDrag:N,defaultViewport:P,translateExtent:R,minZoom:M,maxZoom:T,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:I,noPanClassName:L,disableKeyboardA11y:z})=>{const F=Yr(Ta),j=Fi(p),$=Fi(b),B=$||N,V=$||E,H=j||h&&!0!==B;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Gr(),{deleteElements:r}=Qi(),o=Fi(e,Zi),i=Fi(t);s.useEffect((()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter((e=>e.selected)),i=e.filter((e=>e.selected));r({nodes:o,edges:i}),n.setState({nodesSelectionActive:!1})}}),[o]),s.useEffect((()=>{n.setState({multiSelectionActive:i})}),[i])})({deleteKeyCode:l,multiSelectionKeyCode:v}),c.createElement(ia,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:i,elementsSelectable:x,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:V,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:O,panOnDrag:!j&&B,defaultViewport:P,translateExtent:R,minZoom:M,maxZoom:T,zoomActivationKeyCode:w,preventScrolling:A,noWheelClassName:I,noPanClassName:L},c.createElement(ga,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:B,isSelecting:!!H,selectionMode:m},e,F&&c.createElement(Ma,{onSelectionContextMenu:D,noPanClassName:L,disableKeyboardA11y:z})))};Aa.displayName="FlowRenderer";var Da=s.memo(Aa);function Ia(e){return{...{input:Pa(e.input||yi),default:Pa(e.default||mi),output:Pa(e.output||bi),group:Pa(e.group||wi)},...Object.keys(e).filter((e=>!["input","default","output","group"].includes(e))).reduce(((t,n)=>(t[n]=Pa(e[n]||mi),t)),{})}}const La=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),za=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:a}=Yr(La,q),l=(u=e.onlyRenderVisibleElements,Yr(s.useCallback((e=>u?Zo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes()),[u])));var u;const d=s.useRef(),f=s.useMemo((()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver((e=>{const t=e.map((e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})));i(t)}));return d.current=e,e}),[]);return s.useEffect((()=>()=>{d?.current?.disconnect()}),[]),c.createElement("div",{className:"react-flow__nodes",style:Ji},l.map((i=>{let l=i.type||"default";e.nodeTypes[l]||(a?.("003",$r(l)),l="default");const s=e.nodeTypes[l]||e.nodeTypes.default,u=!!(i.draggable||t&&void 0===i.draggable),d=!!(i.selectable||o&&void 0===i.selectable),p=!!(i.connectable||n&&void 0===i.connectable),h=!!(i.focusable||r&&void 0===i.focusable),m=e.nodeExtent?ro(i.positionAbsolute,e.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:i.width??0,height:i.height??0,origin:e.nodeOrigin});return c.createElement(s,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||Po.Bottom,targetPosition:i.targetPosition||Po.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:d,isConnectable:p,isFocusable:h,resizeObserver:f,dragHandle:i.dragHandle,zIndex:i[ho]?.z??0,isParent:!!i[ho]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!i.width&&!!i.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[ho]?.handleBounds})})))};za.displayName="NodeRenderer";var Fa=s.memo(za);const ja=(e,t,n)=>n===Po.Left?e-t:n===Po.Right?e+t:e,$a=(e,t,n)=>n===Po.Top?e-t:n===Po.Bottom?e+t:e,Ba="react-flow__edgeupdater",Va=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:l})=>c.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:$([Ba,`${Ba}-${l}`]),cx:ja(t,r,e),cy:$a(n,r,e),r:r,stroke:"transparent",fill:"transparent"}),Ha=()=>!0;var Ua=e=>{const t=({id:t,className:n,type:r,data:o,onClick:i,onEdgeDoubleClick:a,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:k,targetY:S,sourcePosition:E,targetPosition:_,elementsSelectable:C,hidden:O,sourceHandleId:N,targetHandleId:P,onContextMenu:R,onMouseEnter:M,onMouseMove:T,onMouseLeave:A,reconnectRadius:D,onReconnect:I,onReconnectStart:L,onReconnectEnd:z,markerEnd:F,markerStart:j,rfId:B,ariaLabel:V,isFocusable:H,isReconnectable:U,pathOptions:W,interactionWidth:q,disableKeyboardA11y:K})=>{const X=s.useRef(null),[Y,G]=s.useState(!1),[Q,Z]=s.useState(!1),J=Gr(),ee=s.useMemo((()=>`url('#${Ko(j,B)}')`),[j,B]),te=s.useMemo((()=>`url('#${Ko(F,B)}')`),[F,B]);if(O)return null;const ne=xo(t,J.getState,a),re=xo(t,J.getState,R),oe=xo(t,J.getState,M),ie=xo(t,J.getState,T),ae=xo(t,J.getState,A),le=(e,n)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=J.getState(),i=n?b:v,a=(n?P:N)||null,l=n?"target":"source",s=o||Ha,c=n,u=r.find((e=>e.id===t));Z(!0),L?.(e,u,l);ci({event:e,handleId:a,nodeId:i,onConnect:e=>I?.(u,e),isTarget:c,getState:J.getState,setState:J.setState,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:e=>{Z(!1),z?.(e,u,l)}})},se=()=>G(!0),ce=()=>G(!1),ue=!C&&!i;return c.createElement("g",{className:$(["react-flow__edge",`react-flow__edge-${r}`,n,{selected:l,animated:u,inactive:ue,updating:Y}]),onClick:e=>{const{edges:n,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=J.getState(),l=n.find((e=>e.id===t));l&&(C&&(J.setState({nodesSelectionActive:!1}),l.selected&&a?(o({nodes:[],edges:[l]}),X.current?.blur()):r([t])),i&&i(e,l))},onDoubleClick:ne,onContextMenu:re,onMouseEnter:oe,onMouseMove:ie,onMouseLeave:ae,onKeyDown:H?e=>{if(!K&&mo.includes(e.key)&&C){const{unselectNodesAndEdges:n,addSelectedEdges:r,edges:o}=J.getState();"Escape"===e.key?(X.current?.blur(),n({edges:[o.find((e=>e.id===t))]})):r([t])}}:void 0,tabIndex:H?0:void 0,role:H?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":null===V?void 0:V||`Edge from ${v} to ${b}`,"aria-describedby":H?`${Di}-${B}`:void 0,ref:X},!Q&&c.createElement(e,{id:t,source:v,target:b,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:o,style:y,sourceX:w,sourceY:x,targetX:k,targetY:S,sourcePosition:E,targetPosition:_,sourceHandleId:N,targetHandleId:P,markerStart:ee,markerEnd:te,pathOptions:W,interactionWidth:q}),U&&c.createElement(c.Fragment,null,("source"===U||!0===U)&&c.createElement(Va,{position:E,centerX:w,centerY:x,radius:D,onMouseDown:e=>le(e,!0),onMouseEnter:se,onMouseOut:ce,type:"source"}),("target"===U||!0===U)&&c.createElement(Va,{position:_,centerX:k,centerY:S,radius:D,onMouseDown:e=>le(e,!1),onMouseEnter:se,onMouseOut:ce,type:"target"})))};return t.displayName="EdgeWrapper",s.memo(t)};function Wa(e){return{...{default:Ua(e.default||Ho),straight:Ua(e.bezier||jo),step:Ua(e.step||Fo),smoothstep:Ua(e.step||zo),simplebezier:Ua(e.simplebezier||To)},...Object.keys(e).filter((e=>!["default","bezier"].includes(e))).reduce(((t,n)=>(t[n]=Ua(e[n]||Ho),t)),{})}}function qa(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case Po.Top:return{x:r+i/2,y:o};case Po.Right:return{x:r+i,y:o+a/2};case Po.Bottom:return{x:r+i/2,y:o+a};case Po.Left:return{x:r,y:o+a/2}}}function Ka(e,t){return e?1!==e.length&&t?t&&e.find((e=>e.id===t))||null:e[0]:null}function Xa(e){const t=e?.[ho]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ya=[{level:0,isMaxLevel:!0,edges:[]}];function Ga(e,t,n){const r=Yr(s.useCallback((n=>e?n.edges.filter((e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:l,transform:s}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=so({x:(0-s[0])/s[2],y:(0-s[1])/s[2],width:a/s[2],height:l/s[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})})):n.edges),[e,t]));return function(e,t,n=!1){let r=-1;const o=e.reduce(((e,o)=>{const i=po(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,l=Math.max(n?.[ho]?.z||0,e?.[ho]?.z||0,1e3);a=(i?o.zIndex:0)+(r?l:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e}),{}),i=Object.entries(o).map((([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}}));return 0===i.length?Ya:i}(r,t,n)}const Qa={[No.Arrow]:({color:e="none",strokeWidth:t=1})=>c.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[No.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>c.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Za=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const u=function(e){const t=Gr();return s.useMemo((()=>Object.prototype.hasOwnProperty.call(Qa,e)?Qa[e]:(t.getState().onError?.("009",Hr(e)),null)),[e])}(t);return u?c.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},c.createElement(u,{color:n,strokeWidth:a})):null},Ja=({defaultColor:e,rfId:t})=>{const n=Yr(s.useCallback((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce(((n,o)=>([o.markerStart,o.markerEnd].forEach((o=>{if(o&&"object"==typeof o){const i=Ko(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}})),n)),[]).sort(((e,t)=>e.id.localeCompare(t.id)))})({defaultColor:e,rfId:t}),[e,t]),((e,t)=>!(e.length!==t.length||e.some(((e,n)=>e.id!==t[n].id)))));return c.createElement("defs",null,n.map((e=>c.createElement(Za,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient}))))};Ja.displayName="MarkerDefinitions";var el=s.memo(Ja);const tl=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),nl=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:v})=>{const{edgesFocusable:b,edgesUpdatable:w,elementsSelectable:x,width:k,height:S,connectionMode:E,nodeInternals:_,onError:C}=Yr(tl,q),O=Ga(t,_,n);return k?c.createElement(c.Fragment,null,O.map((({level:t,edges:n,isMaxLevel:y})=>c.createElement("svg",{key:t,style:{zIndex:t},width:k,height:S,className:"react-flow__edges react-flow__container"},y&&c.createElement(el,{defaultColor:e,rfId:r}),c.createElement("g",null,n.map((e=>{const[t,n,y]=Xa(_.get(e.source)),[k,S,O]=Xa(_.get(e.target));if(!y||!O)return null;let N=e.type||"default";o[N]||(C?.("011",qr(N)),N="default");const P=o[N]||o.default,R=E===Eo.Strict?S.target:(S.target??[]).concat(S.source??[]),M=Ka(n.source,e.sourceHandle),T=Ka(R,e.targetHandle),A=M?.position||Po.Bottom,D=T?.position||Po.Top,I=!!(e.focusable||b&&void 0===e.focusable),L=e.reconnectable||e.updatable,z=void 0!==p&&(L||w&&void 0===L);if(!M||!T)return C?.("008",Ur(M,e)),null;const{sourceX:F,sourceY:j,targetX:B,targetY:V}=((e,t,n,r,o,i)=>{const a=qa(n,e,t),l=qa(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}})(t,M,A,k,T,D);return c.createElement(P,{key:e.id,id:e.id,className:$([e.className,i]),type:N,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:F,sourceY:j,targetX:B,targetY:V,sourcePosition:A,targetPosition:D,elementsSelectable:x,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:r,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:z,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:v})})))))),y):null};nl.displayName="EdgeRenderer";var rl=s.memo(nl);const ol=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function il({children:e}){const t=Yr(ol);return c.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}const al={[Po.Left]:Po.Right,[Po.Right]:Po.Left,[Po.Top]:Po.Bottom,[Po.Bottom]:Po.Top},ll=({nodeId:e,handleType:t,style:n,type:r=Oo.Bezier,CustomComponent:o,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:u,toY:d,connectionMode:f}=Yr(s.useCallback((t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode})),[e]),q),p=a?.[ho]?.handleBounds;let h=p?.[t];if(f===Eo.Loose&&(h=h||p?.["source"===t?"target":"source"]),!a||!h)return null;const m=l?h.find((e=>e.id===l)):h[0],g=m?m.x+m.width/2:(a.width??0)/2,y=m?m.y+m.height/2:a.height??0,v=(a.positionAbsolute?.x??0)+g,b=(a.positionAbsolute?.y??0)+y,w=m?.position,x=w?al[w]:null;if(!w||!x)return null;if(o)return c.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let k="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return r===Oo.Bezier?[k]=Vo(S):r===Oo.Step?[k]=Lo({...S,borderRadius:0}):r===Oo.SmoothStep?[k]=Lo(S):r===Oo.SimpleBezier?[k]=Mo(S):k=`M${v},${b} ${u},${d}`,c.createElement("path",{d:k,fill:"none",className:"react-flow__connection-path",style:n})};ll.displayName="ConnectionLine";const sl=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function cl({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:a,width:l,height:s,connectionStatus:u}=Yr(sl,q);return!!(o&&i&&l&&a)?c.createElement("svg",{style:e,width:l,height:s,className:"react-flow__edges react-flow__connectionline react-flow__container"},c.createElement("g",{className:$(["react-flow__connection",u])},c.createElement(ll,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u}))):null}function ul(e,t){s.useRef(null),Gr();return s.useMemo((()=>t(e)),[e])}const dl=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:u,onEdgeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:k,selectionKeyCode:S,selectionOnDrag:E,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:O,zoomActivationKeyCode:N,deleteKeyCode:P,onlyRenderVisibleElements:R,elementsSelectable:M,selectNodesOnDrag:T,defaultViewport:A,translateExtent:D,minZoom:I,maxZoom:L,preventScrolling:z,defaultMarkerColor:F,zoomOnScroll:j,zoomOnPinch:$,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:W,onPaneClick:q,onPaneMouseEnter:K,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:Z,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:te,onReconnect:ne,onReconnectStart:re,onReconnectEnd:oe,reconnectRadius:ie,noDragClassName:ae,noWheelClassName:le,noPanClassName:se,elevateEdgesOnSelect:ce,disableKeyboardA11y:ue,nodeOrigin:de,nodeExtent:fe,rfId:pe})=>{const he=ul(e,Ia),me=ul(t,Wa);return function(e){const t=Qi(),n=s.useRef(!1);s.useEffect((()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout((()=>e(t)),1),n.current=!0)}),[e,t.viewportInitialized])}(i),c.createElement(Da,{onPaneClick:q,onPaneMouseEnter:K,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:E,selectionMode:_,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:C,panActivationKeyCode:O,zoomActivationKeyCode:N,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:$,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:H,panOnDrag:W,defaultViewport:A,translateExtent:D,minZoom:I,maxZoom:L,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:ae,noWheelClassName:le,noPanClassName:se,disableKeyboardA11y:ue},c.createElement(il,null,c.createElement(rl,{edgeTypes:me,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:R,onEdgeContextMenu:Z,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:te,onReconnect:ne,onReconnectStart:re,onReconnectEnd:oe,reconnectRadius:ie,defaultMarkerColor:F,noPanClassName:se,elevateEdgesOnSelect:!!ce,disableKeyboardA11y:ue,rfId:pe},c.createElement(cl,{style:w,type:b,component:x,containerStyle:k})),c.createElement("div",{className:"react-flow__edgelabel-renderer"}),c.createElement(Fa,{nodeTypes:he,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:T,onlyRenderVisibleElements:R,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ue,nodeOrigin:de,nodeExtent:fe,rfId:pe})))};dl.displayName="GraphView";var fl=s.memo(dl);const pl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],hl={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:pl,nodeExtent:pl,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:(e,t)=>{},isValidConnection:void 0},ml=()=>((e,t)=>e?W(e,t):W)(((e,t)=>({...hl,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Hi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map((e=>({...r,...e})))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Hi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:s,nodeOrigin:c}=t(),u=s?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce(((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[ho]:{...n[ho],handleBounds:void 0}});else if(n){const r=to(t.nodeElement);!(!r.width||!r.height||n.width===r.width&&n.height===r.height&&!t.forceUpdate)&&(o.set(n.id,{...n,[ho]:{...n[ho],handleBounds:{source:ka(".source",t.nodeElement,f,c),target:ka(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e}),[]);Vi(o,c);const h=a||i&&!a&&Ui(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map((e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}));o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:s}=t();if(n?.length){if(i){const t=Hi(ua(n,l()),o,a,s);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,l=null;r?a=n.map((e=>fa(e,!0))):(a=pa(i(),n),l=pa(o,[])),Ki({changedNodes:a,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,l=null;r?a=n.map((e=>fa(e,!0))):(a=pa(o,n),l=pa(i(),[])),Ki({changedNodes:l,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Ki({changedNodes:(n||i()).map((e=>(e.selected=!1,fa(e.id,!1)))),changedEdges:a.map((e=>fa(e.id,!1))),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Ki({changedNodes:r().filter((e=>e.selected)).map((e=>fa(e.id,!1))),changedEdges:n.filter((e=>e.selected)).map((e=>fa(e.id,!1))),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach((e=>{e.positionAbsolute=ro(e.position,n)})),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:l}=t();if(!i||!a||!e.x&&!e.y)return!1;const s=wr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(s,c,l);i.transform(a,u);return n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:hl.connectionNodeId,connectionHandleId:hl.connectionHandleId,connectionHandleType:hl.connectionHandleType,connectionStatus:hl.connectionStatus,connectionStartHandle:hl.connectionStartHandle,connectionEndHandle:hl.connectionEndHandle}),reset:()=>e({...hl})})),Object.is),gl=({children:e})=>{const t=s.useRef(null);return t.current||(t.current=ml()),c.createElement(jr,{value:t.current},e)};gl.displayName="ReactFlowProvider";const yl=({children:e})=>s.useContext(Fr)?c.createElement(c.Fragment,null,e):c.createElement(gl,null,e);yl.displayName="ReactFlowWrapper";const vl={input:yi,default:mi,output:bi,group:wi},bl={default:Ho,straight:jo,step:Fo,smoothstep:zo,simplebezier:To},wl=[0,0],xl=[15,15],kl={x:0,y:0,zoom:1},Sl={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},El=s.forwardRef((({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=vl,edgeTypes:a=bl,onNodeClick:l,onEdgeClick:s,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:C,onNodesDelete:O,onEdgesDelete:N,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:M,onSelectionDragStop:T,onSelectionContextMenu:A,onSelectionStart:D,onSelectionEnd:I,connectionMode:L=Eo.Strict,connectionLineType:z=Oo.Bezier,connectionLineStyle:F,connectionLineComponent:j,connectionLineContainerStyle:B,deleteKeyCode:V="Backspace",selectionKeyCode:H="Shift",selectionOnDrag:U=!1,selectionMode:W=Co.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:K=(bo()?"Meta":"Control"),zoomActivationKeyCode:X=(bo()?"Meta":"Control"),snapToGrid:Y=!1,snapGrid:G=xl,onlyRenderVisibleElements:Q=!1,selectNodesOnDrag:Z=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=wl,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=kl,minZoom:le=.5,maxZoom:se=2,translateExtent:ce=pl,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=_o.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Se,onPaneScroll:Ee,onPaneContextMenu:_e,children:Ce,onEdgeContextMenu:Oe,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Me,onEdgeUpdate:Te,onEdgeUpdateStart:Ae,onEdgeUpdateEnd:De,onReconnect:Ie,onReconnectStart:Le,onReconnectEnd:ze,reconnectRadius:Fe=10,edgeUpdaterRadius:je=10,onNodesChange:$e,onEdgesChange:Be,noDragClassName:Ve="nodrag",noWheelClassName:He="nowheel",noPanClassName:Ue="nopan",fitView:We=!1,fitViewOptions:qe,connectOnClick:Ke=!0,attributionPosition:Xe,proOptions:Ye,defaultEdgeOptions:Ge,elevateNodesOnSelect:Qe=!0,elevateEdgesOnSelect:Ze=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:it,id:at,nodeDragThreshold:lt,...st},ct)=>{const ut=at||"1";return c.createElement("div",{...st,style:{...it,...Sl},ref:ct,className:$(["react-flow",o]),"data-testid":"rf__wrapper",id:at},c.createElement(yl,null,c.createElement(fl,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:a,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:j,connectionLineContainerStyle:B,selectionKeyCode:H,selectionOnDrag:U,selectionMode:W,deleteKeyCode:V,multiSelectionKeyCode:K,panActivationKeyCode:q,zoomActivationKeyCode:X,onlyRenderVisibleElements:Q,selectNodesOnDrag:Z,defaultViewport:ae,translateExtent:ce,minZoom:le,maxZoom:se,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Se,onPaneScroll:Ee,onPaneContextMenu:_e,onSelectionContextMenu:A,onSelectionStart:D,onSelectionEnd:I,onEdgeContextMenu:Oe,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Me,onReconnect:Ie??Te,onReconnectStart:Le??Ae,onReconnectEnd:ze??De,reconnectRadius:Fe??je,defaultMarkerColor:fe,noDragClassName:Ve,noWheelClassName:He,noPanClassName:Ue,elevateEdgesOnSelect:Ze,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),c.createElement(Ri,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Qe,minZoom:le,maxZoom:se,nodeExtent:de,onNodesChange:$e,onEdgesChange:Be,snapToGrid:Y,snapGrid:G,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ge,fitView:We,fitViewOptions:qe,onNodesDelete:O,onEdgesDelete:N,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:C,onSelectionDrag:M,onSelectionDragStart:R,onSelectionDragStop:T,noPanClassName:Ue,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:lt}),c.createElement(Ci,{onSelectionChange:P}),Ce,c.createElement(Jr,{proOptions:Ye,position:Xe}),c.createElement(zi,{rfId:ut,disableKeyboardA11y:Je})))}));El.displayName="ReactFlow";const _l=e=>e.getNodes();const Cl=e=>e.edges;const Ol=({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:l,strokeWidth:s,className:u,borderRadius:d,shapeRendering:f,onClick:p,selected:h})=>{const{background:m,backgroundColor:g}=i||{},y=a||m||g;return c.createElement("rect",{className:$(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,fill:y,stroke:l,strokeWidth:s,shapeRendering:f,onClick:p?t=>p(t,e):void 0})};Ol.displayName="MiniMapNode";var Nl=s.memo(Ol);const Pl=e=>e.nodeOrigin,Rl=e=>e.getNodes().filter((e=>!e.hidden&&e.width&&e.height)),Ml=e=>e instanceof Function?e:()=>e;var Tl=s.memo((function({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:i=Nl,onClick:a}){const l=Yr(Rl,q),s=Yr(Pl),u=Ml(t),d=Ml(e),f=Ml(n),p="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return c.createElement(c.Fragment,null,l.map((e=>{const{x:t,y:n}=Go(e,s).positionAbsolute;return c.createElement(i,{key:e.id,x:t,y:n,width:e.width,height:e.height,style:e.style,selected:e.selected,className:f(e),color:u(e),borderRadius:r,strokeColor:d(e),strokeWidth:o,shapeRendering:p,onClick:a,id:e.id})})))}));const Al=e=>{const t=e.getNodes(),n={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:n,boundingRect:t.length>0?(r=Qo(t,e.nodeOrigin),o=n,co(lo(so(r),so(o)))):n,rfId:e.rfId};var r,o};function Dl({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:f=1,position:p="bottom-right",onClick:h,onNodeClick:m,pannable:g=!1,zoomable:y=!1,ariaLabel:v="React Flow mini map",inversePan:b=!1,zoomStep:w=10,offsetScale:x=5}){const k=Gr(),S=s.useRef(null),{boundingRect:E,viewBB:_,rfId:C}=Yr(Al,q),O=e?.width??200,N=e?.height??150,P=E.width/O,R=E.height/N,M=Math.max(P,R),T=M*O,A=M*N,D=x*M,I=E.x-(T-E.width)/2-D,L=E.y-(A-E.height)/2-D,z=T+2*D,F=A+2*D,j=`react-flow__minimap-desc-${C}`,B=s.useRef(0);B.current=M,s.useEffect((()=>{if(S.current){const e=ut(S.current),t=e=>{const{transform:t,d3Selection:n,d3Zoom:r}=k.getState();if("wheel"!==e.sourceEvent.type||!n||!r)return;const o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*w,i=t[2]*Math.pow(2,o);r.scaleTo(n,i)},n=e=>{const{transform:t,d3Selection:n,d3Zoom:r,translateExtent:o,width:i,height:a}=k.getState();if("mousemove"!==e.sourceEvent.type||!n||!r)return;const l=B.current*Math.max(1,t[2])*(b?-1:1),s={x:t[0]-e.sourceEvent.movementX*l,y:t[1]-e.sourceEvent.movementY*l},c=[[0,0],[i,a]],u=wr.translate(s.x,s.y).scale(t[2]),d=r.constrain()(u,c,o);r.transform(n,d)},r=Pr().on("zoom",g?n:null).on("zoom.wheel",y?t:null);return e.call(r),()=>{e.on("zoom",null)}}}),[g,y,b,w]);const V=h?e=>{const t=dt(e);h(e,{x:t[0],y:t[1]})}:void 0,H=m?(e,t)=>{const n=k.getState().nodeInternals.get(t);m(e,n)}:void 0;return c.createElement(Zr,{position:p,style:e,className:$(["react-flow__minimap",t]),"data-testid":"rf__minimap"},c.createElement("svg",{width:O,height:N,viewBox:`${I} ${L} ${z} ${F}`,role:"img","aria-labelledby":j,ref:S,onClick:V},v&&c.createElement("title",{id:j},v),c.createElement(Tl,{onClick:H,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),c.createElement("path",{className:"react-flow__minimap-mask",d:`M${I-D},${L-D}h${z+2*D}v${F+2*D}h${-z-2*D}z\n M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fill:u,fillRule:"evenodd",stroke:d,strokeWidth:f,pointerEvents:"none"})))}Dl.displayName="MiniMap";var Il,Ll=s.memo(Dl);function zl({color:e,dimensions:t,lineWidth:n}){return c.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Fl({color:e,radius:t}){return c.createElement("circle",{cx:t,cy:t,r:t,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Il||(Il={}));const jl={[Il.Dots]:"#91919a",[Il.Lines]:"#eee",[Il.Cross]:"#e2e2e2"},$l={[Il.Dots]:1,[Il.Lines]:1,[Il.Cross]:6},Bl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Vl({id:e,variant:t=Il.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:a,style:l,className:u}){const d=s.useRef(null),{transform:f,patternId:p}=Yr(Bl,q),h=a||jl[t],m=r||$l[t],g=t===Il.Dots,y=t===Il.Cross,v=Array.isArray(n)?n:[n,n],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,k=g?[w/i,w/i]:[x[0]/i,x[1]/i];return c.createElement("svg",{className:$(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},c.createElement("pattern",{id:p+e,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`},g?c.createElement(Fl,{color:h,radius:w/i}):c.createElement(zl,{dimensions:x,color:h,lineWidth:o})),c.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}Vl.displayName="Background";var Hl=s.memo(Vl);const Ul=({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})=>[`${e}:${t}`,`${n}:${r}`].sort().join("--"),Wl=0,ql=10,Kl=20,Xl=30,Yl=ql,Gl=e=>"string"==typeof e?e:e===Wl?"DEBUG":e===ql?"INFO":e===Kl?"WARN":e===Xl?"ERROR":"UNKNOWN";class Ql{constructor(e,t=ql){this.name=e,this.level=(e=>{if("number"==typeof e)return e;const t=e.toLowerCase();if("debug"===t)return Wl;if("info"===t)return ql;if("warn"===t||"warning"===t)return Kl;if("error"===t)return Xl;throw new Error(`Unknown log level: ${e}`)})(t),this._level_name=Gl(t)}set_level(e){this.level=e,this._level_name=Gl(e)}_fomat_message(e,...t){return`[${this.name}] ${this._level_name}: ${e} ${t.map((e=>JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}()))).join(" ")}`}debug(e,...t){this.level<=Wl&&console.debug(this._fomat_message(e,...t))}info(e,...t){this.level<=ql&&console.info(this._fomat_message(e,...t))}warn(e,...t){this.level<=Kl&&console.warn(this._fomat_message(e,...t))}error(e,...t){this.level<=Xl&&console.error(this._fomat_message(e,...t))}}const Zl=(e,t)=>("<NoValue>"===e.value&&(e.value=void 0),"<NoValue>"===e.fullvalue&&(e.fullvalue=void 0),void 0===e.try_get_full_value&&(e.try_get_full_value=()=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.get_io_full_value({nid:e.node,ioid:e.id})}),void 0===e.hidden&&(e.hidden=!1),void 0===e.set_hidden&&(e.set_hidden=n=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.update_io_options({nid:e.node,ioid:e.id,options:{hidden:n}})}),e),Jl=(e,t,n)=>{if(((e,t)=>{const n=e.frontend||{};if(n.size||(n.size=[200,100]),!n.pos||2!==n.pos.length||isNaN(n.pos[0])||null===n.pos[0]||isNaN(n.pos[1])||null===n.pos[1])if(t&&t.rf_instance&&null!==t.reactflowRef){const e=t.reactflowRef.getBoundingClientRect(),r=e.left+e.width/2,o=e.top+e.height/2,i=t.rf_instance.screenToFlowPosition({x:r,y:o});n.pos=[i.x-n.size[0]/2,i.y-n.size[1]/2]}else n.pos=[0,0];n.collapsed||(n.collapsed=!1),e.frontend=n})(e,n),void 0===(e=F(e)).id)throw new Error("Node must have an id");for(const t in e.io)e.io[t].node=e.id,Zl(e.io[t],n);return{position:{x:e.frontend.pos[0],y:e.frontend.pos[1]},data:{UseNodeStore:t},type:"default",...e}},es=e=>{const t={...e},n=e=>{const t=o.getState();if(e.from_remote){let n=i.get_node(e.node.id,!1);if(!n)try{n=(e=>P(((t,n)=>F(j(e)))))(e.node),i.nodesstates.set(e.node.id,n)}catch(e){return}const r=n.getState();l.logger.info("Add node",r.id,r.name);const a=[...t.nodes,Jl(r,n,l)];o.setState({nodes:a});for(const t in e.node.io){const n=e.node.io[t].id;void 0!==n&&l.worker?.get_io_value({nid:e.node.id,ioid:n})}}},r=e=>{switch(e.type){case"add":n(e);break;case"update":(e=>{if(e.node.in_trigger&&(e.node.error=void 0),e.from_remote){const t=i.get_node(e.id,!1);if(!t)return;j(e.node);const n=t.getState(),{new_obj:r,change:o}=T(n,e.node);if(o){if(e.node.io)for(const t in e.node.io){r.io[t].fullvalue=e.node.io[t]?.fullvalue;for(const t in e.node.io){const n=e.node.io[t],o=r.io[t];n.hasOwnProperty("value")&&(void 0===n.value?o.value=null:"<NoValue>"===n.value?o.value=void 0:o.value=n.value)}}Jl(r,t,l),l.logger.debug("update_action",r),t.setState(F(r))}}else l.worker&&l.worker.locally_update_node(e)})(e);break;case"delete":(e=>{l.logger.info("Deleting node",e.id),e.from_remote?o.getState().onNodesChange([{type:"remove",id:e.id}]):l.worker?.remove_node(e.id)})(e);break;case"error":(e=>{l.logger.error("Error",e),r({type:"update",id:e.id,node:{in_trigger:!1,error:e.error},from_remote:!0})})(e);break;case"trigger":(e=>{e.from_remote?r({type:"update",id:e.id,node:{in_trigger:!0,error:void 0},from_remote:!0}):l.worker?.trigger_node(e.id)})(e);break;default:l.logger.error("Unknown node action",e)}},o=(({on_node_change:e,on_edge_change:t,on_connect:n})=>{const r=e||(e=>{}),o=n||(e=>{}),i=P(((e,t)=>({nodes:[],edges:[],onNodesChange:n=>{e({nodes:ua(n,t().nodes)}),r(n)},onEdgesChange:n=>{e({edges:da(n,t().edges)})},onConnect:e=>{null!=e.source&&null!=e.target&&o(e)}})));return i})({on_node_change:e=>{for(const t of e)switch(t.type){case"position":t.position&&r({type:"update",id:t.id,node:{frontend:{pos:[t.position.x,t.position.y]}},from_remote:!1});break;case"dimensions":t.dimensions&&r({type:"update",id:t.id,node:{frontend:{size:[t.dimensions.width,t.dimensions.height]}},from_remote:!1})}},on_edge_change:e=>{},on_connect:e=>{null!==e.source&&null!==e.target&&null!==e.sourceHandle&&null!==e.targetHandle&&l.worker&&l.worker.add_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle,replace:!0})}}),i=(({})=>{const e=new Map;return{nodesstates:e,get_node:(t,n=!0)=>{const r=e.get(t);if(!r&&n){const n=e.keys();throw new Error(`Node ${t} not found, available nodes: ${Array.from(n)}`)}return r}}})({}),a={libstate:P(((e,t)=>({lib:{shelves:[]},external_worker:[],set:t=>e((e=>({...e,...t}))),get_lib:()=>t().lib,get_external_worker:()=>t().external_worker})))},l={local_settings:P(((e,t)=>({view_settings:{expand_node_props:!1},update_view_settings:e=>{const t=l.local_settings.getState().view_settings,{new_obj:n,change:r}=T(t,e);r&&l.local_settings.setState((e=>({...e,view_settings:n})))}}))),local_state:P(((e,t)=>({selected_nodes:[],selected_edges:[]}))),options:t,lib:a,workermanager:void 0,workers:P(((e,t)=>({}))),workerstate:P(((e,t)=>({is_open:!1}))),render_options:P(((e,t)=>({}))),progress_state:P(((e,t)=>({message:"please select worker",status:"info",progress:0,blocking:!1}))),update_render_options:e=>{const t=l.render_options.getState(),{new_obj:n,change:r}=T(t,e);r&&l.render_options.setState(n)},worker:void 0,_unsubscribeFromWorker:void 0,set_worker:e=>{e!==l.worker&&(l._unsubscribeFromWorker&&(l._unsubscribeFromWorker(),l._unsubscribeFromWorker=void 0),e&&(l._unsubscribeFromWorker=e.state.subscribe((e=>{l.workerstate.setState(e)})),l.workerstate.setState(e.state.getState())),l.worker=e,e?.set_zustand(l))},nodespace:i,useReactFlowStore:o,on_node_action:r,on_edge_action:e=>{const t=o.getState();switch(e.type){case"add":if(e.from_remote){const n=t.edges,r=Ul(e);if(n.some((e=>e.id===r)))return;const i={id:r,source:e.src_nid,target:e.trg_nid,sourceHandle:e.src_ioid,targetHandle:e.trg_ioid,className:"funcnodes-edge animated"};l.logger.info("Adding edge",i),o.setState({edges:[...n,i]}),l.worker?.get_remote_node_state(e.src_nid),l.worker?.get_remote_node_state(e.trg_nid)}break;case"delete":if(e.from_remote){const n=t.edges,r=Ul(e);l.logger.info("Deleting edge",r);const i=n.filter((e=>e.id!==r));o.setState({edges:i}),l.worker?.get_remote_node_state(e.src_nid),l.worker?.get_remote_node_state(e.trg_nid)}break;default:l.logger.error("Unknown edge action",e)}},reactflowRef:null,clear_all:()=>{l.worker?.disconnect(),l.set_worker(void 0),l.workermanager?.setWorker(void 0),l.lib.libstate.getState().set({lib:{shelves:[]},external_worker:[]}),l.nodespace.nodesstates.clear(),l.useReactFlowStore.setState({nodes:[],edges:[]}),l.auto_progress()},set_progress:e=>{if(""===e.message)return l.auto_progress();const t=l.progress_state.getState(),{new_obj:n,change:r}=T(t,e);r&&l.progress_state.setState(n)},auto_progress:()=>void 0===l.workermanager||l.workermanager.open?void 0===l.worker?l.set_progress({progress:0,message:"please select worker",status:"error",blocking:!1}):l.worker.is_open?void l.set_progress({progress:1,message:"running",status:"info",blocking:!1}):l.set_progress({progress:0,message:"connecting to worker",status:"info",blocking:!0}):l.set_progress({progress:0,message:"connecting to worker manager",status:"error",blocking:!1}),plugins:P(((e,t)=>({}))),add_plugin:(e,t)=>{void 0!==t&&l.plugins.setState((n=>({...n,[e]:t})))},dev_settings:{debug:!0},logger:new Ql("fn",Yl)};return l};function ts(e,t){return function(){return e.apply(t,arguments)}}const{toString:ns}=Object.prototype,{getPrototypeOf:rs}=Object,os=(e=>t=>{const n=ns.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),is=e=>(e=e.toLowerCase(),t=>os(t)===e),as=e=>t=>typeof t===e,{isArray:ls}=Array,ss=as("undefined");const cs=is("ArrayBuffer");const us=as("string"),ds=as("function"),fs=as("number"),ps=e=>null!==e&&"object"==typeof e,hs=e=>{if("object"!==os(e))return!1;const t=rs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ms=is("Date"),gs=is("File"),ys=is("Blob"),vs=is("FileList"),bs=is("URLSearchParams"),[ws,xs,ks,Ss]=["ReadableStream","Request","Response","Headers"].map(is);function Es(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),ls(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function _s(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Cs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:window,Os=e=>!ss(e)&&e!==Cs;const Ns=(Ps="undefined"!=typeof Uint8Array&&rs(Uint8Array),e=>Ps&&e instanceof Ps);var Ps;const Rs=is("HTMLFormElement"),Ms=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ts=is("RegExp"),As=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Es(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},Ds="abcdefghijklmnopqrstuvwxyz",Is="0123456789",Ls={DIGIT:Is,ALPHA:Ds,ALPHA_DIGIT:Ds+Ds.toUpperCase()+Is};const zs=is("AsyncFunction"),Fs=(js="function"==typeof setImmediate,$s=ds(Cs.postMessage),js?setImmediate:$s?((e,t)=>(Cs.addEventListener("message",(({source:n,data:r})=>{n===Cs&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),Cs.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var js,$s;const Bs="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Cs):"undefined"!=typeof process&&process.nextTick||Fs;var Vs={isArray:ls,isArrayBuffer:cs,isBuffer:function(e){return null!==e&&!ss(e)&&null!==e.constructor&&!ss(e.constructor)&&ds(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ds(e.append)&&("formdata"===(t=os(e))||"object"===t&&ds(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&cs(e.buffer),t},isString:us,isNumber:fs,isBoolean:e=>!0===e||!1===e,isObject:ps,isPlainObject:hs,isReadableStream:ws,isRequest:xs,isResponse:ks,isHeaders:Ss,isUndefined:ss,isDate:ms,isFile:gs,isBlob:ys,isRegExp:Ts,isFunction:ds,isStream:e=>ps(e)&&ds(e.pipe),isURLSearchParams:bs,isTypedArray:Ns,isFileList:vs,forEach:Es,merge:function e(){const{caseless:t}=Os(this)&&this||{},n={},r=(r,o)=>{const i=t&&_s(n,o)||o;hs(n[i])&&hs(r)?n[i]=e(n[i],r):hs(r)?n[i]=e({},r):ls(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Es(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Es(t,((t,r)=>{n&&ds(t)?e[r]=ts(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&rs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:os,kindOfTest:is,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ls(e))return e;let t=e.length;if(!fs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Rs,hasOwnProperty:Ms,hasOwnProp:Ms,reduceDescriptors:As,freezeMethods:e=>{As(e,((t,n)=>{if(ds(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ds(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ls(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_s,window:Cs,isContextDefined:Os,ALPHABET:Ls,generateString:(e=16,t=Ls.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&ds(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ps(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=ls(e)?[]:{};return Es(e,((e,t)=>{const i=n(e,r+1);!ss(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:zs,isThenable:e=>e&&(ps(e)||ds(e))&&ds(e.then)&&ds(e.catch),setImmediate:Fs,asap:Bs};function Hs(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Vs.inherits(Hs,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Vs.toJSONObject(this.config),code:this.code,status:this.status}}});const Us=Hs.prototype,Ws={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ws[e]={value:e}})),Object.defineProperties(Hs,Ws),Object.defineProperty(Us,"isAxiosError",{value:!0}),Hs.from=(e,t,n,r,o,i)=>{const a=Object.create(Us);return Vs.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Hs.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function qs(e){return Vs.isPlainObject(e)||Vs.isArray(e)}function Ks(e){return Vs.endsWith(e,"[]")?e.slice(0,-2):e}function Xs(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ks(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ys=Vs.toFlatObject(Vs,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Gs(e,t,n){if(!Vs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Vs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Vs.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Vs.isSpecCompliantForm(t);if(!Vs.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(Vs.isDate(e))return e.toISOString();if(!l&&Vs.isBlob(e))throw new Hs("Blob is not supported. Use a Buffer instead.");return Vs.isArrayBuffer(e)||Vs.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let l=e;if(e&&!o&&"object"==typeof e)if(Vs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Vs.isArray(e)&&function(e){return Vs.isArray(e)&&!e.some(qs)}(e)||(Vs.isFileList(e)||Vs.endsWith(n,"[]"))&&(l=Vs.toArray(e)))return n=Ks(n),l.forEach((function(e,r){!Vs.isUndefined(e)&&null!==e&&t.append(!0===a?Xs([n],r,i):null===a?n:n+"[]",s(e))})),!1;return!!qs(e)||(t.append(Xs(o,n,i),s(e)),!1)}const u=[],d=Object.assign(Ys,{defaultVisitor:c,convertValue:s,isVisitable:qs});if(!Vs.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Vs.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Vs.forEach(n,(function(n,i){!0===(!(Vs.isUndefined(n)||null===n)&&o.call(t,n,Vs.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t}function Qs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Zs(e,t){this._pairs=[],e&&Gs(e,this,t)}const Js=Zs.prototype;function ec(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tc(e,t,n){if(!t)return e;const r=n&&n.encode||ec;Vs.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Vs.isURLSearchParams(t)?t.toString():new Zs(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Js.append=function(e,t){this._pairs.push([e,t])},Js.toString=function(e){const t=e?function(t){return e.call(this,t,Qs)}:Qs;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class nc{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vs.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var rc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zs,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ic="undefined"!=typeof window&&"undefined"!=typeof document,ac="object"==typeof navigator&&navigator||void 0,lc=ic&&(!ac||["ReactNative","NativeScript","NS"].indexOf(ac.product)<0),sc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cc=ic&&window.location.href||"http://localhost";var uc={...Object.freeze({__proto__:null,hasBrowserEnv:ic,hasStandardBrowserEnv:lc,hasStandardBrowserWebWorkerEnv:sc,navigator:ac,origin:cc}),...oc};function dc(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),l=o>=e.length;if(i=!i&&Vs.isArray(r)?r.length:i,l)return Vs.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&Vs.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Vs.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(Vs.isFormData(e)&&Vs.isFunction(e.entries)){const n={};return Vs.forEachEntry(e,((e,r)=>{t(function(e){return Vs.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const fc={transitional:rc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Vs.isObject(e);o&&Vs.isHTMLForm(e)&&(e=new FormData(e));if(Vs.isFormData(e))return r?JSON.stringify(dc(e)):e;if(Vs.isArrayBuffer(e)||Vs.isBuffer(e)||Vs.isStream(e)||Vs.isFile(e)||Vs.isBlob(e)||Vs.isReadableStream(e))return e;if(Vs.isArrayBufferView(e))return e.buffer;if(Vs.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Gs(e,new uc.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return uc.isNode&&Vs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Vs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Gs(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Vs.isString(e))try{return(t||JSON.parse)(e),Vs.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||fc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Vs.isResponse(e)||Vs.isReadableStream(e))return e;if(e&&Vs.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Hs.from(e,Hs.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:uc.classes.FormData,Blob:uc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vs.forEach(["delete","get","head","post","put","patch"],(e=>{fc.headers[e]={}}));const pc=Vs.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const hc=Symbol("internals");function mc(e){return e&&String(e).trim().toLowerCase()}function gc(e){return!1===e||null==e?e:Vs.isArray(e)?e.map(gc):String(e)}function yc(e,t,n,r,o){return Vs.isFunction(r)?r.call(this,t,n):(o&&(t=n),Vs.isString(t)?Vs.isString(r)?-1!==t.indexOf(r):Vs.isRegExp(r)?r.test(t):void 0:void 0)}let vc=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=mc(t);if(!o)throw new Error("header name must be a non-empty string");const i=Vs.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=gc(e))}const i=(e,t)=>Vs.forEach(e,((e,n)=>o(e,n,t)));if(Vs.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Vs.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&pc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Vs.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=mc(e)){const n=Vs.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Vs.isFunction(t))return t.call(this,e,n);if(Vs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=mc(e)){const n=Vs.findKey(this,e);return!(!n||void 0===this[n]||t&&!yc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=mc(e)){const o=Vs.findKey(n,e);!o||t&&!yc(0,n[o],o,t)||(delete n[o],r=!0)}}return Vs.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!yc(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Vs.forEach(this,((r,o)=>{const i=Vs.findKey(n,o);if(i)return t[i]=gc(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=gc(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vs.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Vs.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[hc]=this[hc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=mc(e);t[r]||(!function(e,t){const n=Vs.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Vs.isArray(e)?e.forEach(r):r(e),this}};function bc(e,t){const n=this||fc,r=t||n,o=vc.from(r.headers);let i=r.data;return Vs.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function wc(e){return!(!e||!e.__CANCEL__)}function xc(e,t,n){Hs.call(this,null==e?"canceled":e,Hs.ERR_CANCELED,t,n),this.name="CanceledError"}function kc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Hs("Request failed with status code "+n.status,[Hs.ERR_BAD_REQUEST,Hs.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}vc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vs.reduceDescriptors(vc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Vs.freezeMethods(vc),Vs.inherits(xc,Hs,{__CANCEL__:!0});const Sc=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(l){const s=Date.now(),c=r[a];o||(o=s),n[i]=l,r[i]=s;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),s-o<t)return;const f=c&&s-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),l=t-o;l>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-l)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,l=i-r,s=o(l);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},Ec=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_c=e=>(...t)=>Vs.asap((()=>e(...t)));var Cc=uc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,uc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(uc.origin),uc.navigator&&/(msie|trident)/i.test(uc.navigator.userAgent)):()=>!0,Oc=uc.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];Vs.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Vs.isString(r)&&a.push("path="+r),Vs.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Nc(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pc=e=>e instanceof vc?{...e}:e;function Rc(e,t){t=t||{};const n={};function r(e,t,n,r){return Vs.isPlainObject(e)&&Vs.isPlainObject(t)?Vs.merge.call({caseless:r},e,t):Vs.isPlainObject(t)?Vs.merge({},t):Vs.isArray(t)?t.slice():t}function o(e,t,n,o){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Vs.isUndefined(t))return r(void 0,t)}function a(e,t){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(e,t,n)=>o(Pc(e),Pc(t),0,!0)};return Vs.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=s[r]||o,a=i(e[r],t[r],r);Vs.isUndefined(a)&&i!==l||(n[r]=a)})),n}var Mc=e=>{const t=Rc({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:l,auth:s}=t;if(t.headers=l=vc.from(l),t.url=tc(Nc(t.baseURL,t.url),e.params,e.paramsSerializer),s&&l.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Vs.isFormData(r))if(uc.hasStandardBrowserEnv||uc.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(!1!==(n=l.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];l.setContentType([e||"multipart/form-data",...t].join("; "))}if(uc.hasStandardBrowserEnv&&(o&&Vs.isFunction(o)&&(o=o(t)),o||!1!==o&&Cc(t.url))){const e=i&&a&&Oc.read(a);e&&l.set(i,e)}return t};var Tc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Mc(e);let o=r.data;const i=vc.from(r.headers).normalize();let a,l,s,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=vc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());kc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Hs("Request aborted",Hs.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Hs("Network Error",Hs.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||rc;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Hs(t,o.clarifyTimeoutError?Hs.ETIMEDOUT:Hs.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&Vs.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Vs.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([s,u]=Sc(p,!0),m.addEventListener("progress",s)),f&&m.upload&&([l,c]=Sc(f),m.upload.addEventListener("progress",l),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new xc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===uc.protocols.indexOf(y)?n(new Hs("Unsupported protocol "+y+":",Hs.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Hs?t:new xc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new Hs(`timeout ${t} of ms exceeded`,Hs.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:l}=r;return l.unsubscribe=()=>Vs.asap(a),l}},Dc=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ic=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Lc=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ic(e))yield*Dc(n,t)}(e,t);let i,a=0,l=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return l(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw l(e),e}},cancel:e=>(l(e),o.return())},{highWaterMark:2})},zc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Fc=zc&&"function"==typeof ReadableStream,jc=zc&&("function"==typeof TextEncoder?($c=new TextEncoder,e=>$c.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var $c;const Bc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Vc=Fc&&Bc((()=>{let e=!1;const t=new Request(uc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Hc=Fc&&Bc((()=>Vs.isReadableStream(new Response("").body))),Uc={stream:Hc&&(e=>e.body)};var Wc;zc&&(Wc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Uc[e]&&(Uc[e]=Vs.isFunction(Wc[e])?t=>t[e]():(t,n)=>{throw new Hs(`Response type '${e}' is not supported`,Hs.ERR_NOT_SUPPORT,n)})})));const qc=async(e,t)=>{const n=Vs.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Vs.isBlob(e))return e.size;if(Vs.isSpecCompliantForm(e)){const t=new Request(uc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vs.isArrayBufferView(e)||Vs.isArrayBuffer(e)?e.byteLength:(Vs.isURLSearchParams(e)&&(e+=""),Vs.isString(e)?(await jc(e)).byteLength:void 0)})(t):n};var Kc=zc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:s,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Mc(e);c=c?(c+"").toLowerCase():"text";let p,h=Ac([o,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(s&&Vc&&"get"!==n&&"head"!==n&&0!==(g=await qc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Vs.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ec(g,Sc(_c(s)));r=Lc(n.body,65536,e,t)}}Vs.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(p);const a=Hc&&("stream"===c||"response"===c);if(Hc&&(l||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Vs.toFiniteNumber(i.headers.get("content-length")),[n,r]=l&&Ec(t,Sc(_c(l),!0))||[];i=new Response(Lc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let y=await Uc[Vs.findKey(Uc,c)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{kc(t,n,{data:y,headers:vc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Hs("Network Error",Hs.ERR_NETWORK,e,p),{cause:t.cause||t});throw Hs.from(t,t&&t.code,e,p)}});const Xc={http:null,xhr:Tc,fetch:Kc};Vs.forEach(Xc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Yc=e=>`- ${e}`,Gc=e=>Vs.isFunction(e)||null===e||!1===e;var Qc=e=>{e=Vs.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Gc(n)&&(r=Xc[(t=String(n)).toLowerCase()],void 0===r))throw new Hs(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Hs("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Yc).join("\n"):" "+Yc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Zc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xc(null,e)}function Jc(e){Zc(e),e.headers=vc.from(e.headers),e.data=bc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qc(e.adapter||fc.adapter)(e).then((function(t){return Zc(e),t.data=bc.call(e,e.transformResponse,t),t.headers=vc.from(t.headers),t}),(function(t){return wc(t)||(Zc(e),t&&t.response&&(t.response.data=bc.call(e,e.transformResponse,t.response),t.response.headers=vc.from(t.response.headers))),Promise.reject(t)}))}const eu="1.7.9",tu={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tu[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const nu={};tu.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Hs(r(o," has been removed"+(t?" in "+t:"")),Hs.ERR_DEPRECATED);return t&&!nu[o]&&(nu[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},tu.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ru={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Hs("options must be an object",Hs.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Hs("option "+i+" must be "+n,Hs.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Hs("Unknown option "+i,Hs.ERR_BAD_OPTION)}},validators:tu};const ou=ru.validators;let iu=class{constructor(e){this.defaults=e,this.interceptors={request:new nc,response:new nc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Rc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ru.assertOptions(n,{silentJSONParsing:ou.transitional(ou.boolean),forcedJSONParsing:ou.transitional(ou.boolean),clarifyTimeoutError:ou.transitional(ou.boolean)},!1),null!=r&&(Vs.isFunction(r)?t.paramsSerializer={serialize:r}:ru.assertOptions(r,{encode:ou.function,serialize:ou.function},!0)),ru.assertOptions(t,{baseUrl:ou.spelling("baseURL"),withXsrfToken:ou.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Vs.merge(o.common,o[t.method]);o&&Vs.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=vc.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let u,d=0;if(!l){const e=[Jc.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,s),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let f=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=Jc.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=s.length;d<u;)c=c.then(s[d++],s[d++]);return c}getUri(e){return tc(Nc((e=Rc(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Vs.forEach(["delete","get","head","options"],(function(e){iu.prototype[e]=function(t,n){return this.request(Rc(n||{},{method:e,url:t,data:(n||{}).data}))}})),Vs.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Rc(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}iu.prototype[e]=t(),iu.prototype[e+"Form"]=t(!0)}));const au={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(au).forEach((([e,t])=>{au[t]=e}));const lu=function e(t){const n=new iu(t),r=ts(iu.prototype.request,n);return Vs.extend(r,iu.prototype,n,{allOwnKeys:!0}),Vs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Rc(t,n))},r}(fc);lu.Axios=iu,lu.CanceledError=xc,lu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new xc(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},lu.isCancel=wc,lu.VERSION=eu,lu.toFormData=Gs,lu.AxiosError=Hs,lu.Cancel=lu.CanceledError,lu.all=function(e){return Promise.all(e)},lu.spread=function(e){return function(t){return e.apply(null,t)}},lu.isAxiosError=function(e){return Vs.isObject(e)&&!0===e.isAxiosError},lu.mergeConfig=Rc,lu.AxiosHeaders=vc,lu.formToJSON=e=>dc(Vs.isHTMLForm(e)?new FormData(e):e),lu.getAdapter=Qc,lu.HttpStatusCode=au,lu.default=lu;const{Axios:su,AxiosError:cu,CanceledError:uu,isCancel:du,CancelToken:fu,VERSION:pu,all:hu,Cancel:mu,isAxiosError:gu,spread:yu,toFormData:vu,AxiosHeaders:bu,HttpStatusCode:wu,formToJSON:xu,getAdapter:ku,mergeConfig:Su}=lu;let Eu;const _u=new Uint8Array(16);function Cu(){if(!Eu&&(Eu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Eu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Eu(_u)}const Ou=[];for(let e=0;e<256;++e)Ou.push((e+256).toString(16).slice(1));var Nu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pu(e,t,n){if(Nu.randomUUID&&!e)return Nu.randomUUID();const r=(e=e||{}).random||(e.rng||Cu)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return Ou[e[t+0]]+Ou[e[t+1]]+Ou[e[t+2]]+Ou[e[t+3]]+"-"+Ou[e[t+4]]+Ou[e[t+5]]+"-"+Ou[e[t+6]]+Ou[e[t+7]]+"-"+Ou[e[t+8]]+Ou[e[t+9]]+"-"+Ou[e[t+10]]+Ou[e[t+11]]+Ou[e[t+12]]+Ou[e[t+13]]+Ou[e[t+14]]+Ou[e[t+15]]}(r)}class Ru{constructor(e){this.uuid=e.uuid,this.on_error=e.on_error||(e=>{this._zustand?.logger.error(e)}),this.messagePromises=new Map,this._local_nodeupdates=new Map,this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),5e3),this.state=P(((e,t)=>({is_open:!1}))),e.zustand&&this.set_zustand(e.zustand),e.on_sync_complete?this.on_sync_complete=e.on_sync_complete:this.on_sync_complete=async()=>{}}set_zustand(e){e!==this._zustand&&(this._zustand=e,e.set_worker(this),this._zustand.auto_progress(),this.stepwise_fullsync())}get is_open(){return this.state.getState().is_open}set is_open(e){this.state.setState({is_open:e})}async stepwise_fullsync(){this._zustand&&this.is_open&&(await this.sync_lib(),await this.sync_external_worker(),await this.sync_funcnodes_plugins(),await this.sync_nodespace(),await this.sync_view_state(),await this.on_sync_complete(this))}async sync_lib(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_library",wait_for_response:!0,retries:2});this._zustand.lib.libstate.getState().set({lib:e})}async sync_external_worker(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_worker_dependencies",wait_for_response:!0});this._zustand.lib.libstate.getState().set({external_worker:e})}async sync_funcnodes_plugins(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_plugin_keys",wait_for_response:!0,kwargs:{type:"react"}});for(const t of e){const e=await this._send_cmd({cmd:"get_plugin",wait_for_response:!0,kwargs:{key:t,type:"react"}});if(e.js)for(const t of e.js){const e=document.createElement("script");e.text=atob(t),document.body.appendChild(e)}if(e.css)for(const t of e.css){const e=document.createElement("style");e.innerHTML=atob(t),document.head.appendChild(e)}if(void 0!==e.module){const n=atob(e.module),r=n.length,o=new Uint8Array(r);for(let e=0;e<r;e++)o[e]=n.charCodeAt(e);const i=new Blob([o],{type:"application/javascript"}),a=URL.createObjectURL(i),l=await import(a);URL.revokeObjectURL(a),this._zustand.add_plugin(t,l.default)}}}async sync_view_state(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"view_state",wait_for_response:!0});e.renderoptions&&this._zustand.update_render_options(e.renderoptions);const t=e.nodes;if(t)for(const e in t){const n=t[e];this._zustand.on_node_action({type:"update",node:{frontend:n},id:e,from_remote:!0})}}async sync_nodespace(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_nodes",kwargs:{with_frontend:!0},wait_for_response:!0});for(const t of e)this._receive_node_added(t);const t=await this._send_cmd({cmd:"get_edges",wait_for_response:!0});for(const e of t)this._receive_edge_added(...e)}async fullsync(){if(!this._zustand)return;if(!this.is_open)return;let e;for(;;)try{e=await this._send_cmd({cmd:"full_state"});break}catch(e){this._zustand.logger.error("Error in fullsync",e)}this._zustand.logger.debug("Full state",e),this._zustand.lib.libstate.getState().set({lib:e.backend.lib,external_worker:e.worker_dependencies}),e.view.renderoptions&&this._zustand.update_render_options(e.view.renderoptions);const t=e.view.nodes;for(const n of e.backend.nodes)void 0!==t[n.id]&&(n.frontend=t[n.id]),this._receive_node_added(n);for(const t of e.backend.edges)this._receive_edge_added(...t)}async _receive_edge_added(e,t,n,r){this._zustand&&this._zustand.on_edge_action({type:"add",from_remote:!0,src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})}async trigger_node(e){await this._send_cmd({cmd:"trigger_node",kwargs:{nid:e},wait_for_response:!1})}async add_node(e){const t=await this._send_cmd({cmd:"add_node",kwargs:{id:e}});this._receive_node_added(t)}async remove_node(e){await this._send_cmd({cmd:"remove_node",kwargs:{id:e}})}async _receive_node_added(e){this._zustand&&this._zustand.on_node_action({type:"add",node:e,id:e.id,from_remote:!0})}add_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o=!1}){return this._send_cmd({cmd:"add_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o}})}remove_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}){return this._send_cmd({cmd:"remove_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}})}async add_external_worker({module:e,cls_module:t,cls_name:n}){return await this._send_cmd({cmd:"add_external_worker",kwargs:{module:e,cls_module:t,cls_name:n}})}sync_local_node_updates(){clearTimeout(this._nodeupdatetimer),this._local_nodeupdates.forEach((async(e,t)=>{const n=await this._send_cmd({cmd:"update_node",kwargs:{nid:t,data:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:n,id:t,from_remote:!0})})),this._local_nodeupdates.clear(),this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),200)}locally_update_node(e){const t=this._local_nodeupdates.get(e.id);if(t){const{new_obj:n,change:r}=T(t,e.node);r&&this._local_nodeupdates.set(e.id,n)}else this._local_nodeupdates.set(e.id,e.node);e.immediate&&this.sync_local_node_updates()}async get_remote_node_state(e){const t=await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:t,id:t.id,from_remote:!0})}set_io_value({nid:e,ioid:t,value:n,set_default:r=!1}){return this._send_cmd({cmd:"set_io_value",kwargs:{nid:e,ioid:t,value:n,set_default:r},wait_for_response:!0})}clear(){return this._send_cmd({cmd:"clear"})}save(){return this._send_cmd({cmd:"save",wait_for_response:!0})}load(e){return this._send_cmd({cmd:"load_data",kwargs:{data:e},wait_for_response:!0}).then((()=>{this.stepwise_fullsync()}))}async get_io_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{value:n}}},id:e,from_remote:!0}),n):n}async get_ios_values({nid:e}){const t=await this._send_cmd({cmd:"get_ios_values",kwargs:{nid:e},wait_for_response:!0});if(!this._zustand)return t;const n={};for(const e in t)n[e]={value:t[e]};return this._zustand.on_node_action({type:"update",node:{io:n},id:e,from_remote:!0}),t}async _send_cmd({cmd:e,kwargs:t,wait_for_response:n=!0,response_timeout:r=5e3,retries:o=2}){const i={type:"cmd",cmd:e,kwargs:t||{}};if(n){o<0&&(o=0);const t=async()=>{let t;for(;o>=0;){const n=i.id||Pu();i.id=n;const a=new Promise(((t,o)=>{const i=setTimeout((()=>{o("Timeout@wait_for_response for "+e)}),r);this.messagePromises.set(n,{resolve:e=>{clearTimeout(i),t(e),this.messagePromises.delete(n)},reject:e=>{clearTimeout(i),o(e),this.messagePromises.delete(n)}})}));await this.send(i);try{t=await a;break}catch(e){if(0===o)throw e;o-=1;continue}}return t};return t()}return this.send(i)}async send(e){throw new Error("async send(data: any) not implemented")}async upload_file({files:e,onProgressCallback:t,root:n}){throw new Error("upload_file not implemented ")}async handle_large_message_hint({}){throw new Error("async handle_large_message_hint({}: LargeMessageHint) not implemented ")}async receive_workerevent({event:e,data:t}){switch(e){case"worker_error":if(!this._zustand)return;return this._zustand.logger.error(t.error);case"update_worker_dependencies":if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({external_worker:t.worker_dependencies});case"lib_update":return void await this.sync_lib();case"fullsync":return void await this.stepwise_fullsync();case"external_worker_update":return await this.sync_lib(),void await this.sync_external_worker();default:console.warn("Unhandled worker event",e,t)}}async receive_nodespace_event({event:e,data:t}){switch(e){case"after_set_value":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value:t.result}}},id:t.node,from_remote:!0});case"after_update_value_options":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value_options:t.result}}},id:t.node,from_remote:!0});case"triggerstart":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!0},id:t.node,from_remote:!0});case"triggerdone":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!1},id:t.node,from_remote:!0});case"node_trigger_error":if(!this._zustand)return;return this._zustand.on_node_action({type:"error",errortype:"trigger",error:t.error,id:t.node,tb:t.tb,from_remote:!0});case"node_removed":if(!this._zustand)return;return this._zustand.on_node_action({type:"delete",id:t.node,from_remote:!0});case"node_added":return this._receive_node_added(t.node);case"after_disconnect":case"after_unforward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;if(!this._zustand)return;return this._zustand.on_edge_action({type:"delete",from_remote:!0,src_nid:t.result[0],src_ioid:t.result[1],trg_nid:t.result[2],trg_ioid:t.result[3]});case"after_connect":case"after_forward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;return this._receive_edge_added(...t.result);case"after_add_shelf":case"after_remove_shelf":if(!t.result)return;if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({lib:t.result});case"progress":if(!this._zustand)return;if(t.node)return this._zustand.on_node_action({type:"update",node:{id:t.node,progress:t.info},id:t.node,from_remote:!0});console.warn("Unhandled nodepsace event",e,t);break;default:console.warn("Unhandled nodepsace event",e,t)}}async add_lib(e,t){return await this._send_cmd({cmd:"add_package_dependency",kwargs:{name:e,version:t},wait_for_response:!1})}async remove_lib(e){return await this._send_cmd({cmd:"remove_package_dependency",kwargs:{name:e},wait_for_response:!1})}async receive(e){let t;switch(e.type){case"nsevent":return await this.receive_nodespace_event(e);case"result":if(t=e.id&&this.messagePromises.get(e.id),t)return t.resolve(e.result);break;case"error":if(this.on_error(e.tb+"\n"+e.error),t=e.id&&this.messagePromises.get(e.id),t)return t.reject(e.error);break;case"progress":if(!this._zustand)return;this._zustand.set_progress(e);break;case"workerevent":return await this.receive_workerevent(e);case"large_message":return await this.handle_large_message_hint(e);default:console.warn("Unhandled message",e)}}disconnect(){}onclose(){this.is_open=!1,this._zustand&&this._zustand.auto_progress()}async reconnect(){}async stop(){await this._send_cmd({cmd:"stop_worker",wait_for_response:!1});const e=this.onclose.bind(this);this.onclose=()=>{e(),this._zustand&&(this._zustand.worker===this&&this._zustand.clear_all(),this.onclose=e)}}async get_io_full_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_full_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{fullvalue:n}}},id:e,from_remote:!0}),n):n}async update_io_options({nid:e,ioid:t,options:n}){const r=await this._send_cmd({cmd:"update_io_options",kwargs:{nid:e,ioid:t,...n},wait_for_response:!0});if(!this._zustand)return r;this._zustand.on_node_action({type:"update",node:{io:{[t]:{...n}}},id:e,from_remote:!0})}async get_node_status(e){return await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0})}async get_available_modules(){return await this._send_cmd({cmd:"get_available_modules",wait_for_response:!0})}async update_external_worker(e,t,n){return await this._send_cmd({cmd:"update_external_worker",kwargs:{worker_id:e,class_id:t,...n},wait_for_response:!0})}async remove_external_worker(e,t){return await this._send_cmd({cmd:"remove_external_worker",kwargs:{worker_id:e,class_id:t},wait_for_response:!0})}async export({withFiles:e=!1}){return await this._send_cmd({cmd:"export_worker",wait_for_response:!0,kwargs:{with_files:e}})}async update_from_export(e){const t=await this._send_cmd({cmd:"update_from_export",kwargs:{data:e},wait_for_response:!0});return this.stepwise_fullsync(),t}}class Mu extends Ru{constructor(e){super(e),this._websocket=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=5e3,this._reconnect=!0,this._url=e.url,new Promise((e=>{this.connect(),e(null)})),this._zustand&&this._zustand.auto_progress()}connect(){this._zustand?.logger.info("Connecting to websocket"),this.is_open=!1,this._websocket=new WebSocket(this._url),this._websocket.onopen=()=>{this.onopen()},this._websocket.onclose=()=>{this.onclose()},this._websocket.onerror=()=>{this.on_ws_error()},this._websocket.onmessage=e=>{this.onmessage(e.data)}}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}auto_reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this._zustand?.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this._websocket&&this._websocket.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this._zustand?.logger.warn("Maximum reconnect attempts reached. Giving up.")}async onmessage(e){const t=JSON.parse(e);this._zustand?.logger.debug(`Recieved data of length: ${e.length} and data"`,t),await this.receive(t)}get http_protocol(){return this.secure_url?"https":"http"}get secure_url(){return this._url.startsWith("wss")}get url_wo_protocol(){return this._url.substring(this.secure_url?6:5)}get http_url(){var e=this.http_protocol+"://"+this.url_wo_protocol;return"/"!==e[e.length-1]&&(e+="/"),e}async upload_file({files:e,onProgressCallback:t,root:n}){const r=`${this.http_url}upload/`,o=new FormData,i=Array.isArray(e)?e:Array.from(e);for(const e of i){const t=e.webkitRelativePath||e.name,r=n?`${n}/${t}`:t;o.append("file",e,r)}try{return(await lu.post(r,o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{t&&t(e.loaded,e.total)}})).data.file}catch(e){throw new Error("Failed to upload file")}}async handle_large_message_hint({msg_id:e}){const t=this.http_url+"message/"+e,n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}),r=await n.json();this.receive(r)}onopen(){this._zustand?.logger.info("Websocket opened"),this.is_open=!0,this._zustand&&this._zustand.auto_progress(),this.reconnectAttempts=0,this.stepwise_fullsync()}onclose(){this._zustand?.logger.info("Websocket closed"),super.onclose(),this._reconnect&&(this._zustand?.logger.info("Websocket closed,reconnecting"),this.auto_reconnect())}on_ws_error(){this._zustand?.logger.warn("Websocket error"),this._websocket?this._websocket.close():this.auto_reconnect()}async send_large_message(e){const t=`${this.http_url}message/`;await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e})}async send(e){if(!this._websocket||this._websocket.readyState!==WebSocket.OPEN)return void this._zustand?.logger.warn("Websocket not connected");const t=JSON.stringify(e);if(new Blob([t]).size>1e6)return this._zustand?.logger.info("Data too large, sending via http"),await this.send_large_message(t);this._zustand?.logger.debug("Sending data",e),this._websocket.send(t)}async stop(){await super.stop(),this._reconnect=!1}close(){this._websocket&&this._websocket.close()}disconnect(){super.disconnect(),this._reconnect=!1,this.close()}async reconnect(){await super.reconnect(),this._reconnect=!0,!this._websocket||(this._zustand?.logger.info("Reconnecting"),this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(this._websocket.readyState===WebSocket.CONNECTING&&await new Promise(((e,t)=>{if(null===this._websocket)return;let n=setTimeout((()=>{t("Timeout@reconnect")}),2e3);this._websocket.addEventListener("open",(()=>{clearTimeout(n),e(null)}),{once:!0}),this._websocket.readyState===WebSocket.OPEN&&(clearTimeout(n),e(null))})),this._websocket.readyState!==WebSocket.OPEN))?this.connect():this.stepwise_fullsync()}}class Tu{constructor(e,t){this.ws=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=2e3,this.wsuri=e,this.zustand=t,this.workers={},this.on_setWorker=e=>{this.zustand.set_worker(e)},this.connect()}get open(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.zustand.set_progress({progress:0,message:"connecting to worker manager",status:"info",blocking:!0}),this.zustand.logger.info("Connecting to websocket:",this.wsuri),this.ws=new WebSocket(this.wsuri),this.ws.onopen=()=>{this.onopen()},this.ws.onclose=()=>{this.onclose()},this.ws.onerror=()=>{this.on_ws_error()},this.ws.onmessage=e=>{this.onmessage(e.data)},this.connectionTimeout=setTimeout((()=>{this.ws?.readyState!==WebSocket.OPEN&&this.on_ws_error()}),5e3)}on_ws_error(){console.warn("Websocket error"),this.ws?this.ws.close():this.reconnect()}onopen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0),this.zustand.auto_progress(),this.ws&&this.ws.send("worker_status");const e=window.localStorage.getItem("funcnodes__active_worker");e&&this.set_active(e)}onmessage(e){let t=JSON.parse(e);if("worker_status"!==t.type)if("set_worker"!==t.type)"progress"!==t.type?this.zustand.logger.error("WorkerManager: unknown message",t):this.zustand.set_progress(t);else if("WSWorker"===t.data.type){let e="ws"+(t.data.ssl?"s":"")+"://"+t.data.host+":"+t.data.port;this.setWorker(this.workers[t.data.uuid]||new Mu({url:e,zustand:this.zustand,uuid:t.data.uuid,on_sync_complete:this.zustand.options.on_sync_complete}))}else this.zustand.logger.error("WorkerManager: unknown worker type",t);else{const e={};for(let n of t.active)n.active=!0,e[n.uuid]=n;for(let n of t.inactive)n.active=!1,e[n.uuid]=n;this.zustand.workers.setState(e)}}setWorker(e){for(let t in this.workers)t!==e?.uuid&&this.workers[t].disconnect();void 0!==e&&(this.workers[e.uuid]=e,e.reconnect()),window.localStorage.setItem("funcnodes__active_worker",e?.uuid||""),void 0!==this.zustand.worker&&this.zustand.clear_all(),this.zustand.set_worker(e),this.on_setWorker(e)}async restart_worker(e){this.ws?.send(JSON.stringify({type:"restart_worker",workerid:e}))}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this.zustand.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this.ws&&this.ws.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this.zustand.logger.warn("Maximum reconnect attempts reached. Giving up.")}onclose(){this.zustand.logger.warn("WorkerManager: onclose"),this.reconnect()}set_active(e){this.ws&&this.ws.send(JSON.stringify({type:"set_active",workerid:e}))}new_worker({name:e,reference:t,copyLib:n,copyNS:r}){e||(e=void 0),n||(n=!1),r||(r=!1),t||(t=void 0,n=!1,r=!1),this.ws&&this.ws.send(JSON.stringify({type:"new_worker",kwargs:{name:e,reference:t,copyLib:n,copyNS:r}}))}}function Au(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Du(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Iu(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Du(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Du(e[t],null)}}}}function Lu(...e){return s.useCallback(Iu(...e),e)}var zu,Fu,ju={exports:{}},$u={};var Bu=(Fu||(Fu=1,ju.exports=function(){if(zu)return $u;zu=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return $u.Fragment=t,$u.jsx=n,$u.jsxs=n,$u}()),ju.exports);function Vu(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>s.createContext(e)));return function(n){const r=n?.[e]||t;return s.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=s.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,c=s.useMemo((()=>a),Object.values(a));return Bu.jsx(l.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const l=a?.[e]?.[i]||o,c=s.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Hu(r,...t)]}function Hu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return s.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var Uu=Boolean(globalThis?.document)?s.useLayoutEffect:()=>{},Wu=u["useId".toString()]||(()=>{}),qu=0;function Ku(e){const[t,n]=s.useState(Wu());return Uu((()=>{n((e=>e??String(qu++)))}),[e]),e||(t?`radix-${t}`:"")}function Xu(e){const t=s.useRef(e);return s.useEffect((()=>{t.current=e})),s.useMemo((()=>(...e)=>t.current?.(...e)),[])}function Yu({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=s.useState(e),[r]=n,o=s.useRef(r),i=Xu(t);return s.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:r,l=Xu(n);return[a,s.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l])]}var Gu=s.forwardRef(((e,t)=>{const{children:n,...r}=e,o=s.Children.toArray(n),i=o.find(Ju);if(i){const e=i.props.children,n=o.map((t=>t===i?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t));return Bu.jsx(Qu,{...r,ref:t,children:s.isValidElement(e)?s.cloneElement(e,void 0,n):null})}return Bu.jsx(Qu,{...r,ref:t,children:n})}));Gu.displayName="Slot";var Qu=s.forwardRef(((e,t)=>{const{children:n,...r}=e;if(s.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==s.Fragment&&(o.ref=t?Iu(t,e):e),s.cloneElement(n,o)}return s.Children.count(n)>1?s.Children.only(null):null}));Qu.displayName="SlotClone";var Zu=({children:e})=>Bu.jsx(Bu.Fragment,{children:e});function Ju(e){return s.isValidElement(e)&&e.type===Zu}var ed=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=s.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?Gu:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Bu.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function td(e,t){e&&Lr.flushSync((()=>e.dispatchEvent(t)))}var nd,rd="dismissableLayer.update",od="dismissableLayer.pointerDownOutside",id="dismissableLayer.focusOutside",ad=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ld=s.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=s.useContext(ad),[d,f]=s.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=s.useState({}),m=Lu(t,(e=>f(e))),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=b>=v,k=function(e,t=globalThis?.document){const n=Xu(e),r=s.useRef(!1),o=s.useRef((()=>{}));return s.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){ud(od,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...u.branches].some((e=>e.contains(t)));x&&!n&&(o?.(e),a?.(e),e.defaultPrevented||l?.())}),p),S=function(e,t=globalThis?.document){const n=Xu(e),r=s.useRef(!1);return s.useEffect((()=>{const e=e=>{if(e.target&&!r.current){ud(id,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(i?.(e),a?.(e),e.defaultPrevented||l?.())}),p);return function(e,t=globalThis?.document){const n=Xu(e);s.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{b===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),p),s.useEffect((()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(nd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),cd(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=nd)}}),[d,p,n,u]),s.useEffect((()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),cd())}),[d,u]),s.useEffect((()=>{const e=()=>h({});return document.addEventListener(rd,e),()=>document.removeEventListener(rd,e)}),[]),Bu.jsx(ed.div,{...c,ref:m,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:Au(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Au(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Au(e.onPointerDownCapture,k.onPointerDownCapture)})}));ld.displayName="DismissableLayer";var sd=s.forwardRef(((e,t)=>{const n=s.useContext(ad),r=s.useRef(null),o=Lu(t,r);return s.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Bu.jsx(ed.div,{...e,ref:o})}));function cd(){const e=new CustomEvent(rd);document.dispatchEvent(e)}function ud(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?td(o,i):o.dispatchEvent(i)}sd.displayName="DismissableLayerBranch";var dd="focusScope.autoFocusOnMount",fd="focusScope.autoFocusOnUnmount",pd={bubbles:!1,cancelable:!0},hd=s.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=s.useState(null),u=Xu(o),d=Xu(i),f=s.useRef(null),p=Lu(t,(e=>c(e))),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect((()=>{if(r){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:vd(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||vd(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,l,h.paused]),s.useEffect((()=>{if(l){bd.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(dd,pd);l.addEventListener(dd,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vd(r,{select:t}),document.activeElement!==n)return}((e=md(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&vd(l))}return()=>{l.removeEventListener(dd,u),setTimeout((()=>{const e=new CustomEvent(fd,pd);l.addEventListener(fd,d),l.dispatchEvent(e),e.defaultPrevented||vd(t??document.body,{select:!0}),l.removeEventListener(fd,d),bd.remove(h)}),0)}}var e}),[l,u,d,h]);const m=s.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=md(e),n=gd(t,e),r=gd(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&vd(i,{select:!0})):(e.preventDefault(),n&&vd(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,h.paused]);return Bu.jsx(ed.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})}));function md(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gd(e,t){for(const n of e)if(!yd(n,{upTo:t}))return n}function yd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function vd(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hd.displayName="FocusScope";var bd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wd(e,t),e.unshift(t)},remove(t){e=wd(e,t),e[0]?.resume()}}}();function wd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var xd=s.forwardRef(((e,t)=>{const{container:n,...r}=e,[o,i]=s.useState(!1);Uu((()=>i(!0)),[]);const a=n||o&&globalThis?.document?.body;return a?zr.createPortal(Bu.jsx(ed.div,{...r,ref:t}),a):null}));xd.displayName="Portal";var kd=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=s.useState(),r=s.useRef({}),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect((()=>{const e=Sd(r.current);i.current="mounted"===l?e:"none"}),[l]),Uu((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=Sd(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Uu((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=Sd(r.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},l=e=>{e.target===t&&(i.current=Sd(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):s.Children.only(n),i=Lu(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?s.cloneElement(o,{ref:i}):null};function Sd(e){return e?.animationName||"none"}kd.displayName="Presence";var Ed=0;function _d(){s.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cd()),document.body.insertAdjacentElement("beforeend",e[1]??Cd()),Ed++,()=>{1===Ed&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Ed--}}),[])}function Cd(){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 Od=function(){return Od=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Od.apply(this,arguments)};function Nd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Pd(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Rd="right-scroll-bar-position",Md="width-before-scroll-bar";function Td(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ad="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,Dd=new WeakMap;function Id(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return Td(e,t)}))},(o=s.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return Ad((function(){var t=Dd.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||Td(e,null)})),r.forEach((function(e){n.has(e)||Td(e,o)}))}Dd.set(i,e)}),[e]),i}function Ld(e){return e}var zd=function(e){var t=e.sideCar,n=Nd(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 s.createElement(r,Od({},n))};zd.isSideCarExport=!0;var Fd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Ld);var n=[],r=!1,o={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(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=Od({async:!0,ssr:!1},e),t}(),jd=function(){},$d=s.forwardRef((function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=void 0===y?"div":y,b=e.gapMode,w=Nd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,k=Id([n,t]),S=Od(Od({},w),o);return s.createElement(s.Fragment,null,d&&s.createElement(x,{sideCar:Fd,removeScrollBar:u,shards:f,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?s.cloneElement(s.Children.only(l),Od(Od({},S),{ref:k})):s.createElement(v,Od({},S,{className:c,ref:k}),l))}));$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$d.classNames={fullWidth:Md,zeroRight:Rd};function Bd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Vd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=Bd())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hd=function(){var e,t=(e=Vd(),function(t,n){s.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Ud={left:0,top:0,right:0,gap:0},Wd=function(e){return parseInt(e||"",10)||0},qd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ud;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Wd(n),Wd(r),Wd(o)]}(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])}},Kd=Hd(),Xd="data-scroll-locked",Yd=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(Xd,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Rd," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Md," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Rd," .").concat(Rd," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Md," .").concat(Md," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Xd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},Gd=function(){var e=parseInt(document.body.getAttribute(Xd)||"0",10);return isFinite(e)?e:0},Qd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;s.useEffect((function(){return document.body.setAttribute(Xd,(Gd()+1).toString()),function(){var e=Gd()-1;e<=0?document.body.removeAttribute(Xd):document.body.setAttribute(Xd,e.toString())}}),[]);var i=s.useMemo((function(){return qd(o)}),[o]);return s.createElement(Kd,{styles:Yd(i,!t,o,n?"":"!important")})},Zd=!1;if("undefined"!=typeof window)try{var Jd=Object.defineProperty({},"passive",{get:function(){return Zd=!0,!0}});window.addEventListener("test",Jd,Jd),window.removeEventListener("test",Jd,Jd)}catch(e){Zd=!1}var ef=!!Zd&&{passive:!1},tf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},nf=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rf(e,r)){var o=of(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rf=function(e,t){return"v"===e?function(e){return tf(e,"overflowY")}(t):function(e){return tf(e,"overflowX")}(t)},of=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},af=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lf=function(e){return[e.deltaX,e.deltaY]},sf=function(e){return e&&"current"in e?e.current:e},cf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},uf=0,df=[];function ff(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pf,hf=(pf=function(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(uf++)[0],i=s.useState(Hd)[0],a=s.useRef(e);s.useEffect((function(){a.current=e}),[e]),s.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Pd([e.lockRef.current],(e.shards||[]).map(sf),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=af(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=nf(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=nf(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),s=!1,c=i>0,u=0,d=0;do{var f=of(e,a),p=f[0],h=f[1]-f[2]-o*p;(p||h)&&rf(e,a)&&(u+=h,d+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:c)}),[]),c=s.useCallback((function(e){var n=e;if(df.length&&df[df.length-1]===i){var r="deltaY"in n?lf(n):af(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var s=(a.current.shards||[]).map(sf).filter(Boolean).filter((function(e){return e.contains(n.target)}));(s.length>0?l(n,s[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=s.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:ff(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=s.useCallback((function(e){n.current=af(e),r.current=void 0}),[]),f=s.useCallback((function(t){u(t.type,lf(t),t.target,l(t,e.lockRef.current))}),[]),p=s.useCallback((function(t){u(t.type,af(t),t.target,l(t,e.lockRef.current))}),[]);s.useEffect((function(){return df.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ef),document.addEventListener("touchmove",c,ef),document.addEventListener("touchstart",d,ef),function(){df=df.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,ef),document.removeEventListener("touchmove",c,ef),document.removeEventListener("touchstart",d,ef)}}),[]);var h=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(i,{styles:cf(o)}):null,h?s.createElement(Qd,{gapMode:e.gapMode}):null)},Fd.useMedium(pf),zd),mf=s.forwardRef((function(e,t){return s.createElement($d,Od({},e,{ref:t,sideCar:hf}))}));mf.classNames=$d.classNames;var gf=new WeakMap,yf=new WeakMap,vf={},bf=0,wf=function(e){return e&&(e.host||wf(e.parentNode))},xf=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=wf(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);vf[n]||(vf[n]=new WeakMap);var i=vf[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(gf.get(e)||0)+1,c=(i.get(e)||0)+1;gf.set(e,s),i.set(e,c),a.push(e),1===s&&o&&yf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return u(t),l.clear(),bf++,function(){a.forEach((function(e){var t=gf.get(e)-1,o=i.get(e)-1;gf.set(e,t),i.set(e,o),t||(yf.has(e)||e.removeAttribute(r),yf.delete(e)),o||e.removeAttribute(n)})),--bf||(gf=new WeakMap,gf=new WeakMap,yf=new WeakMap,vf={})}},kf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),xf(r,o,n,"aria-hidden")):function(){return null}},Sf="Dialog",[Ef,_f]=Vu(Sf),[Cf,Of]=Ef(Sf),Nf=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=s.useRef(null),c=s.useRef(null),[u=!1,d]=Yu({prop:r,defaultProp:o,onChange:i});return Bu.jsx(Cf,{scope:t,triggerRef:l,contentRef:c,contentId:Ku(),titleId:Ku(),descriptionId:Ku(),open:u,onOpenChange:d,onOpenToggle:s.useCallback((()=>d((e=>!e))),[d]),modal:a,children:n})};Nf.displayName=Sf;var Pf="DialogTrigger",Rf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Pf,n),i=Lu(t,o.triggerRef);return Bu.jsx(ed.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yf(o.open),...r,ref:i,onClick:Au(e.onClick,o.onOpenToggle)})}));Rf.displayName=Pf;var Mf="DialogPortal",[Tf,Af]=Ef(Mf,{forceMount:void 0}),Df=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Of(Mf,t);return Bu.jsx(Tf,{scope:t,forceMount:n,children:s.Children.map(r,(e=>Bu.jsx(kd,{present:n||i.open,children:Bu.jsx(xd,{asChild:!0,container:o,children:e})})))})};Df.displayName=Mf;var If="DialogOverlay",Lf=s.forwardRef(((e,t)=>{const n=Af(If,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Of(If,e.__scopeDialog);return i.modal?Bu.jsx(kd,{present:r||i.open,children:Bu.jsx(zf,{...o,ref:t})}):null}));Lf.displayName=If;var zf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(If,n);return Bu.jsx(mf,{as:Gu,allowPinchZoom:!0,shards:[o.contentRef],children:Bu.jsx(ed.div,{"data-state":Yf(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),Ff="DialogContent",jf=s.forwardRef(((e,t)=>{const n=Af(Ff,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Of(Ff,e.__scopeDialog);return Bu.jsx(kd,{present:r||i.open,children:i.modal?Bu.jsx($f,{...o,ref:t}):Bu.jsx(Bf,{...o,ref:t})})}));jf.displayName=Ff;var $f=s.forwardRef(((e,t)=>{const n=Of(Ff,e.__scopeDialog),r=s.useRef(null),o=Lu(t,n.contentRef,r);return s.useEffect((()=>{const e=r.current;if(e)return kf(e)}),[]),Bu.jsx(Vf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{e.preventDefault(),n.triggerRef.current?.focus()})),onPointerDownOutside:Au(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()))})})),Bf=s.forwardRef(((e,t)=>{const n=Of(Ff,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return Bu.jsx(Vf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})})),Vf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=Of(Ff,n),c=s.useRef(null),u=Lu(t,c);return _d(),Bu.jsxs(Bu.Fragment,{children:[Bu.jsx(hd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:Bu.jsx(ld,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Yf(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),Bu.jsxs(Bu.Fragment,{children:[Bu.jsx(tp,{titleId:l.titleId}),Bu.jsx(np,{contentRef:c,descriptionId:l.descriptionId})]})]})})),Hf="DialogTitle",Uf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Hf,n);return Bu.jsx(ed.h2,{id:o.titleId,...r,ref:t})}));Uf.displayName=Hf;var Wf="DialogDescription",qf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Wf,n);return Bu.jsx(ed.p,{id:o.descriptionId,...r,ref:t})}));qf.displayName=Wf;var Kf="DialogClose",Xf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Kf,n);return Bu.jsx(ed.button,{type:"button",...r,ref:t,onClick:Au(e.onClick,(()=>o.onOpenChange(!1)))})}));function Yf(e){return e?"open":"closed"}Xf.displayName=Kf;var Gf,Qf,Zf="DialogTitleWarning",[Jf,ep]=function(e,t){const n=s.createContext(t),r=e=>{const{children:t,...r}=e,o=s.useMemo((()=>r),Object.values(r));return Bu.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=s.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(Zf,{contentName:Ff,titleName:Hf,docsSlug:"dialog"}),tp=({titleId:e})=>{const t=ep(Zf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect((()=>{if(e){document.getElementById(e)||console.error(n)}}),[n,e]),null},np=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ep("DialogDescriptionWarning").contentName}}.`;return s.useEffect((()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}}),[n,e,t]),null},rp=Nf,op=Rf,ip=Df,ap=Lf,lp=jf,sp=Uf,cp=qf,up=Xf,dp={exports:{}},fp={};function pp(){if(Gf)return fp;Gf=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.for("react.client.reference");function h(f){if("object"==typeof f&&null!==f){var p=f.$$typeof;switch(p){case e:switch(f=f.type){case n:case o:case r:case s:case c:return f;default:switch(f=f&&f.$$typeof){case a:case l:case d:case u:case i:return f;default:return p}}case t:return p}}}return fp.ContextConsumer=i,fp.ContextProvider=a,fp.Element=e,fp.ForwardRef=l,fp.Fragment=n,fp.Lazy=d,fp.Memo=u,fp.Portal=t,fp.Profiler=o,fp.StrictMode=r,fp.Suspense=s,fp.SuspenseList=c,fp.isContextConsumer=function(e){return h(e)===i},fp.isContextProvider=function(e){return h(e)===a},fp.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},fp.isForwardRef=function(e){return h(e)===l},fp.isFragment=function(e){return h(e)===n},fp.isLazy=function(e){return h(e)===d},fp.isMemo=function(e){return h(e)===u},fp.isPortal=function(e){return h(e)===t},fp.isProfiler=function(e){return h(e)===o},fp.isStrictMode=function(e){return h(e)===r},fp.isSuspense=function(e){return h(e)===s},fp.isSuspenseList=function(e){return h(e)===c},fp.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===o||e===r||e===s||e===c||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===i||e.$$typeof===l||e.$$typeof===p||void 0!==e.getModuleId)},fp.typeOf=h,fp}function hp(){return Qf||(Qf=1,dp.exports=pp()),dp.exports}var mp=hp();function gp(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function yp(e){if(s.isValidElement(e)||mp.isValidElementType(e)||!gp(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=yp(e[n])})),t}function vp(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return gp(e)&&gp(t)&&Object.keys(t).forEach((o=>{s.isValidElement(t[o])||mp.isValidElementType(t[o])?r[o]=t[o]:gp(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&gp(e[o])?r[o]=vp(e[o],t[o],n):n.clone?r[o]=gp(t[o])?yp(t[o]):t[o]:r[o]=t[o]})),r}var bp,wp,xp,kp,Sp,Ep,_p,Cp={exports:{}},Op={exports:{}},Np={};function Pp(){return wp||(wp=1,Op.exports=function(){if(bp)return Np;bp=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case s:case c:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case u:case h:case p:case a:return e;default:return f}}case n:return f}}}function w(e){return b(e)===c}return Np.AsyncMode=s,Np.ConcurrentMode=c,Np.ContextConsumer=l,Np.ContextProvider=a,Np.Element=t,Np.ForwardRef=u,Np.Fragment=r,Np.Lazy=h,Np.Memo=p,Np.Portal=n,Np.Profiler=i,Np.StrictMode=o,Np.Suspense=d,Np.isAsyncMode=function(e){return w(e)||b(e)===s},Np.isConcurrentMode=w,Np.isContextConsumer=function(e){return b(e)===l},Np.isContextProvider=function(e){return b(e)===a},Np.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Np.isForwardRef=function(e){return b(e)===u},Np.isFragment=function(e){return b(e)===r},Np.isLazy=function(e){return b(e)===h},Np.isMemo=function(e){return b(e)===p},Np.isPortal=function(e){return b(e)===n},Np.isProfiler=function(e){return b(e)===i},Np.isStrictMode=function(e){return b(e)===o},Np.isSuspense=function(e){return b(e)===d},Np.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Np.typeOf=b,Np}()),Op.exports}function Rp(){if(kp)return xp;kp=1;return xp="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Mp(){if(Ep)return Sp;Ep=1;var e=Rp();function t(){}function n(){}return n.resetWarningCache=t,Sp=function(){function r(t,n,r,o,i,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Sp}function Tp(){return _p||(_p=1,Cp.exports=Mp()()),Cp.exports}var Ap=Tp();function Dp(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach((e=>n.searchParams.append("args[]",e))),`Minified MUI error #${e}; visit ${n} for the full message.`}function Ip(e){if("string"!=typeof e)throw new Error(Dp(7));return e.charAt(0).toUpperCase()+e.slice(1)}const Lp="undefined"!=typeof window?s.useLayoutEffect:s.useEffect;function zp(e){const t=s.useRef(e);return Lp((()=>{t.current=e})),s.useRef(((...e)=>(0,t.current)(...e))).current}function Fp(...e){return s.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{!function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(e,t)}))}),e)}const jp={};function $p(e,t){const n=s.useRef(jp);return n.current===jp&&(n.current=e(t)),n}const Bp=[];class Vp{static create(){return new Vp}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Hp(){const e=$p(Vp.create).current;var t;return t=e.disposeEffect,s.useEffect(t,Bp),e}function Up(e){try{return e.matches(":focus-visible")}catch(e){}return!1}function Wp(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=r;if("components"===o||"slots"===o)n[o]={...e[o],...n[o]};else if("componentsProps"===o||"slotProps"===o){const r=e[o],i=t[o];if(i)if(r){n[o]={...i};for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const t=e;n[o][t]=Wp(r[t],i[t])}}else n[o]=i;else n[o]=r||{}}else void 0===n[o]&&(n[o]=e[o])}return n}function qp(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let a="",l=!0;for(let e=0;e<i.length;e+=1){const r=i[e];r&&(a+=(!0===l?"":" ")+t(r),l=!1,n&&n[r]&&(a+=" "+n[r]))}r[o]=a}return r}const Kp=e=>e,Xp=(()=>{let e=Kp;return{configure(t){e=t},generate:t=>e(t),reset(){e=Kp}}})(),Yp={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Gp(e,t,n="Mui"){const r=Yp[t];return r?`${n}-${r}`:`${Xp.generate(e)}-${t}`}function Qp(e,t,n="Mui"){const r={};return t.forEach((t=>{r[t]=Gp(e,t,n)})),r}function Zp(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Jp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zp(e))&&(r&&(r+=" "),r+=t);return r}function eh(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}function th(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const e=Jp(n?.className,i,o?.className,r?.className),t={...n?.style,...o?.style,...r?.style},a={...n,...o,...r};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=function(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}({...o,...r}),l=eh(r),s=eh(o),c=t(a),u=Jp(c?.className,n?.className,i,o?.className,r?.className),d={...c?.style,...n?.style,...o?.style,...r?.style},f={...c,...n,...s,...l};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}function nh(e,t){return t?vp(e,t,{clone:!1}):e}const rh={xs:0,sm:600,md:900,lg:1200,xl:1536},oh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${rh[e]}px)`},ih={containerQueries:e=>({up:t=>{let n="number"==typeof t?t:rh[t]||t;return"number"==typeof n&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ah(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||oh;return t.reduce(((r,o,i)=>(r[e.up(e.keys[i])]=n(t[i]),r)),{})}if("object"==typeof t){const e=r.breakpoints||oh;return Object.keys(t).reduce(((o,i)=>{if(a=e.keys,"@"===(l=i)||l.startsWith("@")&&(a.some((e=>l.startsWith(`@${e}`)))||l.match(/^@\d/))){const e=function(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}(r.containerQueries?r:ih,i);e&&(o[e]=n(t[i],i))}else if(Object.keys(e.values||rh).includes(i)){o[e.up(i)]=n(t[i],i)}else{const e=i;o[e]=t[e]}var a,l;return o}),{})}return n(t)}function lh(e={}){const t=e.keys?.reduce(((t,n)=>(t[e.up(n)]={},t)),{});return t||{}}function sh(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function ch({values:e,breakpoints:t,base:n}){const r=n||function(e,t){if("object"!=typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r<e.length&&(n[t]=!0)})):r.forEach((t=>{null!=e[t]&&(n[t]=!0)})),n}(e,t),o=Object.keys(r);if(0===o.length)return e;let i;return o.reduce(((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[i],i=r):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[i],i=n):t[n]=e,t)),{})}function uh(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function dh(e,t,n,r=n){let o;return o="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:uh(e,n)||r,t&&(o=t(o,r,e)),o}function fh(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=uh(e.theme,r)||{};return ah(e,i,(e=>{let r=dh(a,o,e);return e===r&&"string"==typeof e&&(r=dh(a,o,`${t}${"default"===e?"":Ip(e)}`,e)),!1===n?r:{[n]:r}}))};return i.propTypes={},i.filterProps=[t],i}const ph={m:"margin",p:"padding"},hh={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},mh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},gh=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}((e=>{if(e.length>2){if(!mh[e])return[e];e=mh[e]}const[t,n]=e.split(""),r=ph[t],o=hh[n]||"";return Array.isArray(o)?o.map((e=>r+e)):[r+o]})),yh=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],vh=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function bh(e,t,n,r){const o=uh(e,t,!0)??n;return"number"==typeof o||"string"==typeof o?e=>"string"==typeof e?e:"string"==typeof o?`calc(${e} * ${o})`:o*e:Array.isArray(o)?e=>{if("string"==typeof e)return e;const t=Math.abs(e),n=o[t];return e>=0?n:"number"==typeof n?-n:`-${n}`}:"function"==typeof o?o:()=>{}}function wh(e){return bh(e,"spacing",8)}function xh(e,t){return"string"==typeof t||null==t?t:e(t)}function kh(e,t,n,r){if(!t.includes(n))return null;const o=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=xh(t,n),e)),{})}(gh(n),r);return ah(e,e[n],o)}function Sh(e,t){const n=wh(e.theme);return Object.keys(e).map((r=>kh(e,t,r,n))).reduce(nh,{})}function Eh(e){return Sh(e,yh)}function _h(e){return Sh(e,vh)}function Ch(...e){const t=e.reduce(((e,t)=>(t.filterProps.forEach((n=>{e[n]=t})),e)),{}),n=e=>Object.keys(e).reduce(((n,r)=>t[r]?nh(n,t[r](e)):n),{});return n.propTypes={},n.filterProps=e.reduce(((e,t)=>e.concat(t.filterProps)),[]),n}function Oh(e){return"number"!=typeof e?e:`${e}px solid`}function Nh(e,t){return fh({prop:e,themeKey:"borders",transform:t})}Eh.propTypes={},Eh.filterProps=yh,_h.propTypes={},_h.filterProps=vh;const Ph=Nh("border",Oh),Rh=Nh("borderTop",Oh),Mh=Nh("borderRight",Oh),Th=Nh("borderBottom",Oh),Ah=Nh("borderLeft",Oh),Dh=Nh("borderColor"),Ih=Nh("borderTopColor"),Lh=Nh("borderRightColor"),zh=Nh("borderBottomColor"),Fh=Nh("borderLeftColor"),jh=Nh("outline",Oh),$h=Nh("outlineColor"),Bh=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=bh(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:xh(t,e)});return ah(e,e.borderRadius,n)}return null};Bh.propTypes={},Bh.filterProps=["borderRadius"],Ch(Ph,Rh,Mh,Th,Ah,Dh,Ih,Lh,zh,Fh,Bh,jh,$h);const Vh=e=>{if(void 0!==e.gap&&null!==e.gap){const t=bh(e.theme,"spacing",8),n=e=>({gap:xh(t,e)});return ah(e,e.gap,n)}return null};Vh.propTypes={},Vh.filterProps=["gap"];const Hh=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=bh(e.theme,"spacing",8),n=e=>({columnGap:xh(t,e)});return ah(e,e.columnGap,n)}return null};Hh.propTypes={},Hh.filterProps=["columnGap"];const Uh=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=bh(e.theme,"spacing",8),n=e=>({rowGap:xh(t,e)});return ah(e,e.rowGap,n)}return null};Uh.propTypes={},Uh.filterProps=["rowGap"];function Wh(e,t){return"grey"===t?t:e}Ch(Vh,Hh,Uh,fh({prop:"gridColumn"}),fh({prop:"gridRow"}),fh({prop:"gridAutoFlow"}),fh({prop:"gridAutoColumns"}),fh({prop:"gridAutoRows"}),fh({prop:"gridTemplateColumns"}),fh({prop:"gridTemplateRows"}),fh({prop:"gridTemplateAreas"}),fh({prop:"gridArea"}));function qh(e){return e<=1&&0!==e?100*e+"%":e}Ch(fh({prop:"color",themeKey:"palette",transform:Wh}),fh({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Wh}),fh({prop:"backgroundColor",themeKey:"palette",transform:Wh}));const Kh=fh({prop:"width",transform:qh}),Xh=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{const n=e.theme?.breakpoints?.values?.[t]||rh[t];return n?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:qh(t)}};return ah(e,e.maxWidth,t)}return null};Xh.filterProps=["maxWidth"];const Yh=fh({prop:"minWidth",transform:qh}),Gh=fh({prop:"height",transform:qh}),Qh=fh({prop:"maxHeight",transform:qh}),Zh=fh({prop:"minHeight",transform:qh});fh({prop:"size",cssProperty:"width",transform:qh}),fh({prop:"size",cssProperty:"height",transform:qh});Ch(Kh,Xh,Yh,Gh,Qh,Zh,fh({prop:"boxSizing"}));const Jh={border:{themeKey:"borders",transform:Oh},borderTop:{themeKey:"borders",transform:Oh},borderRight:{themeKey:"borders",transform:Oh},borderBottom:{themeKey:"borders",transform:Oh},borderLeft:{themeKey:"borders",transform:Oh},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Oh},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Bh},color:{themeKey:"palette",transform:Wh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Wh},backgroundColor:{themeKey:"palette",transform:Wh},p:{style:_h},pt:{style:_h},pr:{style:_h},pb:{style:_h},pl:{style:_h},px:{style:_h},py:{style:_h},padding:{style:_h},paddingTop:{style:_h},paddingRight:{style:_h},paddingBottom:{style:_h},paddingLeft:{style:_h},paddingX:{style:_h},paddingY:{style:_h},paddingInline:{style:_h},paddingInlineStart:{style:_h},paddingInlineEnd:{style:_h},paddingBlock:{style:_h},paddingBlockStart:{style:_h},paddingBlockEnd:{style:_h},m:{style:Eh},mt:{style:Eh},mr:{style:Eh},mb:{style:Eh},ml:{style:Eh},mx:{style:Eh},my:{style:Eh},margin:{style:Eh},marginTop:{style:Eh},marginRight:{style:Eh},marginBottom:{style:Eh},marginLeft:{style:Eh},marginX:{style:Eh},marginY:{style:Eh},marginInline:{style:Eh},marginInlineStart:{style:Eh},marginInlineEnd:{style:Eh},marginBlock:{style:Eh},marginBlockStart:{style:Eh},marginBlockEnd:{style:Eh},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Vh},rowGap:{style:Uh},columnGap:{style:Hh},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qh},maxWidth:{style:Xh},minWidth:{transform:qh},height:{transform:qh},maxHeight:{transform:qh},minHeight:{transform:qh},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const em=function(){function e(e,t,n,r){const o={[e]:t,theme:n},i=r[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const u=uh(n,l)||{};if(c)return c(o);return ah(o,t,(t=>{let n=dh(u,s,t);return t===n&&"string"==typeof t&&(n=dh(u,s,`${e}${"default"===t?"":Ip(t)}`,t)),!1===a?n:{[a]:n}}))}return function t(n){const{sx:r,theme:o={}}=n||{};if(!r)return null;const i=o.unstable_sxConfig??Jh;function a(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const a=lh(o.breakpoints),l=Object.keys(a);let s=a;return Object.keys(r).forEach((n=>{const a=function(e,t){return"function"==typeof e?e(t):e}(r[n],o);if(null!=a)if("object"==typeof a)if(i[n])s=nh(s,e(n,a,o,i));else{const e=ah({theme:o},a,(e=>({[n]:e})));!function(...e){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]),n=new Set(t);return e.every((e=>n.size===Object.keys(e).length))}(e,a)?s=nh(s,e):s[n]=t({sx:a,theme:o})}else s=nh(s,e(n,a,o,i))})),function(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter((e=>e.startsWith("@container"))).sort(((e,t)=>{const n=/min-width:\s*([0-9.]+)/;return+(e.match(n)?.[1]||0)-+(t.match(n)?.[1]||0)}));return n.length?n.reduce(((e,n)=>{const r=t[n];return delete e[n],e[n]=r,e}),{...t}):t}(o,sh(l,s))}return Array.isArray(r)?r.map(a):a(r)}}();em.filterProps=["sx"];function tm(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Jh;return Object.keys(e).forEach((r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]})),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return gp(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}}function nm(){return nm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nm.apply(null,arguments)}var rm=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),om="-ms-",im="-moz-",am="-webkit-",lm="comm",sm="rule",cm="decl",um="@keyframes",dm=Math.abs,fm=String.fromCharCode,pm=Object.assign;function hm(e){return e.trim()}function mm(e,t,n){return e.replace(t,n)}function gm(e,t){return e.indexOf(t)}function ym(e,t){return 0|e.charCodeAt(t)}function vm(e,t,n){return e.slice(t,n)}function bm(e){return e.length}function wm(e){return e.length}function xm(e,t){return t.push(e),e}var km=1,Sm=1,Em=0,_m=0,Cm=0,Om="";function Nm(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:km,column:Sm,length:a,return:""}}function Pm(e,t){return pm(Nm("",null,null,"",null,null,0),e,{length:-e.length},t)}function Rm(){return Cm=_m>0?ym(Om,--_m):0,Sm--,10===Cm&&(Sm=1,km--),Cm}function Mm(){return Cm=_m<Em?ym(Om,_m++):0,Sm++,10===Cm&&(Sm=1,km++),Cm}function Tm(){return ym(Om,_m)}function Am(){return _m}function Dm(e,t){return vm(Om,e,t)}function Im(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Lm(e){return km=Sm=1,Em=bm(Om=e),_m=0,[]}function zm(e){return Om="",e}function Fm(e){return hm(Dm(_m-1,Bm(91===e?e+2:40===e?e+1:e)))}function jm(e){for(;(Cm=Tm())&&Cm<33;)Mm();return Im(e)>2||Im(Cm)>3?"":" "}function $m(e,t){for(;--t&&Mm()&&!(Cm<48||Cm>102||Cm>57&&Cm<65||Cm>70&&Cm<97););return Dm(e,Am()+(t<6&&32==Tm()&&32==Mm()))}function Bm(e){for(;Mm();)switch(Cm){case e:return _m;case 34:case 39:34!==e&&39!==e&&Bm(Cm);break;case 40:41===e&&Bm(e);break;case 92:Mm()}return _m}function Vm(e,t){for(;Mm()&&e+Cm!==57&&(e+Cm!==84||47!==Tm()););return"/*"+Dm(t,_m-1)+"*"+fm(47===e?e:Mm())}function Hm(e){for(;!Im(Tm());)Mm();return Dm(e,_m)}function Um(e){return zm(Wm("",null,null,null,[""],e=Lm(e),0,[0],e))}function Wm(e,t,n,r,o,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=i,k=r,S=b;g;)switch(h=v,v=Mm()){case 40:if(108!=h&&58==ym(S,d-1)){-1!=gm(S+=mm(Fm(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=Fm(v);break;case 9:case 10:case 13:case 32:S+=jm(h);break;case 92:S+=$m(Am()-1,7);continue;case 47:switch(Tm()){case 42:case 47:xm(Km(Vm(Mm(),Am()),t,n),s);break;default:S+="/"}break;case 123*m:l[c++]=bm(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=mm(S,/\f/g,"")),p>0&&bm(S)-d&&xm(p>32?Xm(S+";",r,n,d-1):Xm(mm(S," ","")+";",r,n,d-2),s);break;case 59:S+=";";default:if(xm(k=qm(S,t,n,c,u,o,l,b,w=[],x=[],d),i),123===v)if(0===u)Wm(S,t,k,k,w,i,d,l,x);else switch(99===f&&110===ym(S,3)?100:f){case 100:case 108:case 109:case 115:Wm(e,k,k,r&&xm(qm(e,k,k,0,0,o,l,b,o,w=[],d),x),o,x,d,l,r?w:x);break;default:Wm(S,k,k,k,[""],x,0,l,x)}}c=u=p=0,m=y=1,b=S="",d=a;break;case 58:d=1+bm(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==Rm())continue;switch(S+=fm(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(bm(S)-1)*y,y=1;break;case 64:45===Tm()&&(S+=Fm(Mm())),f=Tm(),u=d=bm(b=S+=Hm(Am())),v++;break;case 45:45===h&&2==bm(S)&&(m=0)}}return i}function qm(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,f=0===o?i:[""],p=wm(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=vm(e,d+1,d=dm(m=a[h])),b=e;y<p;++y)(b=hm(m>0?f[y]+" "+v:mm(v,/&\f/g,f[y])))&&(s[g++]=b);return Nm(e,t,n,0===o?sm:l,s,c,u)}function Km(e,t,n){return Nm(e,t,n,lm,fm(Cm),vm(e,2,-2),0)}function Xm(e,t,n,r){return Nm(e,t,n,cm,vm(e,0,r),vm(e,r+1,-1),r)}function Ym(e,t){for(var n="",r=wm(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Gm(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case cm:return e.return=e.return||e.value;case lm:return"";case um:return e.return=e.value+"{"+Ym(e.children,r)+"}";case sm:e.value=e.props.join(",")}return bm(n=Ym(e.children,r))?e.return=e.value+"{"+n+"}":""}function Qm(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Zm=function(e,t,n){for(var r=0,o=0;r=o,o=Tm(),38===r&&12===o&&(t[n]=1),!Im(o);)Mm();return Dm(e,_m)},Jm=function(e,t){return zm(function(e,t){var n=-1,r=44;do{switch(Im(r)){case 0:38===r&&12===Tm()&&(t[n]=1),e[n]+=Zm(_m-1,t,n);break;case 2:e[n]+=Fm(r);break;case 4:if(44===r){e[++n]=58===Tm()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=fm(r)}}while(r=Mm());return e}(Lm(e),t))},eg=new WeakMap,tg=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||eg.get(n))&&!r){eg.set(e,!0);for(var o=[],i=Jm(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},ng=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function rg(e,t){switch(function(e,t){return 45^ym(e,0)?(((t<<2^ym(e,0))<<2^ym(e,1))<<2^ym(e,2))<<2^ym(e,3):0}(e,t)){case 5103:return am+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return am+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return am+e+im+e+om+e+e;case 6828:case 4268:return am+e+om+e+e;case 6165:return am+e+om+"flex-"+e+e;case 5187:return am+e+mm(e,/(\w+).+(:[^]+)/,am+"box-$1$2"+om+"flex-$1$2")+e;case 5443:return am+e+om+"flex-item-"+mm(e,/flex-|-self/,"")+e;case 4675:return am+e+om+"flex-line-pack"+mm(e,/align-content|flex-|-self/,"")+e;case 5548:return am+e+om+mm(e,"shrink","negative")+e;case 5292:return am+e+om+mm(e,"basis","preferred-size")+e;case 6060:return am+"box-"+mm(e,"-grow","")+am+e+om+mm(e,"grow","positive")+e;case 4554:return am+mm(e,/([^-])(transform)/g,"$1"+am+"$2")+e;case 6187:return mm(mm(mm(e,/(zoom-|grab)/,am+"$1"),/(image-set)/,am+"$1"),e,"")+e;case 5495:case 3959:return mm(e,/(image-set\([^]*)/,am+"$1$`$1");case 4968:return mm(mm(e,/(.+:)(flex-)?(.*)/,am+"box-pack:$3"+om+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+am+e+e;case 4095:case 3583:case 4068:case 2532:return mm(e,/(.+)-inline(.+)/,am+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(bm(e)-1-t>6)switch(ym(e,t+1)){case 109:if(45!==ym(e,t+4))break;case 102:return mm(e,/(.+:)(.+)-([^]+)/,"$1"+am+"$2-$3$1"+im+(108==ym(e,t+3)?"$3":"$2-$3"))+e;case 115:return~gm(e,"stretch")?rg(mm(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ym(e,t+1))break;case 6444:switch(ym(e,bm(e)-3-(~gm(e,"!important")&&10))){case 107:return mm(e,":",":"+am)+e;case 101:return mm(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+am+(45===ym(e,14)?"inline-":"")+"box$3$1"+am+"$2$3$1"+om+"$2box$3")+e}break;case 5936:switch(ym(e,t+11)){case 114:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return am+e+om+e+e}return e}var og,ig,ag=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case cm:e.return=rg(e.value,e.length);break;case um:return Ym([Pm(e,{value:mm(e.value,"@","@"+am)})],r);case sm:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ym([Pm(e,{props:[mm(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ym([Pm(e,{props:[mm(t,/:(plac\w+)/,":"+am+"input-$1")]}),Pm(e,{props:[mm(t,/:(plac\w+)/,":-moz-$1")]}),Pm(e,{props:[mm(t,/:(plac\w+)/,om+"input-$1")]})],r)}return""}))}}],lg=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||ag,a={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;l.push(e)}));var s,c,u=[Gm,(c=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=wm(e);return function(n,r,o,i){for(var a="",l=0;l<t;l++)a+=e[l](n,r,o,i)||"";return a}}([tg,ng].concat(i,u));o=function(e,t,n,r){s=n,function(e){Ym(Um(e),d)}(e?e+"{"+t.styles+"}":t.styles),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new rm({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return f.sheet.hydrate(l),f};!function(){if(ig)return og;ig=1;var e=Pp(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function i(n){return e.isMemo(n)?r:o[n.$$typeof]||t}o[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[e.Memo]=r;var a=Object.defineProperty,l=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,d=Object.prototype;og=function e(t,r,o){if("string"!=typeof r){if(d){var f=u(r);f&&f!==d&&e(t,f,o)}var p=l(r);s&&(p=p.concat(s(r)));for(var h=i(t),m=i(r),g=0;g<p.length;++g){var y=p[g];if(!(n[y]||o&&o[y]||m&&m[y]||h&&h[y])){var v=c(r,y);try{a(t,y,v)}catch(e){}}}}return t}}();function sg(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}var cg=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},ug=function(e,t,n){cg(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var dg={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hg=function(e){return 45===e.charCodeAt(1)},mg=function(e){return null!=e&&"boolean"!=typeof e},gg=Qm((function(e){return hg(e)?e:e.replace(fg,"-$&").toLowerCase()})),yg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,n){return bg={name:t,styles:n,next:bg},t}))}return 1===dg[e]||hg(e)||"number"!=typeof t||0===t?t:t+"px"};function vg(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return bg={name:o.name,styles:o.styles,next:bg},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)bg={name:a.name,styles:a.styles,next:bg},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=vg(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var l=a;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":mg(l)&&(r+=gg(i)+":"+yg(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=vg(e,t,a);switch(i){case"animation":case"animationName":r+=gg(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)mg(a[c])&&(r+=gg(i)+":"+yg(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=bg,s=n(e);return bg=l,vg(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var bg,wg=/label:\s*([^\s;{]+)\s*(;|$)/g;function xg(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";bg=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=vg(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=vg(n,t,e[a]),r)o+=i[a]}wg.lastIndex=0;for(var l,s="";null!==(l=wg.exec(o));)s+="-"+l[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+s;return{name:c,styles:o,next:bg}}var kg=!!u.useInsertionEffect&&u.useInsertionEffect||function(e){return e()},Sg=s.createContext("undefined"!=typeof HTMLElement?lg({key:"css"}):null);Sg.Provider;var Eg,_g,Cg=function(e){return s.forwardRef((function(t,n){var r=s.useContext(Sg);return e(t,r,n)}))},Og=s.createContext({}),Ng={}.hasOwnProperty,Pg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Rg=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return cg(t,n,r),kg((function(){return ug(t,n,r)})),null},Mg=Cg((function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[Pg],i=[r],a="";"string"==typeof e.className?a=sg(t.registered,i,e.className):null!=e.className&&(a=e.className+" ");var l=xg(i,void 0,s.useContext(Og));a+=t.key+"-"+l.name;var c={};for(var u in e)Ng.call(e,u)&&"css"!==u&&u!==Pg&&(c[u]=e[u]);return c.className=a,n&&(c.ref=n),s.createElement(s.Fragment,null,s.createElement(Rg,{cache:t,serialized:l,isStringTag:"string"==typeof o}),s.createElement(o,c))})),Tg=Mg,Ag=function(e,t){var n=arguments;if(null==t||!Ng.call(t,"css"))return s.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=Tg,o[1]=function(e,t){var n={};for(var r in t)Ng.call(t,r)&&(n[r]=t[r]);return n[Pg]=e,n}(e,t);for(var i=2;i<r;i++)o[i]=n[i];return s.createElement.apply(null,o)};function Dg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xg(t)}function Ig(){var e=Dg.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}Eg=Ag||(Ag={}),_g||(_g=Eg.JSX||(Eg.JSX={}));var Lg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,zg=Qm((function(e){return Lg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Fg=function(e){return"theme"!==e},jg=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?zg:Fg},$g=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Bg=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return cg(t,n,r),kg((function(){return ug(t,n,r)})),null},Vg=function e(t,n){var r,o,i=t.__emotion_real===t,a=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=$g(t,n,i),c=l||jg(a),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{var p=d[0];f.push(p[0]);for(var h=d.length,m=1;m<h;m++)f.push(d[m],p[m])}var g=Cg((function(e,t,n){var r=u&&e.as||a,i="",d=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=s.useContext(Og)}"string"==typeof e.className?i=sg(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var m=xg(f.concat(d),t.registered,p);i+=t.key+"-"+m.name,void 0!==o&&(i+=" "+o);var g=u&&void 0===l?jg(r):c,y={};for(var v in e)u&&"as"===v||g(v)&&(y[v]=e[v]);return y.className=i,n&&(y.ref=n),s.createElement(s.Fragment,null,s.createElement(Bg,{cache:t,serialized:m,isStringTag:"string"==typeof r}),s.createElement(r,y))}));return g.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=a,g.__emotion_styles=f,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+o}}),g.withComponent=function(t,r){return e(t,nm({},n,r,{shouldForwardProp:$g(g,r,!0)})).apply(void 0,f)},g}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Vg[e]=Vg(e)}));const Hg=[];function Ug(e){return Hg[0]=e,xg(Hg)}function Wg(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>({...e,[t.key]:t.val})),{})})(t),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-r/100}${n})`}return{keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const t=a.indexOf(e);return 0===t?l(a[1]):t===a.length-1?s(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n,...o}}const qg={borderRadius:4};function Kg(e=8,t=wh({spacing:e})){if(e.mui)return e;const n=(...e)=>(0===e.length?[1]:e).map((e=>{const n=t(e);return"number"==typeof n?`${n}px`:n})).join(" ");return n.mui=!0,n}function Xg(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||"function"!=typeof n.getColorSchemeSelector)return{};let r=n.getColorSchemeSelector(e);return"&"===r?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Yg(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...a}=e;let l=vp({breakpoints:Wg(n),direction:"ltr",components:{},palette:{mode:"light",...r},spacing:Kg(o),shape:{...qg,...i}},a);return l=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{const o=t(e.breakpoints.not(...n),r);return o.includes("not all and")?o.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):o}}const r={},o=e=>(n(r,e),r);return n(o),{...e,containerQueries:o}}(l),l.applyStyles=Xg,l=t.reduce(((e,t)=>vp(e,t)),l),l.unstable_sxConfig={...Jh,...a?.unstable_sxConfig},l.unstable_sx=function(e){return em({sx:e,theme:this})},l}function Gg(e=null){const t=s.useContext(Og);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const Qg=Yg();function Zg(e){const{variants:t,...n}=e,r={variants:t,style:Ug(n),isProcessed:!0};return r.style===n||t&&t.forEach((e=>{"function"!=typeof e.style&&(e.style=Ug(e.style))})),r}const Jg=Yg();function ey(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function ty(e){return e?(t,n)=>n[e]:null}function ny(e,t){const n="function"==typeof t?t(e):t;if(Array.isArray(n))return n.flatMap((t=>ny(e,t)));if(Array.isArray(n?.variants)){let t;if(n.isProcessed)t=n.style;else{const{variants:e,...r}=n;t=r}return ry(e,n.variants,[t])}return n?.isProcessed?n.style:n}function ry(e,t,n=[]){let r;e:for(let o=0;o<t.length;o+=1){const i=t[o];if("function"==typeof i.props){if(r??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(r))continue}else for(const t in i.props)if(e[t]!==i.props[t]&&e.ownerState?.[t]!==i.props[t])continue e;"function"==typeof i.style?(r??={...e,...e.ownerState,ownerState:e.ownerState},n.push(i.style(r))):n.push(i.style)}return n}function oy(e={}){const{themeId:t,defaultTheme:n=Jg,rootShouldForwardProp:r=ey,slotShouldForwardProp:o=ey}=e;function i(e){!function(e,t,n){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?n:e.theme[t]||e.theme}(e,t,n)}return(e,t={})=>{!function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}(e,(e=>e.filter((e=>e!==em))));const{name:n,slot:a,skipVariantsResolver:l,skipSx:s,overridesResolver:c=ty(ay(a)),...u}=t,d=void 0!==l?l:a&&"Root"!==a&&"root"!==a||!1,f=s||!1;let p=ey;"Root"===a||"root"===a?p=r:a?p=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(p=void 0);const h=
10
+ */var k=(g||(g=1,y.exports=function(){if(m)return v;m=1;var e=l(),t=x(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return v.useSyncExternalStoreWithSelector=function(e,t,l,c,u){var d=o(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=a((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,l,c,u]);var p=r(e,d[0],d[1]);return i((function(){f.hasValue=!0,f.value=p}),[p]),s(p),p},v}()),y.exports),S=t(k);const{useDebugValue:E}=c,{useSyncExternalStoreWithSelector:_}=S;let C=!1;const O=e=>e;const N=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?f(e):e,n=(e,n)=>function(e,t=O,n){n&&!C&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),C=!0);const r=_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(r),r}(t,e,n);return Object.assign(n,t),n},P=e=>e?N(e):N;function R(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(e.constructor===Object||e.constructor===Array){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){if(!r.includes(o))return!1;if(!M(e[o],t[o]))return!1}}return!(e instanceof Date&&t instanceof Date)||e.getTime()===t.getTime()}const T=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(R(i)&&R(a)){const{new_obj:e,change:t}=T(a,i);t&&(n=!0,r[o]=e)}else M(a,i)||(n=!0,r[o]=i)})),{new_obj:r,change:n}},A=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(void 0!==a||void 0!==i){if(void 0===a)return n=!0,void(r[o]=i);if(R(i)&&R(a)){const{new_obj:e,change:t}=A(a,i);t&&(n=!0,r[o]=e)}}})),{new_obj:r,change:n}},D={id:"dummy",name:"dummy",node:"dummy",full_id:"dummy",type:"any",value:void 0,is_input:!1,connected:!1,does_trigger:!0,fullvalue:void 0,try_get_full_value:void 0,render_options:{set_default:!0,type:"any"},set_hidden:void 0,hidden:!1},I=e=>{if(!e.id)throw new Error("IO must have an id but is missing for "+JSON.stringify(e));void 0===e.name&&(e.name=e.id);const{new_obj:t}=A(e,D);return"any"!==t.render_options.type&&void 0!==t.render_options.type||(t.render_options.type=t.type),t},L={id:"dummy",node_name:"dummy",frontend:{pos:[NaN,NaN],size:[200,100],collapsed:!1},io:{},name:"dummy",in_trigger:!1,io_order:[],progress:{ascii:!1,elapsed:0,initial:0,n:0,prefix:"idle",unit:"it",unit_divisor:1e3,unit_scale:!1}},z=JSON.stringify(L),F=e=>{if(!e.id)throw new Error("Node must have an id");const t=JSON.parse(z),{new_obj:n}=A(e,t);for(const e in n.io){if(void 0===n.io[e])continue;void 0===n.io[e].id&&(n.io[e].id=e);const t=I(n.io[e]);n.io[e]=t}return n},j=e=>{if(void 0===e.io&&(e.io={}),void 0===e.io_order)if(Array.isArray(e.io)){e.io_order=e.io.map((e=>e.id));const t={};for(const n of e.io)t[n.id]=n;e.io=t}else e.io_order=Object.keys(e.io);else if(Array.isArray(e.io)){const t={};for(const n of e.io)t[n.id]=n,e.io_order.includes(n.id)||e.io_order.push(n.id);e.io=t}else for(const t in e.io)e.io_order.includes(t)||e.io_order.push(t);return e};function $(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=$(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:B}=c,{useSyncExternalStoreWithSelector:V}=S,H=e=>e;function U(e,t=H,n){const r=V(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return B(r),r}const W=(e,t)=>{const n=f(e),r=(e,r=t)=>U(n,e,r);return Object.assign(r,n),r};function q(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var K={value:()=>{}};function X(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new Y(r)}function Y(e){this._=e}function G(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Q(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=K,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}Y.prototype=X.prototype={constructor:Y,on:function(e,t){var n,r=this._,o=function(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",r=e.indexOf(".");if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=Q(r[n],e.name,t);else if(null==t)for(n in r)r[n]=Q(r[n],e.name,null);return this}for(;++i<a;)if((n=(e=o[i]).type)&&(n=G(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Y(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var Z="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),J.hasOwnProperty(t)?{space:J[t],local:e}:e}function te(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Z&&t.documentElement.namespaceURI===Z?t.createElement(e):t.createElementNS(n,e)}}function ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function re(e){var t=ee(e);return(t.local?ne:te)(t)}function oe(){}function ie(e){return null==e?oe:function(){return this.querySelector(e)}}function ae(){return[]}function le(e){return null==e?ae:function(){return this.querySelectorAll(e)}}function se(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ce(e){return function(){return this.matches(e)}}function ue(e){return function(t){return t.matches(e)}}var de=Array.prototype.find;function fe(){return this.firstElementChild}var pe=Array.prototype.filter;function he(){return Array.from(this.children)}function me(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ye(e,t,n,r,o,i){for(var a,l=0,s=t.length,c=i.length;l<c;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new ge(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function ve(e,t,n,r,o,i,a){var l,s,c,u=new Map,d=t.length,f=i.length,p=new Array(d);for(l=0;l<d;++l)(s=t[l])&&(p[l]=c=a.call(s,s.__data__,l,t)+"",u.has(c)?o[l]=s:u.set(c,s));for(l=0;l<f;++l)c=a.call(e,i[l],l,i)+"",(s=u.get(c))?(r[l]=s,s.__data__=i[l],u.delete(c)):n[l]=new ge(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&u.get(p[l])===s&&(o[l]=s)}function be(e){return e.__data__}function we(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ke(e){return function(){this.removeAttribute(e)}}function Se(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ee(e,t){return function(){this.setAttribute(e,t)}}function _e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ce(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Oe(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ne(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Pe(e){return function(){this.style.removeProperty(e)}}function Re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Me(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Te(e,t){return e.style.getPropertyValue(t)||Ne(e).getComputedStyle(e,null).getPropertyValue(t)}function Ae(e){return function(){delete this[e]}}function De(e,t){return function(){this[e]=t}}function Ie(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Le(e){return e.trim().split(/^|\s+/)}function ze(e){return e.classList||new Fe(e)}function Fe(e){this._node=e,this._names=Le(e.getAttribute("class")||"")}function je(e,t){for(var n=ze(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function $e(e,t){for(var n=ze(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Be(e){return function(){je(this,e)}}function Ve(e){return function(){$e(this,e)}}function He(e,t){return function(){(t.apply(this,arguments)?je:$e)(this,e)}}function Ue(){this.textContent=""}function We(e){return function(){this.textContent=e}}function qe(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Ke(){this.innerHTML=""}function Xe(e){return function(){this.innerHTML=e}}function Ye(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ge(){this.nextSibling&&this.parentNode.appendChild(this)}function Qe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ze(){return null}function Je(){var e=this.parentNode;e&&e.removeChild(this)}function et(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nt(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function rt(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ot(e,t,n){var r=Ne(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function it(e,t){return function(){return ot(this,e,t)}}function at(e,t){return function(){return ot(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,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)}},Fe.prototype={add:function(e){this._names.indexOf(e)<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}};var lt=[null];function st(e,t){this._groups=e,this._parents=t}function ct(){return new st([[document.documentElement]],lt)}function ut(e){return"string"==typeof e?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],lt)}function dt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}st.prototype=ct.prototype={constructor:st,select:function(e){"function"!=typeof e&&(e=ie(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,c=r[o]=new Array(s),u=0;u<s;++u)(i=l[u])&&(a=e.call(i,i.__data__,u,l))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new st(r,this._parents)},selectAll:function(e){e="function"==typeof e?se(e):le(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,l=t[i],s=l.length,c=0;c<s;++c)(a=l[c])&&(r.push(e.call(a,a.__data__,c,l)),o.push(a));return new st(r,o)},selectChild:function(e){return this.select(null==e?fe:function(e){return function(){return de.call(this.children,e)}}("function"==typeof e?e:ue(e)))},selectChildren:function(e){return this.selectAll(null==e?he:function(e){return function(){return pe.call(this.children,e)}}("function"==typeof e?e:ue(e)))},filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new st(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,be);var n,r=t?ve:ye,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,l=new Array(a),s=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],f=i[u],p=f.length,h=we(e.call(d,d&&d.__data__,u,o)),m=h.length,g=s[u]=new Array(m),y=l[u]=new Array(m);r(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(l=new st(l,o))._enter=s,l._exit=c,l},enter:function(){return new st(this._enter||this._groups.map(me),this._parents)},exit:function(){return new st(this._exit||this._groups.map(me),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),l=new Array(o),s=0;s<a;++s)for(var c,u=n[s],d=r[s],f=u.length,p=l[s]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;s<o;++s)l[s]=n[s];return new st(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,c=o[i]=new Array(s),u=0;u<s;++u)(a=l[u])&&(c[u]=a);c.sort(t)}return new st(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Se:ke:"function"==typeof t?n.local?Oe:Ce:n.local?_e:Ee)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Pe:"function"==typeof t?Me:Re)(e,t,null==n?"":n)):Te(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Ae:"function"==typeof t?Ie:De)(e,t)):this.node()[e]},classed:function(e,t){var n=Le(e+"");if(arguments.length<2){for(var r=ze(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?He:t?Be:Ve)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ue:("function"==typeof e?qe:We)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Ke:("function"==typeof e?Ye:Xe)(e)):this.node().innerHTML},raise:function(){return this.each(Ge)},lower:function(){return this.each(Qe)},append:function(e){var t="function"==typeof e?e:re(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:re(e),r=null==t?Ze:"function"==typeof t?t:ie(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Je)},clone:function(e){return this.select(e?tt:et)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(l=t?rt:nt,r=0;r<a;++r)this.each(l(i[r],t,n));return this}var l=this.node().__on;if(l)for(var s,c=0,u=l.length;c<u;++c)for(r=0,s=l[c];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value},dispatch:function(e,t){return this.each(("function"==typeof t?at:it)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const ft={passive:!1},pt={capture:!0,passive:!1};function ht(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function gt(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",mt,pt);"onselectstart"in t?n.on("selectstart.drag",mt,pt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yt(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",mt,pt),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var vt=e=>()=>e;function bt(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:l,dx:s,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function wt(e){return!e.ctrlKey&&!e.button}function xt(){return this.parentNode}function kt(e,t){return null==t?{x:e.x,y:e.y}:t}function St(){return navigator.maxTouchPoints||"ontouchstart"in this}function Et(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _t(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ct(){}bt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Ot=.7,Nt=1/Ot,Pt="\\s*([+-]?\\d+)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tt=/^#([0-9a-f]{3,8})$/,At=new RegExp(`^rgb\\(${Pt},${Pt},${Pt}\\)$`),Dt=new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`),It=new RegExp(`^rgba\\(${Pt},${Pt},${Pt},${Rt}\\)$`),Lt=new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${Rt}\\)$`),zt=new RegExp(`^hsl\\(${Rt},${Mt},${Mt}\\)$`),Ft=new RegExp(`^hsla\\(${Rt},${Mt},${Mt},${Rt}\\)$`),jt={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};function $t(){return this.rgb().formatHex()}function Bt(){return this.rgb().formatRgb()}function Vt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ht(t):3===n?new qt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ut(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ut(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=At.exec(e))?new qt(t[1],t[2],t[3],1):(t=Dt.exec(e))?new qt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=It.exec(e))?Ut(t[1],t[2],t[3],t[4]):(t=Lt.exec(e))?Ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=zt.exec(e))?Zt(t[1],t[2]/100,t[3]/100,1):(t=Ft.exec(e))?Zt(t[1],t[2]/100,t[3]/100,t[4]):jt.hasOwnProperty(e)?Ht(jt[e]):"transparent"===e?new qt(NaN,NaN,NaN,0):null}function Ht(e){return new qt(e>>16&255,e>>8&255,255&e,1)}function Ut(e,t,n,r){return r<=0&&(e=t=n=NaN),new qt(e,t,n,r)}function Wt(e,t,n,r){return 1===arguments.length?((o=e)instanceof Ct||(o=Vt(o)),o?new qt((o=o.rgb()).r,o.g,o.b,o.opacity):new qt):new qt(e,t,n,null==r?1:r);var o}function qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Kt(){return`#${Qt(this.r)}${Qt(this.g)}${Qt(this.b)}`}function Xt(){const e=Yt(this.opacity);return`${1===e?"rgb(":"rgba("}${Gt(this.r)}, ${Gt(this.g)}, ${Gt(this.b)}${1===e?")":`, ${e})`}`}function Yt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qt(e){return((e=Gt(e))<16?"0":"")+e.toString(16)}function Zt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,r)}function Jt(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof Ct||(e=Vt(e)),!e)return new en;if(e instanceof en)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+6*(n<r):n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new en(a,l,s,e.opacity)}function en(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tn(e){return(e=(e||0)%360)<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Et(Ct,Vt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$t,formatHex:$t,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Jt(this).formatHsl()},formatRgb:Bt,toString:Bt}),Et(qt,Wt,_t(Ct,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ot:Math.pow(Ot,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qt(Gt(this.r),Gt(this.g),Gt(this.b),Yt(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:Kt,formatHex:Kt,formatHex8:function(){return`#${Qt(this.r)}${Qt(this.g)}${Qt(this.b)}${Qt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Xt,toString:Xt})),Et(en,(function(e,t,n,r){return 1===arguments.length?Jt(e):new en(e,t,n,null==r?1:r)}),_t(Ct,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ot:Math.pow(Ot,e),new en(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new qt(rn(e>=240?e-240:e+120,o,r),rn(e,o,r),rn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new en(tn(this.h),nn(this.s),nn(this.l),Yt(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=Yt(this.opacity);return`${1===e?"hsl(":"hsla("}${tn(this.h)}, ${100*nn(this.s)}%, ${100*nn(this.l)}%${1===e?")":`, ${e})`}`}}));var on=e=>()=>e;function an(e){return 1==(e=+e)?ln:function(t,n){return n-t?function(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)}}(t,n,e):on(isNaN(t)?n:t)}}function ln(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):on(isNaN(e)?t:e)}var sn=function e(t){var n=an(t);function r(e,t){var r=n((e=Wt(e)).r,(t=Wt(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=ln(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function cn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dn=new RegExp(un.source,"g");function fn(e,t){var n,r,o,i=un.lastIndex=dn.lastIndex=0,a=-1,l=[],s=[];for(e+="",t+="";(n=un.exec(e))&&(r=dn.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:cn(n,r)})),i=dn.lastIndex;return i<t.length&&(o=t.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var n,r=0;r<t;++r)l[(n=s[r]).i]=n.x(e);return l.join("")})}var pn,hn=180/Math.PI,mn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gn(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*hn,skewX:Math.atan(s)*hn,scaleX:a,scaleY:l}}function yn(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l=[],s=[];return i=e(i),a=e(a),function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:cn(e,o)},{i:s-2,x:cn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,l,s),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:cn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,l,s),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:cn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,l,s),function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:cn(e,n)},{i:l-2,x:cn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,l,s),i=a=null,function(e){for(var t,n=-1,r=s.length;++n<r;)l[(t=s[n]).i]=t.x(e);return l.join("")}}}var vn=yn((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mn:gn(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),bn=yn((function(e){return null==e?mn:(pn||(pn=document.createElementNS("http://www.w3.org/2000/svg","g")),pn.setAttribute("transform",e),(e=pn.transform.baseVal.consolidate())?gn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):mn)}),", ",")",")");function wn(e){return((e=Math.exp(e))+1/e)/2}var xn,kn,Sn=function e(t,n,r){function o(e,o){var i,a,l=e[0],s=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-l,h=d-s,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[l+e*p,s+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-b)/t,i=function(e){var r,o=e*a,i=wn(b),u=c/(n*g)*(i*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[l+u*p,s+u*h,c*i/wn(t*o+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),En=0,_n=0,Cn=0,On=0,Nn=0,Pn=0,Rn="object"==typeof performance&&performance.now?performance:Date,Mn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tn(){return Nn||(Mn(An),Nn=Rn.now()+Pn)}function An(){Nn=0}function Dn(){this._call=this._time=this._next=null}function In(e,t,n){var r=new Dn;return r.restart(e,t,n),r}function Ln(){Nn=(On=Rn.now())+Pn,En=_n=0;try{!function(){Tn(),++En;for(var e,t=xn;t;)(e=Nn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--En}()}finally{En=0,function(){var e,t,n=xn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:xn=t);kn=e,Fn(r)}(),Nn=0}}function zn(){var e=Rn.now(),t=e-On;t>1e3&&(Pn-=t,On=e)}function Fn(e){En||(_n&&(_n=clearTimeout(_n)),e-Nn>24?(e<1/0&&(_n=setTimeout(Ln,e-Rn.now()-Pn)),Cn&&(Cn=clearInterval(Cn))):(Cn||(On=Rn.now(),Cn=setInterval(zn,1e3)),En=1,Mn(Ln)))}function jn(e,t,n){var r=new Dn;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}Dn.prototype=In.prototype={constructor:Dn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Tn():+n)+(null==t?0:+t),this._next||kn===this||(kn?kn._next=this:xn=this,kn=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};var $n=X("start","end","cancel","interrupt"),Bn=[];function Vn(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,f;if(1!==n.state)return s();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return jn(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(jn((function(){3===n.state&&(n.state=4,n.timer.restart(l,n.delay,n.time),l(i))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function l(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=In(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:$n,tween:Bn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Hn(e,t){var n=Wn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Un(e,t){var n=Wn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Wn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function Kn(e,t){var n,r;return function(){var o=Un(this,e),i=o.tween;if(i!==n)for(var a=0,l=(r=n=i).length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Xn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Un(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,c=o.length;s<c;++s)if(o[s].name===t){o[s]=l;break}s===c&&o.push(l)}i.tween=o}}function Yn(e,t,n){var r=e._id;return e.each((function(){var e=Un(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return Wn(e,r).value[t]}}function Gn(e,t){var n;return("number"==typeof t?cn:t instanceof Vt?sn:(n=Vt(t))?(t=n,sn):fn)(e,t)}function Qn(e){return function(){this.removeAttribute(e)}}function Zn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function er(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function tr(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttribute(e)}}function nr(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttributeNS(e.space,e.local)}}function rr(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function or(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function ir(e,t){return function(){Hn(this,e).delay=+t.apply(this,arguments)}}function ar(e,t){return t=+t,function(){Hn(this,e).delay=t}}function lr(e,t){return function(){Un(this,e).duration=+t.apply(this,arguments)}}function sr(e,t){return t=+t,function(){Un(this,e).duration=t}}var cr=ct.prototype.constructor;function ur(e){return function(){this.style.removeProperty(e)}}var dr=0;function fr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function pr(){return++dr}var hr=ct.prototype;fr.prototype={constructor:fr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ie(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var l,s,c=r[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(l=c[f])&&(s=e.call(l,l.__data__,f,c))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,Vn(d[f],t,n,f,d,Wn(l,n)));return new fr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=le(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,c=r[l],u=c.length,d=0;d<u;++d)if(s=c[d]){for(var f,p=e.call(s,s.__data__,d,c),h=Wn(s,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Vn(f,t,n,m,p,h);i.push(p),a.push(s)}return new fr(i,a,t,n)},selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new fr(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),l=0;l<i;++l)for(var s,c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),p=0;p<d;++p)(s=c[p]||u[p])&&(f[p]=s);for(;l<r;++l)a[l]=t[l];return new fr(a,this._parents,this._name,this._id)},selection:function(){return new cr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=pr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)if(a=l[c]){var u=Wn(a,t);Vn(a,e,n,c,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fr(r,this._parents,e,n)},call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:function(e,t){var n=this._id;return arguments.length<2?Wn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Hn:Un;return function(){var a=i(this,e),l=a.on;l!==r&&(o=(r=l).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=ee(e),r="transform"===n?bn:Gn;return this.attrTween(e,"function"==typeof t?(n.local?nr:tr)(n,r,Yn(this,"attr."+e,t)):null==t?(n.local?Zn:Qn)(n):(n.local?er:Jn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=ee(e);return this.tween(n,(r.local?rr:or)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?vn:Gn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Te(this,e),a=(this.style.removeProperty(e),Te(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,ur(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Te(this,e),l=n(this),s=l+"";return null==l&&(this.style.removeProperty(e),s=l=Te(this,e)),a===s?null:a===r&&s===o?i:(o=s,i=t(r=a,l))}}(e,r,Yn(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,l="end."+a;return function(){var s=Un(this,e),c=s.on,u=null==s.value[a]?i||(i=ur(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(l,o=u),s.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Te(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Yn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Wn(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?Kn:Xn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ir:ar)(t,e)):Wn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?lr:sr)(t,e)):Wn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Un(this,e).ease=t}}(t,e)):Wn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Un(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each((function(){var n=Un(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t})),0===o&&i()}))},[Symbol.iterator]:hr[Symbol.iterator]};var mr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function gr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}ct.prototype.interrupt=function(e){return this.each((function(){qn(this,e)}))},ct.prototype.transition=function(e){var t,n;e instanceof fr?(t=e._id,e=e._name):(t=pr(),(n=mr).time=Tn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)(a=l[c])&&Vn(a,e,t,c,l,n||gr(a,t));return new fr(r,this._parents,e,t)};var yr=e=>()=>e;function vr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function br(e,t,n){this.k=e,this.x=t,this.y=n}br.prototype={constructor:br,scale:function(e){return 1===e?this:new br(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new br(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 wr=new br(1,0,0);function xr(e){e.stopImmediatePropagation()}function kr(e){e.preventDefault(),e.stopImmediatePropagation()}function Sr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Er(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 _r(){return this.__zoom||wr}function Cr(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Or(){return navigator.maxTouchPoints||"ontouchstart"in this}function Nr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Pr(){var e,t,n,r=Sr,o=Er,i=Nr,a=Cr,l=Or,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Sn,f=X("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",_r).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",E).filter(l).on("touchstart.zoom",_).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new br(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new br(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=w(e,i).event(r),l=o.apply(e,i),s=null==n?v(l):"function"==typeof n?n.apply(e,i):n,c=Math.max(l[1][0]-l[0][0],l[1][1]-l[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,p=d(u.invert(s).concat(c/u.k),f.invert(s).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new br(n,s[0]-t[0]*n,s[1]-t[1]*n)}a.zoom(null,e)}}))}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=dt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[u,o.invert(u)],qn(this),n.start()}kr(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",i(y(g(o,l),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),l=ut(e.view).on("mousemove.zoom",(function(e){if(kr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=dt(e,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(e){l.on("mousemove.zoom mouseup.zoom",null),yt(e.view,a.moved),kr(e),a.event(e).end()}),!0),s=dt(e,o),u=e.clientX,d=e.clientY;gt(e.view),xr(e),a.mouse=[s,this.__zoom.invert(s)],qn(this),a.start()}}function E(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=dt(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(y(g(n,s),a,l),o.apply(this,t),c);kr(e),u>0?ut(this).transition().duration(u).call(b,d,a,e):ut(this).call(m.transform,d,a,e)}}function _(n,...o){if(r.apply(this,arguments)){var i,a,l,s,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(xr(n),a=0;a<u;++a)s=[s=dt(l=c[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout((function(){e=null}),500)),qn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,r,o,a,l=w(this,t).event(e),s=e.changedTouches,u=s.length;for(kr(e),n=0;n<u;++n)o=dt(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],p=l.touch1[0],h=l.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(y(r,o,a),l.extent,c))}}function O(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),l=e.changedTouches,s=l.length;for(xr(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),o=0;o<s;++o)i=l[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=dt(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=ut(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",_r),e!==o?b(e,t,n,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,r){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,s),a,l),e,c)}),n,r)},m.translateBy=function(e,t,n,r){m.transform(e,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,(function(){var e=o.apply(this,arguments),a=this.__zoom,l=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return i(wr.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),r,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ut(this.that).datum();f.call(e,this.that,new vr(e,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:yr(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:yr(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:yr(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:yr([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}br.prototype;var Rr,Mr,Tr={exports:{}},Ar={};function Dr(){if(Rr)return Ar;Rr=1;var e=l();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return Ar.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ar.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},Ar.flushSync=function(e){var t=i.T,n=r.p;try{if(i.T=null,r.p=2,e)return e()}finally{i.T=t,r.p=n,r.d.f()}},Ar.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},Ar.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},Ar.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,l="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:l}):"script"===n&&r.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:l,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},Ar.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},Ar.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},Ar.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},Ar.requestFormReset=function(e){r.d.r(e)},Ar.unstable_batchedUpdates=function(e,t){return e(t)},Ar.useFormState=function(e,t,n){return i.H.useFormState(e,t,n)},Ar.useFormStatus=function(){return i.H.useHostTransitionStatus()},Ar.version="19.0.0",Ar}function Ir(){if(Mr)return Tr.exports;return Mr=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),Tr.exports=Dr(),Tr.exports}var Lr=Ir(),zr=t(Lr);const Fr=s.createContext(null),jr=Fr.Provider,$r=e=>`Node type "${e}" not found. Using fallback type "default".`,Br=()=>"The React Flow parent container needs a width and a height to render the graph.",Vr=()=>"Only child nodes can use a parent extent.",Hr=e=>`Marker type "${e}" doesn't exist.`,Ur=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Wr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",qr=e=>`Edge type "${e}" not found. Using fallback type "default".`,Kr=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.`,Xr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Yr(e,t){const n=s.useContext(Fr);if(null===n)throw new Error(Xr);return U(n,e,t)}const Gr=()=>{const e=s.useContext(Fr);if(null===e)throw new Error(Xr);return s.useMemo((()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy})),[e])},Qr=e=>e.userSelectionActive?"none":"all";function Zr({position:e,children:t,className:n,style:r,...o}){const i=Yr(Qr),a=`${e}`.split("-");return c.createElement("div",{className:$(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...o},t)}function Jr({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:c.createElement(Zr,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},c.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var eo=s.memo((({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...f})=>{const p=s.useRef(null),[h,m]=s.useState({x:0,y:0,width:0,height:0}),g=$(["react-flow__edge-textwrapper",d]);return s.useEffect((()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}}),[n]),void 0!==n&&n?c.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},o&&c.createElement("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),c.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},n),u):null}));const to=e=>({width:e.offsetWidth,height:e.offsetHeight}),no=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ro=(e={x:0,y:0},t)=>({x:no(e.x,t[0][0],t[1][0]),y:no(e.y,t[0][1],t[1][1])}),oo=(e,t,n)=>e<t?no(Math.abs(e-t),1,50)/50:e>n?-no(Math.abs(e-n),1,50)/50:0,io=(e,t)=>[20*oo(e.x,35,t.width-35),20*oo(e.y,35,t.height-35)],ao=e=>e.getRootNode?.()||window?.document,lo=(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)}),so=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),co=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),uo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),fo=(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)},po=e=>!isNaN(e)&&isFinite(e),ho=Symbol.for("internals"),mo=["Enter"," ","Escape"];function go(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const yo=e=>"clientX"in e,vo=(e,t)=>{const n=yo(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},bo=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,wo=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>c.createElement(c.Fragment,null,c.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&c.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&po(n)&&po(r)?c.createElement(eo,{x:n,y:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u}):null);function xo(e,t,n){return void 0===n?n:r=>{const o=t().edges.find((t=>t.id===e));o&&n(r,{...o})}}function ko({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function So({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:l}){const s=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*l+.125*r;return[s,c,Math.abs(s-e),Math.abs(c-t)]}var Eo,_o,Co,Oo,No,Po;function Ro({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Po.Left||e===Po.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Mo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top}){const[a,l]=Ro({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,c]=Ro({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=So({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${a},${l} ${s},${c} ${r},${o}`,u,d,f,p]}wo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Eo||(Eo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(_o||(_o={})),function(e){e.Partial="partial",e.Full="full"}(Co||(Co={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Oo||(Oo={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(No||(No={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(Po||(Po={}));const To=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Po.Bottom,targetPosition:i=Po.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=Mo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return c.createElement(wo,{path:y,labelX:v,labelY:b,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})}));To.displayName="SimpleBezierEdge";const Ao={[Po.Left]:{x:-1,y:0},[Po.Right]:{x:1,y:0},[Po.Top]:{x:0,y:-1},[Po.Bottom]:{x:0,y:1}},Do=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Io({source:e,sourcePosition:t=Po.Bottom,target:n,targetPosition:r=Po.Top,center:o,offset:i}){const a=Ao[t],l=Ao[r],s={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+l.x*i,y:n.y+l.y*i},u=(({source:e,sourcePosition:t=Po.Bottom,target:n})=>t===Po.Left||t===Po.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})({source:s,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=ko({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*l[d]==-1){p=o.x??v,h=o.y??b;const e=[{x:p,y:s.y},{x:p,y:c.y}],t=[{x:s.x,y:h},{x:c.x,y:h}];m=a[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:s.x,y:c.y}],u=[{x:c.x,y:s.y}];if(m="x"===d?a.x===f?u:o:a.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===f?g[d]=(s[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===l[e],n=s[e]>c[e],r=s[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const v={x:s.x+g.x,y:s.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:s.x+g.x,y:s.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function Lo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top,borderRadius:a=5,centerX:l,centerY:s,offset:c=20}){const[u,d,f,p,h]=Io({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:s},offset:c}),m=u.reduce(((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(Do(e,t)/2,Do(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const l=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*l},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r}),"");return[m,d,f,p,h]}const zo=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,sourcePosition:f=Po.Bottom,targetPosition:p=Po.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=Lo({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return c.createElement(wo,{path:v,labelX:b,labelY:w,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})}));zo.displayName="SmoothStepEdge";const Fo=s.memo((e=>c.createElement(zo,{...e,pathOptions:s.useMemo((()=>({borderRadius:0,offset:e.pathOptions?.offset})),[e.pathOptions?.offset])})));Fo.displayName="StepEdge";const jo=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,l]=ko({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,l]}({sourceX:e,sourceY:t,targetX:n,targetY:r});return c.createElement(wo,{path:m,labelX:g,labelY:y,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})}));function $o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Bo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Po.Left:return[t-$o(t-r,i),n];case Po.Right:return[t+$o(r-t,i),n];case Po.Top:return[t,n-$o(n-o,i)];case Po.Bottom:return[t,n+$o(o-n,i)]}}function Vo({sourceX:e,sourceY:t,sourcePosition:n=Po.Bottom,targetX:r,targetY:o,targetPosition:i=Po.Top,curvature:a=.25}){const[l,s]=Bo({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=Bo({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,h]=So({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${s} ${c},${u} ${r},${o}`,d,f,p,h]}jo.displayName="StraightEdge";const Ho=s.memo((({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Po.Bottom,targetPosition:i=Po.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=Vo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:g?.curvature});return c.createElement(wo,{path:v,labelX:b,labelY:w,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})}));Ho.displayName="BezierEdge";const Uo=s.createContext(null),Wo=Uo.Provider;Uo.Consumer;const qo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ko=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`},Xo=({x:e,y:t},[n,r,o],i,[a,l])=>{const s={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(s.x/a),y:l*Math.round(s.y/l)}:s},Yo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Go=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Qo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce(((e,n)=>{const{x:r,y:o}=Go(n,t).positionAbsolute;return lo(e,so({x:r,y:o,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return co(n)},Zo=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const s={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach((e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Go(e,l),d={x:u.x,y:u.y,width:t||0,height:n||0},f=fo(s,d);(void 0===t||void 0===n||null===t||null===n||i&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)})),c},Jo=(e,t)=>{const n=e.map((e=>e.id));return t.filter((e=>n.includes(e.source)||n.includes(e.target)))},ei=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),l=n/(e.height*(1+i)),s=Math.min(a,l),c=no(s,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},ti=(e,t=0)=>e.transition().duration(t);function ni(e,t,n,r){return(t[n]||[]).reduce(((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t)),[])}const ri={source:null,target:null,sourceHandle:null,targetHandle:null},oi=()=>({handleDomNode:null,isValid:!1,connection:ri,endHandle:null});function ii(e,t,n,r,o,i,a){const l="target"===o,s=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...oi(),handleDomNode:s};if(s){const e=ai(void 0,s),o=s.getAttribute("data-nodeid"),a=s.getAttribute("data-handleid"),u=s.classList.contains("connectable"),d=s.classList.contains("connectableend"),f={source:l?o:n,sourceHandle:l?a:r,target:l?n:o,targetHandle:l?r:a};c.connection=f;u&&d&&(t===Eo.Strict?l&&"source"===e||!l&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(f))}return c}function ai(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function li(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function si(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function ci({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:c}){const u=ao(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=i();let b,w=0;const{x:x,y:k}=vo(e),S=u?.elementFromPoint(x,k),E=ai(s,S),_=f?.getBoundingClientRect();if(!_||!E)return;let C,O=vo(e,_),N=!1,P=null,R=!1,M=null;const T=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce(((e,o)=>{if(o[ho]){const{handleBounds:i}=o[ho];let a=[],l=[];i&&(a=ni(o,i,"source",`${t}-${n}-${r}`),l=ni(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...l)}return e}),[])}({nodes:y(),nodeId:n,handleId:t,handleType:E}),A=()=>{if(!p)return;const[e,t]=io(O,_);g({x:e,y:t}),w=requestAnimationFrame(A)};function D(e){const{transform:r}=i();O=vo(e,_);const{handle:s,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:l}=vo(e),s=t.elementsFromPoint(a,l).find((e=>e.classList.contains("react-flow__handle")));if(s){const e=s.getAttribute("data-nodeid");if(e){const t=ai(void 0,s),r=s.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find((n=>n.nodeId===e&&n.type===t&&n.id===r));return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach((e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}})),!c.length)return{handle:null,validHandleResult:oi()};if(1===c.length)return c[0];const d=c.some((({validHandleResult:e})=>e.isValid)),f=c.some((({handle:e})=>"target"===e.type));return c.find((({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid))||c[0]}(e,u,Xo(O,r,!1,[1,1]),h,T,(e=>ii(e,d,n,t,o?"target":"source",l,u)));if(b=s,N||(A(),N=!0),M=c.handleDomNode,P=c.connection,R=c.isValid,a({connectionPosition:b&&R?Yo({x:b.x,y:b.y},r):O,connectionStatus:si(!!b,R),connectionEndHandle:c.endHandle}),!b&&!R&&!M)return li(C);P.source!==P.target&&M&&(li(C),C=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",R),M.classList.toggle("react-flow__handle-valid",R))}function I(e){(b||M)&&P&&R&&r?.(P),i().onConnectEnd?.(e),s&&c?.(e),li(C),v(),cancelAnimationFrame(w),N=!1,R=!1,P=null,M=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",I)}a({connectionPosition:O,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:E,connectionStartHandle:{nodeId:n,handleId:t,type:E},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:E}),u.addEventListener("mousemove",D),u.addEventListener("mouseup",I),u.addEventListener("touchmove",D),u.addEventListener("touchend",I)}const ui=()=>!0,di=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),fi=s.forwardRef((({type:e="source",position:t=Po.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=a||null,y="target"===e,v=Gr(),b=s.useContext(Uo),{connectOnClick:w,noPanClassName:x}=Yr(di,q),{connecting:k,clickConnecting:S}=Yr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(b,g,e),q);b||v.getState().onError?.("010",Wr());const E=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=v.getState();t(((e,t)=>{if(!e.source||!e.target)return t;let n;return n=(e=>"id"in e&&"source"in e&&"target"in e)(e)?{...e}:{...e,id:qo(e)},((e,t)=>t.some((t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle)))))(n,t)?t:t.concat(n)})(o,e))}n?.(o),l?.(o)},_=e=>{if(!b)return;const t=yo(e);o&&(t&&0===e.button||!t)&&ci({event:e,handleId:g,nodeId:b,onConnect:E,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:n||v.getState().isValidConnection||ui}),t?f?.(e):p?.(e)};return c.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${g}-${e}`,className:$(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!y,target:y,connectable:r,connectablestart:o,connectableend:i,connecting:S,connectionindicator:r&&(o&&!k||i&&k)}]),onMouseDown:_,onTouchStart:_,onClick:w?t=>{const{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s}=v.getState();if(!b||!a&&!o)return;if(!a)return r?.(t,{nodeId:b,handleId:g,handleType:e}),void v.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:g}});const c=ao(t.target),u=n||s||ui,{connection:d,isValid:f}=ii({nodeId:b,id:g,type:e},l,a.nodeId,a.handleId||null,a.type,u,c);f&&E(d),i?.(t),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)}));fi.displayName="Handle";var pi=s.memo(fi);const hi=({data:e,isConnectable:t,targetPosition:n=Po.Top,sourcePosition:r=Po.Bottom})=>c.createElement(c.Fragment,null,c.createElement(pi,{type:"target",position:n,isConnectable:t}),e?.label,c.createElement(pi,{type:"source",position:r,isConnectable:t}));hi.displayName="DefaultNode";var mi=s.memo(hi);const gi=({data:e,isConnectable:t,sourcePosition:n=Po.Bottom})=>c.createElement(c.Fragment,null,e?.label,c.createElement(pi,{type:"source",position:n,isConnectable:t}));gi.displayName="InputNode";var yi=s.memo(gi);const vi=({data:e,isConnectable:t,targetPosition:n=Po.Top})=>c.createElement(c.Fragment,null,c.createElement(pi,{type:"target",position:n,isConnectable:t}),e?.label);vi.displayName="OutputNode";var bi=s.memo(vi);const wi=()=>null;wi.displayName="GroupNode";const xi=e=>({selectedNodes:e.getNodes().filter((e=>e.selected)),selectedEdges:e.edges.filter((e=>e.selected)).map((e=>({...e})))}),ki=e=>e.id;function Si(e,t){return q(e.selectedNodes.map(ki),t.selectedNodes.map(ki))&&q(e.selectedEdges.map(ki),t.selectedEdges.map(ki))}const Ei=s.memo((({onSelectionChange:e})=>{const t=Gr(),{selectedNodes:n,selectedEdges:r}=Yr(xi,Si);return s.useEffect((()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach((e=>e(o)))}),[n,r,e]),null}));Ei.displayName="SelectionListener";const _i=e=>!!e.onSelectionChange;function Ci({onSelectionChange:e}){const t=Yr(_i);return e||t?c.createElement(Ei,{onSelectionChange:e}):null}const Oi=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ni(e,t){s.useEffect((()=>{void 0!==e&&t(e)}),[e])}function Pi(e,t,n){s.useEffect((()=>{void 0!==t&&n({[e]:t})}),[t])}const Ri=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:k,snapGrid:S,snapToGrid:E,translateExtent:_,connectOnClick:C,defaultEdgeOptions:O,fitView:N,fitViewOptions:P,onNodesDelete:R,onEdgesDelete:M,onNodeDrag:T,onNodeDragStart:A,onNodeDragStop:D,onSelectionDrag:I,onSelectionDragStart:L,onSelectionDragStop:z,noPanClassName:F,nodeOrigin:j,rfId:$,autoPanOnConnect:B,autoPanOnNodeDrag:V,onError:H,connectionRadius:U,isValidConnection:W,nodeDragThreshold:K})=>{const{setNodes:X,setEdges:Y,setDefaultNodesAndEdges:G,setMinZoom:Q,setMaxZoom:Z,setTranslateExtent:J,setNodeExtent:ee,reset:te}=Yr(Oi,q),ne=Gr();return s.useEffect((()=>{const e=r?.map((e=>({...e,...O})));return G(n,e),()=>{te()}}),[]),Pi("defaultEdgeOptions",O,ne.setState),Pi("connectionMode",k,ne.setState),Pi("onConnect",o,ne.setState),Pi("onConnectStart",i,ne.setState),Pi("onConnectEnd",a,ne.setState),Pi("onClickConnectStart",l,ne.setState),Pi("onClickConnectEnd",c,ne.setState),Pi("nodesDraggable",u,ne.setState),Pi("nodesConnectable",d,ne.setState),Pi("nodesFocusable",f,ne.setState),Pi("edgesFocusable",p,ne.setState),Pi("edgesUpdatable",h,ne.setState),Pi("elementsSelectable",x,ne.setState),Pi("elevateNodesOnSelect",m,ne.setState),Pi("snapToGrid",E,ne.setState),Pi("snapGrid",S,ne.setState),Pi("onNodesChange",b,ne.setState),Pi("onEdgesChange",w,ne.setState),Pi("connectOnClick",C,ne.setState),Pi("fitViewOnInit",N,ne.setState),Pi("fitViewOnInitOptions",P,ne.setState),Pi("onNodesDelete",R,ne.setState),Pi("onEdgesDelete",M,ne.setState),Pi("onNodeDrag",T,ne.setState),Pi("onNodeDragStart",A,ne.setState),Pi("onNodeDragStop",D,ne.setState),Pi("onSelectionDrag",I,ne.setState),Pi("onSelectionDragStart",L,ne.setState),Pi("onSelectionDragStop",z,ne.setState),Pi("noPanClassName",F,ne.setState),Pi("nodeOrigin",j,ne.setState),Pi("rfId",$,ne.setState),Pi("autoPanOnConnect",B,ne.setState),Pi("autoPanOnNodeDrag",V,ne.setState),Pi("onError",H,ne.setState),Pi("connectionRadius",U,ne.setState),Pi("isValidConnection",W,ne.setState),Pi("nodeDragThreshold",K,ne.setState),Ni(e,X),Ni(t,Y),Ni(g,Q),Ni(y,Z),Ni(_,J),Ni(v,ee),null},Mi={display:"none"},Ti={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ai="react-flow__node-desc",Di="react-flow__edge-desc",Ii=e=>e.ariaLiveMessage;function Li({rfId:e}){const t=Yr(Ii);return c.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ti},t)}function zi({rfId:e,disableKeyboardA11y:t}){return c.createElement(c.Fragment,null,c.createElement("div",{id:`${Ai}-${e}`,style:Mi},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),c.createElement("div",{id:`${Di}-${e}`,style:Mi},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&c.createElement(Li,{rfId:e}))}var Fi=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=s.useState(!1),o=s.useRef(!1),i=s.useRef(new Set([])),[a,l]=s.useMemo((()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter((e=>"string"==typeof e)).map((e=>e.split("+"))),n=t.reduce(((e,t)=>e.concat(...t)),[]);return[t,n]}return[[],[]]}),[e]);return s.useEffect((()=>{const n="undefined"!=typeof document?document:null,s=t?.target||n;if(null!==e){const e=e=>{o.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!o.current||o.current&&!t.actInsideInputWithModifier)&&go(e))return!1;const n=$i(e.code,l);i.current.add(e[n]),ji(a,i.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&go(e))return!1;const n=$i(e.code,l);ji(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[n]),"Meta"===e.key&&i.current.clear(),o.current=!1},c=()=>{i.current.clear(),r(!1)};return s?.addEventListener("keydown",e),s?.addEventListener("keyup",n),window.addEventListener("blur",c),()=>{s?.removeEventListener("keydown",e),s?.removeEventListener("keyup",n),window.removeEventListener("blur",c)}}}),[e,r]),n};function ji(e,t,n){return e.filter((e=>n||e.length===t.size)).some((e=>e.every((e=>t.has(e)))))}function $i(e,t){return t.includes(e)?"code":"key"}function Bi(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Go(i,r);return Bi(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[ho]?.z??0)>(n.z??0)?i[ho]?.z??0:n.z??0},r)}function Vi(e,t,n){e.forEach((r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Bi(r,e,{...r.position,z:r[ho]?.z??0},t);r.positionAbsolute={x:o,y:i},r[ho].z=a,n?.[r.id]&&(r[ho].isParent=!0)}}))}function Hi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach((e=>{const n=(po(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),l={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},s=e.parentNode||e.parentId;s&&(i[s]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(l,ho,{enumerable:!1,value:{handleBounds:c?void 0:r?.[ho]?.handleBounds,z:n}}),o.set(e.id,l)})),Vi(o,n,i),o}function Ui(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:s,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(l&&s&&(f||!t.initial)){const e=n().filter((e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some((t=>t.id===e.id)):n})),c=e.every((e=>e.width&&e.height));if(e.length>0&&c){const n=Qo(e,d),{x:c,y:u,zoom:f}=ei(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),p=wr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?l.transform(ti(s,t.duration),p):l.transform(s,p),!0}}return!1}function Wi(e,t){return e.forEach((e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[ho]:n[ho],selected:e.selected})})),new Map(t)}function qi(e,t){return t.map((t=>{const n=e.find((e=>e.id===t.id));return n&&(t.selected=n.selected),t}))}function Ki({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:s,hasDefaultEdges:c}=n();e?.length&&(s&&r({nodeInternals:Wi(e,o)}),a?.(e)),t?.length&&(c&&r({edges:qi(t,i)}),l?.(t))}const Xi=()=>{},Yi={zoomIn:Xi,zoomOut:Xi,zoomTo:Xi,getZoom:()=>1,setViewport:Xi,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Xi,fitBounds:Xi,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Gi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Qi(){const e=(()=>{const e=Gr(),{d3Zoom:t,d3Selection:n}=Yr(Gi,q),r=s.useMemo((()=>n&&t?{zoomIn:e=>t.scaleBy(ti(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(ti(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(ti(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,a,l]=e.getState().transform,s=wr.translate(r.x??i,r.y??a).scale(r.zoom??l);t.transform(ti(n,o?.duration),s)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Ui(e.getState,t),setCenter:(r,o,i)=>{const{width:a,height:l,maxZoom:s}=e.getState(),c=void 0!==i?.zoom?i.zoom:s,u=a/2-r*c,d=l/2-o*c,f=wr.translate(u,d).scale(c);t.transform(ti(n,i?.duration),f)},fitBounds:(r,o)=>{const{width:i,height:a,minZoom:l,maxZoom:s}=e.getState(),{x:c,y:u,zoom:d}=ei(r,i,a,l,s,o?.padding??.1),f=wr.translate(c,u).scale(d);t.transform(ti(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Xo(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:a,y:l}=i.getBoundingClientRect(),s={x:t.x-a,y:t.y-l};return Xo(s,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),a=Yo(t,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:Yi),[t,n]);return r})(),t=Gr(),n=s.useCallback((()=>t.getState().getNodes().map((e=>({...e})))),[]),r=s.useCallback((e=>t.getState().nodeInternals.get(e)),[]),o=s.useCallback((()=>{const{edges:e=[]}=t.getState();return e.map((e=>({...e})))}),[]),i=s.useCallback((e=>{const{edges:n=[]}=t.getState();return n.find((t=>t.id===e))}),[]),a=s.useCallback((e=>{const{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=t.getState(),a=n(),l="function"==typeof e?e(a):e;if(o)r(l);else if(i){const e=0===l.length?a.map((e=>({type:"remove",id:e.id}))):l.map((e=>({item:e,type:"reset"})));i(e)}}),[]),l=s.useCallback((e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=t.getState(),a="function"==typeof e?e(n):e;if(o)r(a);else if(i){i(0===a.length?n.map((e=>({type:"remove",id:e.id}))):a.map((e=>({item:e,type:"reset"}))))}}),[]),c=s.useCallback((e=>{const n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=t.getState();if(i){o([...r(),...n])}else if(a){const e=n.map((e=>({item:e,type:"add"})));a(e)}}),[]),u=s.useCallback((e=>{const n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=t.getState();if(i)o([...r,...n]);else if(a){a(n.map((e=>({item:e,type:"add"}))))}}),[]),d=s.useCallback((()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e().map((e=>({...e}))),edges:n.map((e=>({...e}))),viewport:{x:o,y:i,zoom:a}}}),[]),f=s.useCallback((({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:l,onNodesDelete:s,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map((e=>e.id)),p=(n||[]).map((e=>e.id)),h=o().reduce(((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find((e=>e.id===n));return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e}),[]),m=i.filter((e=>"boolean"!=typeof e.deletable||e.deletable)),g=m.filter((e=>p.includes(e.id)));if(h||g){const e=Jo(h,m),n=[...g,...e],o=n.reduce(((e,t)=>(e.includes(t.id)||e.push(t.id),e)),[]);if((l||a)&&(l&&t.setState({edges:i.filter((e=>!o.includes(e.id)))}),a&&(h.forEach((e=>{r.delete(e.id)})),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.map((e=>({id:e,type:"remove"}))))),h.length>0&&(s?.(h),u)){u(h.map((e=>({id:e.id,type:"remove"}))))}}}),[]),p=s.useCallback((e=>{const n=po((r=e).width)&&po(r.height)&&po(r.x)&&po(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:uo(o),o,n]}),[]),h=s.useCallback(((e,n=!0,r)=>{const[o,i,a]=p(e);return o?(r||t.getState().getNodes()).filter((e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const t=uo(e),r=fo(t,o);return n&&r>0||r>=o.width*o.height})):[]}),[]),m=s.useCallback(((e,t,n=!0)=>{const[r]=p(e);if(!r)return!1;const o=fo(r,t);return n&&o>0||o>=r.width*r.height}),[]);return s.useMemo((()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m})),[e,n,r,o,i,a,l,c,u,d,f,h,m])}const Zi={actInsideInputWithModifier:!1};const Ji={position:"absolute",width:"100%",height:"100%",top:0,left:0},ea=e=>({x:e.x,y:e.y,zoom:e.k}),ta=(e,t)=>e.target.closest(`.${t}`),na=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),ra=e=>{const t=e.ctrlKey&&bo()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},oa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ia=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:u=_o.Free,zoomOnDoubleClick:d=!0,elementsSelectable:f,panOnDrag:p=!0,defaultViewport:h,translateExtent:m,minZoom:g,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:b=!0,children:w,noWheelClassName:x,noPanClassName:k})=>{const S=s.useRef(),E=Gr(),_=s.useRef(!1),C=s.useRef(!1),O=s.useRef(null),N=s.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:R,d3ZoomHandler:M,userSelectionActive:T}=Yr(oa,q),A=Fi(v),D=s.useRef(0),I=s.useRef(!1),L=s.useRef();return function(e){const t=Gr();s.useEffect((()=>{let n;const r=()=>{if(!e.current)return;const n=to(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",Br()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver((()=>r())),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}}),[])}(O),s.useEffect((()=>{if(O.current){const e=O.current.getBoundingClientRect(),t=Pr().scaleExtent([g,y]).translateExtent(m),n=ut(O.current).call(t),r=wr.translate(h.x,h.y).scale(no(h.zoom,g,y)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,m);t.transform(n,i),t.wheelDelta(ra),E.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:O.current.closest(".react-flow")})}}),[]),s.useEffect((()=>{R&&P&&(!a||A||T?void 0!==M&&R.on("wheel.zoom",(function(e,t){if(!b&&"wheel"===e.type&&!e.ctrlKey||ta(e,x))return null;e.preventDefault(),M.call(this,e,t)}),{passive:!1}):R.on("wheel.zoom",(r=>{if(ta(r,x))return!1;r.preventDefault(),r.stopImmediatePropagation();const o=R.property("__zoom").k||1;if(r.ctrlKey&&i){const e=dt(r),t=ra(r),n=o*Math.pow(2,t);return void P.scaleTo(R,n,e,r)}const a=1===r.deltaMode?20:1;let s=u===_o.Vertical?0:r.deltaX*a,c=u===_o.Horizontal?0:r.deltaY*a;!bo()&&r.shiftKey&&u!==_o.Vertical&&(s=r.deltaY*a,c=0),P.translateBy(R,-s/o*l,-c/o*l,{internal:!0});const d=ea(R.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=E.getState();clearTimeout(L.current),I.current||(I.current=!0,t?.(r,d),f?.(d)),I.current&&(e?.(r,d),p?.(d),L.current=setTimeout((()=>{n?.(r,d),h?.(d),I.current=!1}),150))}),{passive:!1}))}),[T,a,u,R,P,M,A,i,b,x,t,e,n]),s.useEffect((()=>{P&&P.on("start",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;D.current=e.sourceEvent?.button;const{onViewportChangeStart:n}=E.getState(),r=ea(e.transform);_.current=!0,N.current=r,"mousedown"===e.sourceEvent?.type&&E.setState({paneDragging:!0}),n?.(r),t?.(e.sourceEvent,r)}))}),[P,t]),s.useEffect((()=>{P&&(T&&!_.current?P.on("zoom",null):T||P.on("zoom",(t=>{const{onViewportChange:n}=E.getState();if(E.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),C.current=!(!r||!na(p,D.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=ea(t.transform);n?.(r),e?.(t.sourceEvent,r)}})))}),[T,P,e,p,r]),s.useEffect((()=>{P&&P.on("end",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=E.getState();if(_.current=!1,E.setState({paneDragging:!1}),r&&na(p,D.current??0)&&!C.current&&r(e.sourceEvent),C.current=!1,(n||t)&&(o=N.current,i=e.transform,o.x!==i.x||o.y!==i.y||o.zoom!==i.k)){const r=ea(e.transform);N.current=r,clearTimeout(S.current),S.current=setTimeout((()=>{t?.(r),n?.(e.sourceEvent,r)}),a?150:0)}var o,i}))}),[P,a,p,n,r]),s.useEffect((()=>{P&&P.filter((e=>{const t=A||o,n=i&&e.ctrlKey;if((!0===p||Array.isArray(p)&&p.includes(1))&&1===e.button&&"mousedown"===e.type&&(ta(e,"react-flow__node")||ta(e,"react-flow__edge")))return!0;if(!(p||t||a||d||i))return!1;if(T)return!1;if(!d&&"dblclick"===e.type)return!1;if(ta(e,x)&&"wheel"===e.type)return!1;if(ta(e,k)&&("wheel"!==e.type||a&&"wheel"===e.type&&!A))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!a&&!n&&"wheel"===e.type)return!1;if(!p&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(p)&&!p.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(p)&&p.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r}))}),[T,P,o,i,a,d,p,f,A]),c.createElement("div",{className:"react-flow__renderer",ref:O,style:Ji},w)},aa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function la(){const{userSelectionActive:e,userSelectionRect:t}=Yr(aa,q);return e&&t?c.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function sa(e,t){const n=t.parentNode||t.parentId,r=e.find((e=>e.id===n));if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function ca(e,t){if(e.some((e=>"reset"===e.type)))return e.filter((e=>"reset"===e.type)).map((e=>e.item));const n=e.filter((e=>"add"===e.type)).map((e=>e.item));return t.reduce(((t,n)=>{const r=e.filter((e=>e.id===n.id));if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&sa(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&sa(t,o);break;case"remove":return t}return t.push(o),t}),n)}function ua(e,t){return ca(e,t)}function da(e,t){return ca(e,t)}const fa=(e,t)=>({id:e,type:"select",selected:t});function pa(e,t){return e.reduce(((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(fa(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(fa(n.id,!1))),e}),[])}const ha=(e,t)=>n=>{n.target===t.current&&e?.(n)},ma=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ga=s.memo((({isSelecting:e,selectionMode:t=Co.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=s.useRef(null),m=Gr(),g=s.useRef(0),y=s.useRef(0),v=s.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=Yr(ma,q),k=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},E=l?e=>l(e):void 0,_=w&&(e||b);return c.createElement("div",{className:$(["react-flow__pane",{dragging:x,selection:e}]),onClick:_?void 0:ha(S,h),onContextMenu:ha((e=>{Array.isArray(n)&&n?.includes(2)?e.preventDefault():a?.(e)}),h),onWheel:ha(E,h),onMouseEnter:_?void 0:u,onMouseDown:_?t=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(v.current=o?.getBoundingClientRect(),!w||!e||0!==t.button||t.target!==h.current||!v.current)return;const{x:i,y:a}=vo(t,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),r?.(t)}:void 0,onMouseMove:_?n=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:l,onEdgesChange:s,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!v.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=vo(n,v.current),f=r.startX??0,p=r.startY??0,h={...r,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},b=u(),w=Zo(o,h,a,t===Co.Partial,!0,c),x=Jo(w,i).map((e=>e.id)),k=w.map((e=>e.id));if(g.current!==k.length){g.current=k.length;const e=pa(b,k);e.length&&l?.(e)}if(y.current!==x.length){y.current=x.length;const e=pa(i,x);e.length&&s?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:_?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),k(),o?.(e)}:void 0,onMouseLeave:_?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),o?.(e)),k()}:f,ref:h,style:Ji},p,c.createElement(la,null))}));function ya(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||ya(r,t))}function va(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function ba(e,t,n,r){return Array.from(e.values()).filter((n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!ya(n,e))&&(n.draggable||t&&void 0===n.draggable))).map((e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent})))}function wa(e,t,n,r,o=[0,0],i){const a=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let l=a;const s=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&s&&"parent"!==e.extent){const t=n.get(s),{x:r,y:i}=Go(t,o).positionAbsolute;l=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(s&&e.width&&e.height){const t=n.get(s),{x:r,y:i}=Go(t,o).positionAbsolute;l=t&&po(r)&&po(i)&&po(t.width)&&po(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:l}else i?.("005",Vr()),l=a;let c={x:0,y:0};if(s){const e=n.get(s);c=Go(e,o).positionAbsolute}const u=l&&"parent"!==l?ro(t,l):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function xa({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map((e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute})));return[e?r.find((t=>t.id===e)):r[0],r]}ga.displayName="Pane";const ka=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),l=a.width*r[0],s=a.height*r[1];return i.map((e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-l)/n,y:(t.top-a.top-s)/n,...to(e)}}))};function Sa(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Ea({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:s}=t.getState(),c=l.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame((()=>r?.current?.blur()))):o([e])):s?.("012",Kr(e))}function _a(e){return(t,n,r)=>e?.(t,r)}function Ca({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:a}){const l=Gr(),[c,u]=s.useState(!1),d=s.useRef([]),f=s.useRef({x:null,y:null}),p=s.useRef(0),h=s.useRef(null),m=s.useRef({x:0,y:0}),g=s.useRef(null),y=s.useRef(!1),v=s.useRef(!1),b=s.useRef(!1),w=function(){const e=Gr(),t=s.useCallback((({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=e.getState(),i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(l.x/r[0]):l.x,ySnapped:o?r[1]*Math.round(l.y/r[1]):l.y,...l}}),[]);return t}();return s.useEffect((()=>{if(e?.current){const s=ut(e.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:i,updateNodePositions:a,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Qo(d.current,h);v=so(e)}if(d.current=d.current.map((r=>{const o={x:e-r.distance.x,y:t-r.distance.y};p&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-v.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-v.x2+s[1][0],i[0][1]=r.positionAbsolute.y-v.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-v.y2+s[1][1]);const a=wa(r,o,n,i,h,m);return y=y||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r})),!y)return;a(d.current,!0,!0),u(!0);const b=o?r:_a(i);if(b&&g.current){const[e,t]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=io(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],r({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},k=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:s,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=o?u:_a(p);a&&i||r||!o||n.get(o)?.selected||c(),o&&i&&a&&Ea({id:o,store:l,nodeRef:e});const m=w(t);if(f.current=m,d.current=ba(n,s,m,o),h&&d.current){const[e,r]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});h(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=wt,i=xt,a=kt,l=St,s={},c=X("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",g).on("touchmove.drag",y,ft).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,l){if(!r&&o.call(this,a,l)){var s=b(this,i.call(this,a,l),a,l,"mouse");s&&(ut(a.view).on("mousemove.drag",h,pt).on("mouseup.drag",m,pt),gt(a.view),ht(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function h(r){if(mt(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}s.mouse("drag",r)}function m(e){ut(e.view).on("mousemove.drag mouseup.drag",null),yt(e.view,n),mt(e),s.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=b(this,l,e,t,a[n].identifier,a[n]))&&(ht(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(mt(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=s[o[t].identifier])&&(ht(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var l,d,p,h=c.copy(),m=dt(i||n,t);if(null!=(p=a.call(e,new bt("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return l=p.x-m[0]||0,d=p.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":s[o]=n,g=u++;break;case"end":delete s[o],--u;case"drag":m=dt(c||a,t),g=u}h.call(i,e,new bt(i,{sourceEvent:a,subject:p,target:f,identifier:o,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:vt(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:vt(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:vt(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:vt(!!e),f):l},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",(e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&k(e),b.current=!1;const r=w(e);f.current=r,h.current=t?.getBoundingClientRect()||null,m.current=vo(e.sourceEvent,h.current)})).on("drag",(e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),o=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+o*o)>r&&k(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=vo(e.sourceEvent,h.current),c(t))}})).on("end",(e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:i}=l.getState(),a=o?r:_a(i);if(t(d.current,!1,!1),a){const[t,r]=xa({nodeId:o,dragItems:d.current,nodeInternals:n});a(e.sourceEvent,t,r)}}})).filter((t=>{const o=t.target;return!t.button&&(!n||!va(o,`.${n}`,e))&&(!r||va(o,r,e))}));return s.call(t),()=>{s.on(".drag",null)}}s.on(".drag",null)}}),[e,t,n,r,i,l,o,a,w]),c}function Oa(){const e=Gr(),t=s.useCallback((t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:l,onError:s,nodesDraggable:c}=e.getState(),u=i().filter((e=>e.selected&&(e.draggable||c&&void 0===e.draggable))),d=a?l[0]:5,f=a?l[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p,g=u.map((e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};a&&(t.x=l[0]*Math.round(t.x/l[0]),t.y=l[1]*Math.round(t.y/l[1]));const{positionAbsolute:o,position:i}=wa(e,t,n,r,void 0,s);e.position=i,e.positionAbsolute=o}return e}));o(g,!0,!1)}),[]);return t}const Na={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Pa=e=>{const t=({id:t,type:n,data:r,xPos:o,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:k,selectNodesOnDrag:S,sourcePosition:E,targetPosition:_,hidden:C,resizeObserver:O,dragHandle:N,zIndex:P,isParent:R,noDragClassName:M,noPanClassName:T,initialized:A,disableKeyboardA11y:D,ariaLabel:I,rfId:L,hasHandleBounds:z})=>{const F=Gr(),j=s.useRef(null),B=s.useRef(null),V=s.useRef(E),H=s.useRef(_),U=s.useRef(n),W=w||b||d||f||p||h,q=Oa(),K=Sa(t,F.getState,f),X=Sa(t,F.getState,p),Y=Sa(t,F.getState,h),G=Sa(t,F.getState,m),Q=Sa(t,F.getState,g);s.useEffect((()=>()=>{B.current&&(O?.unobserve(B.current),B.current=null)}),[]),s.useEffect((()=>{if(j.current&&!C){const e=j.current;A&&z&&B.current===e||(B.current&&O?.unobserve(B.current),O?.observe(e),B.current=e)}}),[C,A,z]),s.useEffect((()=>{const e=U.current!==n,r=V.current!==E,o=H.current!==_;j.current&&(e||r||o)&&(e&&(U.current=n),r&&(V.current=E),o&&(H.current=_),F.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))}),[t,n,E,_]);const Z=Ca({nodeRef:j,disabled:C||!b,noDragClassName:M,handleSelector:N,nodeId:t,isSelectable:w,selectNodesOnDrag:S});return C?null:c.createElement("div",{className:$(["react-flow__node",`react-flow__node-${n}`,{[T]:b},v,{selected:u,selectable:w,parent:R,dragging:Z}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:W?"all":"none",visibility:A?"visible":"hidden",...y},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:K,onMouseMove:X,onMouseLeave:Y,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:n}=F.getState();if(w&&(!S||!b||n>0)&&Ea({id:t,store:F,nodeRef:j}),d){const n=F.getState().nodeInternals.get(t);n&&d(e,{...n})}},onDoubleClick:Q,onKeyDown:k?e=>{if(!go(e)&&!D)if(mo.includes(e.key)&&w){const n="Escape"===e.key;Ea({id:t,store:F,unselect:n,nodeRef:j})}else b&&u&&Object.prototype.hasOwnProperty.call(Na,e.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~i}`}),q({x:Na[e.key].x,y:Na[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:k?0:void 0,role:k?"button":void 0,"aria-describedby":D?void 0:`${Ai}-${L}`,"aria-label":I},c.createElement(Wo,{value:t},c.createElement(e,{id:t,data:r,type:n,xPos:o,yPos:i,selected:u,isConnectable:x,sourcePosition:E,targetPosition:_,dragging:Z,dragHandle:N,zIndex:P})))};return t.displayName="NodeWrapper",s.memo(t)};const Ra=e=>{const t=e.getNodes().filter((e=>e.selected));return{...Qo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var Ma=s.memo((function({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Gr(),{width:o,height:i,x:a,y:l,transformString:u,userSelectionActive:d}=Yr(Ra,q),f=Oa(),p=s.useRef(null);if(s.useEffect((()=>{n||p.current?.focus({preventScroll:!0})}),[n]),Ca({nodeRef:p}),d||!o||!i)return null;const h=e?t=>{const n=r.getState().getNodes().filter((e=>e.selected));e(t,n)}:void 0;return c.createElement("div",{className:$(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u}},c.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Na,e.key)&&f({x:Na[e.key].x,y:Na[e.key].y,isShiftPressed:e.shiftKey})},style:{width:o,height:i,top:l,left:a}}))}));const Ta=e=>e.nodesSelectionActive,Aa=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:E,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:O,panOnDrag:N,defaultViewport:P,translateExtent:R,minZoom:M,maxZoom:T,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:I,noPanClassName:L,disableKeyboardA11y:z})=>{const F=Yr(Ta),j=Fi(p),$=Fi(b),B=$||N,V=$||E,H=j||h&&!0!==B;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Gr(),{deleteElements:r}=Qi(),o=Fi(e,Zi),i=Fi(t);s.useEffect((()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter((e=>e.selected)),i=e.filter((e=>e.selected));r({nodes:o,edges:i}),n.setState({nodesSelectionActive:!1})}}),[o]),s.useEffect((()=>{n.setState({multiSelectionActive:i})}),[i])})({deleteKeyCode:l,multiSelectionKeyCode:v}),c.createElement(ia,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:i,elementsSelectable:x,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:V,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:O,panOnDrag:!j&&B,defaultViewport:P,translateExtent:R,minZoom:M,maxZoom:T,zoomActivationKeyCode:w,preventScrolling:A,noWheelClassName:I,noPanClassName:L},c.createElement(ga,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:B,isSelecting:!!H,selectionMode:m},e,F&&c.createElement(Ma,{onSelectionContextMenu:D,noPanClassName:L,disableKeyboardA11y:z})))};Aa.displayName="FlowRenderer";var Da=s.memo(Aa);function Ia(e){return{...{input:Pa(e.input||yi),default:Pa(e.default||mi),output:Pa(e.output||bi),group:Pa(e.group||wi)},...Object.keys(e).filter((e=>!["input","default","output","group"].includes(e))).reduce(((t,n)=>(t[n]=Pa(e[n]||mi),t)),{})}}const La=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),za=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:a}=Yr(La,q),l=(u=e.onlyRenderVisibleElements,Yr(s.useCallback((e=>u?Zo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes()),[u])));var u;const d=s.useRef(),f=s.useMemo((()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver((e=>{const t=e.map((e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})));i(t)}));return d.current=e,e}),[]);return s.useEffect((()=>()=>{d?.current?.disconnect()}),[]),c.createElement("div",{className:"react-flow__nodes",style:Ji},l.map((i=>{let l=i.type||"default";e.nodeTypes[l]||(a?.("003",$r(l)),l="default");const s=e.nodeTypes[l]||e.nodeTypes.default,u=!!(i.draggable||t&&void 0===i.draggable),d=!!(i.selectable||o&&void 0===i.selectable),p=!!(i.connectable||n&&void 0===i.connectable),h=!!(i.focusable||r&&void 0===i.focusable),m=e.nodeExtent?ro(i.positionAbsolute,e.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:i.width??0,height:i.height??0,origin:e.nodeOrigin});return c.createElement(s,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||Po.Bottom,targetPosition:i.targetPosition||Po.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:d,isConnectable:p,isFocusable:h,resizeObserver:f,dragHandle:i.dragHandle,zIndex:i[ho]?.z??0,isParent:!!i[ho]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!i.width&&!!i.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[ho]?.handleBounds})})))};za.displayName="NodeRenderer";var Fa=s.memo(za);const ja=(e,t,n)=>n===Po.Left?e-t:n===Po.Right?e+t:e,$a=(e,t,n)=>n===Po.Top?e-t:n===Po.Bottom?e+t:e,Ba="react-flow__edgeupdater",Va=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:l})=>c.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:$([Ba,`${Ba}-${l}`]),cx:ja(t,r,e),cy:$a(n,r,e),r:r,stroke:"transparent",fill:"transparent"}),Ha=()=>!0;var Ua=e=>{const t=({id:t,className:n,type:r,data:o,onClick:i,onEdgeDoubleClick:a,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:k,targetY:S,sourcePosition:E,targetPosition:_,elementsSelectable:C,hidden:O,sourceHandleId:N,targetHandleId:P,onContextMenu:R,onMouseEnter:M,onMouseMove:T,onMouseLeave:A,reconnectRadius:D,onReconnect:I,onReconnectStart:L,onReconnectEnd:z,markerEnd:F,markerStart:j,rfId:B,ariaLabel:V,isFocusable:H,isReconnectable:U,pathOptions:W,interactionWidth:q,disableKeyboardA11y:K})=>{const X=s.useRef(null),[Y,G]=s.useState(!1),[Q,Z]=s.useState(!1),J=Gr(),ee=s.useMemo((()=>`url('#${Ko(j,B)}')`),[j,B]),te=s.useMemo((()=>`url('#${Ko(F,B)}')`),[F,B]);if(O)return null;const ne=xo(t,J.getState,a),re=xo(t,J.getState,R),oe=xo(t,J.getState,M),ie=xo(t,J.getState,T),ae=xo(t,J.getState,A),le=(e,n)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=J.getState(),i=n?b:v,a=(n?P:N)||null,l=n?"target":"source",s=o||Ha,c=n,u=r.find((e=>e.id===t));Z(!0),L?.(e,u,l);ci({event:e,handleId:a,nodeId:i,onConnect:e=>I?.(u,e),isTarget:c,getState:J.getState,setState:J.setState,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:e=>{Z(!1),z?.(e,u,l)}})},se=()=>G(!0),ce=()=>G(!1),ue=!C&&!i;return c.createElement("g",{className:$(["react-flow__edge",`react-flow__edge-${r}`,n,{selected:l,animated:u,inactive:ue,updating:Y}]),onClick:e=>{const{edges:n,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=J.getState(),l=n.find((e=>e.id===t));l&&(C&&(J.setState({nodesSelectionActive:!1}),l.selected&&a?(o({nodes:[],edges:[l]}),X.current?.blur()):r([t])),i&&i(e,l))},onDoubleClick:ne,onContextMenu:re,onMouseEnter:oe,onMouseMove:ie,onMouseLeave:ae,onKeyDown:H?e=>{if(!K&&mo.includes(e.key)&&C){const{unselectNodesAndEdges:n,addSelectedEdges:r,edges:o}=J.getState();"Escape"===e.key?(X.current?.blur(),n({edges:[o.find((e=>e.id===t))]})):r([t])}}:void 0,tabIndex:H?0:void 0,role:H?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":null===V?void 0:V||`Edge from ${v} to ${b}`,"aria-describedby":H?`${Di}-${B}`:void 0,ref:X},!Q&&c.createElement(e,{id:t,source:v,target:b,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:o,style:y,sourceX:w,sourceY:x,targetX:k,targetY:S,sourcePosition:E,targetPosition:_,sourceHandleId:N,targetHandleId:P,markerStart:ee,markerEnd:te,pathOptions:W,interactionWidth:q}),U&&c.createElement(c.Fragment,null,("source"===U||!0===U)&&c.createElement(Va,{position:E,centerX:w,centerY:x,radius:D,onMouseDown:e=>le(e,!0),onMouseEnter:se,onMouseOut:ce,type:"source"}),("target"===U||!0===U)&&c.createElement(Va,{position:_,centerX:k,centerY:S,radius:D,onMouseDown:e=>le(e,!1),onMouseEnter:se,onMouseOut:ce,type:"target"})))};return t.displayName="EdgeWrapper",s.memo(t)};function Wa(e){return{...{default:Ua(e.default||Ho),straight:Ua(e.bezier||jo),step:Ua(e.step||Fo),smoothstep:Ua(e.step||zo),simplebezier:Ua(e.simplebezier||To)},...Object.keys(e).filter((e=>!["default","bezier"].includes(e))).reduce(((t,n)=>(t[n]=Ua(e[n]||Ho),t)),{})}}function qa(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case Po.Top:return{x:r+i/2,y:o};case Po.Right:return{x:r+i,y:o+a/2};case Po.Bottom:return{x:r+i/2,y:o+a};case Po.Left:return{x:r,y:o+a/2}}}function Ka(e,t){return e?1!==e.length&&t?t&&e.find((e=>e.id===t))||null:e[0]:null}function Xa(e){const t=e?.[ho]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ya=[{level:0,isMaxLevel:!0,edges:[]}];function Ga(e,t,n){const r=Yr(s.useCallback((n=>e?n.edges.filter((e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:l,transform:s}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=so({x:(0-s[0])/s[2],y:(0-s[1])/s[2],width:a/s[2],height:l/s[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})})):n.edges),[e,t]));return function(e,t,n=!1){let r=-1;const o=e.reduce(((e,o)=>{const i=po(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,l=Math.max(n?.[ho]?.z||0,e?.[ho]?.z||0,1e3);a=(i?o.zIndex:0)+(r?l:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e}),{}),i=Object.entries(o).map((([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}}));return 0===i.length?Ya:i}(r,t,n)}const Qa={[No.Arrow]:({color:e="none",strokeWidth:t=1})=>c.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[No.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>c.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Za=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const u=function(e){const t=Gr();return s.useMemo((()=>Object.prototype.hasOwnProperty.call(Qa,e)?Qa[e]:(t.getState().onError?.("009",Hr(e)),null)),[e])}(t);return u?c.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},c.createElement(u,{color:n,strokeWidth:a})):null},Ja=({defaultColor:e,rfId:t})=>{const n=Yr(s.useCallback((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce(((n,o)=>([o.markerStart,o.markerEnd].forEach((o=>{if(o&&"object"==typeof o){const i=Ko(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}})),n)),[]).sort(((e,t)=>e.id.localeCompare(t.id)))})({defaultColor:e,rfId:t}),[e,t]),((e,t)=>!(e.length!==t.length||e.some(((e,n)=>e.id!==t[n].id)))));return c.createElement("defs",null,n.map((e=>c.createElement(Za,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient}))))};Ja.displayName="MarkerDefinitions";var el=s.memo(Ja);const tl=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),nl=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:v})=>{const{edgesFocusable:b,edgesUpdatable:w,elementsSelectable:x,width:k,height:S,connectionMode:E,nodeInternals:_,onError:C}=Yr(tl,q),O=Ga(t,_,n);return k?c.createElement(c.Fragment,null,O.map((({level:t,edges:n,isMaxLevel:y})=>c.createElement("svg",{key:t,style:{zIndex:t},width:k,height:S,className:"react-flow__edges react-flow__container"},y&&c.createElement(el,{defaultColor:e,rfId:r}),c.createElement("g",null,n.map((e=>{const[t,n,y]=Xa(_.get(e.source)),[k,S,O]=Xa(_.get(e.target));if(!y||!O)return null;let N=e.type||"default";o[N]||(C?.("011",qr(N)),N="default");const P=o[N]||o.default,R=E===Eo.Strict?S.target:(S.target??[]).concat(S.source??[]),M=Ka(n.source,e.sourceHandle),T=Ka(R,e.targetHandle),A=M?.position||Po.Bottom,D=T?.position||Po.Top,I=!!(e.focusable||b&&void 0===e.focusable),L=e.reconnectable||e.updatable,z=void 0!==p&&(L||w&&void 0===L);if(!M||!T)return C?.("008",Ur(M,e)),null;const{sourceX:F,sourceY:j,targetX:B,targetY:V}=((e,t,n,r,o,i)=>{const a=qa(n,e,t),l=qa(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}})(t,M,A,k,T,D);return c.createElement(P,{key:e.id,id:e.id,className:$([e.className,i]),type:N,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:F,sourceY:j,targetX:B,targetY:V,sourcePosition:A,targetPosition:D,elementsSelectable:x,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:r,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:z,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:v})})))))),y):null};nl.displayName="EdgeRenderer";var rl=s.memo(nl);const ol=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function il({children:e}){const t=Yr(ol);return c.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}const al={[Po.Left]:Po.Right,[Po.Right]:Po.Left,[Po.Top]:Po.Bottom,[Po.Bottom]:Po.Top},ll=({nodeId:e,handleType:t,style:n,type:r=Oo.Bezier,CustomComponent:o,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:u,toY:d,connectionMode:f}=Yr(s.useCallback((t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode})),[e]),q),p=a?.[ho]?.handleBounds;let h=p?.[t];if(f===Eo.Loose&&(h=h||p?.["source"===t?"target":"source"]),!a||!h)return null;const m=l?h.find((e=>e.id===l)):h[0],g=m?m.x+m.width/2:(a.width??0)/2,y=m?m.y+m.height/2:a.height??0,v=(a.positionAbsolute?.x??0)+g,b=(a.positionAbsolute?.y??0)+y,w=m?.position,x=w?al[w]:null;if(!w||!x)return null;if(o)return c.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let k="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return r===Oo.Bezier?[k]=Vo(S):r===Oo.Step?[k]=Lo({...S,borderRadius:0}):r===Oo.SmoothStep?[k]=Lo(S):r===Oo.SimpleBezier?[k]=Mo(S):k=`M${v},${b} ${u},${d}`,c.createElement("path",{d:k,fill:"none",className:"react-flow__connection-path",style:n})};ll.displayName="ConnectionLine";const sl=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function cl({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:a,width:l,height:s,connectionStatus:u}=Yr(sl,q);return!!(o&&i&&l&&a)?c.createElement("svg",{style:e,width:l,height:s,className:"react-flow__edges react-flow__connectionline react-flow__container"},c.createElement("g",{className:$(["react-flow__connection",u])},c.createElement(ll,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u}))):null}function ul(e,t){s.useRef(null),Gr();return s.useMemo((()=>t(e)),[e])}const dl=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:u,onEdgeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:k,selectionKeyCode:S,selectionOnDrag:E,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:O,zoomActivationKeyCode:N,deleteKeyCode:P,onlyRenderVisibleElements:R,elementsSelectable:M,selectNodesOnDrag:T,defaultViewport:A,translateExtent:D,minZoom:I,maxZoom:L,preventScrolling:z,defaultMarkerColor:F,zoomOnScroll:j,zoomOnPinch:$,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:W,onPaneClick:q,onPaneMouseEnter:K,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:Z,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:te,onReconnect:ne,onReconnectStart:re,onReconnectEnd:oe,reconnectRadius:ie,noDragClassName:ae,noWheelClassName:le,noPanClassName:se,elevateEdgesOnSelect:ce,disableKeyboardA11y:ue,nodeOrigin:de,nodeExtent:fe,rfId:pe})=>{const he=ul(e,Ia),me=ul(t,Wa);return function(e){const t=Qi(),n=s.useRef(!1);s.useEffect((()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout((()=>e(t)),1),n.current=!0)}),[e,t.viewportInitialized])}(i),c.createElement(Da,{onPaneClick:q,onPaneMouseEnter:K,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:E,selectionMode:_,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:C,panActivationKeyCode:O,zoomActivationKeyCode:N,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:$,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:H,panOnDrag:W,defaultViewport:A,translateExtent:D,minZoom:I,maxZoom:L,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:ae,noWheelClassName:le,noPanClassName:se,disableKeyboardA11y:ue},c.createElement(il,null,c.createElement(rl,{edgeTypes:me,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:R,onEdgeContextMenu:Z,onEdgeMouseEnter:J,onEdgeMouseMove:ee,onEdgeMouseLeave:te,onReconnect:ne,onReconnectStart:re,onReconnectEnd:oe,reconnectRadius:ie,defaultMarkerColor:F,noPanClassName:se,elevateEdgesOnSelect:!!ce,disableKeyboardA11y:ue,rfId:pe},c.createElement(cl,{style:w,type:b,component:x,containerStyle:k})),c.createElement("div",{className:"react-flow__edgelabel-renderer"}),c.createElement(Fa,{nodeTypes:he,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:T,onlyRenderVisibleElements:R,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ue,nodeOrigin:de,nodeExtent:fe,rfId:pe})))};dl.displayName="GraphView";var fl=s.memo(dl);const pl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],hl={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:pl,nodeExtent:pl,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:(e,t)=>{},isValidConnection:void 0},ml=()=>((e,t)=>e?W(e,t):W)(((e,t)=>({...hl,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Hi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map((e=>({...r,...e})))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Hi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:s,nodeOrigin:c}=t(),u=s?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce(((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[ho]:{...n[ho],handleBounds:void 0}});else if(n){const r=to(t.nodeElement);!(!r.width||!r.height||n.width===r.width&&n.height===r.height&&!t.forceUpdate)&&(o.set(n.id,{...n,[ho]:{...n[ho],handleBounds:{source:ka(".source",t.nodeElement,f,c),target:ka(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e}),[]);Vi(o,c);const h=a||i&&!a&&Ui(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map((e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}));o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:s}=t();if(n?.length){if(i){const t=Hi(ua(n,l()),o,a,s);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,l=null;r?a=n.map((e=>fa(e,!0))):(a=pa(i(),n),l=pa(o,[])),Ki({changedNodes:a,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,l=null;r?a=n.map((e=>fa(e,!0))):(a=pa(o,n),l=pa(i(),[])),Ki({changedNodes:l,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Ki({changedNodes:(n||i()).map((e=>(e.selected=!1,fa(e.id,!1)))),changedEdges:a.map((e=>fa(e.id,!1))),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Ki({changedNodes:r().filter((e=>e.selected)).map((e=>fa(e.id,!1))),changedEdges:n.filter((e=>e.selected)).map((e=>fa(e.id,!1))),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach((e=>{e.positionAbsolute=ro(e.position,n)})),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:l}=t();if(!i||!a||!e.x&&!e.y)return!1;const s=wr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(s,c,l);i.transform(a,u);return n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:hl.connectionNodeId,connectionHandleId:hl.connectionHandleId,connectionHandleType:hl.connectionHandleType,connectionStatus:hl.connectionStatus,connectionStartHandle:hl.connectionStartHandle,connectionEndHandle:hl.connectionEndHandle}),reset:()=>e({...hl})})),Object.is),gl=({children:e})=>{const t=s.useRef(null);return t.current||(t.current=ml()),c.createElement(jr,{value:t.current},e)};gl.displayName="ReactFlowProvider";const yl=({children:e})=>s.useContext(Fr)?c.createElement(c.Fragment,null,e):c.createElement(gl,null,e);yl.displayName="ReactFlowWrapper";const vl={input:yi,default:mi,output:bi,group:wi},bl={default:Ho,straight:jo,step:Fo,smoothstep:zo,simplebezier:To},wl=[0,0],xl=[15,15],kl={x:0,y:0,zoom:1},Sl={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},El=s.forwardRef((({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=vl,edgeTypes:a=bl,onNodeClick:l,onEdgeClick:s,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:C,onNodesDelete:O,onEdgesDelete:N,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:M,onSelectionDragStop:T,onSelectionContextMenu:A,onSelectionStart:D,onSelectionEnd:I,connectionMode:L=Eo.Strict,connectionLineType:z=Oo.Bezier,connectionLineStyle:F,connectionLineComponent:j,connectionLineContainerStyle:B,deleteKeyCode:V="Backspace",selectionKeyCode:H="Shift",selectionOnDrag:U=!1,selectionMode:W=Co.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:K=(bo()?"Meta":"Control"),zoomActivationKeyCode:X=(bo()?"Meta":"Control"),snapToGrid:Y=!1,snapGrid:G=xl,onlyRenderVisibleElements:Q=!1,selectNodesOnDrag:Z=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=wl,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=kl,minZoom:le=.5,maxZoom:se=2,translateExtent:ce=pl,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=_o.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Se,onPaneScroll:Ee,onPaneContextMenu:_e,children:Ce,onEdgeContextMenu:Oe,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Me,onEdgeUpdate:Te,onEdgeUpdateStart:Ae,onEdgeUpdateEnd:De,onReconnect:Ie,onReconnectStart:Le,onReconnectEnd:ze,reconnectRadius:Fe=10,edgeUpdaterRadius:je=10,onNodesChange:$e,onEdgesChange:Be,noDragClassName:Ve="nodrag",noWheelClassName:He="nowheel",noPanClassName:Ue="nopan",fitView:We=!1,fitViewOptions:qe,connectOnClick:Ke=!0,attributionPosition:Xe,proOptions:Ye,defaultEdgeOptions:Ge,elevateNodesOnSelect:Qe=!0,elevateEdgesOnSelect:Ze=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:it,id:at,nodeDragThreshold:lt,...st},ct)=>{const ut=at||"1";return c.createElement("div",{...st,style:{...it,...Sl},ref:ct,className:$(["react-flow",o]),"data-testid":"rf__wrapper",id:at},c.createElement(yl,null,c.createElement(fl,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:a,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:j,connectionLineContainerStyle:B,selectionKeyCode:H,selectionOnDrag:U,selectionMode:W,deleteKeyCode:V,multiSelectionKeyCode:K,panActivationKeyCode:q,zoomActivationKeyCode:X,onlyRenderVisibleElements:Q,selectNodesOnDrag:Z,defaultViewport:ae,translateExtent:ce,minZoom:le,maxZoom:se,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Se,onPaneScroll:Ee,onPaneContextMenu:_e,onSelectionContextMenu:A,onSelectionStart:D,onSelectionEnd:I,onEdgeContextMenu:Oe,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Me,onReconnect:Ie??Te,onReconnectStart:Le??Ae,onReconnectEnd:ze??De,reconnectRadius:Fe??je,defaultMarkerColor:fe,noDragClassName:Ve,noWheelClassName:He,noPanClassName:Ue,elevateEdgesOnSelect:Ze,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),c.createElement(Ri,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Qe,minZoom:le,maxZoom:se,nodeExtent:de,onNodesChange:$e,onEdgesChange:Be,snapToGrid:Y,snapGrid:G,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ge,fitView:We,fitViewOptions:qe,onNodesDelete:O,onEdgesDelete:N,onNodeDragStart:E,onNodeDrag:_,onNodeDragStop:C,onSelectionDrag:M,onSelectionDragStart:R,onSelectionDragStop:T,noPanClassName:Ue,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:lt}),c.createElement(Ci,{onSelectionChange:P}),Ce,c.createElement(Jr,{proOptions:Ye,position:Xe}),c.createElement(zi,{rfId:ut,disableKeyboardA11y:Je})))}));El.displayName="ReactFlow";const _l=e=>e.getNodes();const Cl=e=>e.edges;const Ol=({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:l,strokeWidth:s,className:u,borderRadius:d,shapeRendering:f,onClick:p,selected:h})=>{const{background:m,backgroundColor:g}=i||{},y=a||m||g;return c.createElement("rect",{className:$(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,fill:y,stroke:l,strokeWidth:s,shapeRendering:f,onClick:p?t=>p(t,e):void 0})};Ol.displayName="MiniMapNode";var Nl=s.memo(Ol);const Pl=e=>e.nodeOrigin,Rl=e=>e.getNodes().filter((e=>!e.hidden&&e.width&&e.height)),Ml=e=>e instanceof Function?e:()=>e;var Tl=s.memo((function({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:i=Nl,onClick:a}){const l=Yr(Rl,q),s=Yr(Pl),u=Ml(t),d=Ml(e),f=Ml(n),p="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return c.createElement(c.Fragment,null,l.map((e=>{const{x:t,y:n}=Go(e,s).positionAbsolute;return c.createElement(i,{key:e.id,x:t,y:n,width:e.width,height:e.height,style:e.style,selected:e.selected,className:f(e),color:u(e),borderRadius:r,strokeColor:d(e),strokeWidth:o,shapeRendering:p,onClick:a,id:e.id})})))}));const Al=e=>{const t=e.getNodes(),n={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:n,boundingRect:t.length>0?(r=Qo(t,e.nodeOrigin),o=n,co(lo(so(r),so(o)))):n,rfId:e.rfId};var r,o};function Dl({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:f=1,position:p="bottom-right",onClick:h,onNodeClick:m,pannable:g=!1,zoomable:y=!1,ariaLabel:v="React Flow mini map",inversePan:b=!1,zoomStep:w=10,offsetScale:x=5}){const k=Gr(),S=s.useRef(null),{boundingRect:E,viewBB:_,rfId:C}=Yr(Al,q),O=e?.width??200,N=e?.height??150,P=E.width/O,R=E.height/N,M=Math.max(P,R),T=M*O,A=M*N,D=x*M,I=E.x-(T-E.width)/2-D,L=E.y-(A-E.height)/2-D,z=T+2*D,F=A+2*D,j=`react-flow__minimap-desc-${C}`,B=s.useRef(0);B.current=M,s.useEffect((()=>{if(S.current){const e=ut(S.current),t=e=>{const{transform:t,d3Selection:n,d3Zoom:r}=k.getState();if("wheel"!==e.sourceEvent.type||!n||!r)return;const o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*w,i=t[2]*Math.pow(2,o);r.scaleTo(n,i)},n=e=>{const{transform:t,d3Selection:n,d3Zoom:r,translateExtent:o,width:i,height:a}=k.getState();if("mousemove"!==e.sourceEvent.type||!n||!r)return;const l=B.current*Math.max(1,t[2])*(b?-1:1),s={x:t[0]-e.sourceEvent.movementX*l,y:t[1]-e.sourceEvent.movementY*l},c=[[0,0],[i,a]],u=wr.translate(s.x,s.y).scale(t[2]),d=r.constrain()(u,c,o);r.transform(n,d)},r=Pr().on("zoom",g?n:null).on("zoom.wheel",y?t:null);return e.call(r),()=>{e.on("zoom",null)}}}),[g,y,b,w]);const V=h?e=>{const t=dt(e);h(e,{x:t[0],y:t[1]})}:void 0,H=m?(e,t)=>{const n=k.getState().nodeInternals.get(t);m(e,n)}:void 0;return c.createElement(Zr,{position:p,style:e,className:$(["react-flow__minimap",t]),"data-testid":"rf__minimap"},c.createElement("svg",{width:O,height:N,viewBox:`${I} ${L} ${z} ${F}`,role:"img","aria-labelledby":j,ref:S,onClick:V},v&&c.createElement("title",{id:j},v),c.createElement(Tl,{onClick:H,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),c.createElement("path",{className:"react-flow__minimap-mask",d:`M${I-D},${L-D}h${z+2*D}v${F+2*D}h${-z-2*D}z\n M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fill:u,fillRule:"evenodd",stroke:d,strokeWidth:f,pointerEvents:"none"})))}Dl.displayName="MiniMap";var Il,Ll=s.memo(Dl);function zl({color:e,dimensions:t,lineWidth:n}){return c.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Fl({color:e,radius:t}){return c.createElement("circle",{cx:t,cy:t,r:t,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Il||(Il={}));const jl={[Il.Dots]:"#91919a",[Il.Lines]:"#eee",[Il.Cross]:"#e2e2e2"},$l={[Il.Dots]:1,[Il.Lines]:1,[Il.Cross]:6},Bl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Vl({id:e,variant:t=Il.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:a,style:l,className:u}){const d=s.useRef(null),{transform:f,patternId:p}=Yr(Bl,q),h=a||jl[t],m=r||$l[t],g=t===Il.Dots,y=t===Il.Cross,v=Array.isArray(n)?n:[n,n],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,k=g?[w/i,w/i]:[x[0]/i,x[1]/i];return c.createElement("svg",{className:$(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},c.createElement("pattern",{id:p+e,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`},g?c.createElement(Fl,{color:h,radius:w/i}):c.createElement(zl,{dimensions:x,color:h,lineWidth:o})),c.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}Vl.displayName="Background";var Hl=s.memo(Vl);const Ul=({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})=>[`${e}:${t}`,`${n}:${r}`].sort().join("--"),Wl=0,ql=10,Kl=20,Xl=30,Yl=ql,Gl=e=>"string"==typeof e?e:e===Wl?"DEBUG":e===ql?"INFO":e===Kl?"WARN":e===Xl?"ERROR":"UNKNOWN";class Ql{constructor(e,t=ql){this.name=e,this.level=(e=>{if("number"==typeof e)return e;const t=e.toLowerCase();if("debug"===t)return Wl;if("info"===t)return ql;if("warn"===t||"warning"===t)return Kl;if("error"===t)return Xl;throw new Error(`Unknown log level: ${e}`)})(t),this._level_name=Gl(t)}set_level(e){this.level=e,this._level_name=Gl(e)}_fomat_message(e,...t){return`[${this.name}] ${this._level_name}: ${e} ${t.map((e=>JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}()))).join(" ")}`}debug(e,...t){this.level<=Wl&&console.debug(this._fomat_message(e,...t))}info(e,...t){this.level<=ql&&console.info(this._fomat_message(e,...t))}warn(e,...t){this.level<=Kl&&console.warn(this._fomat_message(e,...t))}error(e,...t){this.level<=Xl&&console.error(this._fomat_message(e,...t))}}const Zl=(e,t)=>("<NoValue>"===e.value&&(e.value=void 0),"<NoValue>"===e.fullvalue&&(e.fullvalue=void 0),void 0===e.try_get_full_value&&(e.try_get_full_value=()=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.get_io_full_value({nid:e.node,ioid:e.id})}),void 0===e.hidden&&(e.hidden=!1),void 0===e.set_hidden&&(e.set_hidden=n=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.update_io_options({nid:e.node,ioid:e.id,options:{hidden:n}})}),e),Jl=(e,t,n)=>{if(((e,t)=>{const n=e.frontend||{};if(n.size||(n.size=[200,100]),!n.pos||2!==n.pos.length||isNaN(n.pos[0])||null===n.pos[0]||isNaN(n.pos[1])||null===n.pos[1])if(t&&t.rf_instance&&null!==t.reactflowRef){const e=t.reactflowRef.getBoundingClientRect(),r=e.left+e.width/2,o=e.top+e.height/2,i=t.rf_instance.screenToFlowPosition({x:r,y:o});n.pos=[i.x-n.size[0]/2,i.y-n.size[1]/2]}else n.pos=[0,0];n.collapsed||(n.collapsed=!1),e.frontend=n})(e,n),void 0===(e=F(e)).id)throw new Error("Node must have an id");for(const t in e.io)e.io[t].node=e.id,Zl(e.io[t],n);return{position:{x:e.frontend.pos[0],y:e.frontend.pos[1]},data:{UseNodeStore:t},type:"default",...e}},es=e=>{const t={...e},n=e=>{const t=o.getState();if(e.from_remote){let n=i.get_node(e.node.id,!1);if(!n)try{n=(e=>P(((t,n)=>F(j(e)))))(e.node),i.nodesstates.set(e.node.id,n)}catch(e){return void l.logger.error(`Failed to create node store ${e}`)}const r=n.getState();l.logger.info("Add node",r.id,r.name);const a=[...t.nodes,Jl(r,n,l)];o.setState({nodes:a});for(const t in e.node.io){const n=e.node.io[t].id;void 0!==n&&l.worker?.get_io_value({nid:e.node.id,ioid:n})}}},r=e=>{switch(e.type){case"add":n(e);break;case"update":(e=>{if(e.node.in_trigger&&(e.node.error=void 0),e.from_remote){const t=i.get_node(e.id,!1);if(!t)return;j(e.node);const n=t.getState(),{new_obj:r,change:o}=T(n,e.node);if(o){if(e.node.io)for(const t in e.node.io){r.io[t].fullvalue=e.node.io[t]?.fullvalue;for(const t in e.node.io){const n=e.node.io[t],o=r.io[t];n.hasOwnProperty("value")&&(void 0===n.value?o.value=null:"<NoValue>"===n.value?o.value=void 0:o.value=n.value)}}Jl(r,t,l),l.logger.debug("update_action",r),t.setState(F(r))}}else l.worker&&l.worker.locally_update_node(e)})(e);break;case"delete":(e=>{l.logger.info("Deleting node",e.id),e.from_remote?o.getState().onNodesChange([{type:"remove",id:e.id}]):l.worker?.remove_node(e.id)})(e);break;case"error":(e=>{l.logger.error("Error",e),r({type:"update",id:e.id,node:{in_trigger:!1,error:e.error},from_remote:!0})})(e);break;case"trigger":(e=>{e.from_remote?r({type:"update",id:e.id,node:{in_trigger:!0,error:void 0},from_remote:!0}):l.worker?.trigger_node(e.id)})(e);break;default:l.logger.error("Unknown node action",e)}},o=(({on_node_change:e,on_edge_change:t,on_connect:n})=>{const r=e||(e=>{}),o=n||(e=>{}),i=P(((e,t)=>({nodes:[],edges:[],onNodesChange:n=>{e({nodes:ua(n,t().nodes)}),r(n)},onEdgesChange:n=>{e({edges:da(n,t().edges)})},onConnect:e=>{null!=e.source&&null!=e.target&&o(e)}})));return i})({on_node_change:e=>{for(const t of e)switch(t.type){case"position":t.position&&r({type:"update",id:t.id,node:{frontend:{pos:[t.position.x,t.position.y]}},from_remote:!1});break;case"dimensions":t.dimensions&&r({type:"update",id:t.id,node:{frontend:{size:[t.dimensions.width,t.dimensions.height]}},from_remote:!1})}},on_edge_change:e=>{},on_connect:e=>{null!==e.source&&null!==e.target&&null!==e.sourceHandle&&null!==e.targetHandle&&l.worker&&l.worker.add_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle,replace:!0})}}),i=(({})=>{const e=new Map;return{nodesstates:e,get_node:(t,n=!0)=>{const r=e.get(t);if(!r&&n){const n=e.keys();throw new Error(`Node ${t} not found, available nodes: ${Array.from(n)}`)}return r}}})({}),a={libstate:P(((e,t)=>({lib:{shelves:[]},external_worker:[],set:t=>e((e=>({...e,...t}))),get_lib:()=>t().lib,get_external_worker:()=>t().external_worker})))},l={local_settings:P(((e,t)=>({view_settings:{expand_node_props:!1},update_view_settings:e=>{const t=l.local_settings.getState().view_settings,{new_obj:n,change:r}=T(t,e);r&&l.local_settings.setState((e=>({...e,view_settings:n})))}}))),local_state:P(((e,t)=>({selected_nodes:[],selected_edges:[]}))),options:t,lib:a,workermanager:void 0,workers:P(((e,t)=>({}))),workerstate:P(((e,t)=>({is_open:!1}))),render_options:P(((e,t)=>({}))),progress_state:P(((e,t)=>({message:"please select worker",status:"info",progress:0,blocking:!1}))),update_render_options:e=>{const t=l.render_options.getState(),{new_obj:n,change:r}=T(t,e);r&&l.render_options.setState(n)},worker:void 0,_unsubscribeFromWorker:void 0,set_worker:e=>{e!==l.worker&&(l._unsubscribeFromWorker&&(l._unsubscribeFromWorker(),l._unsubscribeFromWorker=void 0),e&&(l._unsubscribeFromWorker=e.state.subscribe((e=>{l.workerstate.setState(e)})),l.workerstate.setState(e.state.getState())),l.worker=e,e?.set_zustand(l))},nodespace:i,useReactFlowStore:o,on_node_action:r,on_edge_action:e=>{const t=o.getState();switch(e.type){case"add":if(e.from_remote){const n=t.edges,r=Ul(e);if(n.some((e=>e.id===r)))return;const i={id:r,source:e.src_nid,target:e.trg_nid,sourceHandle:e.src_ioid,targetHandle:e.trg_ioid,className:"funcnodes-edge animated"};l.logger.info("Adding edge",i),o.setState({edges:[...n,i]}),l.worker?.get_remote_node_state(e.src_nid),l.worker?.get_remote_node_state(e.trg_nid)}break;case"delete":if(e.from_remote){const n=t.edges,r=Ul(e);l.logger.info("Deleting edge",r);const i=n.filter((e=>e.id!==r));o.setState({edges:i}),l.worker?.get_remote_node_state(e.src_nid),l.worker?.get_remote_node_state(e.trg_nid)}break;default:l.logger.error("Unknown edge action",e)}},reactflowRef:null,clear_all:()=>{l.worker?.disconnect(),l.set_worker(void 0),l.workermanager?.setWorker(void 0),l.lib.libstate.getState().set({lib:{shelves:[]},external_worker:[]}),l.nodespace.nodesstates.clear(),l.useReactFlowStore.setState({nodes:[],edges:[]}),l.auto_progress()},set_progress:e=>{if(""===e.message)return l.auto_progress();const t=l.progress_state.getState(),{new_obj:n,change:r}=T(t,e);r&&l.progress_state.setState(n)},auto_progress:()=>void 0===l.workermanager||l.workermanager.open?void 0===l.worker?l.set_progress({progress:0,message:"please select worker",status:"error",blocking:!1}):l.worker.is_open?void l.set_progress({progress:1,message:"running",status:"info",blocking:!1}):l.set_progress({progress:0,message:"connecting to worker",status:"info",blocking:!0}):l.set_progress({progress:0,message:"connecting to worker manager",status:"error",blocking:!1}),plugins:P(((e,t)=>({}))),add_plugin:(e,t)=>{void 0!==t&&l.plugins.setState((n=>({...n,[e]:t})))},dev_settings:{debug:!0},logger:new Ql("fn",Yl)};return l};function ts(e,t){return function(){return e.apply(t,arguments)}}const{toString:ns}=Object.prototype,{getPrototypeOf:rs}=Object,os=(e=>t=>{const n=ns.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),is=e=>(e=e.toLowerCase(),t=>os(t)===e),as=e=>t=>typeof t===e,{isArray:ls}=Array,ss=as("undefined");const cs=is("ArrayBuffer");const us=as("string"),ds=as("function"),fs=as("number"),ps=e=>null!==e&&"object"==typeof e,hs=e=>{if("object"!==os(e))return!1;const t=rs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ms=is("Date"),gs=is("File"),ys=is("Blob"),vs=is("FileList"),bs=is("URLSearchParams"),[ws,xs,ks,Ss]=["ReadableStream","Request","Response","Headers"].map(is);function Es(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),ls(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function _s(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Cs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:window,Os=e=>!ss(e)&&e!==Cs;const Ns=(Ps="undefined"!=typeof Uint8Array&&rs(Uint8Array),e=>Ps&&e instanceof Ps);var Ps;const Rs=is("HTMLFormElement"),Ms=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ts=is("RegExp"),As=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Es(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},Ds="abcdefghijklmnopqrstuvwxyz",Is="0123456789",Ls={DIGIT:Is,ALPHA:Ds,ALPHA_DIGIT:Ds+Ds.toUpperCase()+Is};const zs=is("AsyncFunction"),Fs=(js="function"==typeof setImmediate,$s=ds(Cs.postMessage),js?setImmediate:$s?((e,t)=>(Cs.addEventListener("message",(({source:n,data:r})=>{n===Cs&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),Cs.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var js,$s;const Bs="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Cs):"undefined"!=typeof process&&process.nextTick||Fs;var Vs={isArray:ls,isArrayBuffer:cs,isBuffer:function(e){return null!==e&&!ss(e)&&null!==e.constructor&&!ss(e.constructor)&&ds(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ds(e.append)&&("formdata"===(t=os(e))||"object"===t&&ds(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&cs(e.buffer),t},isString:us,isNumber:fs,isBoolean:e=>!0===e||!1===e,isObject:ps,isPlainObject:hs,isReadableStream:ws,isRequest:xs,isResponse:ks,isHeaders:Ss,isUndefined:ss,isDate:ms,isFile:gs,isBlob:ys,isRegExp:Ts,isFunction:ds,isStream:e=>ps(e)&&ds(e.pipe),isURLSearchParams:bs,isTypedArray:Ns,isFileList:vs,forEach:Es,merge:function e(){const{caseless:t}=Os(this)&&this||{},n={},r=(r,o)=>{const i=t&&_s(n,o)||o;hs(n[i])&&hs(r)?n[i]=e(n[i],r):hs(r)?n[i]=e({},r):ls(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Es(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Es(t,((t,r)=>{n&&ds(t)?e[r]=ts(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&rs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:os,kindOfTest:is,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ls(e))return e;let t=e.length;if(!fs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Rs,hasOwnProperty:Ms,hasOwnProp:Ms,reduceDescriptors:As,freezeMethods:e=>{As(e,((t,n)=>{if(ds(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ds(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ls(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_s,window:Cs,isContextDefined:Os,ALPHABET:Ls,generateString:(e=16,t=Ls.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&ds(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ps(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=ls(e)?[]:{};return Es(e,((e,t)=>{const i=n(e,r+1);!ss(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:zs,isThenable:e=>e&&(ps(e)||ds(e))&&ds(e.then)&&ds(e.catch),setImmediate:Fs,asap:Bs};function Hs(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Vs.inherits(Hs,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Vs.toJSONObject(this.config),code:this.code,status:this.status}}});const Us=Hs.prototype,Ws={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ws[e]={value:e}})),Object.defineProperties(Hs,Ws),Object.defineProperty(Us,"isAxiosError",{value:!0}),Hs.from=(e,t,n,r,o,i)=>{const a=Object.create(Us);return Vs.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Hs.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function qs(e){return Vs.isPlainObject(e)||Vs.isArray(e)}function Ks(e){return Vs.endsWith(e,"[]")?e.slice(0,-2):e}function Xs(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ks(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ys=Vs.toFlatObject(Vs,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Gs(e,t,n){if(!Vs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Vs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Vs.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Vs.isSpecCompliantForm(t);if(!Vs.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(Vs.isDate(e))return e.toISOString();if(!l&&Vs.isBlob(e))throw new Hs("Blob is not supported. Use a Buffer instead.");return Vs.isArrayBuffer(e)||Vs.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let l=e;if(e&&!o&&"object"==typeof e)if(Vs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Vs.isArray(e)&&function(e){return Vs.isArray(e)&&!e.some(qs)}(e)||(Vs.isFileList(e)||Vs.endsWith(n,"[]"))&&(l=Vs.toArray(e)))return n=Ks(n),l.forEach((function(e,r){!Vs.isUndefined(e)&&null!==e&&t.append(!0===a?Xs([n],r,i):null===a?n:n+"[]",s(e))})),!1;return!!qs(e)||(t.append(Xs(o,n,i),s(e)),!1)}const u=[],d=Object.assign(Ys,{defaultVisitor:c,convertValue:s,isVisitable:qs});if(!Vs.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Vs.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Vs.forEach(n,(function(n,i){!0===(!(Vs.isUndefined(n)||null===n)&&o.call(t,n,Vs.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t}function Qs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Zs(e,t){this._pairs=[],e&&Gs(e,this,t)}const Js=Zs.prototype;function ec(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tc(e,t,n){if(!t)return e;const r=n&&n.encode||ec;Vs.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Vs.isURLSearchParams(t)?t.toString():new Zs(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Js.append=function(e,t){this._pairs.push([e,t])},Js.toString=function(e){const t=e?function(t){return e.call(this,t,Qs)}:Qs;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class nc{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vs.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var rc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zs,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ic="undefined"!=typeof window&&"undefined"!=typeof document,ac="object"==typeof navigator&&navigator||void 0,lc=ic&&(!ac||["ReactNative","NativeScript","NS"].indexOf(ac.product)<0),sc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cc=ic&&window.location.href||"http://localhost";var uc={...Object.freeze({__proto__:null,hasBrowserEnv:ic,hasStandardBrowserEnv:lc,hasStandardBrowserWebWorkerEnv:sc,navigator:ac,origin:cc}),...oc};function dc(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),l=o>=e.length;if(i=!i&&Vs.isArray(r)?r.length:i,l)return Vs.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&Vs.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Vs.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(Vs.isFormData(e)&&Vs.isFunction(e.entries)){const n={};return Vs.forEachEntry(e,((e,r)=>{t(function(e){return Vs.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const fc={transitional:rc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Vs.isObject(e);o&&Vs.isHTMLForm(e)&&(e=new FormData(e));if(Vs.isFormData(e))return r?JSON.stringify(dc(e)):e;if(Vs.isArrayBuffer(e)||Vs.isBuffer(e)||Vs.isStream(e)||Vs.isFile(e)||Vs.isBlob(e)||Vs.isReadableStream(e))return e;if(Vs.isArrayBufferView(e))return e.buffer;if(Vs.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Gs(e,new uc.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return uc.isNode&&Vs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Vs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Gs(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Vs.isString(e))try{return(t||JSON.parse)(e),Vs.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||fc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Vs.isResponse(e)||Vs.isReadableStream(e))return e;if(e&&Vs.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Hs.from(e,Hs.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:uc.classes.FormData,Blob:uc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vs.forEach(["delete","get","head","post","put","patch"],(e=>{fc.headers[e]={}}));const pc=Vs.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const hc=Symbol("internals");function mc(e){return e&&String(e).trim().toLowerCase()}function gc(e){return!1===e||null==e?e:Vs.isArray(e)?e.map(gc):String(e)}function yc(e,t,n,r,o){return Vs.isFunction(r)?r.call(this,t,n):(o&&(t=n),Vs.isString(t)?Vs.isString(r)?-1!==t.indexOf(r):Vs.isRegExp(r)?r.test(t):void 0:void 0)}let vc=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=mc(t);if(!o)throw new Error("header name must be a non-empty string");const i=Vs.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=gc(e))}const i=(e,t)=>Vs.forEach(e,((e,n)=>o(e,n,t)));if(Vs.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Vs.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&pc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Vs.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=mc(e)){const n=Vs.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Vs.isFunction(t))return t.call(this,e,n);if(Vs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=mc(e)){const n=Vs.findKey(this,e);return!(!n||void 0===this[n]||t&&!yc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=mc(e)){const o=Vs.findKey(n,e);!o||t&&!yc(0,n[o],o,t)||(delete n[o],r=!0)}}return Vs.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!yc(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Vs.forEach(this,((r,o)=>{const i=Vs.findKey(n,o);if(i)return t[i]=gc(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=gc(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vs.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Vs.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[hc]=this[hc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=mc(e);t[r]||(!function(e,t){const n=Vs.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Vs.isArray(e)?e.forEach(r):r(e),this}};function bc(e,t){const n=this||fc,r=t||n,o=vc.from(r.headers);let i=r.data;return Vs.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function wc(e){return!(!e||!e.__CANCEL__)}function xc(e,t,n){Hs.call(this,null==e?"canceled":e,Hs.ERR_CANCELED,t,n),this.name="CanceledError"}function kc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Hs("Request failed with status code "+n.status,[Hs.ERR_BAD_REQUEST,Hs.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}vc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vs.reduceDescriptors(vc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Vs.freezeMethods(vc),Vs.inherits(xc,Hs,{__CANCEL__:!0});const Sc=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(l){const s=Date.now(),c=r[a];o||(o=s),n[i]=l,r[i]=s;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),s-o<t)return;const f=c&&s-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),l=t-o;l>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-l)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,l=i-r,s=o(l);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},Ec=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_c=e=>(...t)=>Vs.asap((()=>e(...t)));var Cc=uc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,uc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(uc.origin),uc.navigator&&/(msie|trident)/i.test(uc.navigator.userAgent)):()=>!0,Oc=uc.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];Vs.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Vs.isString(r)&&a.push("path="+r),Vs.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Nc(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pc=e=>e instanceof vc?{...e}:e;function Rc(e,t){t=t||{};const n={};function r(e,t,n,r){return Vs.isPlainObject(e)&&Vs.isPlainObject(t)?Vs.merge.call({caseless:r},e,t):Vs.isPlainObject(t)?Vs.merge({},t):Vs.isArray(t)?t.slice():t}function o(e,t,n,o){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Vs.isUndefined(t))return r(void 0,t)}function a(e,t){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(e,t,n)=>o(Pc(e),Pc(t),0,!0)};return Vs.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=s[r]||o,a=i(e[r],t[r],r);Vs.isUndefined(a)&&i!==l||(n[r]=a)})),n}var Mc=e=>{const t=Rc({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:l,auth:s}=t;if(t.headers=l=vc.from(l),t.url=tc(Nc(t.baseURL,t.url),e.params,e.paramsSerializer),s&&l.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Vs.isFormData(r))if(uc.hasStandardBrowserEnv||uc.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(!1!==(n=l.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];l.setContentType([e||"multipart/form-data",...t].join("; "))}if(uc.hasStandardBrowserEnv&&(o&&Vs.isFunction(o)&&(o=o(t)),o||!1!==o&&Cc(t.url))){const e=i&&a&&Oc.read(a);e&&l.set(i,e)}return t};var Tc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Mc(e);let o=r.data;const i=vc.from(r.headers).normalize();let a,l,s,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=vc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());kc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Hs("Request aborted",Hs.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Hs("Network Error",Hs.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||rc;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Hs(t,o.clarifyTimeoutError?Hs.ETIMEDOUT:Hs.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&Vs.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Vs.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([s,u]=Sc(p,!0),m.addEventListener("progress",s)),f&&m.upload&&([l,c]=Sc(f),m.upload.addEventListener("progress",l),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new xc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===uc.protocols.indexOf(y)?n(new Hs("Unsupported protocol "+y+":",Hs.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Hs?t:new xc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new Hs(`timeout ${t} of ms exceeded`,Hs.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:l}=r;return l.unsubscribe=()=>Vs.asap(a),l}},Dc=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ic=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Lc=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ic(e))yield*Dc(n,t)}(e,t);let i,a=0,l=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return l(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw l(e),e}},cancel:e=>(l(e),o.return())},{highWaterMark:2})},zc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Fc=zc&&"function"==typeof ReadableStream,jc=zc&&("function"==typeof TextEncoder?($c=new TextEncoder,e=>$c.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var $c;const Bc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Vc=Fc&&Bc((()=>{let e=!1;const t=new Request(uc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Hc=Fc&&Bc((()=>Vs.isReadableStream(new Response("").body))),Uc={stream:Hc&&(e=>e.body)};var Wc;zc&&(Wc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Uc[e]&&(Uc[e]=Vs.isFunction(Wc[e])?t=>t[e]():(t,n)=>{throw new Hs(`Response type '${e}' is not supported`,Hs.ERR_NOT_SUPPORT,n)})})));const qc=async(e,t)=>{const n=Vs.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Vs.isBlob(e))return e.size;if(Vs.isSpecCompliantForm(e)){const t=new Request(uc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vs.isArrayBufferView(e)||Vs.isArrayBuffer(e)?e.byteLength:(Vs.isURLSearchParams(e)&&(e+=""),Vs.isString(e)?(await jc(e)).byteLength:void 0)})(t):n};var Kc=zc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:s,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Mc(e);c=c?(c+"").toLowerCase():"text";let p,h=Ac([o,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(s&&Vc&&"get"!==n&&"head"!==n&&0!==(g=await qc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Vs.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ec(g,Sc(_c(s)));r=Lc(n.body,65536,e,t)}}Vs.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(p);const a=Hc&&("stream"===c||"response"===c);if(Hc&&(l||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Vs.toFiniteNumber(i.headers.get("content-length")),[n,r]=l&&Ec(t,Sc(_c(l),!0))||[];i=new Response(Lc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let y=await Uc[Vs.findKey(Uc,c)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{kc(t,n,{data:y,headers:vc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Hs("Network Error",Hs.ERR_NETWORK,e,p),{cause:t.cause||t});throw Hs.from(t,t&&t.code,e,p)}});const Xc={http:null,xhr:Tc,fetch:Kc};Vs.forEach(Xc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Yc=e=>`- ${e}`,Gc=e=>Vs.isFunction(e)||null===e||!1===e;var Qc=e=>{e=Vs.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Gc(n)&&(r=Xc[(t=String(n)).toLowerCase()],void 0===r))throw new Hs(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Hs("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Yc).join("\n"):" "+Yc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Zc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xc(null,e)}function Jc(e){Zc(e),e.headers=vc.from(e.headers),e.data=bc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qc(e.adapter||fc.adapter)(e).then((function(t){return Zc(e),t.data=bc.call(e,e.transformResponse,t),t.headers=vc.from(t.headers),t}),(function(t){return wc(t)||(Zc(e),t&&t.response&&(t.response.data=bc.call(e,e.transformResponse,t.response),t.response.headers=vc.from(t.response.headers))),Promise.reject(t)}))}const eu="1.7.9",tu={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tu[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const nu={};tu.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Hs(r(o," has been removed"+(t?" in "+t:"")),Hs.ERR_DEPRECATED);return t&&!nu[o]&&(nu[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},tu.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ru={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Hs("options must be an object",Hs.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Hs("option "+i+" must be "+n,Hs.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Hs("Unknown option "+i,Hs.ERR_BAD_OPTION)}},validators:tu};const ou=ru.validators;let iu=class{constructor(e){this.defaults=e,this.interceptors={request:new nc,response:new nc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Rc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ru.assertOptions(n,{silentJSONParsing:ou.transitional(ou.boolean),forcedJSONParsing:ou.transitional(ou.boolean),clarifyTimeoutError:ou.transitional(ou.boolean)},!1),null!=r&&(Vs.isFunction(r)?t.paramsSerializer={serialize:r}:ru.assertOptions(r,{encode:ou.function,serialize:ou.function},!0)),ru.assertOptions(t,{baseUrl:ou.spelling("baseURL"),withXsrfToken:ou.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Vs.merge(o.common,o[t.method]);o&&Vs.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=vc.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let u,d=0;if(!l){const e=[Jc.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,s),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let f=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=Jc.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=s.length;d<u;)c=c.then(s[d++],s[d++]);return c}getUri(e){return tc(Nc((e=Rc(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Vs.forEach(["delete","get","head","options"],(function(e){iu.prototype[e]=function(t,n){return this.request(Rc(n||{},{method:e,url:t,data:(n||{}).data}))}})),Vs.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Rc(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}iu.prototype[e]=t(),iu.prototype[e+"Form"]=t(!0)}));const au={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(au).forEach((([e,t])=>{au[t]=e}));const lu=function e(t){const n=new iu(t),r=ts(iu.prototype.request,n);return Vs.extend(r,iu.prototype,n,{allOwnKeys:!0}),Vs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Rc(t,n))},r}(fc);lu.Axios=iu,lu.CanceledError=xc,lu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new xc(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},lu.isCancel=wc,lu.VERSION=eu,lu.toFormData=Gs,lu.AxiosError=Hs,lu.Cancel=lu.CanceledError,lu.all=function(e){return Promise.all(e)},lu.spread=function(e){return function(t){return e.apply(null,t)}},lu.isAxiosError=function(e){return Vs.isObject(e)&&!0===e.isAxiosError},lu.mergeConfig=Rc,lu.AxiosHeaders=vc,lu.formToJSON=e=>dc(Vs.isHTMLForm(e)?new FormData(e):e),lu.getAdapter=Qc,lu.HttpStatusCode=au,lu.default=lu;const{Axios:su,AxiosError:cu,CanceledError:uu,isCancel:du,CancelToken:fu,VERSION:pu,all:hu,Cancel:mu,isAxiosError:gu,spread:yu,toFormData:vu,AxiosHeaders:bu,HttpStatusCode:wu,formToJSON:xu,getAdapter:ku,mergeConfig:Su}=lu;let Eu;const _u=new Uint8Array(16);function Cu(){if(!Eu&&(Eu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Eu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Eu(_u)}const Ou=[];for(let e=0;e<256;++e)Ou.push((e+256).toString(16).slice(1));var Nu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pu(e,t,n){if(Nu.randomUUID&&!e)return Nu.randomUUID();const r=(e=e||{}).random||(e.rng||Cu)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return Ou[e[t+0]]+Ou[e[t+1]]+Ou[e[t+2]]+Ou[e[t+3]]+"-"+Ou[e[t+4]]+Ou[e[t+5]]+"-"+Ou[e[t+6]]+Ou[e[t+7]]+"-"+Ou[e[t+8]]+Ou[e[t+9]]+"-"+Ou[e[t+10]]+Ou[e[t+11]]+Ou[e[t+12]]+Ou[e[t+13]]+Ou[e[t+14]]+Ou[e[t+15]]}(r)}class Ru{constructor(e){this.uuid=e.uuid,this.on_error=e.on_error||(e=>{this._zustand?.logger.error(e)}),this.messagePromises=new Map,this._local_nodeupdates=new Map,this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),5e3),this.state=P(((e,t)=>({is_open:!1}))),e.zustand&&this.set_zustand(e.zustand),e.on_sync_complete?this.on_sync_complete=e.on_sync_complete:this.on_sync_complete=async()=>{}}set_zustand(e){e!==this._zustand&&(this._zustand=e,e.set_worker(this),this._zustand.auto_progress(),this.stepwise_fullsync())}get is_open(){return this.state.getState().is_open}set is_open(e){this.state.setState({is_open:e})}async stepwise_fullsync(){this._zustand&&this.is_open&&(await this.sync_lib(),await this.sync_external_worker(),await this.sync_funcnodes_plugins(),await this.sync_nodespace(),await this.sync_view_state(),await this.on_sync_complete(this))}async sync_lib(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_library",wait_for_response:!0,retries:2});this._zustand.lib.libstate.getState().set({lib:e})}async sync_external_worker(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_worker_dependencies",wait_for_response:!0});this._zustand.lib.libstate.getState().set({external_worker:e})}async sync_funcnodes_plugins(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_plugin_keys",wait_for_response:!0,kwargs:{type:"react"}});for(const t of e){const e=await this._send_cmd({cmd:"get_plugin",wait_for_response:!0,kwargs:{key:t,type:"react"}});if(e.js)for(const t of e.js){const e=document.createElement("script");e.text=atob(t),document.body.appendChild(e)}if(e.css)for(const t of e.css){const e=document.createElement("style");e.innerHTML=atob(t),document.head.appendChild(e)}if(void 0!==e.module){const n=atob(e.module),r=n.length,o=new Uint8Array(r);for(let e=0;e<r;e++)o[e]=n.charCodeAt(e);const i=new Blob([o],{type:"application/javascript"}),a=URL.createObjectURL(i),l=await import(a);URL.revokeObjectURL(a),this._zustand.add_plugin(t,l.default)}}}async sync_view_state(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"view_state",wait_for_response:!0});e.renderoptions&&this._zustand.update_render_options(e.renderoptions);const t=e.nodes;if(t)for(const e in t){const n=t[e];this._zustand.on_node_action({type:"update",node:{frontend:n},id:e,from_remote:!0})}}async sync_nodespace(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_nodes",kwargs:{with_frontend:!0},wait_for_response:!0});for(const t of e)this._receive_node_added(t);const t=await this._send_cmd({cmd:"get_edges",wait_for_response:!0});for(const e of t)this._receive_edge_added(...e)}async fullsync(){if(!this._zustand)return;if(!this.is_open)return;let e;for(;;)try{e=await this._send_cmd({cmd:"full_state"});break}catch(e){this._zustand.logger.error("Error in fullsync",e)}this._zustand.logger.debug("Full state",e),this._zustand.lib.libstate.getState().set({lib:e.backend.lib,external_worker:e.worker_dependencies}),e.view.renderoptions&&this._zustand.update_render_options(e.view.renderoptions);const t=e.view.nodes;for(const n of e.backend.nodes)void 0!==t[n.id]&&(n.frontend=t[n.id]),this._receive_node_added(n);for(const t of e.backend.edges)this._receive_edge_added(...t)}async _receive_edge_added(e,t,n,r){this._zustand&&this._zustand.on_edge_action({type:"add",from_remote:!0,src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})}async trigger_node(e){await this._send_cmd({cmd:"trigger_node",kwargs:{nid:e},wait_for_response:!1})}async add_node(e){const t=await this._send_cmd({cmd:"add_node",kwargs:{id:e}});this._receive_node_added(t)}async remove_node(e){await this._send_cmd({cmd:"remove_node",kwargs:{id:e}})}async _receive_node_added(e){this._zustand&&this._zustand.on_node_action({type:"add",node:e,id:e.id,from_remote:!0})}add_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o=!1}){return this._send_cmd({cmd:"add_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o}})}remove_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}){return this._send_cmd({cmd:"remove_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}})}async add_external_worker({module:e,cls_module:t,cls_name:n}){return await this._send_cmd({cmd:"add_external_worker",kwargs:{module:e,cls_module:t,cls_name:n}})}sync_local_node_updates(){clearTimeout(this._nodeupdatetimer),this._local_nodeupdates.forEach((async(e,t)=>{const n=await this._send_cmd({cmd:"update_node",kwargs:{nid:t,data:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:n,id:t,from_remote:!0})})),this._local_nodeupdates.clear(),this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),200)}locally_update_node(e){const t=this._local_nodeupdates.get(e.id);if(t){const{new_obj:n,change:r}=T(t,e.node);r&&this._local_nodeupdates.set(e.id,n)}else this._local_nodeupdates.set(e.id,e.node);e.immediate&&this.sync_local_node_updates()}async get_remote_node_state(e){const t=await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:t,id:t.id,from_remote:!0})}set_io_value({nid:e,ioid:t,value:n,set_default:r=!1}){return this._send_cmd({cmd:"set_io_value",kwargs:{nid:e,ioid:t,value:n,set_default:r},wait_for_response:!0})}clear(){return this._send_cmd({cmd:"clear"})}save(){return this._send_cmd({cmd:"save",wait_for_response:!0})}load(e){return this._send_cmd({cmd:"load_data",kwargs:{data:e},wait_for_response:!0}).then((()=>{this.stepwise_fullsync()}))}async get_io_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{value:n}}},id:e,from_remote:!0}),n):n}async get_ios_values({nid:e}){const t=await this._send_cmd({cmd:"get_ios_values",kwargs:{nid:e},wait_for_response:!0});if(!this._zustand)return t;const n={};for(const e in t)n[e]={value:t[e]};return this._zustand.on_node_action({type:"update",node:{io:n},id:e,from_remote:!0}),t}async _send_cmd({cmd:e,kwargs:t,wait_for_response:n=!0,response_timeout:r=5e3,retries:o=2}){const i={type:"cmd",cmd:e,kwargs:t||{}};if(n){o<0&&(o=0);const t=async()=>{let t;for(;o>=0;){const n=i.id||Pu();i.id=n;const a=new Promise(((t,o)=>{const i=setTimeout((()=>{o("Timeout@wait_for_response for "+e)}),r);this.messagePromises.set(n,{resolve:e=>{clearTimeout(i),t(e),this.messagePromises.delete(n)},reject:e=>{clearTimeout(i),o(e),this.messagePromises.delete(n)}})}));await this.send(i);try{t=await a;break}catch(e){if(0===o)throw e;o-=1;continue}}return t};return t()}return this.send(i)}async send(e){throw new Error("async send(data: any) not implemented")}async upload_file({files:e,onProgressCallback:t,root:n}){throw new Error("upload_file not implemented ")}async handle_large_message_hint({}){throw new Error("async handle_large_message_hint({}: LargeMessageHint) not implemented ")}async receive_workerevent({event:e,data:t}){switch(e){case"worker_error":if(!this._zustand)return;return this._zustand.logger.error(t.error);case"update_worker_dependencies":if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({external_worker:t.worker_dependencies});case"lib_update":return void await this.sync_lib();case"fullsync":return void await this.stepwise_fullsync();case"external_worker_update":return await this.sync_lib(),void await this.sync_external_worker();default:console.warn("Unhandled worker event",e,t)}}async receive_nodespace_event({event:e,data:t}){switch(e){case"after_set_value":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value:t.result}}},id:t.node,from_remote:!0});case"after_update_value_options":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value_options:t.result}}},id:t.node,from_remote:!0});case"triggerstart":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!0},id:t.node,from_remote:!0});case"triggerdone":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!1},id:t.node,from_remote:!0});case"node_trigger_error":if(!this._zustand)return;return this._zustand.on_node_action({type:"error",errortype:"trigger",error:t.error,id:t.node,tb:t.tb,from_remote:!0});case"node_removed":if(!this._zustand)return;return this._zustand.on_node_action({type:"delete",id:t.node,from_remote:!0});case"node_added":return this._receive_node_added(t.node);case"after_disconnect":case"after_unforward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;if(!this._zustand)return;return this._zustand.on_edge_action({type:"delete",from_remote:!0,src_nid:t.result[0],src_ioid:t.result[1],trg_nid:t.result[2],trg_ioid:t.result[3]});case"after_connect":case"after_forward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;return this._receive_edge_added(...t.result);case"after_add_shelf":case"after_remove_shelf":if(!t.result)return;if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({lib:t.result});case"progress":if(!this._zustand)return;if(t.node)return this._zustand.on_node_action({type:"update",node:{id:t.node,progress:t.info},id:t.node,from_remote:!0});console.warn("Unhandled nodepsace event",e,t);break;default:console.warn("Unhandled nodepsace event",e,t)}}async add_lib(e,t){return await this._send_cmd({cmd:"add_package_dependency",kwargs:{name:e,version:t},wait_for_response:!1})}async remove_lib(e){return await this._send_cmd({cmd:"remove_package_dependency",kwargs:{name:e},wait_for_response:!1})}async receive(e){let t;switch(e.type){case"nsevent":return await this.receive_nodespace_event(e);case"result":if(t=e.id&&this.messagePromises.get(e.id),t)return t.resolve(e.result);break;case"error":if(this.on_error(e.tb+"\n"+e.error),t=e.id&&this.messagePromises.get(e.id),t)return t.reject(e.error);break;case"progress":if(!this._zustand)return;this._zustand.set_progress(e);break;case"workerevent":return await this.receive_workerevent(e);case"large_message":return await this.handle_large_message_hint(e);default:console.warn("Unhandled message",e)}}disconnect(){}onclose(){this.is_open=!1,this._zustand&&this._zustand.auto_progress()}async reconnect(){}async stop(){await this._send_cmd({cmd:"stop_worker",wait_for_response:!1});const e=this.onclose.bind(this);this.onclose=()=>{e(),this._zustand&&(this._zustand.worker===this&&this._zustand.clear_all(),this.onclose=e)}}async get_io_full_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_full_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{fullvalue:n}}},id:e,from_remote:!0}),n):n}async update_io_options({nid:e,ioid:t,options:n}){const r=await this._send_cmd({cmd:"update_io_options",kwargs:{nid:e,ioid:t,...n},wait_for_response:!0});if(!this._zustand)return r;this._zustand.on_node_action({type:"update",node:{io:{[t]:{...n}}},id:e,from_remote:!0})}async get_node_status(e){return await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0})}async get_available_modules(){return await this._send_cmd({cmd:"get_available_modules",wait_for_response:!0})}async update_external_worker(e,t,n){return await this._send_cmd({cmd:"update_external_worker",kwargs:{worker_id:e,class_id:t,...n},wait_for_response:!0})}async remove_external_worker(e,t){return await this._send_cmd({cmd:"remove_external_worker",kwargs:{worker_id:e,class_id:t},wait_for_response:!0})}async export({withFiles:e=!1}){return await this._send_cmd({cmd:"export_worker",wait_for_response:!0,kwargs:{with_files:e}})}async update_from_export(e){const t=await this._send_cmd({cmd:"update_from_export",kwargs:{data:e},wait_for_response:!0});return this.stepwise_fullsync(),t}}class Mu extends Ru{constructor(e){super(e),this._websocket=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=5e3,this._reconnect=!0,this._url=e.url,new Promise((e=>{this.connect(),e(null)})),this._zustand&&this._zustand.auto_progress()}connect(){this._zustand?.logger.info("Connecting to websocket"),this.is_open=!1,this._websocket=new WebSocket(this._url),this._websocket.onopen=()=>{this.onopen()},this._websocket.onclose=()=>{this.onclose()},this._websocket.onerror=()=>{this.on_ws_error()},this._websocket.onmessage=e=>{this.onmessage(e.data)}}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}auto_reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this._zustand?.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this._websocket&&this._websocket.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this._zustand?.logger.warn("Maximum reconnect attempts reached. Giving up.")}async onmessage(e){const t=JSON.parse(e);this._zustand?.logger.debug(`Recieved data of length: ${e.length} and data"`,t),await this.receive(t)}get http_protocol(){return this.secure_url?"https":"http"}get secure_url(){return this._url.startsWith("wss")}get url_wo_protocol(){return this._url.substring(this.secure_url?6:5)}get http_url(){var e=this.http_protocol+"://"+this.url_wo_protocol;return"/"!==e[e.length-1]&&(e+="/"),e}async upload_file({files:e,onProgressCallback:t,root:n}){const r=`${this.http_url}upload/`,o=new FormData,i=Array.isArray(e)?e:Array.from(e);for(const e of i){const t=e.webkitRelativePath||e.name,r=n?`${n}/${t}`:t;o.append("file",e,r)}try{return(await lu.post(r,o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{t&&t(e.loaded,e.total)}})).data.file}catch(e){throw new Error("Failed to upload file")}}async handle_large_message_hint({msg_id:e}){const t=this.http_url+"message/"+e,n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}),r=await n.json();this.receive(r)}onopen(){this._zustand?.logger.info("Websocket opened"),this.is_open=!0,this._zustand&&this._zustand.auto_progress(),this.reconnectAttempts=0,this.stepwise_fullsync()}onclose(){this._zustand?.logger.info("Websocket closed"),super.onclose(),this._reconnect&&(this._zustand?.logger.info("Websocket closed,reconnecting"),this.auto_reconnect())}on_ws_error(){this._zustand?.logger.warn("Websocket error"),this._websocket?this._websocket.close():this.auto_reconnect()}async send_large_message(e){const t=`${this.http_url}message/`;await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e})}async send(e){if(!this._websocket||this._websocket.readyState!==WebSocket.OPEN)return void this._zustand?.logger.warn("Websocket not connected");const t=JSON.stringify(e);if(new Blob([t]).size>1e6)return this._zustand?.logger.info("Data too large, sending via http"),await this.send_large_message(t);this._zustand?.logger.debug("Sending data",e),this._websocket.send(t)}async stop(){await super.stop(),this._reconnect=!1}close(){this._websocket&&this._websocket.close()}disconnect(){super.disconnect(),this._reconnect=!1,this.close()}async reconnect(){await super.reconnect(),this._reconnect=!0,!this._websocket||(this._zustand?.logger.info("Reconnecting"),this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(this._websocket.readyState===WebSocket.CONNECTING&&await new Promise(((e,t)=>{if(null===this._websocket)return;let n=setTimeout((()=>{t("Timeout@reconnect")}),2e3);this._websocket.addEventListener("open",(()=>{clearTimeout(n),e(null)}),{once:!0}),this._websocket.readyState===WebSocket.OPEN&&(clearTimeout(n),e(null))})),this._websocket.readyState!==WebSocket.OPEN))?this.connect():this.stepwise_fullsync()}}class Tu{constructor(e,t){this.ws=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=2e3,this.wsuri=e,this.zustand=t,this.workers={},this.on_setWorker=e=>{this.zustand.set_worker(e)},this.connect()}get open(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.zustand.set_progress({progress:0,message:"connecting to worker manager",status:"info",blocking:!0}),this.zustand.logger.info("Connecting to websocket:",this.wsuri),this.ws=new WebSocket(this.wsuri),this.ws.onopen=()=>{this.onopen()},this.ws.onclose=()=>{this.onclose()},this.ws.onerror=()=>{this.on_ws_error()},this.ws.onmessage=e=>{this.onmessage(e.data)},this.connectionTimeout=setTimeout((()=>{this.ws?.readyState!==WebSocket.OPEN&&this.on_ws_error()}),5e3)}on_ws_error(){console.warn("Websocket error"),this.ws?this.ws.close():this.reconnect()}onopen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0),this.zustand.auto_progress(),this.ws&&this.ws.send("worker_status");const e=window.localStorage.getItem("funcnodes__active_worker");e&&this.set_active(e)}onmessage(e){let t=JSON.parse(e);if("worker_status"!==t.type)if("set_worker"!==t.type)"progress"!==t.type?this.zustand.logger.error("WorkerManager: unknown message",t):this.zustand.set_progress(t);else if("WSWorker"===t.data.type){let e="ws"+(t.data.ssl?"s":"")+"://"+t.data.host+":"+t.data.port;this.setWorker(this.workers[t.data.uuid]||new Mu({url:e,zustand:this.zustand,uuid:t.data.uuid,on_sync_complete:this.zustand.options.on_sync_complete}))}else this.zustand.logger.error("WorkerManager: unknown worker type",t);else{const e={};for(let n of t.active)n.active=!0,e[n.uuid]=n;for(let n of t.inactive)n.active=!1,e[n.uuid]=n;this.zustand.workers.setState(e)}}setWorker(e){for(let t in this.workers)t!==e?.uuid&&this.workers[t].disconnect();void 0!==e&&(this.workers[e.uuid]=e,e.reconnect()),window.localStorage.setItem("funcnodes__active_worker",e?.uuid||""),void 0!==this.zustand.worker&&this.zustand.clear_all(),this.zustand.set_worker(e),this.on_setWorker(e)}async restart_worker(e){this.ws?.send(JSON.stringify({type:"restart_worker",workerid:e}))}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this.zustand.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this.ws&&this.ws.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this.zustand.logger.warn("Maximum reconnect attempts reached. Giving up.")}onclose(){this.zustand.logger.warn("WorkerManager: onclose"),this.reconnect()}set_active(e){this.ws&&this.ws.send(JSON.stringify({type:"set_active",workerid:e}))}new_worker({name:e,reference:t,copyLib:n,copyNS:r}){e||(e=void 0),n||(n=!1),r||(r=!1),t||(t=void 0,n=!1,r=!1),this.ws&&this.ws.send(JSON.stringify({type:"new_worker",kwargs:{name:e,reference:t,copyLib:n,copyNS:r}}))}}function Au(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Du(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Iu(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Du(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Du(e[t],null)}}}}function Lu(...e){return s.useCallback(Iu(...e),e)}var zu,Fu,ju={exports:{}},$u={};var Bu=(Fu||(Fu=1,ju.exports=function(){if(zu)return $u;zu=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return $u.Fragment=t,$u.jsx=n,$u.jsxs=n,$u}()),ju.exports);function Vu(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>s.createContext(e)));return function(n){const r=n?.[e]||t;return s.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=s.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,c=s.useMemo((()=>a),Object.values(a));return Bu.jsx(l.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const l=a?.[e]?.[i]||o,c=s.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Hu(r,...t)]}function Hu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return s.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var Uu=Boolean(globalThis?.document)?s.useLayoutEffect:()=>{},Wu=u["useId".toString()]||(()=>{}),qu=0;function Ku(e){const[t,n]=s.useState(Wu());return Uu((()=>{n((e=>e??String(qu++)))}),[e]),e||(t?`radix-${t}`:"")}function Xu(e){const t=s.useRef(e);return s.useEffect((()=>{t.current=e})),s.useMemo((()=>(...e)=>t.current?.(...e)),[])}function Yu({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=s.useState(e),[r]=n,o=s.useRef(r),i=Xu(t);return s.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:r,l=Xu(n);return[a,s.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l])]}var Gu=s.forwardRef(((e,t)=>{const{children:n,...r}=e,o=s.Children.toArray(n),i=o.find(Ju);if(i){const e=i.props.children,n=o.map((t=>t===i?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t));return Bu.jsx(Qu,{...r,ref:t,children:s.isValidElement(e)?s.cloneElement(e,void 0,n):null})}return Bu.jsx(Qu,{...r,ref:t,children:n})}));Gu.displayName="Slot";var Qu=s.forwardRef(((e,t)=>{const{children:n,...r}=e;if(s.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==s.Fragment&&(o.ref=t?Iu(t,e):e),s.cloneElement(n,o)}return s.Children.count(n)>1?s.Children.only(null):null}));Qu.displayName="SlotClone";var Zu=({children:e})=>Bu.jsx(Bu.Fragment,{children:e});function Ju(e){return s.isValidElement(e)&&e.type===Zu}var ed=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=s.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?Gu:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Bu.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function td(e,t){e&&Lr.flushSync((()=>e.dispatchEvent(t)))}var nd,rd="dismissableLayer.update",od="dismissableLayer.pointerDownOutside",id="dismissableLayer.focusOutside",ad=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ld=s.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=s.useContext(ad),[d,f]=s.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=s.useState({}),m=Lu(t,(e=>f(e))),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=b>=v,k=function(e,t=globalThis?.document){const n=Xu(e),r=s.useRef(!1),o=s.useRef((()=>{}));return s.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){ud(od,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...u.branches].some((e=>e.contains(t)));x&&!n&&(o?.(e),a?.(e),e.defaultPrevented||l?.())}),p),S=function(e,t=globalThis?.document){const n=Xu(e),r=s.useRef(!1);return s.useEffect((()=>{const e=e=>{if(e.target&&!r.current){ud(id,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(i?.(e),a?.(e),e.defaultPrevented||l?.())}),p);return function(e,t=globalThis?.document){const n=Xu(e);s.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{b===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),p),s.useEffect((()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(nd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),cd(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=nd)}}),[d,p,n,u]),s.useEffect((()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),cd())}),[d,u]),s.useEffect((()=>{const e=()=>h({});return document.addEventListener(rd,e),()=>document.removeEventListener(rd,e)}),[]),Bu.jsx(ed.div,{...c,ref:m,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:Au(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Au(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Au(e.onPointerDownCapture,k.onPointerDownCapture)})}));ld.displayName="DismissableLayer";var sd=s.forwardRef(((e,t)=>{const n=s.useContext(ad),r=s.useRef(null),o=Lu(t,r);return s.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Bu.jsx(ed.div,{...e,ref:o})}));function cd(){const e=new CustomEvent(rd);document.dispatchEvent(e)}function ud(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?td(o,i):o.dispatchEvent(i)}sd.displayName="DismissableLayerBranch";var dd="focusScope.autoFocusOnMount",fd="focusScope.autoFocusOnUnmount",pd={bubbles:!1,cancelable:!0},hd=s.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=s.useState(null),u=Xu(o),d=Xu(i),f=s.useRef(null),p=Lu(t,(e=>c(e))),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect((()=>{if(r){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:vd(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||vd(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,l,h.paused]),s.useEffect((()=>{if(l){bd.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(dd,pd);l.addEventListener(dd,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vd(r,{select:t}),document.activeElement!==n)return}((e=md(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&vd(l))}return()=>{l.removeEventListener(dd,u),setTimeout((()=>{const e=new CustomEvent(fd,pd);l.addEventListener(fd,d),l.dispatchEvent(e),e.defaultPrevented||vd(t??document.body,{select:!0}),l.removeEventListener(fd,d),bd.remove(h)}),0)}}var e}),[l,u,d,h]);const m=s.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=md(e),n=gd(t,e),r=gd(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&vd(i,{select:!0})):(e.preventDefault(),n&&vd(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,h.paused]);return Bu.jsx(ed.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})}));function md(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gd(e,t){for(const n of e)if(!yd(n,{upTo:t}))return n}function yd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function vd(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hd.displayName="FocusScope";var bd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wd(e,t),e.unshift(t)},remove(t){e=wd(e,t),e[0]?.resume()}}}();function wd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var xd=s.forwardRef(((e,t)=>{const{container:n,...r}=e,[o,i]=s.useState(!1);Uu((()=>i(!0)),[]);const a=n||o&&globalThis?.document?.body;return a?zr.createPortal(Bu.jsx(ed.div,{...r,ref:t}),a):null}));xd.displayName="Portal";var kd=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=s.useState(),r=s.useRef({}),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect((()=>{const e=Sd(r.current);i.current="mounted"===l?e:"none"}),[l]),Uu((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=Sd(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Uu((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=Sd(r.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},l=e=>{e.target===t&&(i.current=Sd(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):s.Children.only(n),i=Lu(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?s.cloneElement(o,{ref:i}):null};function Sd(e){return e?.animationName||"none"}kd.displayName="Presence";var Ed=0;function _d(){s.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cd()),document.body.insertAdjacentElement("beforeend",e[1]??Cd()),Ed++,()=>{1===Ed&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Ed--}}),[])}function Cd(){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 Od=function(){return Od=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Od.apply(this,arguments)};function Nd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Pd(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Rd="right-scroll-bar-position",Md="width-before-scroll-bar";function Td(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ad="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,Dd=new WeakMap;function Id(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return Td(e,t)}))},(o=s.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return Ad((function(){var t=Dd.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||Td(e,null)})),r.forEach((function(e){n.has(e)||Td(e,o)}))}Dd.set(i,e)}),[e]),i}function Ld(e){return e}var zd=function(e){var t=e.sideCar,n=Nd(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 s.createElement(r,Od({},n))};zd.isSideCarExport=!0;var Fd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Ld);var n=[],r=!1,o={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(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=Od({async:!0,ssr:!1},e),t}(),jd=function(){},$d=s.forwardRef((function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=void 0===y?"div":y,b=e.gapMode,w=Nd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,k=Id([n,t]),S=Od(Od({},w),o);return s.createElement(s.Fragment,null,d&&s.createElement(x,{sideCar:Fd,removeScrollBar:u,shards:f,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?s.cloneElement(s.Children.only(l),Od(Od({},S),{ref:k})):s.createElement(v,Od({},S,{className:c,ref:k}),l))}));$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$d.classNames={fullWidth:Md,zeroRight:Rd};function Bd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Vd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=Bd())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hd=function(){var e,t=(e=Vd(),function(t,n){s.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Ud={left:0,top:0,right:0,gap:0},Wd=function(e){return parseInt(e||"",10)||0},qd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ud;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Wd(n),Wd(r),Wd(o)]}(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])}},Kd=Hd(),Xd="data-scroll-locked",Yd=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(Xd,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Rd," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Md," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Rd," .").concat(Rd," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Md," .").concat(Md," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Xd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},Gd=function(){var e=parseInt(document.body.getAttribute(Xd)||"0",10);return isFinite(e)?e:0},Qd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;s.useEffect((function(){return document.body.setAttribute(Xd,(Gd()+1).toString()),function(){var e=Gd()-1;e<=0?document.body.removeAttribute(Xd):document.body.setAttribute(Xd,e.toString())}}),[]);var i=s.useMemo((function(){return qd(o)}),[o]);return s.createElement(Kd,{styles:Yd(i,!t,o,n?"":"!important")})},Zd=!1;if("undefined"!=typeof window)try{var Jd=Object.defineProperty({},"passive",{get:function(){return Zd=!0,!0}});window.addEventListener("test",Jd,Jd),window.removeEventListener("test",Jd,Jd)}catch(e){Zd=!1}var ef=!!Zd&&{passive:!1},tf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},nf=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rf(e,r)){var o=of(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rf=function(e,t){return"v"===e?function(e){return tf(e,"overflowY")}(t):function(e){return tf(e,"overflowX")}(t)},of=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},af=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lf=function(e){return[e.deltaX,e.deltaY]},sf=function(e){return e&&"current"in e?e.current:e},cf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},uf=0,df=[];function ff(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pf,hf=(pf=function(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(uf++)[0],i=s.useState(Hd)[0],a=s.useRef(e);s.useEffect((function(){a.current=e}),[e]),s.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Pd([e.lockRef.current],(e.shards||[]).map(sf),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=af(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=nf(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=nf(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),s=!1,c=i>0,u=0,d=0;do{var f=of(e,a),p=f[0],h=f[1]-f[2]-o*p;(p||h)&&rf(e,a)&&(u+=h,d+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:c)}),[]),c=s.useCallback((function(e){var n=e;if(df.length&&df[df.length-1]===i){var r="deltaY"in n?lf(n):af(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var s=(a.current.shards||[]).map(sf).filter(Boolean).filter((function(e){return e.contains(n.target)}));(s.length>0?l(n,s[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=s.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:ff(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=s.useCallback((function(e){n.current=af(e),r.current=void 0}),[]),f=s.useCallback((function(t){u(t.type,lf(t),t.target,l(t,e.lockRef.current))}),[]),p=s.useCallback((function(t){u(t.type,af(t),t.target,l(t,e.lockRef.current))}),[]);s.useEffect((function(){return df.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ef),document.addEventListener("touchmove",c,ef),document.addEventListener("touchstart",d,ef),function(){df=df.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,ef),document.removeEventListener("touchmove",c,ef),document.removeEventListener("touchstart",d,ef)}}),[]);var h=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(i,{styles:cf(o)}):null,h?s.createElement(Qd,{gapMode:e.gapMode}):null)},Fd.useMedium(pf),zd),mf=s.forwardRef((function(e,t){return s.createElement($d,Od({},e,{ref:t,sideCar:hf}))}));mf.classNames=$d.classNames;var gf=new WeakMap,yf=new WeakMap,vf={},bf=0,wf=function(e){return e&&(e.host||wf(e.parentNode))},xf=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=wf(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);vf[n]||(vf[n]=new WeakMap);var i=vf[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(gf.get(e)||0)+1,c=(i.get(e)||0)+1;gf.set(e,s),i.set(e,c),a.push(e),1===s&&o&&yf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return u(t),l.clear(),bf++,function(){a.forEach((function(e){var t=gf.get(e)-1,o=i.get(e)-1;gf.set(e,t),i.set(e,o),t||(yf.has(e)||e.removeAttribute(r),yf.delete(e)),o||e.removeAttribute(n)})),--bf||(gf=new WeakMap,gf=new WeakMap,yf=new WeakMap,vf={})}},kf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),xf(r,o,n,"aria-hidden")):function(){return null}},Sf="Dialog",[Ef,_f]=Vu(Sf),[Cf,Of]=Ef(Sf),Nf=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=s.useRef(null),c=s.useRef(null),[u=!1,d]=Yu({prop:r,defaultProp:o,onChange:i});return Bu.jsx(Cf,{scope:t,triggerRef:l,contentRef:c,contentId:Ku(),titleId:Ku(),descriptionId:Ku(),open:u,onOpenChange:d,onOpenToggle:s.useCallback((()=>d((e=>!e))),[d]),modal:a,children:n})};Nf.displayName=Sf;var Pf="DialogTrigger",Rf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Pf,n),i=Lu(t,o.triggerRef);return Bu.jsx(ed.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yf(o.open),...r,ref:i,onClick:Au(e.onClick,o.onOpenToggle)})}));Rf.displayName=Pf;var Mf="DialogPortal",[Tf,Af]=Ef(Mf,{forceMount:void 0}),Df=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Of(Mf,t);return Bu.jsx(Tf,{scope:t,forceMount:n,children:s.Children.map(r,(e=>Bu.jsx(kd,{present:n||i.open,children:Bu.jsx(xd,{asChild:!0,container:o,children:e})})))})};Df.displayName=Mf;var If="DialogOverlay",Lf=s.forwardRef(((e,t)=>{const n=Af(If,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Of(If,e.__scopeDialog);return i.modal?Bu.jsx(kd,{present:r||i.open,children:Bu.jsx(zf,{...o,ref:t})}):null}));Lf.displayName=If;var zf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(If,n);return Bu.jsx(mf,{as:Gu,allowPinchZoom:!0,shards:[o.contentRef],children:Bu.jsx(ed.div,{"data-state":Yf(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),Ff="DialogContent",jf=s.forwardRef(((e,t)=>{const n=Af(Ff,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Of(Ff,e.__scopeDialog);return Bu.jsx(kd,{present:r||i.open,children:i.modal?Bu.jsx($f,{...o,ref:t}):Bu.jsx(Bf,{...o,ref:t})})}));jf.displayName=Ff;var $f=s.forwardRef(((e,t)=>{const n=Of(Ff,e.__scopeDialog),r=s.useRef(null),o=Lu(t,n.contentRef,r);return s.useEffect((()=>{const e=r.current;if(e)return kf(e)}),[]),Bu.jsx(Vf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{e.preventDefault(),n.triggerRef.current?.focus()})),onPointerDownOutside:Au(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()))})})),Bf=s.forwardRef(((e,t)=>{const n=Of(Ff,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return Bu.jsx(Vf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})})),Vf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=Of(Ff,n),c=s.useRef(null),u=Lu(t,c);return _d(),Bu.jsxs(Bu.Fragment,{children:[Bu.jsx(hd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:Bu.jsx(ld,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Yf(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),Bu.jsxs(Bu.Fragment,{children:[Bu.jsx(tp,{titleId:l.titleId}),Bu.jsx(np,{contentRef:c,descriptionId:l.descriptionId})]})]})})),Hf="DialogTitle",Uf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Hf,n);return Bu.jsx(ed.h2,{id:o.titleId,...r,ref:t})}));Uf.displayName=Hf;var Wf="DialogDescription",qf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Wf,n);return Bu.jsx(ed.p,{id:o.descriptionId,...r,ref:t})}));qf.displayName=Wf;var Kf="DialogClose",Xf=s.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=Of(Kf,n);return Bu.jsx(ed.button,{type:"button",...r,ref:t,onClick:Au(e.onClick,(()=>o.onOpenChange(!1)))})}));function Yf(e){return e?"open":"closed"}Xf.displayName=Kf;var Gf,Qf,Zf="DialogTitleWarning",[Jf,ep]=function(e,t){const n=s.createContext(t),r=e=>{const{children:t,...r}=e,o=s.useMemo((()=>r),Object.values(r));return Bu.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=s.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(Zf,{contentName:Ff,titleName:Hf,docsSlug:"dialog"}),tp=({titleId:e})=>{const t=ep(Zf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect((()=>{if(e){document.getElementById(e)||console.error(n)}}),[n,e]),null},np=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ep("DialogDescriptionWarning").contentName}}.`;return s.useEffect((()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}}),[n,e,t]),null},rp=Nf,op=Rf,ip=Df,ap=Lf,lp=jf,sp=Uf,cp=qf,up=Xf,dp={exports:{}},fp={};function pp(){if(Gf)return fp;Gf=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.for("react.client.reference");function h(f){if("object"==typeof f&&null!==f){var p=f.$$typeof;switch(p){case e:switch(f=f.type){case n:case o:case r:case s:case c:return f;default:switch(f=f&&f.$$typeof){case a:case l:case d:case u:case i:return f;default:return p}}case t:return p}}}return fp.ContextConsumer=i,fp.ContextProvider=a,fp.Element=e,fp.ForwardRef=l,fp.Fragment=n,fp.Lazy=d,fp.Memo=u,fp.Portal=t,fp.Profiler=o,fp.StrictMode=r,fp.Suspense=s,fp.SuspenseList=c,fp.isContextConsumer=function(e){return h(e)===i},fp.isContextProvider=function(e){return h(e)===a},fp.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},fp.isForwardRef=function(e){return h(e)===l},fp.isFragment=function(e){return h(e)===n},fp.isLazy=function(e){return h(e)===d},fp.isMemo=function(e){return h(e)===u},fp.isPortal=function(e){return h(e)===t},fp.isProfiler=function(e){return h(e)===o},fp.isStrictMode=function(e){return h(e)===r},fp.isSuspense=function(e){return h(e)===s},fp.isSuspenseList=function(e){return h(e)===c},fp.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===o||e===r||e===s||e===c||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===i||e.$$typeof===l||e.$$typeof===p||void 0!==e.getModuleId)},fp.typeOf=h,fp}function hp(){return Qf||(Qf=1,dp.exports=pp()),dp.exports}var mp=hp();function gp(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function yp(e){if(s.isValidElement(e)||mp.isValidElementType(e)||!gp(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=yp(e[n])})),t}function vp(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return gp(e)&&gp(t)&&Object.keys(t).forEach((o=>{s.isValidElement(t[o])||mp.isValidElementType(t[o])?r[o]=t[o]:gp(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&gp(e[o])?r[o]=vp(e[o],t[o],n):n.clone?r[o]=gp(t[o])?yp(t[o]):t[o]:r[o]=t[o]})),r}var bp,wp,xp,kp,Sp,Ep,_p,Cp={exports:{}},Op={exports:{}},Np={};function Pp(){return wp||(wp=1,Op.exports=function(){if(bp)return Np;bp=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case s:case c:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case u:case h:case p:case a:return e;default:return f}}case n:return f}}}function w(e){return b(e)===c}return Np.AsyncMode=s,Np.ConcurrentMode=c,Np.ContextConsumer=l,Np.ContextProvider=a,Np.Element=t,Np.ForwardRef=u,Np.Fragment=r,Np.Lazy=h,Np.Memo=p,Np.Portal=n,Np.Profiler=i,Np.StrictMode=o,Np.Suspense=d,Np.isAsyncMode=function(e){return w(e)||b(e)===s},Np.isConcurrentMode=w,Np.isContextConsumer=function(e){return b(e)===l},Np.isContextProvider=function(e){return b(e)===a},Np.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Np.isForwardRef=function(e){return b(e)===u},Np.isFragment=function(e){return b(e)===r},Np.isLazy=function(e){return b(e)===h},Np.isMemo=function(e){return b(e)===p},Np.isPortal=function(e){return b(e)===n},Np.isProfiler=function(e){return b(e)===i},Np.isStrictMode=function(e){return b(e)===o},Np.isSuspense=function(e){return b(e)===d},Np.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Np.typeOf=b,Np}()),Op.exports}function Rp(){if(kp)return xp;kp=1;return xp="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Mp(){if(Ep)return Sp;Ep=1;var e=Rp();function t(){}function n(){}return n.resetWarningCache=t,Sp=function(){function r(t,n,r,o,i,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Sp}function Tp(){return _p||(_p=1,Cp.exports=Mp()()),Cp.exports}var Ap=Tp();function Dp(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach((e=>n.searchParams.append("args[]",e))),`Minified MUI error #${e}; visit ${n} for the full message.`}function Ip(e){if("string"!=typeof e)throw new Error(Dp(7));return e.charAt(0).toUpperCase()+e.slice(1)}const Lp="undefined"!=typeof window?s.useLayoutEffect:s.useEffect;function zp(e){const t=s.useRef(e);return Lp((()=>{t.current=e})),s.useRef(((...e)=>(0,t.current)(...e))).current}function Fp(...e){return s.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{!function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(e,t)}))}),e)}const jp={};function $p(e,t){const n=s.useRef(jp);return n.current===jp&&(n.current=e(t)),n}const Bp=[];class Vp{static create(){return new Vp}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Hp(){const e=$p(Vp.create).current;var t;return t=e.disposeEffect,s.useEffect(t,Bp),e}function Up(e){try{return e.matches(":focus-visible")}catch(e){}return!1}function Wp(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=r;if("components"===o||"slots"===o)n[o]={...e[o],...n[o]};else if("componentsProps"===o||"slotProps"===o){const r=e[o],i=t[o];if(i)if(r){n[o]={...i};for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const t=e;n[o][t]=Wp(r[t],i[t])}}else n[o]=i;else n[o]=r||{}}else void 0===n[o]&&(n[o]=e[o])}return n}function qp(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let a="",l=!0;for(let e=0;e<i.length;e+=1){const r=i[e];r&&(a+=(!0===l?"":" ")+t(r),l=!1,n&&n[r]&&(a+=" "+n[r]))}r[o]=a}return r}const Kp=e=>e,Xp=(()=>{let e=Kp;return{configure(t){e=t},generate:t=>e(t),reset(){e=Kp}}})(),Yp={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Gp(e,t,n="Mui"){const r=Yp[t];return r?`${n}-${r}`:`${Xp.generate(e)}-${t}`}function Qp(e,t,n="Mui"){const r={};return t.forEach((t=>{r[t]=Gp(e,t,n)})),r}function Zp(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Jp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zp(e))&&(r&&(r+=" "),r+=t);return r}function eh(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}function th(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const e=Jp(n?.className,i,o?.className,r?.className),t={...n?.style,...o?.style,...r?.style},a={...n,...o,...r};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=function(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}({...o,...r}),l=eh(r),s=eh(o),c=t(a),u=Jp(c?.className,n?.className,i,o?.className,r?.className),d={...c?.style,...n?.style,...o?.style,...r?.style},f={...c,...n,...s,...l};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}function nh(e,t){return t?vp(e,t,{clone:!1}):e}const rh={xs:0,sm:600,md:900,lg:1200,xl:1536},oh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${rh[e]}px)`},ih={containerQueries:e=>({up:t=>{let n="number"==typeof t?t:rh[t]||t;return"number"==typeof n&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ah(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||oh;return t.reduce(((r,o,i)=>(r[e.up(e.keys[i])]=n(t[i]),r)),{})}if("object"==typeof t){const e=r.breakpoints||oh;return Object.keys(t).reduce(((o,i)=>{if(a=e.keys,"@"===(l=i)||l.startsWith("@")&&(a.some((e=>l.startsWith(`@${e}`)))||l.match(/^@\d/))){const e=function(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}(r.containerQueries?r:ih,i);e&&(o[e]=n(t[i],i))}else if(Object.keys(e.values||rh).includes(i)){o[e.up(i)]=n(t[i],i)}else{const e=i;o[e]=t[e]}var a,l;return o}),{})}return n(t)}function lh(e={}){const t=e.keys?.reduce(((t,n)=>(t[e.up(n)]={},t)),{});return t||{}}function sh(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function ch({values:e,breakpoints:t,base:n}){const r=n||function(e,t){if("object"!=typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r<e.length&&(n[t]=!0)})):r.forEach((t=>{null!=e[t]&&(n[t]=!0)})),n}(e,t),o=Object.keys(r);if(0===o.length)return e;let i;return o.reduce(((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[i],i=r):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[i],i=n):t[n]=e,t)),{})}function uh(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function dh(e,t,n,r=n){let o;return o="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:uh(e,n)||r,t&&(o=t(o,r,e)),o}function fh(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=uh(e.theme,r)||{};return ah(e,i,(e=>{let r=dh(a,o,e);return e===r&&"string"==typeof e&&(r=dh(a,o,`${t}${"default"===e?"":Ip(e)}`,e)),!1===n?r:{[n]:r}}))};return i.propTypes={},i.filterProps=[t],i}const ph={m:"margin",p:"padding"},hh={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},mh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},gh=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}((e=>{if(e.length>2){if(!mh[e])return[e];e=mh[e]}const[t,n]=e.split(""),r=ph[t],o=hh[n]||"";return Array.isArray(o)?o.map((e=>r+e)):[r+o]})),yh=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],vh=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function bh(e,t,n,r){const o=uh(e,t,!0)??n;return"number"==typeof o||"string"==typeof o?e=>"string"==typeof e?e:"string"==typeof o?`calc(${e} * ${o})`:o*e:Array.isArray(o)?e=>{if("string"==typeof e)return e;const t=Math.abs(e),n=o[t];return e>=0?n:"number"==typeof n?-n:`-${n}`}:"function"==typeof o?o:()=>{}}function wh(e){return bh(e,"spacing",8)}function xh(e,t){return"string"==typeof t||null==t?t:e(t)}function kh(e,t,n,r){if(!t.includes(n))return null;const o=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=xh(t,n),e)),{})}(gh(n),r);return ah(e,e[n],o)}function Sh(e,t){const n=wh(e.theme);return Object.keys(e).map((r=>kh(e,t,r,n))).reduce(nh,{})}function Eh(e){return Sh(e,yh)}function _h(e){return Sh(e,vh)}function Ch(...e){const t=e.reduce(((e,t)=>(t.filterProps.forEach((n=>{e[n]=t})),e)),{}),n=e=>Object.keys(e).reduce(((n,r)=>t[r]?nh(n,t[r](e)):n),{});return n.propTypes={},n.filterProps=e.reduce(((e,t)=>e.concat(t.filterProps)),[]),n}function Oh(e){return"number"!=typeof e?e:`${e}px solid`}function Nh(e,t){return fh({prop:e,themeKey:"borders",transform:t})}Eh.propTypes={},Eh.filterProps=yh,_h.propTypes={},_h.filterProps=vh;const Ph=Nh("border",Oh),Rh=Nh("borderTop",Oh),Mh=Nh("borderRight",Oh),Th=Nh("borderBottom",Oh),Ah=Nh("borderLeft",Oh),Dh=Nh("borderColor"),Ih=Nh("borderTopColor"),Lh=Nh("borderRightColor"),zh=Nh("borderBottomColor"),Fh=Nh("borderLeftColor"),jh=Nh("outline",Oh),$h=Nh("outlineColor"),Bh=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=bh(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:xh(t,e)});return ah(e,e.borderRadius,n)}return null};Bh.propTypes={},Bh.filterProps=["borderRadius"],Ch(Ph,Rh,Mh,Th,Ah,Dh,Ih,Lh,zh,Fh,Bh,jh,$h);const Vh=e=>{if(void 0!==e.gap&&null!==e.gap){const t=bh(e.theme,"spacing",8),n=e=>({gap:xh(t,e)});return ah(e,e.gap,n)}return null};Vh.propTypes={},Vh.filterProps=["gap"];const Hh=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=bh(e.theme,"spacing",8),n=e=>({columnGap:xh(t,e)});return ah(e,e.columnGap,n)}return null};Hh.propTypes={},Hh.filterProps=["columnGap"];const Uh=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=bh(e.theme,"spacing",8),n=e=>({rowGap:xh(t,e)});return ah(e,e.rowGap,n)}return null};Uh.propTypes={},Uh.filterProps=["rowGap"];function Wh(e,t){return"grey"===t?t:e}Ch(Vh,Hh,Uh,fh({prop:"gridColumn"}),fh({prop:"gridRow"}),fh({prop:"gridAutoFlow"}),fh({prop:"gridAutoColumns"}),fh({prop:"gridAutoRows"}),fh({prop:"gridTemplateColumns"}),fh({prop:"gridTemplateRows"}),fh({prop:"gridTemplateAreas"}),fh({prop:"gridArea"}));function qh(e){return e<=1&&0!==e?100*e+"%":e}Ch(fh({prop:"color",themeKey:"palette",transform:Wh}),fh({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Wh}),fh({prop:"backgroundColor",themeKey:"palette",transform:Wh}));const Kh=fh({prop:"width",transform:qh}),Xh=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{const n=e.theme?.breakpoints?.values?.[t]||rh[t];return n?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:qh(t)}};return ah(e,e.maxWidth,t)}return null};Xh.filterProps=["maxWidth"];const Yh=fh({prop:"minWidth",transform:qh}),Gh=fh({prop:"height",transform:qh}),Qh=fh({prop:"maxHeight",transform:qh}),Zh=fh({prop:"minHeight",transform:qh});fh({prop:"size",cssProperty:"width",transform:qh}),fh({prop:"size",cssProperty:"height",transform:qh});Ch(Kh,Xh,Yh,Gh,Qh,Zh,fh({prop:"boxSizing"}));const Jh={border:{themeKey:"borders",transform:Oh},borderTop:{themeKey:"borders",transform:Oh},borderRight:{themeKey:"borders",transform:Oh},borderBottom:{themeKey:"borders",transform:Oh},borderLeft:{themeKey:"borders",transform:Oh},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Oh},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Bh},color:{themeKey:"palette",transform:Wh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Wh},backgroundColor:{themeKey:"palette",transform:Wh},p:{style:_h},pt:{style:_h},pr:{style:_h},pb:{style:_h},pl:{style:_h},px:{style:_h},py:{style:_h},padding:{style:_h},paddingTop:{style:_h},paddingRight:{style:_h},paddingBottom:{style:_h},paddingLeft:{style:_h},paddingX:{style:_h},paddingY:{style:_h},paddingInline:{style:_h},paddingInlineStart:{style:_h},paddingInlineEnd:{style:_h},paddingBlock:{style:_h},paddingBlockStart:{style:_h},paddingBlockEnd:{style:_h},m:{style:Eh},mt:{style:Eh},mr:{style:Eh},mb:{style:Eh},ml:{style:Eh},mx:{style:Eh},my:{style:Eh},margin:{style:Eh},marginTop:{style:Eh},marginRight:{style:Eh},marginBottom:{style:Eh},marginLeft:{style:Eh},marginX:{style:Eh},marginY:{style:Eh},marginInline:{style:Eh},marginInlineStart:{style:Eh},marginInlineEnd:{style:Eh},marginBlock:{style:Eh},marginBlockStart:{style:Eh},marginBlockEnd:{style:Eh},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Vh},rowGap:{style:Uh},columnGap:{style:Hh},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qh},maxWidth:{style:Xh},minWidth:{transform:qh},height:{transform:qh},maxHeight:{transform:qh},minHeight:{transform:qh},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const em=function(){function e(e,t,n,r){const o={[e]:t,theme:n},i=r[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const u=uh(n,l)||{};if(c)return c(o);return ah(o,t,(t=>{let n=dh(u,s,t);return t===n&&"string"==typeof t&&(n=dh(u,s,`${e}${"default"===t?"":Ip(t)}`,t)),!1===a?n:{[a]:n}}))}return function t(n){const{sx:r,theme:o={}}=n||{};if(!r)return null;const i=o.unstable_sxConfig??Jh;function a(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const a=lh(o.breakpoints),l=Object.keys(a);let s=a;return Object.keys(r).forEach((n=>{const a=function(e,t){return"function"==typeof e?e(t):e}(r[n],o);if(null!=a)if("object"==typeof a)if(i[n])s=nh(s,e(n,a,o,i));else{const e=ah({theme:o},a,(e=>({[n]:e})));!function(...e){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]),n=new Set(t);return e.every((e=>n.size===Object.keys(e).length))}(e,a)?s=nh(s,e):s[n]=t({sx:a,theme:o})}else s=nh(s,e(n,a,o,i))})),function(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter((e=>e.startsWith("@container"))).sort(((e,t)=>{const n=/min-width:\s*([0-9.]+)/;return+(e.match(n)?.[1]||0)-+(t.match(n)?.[1]||0)}));return n.length?n.reduce(((e,n)=>{const r=t[n];return delete e[n],e[n]=r,e}),{...t}):t}(o,sh(l,s))}return Array.isArray(r)?r.map(a):a(r)}}();em.filterProps=["sx"];function tm(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Jh;return Object.keys(e).forEach((r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]})),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return gp(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}}function nm(){return nm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nm.apply(null,arguments)}var rm=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),om="-ms-",im="-moz-",am="-webkit-",lm="comm",sm="rule",cm="decl",um="@keyframes",dm=Math.abs,fm=String.fromCharCode,pm=Object.assign;function hm(e){return e.trim()}function mm(e,t,n){return e.replace(t,n)}function gm(e,t){return e.indexOf(t)}function ym(e,t){return 0|e.charCodeAt(t)}function vm(e,t,n){return e.slice(t,n)}function bm(e){return e.length}function wm(e){return e.length}function xm(e,t){return t.push(e),e}var km=1,Sm=1,Em=0,_m=0,Cm=0,Om="";function Nm(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:km,column:Sm,length:a,return:""}}function Pm(e,t){return pm(Nm("",null,null,"",null,null,0),e,{length:-e.length},t)}function Rm(){return Cm=_m>0?ym(Om,--_m):0,Sm--,10===Cm&&(Sm=1,km--),Cm}function Mm(){return Cm=_m<Em?ym(Om,_m++):0,Sm++,10===Cm&&(Sm=1,km++),Cm}function Tm(){return ym(Om,_m)}function Am(){return _m}function Dm(e,t){return vm(Om,e,t)}function Im(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Lm(e){return km=Sm=1,Em=bm(Om=e),_m=0,[]}function zm(e){return Om="",e}function Fm(e){return hm(Dm(_m-1,Bm(91===e?e+2:40===e?e+1:e)))}function jm(e){for(;(Cm=Tm())&&Cm<33;)Mm();return Im(e)>2||Im(Cm)>3?"":" "}function $m(e,t){for(;--t&&Mm()&&!(Cm<48||Cm>102||Cm>57&&Cm<65||Cm>70&&Cm<97););return Dm(e,Am()+(t<6&&32==Tm()&&32==Mm()))}function Bm(e){for(;Mm();)switch(Cm){case e:return _m;case 34:case 39:34!==e&&39!==e&&Bm(Cm);break;case 40:41===e&&Bm(e);break;case 92:Mm()}return _m}function Vm(e,t){for(;Mm()&&e+Cm!==57&&(e+Cm!==84||47!==Tm()););return"/*"+Dm(t,_m-1)+"*"+fm(47===e?e:Mm())}function Hm(e){for(;!Im(Tm());)Mm();return Dm(e,_m)}function Um(e){return zm(Wm("",null,null,null,[""],e=Lm(e),0,[0],e))}function Wm(e,t,n,r,o,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=i,k=r,S=b;g;)switch(h=v,v=Mm()){case 40:if(108!=h&&58==ym(S,d-1)){-1!=gm(S+=mm(Fm(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=Fm(v);break;case 9:case 10:case 13:case 32:S+=jm(h);break;case 92:S+=$m(Am()-1,7);continue;case 47:switch(Tm()){case 42:case 47:xm(Km(Vm(Mm(),Am()),t,n),s);break;default:S+="/"}break;case 123*m:l[c++]=bm(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=mm(S,/\f/g,"")),p>0&&bm(S)-d&&xm(p>32?Xm(S+";",r,n,d-1):Xm(mm(S," ","")+";",r,n,d-2),s);break;case 59:S+=";";default:if(xm(k=qm(S,t,n,c,u,o,l,b,w=[],x=[],d),i),123===v)if(0===u)Wm(S,t,k,k,w,i,d,l,x);else switch(99===f&&110===ym(S,3)?100:f){case 100:case 108:case 109:case 115:Wm(e,k,k,r&&xm(qm(e,k,k,0,0,o,l,b,o,w=[],d),x),o,x,d,l,r?w:x);break;default:Wm(S,k,k,k,[""],x,0,l,x)}}c=u=p=0,m=y=1,b=S="",d=a;break;case 58:d=1+bm(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==Rm())continue;switch(S+=fm(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(bm(S)-1)*y,y=1;break;case 64:45===Tm()&&(S+=Fm(Mm())),f=Tm(),u=d=bm(b=S+=Hm(Am())),v++;break;case 45:45===h&&2==bm(S)&&(m=0)}}return i}function qm(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,f=0===o?i:[""],p=wm(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=vm(e,d+1,d=dm(m=a[h])),b=e;y<p;++y)(b=hm(m>0?f[y]+" "+v:mm(v,/&\f/g,f[y])))&&(s[g++]=b);return Nm(e,t,n,0===o?sm:l,s,c,u)}function Km(e,t,n){return Nm(e,t,n,lm,fm(Cm),vm(e,2,-2),0)}function Xm(e,t,n,r){return Nm(e,t,n,cm,vm(e,0,r),vm(e,r+1,-1),r)}function Ym(e,t){for(var n="",r=wm(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Gm(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case cm:return e.return=e.return||e.value;case lm:return"";case um:return e.return=e.value+"{"+Ym(e.children,r)+"}";case sm:e.value=e.props.join(",")}return bm(n=Ym(e.children,r))?e.return=e.value+"{"+n+"}":""}function Qm(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Zm=function(e,t,n){for(var r=0,o=0;r=o,o=Tm(),38===r&&12===o&&(t[n]=1),!Im(o);)Mm();return Dm(e,_m)},Jm=function(e,t){return zm(function(e,t){var n=-1,r=44;do{switch(Im(r)){case 0:38===r&&12===Tm()&&(t[n]=1),e[n]+=Zm(_m-1,t,n);break;case 2:e[n]+=Fm(r);break;case 4:if(44===r){e[++n]=58===Tm()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=fm(r)}}while(r=Mm());return e}(Lm(e),t))},eg=new WeakMap,tg=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||eg.get(n))&&!r){eg.set(e,!0);for(var o=[],i=Jm(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},ng=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function rg(e,t){switch(function(e,t){return 45^ym(e,0)?(((t<<2^ym(e,0))<<2^ym(e,1))<<2^ym(e,2))<<2^ym(e,3):0}(e,t)){case 5103:return am+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return am+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return am+e+im+e+om+e+e;case 6828:case 4268:return am+e+om+e+e;case 6165:return am+e+om+"flex-"+e+e;case 5187:return am+e+mm(e,/(\w+).+(:[^]+)/,am+"box-$1$2"+om+"flex-$1$2")+e;case 5443:return am+e+om+"flex-item-"+mm(e,/flex-|-self/,"")+e;case 4675:return am+e+om+"flex-line-pack"+mm(e,/align-content|flex-|-self/,"")+e;case 5548:return am+e+om+mm(e,"shrink","negative")+e;case 5292:return am+e+om+mm(e,"basis","preferred-size")+e;case 6060:return am+"box-"+mm(e,"-grow","")+am+e+om+mm(e,"grow","positive")+e;case 4554:return am+mm(e,/([^-])(transform)/g,"$1"+am+"$2")+e;case 6187:return mm(mm(mm(e,/(zoom-|grab)/,am+"$1"),/(image-set)/,am+"$1"),e,"")+e;case 5495:case 3959:return mm(e,/(image-set\([^]*)/,am+"$1$`$1");case 4968:return mm(mm(e,/(.+:)(flex-)?(.*)/,am+"box-pack:$3"+om+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+am+e+e;case 4095:case 3583:case 4068:case 2532:return mm(e,/(.+)-inline(.+)/,am+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(bm(e)-1-t>6)switch(ym(e,t+1)){case 109:if(45!==ym(e,t+4))break;case 102:return mm(e,/(.+:)(.+)-([^]+)/,"$1"+am+"$2-$3$1"+im+(108==ym(e,t+3)?"$3":"$2-$3"))+e;case 115:return~gm(e,"stretch")?rg(mm(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ym(e,t+1))break;case 6444:switch(ym(e,bm(e)-3-(~gm(e,"!important")&&10))){case 107:return mm(e,":",":"+am)+e;case 101:return mm(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+am+(45===ym(e,14)?"inline-":"")+"box$3$1"+am+"$2$3$1"+om+"$2box$3")+e}break;case 5936:switch(ym(e,t+11)){case 114:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return am+e+om+mm(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return am+e+om+e+e}return e}var og,ig,ag=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case cm:e.return=rg(e.value,e.length);break;case um:return Ym([Pm(e,{value:mm(e.value,"@","@"+am)})],r);case sm:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ym([Pm(e,{props:[mm(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ym([Pm(e,{props:[mm(t,/:(plac\w+)/,":"+am+"input-$1")]}),Pm(e,{props:[mm(t,/:(plac\w+)/,":-moz-$1")]}),Pm(e,{props:[mm(t,/:(plac\w+)/,om+"input-$1")]})],r)}return""}))}}],lg=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||ag,a={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;l.push(e)}));var s,c,u=[Gm,(c=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=wm(e);return function(n,r,o,i){for(var a="",l=0;l<t;l++)a+=e[l](n,r,o,i)||"";return a}}([tg,ng].concat(i,u));o=function(e,t,n,r){s=n,function(e){Ym(Um(e),d)}(e?e+"{"+t.styles+"}":t.styles),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new rm({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return f.sheet.hydrate(l),f};!function(){if(ig)return og;ig=1;var e=Pp(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function i(n){return e.isMemo(n)?r:o[n.$$typeof]||t}o[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[e.Memo]=r;var a=Object.defineProperty,l=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,d=Object.prototype;og=function e(t,r,o){if("string"!=typeof r){if(d){var f=u(r);f&&f!==d&&e(t,f,o)}var p=l(r);s&&(p=p.concat(s(r)));for(var h=i(t),m=i(r),g=0;g<p.length;++g){var y=p[g];if(!(n[y]||o&&o[y]||m&&m[y]||h&&h[y])){var v=c(r,y);try{a(t,y,v)}catch(e){}}}}return t}}();function sg(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}var cg=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},ug=function(e,t,n){cg(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var dg={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hg=function(e){return 45===e.charCodeAt(1)},mg=function(e){return null!=e&&"boolean"!=typeof e},gg=Qm((function(e){return hg(e)?e:e.replace(fg,"-$&").toLowerCase()})),yg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,n){return bg={name:t,styles:n,next:bg},t}))}return 1===dg[e]||hg(e)||"number"!=typeof t||0===t?t:t+"px"};function vg(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return bg={name:o.name,styles:o.styles,next:bg},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)bg={name:a.name,styles:a.styles,next:bg},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=vg(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var l=a;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":mg(l)&&(r+=gg(i)+":"+yg(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=vg(e,t,a);switch(i){case"animation":case"animationName":r+=gg(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)mg(a[c])&&(r+=gg(i)+":"+yg(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=bg,s=n(e);return bg=l,vg(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var bg,wg=/label:\s*([^\s;{]+)\s*(;|$)/g;function xg(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";bg=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=vg(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=vg(n,t,e[a]),r)o+=i[a]}wg.lastIndex=0;for(var l,s="";null!==(l=wg.exec(o));)s+="-"+l[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+s;return{name:c,styles:o,next:bg}}var kg=!!u.useInsertionEffect&&u.useInsertionEffect||function(e){return e()},Sg=s.createContext("undefined"!=typeof HTMLElement?lg({key:"css"}):null);Sg.Provider;var Eg,_g,Cg=function(e){return s.forwardRef((function(t,n){var r=s.useContext(Sg);return e(t,r,n)}))},Og=s.createContext({}),Ng={}.hasOwnProperty,Pg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Rg=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return cg(t,n,r),kg((function(){return ug(t,n,r)})),null},Mg=Cg((function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[Pg],i=[r],a="";"string"==typeof e.className?a=sg(t.registered,i,e.className):null!=e.className&&(a=e.className+" ");var l=xg(i,void 0,s.useContext(Og));a+=t.key+"-"+l.name;var c={};for(var u in e)Ng.call(e,u)&&"css"!==u&&u!==Pg&&(c[u]=e[u]);return c.className=a,n&&(c.ref=n),s.createElement(s.Fragment,null,s.createElement(Rg,{cache:t,serialized:l,isStringTag:"string"==typeof o}),s.createElement(o,c))})),Tg=Mg,Ag=function(e,t){var n=arguments;if(null==t||!Ng.call(t,"css"))return s.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=Tg,o[1]=function(e,t){var n={};for(var r in t)Ng.call(t,r)&&(n[r]=t[r]);return n[Pg]=e,n}(e,t);for(var i=2;i<r;i++)o[i]=n[i];return s.createElement.apply(null,o)};function Dg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xg(t)}function Ig(){var e=Dg.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}Eg=Ag||(Ag={}),_g||(_g=Eg.JSX||(Eg.JSX={}));var Lg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,zg=Qm((function(e){return Lg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Fg=function(e){return"theme"!==e},jg=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?zg:Fg},$g=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Bg=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return cg(t,n,r),kg((function(){return ug(t,n,r)})),null},Vg=function e(t,n){var r,o,i=t.__emotion_real===t,a=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=$g(t,n,i),c=l||jg(a),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{var p=d[0];f.push(p[0]);for(var h=d.length,m=1;m<h;m++)f.push(d[m],p[m])}var g=Cg((function(e,t,n){var r=u&&e.as||a,i="",d=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=s.useContext(Og)}"string"==typeof e.className?i=sg(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var m=xg(f.concat(d),t.registered,p);i+=t.key+"-"+m.name,void 0!==o&&(i+=" "+o);var g=u&&void 0===l?jg(r):c,y={};for(var v in e)u&&"as"===v||g(v)&&(y[v]=e[v]);return y.className=i,n&&(y.ref=n),s.createElement(s.Fragment,null,s.createElement(Bg,{cache:t,serialized:m,isStringTag:"string"==typeof r}),s.createElement(r,y))}));return g.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=a,g.__emotion_styles=f,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+o}}),g.withComponent=function(t,r){return e(t,nm({},n,r,{shouldForwardProp:$g(g,r,!0)})).apply(void 0,f)},g}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Vg[e]=Vg(e)}));const Hg=[];function Ug(e){return Hg[0]=e,xg(Hg)}function Wg(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>({...e,[t.key]:t.val})),{})})(t),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-r/100}${n})`}return{keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const t=a.indexOf(e);return 0===t?l(a[1]):t===a.length-1?s(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n,...o}}const qg={borderRadius:4};function Kg(e=8,t=wh({spacing:e})){if(e.mui)return e;const n=(...e)=>(0===e.length?[1]:e).map((e=>{const n=t(e);return"number"==typeof n?`${n}px`:n})).join(" ");return n.mui=!0,n}function Xg(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||"function"!=typeof n.getColorSchemeSelector)return{};let r=n.getColorSchemeSelector(e);return"&"===r?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Yg(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...a}=e;let l=vp({breakpoints:Wg(n),direction:"ltr",components:{},palette:{mode:"light",...r},spacing:Kg(o),shape:{...qg,...i}},a);return l=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{const o=t(e.breakpoints.not(...n),r);return o.includes("not all and")?o.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):o}}const r={},o=e=>(n(r,e),r);return n(o),{...e,containerQueries:o}}(l),l.applyStyles=Xg,l=t.reduce(((e,t)=>vp(e,t)),l),l.unstable_sxConfig={...Jh,...a?.unstable_sxConfig},l.unstable_sx=function(e){return em({sx:e,theme:this})},l}function Gg(e=null){const t=s.useContext(Og);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const Qg=Yg();function Zg(e){const{variants:t,...n}=e,r={variants:t,style:Ug(n),isProcessed:!0};return r.style===n||t&&t.forEach((e=>{"function"!=typeof e.style&&(e.style=Ug(e.style))})),r}const Jg=Yg();function ey(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function ty(e){return e?(t,n)=>n[e]:null}function ny(e,t){const n="function"==typeof t?t(e):t;if(Array.isArray(n))return n.flatMap((t=>ny(e,t)));if(Array.isArray(n?.variants)){let t;if(n.isProcessed)t=n.style;else{const{variants:e,...r}=n;t=r}return ry(e,n.variants,[t])}return n?.isProcessed?n.style:n}function ry(e,t,n=[]){let r;e:for(let o=0;o<t.length;o+=1){const i=t[o];if("function"==typeof i.props){if(r??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(r))continue}else for(const t in i.props)if(e[t]!==i.props[t]&&e.ownerState?.[t]!==i.props[t])continue e;"function"==typeof i.style?(r??={...e,...e.ownerState,ownerState:e.ownerState},n.push(i.style(r))):n.push(i.style)}return n}function oy(e={}){const{themeId:t,defaultTheme:n=Jg,rootShouldForwardProp:r=ey,slotShouldForwardProp:o=ey}=e;function i(e){!function(e,t,n){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?n:e.theme[t]||e.theme}(e,t,n)}return(e,t={})=>{!function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}(e,(e=>e.filter((e=>e!==em))));const{name:n,slot:a,skipVariantsResolver:l,skipSx:s,overridesResolver:c=ty(ay(a)),...u}=t,d=void 0!==l?l:a&&"Root"!==a&&"root"!==a||!1,f=s||!1;let p=ey;"Root"===a||"root"===a?p=r:a?p=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(p=void 0);const h=
11
11
  /**
12
12
  * @mui/styled-engine v6.4.3
13
13
  *
@@ -93,7 +93,7 @@ function(e,t){return Vg(e,t)}(e,{shouldForwardProp:p,label:iy(),...u}),m=e=>{if(
93
93
  * content-type
94
94
  * Copyright(c) 2015 Douglas Christopher Wilson
95
95
  * MIT Licensed
96
- */var ML=function(){if(PL)return RL;PL=1;var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/\\([\u000b\u0020-\u00ff])/g,o=/([\\"])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){var r=String(e);if(n.test(r))return r;if(r.length>0&&!t.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(o,"\\$1")+'"'}function l(e){this.parameters=Object.create(null),this.type=e}return RL.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!i.test(r))throw new TypeError("invalid type");var o=r;if(t&&"object"==typeof t)for(var l,s=Object.keys(t).sort(),c=0;c<s.length;c++){if(l=s[c],!n.test(l))throw new TypeError("invalid parameter name");o+="; "+l+"="+a(t[l])}return o},RL.parse=function(t){if(!t)throw new TypeError("argument string is required");var n="object"==typeof t?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(t):t;if("string"!=typeof n)throw new TypeError("argument string is required to be a string");var o=n.indexOf(";"),a=-1!==o?n.slice(0,o).trim():n.trim();if(!i.test(a))throw new TypeError("invalid media type");var s=new l(a.toLowerCase());if(-1!==o){var c,u,d;for(e.lastIndex=o;u=e.exec(n);){if(u.index!==o)throw new TypeError("invalid parameter format");o+=u[0].length,c=u[1].toLowerCase(),34===(d=u[2]).charCodeAt(0)&&-1!==(d=d.slice(1,-1)).indexOf("\\")&&(d=d.replace(r,"$1")),s.parameters[c]=d}if(o!==n.length)throw new TypeError("invalid parameter format")}return s},RL}(),TL=new Map,AL=function(e){return e.cloneNode(!0)},DL=function(){return"file:"===window.location.protocol},IL=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=ML.parse(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(DL()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||DL()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(e){if(r.abort(),!(e instanceof Error))throw e;n(e,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},LL={},zL=function(e,t){LL[e]=LL[e]||[],LL[e].push(t)},FL=function(e,t,n){if(TL.has(e)){var r=TL.get(e);if(void 0===r)return void zL(e,n);if(r instanceof SVGSVGElement)return void n(null,AL(r))}TL.set(e,void 0),zL(e,n),IL(e,t,(function(t,n){var r;t?TL.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&TL.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(LL[e])){var n=TL.get(e),r=LL[e][t];n instanceof SVGSVGElement&&r(null,AL(n)),n instanceof Error&&r(n),t===LL[e].length-1&&delete LL[e]}}),0)},n=0,r=LL[e].length;n<r;n++)t(n)}(e)}))},jL=function(e,t,n){IL(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},$L=0,BL=[],VL={},HL="http://www.w3.org/1999/xlink",UL=function(e,t,n,r,o,i,a){var l=e.getAttribute("data-src")||e.getAttribute("src");if(l){if(-1!==BL.indexOf(e))return BL.splice(BL.indexOf(e),1),void(e=null);BL.push(e),e.setAttribute("src",""),(r?FL:jL)(l,o,(function(r,o){if(!o)return BL.splice(BL.indexOf(e),1),e=null,void a(r);var s=e.getAttribute("id");s&&o.setAttribute("id",s);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var f=Array.from(new Set(Pd(Pd(Pd([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",f);var p=e.getAttribute("style");p&&o.setAttribute("style",p),o.setAttribute("data-src",l);var h=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(h,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var m,g,y,v,b,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){m=e,y=w[e];for(var t=function(e,t){var n;v=g[e].id,b=v+"-"+ ++$L,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+v+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+v+'"?\\)'))||n[t].setAttribute(e,"url(#"+b+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,l=r.length;a<l;a++){var s=r[a].getAttributeNS(HL,"href");s&&s.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(HL,"href","#"+b);g[e].id=b},n=0,r=(g=o.querySelectorAll(m+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var x,k,S=o.querySelectorAll("script"),E=[],_=0,C=S.length;_<C;_++)(k=S[_].getAttribute("type"))&&"application/ecmascript"!==k&&"application/javascript"!==k&&"text/javascript"!==k||((x=S[_].innerText||S[_].textContent)&&E.push(x),o.removeChild(S[_]));if(E.length>0&&("always"===t||"once"===t&&!VL[l])){for(var O=0,N=E.length;O<N;O++)new Function(E[O])(window);VL[l]=!0}var P=o.querySelectorAll("style");if(Array.prototype.forEach.call(P,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",HL),i(o),!e.parentNode)return BL.splice(BL.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),BL.splice(BL.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},WL=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qL="http://www.w3.org/2000/svg",KL="http://www.w3.org/1999/xlink",XL=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}Kb(t,e);var n=t.prototype;return n.renderSVG=function(){var e=this;if(this.reactWrapper instanceof function(e){return((null==e?void 0:e.ownerDocument)||document).defaultView||window}(this.reactWrapper).Node){var t,n,r=this.props,o=r.desc,i=r.evalScripts,a=r.httpRequestWithCredentials,l=r.renumerateIRIElements,s=r.src,c=r.title,u=r.useRequestCache,d=this.props.onError,f=this.props.beforeInjection,p=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((t=document.createElementNS(qL,h)).setAttribute("xmlns",qL),t.setAttribute("xmlns:xlink",KL),n=document.createElementNS(qL,h)):(t=document.createElement(h),n=document.createElement(h)),t.appendChild(n),n.dataset.src=s,this.nonReactWrapper=this.reactWrapper.appendChild(t);var m=function(t){e.removeSVG(),e._isMounted?e.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){d(t)})):d(t)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,l=n.beforeEach,s=void 0===l?function(){}:l,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,f=void 0===d?"never":d,p=n.httpRequestWithCredentials,h=void 0!==p&&p,m=n.renumerateIRIElements,g=void 0===m||m;if(e&&"length"in e)for(var y=0,v=0,b=e.length;v<b;v++)UL(e[v],f,g,u,h,s,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?UL(e,f,g,u,h,s,(function(t,n){a(t,n),o(1),e=null})):o(0)}(n,{afterEach:function(t,n){t?m(t):e._isMounted&&e.setState((function(){return{isLoading:!1}}),(function(){try{p(n)}catch(e){m(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=o,e.prepend(n)}if(c){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var i=document.createElement("title");i.innerHTML=c,e.prepend(i)}try{f(e)}catch(e){m(e)}},cacheRequests:u,evalScripts:i,httpRequestWithCredentials:a,renumerateIRIElements:l})}},n.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(nm({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,o=Wb(e,WL),i=r;return s.createElement(i,nm({},o,{ref:this.refCallback},"svg"===r?{xmlns:qL,xmlnsXlink:KL}:{}),this.state.isLoading&&n&&s.createElement(n,null),this.state.hasError&&t&&s.createElement(t,null))},t}(s.Component);XL.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},XL.propTypes={afterInjection:Ap.func,beforeInjection:Ap.func,desc:Ap.string,evalScripts:Ap.oneOf(["always","once","never"]),fallback:Ap.oneOfType([Ap.func,Ap.object,Ap.string]),httpRequestWithCredentials:Ap.bool,loading:Ap.oneOfType([Ap.func,Ap.object,Ap.string]),onError:Ap.func,renumerateIRIElements:Ap.bool,src:Ap.string.isRequired,title:Ap.string,useRequestCache:Ap.bool,wrapper:Ap.oneOf(["div","span","svg"])};const YL=({value:e,renderoptions:t})=>(void 0===t&&(t={}),void 0===t.format&&(t.format="jpeg"),s.createElement("img",{src:"data:image/"+t.format+";base64, "+e,style:{maxWidth:"100%",maxHeight:"100%"}})),GL=({value:e})=>s.createElement(XL,{src:`data:image/svg+xml;base64,${btoa(e)}`,style:{maxWidth:"100%",maxHeight:"100%"},beforeInjection:e=>{e.classList.add("svg-class-name"),e.setAttribute("style","max-width: 100%; max-height: 100%;"),e.setAttribute("width","100%"),e.setAttribute("height","100%")}}),QL=({io:e})=>{let t=e.fullvalue;if(null==t&&(t=e.value),void 0===t&&(t=""),"string"!=typeof t||t.length%4!=0)return s.createElement("div",null,t);const n=Math.round(3*t.length/4);return s.createElement("div",null,s.createElement("pre",null,"Bytes(",n,")"))},ZL=({io:e})=>{let t=e.fullvalue;return void 0===t&&(t=e.value),void 0===t&&(t={}),s.createElement(OL,{data:t})},JL={float:({io:e,inputconverter:t})=>oL({io:e,inputconverter:t,parser:parseFloat}),int:({io:e,inputconverter:t})=>oL({io:e,inputconverter:t,parser:parseInt}),bool:({io:e,inputconverter:t})=>{const n=s.useContext($z),r=void 0===e.value,o=s.useRef(null);s.useEffect((()=>{o.current&&(o.current.indeterminate=r)}),[o,r]);return s.createElement("input",{ref:o,type:"checkbox",className:"styledcheckbox booleaninput",checked:!!t[1](e.value),onChange:r=>{let o=r.target.checked;try{o=t[0](r.target.checked)}catch(r){}n.worker?.set_io_value({nid:e.node,ioid:e.id,value:o,set_default:e.render_options.set_default})},disabled:e.connected})},string:iL,str:iL,color:({io:e})=>{const t=s.useContext($z),n=e.value_options?.colorspace||"hex";let r=!1;return"string"!=typeof e.type&&"anyOf"in e.type&&void 0!==e.type.anyOf&&(r=e.type.anyOf.some((e=>"None"===e))),s.createElement(oA,{onChange:r=>{let o="<NoValue>";r&&(o=r[n]?r[n]():r.hex()),null===r&&(o=null),t.worker?.set_io_value({nid:e.node,ioid:e.id,value:o,set_default:e.render_options.set_default})},inicolordata:e.value,allow_null:r,inicolorspace:n})},select:uL,enum:uL,bytes:QL},ez={Inputrenderer:JL,Outputrenderer:{},HandlePreviewRenderer:{bytes:QL},DataOverlayRenderer:{},DataPreviewViewRenderer:{string:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n"),s.createElement("div",null,s.createElement("pre",null,t))},table:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=[]),s.createElement(NL,{tabledata:t})},image:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),s.createElement(YL,{value:t})},svg:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),s.createElement(GL,{value:t})},dict:ZL,bytes:QL},DataViewRenderer:{},InLineRenderer:{bytes:({io:e})=>{let t=e.fullvalue;null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n");return`Bytes(${Math.round(3*t.length/4)})`}}},tz=(e,t)=>{const n=t.options||{},r=void 0===n.overwrite||n.overwrite;switch(t.type){case"EXTEND_INPUT_RENDER":return!r&&e.Inputrenderer[t.payload.type]?e:{...e,Inputrenderer:{...e.Inputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_OUTPUT_RENDER":return!r&&e.Outputrenderer[t.payload.type]?e:{...e,Outputrenderer:{...e.Outputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_HANDLE_PREVIEW_RENDER":return!r&&e.HandlePreviewRenderer[t.payload.type]?e:{...e,HandlePreviewRenderer:{...e.HandlePreviewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_OVERLAY_RENDER":return!r&&e.DataOverlayRenderer[t.payload.type]?e:{...e,DataOverlayRenderer:{...e.DataOverlayRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_PREVIEW_RENDER":return!r&&e.DataPreviewViewRenderer[t.payload.type]?e:{...e,DataPreviewViewRenderer:{...e.DataPreviewViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_VIEW_RENDER":return!r&&e.DataViewRenderer[t.payload.type]?e:{...e,DataViewRenderer:{...e.DataViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_FROM_PLUGIN":let n=!1;const o=[[t.payload.plugin.input_renderers||{},e.Inputrenderer],[t.payload.plugin.output_renderers||{},e.Outputrenderer],[t.payload.plugin.handle_preview_renderers||{},e.HandlePreviewRenderer],[t.payload.plugin.data_overlay_renderers||{},e.DataOverlayRenderer],[t.payload.plugin.data_preview_renderers||{},e.DataPreviewViewRenderer],[t.payload.plugin.data_view_renderers||{},e.DataViewRenderer]];for(const[e,t]of o){if(Object.keys(e).length>0)if(r)n=!0;else for(const r in e)if(!t[r]){n=!0;break}if(n)break}if(!n)return e;for(const[e,t]of o)for(const n in e)!r&&t[n]||(t[n]=e[n]);return{...e};default:return e}},nz=({children:e,plugins:t,fnrf_zst:n})=>{const[r,o]=s.useReducer(tz,ez),i=(e,t)=>{o({type:"EXTEND_FROM_PLUGIN",payload:{plugin:e},options:t})};return s.useEffect((()=>{for(const e in t){const r=t[e].RendererPlugin;r&&i(r);const o=t[e].renderpluginfactory;o&&i(o({React:u,fnrf_zst:n}))}}),[t]),s.createElement(rz.Provider,{value:{Inputrenderer:r.Inputrenderer,Outputrenderer:r.Outputrenderer,HandlePreviewRenderer:r.HandlePreviewRenderer,DataOverlayRenderer:r.DataOverlayRenderer,DataPreviewViewRenderer:r.DataPreviewViewRenderer,DataViewRenderer:r.DataViewRenderer,InLineRenderer:r.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{o({type:"EXTEND_INPUT_RENDER",payload:{type:e,component:t},options:n})},extendOutputRenderMapping:(e,t,n)=>{o({type:"EXTEND_OUTPUT_RENDER",payload:{type:e,component:t},options:n})},extendHandlePreviewRenderMapping:(e,t,n)=>{o({type:"EXTEND_HANDLE_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataOverlayRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_OVERLAY_RENDER",payload:{type:e,component:t},options:n})},extendDataPreviewRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataViewRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_VIEW_RENDER",payload:{type:e,component:t},options:n})},extendFromPlugin:i}},e)},rz=s.createContext({Inputrenderer:ez.Inputrenderer,Outputrenderer:ez.Outputrenderer,HandlePreviewRenderer:ez.HandlePreviewRenderer,DataOverlayRenderer:ez.DataOverlayRenderer,DataPreviewViewRenderer:ez.DataPreviewViewRenderer,DataViewRenderer:ez.DataViewRenderer,InLineRenderer:ez.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{},extendOutputRenderMapping:(e,t,n)=>{},extendHandlePreviewRenderMapping:(e,t,n)=>{},extendDataOverlayRenderMapping:(e,t,n)=>{},extendDataPreviewRenderMapping:(e,t,n)=>{},extendDataViewRenderMapping:(e,t,n)=>{},extendFromPlugin:(e,t)=>{}}),oz=({component:e,...t})=>s.createElement(e,{...t}),iz=e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{});if(!n)return ZL;const{DataOverlayRenderer:r,DataPreviewViewRenderer:o}=s.useContext(rz);return r[n]?r[n]:o[n]?o[n]:ZL},az=(e,t)=>{if("string"==typeof e)return e in t?[t[e],e]:[e,e];if("allOf"in e&&void 0!==e.allOf)return[void 0,void 0];if("anyOf"in e&&void 0!==e.anyOf){const n=e.anyOf.map((e=>az(e,t)));for(const e of n)switch(e[0]){case"bool":return["bool",e[1]];case"enum":return["enum",e[1]];case"float":return["float",e[1]];case"int":return["int",e[1]];case"string":case"str":return["string",e[1]]}return[void 0,void 0]}return"type"in e&&void 0!==e.type&&"enum"===e.type?["enum","enum"]:[void 0,void 0]},lz=({io:e,typestring:t,preview:n,...r})=>{const[o,i]=s.useState(!1),[a,l]=s.useState(!1),[c,u]=e?(e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),{HandlePreviewRenderer:r,DataPreviewViewRenderer:o}=s.useContext(rz),i=iz(e);return n?r[n]?[r[n],i]:o[n]?[o[n],i]:[ZL,i]:[ZL,i]})(e):[void 0,void 0];return s.createElement(pT,null,s.createElement(hT,{open:o||a,onOpenChange:l},s.createElement(mT,{asChild:!0},s.createElement(pi,{id:e.id,...r})),s.createElement(gT,null,s.createElement(yT,{className:"iotooltipcontent",sideOffset:5},s.createElement("div",{className:"iotooltip_container"},s.createElement("div",{className:"iotooltip_header"},o?s.createElement(ub,{onClick:()=>i(!1)}):s.createElement(cb,{onClick:()=>i(!0)}),u&&s.createElement(_w,{title:e.full_id,trigger:s.createElement(db,null),onOpenChange:t=>{t&&e.try_get_full_value&&e.try_get_full_value(),i(t)}},s.createElement(oz,{component:u,io:e}))),c?s.createElement(oz,{component:c,io:e}):`no preview available for "${t}"`),s.createElement(vT,{className:"iotooltipcontentarrow"})))))},sz={"":[e=>e,e=>e],str_to_json:[e=>JSON.parse(e),e=>"string"==typeof e?e:JSON.stringify(e)],str_to_list:[e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch(t){try{return JSON.parse("["+e+"]")}catch(e){}}throw new Error("Invalid list")},e=>JSON.stringify(e)]},cz=({io:e})=>{const t=s.useContext($z).render_options(),[n,r]=az(e.render_options.type,t.typemap||{}),{Inputrenderer:o}=s.useContext(rz),i=n?e.value_options?.options?uL:o[n]:void 0,a=sz[(r&&t.inputconverter?.[r])??""];return s.createElement("div",{className:"nodeinput"},s.createElement(lz,{io:e,typestring:n,position:Po.Left,type:"target"}),i&&s.createElement("div",{className:"iovaluefield nodrag"},s.createElement(i,{io:e,inputconverter:a})),s.createElement("div",{className:"ioname"},e.name),s.createElement(lz,{io:e,typestring:n,position:Po.Right,type:"source"}))},uz=({io:e,typestring:t})=>{const{InLineRenderer:n}=s.useContext(rz);if(t&&n[t])return s.createElement("div",null,n[t]({io:e}));let r=e.fullvalue;return null==r&&(r=e.value),r=void 0===r?"":JSON.stringify(r).replace(/\\n/g,"\n"),r.length>63&&(r=r.slice(0,60)+"..."),s.createElement("div",null,r)},dz=({io:e})=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),{Outputrenderer:r}=s.useContext(rz),o=n?r[n]:void 0;return s.createElement("div",{className:"nodeoutput"},s.createElement(lz,{io:e,typestring:n,position:Po.Right,type:"source"}),s.createElement("div",{className:"ioname"},e.name),o?s.createElement("div",{className:"iovaluefield nodrag"},s.createElement(o,{io:e})):s.createElement("div",{className:"iovaluefield"},s.createElement(uz,{io:e,typestring:n})))};function fz(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function pz(e,t){const n=["","K","M","G","T"];let r=0;for(;e>=t&&r<n.length-1;)e/=t,r++;return[e.toFixed(2),n[r]]}const hz=({state:e,className:t="reacttqdm",...n})=>{const r=s.useRef(null),o=s.useRef(null);s.useEffect((()=>{const e=()=>{r.current&&o.current&&function(e,t,n={}){const{maxFontSize:r=100,minFontSize:o=6,decrementFactor:i=.9}=n;if(!e||!t)return;if(i>=1||i<=0)throw new Error("decrementFactor must be between 0 and 1");const a=e.getBoundingClientRect(),l=a.width,s=a.height;let c=r;t.style.whiteSpace="nowrap",t.style.display="inline-block",t.style.fontSize=c+"px";let u=t.getBoundingClientRect();for(;(u.width>l||u.height>s)&&c>o;)c*=i,t.style.fontSize=c+"px",u=t.getBoundingClientRect()}(r.current,o.current,{maxFontSize:12,decrementFactor:.9})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[e]);const i=e.total?e.n/e.total*100:0;return s.createElement("div",{ref:r,className:t,...n},s.createElement("div",{style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},s.createElement("div",{className:t+"-bar",style:{position:"absolute",width:"100%",height:"100%",overflow:"hidden"}},s.createElement("div",{className:t+"-progress",style:{width:`${i}%`,height:"100%"}})),s.createElement("div",{className:t+"-text",ref:o},function(e={n:0,elapsed:0,ascii:!1,unit:"it",unit_scale:!1,unit_divisor:1e3}){let t=e.total??null;const{n:n,unit_scale:r,elapsed:o,unit:i,unit_divisor:a,prefix:l="",rate:s,postfix:c=null,initial:u=0}=e;null!==t&&n>=t+.5&&(t=null);let d=n,f=t,p=s;r&&!0!==r&&1!==r&&(null!==t&&(f=t*r),d=n*r,void 0!==s&&(p=s*r));const h=fz(o);void 0===p&&o>0&&(p=(d-u)/o);const m=p?1/p:void 0,[g,y]=p?pz(p,a):[void 0,""],[v,b]=m?pz(m,1e3):[void 0,""],w=m&&m>1?v?`${v}${b}s/`+i:"?":(g||"?")+`${y}${i}/s`,x=r?pz(d,a).join(""):d.toString(),k=r&&null!==f?pz(f,a).join(""):f?.toString()??"?",S=p?fz(p&&null!==f?(f-d)/p:0):"?",E=l?`${l}: `:"";if(null!==t){const e=` ${x}/${k} [${h} < ${S}, ${w}${c??""}]`;return`${E}${(d/t*100).toFixed(0)}%${e}`}return`${E}${x}${i} [${h}, ${w}${c??""}]`}(e))))},mz=({node_data:e})=>{const t=s.useContext($z);return s.createElement("div",{className:"nodeheader",title:e.description||e.node_name},s.createElement("div",{className:"nodeheader_element"},s.createElement(hb,{fontSize:"inherit",className:"triggerbutton",onClick:()=>{t.on_node_action({type:"trigger",from_remote:!1,id:e.id})}}),s.createElement(pb,{fontSize:"inherit",onClick:async()=>{t.logger.info("nodestatus",await(t.worker?.get_node_status(e.id)))}})),s.createElement("div",{className:"nodeheader_element nodeheader_title"},s.createElement("div",{className:"nodeheader_title_text"},e.node_name)),s.createElement("div",{className:"nodeheader_element"},s.createElement(fb,{fontSize:"inherit"})))},gz=({node_data:e})=>{const t=e.render_options?.data?.src?e.io[e.render_options?.data?.src]:void 0,[n,r]=t?(e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),r=iz(e),{DataPreviewViewRenderer:o,DataViewRenderer:i}=s.useContext(rz);return n?i[n]?[i[n],r]:o[n]?[o[n],r]:[ZL,r]:[ZL,r]})(t):[void 0,void 0];return s.createElement("div",{className:"nodrag nodedatabody"},n&&t&&s.createElement(_w,{title:t.full_id,trigger:s.createElement("div",null,s.createElement(oz,{component:n,io:t})),onOpenChange:e=>{e&&t?.try_get_full_value&&t?.try_get_full_value()}},s.createElement(oz,{component:r,io:t})))},yz=({node_data:e})=>{const t=Object.values(e.io).filter((e=>e.is_input)),n=Object.values(e.io).filter((e=>!e.is_input));return e.render_options,s.createElement("div",{className:"nodebody"},n.map((e=>e.hidden?null:s.createElement(dz,{key:e.id,io:e}))),s.createElement(gz,{node_data:e}),t.map((e=>e.hidden?null:s.createElement(cz,{key:e.id,io:e}))))},vz=({node_data:e})=>{const[t,n]=s.useState(e.name);s.useEffect((()=>{n(e.name)}),[e]);const r=s.useContext($z);return s.createElement("input",{className:"nodename_input",value:t,onChange:e=>{n(e.target.value)},onBlur:t=>{const n=t.target.value;r.on_node_action({type:"update",from_remote:!1,id:e.id,node:{name:n}})}})},bz=({node_data:e})=>e.progress?s.createElement(hz,{style:{height:"idle"===e.progress.prefix?"0px":void 0},state:e.progress,className:"nodeprogress"}):null,wz=({node_data:e})=>s.createElement("div",{className:"nodefooter"},e.error&&s.createElement("div",{className:"nodeerror"},e.error),s.createElement(bz,{node_data:e})),xz=({io:e})=>{const t=s.useContext($z).render_options(),[n,r]=az(e.render_options.type,t.typemap||{}),{Inputrenderer:o}=s.useContext(rz),i=n?e.value_options?.options?uL:o[n]:void 0,a=sz[(r&&t.inputconverter?.[r])??""];return s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,e.name),i&&s.createElement(i,{io:e,inputconverter:a}),s.createElement("div",null,s.createElement("label",null,"hidden:",s.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden}))))},kz=({io:e})=>s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,e.name),s.createElement("div",null,s.createElement("label",null,"hidden:",s.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden})))),Sz=({nodestore:e})=>{const t=e(),n=Object.values(t.io).filter((e=>e.is_input)),r=Object.values(t.io).filter((e=>!e.is_input));return s.createElement("div",null,s.createElement("div",{className:"nodesettings_section"},s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,"Name"),s.createElement("div",null,s.createElement(vz,{node_data:t})))),s.createElement("div",{className:"nodesettings_section"},s.createElement("div",null,"Inputs"),n.map((e=>s.createElement(xz,{io:e,key:e.id})))),s.createElement("div",{className:"nodesettings_section"},s.createElement("div",null,"Outputs"),r.map((e=>s.createElement(kz,{io:e,key:e.id})))))},Ez=()=>{const e=s.useContext($z),t=e.local_state((e=>e.selected_nodes));if(0===t.length)return s.createElement("div",null,"Node Settings");if(t.length>1)return s.createElement("div",null,"Multiple Nodes Selected");const n=e.nodespace.get_node(t[0]);return n?s.createElement(Sz,{nodestore:n}):s.createElement("div",null,"Node not found")},_z=()=>{const e=s.useContext($z),t=e.local_settings((e=>e.view_settings.expand_node_props)),n=e.local_settings((e=>e.update_view_settings)),r=e=>{n({expand_node_props:e})};return s.createElement("div",{className:"nodesettings_container"},s.createElement("div",{className:"nodesettings_expander"},t?s.createElement(sb,{onClick:()=>{r(!1)}}):s.createElement(mb,{onClick:()=>{r(!0)}})),s.createElement("div",{className:"nodesettings_content "+(t?"expanded":"collapsed")},t&&s.createElement(Ez,null)))},Cz=e=>({nodes:e.nodes,edges:e.edges,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect}),Oz={default:({data:e})=>{const t=e.UseNodeStore(),n=t.frontend.collapsed||!1,[r,o]=s.useState(!1);return s.useEffect((()=>{let e;return t.in_trigger?o(!0):r&&(e=setTimeout((()=>o(!1)),200)),()=>clearTimeout(e)}),[t.in_trigger,r]),s.createElement(s.Fragment,null,s.createElement("div",{className:"innernode"+(r?" intrigger":"")+(t.error?" error":"")},s.createElement(mz,{node_data:t}),s.createElement(vz,{node_data:t}),n?null:s.createElement(yz,{node_data:t}),s.createElement(wz,{node_data:t})))}},Nz={default:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,data:l,...c})=>{const[u]=Vo({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return s.createElement(s.Fragment,null,s.createElement(wo,{id:e,path:u,...c}))}},Pz=()=>{const e=Qi();return s.useContext($z).rf_instance=e,s.createElement(s.Fragment,null)},Rz=()=>{const e=s.useContext($z),t=Fi("Delete"),n=Yr(Cl,q),r=Yr(_l,q);if(t){for(const t of n)if(t.selected){if(!e.worker)return s.createElement(s.Fragment,null);if(!t.source||!t.target)return s.createElement(s.Fragment,null);if(!t.sourceHandle||!t.targetHandle)return s.createElement(s.Fragment,null);e.worker.remove_edge({src_nid:t.source,src_ioid:t.sourceHandle,trg_nid:t.target,trg_ioid:t.targetHandle})}for(const t of r)if(t.selected){if(!e.worker)return s.createElement(s.Fragment,null);e.worker.remove_node(t.id)}}return s.createElement(s.Fragment,null)},Mz=({id:e,top:t,left:n,right:r,bottom:o,...i})=>{const{getNode:a,setNodes:l,addNodes:c,setEdges:u}=Qi(),d=s.useContext($z),f=s.useCallback((()=>{const t=a(e);if(!t)return;const n={x:t.position.x+50,y:t.position.y+50};c({...t,id:`${t.id}-copy`,position:n})}),[e,a,c]),p=s.useCallback((()=>{d.on_node_action({type:"delete",id:e,from_remote:!1})}),[e,l,u]),h=d.nodespace.get_node(e,!1);if(!h)return s.createElement(s.Fragment,null," ");const m=h();return s.createElement("div",{style:{top:t,left:n,right:r,bottom:o},className:"context-menu",...i},s.createElement("p",{style:{fontWeight:"bold"}},s.createElement("small",null,m.name)),s.createElement("button",{onClick:f},"duplicate"),s.createElement("button",{onClick:p},"delete"))},Tz=e=>{const t=s.useContext($z),n=s.useRef(null);s.useEffect((()=>{t.reactflowRef=n.current}),[n]);const[r,o]=s.useState(null),i=s.useCallback((()=>o(null)),[o]),{nodes:a,edges:l,onNodesChange:c,onEdgesChange:u,onConnect:d}=t.useReactFlowStore(zM(Cz));return s.createElement("div",{className:"reactflowlayer"},s.createElement(El,{nodes:a,edges:l,onNodesChange:c,onEdgesChange:u,onConnect:d,nodeTypes:Oz,edgeTypes:Nz,minZoom:e.minZoom,maxZoom:e.maxZoom,fitView:!0,onSelectionChange:({nodes:e,edges:n})=>{const r=t.local_state.getState();t.local_state.setState({...r,selected_nodes:e.map((e=>e.id)),selected_edges:n.map((e=>e.id))})},ref:n,onPaneClick:i,panOnDrag:!e.static},s.createElement(Pz,null),s.createElement(Rz,null),s.createElement(Hl,{color:"#888",gap:16,size:1}),e.minimap&&s.createElement(Ll,{nodeStrokeWidth:3,pannable:!e.static,zoomable:!e.static,zoomStep:3}),r&&s.createElement(Mz,{onClick:i,...r})))},Az=s.createContext(void 0),Dz=s.forwardRef(((e,t)=>{const{asChild:n,children:r,className:o,style:i,...a}=e,[l,c]=s.useState(!1),u=s.useRef(null),[d,f]=s.useState(null),[p,h]=s.useState({}),m=e.htime||300,g=e.vtime||300,y=e.hdelay||0,v=e.vdelay||200;s.useImperativeHandle(t,(()=>u.current),[]);let b;if(n&&s.isValidElement(r)){const e=r,t=[e.props.className,o,"smooth-expand",l?"smooth-expand-expanded":""].filter(Boolean).join(" "),n={...e.props.style,...i,...p};b=s.cloneElement(e,{ref:u,className:t,style:n,...a})}else b=s.createElement("div",{ref:u,...a,className:`smooth-expand ${l?"smooth-expand-expanded":""} ${o||""}`,style:{...i,...p}},r);const w=s.createElement(Az.Provider,{value:{isExpanded:l,toggleExpand:async()=>{u.current&&(l?await(async()=>{if(!u.current)return;if(!d)return;const e={transitionProperty:"width, left, height, top",transitionDuration:`${m}ms, ${m}ms, ${g}ms, ${g}ms`};h((t=>({...t,...e})));const[t,n,r,o]=d,i=new Promise((e=>{setTimeout((()=>{h((e=>({...e,left:`${t}px`,width:`${r}px`}))),e()}),v)})),a=new Promise((e=>{setTimeout((()=>{h((e=>({...e,top:`${n}px`,height:`${o}px`}))),e()}),y)})),l=Math.max(m+y,g+v),s=new Promise((e=>{setTimeout((()=>{e()}),l)}));await Promise.all([i,a,s]),u.current.style.transition="",h({}),c(!1)})():await(async()=>{if(!u.current)return;u.current.style.transition="none",u.current.style.position="",u.current.style.top="",u.current.style.left="",u.current.style.width="",u.current.style.height="";const e=u.current.getBoundingClientRect();f([e.left,e.top,e.width,e.height]),u.current.style.transition="none",h({position:"absolute",top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`}),h((e=>({...e,transitionProperty:"width, left, height, top",transitionDuration:`${m}ms, ${m}ms, ${g}ms, ${g}ms`}))),c(!0);const t=new Promise((e=>{setTimeout((()=>{h((e=>({...e,left:"0px",width:"100vw"}))),e()}),y)})),n=new Promise((e=>{setTimeout((()=>{h((e=>({...e,top:"0px",height:"100vh"}))),e()}),v)})),r=Math.max(m+y,g+v),o=new Promise((e=>{setTimeout((()=>{e()}),r)}));await Promise.all([t,n,o])})())}}},b);return l?Lr.createPortal(w,document.body):w}));Dz.Trigger=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Trigger must be used within a SmoothExpandComponent");return s.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleExpand},e)},Dz.Expanded=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Expanded must be used within a SmoothExpandComponent");return t.isExpanded?s.createElement(s.Fragment,null,e):null},Dz.Collapsed=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Collapsed must be used within a SmoothExpandComponent");return t.isExpanded?null:s.createElement(s.Fragment,null,e)};const Iz=s.createContext(void 0),Lz=s.forwardRef(((e,t)=>{const{asChild:n,children:r,className:o,style:i,...a}=e,l=s.useRef(null);s.useImperativeHandle(t,(()=>l.current),[]);const[c,u]=s.useState(!1),d=s.useCallback((async()=>{try{const e=l.current;if(!e)return;if(c){const e=document;e.exitFullscreen?await e.exitFullscreen():e.mozCancelFullScreen?await e.mozCancelFullScreen():e.webkitExitFullscreen?await e.webkitExitFullscreen():e.msExitFullscreen&&await e.msExitFullscreen(),u(!1)}else e.requestFullscreen?await e.requestFullscreen():e.mozRequestFullScreen?await e.mozRequestFullScreen():e.webkitRequestFullscreen?await e.webkitRequestFullscreen():e.msRequestFullscreen&&await e.msRequestFullscreen(),u(!0)}catch(e){console.error("Error toggling fullscreen",e)}}),[c]);let f;if(s.useEffect((()=>{const e=()=>{const e=document.fullscreenElement;u(!!e)};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[]),n&&s.isValidElement(r)){const e=r,t=[e.props.className,o].filter(Boolean).join(" "),n={...e.props.style,...i};f=s.cloneElement(e,{ref:l,className:t,style:n,...a})}else f=s.createElement("div",{ref:l,...a,className:o,style:i},r);return s.createElement(Iz.Provider,{value:{isFullScreen:c,toggleFullscreen:d}},f)}));Lz.Trigger=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Trigger must be used within a FullScreenComponent");return s.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleFullscreen},e)},Lz.InFullScreen=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Expanded must be used within a FullScreenComponent");return t.isFullScreen?s.createElement(s.Fragment,null,e):null},Lz.OutFullScreen=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Collapsed must be used within a FullScreenComponent");return t.isFullScreen?null:s.createElement(s.Fragment,null,e)};const zz=({fnrf_zst:e,header:t,flow:n,library:r})=>{const[o,i]=s.useState(e.options.worker);e.workermanager&&(e.workermanager.on_setWorker=i),e.set_worker(o),e.auto_progress();const a=e.plugins();return s.createElement(nz,{plugins:a,fnrf_zst:e},s.createElement($z.Provider,{value:e},s.createElement(Dz,{asChild:!0},s.createElement(Lz,{asChild:!0},s.createElement("div",{className:"funcnodesreactflowcontainer funcnodescontainer"},t.show&&s.createElement(ZE,{...t}),s.createElement("div",{className:"funcnodesreactflowbody"},o&&r.show&&s.createElement(IM,null),s.createElement(Tz,{...n}),o&&s.createElement(_z,null)),s.createElement("div",{className:"funcnodesflaotingmenu"},s.createElement(Lz.OutFullScreen,null,n.allowExpand&&s.createElement(Dz.Trigger,null,s.createElement(Dz.Expanded,null,s.createElement(Sw,null)),s.createElement(Dz.Collapsed,null,s.createElement(Ew,null)))),n.allowFullScreen&&s.createElement(Lz.Trigger,null,s.createElement(Lz.OutFullScreen,null,s.createElement(db,null)),s.createElement(Lz.InFullScreen,null,s.createElement(kw,null)))))))))},Fz={},jz={id:"",debug:!1,useWorkerManager:!0,show_library:!0,header:{show:!0,showmenu:!0},flow:{minimap:!0,static:!1,minZoom:.1,maxZoom:5,allowFullScreen:!0,allowExpand:!0},library:{show:!0}},$z=s.createContext(es(jz)),Bz=e=>{let t=A(e,{...jz,id:Pu()}).new_obj;if(!t.useWorkerManager&&void 0===t.worker)return s.createElement("div",null,"Error: If you don't use a worker manager, you must provide a default worker.");if(e.useWorkerManager&&void 0===e.workermanager_url)return s.createElement("div",null,"Error: If you use a worker manager, you must provide a worker manager url.");if(void 0===window.fnrf_zst&&(window.fnrf_zst=Fz),void 0===Fz[t.id]){const e=es(t);Fz[t.id]=e}if(t.worker&&t.worker.set_zustand(Fz[t.id]),Fz[t.id].options.debug=t.debug,t.useWorkerManager){const e=new Tu(t.workermanager_url,Fz[t.id]);Fz[t.id].workermanager=e}return s.createElement(zz,{fnrf_zst:Fz[t.id],header:t.header,library:t.library,flow:t.flow})},Vz=e=>{const t=new Ql("FuncNodes",e.debug?"debug":"info");t.debug("Initalizing FuncNodes with props:",e);let n=A(e,{...jz,id:Pu()}).new_obj;if(void 0===e.worker&&void 0!==e.worker_url&&(n.useWorkerManager=!1,n.worker=new Mu({url:e.worker_url,uuid:n.id,on_sync_complete:e.on_sync_complete})),void 0!==n.worker){const e=es(n);n.worker.set_zustand(e)}if(void 0!==e.fnw_url){if(void 0===n.worker)throw new Error("defining fnw_url requires a worker to be defined");const t=async function(e,t=!0){try{const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch from URL: ${n.status} ${n.statusText}`);const r=await n.blob();return await new Promise(((e,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;"string"!=typeof r&&(n("Failed to convert URL to Base64: No result from FileReader"),n(o.error)),e(t?r.split(",")[1]:r)},o.onerror=()=>n(o.error),o.readAsDataURL(r)}))}catch(e){throw console.error("Error converting URL to Base64:",e),e}}(e.fnw_url),r=n.worker.on_sync_complete,o=async e=>{const n=await t;e.on_sync_complete=r,await e.update_from_export(n)};n.worker.on_sync_complete=o}return t.debug("Initalizing FuncnodesReactFlow with props:",n),s.createElement("div",{className:"App",style:{height:"100%",width:"100%"}},s.createElement(Bz,{...n}))};var Hz,Uz,Wz,qz,Kz={exports:{}},Xz={},Yz={exports:{}},Gz={};function Qz(){return Uz||(Uz=1,Yz.exports=(Hz||(Hz=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>o(s,n))c<i&&0>o(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(s,o)}o=n(c)}}function w(e){if(m=!1,b(e),!h)if(null!==n(s))h=!0,R();else{var t=n(c);null!==t&&M(w,t.startTime-e)}}var x,k=!1,S=-1,E=5,_=-1;function C(){return!(e.unstable_now()-_<E)}function O(){if(k){var t=e.unstable_now();_=t;var o=!0;try{e:{h=!1,m&&(m=!1,y(S),S=-1),p=!0;var i=f;try{t:{for(b(t),d=n(s);null!==d&&!(d.expirationTime>t&&C());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var l=a(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){d.callback=l,b(t),o=!0;break t}d===n(s)&&r(s),b(t)}else r(s);d=n(s)}if(null!==d)o=!0;else{var u=n(c);null!==u&&M(w,u.startTime-t),o=!1}}break e}finally{d=null,f=i,p=!1}o=void 0}}finally{o?x():k=!1}}}if("function"==typeof v)x=function(){v(O)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,P=N.port2;N.port1.onmessage=O,x=function(){P.postMessage(null)}}else x=function(){g(O,0)};function R(){k||(k=!0,x())}function M(t,n){S=g((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,R())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:u++,callback:o,priorityLevel:r,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(r.sortIndex=i,t(c,r),null===n(s)&&r===n(c)&&(m?(y(S),S=-1):m=!0,M(w,i-a))):(r.sortIndex=l,t(s,r),h||p||(h=!0,R())),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(Gz)),Gz)),Yz.exports}
96
+ */var ML=function(){if(PL)return RL;PL=1;var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/\\([\u000b\u0020-\u00ff])/g,o=/([\\"])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){var r=String(e);if(n.test(r))return r;if(r.length>0&&!t.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(o,"\\$1")+'"'}function l(e){this.parameters=Object.create(null),this.type=e}return RL.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!i.test(r))throw new TypeError("invalid type");var o=r;if(t&&"object"==typeof t)for(var l,s=Object.keys(t).sort(),c=0;c<s.length;c++){if(l=s[c],!n.test(l))throw new TypeError("invalid parameter name");o+="; "+l+"="+a(t[l])}return o},RL.parse=function(t){if(!t)throw new TypeError("argument string is required");var n="object"==typeof t?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(t):t;if("string"!=typeof n)throw new TypeError("argument string is required to be a string");var o=n.indexOf(";"),a=-1!==o?n.slice(0,o).trim():n.trim();if(!i.test(a))throw new TypeError("invalid media type");var s=new l(a.toLowerCase());if(-1!==o){var c,u,d;for(e.lastIndex=o;u=e.exec(n);){if(u.index!==o)throw new TypeError("invalid parameter format");o+=u[0].length,c=u[1].toLowerCase(),34===(d=u[2]).charCodeAt(0)&&-1!==(d=d.slice(1,-1)).indexOf("\\")&&(d=d.replace(r,"$1")),s.parameters[c]=d}if(o!==n.length)throw new TypeError("invalid parameter format")}return s},RL}(),TL=new Map,AL=function(e){return e.cloneNode(!0)},DL=function(){return"file:"===window.location.protocol},IL=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=ML.parse(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(DL()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||DL()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(e){if(r.abort(),!(e instanceof Error))throw e;n(e,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},LL={},zL=function(e,t){LL[e]=LL[e]||[],LL[e].push(t)},FL=function(e,t,n){if(TL.has(e)){var r=TL.get(e);if(void 0===r)return void zL(e,n);if(r instanceof SVGSVGElement)return void n(null,AL(r))}TL.set(e,void 0),zL(e,n),IL(e,t,(function(t,n){var r;t?TL.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&TL.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(LL[e])){var n=TL.get(e),r=LL[e][t];n instanceof SVGSVGElement&&r(null,AL(n)),n instanceof Error&&r(n),t===LL[e].length-1&&delete LL[e]}}),0)},n=0,r=LL[e].length;n<r;n++)t(n)}(e)}))},jL=function(e,t,n){IL(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},$L=0,BL=[],VL={},HL="http://www.w3.org/1999/xlink",UL=function(e,t,n,r,o,i,a){var l=e.getAttribute("data-src")||e.getAttribute("src");if(l){if(-1!==BL.indexOf(e))return BL.splice(BL.indexOf(e),1),void(e=null);BL.push(e),e.setAttribute("src",""),(r?FL:jL)(l,o,(function(r,o){if(!o)return BL.splice(BL.indexOf(e),1),e=null,void a(r);var s=e.getAttribute("id");s&&o.setAttribute("id",s);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var f=Array.from(new Set(Pd(Pd(Pd([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",f);var p=e.getAttribute("style");p&&o.setAttribute("style",p),o.setAttribute("data-src",l);var h=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(h,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var m,g,y,v,b,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){m=e,y=w[e];for(var t=function(e,t){var n;v=g[e].id,b=v+"-"+ ++$L,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+v+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+v+'"?\\)'))||n[t].setAttribute(e,"url(#"+b+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,l=r.length;a<l;a++){var s=r[a].getAttributeNS(HL,"href");s&&s.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(HL,"href","#"+b);g[e].id=b},n=0,r=(g=o.querySelectorAll(m+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var x,k,S=o.querySelectorAll("script"),E=[],_=0,C=S.length;_<C;_++)(k=S[_].getAttribute("type"))&&"application/ecmascript"!==k&&"application/javascript"!==k&&"text/javascript"!==k||((x=S[_].innerText||S[_].textContent)&&E.push(x),o.removeChild(S[_]));if(E.length>0&&("always"===t||"once"===t&&!VL[l])){for(var O=0,N=E.length;O<N;O++)new Function(E[O])(window);VL[l]=!0}var P=o.querySelectorAll("style");if(Array.prototype.forEach.call(P,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",HL),i(o),!e.parentNode)return BL.splice(BL.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),BL.splice(BL.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},WL=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qL="http://www.w3.org/2000/svg",KL="http://www.w3.org/1999/xlink",XL=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}Kb(t,e);var n=t.prototype;return n.renderSVG=function(){var e=this;if(this.reactWrapper instanceof function(e){return((null==e?void 0:e.ownerDocument)||document).defaultView||window}(this.reactWrapper).Node){var t,n,r=this.props,o=r.desc,i=r.evalScripts,a=r.httpRequestWithCredentials,l=r.renumerateIRIElements,s=r.src,c=r.title,u=r.useRequestCache,d=this.props.onError,f=this.props.beforeInjection,p=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((t=document.createElementNS(qL,h)).setAttribute("xmlns",qL),t.setAttribute("xmlns:xlink",KL),n=document.createElementNS(qL,h)):(t=document.createElement(h),n=document.createElement(h)),t.appendChild(n),n.dataset.src=s,this.nonReactWrapper=this.reactWrapper.appendChild(t);var m=function(t){e.removeSVG(),e._isMounted?e.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){d(t)})):d(t)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,l=n.beforeEach,s=void 0===l?function(){}:l,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,f=void 0===d?"never":d,p=n.httpRequestWithCredentials,h=void 0!==p&&p,m=n.renumerateIRIElements,g=void 0===m||m;if(e&&"length"in e)for(var y=0,v=0,b=e.length;v<b;v++)UL(e[v],f,g,u,h,s,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?UL(e,f,g,u,h,s,(function(t,n){a(t,n),o(1),e=null})):o(0)}(n,{afterEach:function(t,n){t?m(t):e._isMounted&&e.setState((function(){return{isLoading:!1}}),(function(){try{p(n)}catch(e){m(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=o,e.prepend(n)}if(c){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var i=document.createElement("title");i.innerHTML=c,e.prepend(i)}try{f(e)}catch(e){m(e)}},cacheRequests:u,evalScripts:i,httpRequestWithCredentials:a,renumerateIRIElements:l})}},n.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(nm({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,o=Wb(e,WL),i=r;return s.createElement(i,nm({},o,{ref:this.refCallback},"svg"===r?{xmlns:qL,xmlnsXlink:KL}:{}),this.state.isLoading&&n&&s.createElement(n,null),this.state.hasError&&t&&s.createElement(t,null))},t}(s.Component);XL.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},XL.propTypes={afterInjection:Ap.func,beforeInjection:Ap.func,desc:Ap.string,evalScripts:Ap.oneOf(["always","once","never"]),fallback:Ap.oneOfType([Ap.func,Ap.object,Ap.string]),httpRequestWithCredentials:Ap.bool,loading:Ap.oneOfType([Ap.func,Ap.object,Ap.string]),onError:Ap.func,renumerateIRIElements:Ap.bool,src:Ap.string.isRequired,title:Ap.string,useRequestCache:Ap.bool,wrapper:Ap.oneOf(["div","span","svg"])};const YL=({value:e,renderoptions:t})=>(void 0===t&&(t={}),void 0===t.format&&(t.format="jpeg"),s.createElement("img",{src:"data:image/"+t.format+";base64, "+e,style:{maxWidth:"100%",maxHeight:"100%"}})),GL=({value:e})=>s.createElement(XL,{src:`data:image/svg+xml;base64,${btoa(e)}`,style:{maxWidth:"100%",maxHeight:"100%"},beforeInjection:e=>{e.classList.add("svg-class-name"),e.setAttribute("style","max-width: 100%; max-height: 100%;"),e.setAttribute("width","100%"),e.setAttribute("height","100%")}}),QL=({io:e})=>{let t=e.fullvalue;if(null==t&&(t=e.value),void 0===t&&(t=""),"string"!=typeof t||t.length%4!=0)return s.createElement("div",null,t);const n=Math.round(3*t.length/4);return s.createElement("div",null,s.createElement("pre",null,"Bytes(",n,")"))},ZL=({io:e})=>{let t=e.fullvalue;return void 0===t&&(t=e.value),void 0===t&&(t={}),s.createElement(OL,{data:t})},JL={float:({io:e,inputconverter:t})=>oL({io:e,inputconverter:t,parser:parseFloat}),int:({io:e,inputconverter:t})=>oL({io:e,inputconverter:t,parser:parseInt}),bool:({io:e,inputconverter:t})=>{const n=s.useContext($z),r=void 0===e.value,o=s.useRef(null);s.useEffect((()=>{o.current&&(o.current.indeterminate=r)}),[o,r]);return s.createElement("input",{ref:o,type:"checkbox",className:"styledcheckbox booleaninput",checked:!!t[1](e.value),onChange:r=>{let o=r.target.checked;try{o=t[0](r.target.checked)}catch(r){}n.worker?.set_io_value({nid:e.node,ioid:e.id,value:o,set_default:e.render_options.set_default})},disabled:e.connected})},string:iL,str:iL,color:({io:e})=>{const t=s.useContext($z),n=e.value_options?.colorspace||"hex";let r=!1;return"string"!=typeof e.type&&"anyOf"in e.type&&void 0!==e.type.anyOf&&(r=e.type.anyOf.some((e=>"None"===e))),s.createElement(oA,{onChange:r=>{let o="<NoValue>";r&&(o=r[n]?r[n]():r.hex()),null===r&&(o=null),t.worker?.set_io_value({nid:e.node,ioid:e.id,value:o,set_default:e.render_options.set_default})},inicolordata:e.value,allow_null:r,inicolorspace:n})},select:uL,enum:uL,bytes:QL},ez={Inputrenderer:JL,Outputrenderer:{},HandlePreviewRenderer:{bytes:QL},DataOverlayRenderer:{},DataPreviewViewRenderer:{string:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n"),s.createElement("div",null,s.createElement("pre",null,t))},table:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=[]),s.createElement(NL,{tabledata:t})},image:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),s.createElement(YL,{value:t})},svg:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),s.createElement(GL,{value:t})},dict:ZL,bytes:QL},DataViewRenderer:{},InLineRenderer:{bytes:({io:e})=>{let t=e.fullvalue;null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n");return`Bytes(${Math.round(3*t.length/4)})`}}},tz=(e,t)=>{const n=t.options||{},r=void 0===n.overwrite||n.overwrite;switch(t.type){case"EXTEND_INPUT_RENDER":return!r&&e.Inputrenderer[t.payload.type]?e:{...e,Inputrenderer:{...e.Inputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_OUTPUT_RENDER":return!r&&e.Outputrenderer[t.payload.type]?e:{...e,Outputrenderer:{...e.Outputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_HANDLE_PREVIEW_RENDER":return!r&&e.HandlePreviewRenderer[t.payload.type]?e:{...e,HandlePreviewRenderer:{...e.HandlePreviewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_OVERLAY_RENDER":return!r&&e.DataOverlayRenderer[t.payload.type]?e:{...e,DataOverlayRenderer:{...e.DataOverlayRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_PREVIEW_RENDER":return!r&&e.DataPreviewViewRenderer[t.payload.type]?e:{...e,DataPreviewViewRenderer:{...e.DataPreviewViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_VIEW_RENDER":return!r&&e.DataViewRenderer[t.payload.type]?e:{...e,DataViewRenderer:{...e.DataViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_FROM_PLUGIN":let n=!1;const o=[[t.payload.plugin.input_renderers||{},e.Inputrenderer],[t.payload.plugin.output_renderers||{},e.Outputrenderer],[t.payload.plugin.handle_preview_renderers||{},e.HandlePreviewRenderer],[t.payload.plugin.data_overlay_renderers||{},e.DataOverlayRenderer],[t.payload.plugin.data_preview_renderers||{},e.DataPreviewViewRenderer],[t.payload.plugin.data_view_renderers||{},e.DataViewRenderer]];for(const[e,t]of o){if(Object.keys(e).length>0)if(r)n=!0;else for(const r in e)if(!t[r]){n=!0;break}if(n)break}if(!n)return e;for(const[e,t]of o)for(const n in e)!r&&t[n]||(t[n]=e[n]);return{...e};default:return e}},nz=({children:e,plugins:t,fnrf_zst:n})=>{const[r,o]=s.useReducer(tz,ez),i=(e,t)=>{o({type:"EXTEND_FROM_PLUGIN",payload:{plugin:e},options:t})};return s.useEffect((()=>{for(const e in t){const r=t[e].RendererPlugin;r&&i(r);const o=t[e].renderpluginfactory;o&&i(o({React:u,fnrf_zst:n}))}}),[t]),s.createElement(rz.Provider,{value:{Inputrenderer:r.Inputrenderer,Outputrenderer:r.Outputrenderer,HandlePreviewRenderer:r.HandlePreviewRenderer,DataOverlayRenderer:r.DataOverlayRenderer,DataPreviewViewRenderer:r.DataPreviewViewRenderer,DataViewRenderer:r.DataViewRenderer,InLineRenderer:r.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{o({type:"EXTEND_INPUT_RENDER",payload:{type:e,component:t},options:n})},extendOutputRenderMapping:(e,t,n)=>{o({type:"EXTEND_OUTPUT_RENDER",payload:{type:e,component:t},options:n})},extendHandlePreviewRenderMapping:(e,t,n)=>{o({type:"EXTEND_HANDLE_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataOverlayRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_OVERLAY_RENDER",payload:{type:e,component:t},options:n})},extendDataPreviewRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataViewRenderMapping:(e,t,n)=>{o({type:"EXTEND_DATA_VIEW_RENDER",payload:{type:e,component:t},options:n})},extendFromPlugin:i}},e)},rz=s.createContext({Inputrenderer:ez.Inputrenderer,Outputrenderer:ez.Outputrenderer,HandlePreviewRenderer:ez.HandlePreviewRenderer,DataOverlayRenderer:ez.DataOverlayRenderer,DataPreviewViewRenderer:ez.DataPreviewViewRenderer,DataViewRenderer:ez.DataViewRenderer,InLineRenderer:ez.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{},extendOutputRenderMapping:(e,t,n)=>{},extendHandlePreviewRenderMapping:(e,t,n)=>{},extendDataOverlayRenderMapping:(e,t,n)=>{},extendDataPreviewRenderMapping:(e,t,n)=>{},extendDataViewRenderMapping:(e,t,n)=>{},extendFromPlugin:(e,t)=>{}}),oz=({component:e,...t})=>s.createElement(e,{...t}),iz=e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{});if(!n)return ZL;const{DataOverlayRenderer:r,DataPreviewViewRenderer:o}=s.useContext(rz);return r[n]?r[n]:o[n]?o[n]:ZL},az=(e,t)=>{if("string"==typeof e)return e in t?[t[e],e]:[e,e];if("allOf"in e&&void 0!==e.allOf)return[void 0,void 0];if("anyOf"in e&&void 0!==e.anyOf){const n=e.anyOf.map((e=>az(e,t)));for(const e of n)switch(e[0]){case"bool":return["bool",e[1]];case"enum":return["enum",e[1]];case"float":return["float",e[1]];case"int":return["int",e[1]];case"string":case"str":return["string",e[1]]}return[void 0,void 0]}return"type"in e&&void 0!==e.type&&"enum"===e.type?["enum","enum"]:[void 0,void 0]},lz=({io:e,typestring:t,preview:n,...r})=>{const[o,i]=s.useState(!1),[a,l]=s.useState(!1),[c,u]=e?(e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),{HandlePreviewRenderer:r,DataPreviewViewRenderer:o}=s.useContext(rz),i=iz(e);return n?r[n]?[r[n],i]:o[n]?[o[n],i]:[ZL,i]:[ZL,i]})(e):[void 0,void 0];return s.createElement(pT,null,s.createElement(hT,{open:o||a,onOpenChange:l},s.createElement(mT,{asChild:!0},s.createElement(pi,{id:e.id,"data-type":t,...r})),s.createElement(gT,null,s.createElement(yT,{className:"iotooltipcontent",sideOffset:5},s.createElement("div",{className:"iotooltip_container"},s.createElement("div",{className:"iotooltip_header"},o?s.createElement(ub,{onClick:()=>i(!1)}):s.createElement(cb,{onClick:()=>i(!0)}),u&&s.createElement(_w,{title:e.full_id,trigger:s.createElement(db,null),onOpenChange:t=>{t&&e.try_get_full_value&&e.try_get_full_value(),i(t)}},s.createElement(oz,{component:u,io:e}))),c?s.createElement(oz,{component:c,io:e}):`no preview available for "${t}"`),s.createElement(vT,{className:"iotooltipcontentarrow"})))))},sz={"":[e=>e,e=>e],str_to_json:[e=>JSON.parse(e),e=>"string"==typeof e?e:JSON.stringify(e)],str_to_list:[e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch(t){try{return JSON.parse("["+e+"]")}catch(e){}}throw new Error("Invalid list")},e=>JSON.stringify(e)]},cz=({io:e})=>{const t=s.useContext($z).render_options(),[n,r]=az(e.render_options.type,t.typemap||{}),{Inputrenderer:o}=s.useContext(rz),i=n?e.value_options?.options?uL:o[n]:void 0,a=sz[(r&&t.inputconverter?.[r])??""];return s.createElement("div",{className:"nodeinput","data-type":n},s.createElement(lz,{io:e,typestring:n,position:Po.Left,type:"target"}),i&&s.createElement("div",{className:"iovaluefield nodrag","data-type":n},s.createElement(i,{io:e,inputconverter:a})),s.createElement("div",{className:"ioname"},e.name),s.createElement(lz,{io:e,typestring:n,position:Po.Right,type:"source"}))},uz=({io:e,typestring:t})=>{const{InLineRenderer:n}=s.useContext(rz);if(t&&n[t])return s.createElement("div",null,n[t]({io:e}));let r=e.fullvalue;return null==r&&(r=e.value),r=void 0===r?"":JSON.stringify(r).replace(/\\n/g,"\n"),r.length>63&&(r=r.slice(0,60)+"..."),s.createElement("div",null,r)},dz=({io:e})=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),{Outputrenderer:r}=s.useContext(rz),o=n?r[n]:void 0;return s.createElement("div",{className:"nodeoutput","data-type":n},s.createElement(lz,{io:e,typestring:n,position:Po.Right,type:"source"}),s.createElement("div",{className:"ioname"},e.name),o?s.createElement("div",{className:"iovaluefield nodrag"},s.createElement(o,{io:e})):s.createElement("div",{className:"iovaluefield"},s.createElement(uz,{io:e,typestring:n})))};function fz(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function pz(e,t){const n=["","K","M","G","T"];let r=0;for(;e>=t&&r<n.length-1;)e/=t,r++;return[e.toFixed(2),n[r]]}const hz=({state:e,className:t="reacttqdm",...n})=>{const r=s.useRef(null),o=s.useRef(null);s.useEffect((()=>{const e=()=>{r.current&&o.current&&function(e,t,n={}){const{maxFontSize:r=100,minFontSize:o=6,decrementFactor:i=.9}=n;if(!e||!t)return;if(i>=1||i<=0)throw new Error("decrementFactor must be between 0 and 1");const a=e.getBoundingClientRect(),l=a.width,s=a.height;let c=r;t.style.whiteSpace="nowrap",t.style.display="inline-block",t.style.fontSize=c+"px";let u=t.getBoundingClientRect();for(;(u.width>l||u.height>s)&&c>o;)c*=i,t.style.fontSize=c+"px",u=t.getBoundingClientRect()}(r.current,o.current,{maxFontSize:12,decrementFactor:.9})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[e]);const i=e.total?e.n/e.total*100:0;return s.createElement("div",{ref:r,className:t,...n},s.createElement("div",{style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},s.createElement("div",{className:t+"-bar",style:{position:"absolute",width:"100%",height:"100%",overflow:"hidden"}},s.createElement("div",{className:t+"-progress",style:{width:`${i}%`,height:"100%"}})),s.createElement("div",{className:t+"-text",ref:o},function(e={n:0,elapsed:0,ascii:!1,unit:"it",unit_scale:!1,unit_divisor:1e3}){let t=e.total??null;const{n:n,unit_scale:r,elapsed:o,unit:i,unit_divisor:a,prefix:l="",rate:s,postfix:c=null,initial:u=0}=e;null!==t&&n>=t+.5&&(t=null);let d=n,f=t,p=s;r&&!0!==r&&1!==r&&(null!==t&&(f=t*r),d=n*r,void 0!==s&&(p=s*r));const h=fz(o);void 0===p&&o>0&&(p=(d-u)/o);const m=p?1/p:void 0,[g,y]=p?pz(p,a):[void 0,""],[v,b]=m?pz(m,1e3):[void 0,""],w=m&&m>1?v?`${v}${b}s/`+i:"?":(g||"?")+`${y}${i}/s`,x=r?pz(d,a).join(""):d.toString(),k=r&&null!==f?pz(f,a).join(""):f?.toString()??"?",S=p?fz(p&&null!==f?(f-d)/p:0):"?",E=l?`${l}: `:"";if(null!==t){const e=` ${x}/${k} [${h} < ${S}, ${w}${c??""}]`;return`${E}${(d/t*100).toFixed(0)}%${e}`}return`${E}${x}${i} [${h}, ${w}${c??""}]`}(e))))},mz=({node_data:e})=>{const t=s.useContext($z);return s.createElement("div",{className:"nodeheader",title:e.description||e.node_name},s.createElement("div",{className:"nodeheader_element"},s.createElement(hb,{fontSize:"inherit",className:"triggerbutton",onClick:()=>{t.on_node_action({type:"trigger",from_remote:!1,id:e.id})}}),s.createElement(pb,{fontSize:"inherit",onClick:async()=>{t.logger.info("nodestatus",await(t.worker?.get_node_status(e.id)))}})),s.createElement("div",{className:"nodeheader_element nodeheader_title"},s.createElement("div",{className:"nodeheader_title_text"},e.node_name)),s.createElement("div",{className:"nodeheader_element"},s.createElement(fb,{fontSize:"inherit"})))},gz=({node_data:e})=>{const t=e.render_options?.data?.src?e.io[e.render_options?.data?.src]:void 0,[n,r]=t?(e=>{const t=s.useContext($z).render_options(),[n]=az(e.type,t.typemap||{}),r=iz(e),{DataPreviewViewRenderer:o,DataViewRenderer:i}=s.useContext(rz);return n?i[n]?[i[n],r]:o[n]?[o[n],r]:[ZL,r]:[ZL,r]})(t):[void 0,void 0];return s.createElement("div",{className:"nodrag nodedatabody"},n&&t&&s.createElement(_w,{title:t.full_id,trigger:s.createElement("div",null,s.createElement(oz,{component:n,io:t})),onOpenChange:e=>{e&&t?.try_get_full_value&&t?.try_get_full_value()}},s.createElement(oz,{component:r,io:t})))},yz=({node_data:e})=>{const t=Object.values(e.io).filter((e=>e.is_input)),n=Object.values(e.io).filter((e=>!e.is_input));return e.render_options,s.createElement("div",{className:"nodebody"},n.map((e=>e.hidden?null:s.createElement(dz,{key:e.id,io:e}))),s.createElement(gz,{node_data:e}),t.map((e=>e.hidden?null:s.createElement(cz,{key:e.id,io:e}))))},vz=({node_data:e})=>{const[t,n]=s.useState(e.name);s.useEffect((()=>{n(e.name)}),[e]);const r=s.useContext($z);return s.createElement("input",{className:"nodename_input",value:t,onChange:e=>{n(e.target.value)},onBlur:t=>{const n=t.target.value;r.on_node_action({type:"update",from_remote:!1,id:e.id,node:{name:n}})}})},bz=({node_data:e})=>e.progress?s.createElement(hz,{style:{height:"idle"===e.progress.prefix?"0px":void 0},state:e.progress,className:"nodeprogress"}):null,wz=({node_data:e})=>s.createElement("div",{className:"nodefooter"},e.error&&s.createElement("div",{className:"nodeerror"},e.error),s.createElement(bz,{node_data:e})),xz=({io:e})=>{const t=s.useContext($z).render_options(),[n,r]=az(e.render_options.type,t.typemap||{}),{Inputrenderer:o}=s.useContext(rz),i=n?e.value_options?.options?uL:o[n]:void 0,a=sz[(r&&t.inputconverter?.[r])??""];return s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,e.name),i&&s.createElement(i,{io:e,inputconverter:a}),s.createElement("div",null,s.createElement("label",null,"hidden:",s.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden}))))},kz=({io:e})=>s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,e.name),s.createElement("div",null,s.createElement("label",null,"hidden:",s.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden})))),Sz=({nodestore:e})=>{const t=e(),n=Object.values(t.io).filter((e=>e.is_input)),r=Object.values(t.io).filter((e=>!e.is_input));return s.createElement("div",null,s.createElement("div",{className:"nodesettings_section"},s.createElement("div",{className:"nodesettings_component"},s.createElement("div",null,"Name"),s.createElement("div",null,s.createElement(vz,{node_data:t})))),s.createElement("div",{className:"nodesettings_section"},s.createElement("div",null,"Inputs"),n.map((e=>s.createElement(xz,{io:e,key:e.id})))),s.createElement("div",{className:"nodesettings_section"},s.createElement("div",null,"Outputs"),r.map((e=>s.createElement(kz,{io:e,key:e.id})))))},Ez=()=>{const e=s.useContext($z),t=e.local_state((e=>e.selected_nodes));if(0===t.length)return s.createElement("div",null,"Node Settings");if(t.length>1)return s.createElement("div",null,"Multiple Nodes Selected");const n=e.nodespace.get_node(t[0]);return n?s.createElement(Sz,{nodestore:n}):s.createElement("div",null,"Node not found")},_z=()=>{const e=s.useContext($z),t=e.local_settings((e=>e.view_settings.expand_node_props)),n=e.local_settings((e=>e.update_view_settings)),r=e=>{n({expand_node_props:e})};return s.createElement("div",{className:"nodesettings_container"},s.createElement("div",{className:"nodesettings_expander"},t?s.createElement(sb,{onClick:()=>{r(!1)}}):s.createElement(mb,{onClick:()=>{r(!0)}})),s.createElement("div",{className:"nodesettings_content "+(t?"expanded":"collapsed")},t&&s.createElement(Ez,null)))},Cz=e=>({nodes:e.nodes,edges:e.edges,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect}),Oz={default:({data:e})=>{const t=e.UseNodeStore(),n=t.frontend.collapsed||!1,[r,o]=s.useState(!1);return s.useEffect((()=>{let e;return t.in_trigger?o(!0):r&&(e=setTimeout((()=>o(!1)),200)),()=>clearTimeout(e)}),[t.in_trigger,r]),s.createElement(s.Fragment,null,s.createElement("div",{className:"innernode"+(r?" intrigger":"")+(t.error?" error":"")},s.createElement(mz,{node_data:t}),s.createElement(vz,{node_data:t}),n?null:s.createElement(yz,{node_data:t}),s.createElement(wz,{node_data:t})))}},Nz={default:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:a,data:l,...c})=>{const[u]=Vo({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return s.createElement(s.Fragment,null,s.createElement(wo,{id:e,path:u,...c}))}},Pz=()=>{const e=Qi();return s.useContext($z).rf_instance=e,s.createElement(s.Fragment,null)},Rz=()=>{const e=s.useContext($z),t=Fi("Delete"),n=Yr(Cl,q),r=Yr(_l,q);if(t){for(const t of n)if(t.selected){if(!e.worker)return s.createElement(s.Fragment,null);if(!t.source||!t.target)return s.createElement(s.Fragment,null);if(!t.sourceHandle||!t.targetHandle)return s.createElement(s.Fragment,null);e.worker.remove_edge({src_nid:t.source,src_ioid:t.sourceHandle,trg_nid:t.target,trg_ioid:t.targetHandle})}for(const t of r)if(t.selected){if(!e.worker)return s.createElement(s.Fragment,null);e.worker.remove_node(t.id)}}return s.createElement(s.Fragment,null)},Mz=({id:e,top:t,left:n,right:r,bottom:o,...i})=>{const{getNode:a,setNodes:l,addNodes:c,setEdges:u}=Qi(),d=s.useContext($z),f=s.useCallback((()=>{const t=a(e);if(!t)return;const n={x:t.position.x+50,y:t.position.y+50};c({...t,id:`${t.id}-copy`,position:n})}),[e,a,c]),p=s.useCallback((()=>{d.on_node_action({type:"delete",id:e,from_remote:!1})}),[e,l,u]),h=d.nodespace.get_node(e,!1);if(!h)return s.createElement(s.Fragment,null," ");const m=h();return s.createElement("div",{style:{top:t,left:n,right:r,bottom:o},className:"context-menu",...i},s.createElement("p",{style:{fontWeight:"bold"}},s.createElement("small",null,m.name)),s.createElement("button",{onClick:f},"duplicate"),s.createElement("button",{onClick:p},"delete"))},Tz=e=>{const t=s.useContext($z),n=s.useRef(null);s.useEffect((()=>{t.reactflowRef=n.current}),[n]);const[r,o]=s.useState(null),i=s.useCallback((()=>o(null)),[o]),{nodes:a,edges:l,onNodesChange:c,onEdgesChange:u,onConnect:d}=t.useReactFlowStore(zM(Cz));return s.createElement("div",{className:"reactflowlayer"},s.createElement(El,{nodes:a,edges:l,onNodesChange:c,onEdgesChange:u,onConnect:d,nodeTypes:Oz,edgeTypes:Nz,minZoom:e.minZoom,maxZoom:e.maxZoom,fitView:!0,onSelectionChange:({nodes:e,edges:n})=>{const r=t.local_state.getState();t.local_state.setState({...r,selected_nodes:e.map((e=>e.id)),selected_edges:n.map((e=>e.id))})},ref:n,onPaneClick:i,panOnDrag:!e.static},s.createElement(Pz,null),s.createElement(Rz,null),s.createElement(Hl,{color:"#888",gap:16,size:1}),e.minimap&&s.createElement(Ll,{nodeStrokeWidth:3,pannable:!e.static,zoomable:!e.static,zoomStep:3}),r&&s.createElement(Mz,{onClick:i,...r})))},Az=s.createContext(void 0),Dz=s.forwardRef(((e,t)=>{const{asChild:n,children:r,className:o,style:i,...a}=e,[l,c]=s.useState(!1),u=s.useRef(null),[d,f]=s.useState(null),[p,h]=s.useState({}),m=e.htime||300,g=e.vtime||300,y=e.hdelay||0,v=e.vdelay||200;s.useImperativeHandle(t,(()=>u.current),[]);let b;if(n&&s.isValidElement(r)){const e=r,t=[e.props.className,o,"smooth-expand",l?"smooth-expand-expanded":""].filter(Boolean).join(" "),n={...e.props.style,...i,...p};b=s.cloneElement(e,{ref:u,className:t,style:n,...a})}else b=s.createElement("div",{ref:u,...a,className:`smooth-expand ${l?"smooth-expand-expanded":""} ${o||""}`,style:{...i,...p}},r);const w=s.createElement(Az.Provider,{value:{isExpanded:l,toggleExpand:async()=>{u.current&&(l?await(async()=>{if(!u.current)return;if(!d)return;const e={transitionProperty:"width, left, height, top",transitionDuration:`${m}ms, ${m}ms, ${g}ms, ${g}ms`};h((t=>({...t,...e})));const[t,n,r,o]=d,i=new Promise((e=>{setTimeout((()=>{h((e=>({...e,left:`${t}px`,width:`${r}px`}))),e()}),v)})),a=new Promise((e=>{setTimeout((()=>{h((e=>({...e,top:`${n}px`,height:`${o}px`}))),e()}),y)})),l=Math.max(m+y,g+v),s=new Promise((e=>{setTimeout((()=>{e()}),l)}));await Promise.all([i,a,s]),u.current.style.transition="",h({}),c(!1)})():await(async()=>{if(!u.current)return;u.current.style.transition="none",u.current.style.position="",u.current.style.top="",u.current.style.left="",u.current.style.width="",u.current.style.height="";const e=u.current.getBoundingClientRect();f([e.left,e.top,e.width,e.height]),u.current.style.transition="none",h({position:"absolute",top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`}),h((e=>({...e,transitionProperty:"width, left, height, top",transitionDuration:`${m}ms, ${m}ms, ${g}ms, ${g}ms`}))),c(!0);const t=new Promise((e=>{setTimeout((()=>{h((e=>({...e,left:"0px",width:"100vw"}))),e()}),y)})),n=new Promise((e=>{setTimeout((()=>{h((e=>({...e,top:"0px",height:"100vh"}))),e()}),v)})),r=Math.max(m+y,g+v),o=new Promise((e=>{setTimeout((()=>{e()}),r)}));await Promise.all([t,n,o])})())}}},b);return l?Lr.createPortal(w,document.body):w}));Dz.Trigger=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Trigger must be used within a SmoothExpandComponent");return s.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleExpand},e)},Dz.Expanded=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Expanded must be used within a SmoothExpandComponent");return t.isExpanded?s.createElement(s.Fragment,null,e):null},Dz.Collapsed=function({children:e}){const t=s.useContext(Az);if(!t)throw new Error("SmoothExpandComponent.Collapsed must be used within a SmoothExpandComponent");return t.isExpanded?null:s.createElement(s.Fragment,null,e)};const Iz=s.createContext(void 0),Lz=s.forwardRef(((e,t)=>{const{asChild:n,children:r,className:o,style:i,...a}=e,l=s.useRef(null);s.useImperativeHandle(t,(()=>l.current),[]);const[c,u]=s.useState(!1),d=s.useCallback((async()=>{try{const e=l.current;if(!e)return;if(c){const e=document;e.exitFullscreen?await e.exitFullscreen():e.mozCancelFullScreen?await e.mozCancelFullScreen():e.webkitExitFullscreen?await e.webkitExitFullscreen():e.msExitFullscreen&&await e.msExitFullscreen(),u(!1)}else e.requestFullscreen?await e.requestFullscreen():e.mozRequestFullScreen?await e.mozRequestFullScreen():e.webkitRequestFullscreen?await e.webkitRequestFullscreen():e.msRequestFullscreen&&await e.msRequestFullscreen(),u(!0)}catch(e){console.error("Error toggling fullscreen",e)}}),[c]);let f;if(s.useEffect((()=>{const e=()=>{const e=document.fullscreenElement;u(!!e)};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[]),n&&s.isValidElement(r)){const e=r,t=[e.props.className,o].filter(Boolean).join(" "),n={...e.props.style,...i};f=s.cloneElement(e,{ref:l,className:t,style:n,...a})}else f=s.createElement("div",{ref:l,...a,className:o,style:i},r);return s.createElement(Iz.Provider,{value:{isFullScreen:c,toggleFullscreen:d}},f)}));Lz.Trigger=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Trigger must be used within a FullScreenComponent");return s.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleFullscreen},e)},Lz.InFullScreen=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Expanded must be used within a FullScreenComponent");return t.isFullScreen?s.createElement(s.Fragment,null,e):null},Lz.OutFullScreen=function({children:e}){const t=s.useContext(Iz);if(!t)throw new Error("FullScreenComponent.Collapsed must be used within a FullScreenComponent");return t.isFullScreen?null:s.createElement(s.Fragment,null,e)};const zz=({fnrf_zst:e,header:t,flow:n,library:r})=>{const[o,i]=s.useState(e.options.worker);e.workermanager&&(e.workermanager.on_setWorker=i),e.set_worker(o),e.auto_progress();const a=e.plugins();return s.createElement(nz,{plugins:a,fnrf_zst:e},s.createElement($z.Provider,{value:e},s.createElement(Dz,{asChild:!0},s.createElement(Lz,{asChild:!0},s.createElement("div",{className:"funcnodesreactflowcontainer funcnodescontainer"},t.show&&s.createElement(ZE,{...t}),s.createElement("div",{className:"funcnodesreactflowbody"},o&&r.show&&s.createElement(IM,null),s.createElement(Tz,{...n}),o&&n.showNodeSettings&&s.createElement(_z,null)),s.createElement("div",{className:"funcnodesflaotingmenu"},s.createElement(Lz.OutFullScreen,null,n.allowExpand&&s.createElement(Dz.Trigger,null,s.createElement(Dz.Expanded,null,s.createElement(Sw,null)),s.createElement(Dz.Collapsed,null,s.createElement(Ew,null)))),n.allowFullScreen&&s.createElement(Lz.Trigger,null,s.createElement(Lz.OutFullScreen,null,s.createElement(db,null)),s.createElement(Lz.InFullScreen,null,s.createElement(kw,null)))))))))},Fz={},jz={id:"",debug:!1,useWorkerManager:!0,show_library:!0,header:{show:!0,showmenu:!0},flow:{minimap:!0,static:!1,minZoom:.1,maxZoom:5,allowFullScreen:!0,allowExpand:!0,showNodeSettings:!0},library:{show:!0}},$z=s.createContext(es(jz)),Bz=e=>{let t=A(e,{...jz,id:Pu()}).new_obj;if(!t.useWorkerManager&&void 0===t.worker)return s.createElement("div",null,"Error: If you don't use a worker manager, you must provide a default worker.");if(e.useWorkerManager&&void 0===e.workermanager_url)return s.createElement("div",null,"Error: If you use a worker manager, you must provide a worker manager url.");if(void 0===window.fnrf_zst&&(window.fnrf_zst=Fz),void 0===Fz[t.id]){const e=es(t);Fz[t.id]=e}if(t.worker&&t.worker.set_zustand(Fz[t.id]),Fz[t.id].options.debug=t.debug,t.useWorkerManager){const e=new Tu(t.workermanager_url,Fz[t.id]);Fz[t.id].workermanager=e}return s.createElement(zz,{fnrf_zst:Fz[t.id],header:t.header,library:t.library,flow:t.flow})},Vz=e=>{const t=new Ql("FuncNodes",e.debug?"debug":"info");t.debug("Initalizing FuncNodes with props:",e);let n=A(e,{...jz,id:Pu()}).new_obj;if(void 0===e.worker&&void 0!==e.worker_url&&(n.useWorkerManager=!1,n.worker=new Mu({url:e.worker_url,uuid:n.id,on_sync_complete:n.on_sync_complete})),void 0!==n.worker){const e=es(n);n.worker.set_zustand(e)}if(void 0!==e.fnw_url){if(void 0===n.worker)throw new Error("defining fnw_url requires a worker to be defined");const t=async function(e,t=!0){try{const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch from URL: ${n.status} ${n.statusText}`);const r=await n.blob();return await new Promise(((e,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;"string"!=typeof r&&(n("Failed to convert URL to Base64: No result from FileReader"),n(o.error)),e(t?r.split(",")[1]:r)},o.onerror=()=>n(o.error),o.readAsDataURL(r)}))}catch(e){throw console.error("Error converting URL to Base64:",e),e}}(e.fnw_url),r=n.worker.on_sync_complete,o=async e=>{const n=await t;e.on_sync_complete=r,await e.update_from_export(n)};n.worker.on_sync_complete=o}return t.debug("Initalizing FuncnodesReactFlow with props:",n),s.createElement("div",{className:"App",style:{height:"100%",width:"100%"}},s.createElement(Bz,{...n}))};var Hz,Uz,Wz,qz,Kz={exports:{}},Xz={},Yz={exports:{}},Gz={};function Qz(){return Uz||(Uz=1,Yz.exports=(Hz||(Hz=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>o(s,n))c<i&&0>o(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(s,o)}o=n(c)}}function w(e){if(m=!1,b(e),!h)if(null!==n(s))h=!0,R();else{var t=n(c);null!==t&&M(w,t.startTime-e)}}var x,k=!1,S=-1,E=5,_=-1;function C(){return!(e.unstable_now()-_<E)}function O(){if(k){var t=e.unstable_now();_=t;var o=!0;try{e:{h=!1,m&&(m=!1,y(S),S=-1),p=!0;var i=f;try{t:{for(b(t),d=n(s);null!==d&&!(d.expirationTime>t&&C());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var l=a(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){d.callback=l,b(t),o=!0;break t}d===n(s)&&r(s),b(t)}else r(s);d=n(s)}if(null!==d)o=!0;else{var u=n(c);null!==u&&M(w,u.startTime-t),o=!1}}break e}finally{d=null,f=i,p=!1}o=void 0}}finally{o?x():k=!1}}}if("function"==typeof v)x=function(){v(O)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,P=N.port2;N.port1.onmessage=O,x=function(){P.postMessage(null)}}else x=function(){g(O,0)};function R(){k||(k=!0,x())}function M(t,n){S=g((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,R())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:u++,callback:o,priorityLevel:r,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(r.sortIndex=i,t(c,r),null===n(s)&&r===n(c)&&(m?(y(S),S=-1):m=!0,M(w,i-a))):(r.sortIndex=l,t(s,r),h||p||(h=!0,R())),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(Gz)),Gz)),Yz.exports}
97
97
  /**
98
98
  * @license React
99
99
  * react-dom-client.production.js