@owox/web 0.29.0-next-20260709112013 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,45 @@
1
- var to=Object.defineProperty;var no=(e,t,n)=>t in e?to(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var X=(e,t,n)=>no(e,typeof t!="symbol"?t+"":t,n);import{c as ln,g as ro,t as Ee,r as g,a as Le,R as On,j as z,B as Xe,M as io,b as oo,h as ao,d as so,C as uo,N as co,I as lo,E as fo,e as po}from"./index-NJ-LhnFM.js";/**
1
+ var ro=Object.defineProperty;var io=(e,t,n)=>t in e?ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>io(e,typeof t!="symbol"?t+"":t,n);import{c as ln,g as oo,t as Ee,r as g,a as Le,R as On,j as z,B as Ue,M as ao,b as so,h as uo,d as co,C as lo,N as fo,I as po,E as ho,e as vo}from"./index-dfv6qWu-.js";/**
2
2
  * @license lucide-react v0.475.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const ho=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}]],vo=ln("Locate",ho);/**
6
+ */const mo=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}]],yo=ln("Locate",mo);/**
7
7
  * @license lucide-react v0.475.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const mo=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],yo=ln("ZoomIn",mo);/**
11
+ */const go=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],bo=ln("ZoomIn",go);/**
12
12
  * @license lucide-react v0.475.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const go=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],bo=ln("ZoomOut",go);function Sn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function T(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(u){Sn(o,r,i,a,s,"next",u)}function s(u){Sn(o,r,i,a,s,"throw",u)}a(void 0)})}}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function wo(e,t){if(ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e){var t=wo(e,"string");return ie(t)=="symbol"?t:t+""}function ko(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lr(r.key),r)}}function F(e,t,n){return t&&ko(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){if(t&&(ie(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xo(e)}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},W(e)}function Vt(e,t){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Vt(e,t)}function oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}function $(e,t,n){return(t=Lr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xt={exports:{}},Ot={exports:{}},Cn;function Br(){return Cn||(Cn=1,(function(e){function t(n,r){this.v=n,this.k=r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ot)),Ot.exports}var St={exports:{}},Ct={exports:{}},Pn;function Fr(){return Pn||(Pn=1,(function(e){function t(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}e.exports=t=function(u,c,l,f){function d(p,h){t(u,p,function(y){return this._invoke(p,h,y)})}c?a?a(u,c,{value:l,enumerable:!f,configurable:!f,writable:!f}):u[c]=l:(d("next",0),d("throw",1),d("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ct)),Ct.exports}var $n;function Hr(){return $n||($n=1,(function(e){var t=Fr();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,i,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(m,k,v,w){var E=k&&k.prototype instanceof l?k:l,j=Object.create(E.prototype);return t(j,"_invoke",(function(R,P,_){var A,I,D,V=0,L=_||[],K=!1,Y={p:0,n:0,v:r,a:se,f:se.bind(r,4),d:function(b,x){return A=b,I=0,D=r,Y.n=x,c}};function se(Q,b){for(I=Q,D=b,i=0;!K&&V&&!x&&i<L.length;i++){var x,O=L[i],C=Y.p,M=O[2];Q>3?(x=M===b)&&(D=O[(I=O[4])?5:(I=3,3)],O[4]=O[5]=r):O[0]<=C&&((x=Q<2&&C<O[1])?(I=0,Y.v=b,Y.n=O[1]):C<M&&(x=Q<3||O[0]>b||b>M)&&(O[4]=Q,O[5]=b,Y.n=M,I=0))}if(x||Q>1)return c;throw K=!0,b}return function(Q,b,x){if(V>1)throw TypeError("Generator is already running");for(K&&b===1&&se(b,x),I=b,D=x;(i=I<2?r:D)||!K;){A||(I?I<3?(I>1&&(Y.n=-1),se(I,D)):Y.n=D:Y.v=D);try{if(V=2,A){if(I||(Q="next"),i=A[Q]){if(!(i=i.call(A,D)))throw TypeError("iterator result is not an object");if(!i.done)return i;D=i.value,I<2&&(I=0)}else I===1&&(i=A.return)&&i.call(A),I<2&&(D=TypeError("The iterator does not provide a '"+Q+"' method"),I=1);A=r}else if((i=(K=Y.n<0)?D:R.call(P,Y))!==c)break}catch(O){A=r,I=1,D=O}finally{V=1}}return{value:i,done:K}}})(m,v,w),!0),j}var c={};function l(){}function f(){}function d(){}i=Object.getPrototypeOf;var p=[][a]?i(i([][a]())):(t(i={},a,function(){return this}),i),h=d.prototype=l.prototype=Object.create(p);function y(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,d):(m.__proto__=d,t(m,s,"GeneratorFunction")),m.prototype=Object.create(h),m}return f.prototype=d,t(h,"constructor",d),t(d,"constructor",f),f.displayName="GeneratorFunction",t(d,s,"GeneratorFunction"),t(h),t(h,s,"Generator"),t(h,a,function(){return this}),t(h,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:u,m:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(St)),St.exports}var Pt={exports:{}},$t={exports:{}},jt={exports:{}},jn;function Gr(){return jn||(jn=1,(function(e){var t=Br(),n=Fr();function r(i,o){function a(u,c,l,f){try{var d=i[u](c),p=d.value;return p instanceof t?o.resolve(p.v).then(function(h){a("next",h,l,f)},function(h){a("throw",h,l,f)}):o.resolve(p).then(function(h){d.value=h,l(d)},function(h){return a("throw",h,l,f)})}catch(h){f(h)}}var s;this.next||(n(r.prototype),n(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(u,c,l){function f(){return new o(function(d,p){a(u,l,d,p)})}return s=s?s.then(f,f):f()},!0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(jt)),jt.exports}var _n;function Vr(){return _n||(_n=1,(function(e){var t=Hr(),n=Gr();function r(i,o,a,s,u){return new n(t().w(i,o,a,s),u||Promise)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})($t)),$t.exports}var En;function Oo(){return En||(En=1,(function(e){var t=Vr();function n(r,i,o,a,s){var u=t(r,i,o,a,s);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Pt)),Pt.exports}var _t={exports:{}},An;function So(){return An||(An=1,(function(e){function t(n){var r=Object(n),i=[];for(var o in r)i.unshift(o);return function a(){for(;i.length;)if((o=i.pop())in r)return a.value=o,a.done=!1,a;return a.done=!0,a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(_t)),_t.exports}var Et={exports:{}},At={exports:{}},Rn;function Co(){return Rn||(Rn=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(At)),At.exports}var In;function Po(){return In||(In=1,(function(e){var t=Co().default;function n(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}}}throw new TypeError(t(r)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Et)),Et.exports}var Nn;function $o(){return Nn||(Nn=1,(function(e){var t=Br(),n=Hr(),r=Oo(),i=Vr(),o=Gr(),a=So(),s=Po();function u(){var c=n(),l=c.m(u),f=(Object.getPrototypeOf?Object.getPrototypeOf(l):l.__proto__).constructor;function d(y){var m=typeof y=="function"&&y.constructor;return!!m&&(m===f||(m.displayName||m.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function h(y){var m,k;return function(v){m||(m={stop:function(){return k(v.a,2)},catch:function(){return v.v},abrupt:function(E,j){return k(v.a,p[E],j)},delegateYield:function(E,j,R){return m.resultName=j,k(v.d,s(E),R)},finish:function(E){return k(v.f,E)}},k=function(E,j,R){v.p=m.prev,v.n=m.next;try{return E(j,R)}finally{m.next=v.n}}),m.resultName&&(m[m.resultName]=v.v,m.resultName=void 0),m.sent=v.v,m.next=v.n;try{return y.call(this,m)}finally{v.p=m.prev,v.n=m.next}}}return(e.exports=u=function(){return{wrap:function(k,v,w,E){return c.w(h(k),v,w,E&&E.reverse())},isGeneratorFunction:d,mark:c.m,awrap:function(k,v){return new t(k,v)},AsyncIterator:o,async:function(k,v,w,E,j){return(d(v)?i:r)(h(k),v,w,E,j)},keys:a,values:s}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})(xt)),xt.exports}var Rt,zn;function jo(){if(zn)return Rt;zn=1;var e=$o()();Rt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Rt}var _o=jo();const S=ro(_o);/*!
16
+ */const wo=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ko=ln("ZoomOut",wo);function Sn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function T(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(u){Sn(o,r,i,a,s,"next",u)}function s(u){Sn(o,r,i,a,s,"throw",u)}a(void 0)})}}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ne(e){"@babel/helpers - typeof";return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(e)}function xo(e,t){if(ne(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ne(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Br(e){var t=xo(e,"string");return ne(t)=="symbol"?t:t+""}function Oo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Br(r.key),r)}}function H(e,t,n){return t&&Oo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function So(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){if(t&&(ne(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return So(e)}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},W(e)}function Vt(e,t){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Vt(e,t)}function oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}function $(e,t,n){return(t=Br(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xt={exports:{}},Ot={exports:{}},Cn;function Hr(){return Cn||(Cn=1,(function(e){function t(n,r){this.v=n,this.k=r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ot)),Ot.exports}var St={exports:{}},Ct={exports:{}},Pn;function Fr(){return Pn||(Pn=1,(function(e){function t(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}e.exports=t=function(u,c,l,f){function d(p,h){t(u,p,function(y){return this._invoke(p,h,y)})}c?a?a(u,c,{value:l,enumerable:!f,configurable:!f,writable:!f}):u[c]=l:(d("next",0),d("throw",1),d("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ct)),Ct.exports}var $n;function Gr(){return $n||($n=1,(function(e){var t=Fr();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,i,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(m,k,v,w){var E=k&&k.prototype instanceof l?k:l,_=Object.create(E.prototype);return t(_,"_invoke",(function(I,P,j){var A,N,D,V=0,L=j||[],Z=!1,K={p:0,n:0,v:r,a:se,f:se.bind(r,4),d:function(b,x){return A=b,N=0,D=r,K.n=x,c}};function se(Q,b){for(N=Q,D=b,i=0;!Z&&V&&!x&&i<L.length;i++){var x,S=L[i],C=K.p,M=S[2];Q>3?(x=M===b)&&(D=S[(N=S[4])?5:(N=3,3)],S[4]=S[5]=r):S[0]<=C&&((x=Q<2&&C<S[1])?(N=0,K.v=b,K.n=S[1]):C<M&&(x=Q<3||S[0]>b||b>M)&&(S[4]=Q,S[5]=b,K.n=M,N=0))}if(x||Q>1)return c;throw Z=!0,b}return function(Q,b,x){if(V>1)throw TypeError("Generator is already running");for(Z&&b===1&&se(b,x),N=b,D=x;(i=N<2?r:D)||!Z;){A||(N?N<3?(N>1&&(K.n=-1),se(N,D)):K.n=D:K.v=D);try{if(V=2,A){if(N||(Q="next"),i=A[Q]){if(!(i=i.call(A,D)))throw TypeError("iterator result is not an object");if(!i.done)return i;D=i.value,N<2&&(N=0)}else N===1&&(i=A.return)&&i.call(A),N<2&&(D=TypeError("The iterator does not provide a '"+Q+"' method"),N=1);A=r}else if((i=(Z=K.n<0)?D:I.call(P,K))!==c)break}catch(S){A=r,N=1,D=S}finally{V=1}}return{value:i,done:Z}}})(m,v,w),!0),_}var c={};function l(){}function f(){}function d(){}i=Object.getPrototypeOf;var p=[][a]?i(i([][a]())):(t(i={},a,function(){return this}),i),h=d.prototype=l.prototype=Object.create(p);function y(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,d):(m.__proto__=d,t(m,s,"GeneratorFunction")),m.prototype=Object.create(h),m}return f.prototype=d,t(h,"constructor",d),t(d,"constructor",f),f.displayName="GeneratorFunction",t(d,s,"GeneratorFunction"),t(h),t(h,s,"Generator"),t(h,a,function(){return this}),t(h,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:u,m:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(St)),St.exports}var Pt={exports:{}},$t={exports:{}},_t={exports:{}},_n;function Vr(){return _n||(_n=1,(function(e){var t=Hr(),n=Fr();function r(i,o){function a(u,c,l,f){try{var d=i[u](c),p=d.value;return p instanceof t?o.resolve(p.v).then(function(h){a("next",h,l,f)},function(h){a("throw",h,l,f)}):o.resolve(p).then(function(h){d.value=h,l(d)},function(h){return a("throw",h,l,f)})}catch(h){f(h)}}var s;this.next||(n(r.prototype),n(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(u,c,l){function f(){return new o(function(d,p){a(u,l,d,p)})}return s=s?s.then(f,f):f()},!0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(_t)),_t.exports}var jn;function Wr(){return jn||(jn=1,(function(e){var t=Gr(),n=Vr();function r(i,o,a,s,u){return new n(t().w(i,o,a,s),u||Promise)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})($t)),$t.exports}var En;function Co(){return En||(En=1,(function(e){var t=Wr();function n(r,i,o,a,s){var u=t(r,i,o,a,s);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Pt)),Pt.exports}var jt={exports:{}},An;function Po(){return An||(An=1,(function(e){function t(n){var r=Object(n),i=[];for(var o in r)i.unshift(o);return function a(){for(;i.length;)if((o=i.pop())in r)return a.value=o,a.done=!1,a;return a.done=!0,a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(jt)),jt.exports}var Et={exports:{}},At={exports:{}},In;function $o(){return In||(In=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(At)),At.exports}var Nn;function _o(){return Nn||(Nn=1,(function(e){var t=$o().default;function n(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}}}throw new TypeError(t(r)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Et)),Et.exports}var Rn;function jo(){return Rn||(Rn=1,(function(e){var t=Hr(),n=Gr(),r=Co(),i=Wr(),o=Vr(),a=Po(),s=_o();function u(){var c=n(),l=c.m(u),f=(Object.getPrototypeOf?Object.getPrototypeOf(l):l.__proto__).constructor;function d(y){var m=typeof y=="function"&&y.constructor;return!!m&&(m===f||(m.displayName||m.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function h(y){var m,k;return function(v){m||(m={stop:function(){return k(v.a,2)},catch:function(){return v.v},abrupt:function(E,_){return k(v.a,p[E],_)},delegateYield:function(E,_,I){return m.resultName=_,k(v.d,s(E),I)},finish:function(E){return k(v.f,E)}},k=function(E,_,I){v.p=m.prev,v.n=m.next;try{return E(_,I)}finally{m.next=v.n}}),m.resultName&&(m[m.resultName]=v.v,m.resultName=void 0),m.sent=v.v,m.next=v.n;try{return y.call(this,m)}finally{v.p=m.prev,v.n=m.next}}}return(e.exports=u=function(){return{wrap:function(k,v,w,E){return c.w(h(k),v,w,E&&E.reverse())},isGeneratorFunction:d,mark:c.m,awrap:function(k,v){return new t(k,v)},AsyncIterator:o,async:function(k,v,w,E,_){return(d(v)?i:r)(h(k),v,w,E,_)},keys:a,values:s}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})(xt)),xt.exports}var It,zn;function Eo(){if(zn)return It;zn=1;var e=jo()();It=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return It}var Ao=Eo();const O=oo(Ao);/*!
17
17
  * rete v2.0.5
18
18
  * (c) 2025 Vitaliy Stoliarov
19
19
  * Released under the MIT license.
20
- * */function Eo(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ao(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Ao(e,t){if(e){if(typeof e=="string")return Mn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(e,t):void 0}}function Mn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ro(){return{debug:function(t){}}}var Io=(function(){function e(){B(this,e),$(this,"pipes",[])}return F(e,[{key:"addPipe",value:function(n){this.pipes.push(n)}},{key:"emit",value:(function(){var t=T(S.mark(function r(i){var o,a,s,u;return S.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o=i,a=Eo(this.pipes),l.prev=2,a.s();case 4:if((s=a.n()).done){l.next=13;break}return u=s.value,l.next=8,u(o);case 8:if(o=l.sent,!(typeof o>"u")){l.next=11;break}return l.abrupt("return");case 11:l.next=4;break;case 13:l.next=18;break;case 15:l.prev=15,l.t0=l.catch(2),a.e(l.t0);case 18:return l.prev=18,a.f(),l.finish(18);case 21:return l.abrupt("return",o);case 22:case"end":return l.stop()}},r,this,[[2,15,18,21]])}));function n(r){return t.apply(this,arguments)}return n})()}])})(),Ze=(function(){function e(t){B(this,e),$(this,"signal",new Io),this.name=t}return F(e,[{key:"addPipe",value:function(n){this.signal.addPipe(n)}},{key:"use",value:function(n){if(!(n instanceof e))throw new Error("cannot use non-Scope instance");return n.setParent(this),this.addPipe(function(r){return n.signal.emit(r)}),Ro()}},{key:"setParent",value:function(n){this.parent=n}},{key:"emit",value:function(n){return this.signal.emit(n)}},{key:"hasParent",value:function(){return!!this.parent}},{key:"parentScope",value:function(n){if(!this.parent)throw new Error("cannot find parent");if(n&&this.parent instanceof n)return this.parent;if(n)throw new Error("actual parent is not instance of type");return this.parent}}])})();function Dn(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=No(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function No(e,t){if(e){if(typeof e=="string")return Tn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}function Tn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zo(e,t,n){return t=W(t),me(e,Wr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function Wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wr=function(){return!!e})()}var Pe=(function(e){function t(){var n;return B(this,t),n=zo(this,t,["NodeEditor"]),$(n,"nodes",[]),$(n,"connections",[]),n}return oe(t,e),F(t,[{key:"getNode",value:function(r){return this.nodes.find(function(i){return i.id===r})}},{key:"getNodes",value:function(){return this.nodes.slice()}},{key:"getConnections",value:function(){return this.connections.slice()}},{key:"getConnection",value:function(r){return this.connections.find(function(i){return i.id===r})}},{key:"addNode",value:(function(){var n=T(S.mark(function i(o){return S.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getNode(o.id)){s.next=2;break}throw new Error("node has already been added");case 2:return s.next=4,this.emit({type:"nodecreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.nodes.push(o),s.next=9,this.emit({type:"nodecreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"addConnection",value:(function(){var n=T(S.mark(function i(o){return S.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getConnection(o.id)){s.next=2;break}throw new Error("connection has already been added");case 2:return s.next=4,this.emit({type:"connectioncreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.connections.push(o),s.next=9,this.emit({type:"connectioncreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeNode",value:(function(){var n=T(S.mark(function i(o){var a,s;return S.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.nodes.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find node");case 3:return c.next=5,this.emit({type:"noderemove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.nodes.indexOf(a),this.nodes.splice(s,1),c.next=11,this.emit({type:"noderemoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeConnection",value:(function(){var n=T(S.mark(function i(o){var a,s;return S.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.connections.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find connection");case 3:return c.next=5,this.emit({type:"connectionremove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.connections.indexOf(a),this.connections.splice(s,1),c.next=11,this.emit({type:"connectionremoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"clear",value:(function(){var n=T(S.mark(function i(){var o,a,s,u,c,l;return S.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.emit({type:"clear"});case 2:if(d.sent){d.next=6;break}return d.next=5,this.emit({type:"clearcancelled"});case 5:return d.abrupt("return",!1);case 6:o=Dn(this.connections.slice()),d.prev=7,o.s();case 9:if((a=o.n()).done){d.next=15;break}return s=a.value,d.next=13,this.removeConnection(s.id);case 13:d.next=9;break;case 15:d.next=20;break;case 17:d.prev=17,d.t0=d.catch(7),o.e(d.t0);case 20:return d.prev=20,o.f(),d.finish(20);case 23:u=Dn(this.nodes.slice()),d.prev=24,u.s();case 26:if((c=u.n()).done){d.next=32;break}return l=c.value,d.next=30,this.removeNode(l.id);case 30:d.next=26;break;case 32:d.next=37;break;case 34:d.prev=34,d.t1=d.catch(24),u.e(d.t1);case 37:return d.prev=37,u.f(),d.finish(37);case 40:return d.next=42,this.emit({type:"cleared"});case 42:return d.abrupt("return",!0);case 43:case"end":return d.stop()}},i,this,[[7,17,20,23],[24,34,37,40]])}));function r(){return n.apply(this,arguments)}return r})()}])})(Ze),It=globalThis.crypto;function $e(){if("randomBytes"in It)return It.randomBytes(8).toString("hex");var e=It.getRandomValues(new Uint8Array(8)),t=Array.from(e),n=t.map(function(r){return r.toString(16).padStart(2,"0")});return n.join("")}function dn(e,t,n){return t=W(t),me(e,qr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qr=function(){return!!e})()}var Mo=F(function e(t){B(this,e),this.name=t}),fn=F(function e(t,n,r){B(this,e),this.socket=t,this.label=n,this.multipleConnections=r,this.id=$e()}),Do=(function(e){function t(n,r,i){var o;return B(this,t),o=dn(this,t,[n,r,i]),$(o,"control",null),$(o,"showControl",!0),o.socket=n,o.label=r,o.multipleConnections=i,o}return oe(t,e),F(t,[{key:"addControl",value:function(r){if(this.control)throw new Error("control already added for this input");this.control=r}},{key:"removeControl",value:function(){this.control=null}}])})(fn),To=(function(e){function t(n,r,i){return B(this,t),dn(this,t,[n,r,i!==!1])}return oe(t,e),F(t)})(fn),Kr=F(function e(){B(this,e),this.id=$e()}),Lo=(function(e){function t(n,r){var i,o;return B(this,t),o=dn(this,t),o.type=n,o.options=r,o.id=$e(),o.readonly=(i=r==null?void 0:r.readonly)!==null&&i!==void 0?i:!1,typeof(r==null?void 0:r.initial)<"u"&&(o.value=r.initial),o}return oe(t,e),F(t,[{key:"setValue",value:function(r){var i;this.value=r,(i=this.options)!==null&&i!==void 0&&i.change&&this.options.change(r)}}])})(Kr),Bo=(function(){function e(t){B(this,e),$(this,"inputs",{}),$(this,"outputs",{}),$(this,"controls",{}),this.label=t,this.id=$e()}return F(e,[{key:"hasInput",value:function(n){return Object.prototype.hasOwnProperty.call(this.inputs,n)}},{key:"addInput",value:function(n,r){if(this.hasInput(n))throw new Error("input with key '".concat(String(n),"' already added"));Object.defineProperty(this.inputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeInput",value:function(n){delete this.inputs[n]}},{key:"hasOutput",value:function(n){return Object.prototype.hasOwnProperty.call(this.outputs,n)}},{key:"addOutput",value:function(n,r){if(this.hasOutput(n))throw new Error("output with key '".concat(String(n),"' already added"));Object.defineProperty(this.outputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeOutput",value:function(n){delete this.outputs[n]}},{key:"hasControl",value:function(n){return Object.prototype.hasOwnProperty.call(this.controls,n)}},{key:"addControl",value:function(n,r){if(this.hasControl(n))throw new Error("control with key '".concat(String(n),"' already added"));Object.defineProperty(this.controls,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeControl",value:function(n){delete this.controls[n]}}])})(),Fo=F(function e(t,n,r,i){if(B(this,e),this.sourceOutput=n,this.targetInput=i,!t.outputs[n])throw new Error("source node doesn't have output with a key ".concat(String(n)));if(!r.inputs[i])throw new Error("target node doesn't have input with a key ".concat(String(i)));this.id=$e(),this.source=t.id,this.target=r.id}),Ae=Object.freeze({__proto__:null,Socket:Mo,Port:fn,Input:Do,Output:To,Control:Kr,InputControl:Lo,Node:Bo,Connection:Fo});function Wt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ho(e){if(Array.isArray(e))return Wt(e)}function Go(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yr(e,t){if(e){if(typeof e=="string")return Wt(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}function Vo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(e){return Ho(e)||Go(e)||Yr(e)||Vo()}/*!
24
- * rete-area-plugin v2.1.4
25
- * (c) 2025 Vitaliy Stoliarov
20
+ * */function Io(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=No(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function No(e,t){if(e){if(typeof e=="string")return Mn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(e,t):void 0}}function Mn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ro(){return{debug:function(t){}}}var zo=(function(){function e(){B(this,e),$(this,"pipes",[])}return H(e,[{key:"addPipe",value:function(n){this.pipes.push(n)}},{key:"emit",value:(function(){var t=T(O.mark(function r(i){var o,a,s,u;return O.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o=i,a=Io(this.pipes),l.prev=2,a.s();case 4:if((s=a.n()).done){l.next=13;break}return u=s.value,l.next=8,u(o);case 8:if(o=l.sent,!(typeof o>"u")){l.next=11;break}return l.abrupt("return");case 11:l.next=4;break;case 13:l.next=18;break;case 15:l.prev=15,l.t0=l.catch(2),a.e(l.t0);case 18:return l.prev=18,a.f(),l.finish(18);case 21:return l.abrupt("return",o);case 22:case"end":return l.stop()}},r,this,[[2,15,18,21]])}));function n(r){return t.apply(this,arguments)}return n})()}])})(),Ye=(function(){function e(t){B(this,e),$(this,"signal",new zo),this.name=t}return H(e,[{key:"addPipe",value:function(n){this.signal.addPipe(n)}},{key:"use",value:function(n){if(!(n instanceof e))throw new Error("cannot use non-Scope instance");return n.setParent(this),this.addPipe(function(r){return n.signal.emit(r)}),Ro()}},{key:"setParent",value:function(n){this.parent=n}},{key:"emit",value:function(n){return this.signal.emit(n)}},{key:"hasParent",value:function(){return!!this.parent}},{key:"parentScope",value:function(n){if(!this.parent)throw new Error("cannot find parent");if(n&&this.parent instanceof n)return this.parent;if(n)throw new Error("actual parent is not instance of type");return this.parent}}])})();function Dn(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Mo(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Mo(e,t){if(e){if(typeof e=="string")return Tn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}function Tn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Do(e,t,n){return t=W(t),me(e,qr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qr=function(){return!!e})()}var Pe=(function(e){function t(){var n;return B(this,t),n=Do(this,t,["NodeEditor"]),$(n,"nodes",[]),$(n,"connections",[]),n}return oe(t,e),H(t,[{key:"getNode",value:function(r){return this.nodes.find(function(i){return i.id===r})}},{key:"getNodes",value:function(){return this.nodes.slice()}},{key:"getConnections",value:function(){return this.connections.slice()}},{key:"getConnection",value:function(r){return this.connections.find(function(i){return i.id===r})}},{key:"addNode",value:(function(){var n=T(O.mark(function i(o){return O.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getNode(o.id)){s.next=2;break}throw new Error("node has already been added");case 2:return s.next=4,this.emit({type:"nodecreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.nodes.push(o),s.next=9,this.emit({type:"nodecreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"addConnection",value:(function(){var n=T(O.mark(function i(o){return O.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getConnection(o.id)){s.next=2;break}throw new Error("connection has already been added");case 2:return s.next=4,this.emit({type:"connectioncreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.connections.push(o),s.next=9,this.emit({type:"connectioncreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeNode",value:(function(){var n=T(O.mark(function i(o){var a,s;return O.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.nodes.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find node");case 3:return c.next=5,this.emit({type:"noderemove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.nodes.indexOf(a),this.nodes.splice(s,1),c.next=11,this.emit({type:"noderemoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeConnection",value:(function(){var n=T(O.mark(function i(o){var a,s;return O.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.connections.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find connection");case 3:return c.next=5,this.emit({type:"connectionremove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.connections.indexOf(a),this.connections.splice(s,1),c.next=11,this.emit({type:"connectionremoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"clear",value:(function(){var n=T(O.mark(function i(){var o,a,s,u,c,l;return O.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.emit({type:"clear"});case 2:if(d.sent){d.next=6;break}return d.next=5,this.emit({type:"clearcancelled"});case 5:return d.abrupt("return",!1);case 6:o=Dn(this.connections.slice()),d.prev=7,o.s();case 9:if((a=o.n()).done){d.next=15;break}return s=a.value,d.next=13,this.removeConnection(s.id);case 13:d.next=9;break;case 15:d.next=20;break;case 17:d.prev=17,d.t0=d.catch(7),o.e(d.t0);case 20:return d.prev=20,o.f(),d.finish(20);case 23:u=Dn(this.nodes.slice()),d.prev=24,u.s();case 26:if((c=u.n()).done){d.next=32;break}return l=c.value,d.next=30,this.removeNode(l.id);case 30:d.next=26;break;case 32:d.next=37;break;case 34:d.prev=34,d.t1=d.catch(24),u.e(d.t1);case 37:return d.prev=37,u.f(),d.finish(37);case 40:return d.next=42,this.emit({type:"cleared"});case 42:return d.abrupt("return",!0);case 43:case"end":return d.stop()}},i,this,[[7,17,20,23],[24,34,37,40]])}));function r(){return n.apply(this,arguments)}return r})()}])})(Ye),Nt=globalThis.crypto;function $e(){if("randomBytes"in Nt)return Nt.randomBytes(8).toString("hex");var e=Nt.getRandomValues(new Uint8Array(8)),t=Array.from(e),n=t.map(function(r){return r.toString(16).padStart(2,"0")});return n.join("")}function dn(e,t,n){return t=W(t),me(e,Zr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zr=function(){return!!e})()}var To=H(function e(t){B(this,e),this.name=t}),fn=H(function e(t,n,r){B(this,e),this.socket=t,this.label=n,this.multipleConnections=r,this.id=$e()}),Lo=(function(e){function t(n,r,i){var o;return B(this,t),o=dn(this,t,[n,r,i]),$(o,"control",null),$(o,"showControl",!0),o.socket=n,o.label=r,o.multipleConnections=i,o}return oe(t,e),H(t,[{key:"addControl",value:function(r){if(this.control)throw new Error("control already added for this input");this.control=r}},{key:"removeControl",value:function(){this.control=null}}])})(fn),Bo=(function(e){function t(n,r,i){return B(this,t),dn(this,t,[n,r,i!==!1])}return oe(t,e),H(t)})(fn),Kr=H(function e(){B(this,e),this.id=$e()}),Ho=(function(e){function t(n,r){var i,o;return B(this,t),o=dn(this,t),o.type=n,o.options=r,o.id=$e(),o.readonly=(i=r==null?void 0:r.readonly)!==null&&i!==void 0?i:!1,typeof(r==null?void 0:r.initial)<"u"&&(o.value=r.initial),o}return oe(t,e),H(t,[{key:"setValue",value:function(r){var i;this.value=r,(i=this.options)!==null&&i!==void 0&&i.change&&this.options.change(r)}}])})(Kr),Fo=(function(){function e(t){B(this,e),$(this,"inputs",{}),$(this,"outputs",{}),$(this,"controls",{}),this.label=t,this.id=$e()}return H(e,[{key:"hasInput",value:function(n){return Object.prototype.hasOwnProperty.call(this.inputs,n)}},{key:"addInput",value:function(n,r){if(this.hasInput(n))throw new Error("input with key '".concat(String(n),"' already added"));Object.defineProperty(this.inputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeInput",value:function(n){delete this.inputs[n]}},{key:"hasOutput",value:function(n){return Object.prototype.hasOwnProperty.call(this.outputs,n)}},{key:"addOutput",value:function(n,r){if(this.hasOutput(n))throw new Error("output with key '".concat(String(n),"' already added"));Object.defineProperty(this.outputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeOutput",value:function(n){delete this.outputs[n]}},{key:"hasControl",value:function(n){return Object.prototype.hasOwnProperty.call(this.controls,n)}},{key:"addControl",value:function(n,r){if(this.hasControl(n))throw new Error("control with key '".concat(String(n),"' already added"));Object.defineProperty(this.controls,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeControl",value:function(n){delete this.controls[n]}}])})(),Go=H(function e(t,n,r,i){if(B(this,e),this.sourceOutput=n,this.targetInput=i,!t.outputs[n])throw new Error("source node doesn't have output with a key ".concat(String(n)));if(!r.inputs[i])throw new Error("target node doesn't have input with a key ".concat(String(i)));this.id=$e(),this.source=t.id,this.target=r.id}),Ae=Object.freeze({__proto__:null,Socket:To,Port:fn,Input:Lo,Output:Bo,Control:Kr,InputControl:Ho,Node:Fo,Connection:Go});function Wt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vo(e){if(Array.isArray(e))return Wt(e)}function Wo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yr(e,t){if(e){if(typeof e=="string")return Wt(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}function qo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ve(e){return Vo(e)||Wo(e)||Yr(e)||qo()}/*!
24
+ * rete-area-plugin v2.3.1
25
+ * (c) 2026 Vitaliy Stoliarov
26
26
  * Released under the MIT license.
27
- * */var Wo=(function(){function e(t){B(this,e),this.reordered=t,this.holder=document.createElement("div"),this.holder.style.transformOrigin="0 0"}return F(e,[{key:"getPointerFrom",value:function(n){var r=this.holder.getBoundingClientRect(),i=r.left,o=r.top,a=n.clientX-i,s=n.clientY-o;return{x:a,y:s}}},{key:"add",value:function(n){this.holder.appendChild(n)}},{key:"reorder",value:(function(){var t=T(S.mark(function r(i,o){return S.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.holder.contains(i)){s.next=2;break}throw new Error("content doesn't have 'target' for reordering");case 2:if(!(o!==null&&!this.holder.contains(o))){s.next=4;break}throw new Error("content doesn't have 'next' for reordering");case 4:return this.holder.insertBefore(i,o),s.next=7,this.reordered(i);case 7:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:function(n){this.holder.contains(n)&&this.holder.removeChild(n)}}])})();function qo(e,t){var n=function(a){t.move(a)},r=function(a){window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r),t.up(a)},i=function(a){window.addEventListener("pointermove",n),window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),t.down(a)};return e.addEventListener("pointerdown",i),{destroy:function(){e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r)}}}var Ln=function(t){return t.length===0?0:Math.min.apply(Math,de(t))},Bn=function(t){return t.length===0?0:Math.max.apply(Math,de(t))};function Zr(e){var t=Ln(e.map(function(o){return o.position.x})),n=Ln(e.map(function(o){return o.position.y})),r=Bn(e.map(function(o){return o.position.x+o.width})),i=Bn(e.map(function(o){return o.position.y+o.height}));return{left:t,right:r,top:n,bottom:i,width:Math.abs(t-r),height:Math.abs(n-i),center:{x:(t+r)/2,y:(n+i)/2}}}function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ur=(function(){function e(t){var n=this;B(this,e),$(this,"down",function(r){n.guards.down(r)&&(r.stopPropagation(),n.pointerStart={x:r.pageX,y:r.pageY},n.startPosition=Ko({},n.config.getCurrentPosition()),n.events.start(r))}),$(this,"move",function(r){if(!(!n.pointerStart||!n.startPosition)&&n.guards.move(r)){r.preventDefault();var i={x:r.pageX-n.pointerStart.x,y:r.pageY-n.pointerStart.y},o=n.config.getZoom(),a=n.startPosition.x+i.x/o,s=n.startPosition.y+i.y/o;n.events.translate(a,s,r)}}),$(this,"up",function(r){n.pointerStart&&(delete n.pointerStart,n.events.drag(r))}),this.guards=t||{down:function(i){return!(i.pointerType==="mouse"&&i.button!==0)},move:function(){return!0}}}return F(e,[{key:"initialize",value:function(n,r,i){this.config=r,this.events=i,n.style.touchAction="none",this.pointerListener=qo(n,{down:this.down,move:this.move,up:this.up})}},{key:"destroy",value:function(){this.pointerListener.destroy()}}])})(),Yo=(function(){function e(t){var n=this;B(this,e),$(this,"previous",null),$(this,"pointers",[]),$(this,"wheel",function(r){r.preventDefault();var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=r.deltaY<0,u=s?n.intensity:-n.intensity,c=(o-r.clientX)*u,l=(a-r.clientY)*u;n.onzoom(u,c,l,"wheel")}),$(this,"down",function(r){n.pointers.push(r)}),$(this,"move",function(r){if(n.pointers=n.pointers.map(function(h){return h.pointerId===r.pointerId?r:h}),!!n.isTranslating()){var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=n.getTouches(),u=s.cx,c=s.cy,l=s.distance;if(n.previous!==null&&n.previous.distance>0){var f=l/n.previous.distance-1,d=(o-u)*f,p=(a-c)*f;n.onzoom(f,d-(n.previous.cx-u),p-(n.previous.cy-c),"touch")}n.previous={cx:u,cy:c,distance:l}}}),$(this,"contextmenu",function(){n.pointers=[]}),$(this,"up",function(r){n.previous=null,n.pointers=n.pointers.filter(function(i){return i.pointerId!==r.pointerId})}),$(this,"dblclick",function(r){r.preventDefault();var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=4*n.intensity,u=(o-r.clientX)*s,c=(a-r.clientY)*s;n.onzoom(s,u,c,"dblclick")}),this.intensity=t}return F(e,[{key:"initialize",value:function(n,r,i){this.container=n,this.element=r,this.onzoom=i,this.container.addEventListener("wheel",this.wheel),this.container.addEventListener("pointerdown",this.down),this.container.addEventListener("dblclick",this.dblclick),window.addEventListener("pointermove",this.move),window.addEventListener("pointerup",this.up),window.addEventListener("pointercancel",this.up),window.addEventListener("contextmenu",this.contextmenu)}},{key:"getTouches",value:function(){var n={touches:this.pointers},r=[n.touches[0].clientX,n.touches[0].clientY],i=r[0],o=r[1],a=[n.touches[1].clientX,n.touches[1].clientY],s=a[0],u=a[1],c=Math.sqrt(Math.pow(i-s,2)+Math.pow(o-u,2));return{cx:(i+s)/2,cy:(o+u)/2,distance:c}}},{key:"isTranslating",value:function(){return this.pointers.length>=2}},{key:"destroy",value:function(){this.container.removeEventListener("wheel",this.wheel),this.container.removeEventListener("pointerdown",this.down),this.container.removeEventListener("dblclick",this.dblclick),window.removeEventListener("pointermove",this.move),window.removeEventListener("pointerup",this.up),window.removeEventListener("pointercancel",this.up),window.removeEventListener("contextmenu",this.contextmenu)}}])})(),Zo=(function(){function e(t,n,r){var i=this;B(this,e),$(this,"transform",{k:1,x:0,y:0}),$(this,"pointer",{x:0,y:0}),$(this,"zoomHandler",null),$(this,"dragHandler",null),$(this,"pointerdown",function(o){i.setPointerFrom(o),i.events.pointerDown(i.pointer,o)}),$(this,"pointermove",function(o){i.setPointerFrom(o),i.events.pointerMove(i.pointer,o)}),$(this,"pointerup",function(o){i.setPointerFrom(o),i.events.pointerUp(i.pointer,o)}),$(this,"resize",function(o){i.events.resize(o)}),$(this,"onTranslate",function(o,a){var s;(s=i.zoomHandler)!==null&&s!==void 0&&s.isTranslating()||i.translate(o,a)}),$(this,"onZoom",function(o,a,s,u){i.zoom(i.transform.k*(1+o),a,s,u),i.update()}),this.container=t,this.events=n,this.guards=r,this.content=new Wo(function(o){return i.events.reordered(o)}),this.content.holder.style.transformOrigin="0 0",this.setZoomHandler(new Yo(.1)),this.setDragHandler(new Ur),this.container.addEventListener("pointerdown",this.pointerdown),this.container.addEventListener("pointermove",this.pointermove),window.addEventListener("pointerup",this.pointerup),window.addEventListener("resize",this.resize),t.appendChild(this.content.holder),this.update()}return F(e,[{key:"update",value:function(){var n=this.transform,r=n.x,i=n.y,o=n.k;this.content.holder.style.transform="translate(".concat(r,"px, ").concat(i,"px) scale(").concat(o,")")}},{key:"setDragHandler",value:function(n){var r=this;this.dragHandler&&this.dragHandler.destroy(),this.dragHandler=n,this.dragHandler&&this.dragHandler.initialize(this.container,{getCurrentPosition:function(){return r.transform},getZoom:function(){return 1}},{start:function(){return null},translate:this.onTranslate,drag:function(){return null}})}},{key:"setZoomHandler",value:function(n){this.zoomHandler&&this.zoomHandler.destroy(),this.zoomHandler=n,this.zoomHandler&&this.zoomHandler.initialize(this.container,this.content.holder,this.onZoom)}},{key:"setPointerFrom",value:function(n){var r=this.content.getPointerFrom(n),i=r.x,o=r.y,a=this.transform.k;this.pointer={x:i/a,y:o/a}}},{key:"translate",value:(function(){var t=T(S.mark(function r(i,o){var a,s;return S.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a={x:i,y:o},c.next=3,this.guards.translate({previous:this.transform,position:a});case 3:if(s=c.sent,s){c.next=6;break}return c.abrupt("return",!1);case 6:return this.transform.x=s.data.position.x,this.transform.y=s.data.position.y,this.update(),c.next=11,this.events.translated(s.data);case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"zoom",value:(function(){var t=T(S.mark(function r(i){var o,a,s,u,c,l,f=arguments;return S.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=f.length>1&&f[1]!==void 0?f[1]:0,a=f.length>2&&f[2]!==void 0?f[2]:0,s=f.length>3?f[3]:void 0,u=this.transform.k,p.next=6,this.guards.zoom({previous:this.transform,zoom:i,source:s});case 6:if(c=p.sent,c){p.next=9;break}return p.abrupt("return",!0);case 9:return l=(u-c.data.zoom)/(u-i||1),this.transform.k=c.data.zoom||1,this.transform.x+=o*l,this.transform.y+=a*l,this.update(),p.next=16,this.events.zoomed(c.data);case 16:return p.abrupt("return",!1);case 17:case"end":return p.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"destroy",value:function(){this.container.removeEventListener("pointerdown",this.pointerdown),this.container.removeEventListener("pointermove",this.pointermove),window.removeEventListener("pointerup",this.pointerup),window.removeEventListener("resize",this.resize),this.dragHandler&&this.dragHandler.destroy(),this.zoomHandler&&this.zoomHandler.destroy(),this.content.holder.innerHTML=""}}])})();function Uo(e,t,n){return t=W(t),me(e,Xr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xr=function(){return!!e})()}var ft=(function(e){function t(){return B(this,t),Uo(this,t,arguments)}return oe(t,e),F(t)})(Ze),Xo=F(function e(t){B(this,e),this.element=document.createElement("div"),this.element.style.position="absolute",this.element.style.left="0",this.element.style.top="0",this.element.addEventListener("contextmenu",function(n){return t.contextmenu(n)})}),Jo=(function(){function e(){B(this,e),$(this,"views",new WeakMap),$(this,"viewsElements",new Map)}return F(e,[{key:"set",value:function(n){var r=n.element,i=n.type,o=n.payload;o!=null&&o.id&&(this.views.set(r,n),this.viewsElements.set("".concat(i,"_").concat(o.id),r))}},{key:"get",value:function(n,r){var i=this.viewsElements.get("".concat(n,"_").concat(r));return i&&this.views.get(i)}},{key:"delete",value:function(n){var r,i=this.views.get(n);i&&(r=i.payload)!==null&&r!==void 0&&r.id&&(this.views.delete(n),this.viewsElements.delete("".concat(i.type,"_").concat(i.payload.id)))}}])})();function Hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Qo=(function(){function e(t,n,r){var i=this;B(this,e),$(this,"translate",(function(){var o=T(S.mark(function a(s,u){var c,l;return S.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c=Gn({},i.position),d.next=3,i.guards.translate({previous:c,position:{x:s,y:u}});case 3:if(l=d.sent,l){d.next=6;break}return d.abrupt("return",!1);case 6:return i.position=Gn({},l.data.position),i.element.style.transform="translate(".concat(i.position.x,"px, ").concat(i.position.y,"px)"),d.next=10,i.events.translated({position:i.position,previous:c});case 10:return d.abrupt("return",!0);case 11:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),$(this,"resize",(function(){var o=T(S.mark(function a(s,u){var c,l;return S.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c={width:s,height:u},d.next=3,i.guards.resize({size:c});case 3:if(d.sent){d.next=5;break}return d.abrupt("return",!1);case 5:if(l=i.element.querySelector("*:not(span):not([fragment])"),!(!l||!(l instanceof HTMLElement))){d.next=8;break}return d.abrupt("return",!1);case 8:return l.style.width="".concat(s,"px"),l.style.height="".concat(u,"px"),d.next=12,i.events.resized({size:c});case 12:return d.abrupt("return",!0);case 13:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),this.getZoom=t,this.events=n,this.guards=r,this.element=document.createElement("div"),this.element.style.position="absolute",this.position={x:0,y:0},this.translate(0,0),this.element.addEventListener("contextmenu",function(o){return i.events.contextmenu(o)}),this.dragHandler=new Ur,this.dragHandler.initialize(this.element,{getCurrentPosition:function(){return i.position},getZoom:function(){return i.getZoom()}},{start:this.events.picked,translate:this.translate,drag:this.events.dragged})}return F(e,[{key:"destroy",value:function(){this.dragHandler.destroy()}}])})();function Jr(e,t){return e.map(function(n){return{view:t.get(n.id),node:n}}).filter(function(n){return n.view}).map(function(n){var r=n.view,i=n.node,o=i.width,a=i.height;return typeof o<"u"&&typeof a<"u"?{position:r.position,width:o,height:a}:{position:r.position,width:r.element.clientWidth,height:r.element.clientHeight}})}function ea(e,t){var n=e.parentScope(Pe),r=t.map(function(o){return ie(o)==="object"?o:n.getNode(o)}),i=Jr(r,e.nodeViews);return Zr(i)}function ta(e){var t=e;t.addPipe(function(n){if(!n||ie(n)!=="object"||!("type"in n))return n;if(n.type==="nodepicked"){var r=t.nodeViews.get(n.data.id),i=t.area.content;r&&i.reorder(r.element,null)}if(n.type==="connectioncreated"){var o=t.connectionViews.get(n.data.id),a=t.area.content;o&&a.reorder(o.element,a.holder.firstChild)}return n})}function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function na(e,t){var n=t!=null&&t.scaling?t.scaling===!0?{min:.1,max:1}:t.scaling:!1,r=t!=null&&t.translation?t.translation===!0?{left:0,top:0,right:1e3,bottom:1e3}:t.translation:!1;function i(a){if(!n)throw new Error("scaling param isnt defined");var s=typeof n=="function"?n():n,u=s.min,c=s.max;return a<u?u:a>c?c:a}function o(a){if(!r)throw new Error("translation param isnt defined");var s=pe({},a),u=typeof r=="function"?r():r,c=u.left,l=u.top,f=u.right,d=u.bottom;return s.x<c&&(s.x=c),s.x>f&&(s.x=f),s.y<l&&(s.y=l),s.y>d&&(s.y=d),s}e.addPipe(function(a){if(!a||ie(a)!=="object"||!("type"in a))return a;if(n&&a.type==="zoom")return pe(pe({},a),{},{data:pe(pe({},a.data),{},{zoom:i(a.data.zoom)})});if(r&&a.type==="zoomed"){var s=o(e.area.transform);e.area.translate(s.x,s.y)}return r&&a.type==="translate"?pe(pe({},a),{},{data:pe(pe({},a.data),{},{position:o(a.data.position)})}):a})}function ra(){var e=!1;function t(r){(r.key==="Control"||r.key==="Meta")&&(e=!0)}function n(r){(r.key==="Control"||r.key==="Meta")&&(e=!1)}return document.addEventListener("keydown",t),document.addEventListener("keyup",n),{active:function(){return e},destroy:function(){document.removeEventListener("keydown",t),document.removeEventListener("keyup",n)}}}var Qr=(function(){function e(){B(this,e),$(this,"entities",new Map),$(this,"pickId",null)}return F(e,[{key:"isSelected",value:function(n){return this.entities.has("".concat(n.label,"_").concat(n.id))}},{key:"add",value:(function(){var t=T(S.mark(function r(i,o){return S.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(o){s.next=3;break}return s.next=3,this.unselectAll();case 3:this.entities.set("".concat(i.label,"_").concat(i.id),i);case 4:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:(function(){var t=T(S.mark(function r(i){var o,a;return S.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o="".concat(i.label,"_").concat(i.id),a=this.entities.get(o),!a){u.next=6;break}return this.entities.delete(o),u.next=6,a.unselect();case 6:case"end":return u.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"unselectAll",value:(function(){var t=T(S.mark(function r(){var i=this;return S.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Promise.all(de(Array.from(this.entities.values())).map(function(s){return i.remove(s)}));case 2:case"end":return a.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n})()},{key:"translate",value:(function(){var t=T(S.mark(function r(i,o){var a=this;return S.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all(Array.from(this.entities.values()).map(function(c){return!a.isPicked(c)&&c.translate(i,o)}));case 2:case"end":return u.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"pick",value:function(n){this.pickId="".concat(n.label,"_").concat(n.id)}},{key:"release",value:function(){this.pickId=null}},{key:"isPicked",value:function(n){return this.pickId==="".concat(n.label,"_").concat(n.id)}}])})();function ia(){return new Qr}function oa(e,t,n){var r=null,i=e,o=function(){return r||(r=i.parentScope(Pe))},a=0;function s(p){p.selected||(p.selected=!0,i.update("node",p.id))}function u(p){p.selected&&(p.selected=!1,i.update("node",p.id))}function c(p,h){return l.apply(this,arguments)}function l(){return l=T(S.mark(function p(h,y){var m;return S.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(m=o().getNode(h),m){v.next=3;break}return v.abrupt("return");case 3:return v.next=5,t.add({label:"node",id:m.id,translate:function(E,j){return T(S.mark(function R(){var P,_;return S.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(P=i.nodeViews.get(m.id),_=P==null?void 0:P.position,!_){I.next=5;break}return I.next=5,P.translate(_.x+E,_.y+j);case 5:case"end":return I.stop()}},R)}))()},unselect:function(){u(m)}},y);case 5:s(m);case 6:case"end":return v.stop()}},p)})),l.apply(this,arguments)}function f(p){return d.apply(this,arguments)}function d(){return d=T(S.mark(function p(h){return S.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,t.remove({id:h,label:"node"});case 2:case"end":return m.stop()}},p)})),d.apply(this,arguments)}return i.addPipe((function(){var p=T(S.mark(function h(y){var m,k,v,w,E,j,R,P;return S.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!(!y||ie(y)!=="object"||!("type"in y))){A.next=2;break}return A.abrupt("return",y);case 2:if(y.type!=="nodepicked"){A.next=11;break}return m=y.data.id,k=n.accumulating.active(),t.pick({id:m,label:"node"}),a=null,A.next=9,c(m,k);case 9:A.next=33;break;case 11:if(y.type!=="nodetranslated"){A.next=20;break}if(v=y.data,w=v.id,E=v.position,j=v.previous,R=E.x-j.x,P=E.y-j.y,!t.isPicked({id:w,label:"node"})){A.next=18;break}return A.next=18,t.translate(R,P);case 18:A.next=33;break;case 20:if(y.type!=="pointerdown"){A.next=24;break}a=0,A.next=33;break;case 24:if(y.type!=="pointermove"){A.next=28;break}a!==null&&a++,A.next=33;break;case 28:if(y.type!=="pointerup"){A.next=33;break}if(!(a!==null&&a<4)){A.next=32;break}return A.next=32,t.unselectAll();case 32:a=null;case 33:return A.abrupt("return",y);case 34:case"end":return A.stop()}},h)}));return function(h){return p.apply(this,arguments)}})()),{select:c,unselect:f}}function aa(e,t){var n=null,r=function(){return n||(n=e.parentScope(Pe))};function i(o,a){var s=r().getNode(o);if(s){var u=s.inputs[a];if(!u)throw new Error("cannot find input");var c=u.showControl,l=r().getConnections(),f=!!l.find(function(d){return d.target===o&&d.targetInput===a});u.showControl=t?t({hasAnyConnection:f,input:u}):!f,u.showControl!==c&&e.update("node",s.id)}}e.addPipe(function(o){return(o.type==="connectioncreated"||o.type==="connectionremoved")&&i(o.data.target,o.data.targetInput),o})}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sa(e,t){var n=e,r=typeof(t==null?void 0:t.size)>"u"?16:t.size,i=typeof(t==null?void 0:t.dynamic)>"u"?!0:t.dynamic;function o(a){return Math.round(a/r)*r}n.addPipe(function(a){if(!a||ie(a)!=="object"||!("type"in a))return a;if(i&&a.type==="nodetranslate"){var s=a.data.position,u=o(s.x),c=o(s.y);return Je(Je({},a),{},{data:Je(Je({},a.data),{},{position:{x:u,y:c}})})}if(!i&&a.type==="nodedragged"){var l=n.nodeViews.get(a.data.id);if(l){var f=l.position,d=f.x,p=f.y;l.translate(o(d),o(p))}}return a})}function ua(e,t,n){return qt.apply(this,arguments)}function qt(){return qt=T(S.mark(function e(t,n,r){var i,o,a,s,u,c,l,f,d,p,h,y,m;return S.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return i=r||{},o=i.scale,a=o===void 0?.9:o,s=t.parentScope(Pe),u=n.map(function(w){return ie(w)==="object"?w:s.getNode(w)}),c=Jr(u,t.nodeViews),l=Zr(c),f=[t.container.clientWidth,t.container.clientHeight],d=f[0],p=f[1],h=d/l.width,y=p/l.height,m=Math.min(y*a,h*a,1),t.area.transform.x=d/2-l.center.x*m,t.area.transform.y=p/2-l.center.y*m,v.next=12,t.area.zoom(m,0,0);case 12:case"end":return v.stop()}},e)})),qt.apply(this,arguments)}var Qe=Object.freeze({__proto__:null,getBoundingBox:ea,simpleNodesOrder:ta,restrictor:na,accumulateOnCtrl:ra,selectableNodes:oa,Selector:Qr,selector:ia,showInputControl:aa,snapGrid:sa,zoomAt:ua});function qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ca(e,t,n){return t=W(t),me(e,ei()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ei=function(){return!!e})()}var ti=(function(e){function t(n){var r;return B(this,t),r=ca(this,t,["area"]),$(r,"nodeViews",new Map),$(r,"connectionViews",new Map),$(r,"elements",new Jo),$(r,"onContextMenu",function(i){r.emit({type:"contextmenu",data:{event:i,context:"root"}})}),r.container=n,n.style.overflow="hidden",n.addEventListener("contextmenu",r.onContextMenu),r.addPipe(function(i){return!i||!(ie(i)==="object"&&"type"in i)||(i.type==="nodecreated"&&r.addNodeView(i.data),i.type==="noderemoved"&&r.removeNodeView(i.data.id),i.type==="connectioncreated"&&r.addConnectionView(i.data),i.type==="connectionremoved"&&r.removeConnectionView(i.data.id),i.type==="render"&&r.elements.set(i.data),i.type==="unmount"&&r.elements.delete(i.data.element)),i}),r.area=new Zo(n,{zoomed:function(o){return r.emit({type:"zoomed",data:o})},pointerDown:function(o,a){r.emit({type:"pointerdown",data:{position:o,event:a}})},pointerMove:function(o,a){r.emit({type:"pointermove",data:{position:o,event:a}})},pointerUp:function(o,a){r.emit({type:"pointerup",data:{position:o,event:a}})},resize:function(o){r.emit({type:"resized",data:{event:o}})},translated:function(o){return r.emit({type:"translated",data:o})},reordered:function(o){return r.emit({type:"reordered",data:{element:o}})}},{translate:function(o){return r.emit({type:"translate",data:o})},zoom:function(o){return r.emit({type:"zoom",data:o})}}),r}return oe(t,e),F(t,[{key:"addNodeView",value:function(r){var i=this,o=r.id,a=new Qo(function(){return i.area.transform.k},{picked:function(){i.emit({type:"nodepicked",data:{id:o}})},translated:function(u){return i.emit({type:"nodetranslated",data:Kn({id:o},u)})},dragged:function(){i.emit({type:"nodedragged",data:r})},contextmenu:function(u){i.emit({type:"contextmenu",data:{event:u,context:r}})},resized:function(u){var c=u.size;return i.emit({type:"noderesized",data:{id:r.id,size:c}})}},{translate:function(u){return i.emit({type:"nodetranslate",data:Kn({id:o},u)})},resize:function(u){var c=u.size;return i.emit({type:"noderesize",data:{id:r.id,size:c}})}});return this.nodeViews.set(o,a),this.area.content.add(a.element),this.emit({type:"render",data:{element:a.element,type:"node",payload:r}}),a}},{key:"removeNodeView",value:function(r){var i=this.nodeViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.nodeViews.delete(r),this.area.content.remove(i.element))}},{key:"addConnectionView",value:function(r){var i=this,o=new Xo({contextmenu:function(s){i.emit({type:"contextmenu",data:{event:s,context:r}})}});return this.connectionViews.set(r.id,o),this.area.content.add(o.element),this.emit({type:"render",data:{element:o.element,type:"connection",payload:r}}),o}},{key:"removeConnectionView",value:function(r){var i=this.connectionViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.connectionViews.delete(r),this.area.content.remove(i.element))}},{key:"update",value:(function(){var n=T(S.mark(function i(o,a){var s;return S.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=this.elements.get(o,a),!s){c.next=4;break}return c.next=4,this.emit({type:"render",data:s});case 4:case"end":return c.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"resize",value:(function(){var n=T(S.mark(function i(o,a,s){var u;return S.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u=this.nodeViews.get(o),!u){l.next=5;break}return l.next=4,u.resize(a,s);case 4:return l.abrupt("return",l.sent);case 5:case"end":return l.stop()}},i,this)}));function r(i,o,a){return n.apply(this,arguments)}return r})()},{key:"translate",value:(function(){var n=T(S.mark(function i(o,a){var s,u,c;return S.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s=a.x,u=a.y,c=this.nodeViews.get(o),!c){f.next=6;break}return f.next=5,c.translate(s,u);case 5:return f.abrupt("return",f.sent);case 6:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"destroy",value:function(){var r=this;this.container.removeEventListener("contextmenu",this.onContextMenu),Array.from(this.connectionViews.keys()).forEach(function(i){return r.removeConnectionView(i)}),Array.from(this.nodeViews.keys()).forEach(function(i){return r.removeNodeView(i)}),this.area.destroy()}}])})(ft);function la(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=W(e))!==null;);return e}function qe(){return qe=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=la(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},qe.apply(null,arguments)}function da(e){if(Array.isArray(e))return e}function fa(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(e,t){return da(e)||fa(e,t)||Yr(e,t)||pa()}/*!
27
+ * */var Zo=(function(){function e(t){B(this,e),this.reordered=t,this.holder=document.createElement("div"),this.holder.style.transformOrigin="0 0"}return H(e,[{key:"getPointerFrom",value:function(n){var r=this.holder.getBoundingClientRect(),i=r.left,o=r.top,a=n.clientX-i,s=n.clientY-o;return{x:a,y:s}}},{key:"add",value:function(n){this.holder.appendChild(n)}},{key:"reorder",value:(function(){var t=T(O.mark(function r(i,o){return O.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.holder.contains(i)){s.next=2;break}throw new Error("content doesn't have 'target' for reordering");case 2:if(!(o!==null&&!this.holder.contains(o))){s.next=4;break}throw new Error("content doesn't have 'next' for reordering");case 4:return this.holder.insertBefore(i,o),s.next=7,this.reordered(i);case 7:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:function(n){this.holder.contains(n)&&this.holder.removeChild(n)}}])})();function Ko(e,t){var n=function(a){t.move(a)},r=function(a){window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r),t.up(a)},i=function(a){window.addEventListener("pointermove",n),window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),t.down(a)};return e.addEventListener("pointerdown",i),{destroy:function(){e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r)}}}var Ln=function(t){return t.length===0?0:Math.min.apply(Math,ve(t))},Bn=function(t){return t.length===0?0:Math.max.apply(Math,ve(t))};function Xr(e){var t=Ln(e.map(function(o){return o.position.x})),n=Ln(e.map(function(o){return o.position.y})),r=Bn(e.map(function(o){return o.position.x+o.width})),i=Bn(e.map(function(o){return o.position.y+o.height}));return{left:t,right:r,top:n,bottom:i,width:Math.abs(t-r),height:Math.abs(n-i),center:{x:(t+r)/2,y:(n+i)/2}}}function Hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ur=(function(){function e(t){var n=this;B(this,e),$(this,"down",function(r){n.guards.down(r)&&(r.stopPropagation(),n.pointerStart={x:r.pageX,y:r.pageY},n.startPosition=Yo({},n.config.getCurrentPosition()),n.events.start(r))}),$(this,"move",function(r){if(!(!n.pointerStart||!n.startPosition)&&n.guards.move(r)){r.preventDefault();var i={x:r.pageX-n.pointerStart.x,y:r.pageY-n.pointerStart.y},o=n.config.getZoom(),a=n.startPosition.x+i.x/o,s=n.startPosition.y+i.y/o;n.events.translate(a,s,r)}}),$(this,"up",function(r){n.pointerStart&&(delete n.pointerStart,n.events.drag(r))}),this.guards=t||{down:function(i){return!(i.pointerType==="mouse"&&i.button!==0)},move:function(){return!0}}}return H(e,[{key:"initialize",value:function(n,r,i){this.config=r,this.events=i,n.style.touchAction="none",this.pointerListener=Ko(n,{down:this.down,move:this.move,up:this.up})}},{key:"destroy",value:function(){this.pointerListener.destroy()}}])})(),Jr=8,Xo=24,Uo=1,Jo=2;function Qo(e,t){return t===Uo?e*Jr:t===Jo?e*Xo:e}function ea(e,t){if(e===0)return 0;var n=t/Jr,r=-e*n;return Math.sign(r)*Math.min(t,Math.abs(r))}var ta=(function(){function e(t){var n=this;B(this,e),$(this,"previous",null),$(this,"pointers",[]),$(this,"wheel",function(r){r.preventDefault();var i=Qo(r.deltaY,r.deltaMode),o=ea(i,n.intensity);if(o!==0){var a=n.element.getBoundingClientRect(),s=a.left,u=a.top,c=(s-r.clientX)*o,l=(u-r.clientY)*o;n.onzoom(o,c,l,"wheel")}}),$(this,"down",function(r){n.pointers.push(r)}),$(this,"move",function(r){if(n.pointers=n.pointers.map(function(h){return h.pointerId===r.pointerId?r:h}),!!n.isTranslating()){var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=n.getTouches(),u=s.cx,c=s.cy,l=s.distance;if(n.previous!==null&&n.previous.distance>0){var f=l/n.previous.distance-1,d=(o-u)*f,p=(a-c)*f;n.onzoom(f,d-(n.previous.cx-u),p-(n.previous.cy-c),"touch")}n.previous={cx:u,cy:c,distance:l}}}),$(this,"contextmenu",function(){n.pointers=[]}),$(this,"up",function(r){n.previous=null,n.pointers=n.pointers.filter(function(i){return i.pointerId!==r.pointerId})}),$(this,"dblclick",function(r){r.preventDefault();var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=4*n.intensity,u=(o-r.clientX)*s,c=(a-r.clientY)*s;n.onzoom(s,u,c,"dblclick")}),this.intensity=t}return H(e,[{key:"initialize",value:function(n,r,i){this.container=n,this.element=r,this.onzoom=i,this.container.addEventListener("wheel",this.wheel),this.container.addEventListener("pointerdown",this.down),this.container.addEventListener("dblclick",this.dblclick),window.addEventListener("pointermove",this.move),window.addEventListener("pointerup",this.up),window.addEventListener("pointercancel",this.up),window.addEventListener("contextmenu",this.contextmenu)}},{key:"getTouches",value:function(){var n={touches:this.pointers},r=[n.touches[0].clientX,n.touches[0].clientY],i=r[0],o=r[1],a=[n.touches[1].clientX,n.touches[1].clientY],s=a[0],u=a[1],c=Math.sqrt(Math.pow(i-s,2)+Math.pow(o-u,2));return{cx:(i+s)/2,cy:(o+u)/2,distance:c}}},{key:"isTranslating",value:function(){return this.pointers.length>=2}},{key:"destroy",value:function(){this.container.removeEventListener("wheel",this.wheel),this.container.removeEventListener("pointerdown",this.down),this.container.removeEventListener("dblclick",this.dblclick),window.removeEventListener("pointermove",this.move),window.removeEventListener("pointerup",this.up),window.removeEventListener("pointercancel",this.up),window.removeEventListener("contextmenu",this.contextmenu)}}])})(),na=(function(){function e(t,n,r){var i=this;B(this,e),$(this,"transform",{k:1,x:0,y:0}),$(this,"pointer",{x:0,y:0}),$(this,"zoomHandler",null),$(this,"dragHandler",null),$(this,"pointerdown",function(o){i.setPointerFrom(o),i.events.pointerDown(i.pointer,o)}),$(this,"pointermove",function(o){i.setPointerFrom(o),i.events.pointerMove(i.pointer,o)}),$(this,"pointerup",function(o){i.setPointerFrom(o),i.events.pointerUp(i.pointer,o)}),$(this,"resize",function(o){i.events.resize(o)}),$(this,"onTranslate",function(o,a){var s;(s=i.zoomHandler)!==null&&s!==void 0&&s.isTranslating()||i.translate(o,a)}),$(this,"onZoom",function(o,a,s,u){i.zoom(i.transform.k*(1+o),a,s,u),i.update()}),this.container=t,this.events=n,this.guards=r,this.content=new Zo(function(o){return i.events.reordered(o)}),this.content.holder.style.transformOrigin="0 0",this.setZoomHandler(new ta(.1)),this.setDragHandler(new Ur),this.container.addEventListener("pointerdown",this.pointerdown),this.container.addEventListener("pointermove",this.pointermove),window.addEventListener("pointerup",this.pointerup),window.addEventListener("resize",this.resize),t.appendChild(this.content.holder),this.update()}return H(e,[{key:"update",value:function(){var n=this.transform,r=n.x,i=n.y,o=n.k;this.content.holder.style.transform="translate(".concat(r,"px, ").concat(i,"px) scale(").concat(o,")")}},{key:"setDragHandler",value:function(n){var r=this;this.dragHandler&&this.dragHandler.destroy(),this.dragHandler=n,this.dragHandler&&this.dragHandler.initialize(this.container,{getCurrentPosition:function(){return r.transform},getZoom:function(){return 1}},{start:function(){return null},translate:this.onTranslate,drag:function(){return null}})}},{key:"setZoomHandler",value:function(n){this.zoomHandler&&this.zoomHandler.destroy(),this.zoomHandler=n,this.zoomHandler&&this.zoomHandler.initialize(this.container,this.content.holder,this.onZoom)}},{key:"setPointerFrom",value:function(n){var r=this.content.getPointerFrom(n),i=r.x,o=r.y,a=this.transform.k;this.pointer={x:i/a,y:o/a}}},{key:"translate",value:(function(){var t=T(O.mark(function r(i,o){var a,s;return O.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a={x:i,y:o},c.next=3,this.guards.translate({previous:this.transform,position:a});case 3:if(s=c.sent,s){c.next=6;break}return c.abrupt("return",!1);case 6:return this.transform.x=s.data.position.x,this.transform.y=s.data.position.y,this.update(),c.next=11,this.events.translated(s.data);case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"zoom",value:(function(){var t=T(O.mark(function r(i){var o,a,s,u,c,l,f=arguments;return O.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=f.length>1&&f[1]!==void 0?f[1]:0,a=f.length>2&&f[2]!==void 0?f[2]:0,s=f.length>3?f[3]:void 0,u=this.transform.k,p.next=6,this.guards.zoom({previous:this.transform,zoom:i,source:s});case 6:if(c=p.sent,c){p.next=9;break}return p.abrupt("return",!0);case 9:return l=(u-c.data.zoom)/(u-i||1),this.transform.k=c.data.zoom||1,this.transform.x+=o*l,this.transform.y+=a*l,this.update(),p.next=16,this.events.zoomed(c.data);case 16:return p.abrupt("return",!1);case 17:case"end":return p.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"destroy",value:function(){this.container.removeEventListener("pointerdown",this.pointerdown),this.container.removeEventListener("pointermove",this.pointermove),window.removeEventListener("pointerup",this.pointerup),window.removeEventListener("resize",this.resize),this.dragHandler&&this.dragHandler.destroy(),this.zoomHandler&&this.zoomHandler.destroy(),this.content.holder.innerHTML=""}}])})();function ra(e,t,n){return t=W(t),me(e,Qr()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function Qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qr=function(){return!!e})()}var ft=(function(e){function t(){return B(this,t),ra(this,t,arguments)}return oe(t,e),H(t)})(Ye),ia=H(function e(t){B(this,e),this.element=document.createElement("div"),this.element.style.position="absolute",this.element.style.left="0",this.element.style.top="0",this.element.addEventListener("contextmenu",function(n){t.contextmenu(n)})}),oa=(function(){function e(){B(this,e),$(this,"views",new WeakMap),$(this,"viewsElements",new Map)}return H(e,[{key:"set",value:function(n){var r=n.element,i=n.type,o=n.payload;o!=null&&o.id&&(this.views.set(r,n),this.viewsElements.set("".concat(i,"_").concat(o.id),r))}},{key:"get",value:function(n,r){var i=this.viewsElements.get("".concat(n,"_").concat(r));return i&&this.views.get(i)}},{key:"delete",value:function(n){var r,i=this.views.get(n);i&&(r=i.payload)!==null&&r!==void 0&&r.id&&(this.views.delete(n),this.viewsElements.delete("".concat(i.type,"_").concat(i.payload.id)))}}])})();function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var aa=(function(){function e(t,n,r){var i=this;B(this,e),$(this,"translate",(function(){var o=T(O.mark(function a(s,u){var c,l;return O.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c=Gn({},i.position),d.next=3,i.guards.translate({previous:c,position:{x:s,y:u}});case 3:if(l=d.sent,l){d.next=6;break}return d.abrupt("return",!1);case 6:return i.position=Gn({},l.data.position),i.element.style.transform="translate(".concat(i.position.x,"px, ").concat(i.position.y,"px)"),d.next=10,i.events.translated({position:i.position,previous:c});case 10:return d.abrupt("return",!0);case 11:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),$(this,"resize",(function(){var o=T(O.mark(function a(s,u){var c,l;return O.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c={width:s,height:u},d.next=3,i.guards.resize({size:c});case 3:if(d.sent){d.next=5;break}return d.abrupt("return",!1);case 5:if(l=i.element.querySelector("*:not(span):not([fragment])"),!(!l||!(l instanceof HTMLElement))){d.next=8;break}return d.abrupt("return",!1);case 8:return l.style.width="".concat(s,"px"),l.style.height="".concat(u,"px"),d.next=12,i.events.resized({size:c});case 12:return d.abrupt("return",!0);case 13:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),this.getZoom=t,this.events=n,this.guards=r,this.element=document.createElement("div"),this.element.style.position="absolute",this.position={x:0,y:0},this.translate(0,0),this.element.addEventListener("contextmenu",function(o){i.events.contextmenu(o)}),this.dragHandler=new Ur,this.dragHandler.initialize(this.element,{getCurrentPosition:function(){return i.position},getZoom:function(){return i.getZoom()}},{start:this.events.picked,translate:this.translate,drag:this.events.dragged})}return H(e,[{key:"destroy",value:function(){this.dragHandler.destroy()}}])})();function ei(e,t){return e.map(function(n){return{view:t.get(n.id),node:n}}).filter(function(n){return n.view}).map(function(n){var r=n.view,i=n.node,o=i.width,a=i.height;return typeof o<"u"&&typeof a<"u"?{position:r.position,width:o,height:a}:{position:r.position,width:r.element.clientWidth,height:r.element.clientHeight}})}function sa(e,t){var n=e.parentScope(Pe),r=t.map(function(o){return ne(o)==="object"?o:n.getNode(o)}),i=ei(r,e.nodeViews);return Xr(i)}function ua(e){var t=e;t.addPipe(function(n){if(!n||ne(n)!=="object"||!("type"in n))return n;if(n.type==="nodepicked"){var r=t.nodeViews.get(n.data.id),i=t.area.content;r&&i.reorder(r.element,null)}if(n.type==="connectioncreated"){var o=t.connectionViews.get(n.data.id),a=t.area.content;o&&a.reorder(o.element,a.holder.firstChild)}return n})}var ca=0,Vn=1;function la(e){var t=e,n=Vn,r=function(s){var u=t.nodeViews.get(s);u&&(u.element.style.zIndex=String(Vn))},i=function(s){var u=t.nodeViews.get(s);u&&(n+=1,u.element.style.zIndex=String(n))},o=function(s){var u=t.connectionViews.get(s);u&&(u.element.style.zIndex=String(ca))};t.addPipe(function(a){return!a||ne(a)!=="object"||!("type"in a)||(a.type==="nodecreated"&&r(a.data.id),a.type==="nodepicked"&&i(a.data.id),a.type==="connectioncreated"&&o(a.data.id)),a})}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function da(e,t){var n=t!=null&&t.scaling?t.scaling===!0?{min:.1,max:1}:t.scaling:!1,r=t!=null&&t.translation?t.translation===!0?{left:0,top:0,right:1e3,bottom:1e3}:t.translation:!1;function i(a){if(!n)throw new Error("scaling param isnt defined");var s=typeof n=="function"?n():n,u=s.min,c=s.max;return a<u?u:a>c?c:a}function o(a){if(!r)throw new Error("translation param isnt defined");var s=fe({},a),u=typeof r=="function"?r():r,c=u.left,l=u.top,f=u.right,d=u.bottom;return s.x<c&&(s.x=c),s.x>f&&(s.x=f),s.y<l&&(s.y=l),s.y>d&&(s.y=d),s}e.addPipe(function(a){if(!a||ne(a)!=="object"||!("type"in a))return a;if(n&&a.type==="zoom")return fe(fe({},a),{},{data:fe(fe({},a.data),{},{zoom:i(a.data.zoom)})});if(r&&a.type==="zoomed"){var s=o(e.area.transform);e.area.translate(s.x,s.y)}return r&&a.type==="translate"?fe(fe({},a),{},{data:fe(fe({},a.data),{},{position:o(a.data.position)})}):a})}function fa(){var e=!1;function t(r){(r.key==="Control"||r.key==="Meta")&&(e=!0)}function n(r){(r.key==="Control"||r.key==="Meta")&&(e=!1)}return document.addEventListener("keydown",t),document.addEventListener("keyup",n),{active:function(){return e},destroy:function(){document.removeEventListener("keydown",t),document.removeEventListener("keyup",n)}}}var ti=(function(){function e(){B(this,e),$(this,"entities",new Map),$(this,"pickId",null)}return H(e,[{key:"isSelected",value:function(n){return this.entities.has("".concat(n.label,"_").concat(n.id))}},{key:"add",value:(function(){var t=T(O.mark(function r(i,o){var a;return O.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(a="".concat(i.label,"_").concat(i.id),o){u.next=4;break}return u.next=4,this.unselect(Array.from(this.entities.values()).filter(function(c){return c.label!==i.label||c.id!==i.id}));case 4:this.entities.set(a,i);case 5:case"end":return u.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:(function(){var t=T(O.mark(function r(i){var o,a;return O.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o="".concat(i.label,"_").concat(i.id),a=this.entities.get(o),!a){u.next=6;break}return this.entities.delete(o),u.next=6,a.unselect();case 6:case"end":return u.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"unselect",value:(function(){var t=T(O.mark(function r(i){var o=this;return O.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Promise.all(Array.from(i).map(function(u){return o.remove(u)}));case 2:case"end":return s.stop()}},r)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"unselectAll",value:(function(){var t=T(O.mark(function r(){return O.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.unselect(this.entities.values());case 2:case"end":return o.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n})()},{key:"translate",value:(function(){var t=T(O.mark(function r(i,o){var a=this;return O.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all(Array.from(this.entities.values()).map(function(c){return!a.isPicked(c)&&c.translate(i,o)}));case 2:case"end":return u.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"pick",value:function(n){this.pickId="".concat(n.label,"_").concat(n.id)}},{key:"release",value:function(){this.pickId=null}},{key:"isPicked",value:function(n){return this.pickId==="".concat(n.label,"_").concat(n.id)}}])})();function pa(){return new ti}function ha(e,t,n){var r=null,i=e,o=function(){return r||(r=i.parentScope(Pe))},a=0;function s(p){p.selected||(p.selected=!0,i.update("node",p.id))}function u(p){p.selected&&(p.selected=!1,i.update("node",p.id))}function c(p,h){return l.apply(this,arguments)}function l(){return l=T(O.mark(function p(h,y){var m;return O.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(m=o().getNode(h),m){v.next=3;break}return v.abrupt("return");case 3:return v.next=5,t.add({label:"node",id:m.id,translate:function(E,_){return T(O.mark(function I(){var P,j;return O.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(P=i.nodeViews.get(m.id),j=P==null?void 0:P.position,!j){N.next=5;break}return N.next=5,P.translate(j.x+E,j.y+_);case 5:case"end":return N.stop()}},I)}))()},unselect:function(){u(m)}},y);case 5:s(m);case 6:case"end":return v.stop()}},p)})),l.apply(this,arguments)}function f(p){return d.apply(this,arguments)}function d(){return d=T(O.mark(function p(h){return O.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,t.remove({id:h,label:"node"});case 2:case"end":return m.stop()}},p)})),d.apply(this,arguments)}return i.addPipe((function(){var p=T(O.mark(function h(y){var m,k,v,w,E,_,I,P;return O.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!(!y||ne(y)!=="object"||!("type"in y))){A.next=2;break}return A.abrupt("return",y);case 2:if(y.type!=="nodepicked"){A.next=11;break}return m=y.data.id,k=n.accumulating.active(),t.pick({id:m,label:"node"}),a=null,A.next=9,c(m,k);case 9:A.next=33;break;case 11:if(y.type!=="nodetranslated"){A.next=20;break}if(v=y.data,w=v.id,E=v.position,_=v.previous,I=E.x-_.x,P=E.y-_.y,!t.isPicked({id:w,label:"node"})){A.next=18;break}return A.next=18,t.translate(I,P);case 18:A.next=33;break;case 20:if(y.type!=="pointerdown"){A.next=24;break}a=0,A.next=33;break;case 24:if(y.type!=="pointermove"){A.next=28;break}a!==null&&a++,A.next=33;break;case 28:if(y.type!=="pointerup"){A.next=33;break}if(!(a!==null&&a<4)){A.next=32;break}return A.next=32,t.unselectAll();case 32:a=null;case 33:return A.abrupt("return",y);case 34:case"end":return A.stop()}},h)}));return function(h){return p.apply(this,arguments)}})()),{select:c,unselect:f}}function va(e,t){var n=null,r=function(){return n||(n=e.parentScope(Pe))};function i(o,a){var s=r().getNode(o);if(s){var u=s.inputs[a];if(!u)throw new Error("cannot find input");var c=u.showControl,l=r().getConnections(),f=!!l.find(function(d){return d.target===o&&d.targetInput===a});u.showControl=t?t({hasAnyConnection:f,input:u}):!f,u.showControl!==c&&e.update("node",s.id)}}e.addPipe(function(o){return(o.type==="connectioncreated"||o.type==="connectionremoved")&&i(o.data.target,o.data.targetInput),o})}function qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ma(e,t){var n=e,r=typeof(t==null?void 0:t.size)>"u"?16:t.size,i=typeof(t==null?void 0:t.dynamic)>"u"?!0:t.dynamic;function o(a){return Math.round(a/r)*r}n.addPipe(function(a){if(!a||ne(a)!=="object"||!("type"in a))return a;if(i&&a.type==="nodetranslate"){var s=a.data.position,u=o(s.x),c=o(s.y);return Je(Je({},a),{},{data:Je(Je({},a.data),{},{position:{x:u,y:c}})})}if(!i&&a.type==="nodedragged"){var l=n.nodeViews.get(a.data.id);if(l){var f=l.position,d=f.x,p=f.y;l.translate(o(d),o(p))}}return a})}function ya(e,t,n){return qt.apply(this,arguments)}function qt(){return qt=T(O.mark(function e(t,n,r){var i,o,a,s,u,c,l,f,d,p,h,y,m;return O.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return i=r||{},o=i.scale,a=o===void 0?.9:o,s=t.parentScope(Pe),u=n.map(function(w){return ne(w)==="object"?w:s.getNode(w)}),c=ei(u,t.nodeViews),l=Xr(c),f=[t.container.clientWidth,t.container.clientHeight],d=f[0],p=f[1],h=d/l.width,y=p/l.height,m=Math.min(y*a,h*a,1),t.area.transform.x=d/2-l.center.x*m,t.area.transform.y=p/2-l.center.y*m,v.next=12,t.area.zoom(m,0,0);case 12:case"end":return v.stop()}},e)})),qt.apply(this,arguments)}var Qe=Object.freeze({__proto__:null,getBoundingBox:sa,simpleNodesOrder:ua,zIndexNodesOrder:la,restrictor:da,accumulateOnCtrl:fa,selectableNodes:ha,Selector:ti,selector:pa,showInputControl:va,snapGrid:ma,zoomAt:ya});function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ga(e,t,n){return t=W(t),me(e,ni()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function ni(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ni=function(){return!!e})()}var ri=(function(e){function t(n){var r;return B(this,t),r=ga(this,t,["area"]),$(r,"nodeViews",new Map),$(r,"connectionViews",new Map),$(r,"elements",new oa),$(r,"onContextMenu",function(i){r.emit({type:"contextmenu",data:{event:i,context:"root"}})}),r.container=n,n.style.overflow="hidden",n.addEventListener("contextmenu",r.onContextMenu),r.addPipe(function(i){return!i||!(ne(i)==="object"&&"type"in i)||(i.type==="nodecreated"&&r.addNodeView(i.data),i.type==="noderemoved"&&r.removeNodeView(i.data.id),i.type==="connectioncreated"&&r.addConnectionView(i.data),i.type==="connectionremoved"&&r.removeConnectionView(i.data.id),i.type==="render"&&r.elements.set(i.data),i.type==="unmount"&&r.elements.delete(i.data.element)),i}),r.area=new na(n,{zoomed:function(o){return r.emit({type:"zoomed",data:o})},pointerDown:function(o,a){r.emit({type:"pointerdown",data:{position:o,event:a}})},pointerMove:function(o,a){r.emit({type:"pointermove",data:{position:o,event:a}})},pointerUp:function(o,a){r.emit({type:"pointerup",data:{position:o,event:a}})},resize:function(o){r.emit({type:"resized",data:{event:o}})},translated:function(o){return r.emit({type:"translated",data:o})},reordered:function(o){return r.emit({type:"reordered",data:{element:o}})}},{translate:function(o){return r.emit({type:"translate",data:o})},zoom:function(o){return r.emit({type:"zoom",data:o})}}),r}return oe(t,e),H(t,[{key:"addNodeView",value:function(r){var i=this,o=r.id,a=new aa(function(){return i.area.transform.k},{picked:function(){i.emit({type:"nodepicked",data:{id:o}})},translated:function(u){return i.emit({type:"nodetranslated",data:Kn({id:o},u)})},dragged:function(){i.emit({type:"nodedragged",data:r})},contextmenu:function(u){i.emit({type:"contextmenu",data:{event:u,context:r}})},resized:function(u){var c=u.size;return i.emit({type:"noderesized",data:{id:r.id,size:c}})}},{translate:function(u){return i.emit({type:"nodetranslate",data:Kn({id:o},u)})},resize:function(u){var c=u.size;return i.emit({type:"noderesize",data:{id:r.id,size:c}})}});return this.nodeViews.set(o,a),this.area.content.add(a.element),this.emit({type:"render",data:{element:a.element,type:"node",payload:r}}),a}},{key:"removeNodeView",value:function(r){var i=this.nodeViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.nodeViews.delete(r),this.area.content.remove(i.element))}},{key:"addConnectionView",value:function(r){var i=this,o=new ia({contextmenu:function(s){i.emit({type:"contextmenu",data:{event:s,context:r}})}});return this.connectionViews.set(r.id,o),this.area.content.add(o.element),this.emit({type:"render",data:{element:o.element,type:"connection",payload:r}}),o}},{key:"removeConnectionView",value:function(r){var i=this.connectionViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.connectionViews.delete(r),this.area.content.remove(i.element))}},{key:"update",value:(function(){var n=T(O.mark(function i(o,a){var s;return O.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=this.elements.get(o,a),!s){c.next=4;break}return c.next=4,this.emit({type:"render",data:s});case 4:case"end":return c.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"resize",value:(function(){var n=T(O.mark(function i(o,a,s){var u;return O.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u=this.nodeViews.get(o),!u){l.next=5;break}return l.next=4,u.resize(a,s);case 4:return l.abrupt("return",l.sent);case 5:case"end":return l.stop()}},i,this)}));function r(i,o,a){return n.apply(this,arguments)}return r})()},{key:"translate",value:(function(){var n=T(O.mark(function i(o,a){var s,u,c;return O.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s=a.x,u=a.y,c=this.nodeViews.get(o),!c){f.next=6;break}return f.next=5,c.translate(s,u);case 5:return f.abrupt("return",f.sent);case 6:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"destroy",value:function(){var r=this;this.container.removeEventListener("contextmenu",this.onContextMenu),Array.from(this.connectionViews.keys()).forEach(function(i){r.removeConnectionView(i)}),Array.from(this.nodeViews.keys()).forEach(function(i){r.removeNodeView(i)}),this.area.destroy()}}])})(ft);function ba(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=W(e))!==null;);return e}function qe(){return qe=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=ba(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},qe.apply(null,arguments)}function wa(e){if(Array.isArray(e))return e}function ka(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function xa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ie(e,t){return wa(e)||ka(e,t)||Yr(e,t)||xa()}/*!
29
29
  * rete-connection-plugin v2.0.4
30
30
  * (c) 2024 Vitaliy Stoliarov
31
31
  * Released under the MIT license.
32
- * */function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ha(e){var t=null,n=null;function r(o){n&&o.removeConnectionView(n),t=null,n=null}function i(o){r(o),n="pseudo_".concat($e())}return{isMounted:function(){return!!n},mount:i,render:function(a,s,u){var c=s.x,l=s.y,f=u.side==="output",d={x:c+(f?-3:3),y:l};if(!n)throw new Error("pseudo connection id wasn't generated");var p=f?Nt({id:n,source:u.nodeId,sourceOutput:u.key,target:"",targetInput:""},e??{}):Nt({id:n,target:u.nodeId,targetInput:u.key,source:"",sourceOutput:""},e??{});if(!t){var h=a.addConnectionView(p);t=h.element}t&&a.emit({type:"render",data:Nt({element:t,type:"connection",payload:p},f?{end:d}:{start:d})})},unmount:r}}function va(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ma(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function ma(e,t){if(e){if(typeof e=="string")return Zn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zn(e,t):void 0}}function Zn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ya(e,t){var n=va(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value,o=e.get(i);if(o)return o}}catch(a){n.e(a)}finally{n.f()}}function ni(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,i=r.elementsFromPoint(e,t),o=(n=i[0])===null||n===void 0?void 0:n.shadowRoot;return o&&o!==r&&i.unshift.apply(i,de(ni(e,t,o))),i}var pn=(function(){function e(){B(this,e)}return F(e,[{key:"setContext",value:function(n){this.context=n}}])})();function ri(e,t){var n=e.side==="output"&&t.side==="input",r=e.side==="input"&&t.side==="output",i=n?[e,t]:r?[t,e]:[],o=re(i,2),a=o[0],s=o[1];if(a&&s)return[a,s]}function ga(e,t){return!!ri(e,t)}function ba(e,t,n){var r=ri(e,t)||[null,null],i=re(r,2),o=i[0],a=i[1];if(o&&a)return n.editor.addConnection({id:$e(),source:o.nodeId,sourceOutput:o.key,target:a.nodeId,targetInput:a.key}),!0}function wa(e,t){var n=t.getNode(e.nodeId);if(!n)throw new Error("cannot find node");var r=e.side==="input"?n.inputs:n.outputs;return r[e.key]}function ka(e,t){var n=e.nodeId,r=e.side,i=e.key;return t.getConnections().filter(function(o){if(r==="input")return o.target===n&&o.targetInput===i;if(r==="output")return o.source===n&&o.sourceOutput===i})}function Kt(e,t){var n=e.map(function(r){var i=wa(r,t),o=i==null?void 0:i.multipleConnections;return o?[]:ka(r,t)}).flat();return{commit:function(){var i=Array.from(new Set(n.map(function(o){var a=o.id;return a})));i.forEach(function(o){t.removeConnection(o)})}}}function hn(e,t,n){return t=W(t),me(e,ii()?Reflect.construct(t,[],W(e).constructor):t.apply(e,n))}function ii(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ii=function(){return!!e})()}var xa=(function(e){function t(n,r){var i;return B(this,t),i=hn(this,t),i.initial=n,i.params=r,i}return oe(t,e),F(t,[{key:"pick",value:(function(){var n=T(S.mark(function i(o,a){var s,u;return S.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:s=o.socket,this.params.canMakeConnection(this.initial,s)&&(Kt([this.initial,s],a.editor).commit(),u=this.params.makeConnection(this.initial,s,a),this.drop(a,u?s:null,u));case 2:case"end":return l.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new vn(this.params))}}])})(pn),Oa=(function(e){function t(n,r,i){var o;B(this,t),o=hn(this,t),o.connection=n,o.params=r;var a=Array.from(i.socketsCache.values()).find(function(s){return s.nodeId===o.connection.source&&s.side==="output"&&s.key===o.connection.sourceOutput});if(!a)throw new Error("cannot find output socket");return o.outputSocket=a,o}return oe(t,e),F(t,[{key:"init",value:(function(){var n=T(S.mark(function i(o){var a=this;return S.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o.scope.emit({type:"connectionpick",data:{socket:this.outputSocket}}).then(function(c){c?(o.editor.removeConnection(a.connection.id),a.initial=a.outputSocket):a.drop(o)});case 1:case"end":return u.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"pick",value:(function(){var n=T(S.mark(function i(o,a){var s,u,c,l,f,d;return S.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:s=o.socket,u=o.event,this.initial&&!(s.side==="input"&&this.connection.target===s.nodeId&&this.connection.targetInput===s.key)?this.params.canMakeConnection(this.initial,s)&&(Kt([this.initial,s],a.editor).commit(),c=this.params.makeConnection(this.initial,s,a),l=c?s:null,this.drop(a,l,c)):u==="down"&&this.initial&&(Kt([this.initial,s],a.editor).commit(),f=this.params.makeConnection(this.initial,s,a),d=f?null:s,this.drop(a,d,f));case 2:case"end":return h.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new vn(this.params))}}])})(pn),vn=(function(e){function t(n){var r;return B(this,t),r=hn(this,t),r.params=n,r}return oe(t,e),F(t,[{key:"pick",value:(function(){var n=T(S.mark(function i(o,a){var s,u,c,l;return S.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(s=o.socket,u=o.event,u==="down"){d.next=3;break}return d.abrupt("return");case 3:if(s.side!=="input"){d.next=11;break}if(c=a.editor.getConnections().find(function(p){return p.target===s.nodeId&&p.targetInput===s.key}),!c){d.next=11;break}return l=new Oa(c,this.params,a),d.next=9,l.init(a);case 9:return this.context.switchTo(l),d.abrupt("return");case 11:return d.next=13,a.scope.emit({type:"connectionpick",data:{socket:s}});case 13:if(!d.sent){d.next=17;break}this.context.switchTo(new xa(s,this.params)),d.next=18;break;case 17:this.drop(a);case 18:case"end":return d.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),delete this.initial}}])})(pn),Sa=(function(){function e(t){B(this,e);var n=(t==null?void 0:t.canMakeConnection)||ga,r=(t==null?void 0:t.makeConnection)||ba;this.switchTo(new vn({canMakeConnection:n,makeConnection:r}))}return F(e,[{key:"pick",value:(function(){var t=T(S.mark(function r(i,o){return S.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.currentState.pick(i,o);case 2:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"getPickedSocket",value:function(){return this.currentState.initial}},{key:"switchTo",value:function(n){n.setContext(this),this.currentState=n}},{key:"drop",value:function(n){this.currentState.drop(n)}}])})();function Ca(){return function(){return new Sa}}var Pa=Object.freeze({__proto__:null,setup:Ca}),$a=Object.freeze({__proto__:null,classic:Pa});function ja(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_a(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
34
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function _a(e,t){if(e){if(typeof e=="string")return Un(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(e,t):void 0}}function Un(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ea(e,t,n){return t=W(t),me(e,oi()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oi=function(){return!!e})()}function Aa(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var Ra=(function(e){function t(){var n;return B(this,t),n=Ea(this,t,["connection"]),$(n,"presets",[]),$(n,"currentFlow",null),$(n,"preudoconnection",ha({isPseudo:!0})),$(n,"socketsCache",new Map),n}return oe(t,e),F(t,[{key:"addPreset",value:function(r){this.presets.push(r)}},{key:"findPreset",value:function(r){var i=ja(this.presets),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=a(r);if(s)return s}}catch(u){i.e(u)}finally{i.f()}return null}},{key:"update",value:function(){if(this.currentFlow){var r=this.currentFlow.getPickedSocket();r&&this.preudoconnection.render(this.areaPlugin,this.areaPlugin.area.pointer,r)}}},{key:"drop",value:function(){var r={editor:this.editor,scope:this,socketsCache:this.socketsCache};this.currentFlow&&(this.currentFlow.drop(r),this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null)}},{key:"pick",value:(function(){var n=T(S.mark(function i(o,a){var s,u,c;return S.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s={editor:this.editor,scope:this,socketsCache:this.socketsCache},u=ni(o.clientX,o.clientY),c=ya(this.socketsCache,u),!c){f.next=13;break}if(o.preventDefault(),o.stopPropagation(),this.currentFlow=this.currentFlow||this.findPreset(c),!this.currentFlow){f.next=11;break}return f.next=10,this.currentFlow.pick({socket:c,event:a},s);case 10:this.preudoconnection.mount(this.areaPlugin);case 11:f.next=14;break;case 13:this.currentFlow&&this.currentFlow.drop(s);case 14:this.currentFlow&&!this.currentFlow.getPickedSocket()&&(this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null),this.update();case 16:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"setParent",value:function(r){var i=this;Aa(t,"setParent",this)([r]),this.areaPlugin=this.parentScope(ft),this.editor=this.areaPlugin.parentScope(Pe);var o=function(s){i.pick(s,"down")};this.addPipe(function(a){if(!a||ie(a)!=="object"||!("type"in a))return a;if(a.type==="pointermove")i.update();else if(a.type==="pointerup")i.pick(a.data.event,"up");else if(a.type==="render"){if(a.data.type==="socket"){var s=a.data.element;s.addEventListener("pointerdown",o),i.socketsCache.set(s,a.data)}}else if(a.type==="unmount"){var u=a.data.element;u.removeEventListener("pointerdown",o),i.socketsCache.delete(u)}return a})}}])})(Ze);/*!
32
+ * */function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oa(e){var t=null,n=null;function r(o){n&&o.removeConnectionView(n),t=null,n=null}function i(o){r(o),n="pseudo_".concat($e())}return{isMounted:function(){return!!n},mount:i,render:function(a,s,u){var c=s.x,l=s.y,f=u.side==="output",d={x:c+(f?-3:3),y:l};if(!n)throw new Error("pseudo connection id wasn't generated");var p=f?Rt({id:n,source:u.nodeId,sourceOutput:u.key,target:"",targetInput:""},e??{}):Rt({id:n,target:u.nodeId,targetInput:u.key,source:"",sourceOutput:""},e??{});if(!t){var h=a.addConnectionView(p);t=h.element}t&&a.emit({type:"render",data:Rt({element:t,type:"connection",payload:p},f?{end:d}:{start:d})})},unmount:r}}function Sa(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ca(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Ca(e,t){if(e){if(typeof e=="string")return Xn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}function Xn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Pa(e,t){var n=Sa(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value,o=e.get(i);if(o)return o}}catch(a){n.e(a)}finally{n.f()}}function ii(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,i=r.elementsFromPoint(e,t),o=(n=i[0])===null||n===void 0?void 0:n.shadowRoot;return o&&o!==r&&i.unshift.apply(i,ve(ii(e,t,o))),i}var pn=(function(){function e(){B(this,e)}return H(e,[{key:"setContext",value:function(n){this.context=n}}])})();function oi(e,t){var n=e.side==="output"&&t.side==="input",r=e.side==="input"&&t.side==="output",i=n?[e,t]:r?[t,e]:[],o=ie(i,2),a=o[0],s=o[1];if(a&&s)return[a,s]}function $a(e,t){return!!oi(e,t)}function _a(e,t,n){var r=oi(e,t)||[null,null],i=ie(r,2),o=i[0],a=i[1];if(o&&a)return n.editor.addConnection({id:$e(),source:o.nodeId,sourceOutput:o.key,target:a.nodeId,targetInput:a.key}),!0}function ja(e,t){var n=t.getNode(e.nodeId);if(!n)throw new Error("cannot find node");var r=e.side==="input"?n.inputs:n.outputs;return r[e.key]}function Ea(e,t){var n=e.nodeId,r=e.side,i=e.key;return t.getConnections().filter(function(o){if(r==="input")return o.target===n&&o.targetInput===i;if(r==="output")return o.source===n&&o.sourceOutput===i})}function Zt(e,t){var n=e.map(function(r){var i=ja(r,t),o=i==null?void 0:i.multipleConnections;return o?[]:Ea(r,t)}).flat();return{commit:function(){var i=Array.from(new Set(n.map(function(o){var a=o.id;return a})));i.forEach(function(o){t.removeConnection(o)})}}}function hn(e,t,n){return t=W(t),me(e,ai()?Reflect.construct(t,[],W(e).constructor):t.apply(e,n))}function ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ai=function(){return!!e})()}var Aa=(function(e){function t(n,r){var i;return B(this,t),i=hn(this,t),i.initial=n,i.params=r,i}return oe(t,e),H(t,[{key:"pick",value:(function(){var n=T(O.mark(function i(o,a){var s,u;return O.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:s=o.socket,this.params.canMakeConnection(this.initial,s)&&(Zt([this.initial,s],a.editor).commit(),u=this.params.makeConnection(this.initial,s,a),this.drop(a,u?s:null,u));case 2:case"end":return l.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new vn(this.params))}}])})(pn),Ia=(function(e){function t(n,r,i){var o;B(this,t),o=hn(this,t),o.connection=n,o.params=r;var a=Array.from(i.socketsCache.values()).find(function(s){return s.nodeId===o.connection.source&&s.side==="output"&&s.key===o.connection.sourceOutput});if(!a)throw new Error("cannot find output socket");return o.outputSocket=a,o}return oe(t,e),H(t,[{key:"init",value:(function(){var n=T(O.mark(function i(o){var a=this;return O.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o.scope.emit({type:"connectionpick",data:{socket:this.outputSocket}}).then(function(c){c?(o.editor.removeConnection(a.connection.id),a.initial=a.outputSocket):a.drop(o)});case 1:case"end":return u.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"pick",value:(function(){var n=T(O.mark(function i(o,a){var s,u,c,l,f,d;return O.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:s=o.socket,u=o.event,this.initial&&!(s.side==="input"&&this.connection.target===s.nodeId&&this.connection.targetInput===s.key)?this.params.canMakeConnection(this.initial,s)&&(Zt([this.initial,s],a.editor).commit(),c=this.params.makeConnection(this.initial,s,a),l=c?s:null,this.drop(a,l,c)):u==="down"&&this.initial&&(Zt([this.initial,s],a.editor).commit(),f=this.params.makeConnection(this.initial,s,a),d=f?null:s,this.drop(a,d,f));case 2:case"end":return h.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new vn(this.params))}}])})(pn),vn=(function(e){function t(n){var r;return B(this,t),r=hn(this,t),r.params=n,r}return oe(t,e),H(t,[{key:"pick",value:(function(){var n=T(O.mark(function i(o,a){var s,u,c,l;return O.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(s=o.socket,u=o.event,u==="down"){d.next=3;break}return d.abrupt("return");case 3:if(s.side!=="input"){d.next=11;break}if(c=a.editor.getConnections().find(function(p){return p.target===s.nodeId&&p.targetInput===s.key}),!c){d.next=11;break}return l=new Ia(c,this.params,a),d.next=9,l.init(a);case 9:return this.context.switchTo(l),d.abrupt("return");case 11:return d.next=13,a.scope.emit({type:"connectionpick",data:{socket:s}});case 13:if(!d.sent){d.next=17;break}this.context.switchTo(new Aa(s,this.params)),d.next=18;break;case 17:this.drop(a);case 18:case"end":return d.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),delete this.initial}}])})(pn),Na=(function(){function e(t){B(this,e);var n=(t==null?void 0:t.canMakeConnection)||$a,r=(t==null?void 0:t.makeConnection)||_a;this.switchTo(new vn({canMakeConnection:n,makeConnection:r}))}return H(e,[{key:"pick",value:(function(){var t=T(O.mark(function r(i,o){return O.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.currentState.pick(i,o);case 2:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"getPickedSocket",value:function(){return this.currentState.initial}},{key:"switchTo",value:function(n){n.setContext(this),this.currentState=n}},{key:"drop",value:function(n){this.currentState.drop(n)}}])})();function Ra(){return function(){return new Na}}var za=Object.freeze({__proto__:null,setup:Ra}),Ma=Object.freeze({__proto__:null,classic:za});function Da(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ta(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
34
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Ta(e,t){if(e){if(typeof e=="string")return Un(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(e,t):void 0}}function Un(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function La(e,t,n){return t=W(t),me(e,si()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(si=function(){return!!e})()}function Ba(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var Ha=(function(e){function t(){var n;return B(this,t),n=La(this,t,["connection"]),$(n,"presets",[]),$(n,"currentFlow",null),$(n,"preudoconnection",Oa({isPseudo:!0})),$(n,"socketsCache",new Map),n}return oe(t,e),H(t,[{key:"addPreset",value:function(r){this.presets.push(r)}},{key:"findPreset",value:function(r){var i=Da(this.presets),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=a(r);if(s)return s}}catch(u){i.e(u)}finally{i.f()}return null}},{key:"update",value:function(){if(this.currentFlow){var r=this.currentFlow.getPickedSocket();r&&this.preudoconnection.render(this.areaPlugin,this.areaPlugin.area.pointer,r)}}},{key:"drop",value:function(){var r={editor:this.editor,scope:this,socketsCache:this.socketsCache};this.currentFlow&&(this.currentFlow.drop(r),this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null)}},{key:"pick",value:(function(){var n=T(O.mark(function i(o,a){var s,u,c;return O.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s={editor:this.editor,scope:this,socketsCache:this.socketsCache},u=ii(o.clientX,o.clientY),c=Pa(this.socketsCache,u),!c){f.next=13;break}if(o.preventDefault(),o.stopPropagation(),this.currentFlow=this.currentFlow||this.findPreset(c),!this.currentFlow){f.next=11;break}return f.next=10,this.currentFlow.pick({socket:c,event:a},s);case 10:this.preudoconnection.mount(this.areaPlugin);case 11:f.next=14;break;case 13:this.currentFlow&&this.currentFlow.drop(s);case 14:this.currentFlow&&!this.currentFlow.getPickedSocket()&&(this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null),this.update();case 16:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"setParent",value:function(r){var i=this;Ba(t,"setParent",this)([r]),this.areaPlugin=this.parentScope(ft),this.editor=this.areaPlugin.parentScope(Pe);var o=function(s){i.pick(s,"down")};this.addPipe(function(a){if(!a||ne(a)!=="object"||!("type"in a))return a;if(a.type==="pointermove")i.update();else if(a.type==="pointerup")i.pick(a.data.event,"up");else if(a.type==="render"){if(a.data.type==="socket"){var s=a.data.element;s.addEventListener("pointerdown",o),i.socketsCache.set(s,a.data)}}else if(a.type==="unmount"){var u=a.data.element;u.removeEventListener("pointerdown",o),i.socketsCache.delete(u)}return a})}}])})(Ye);/*!
35
35
  * rete-minimap-plugin v2.0.2
36
36
  * (c) 2024 Vitaliy Stoliarov
37
37
  * Released under the MIT license.
38
- * */function Ia(e){var t=e.map(function(c){return c.left}),n=e.map(function(c){return c.left+c.width}),r=e.map(function(c){return c.top}),i=e.map(function(c){return c.top+c.height}),o=Math.min.apply(Math,de(t)),a=Math.max.apply(Math,de(n)),s=Math.min.apply(Math,de(r)),u=Math.max.apply(Math,de(i));return{left:o,right:a,top:s,bottom:u,width:a-o,height:u-s}}function Na(e,t,n){var r=Ia(e),i=Math.max(t,Math.max(r.width,r.height*n)),o=(i-r.width)/2-r.left,a=(i/n-r.height)/2-r.top,s=function(l){return l/i},u=function(l){return l*i};return{origin:{x:o,y:a},scale:s,invert:u}}function za(e,t,n){return t=W(t),me(e,ai()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ai=function(){return!!e})()}function Ma(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var Da=(function(e){function t(n){var r,i,o,a,s,u;return B(this,t),u=za(this,t,["minimap"]),u.props=n,u.ratio=(r=(i=u.props)===null||i===void 0?void 0:i.ratio)!==null&&r!==void 0?r:1,u.minDistance=(o=(a=u.props)===null||a===void 0?void 0:a.minDistance)!==null&&o!==void 0?o:2e3,u.boundViewport=!!(!((s=u.props)===null||s===void 0)&&s.boundViewport),u}return oe(t,e),F(t,[{key:"setParent",value:function(r){var i=this;Ma(t,"setParent",this)([r]),this.area=this.parentScope(ti),this.editor=this.area.parentScope(Pe),this.element=document.createElement("div"),this.area.container.appendChild(this.element),this.addPipe(function(o){return"type"in o&&(o.type==="render"&&o.data.type==="node"||o.type==="nodetranslated"||o.type==="nodecreated"||o.type==="noderemoved"||o.type==="translated"||o.type==="resized"||o.type==="noderesized"||o.type==="zoomed")&&i.render(),o})}},{key:"getNodesRect",value:function(){var r=this;return this.editor.getNodes().map(function(i){var o=r.area.nodeViews.get(i.id);return o?{width:i.width,height:i.height,left:o.position.x,top:o.position.y}:null}).filter(Boolean)}},{key:"render",value:function(){var r=this,i=this.parentScope(),o=this.getNodesRect(),a=this.area.area.transform,s=this.area.container,u=s.clientWidth,c=s.clientHeight,l=this.minDistance,f=this.ratio,d={left:-a.x/a.k,top:-a.y/a.k,width:u/a.k,height:c/a.k},p=this.boundViewport?[].concat(de(o),[d]):o,h=Na(p,l,f),y=h.origin,m=h.scale,k=h.invert;i.emit({type:"render",data:{type:"minimap",element:this.element,ratio:f,start:function(){return a},nodes:o.map(function(v){return{left:m(v.left+y.x),top:m(v.top+y.y),width:m(v.width),height:m(v.height)}}),viewport:{left:m(d.left+y.x),top:m(d.top+y.y),width:m(d.width),height:m(d.height)},translate:function(w,E){var j=a.x,R=a.y,P=a.k;r.area.area.translate(j+k(w)*P,R+k(E)*P)},point:function(w,E){var j={x:(y.x-k(w))*a.k,y:(y.y-k(E))*a.k},R={x:j.x+u/2,y:j.y+c/2};r.area.area.translate(R.x,R.y)}}})}}])})(Ze);/*!
38
+ * */function Fa(e){var t=e.map(function(c){return c.left}),n=e.map(function(c){return c.left+c.width}),r=e.map(function(c){return c.top}),i=e.map(function(c){return c.top+c.height}),o=Math.min.apply(Math,ve(t)),a=Math.max.apply(Math,ve(n)),s=Math.min.apply(Math,ve(r)),u=Math.max.apply(Math,ve(i));return{left:o,right:a,top:s,bottom:u,width:a-o,height:u-s}}function Ga(e,t,n){var r=Fa(e),i=Math.max(t,Math.max(r.width,r.height*n)),o=(i-r.width)/2-r.left,a=(i/n-r.height)/2-r.top,s=function(l){return l/i},u=function(l){return l*i};return{origin:{x:o,y:a},scale:s,invert:u}}function Va(e,t,n){return t=W(t),me(e,ui()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function ui(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ui=function(){return!!e})()}function Wa(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var qa=(function(e){function t(n){var r,i,o,a,s,u;return B(this,t),u=Va(this,t,["minimap"]),u.props=n,u.ratio=(r=(i=u.props)===null||i===void 0?void 0:i.ratio)!==null&&r!==void 0?r:1,u.minDistance=(o=(a=u.props)===null||a===void 0?void 0:a.minDistance)!==null&&o!==void 0?o:2e3,u.boundViewport=!!(!((s=u.props)===null||s===void 0)&&s.boundViewport),u}return oe(t,e),H(t,[{key:"setParent",value:function(r){var i=this;Wa(t,"setParent",this)([r]),this.area=this.parentScope(ri),this.editor=this.area.parentScope(Pe),this.element=document.createElement("div"),this.area.container.appendChild(this.element),this.addPipe(function(o){return"type"in o&&(o.type==="render"&&o.data.type==="node"||o.type==="nodetranslated"||o.type==="nodecreated"||o.type==="noderemoved"||o.type==="translated"||o.type==="resized"||o.type==="noderesized"||o.type==="zoomed")&&i.render(),o})}},{key:"getNodesRect",value:function(){var r=this;return this.editor.getNodes().map(function(i){var o=r.area.nodeViews.get(i.id);return o?{width:i.width,height:i.height,left:o.position.x,top:o.position.y}:null}).filter(Boolean)}},{key:"render",value:function(){var r=this,i=this.parentScope(),o=this.getNodesRect(),a=this.area.area.transform,s=this.area.container,u=s.clientWidth,c=s.clientHeight,l=this.minDistance,f=this.ratio,d={left:-a.x/a.k,top:-a.y/a.k,width:u/a.k,height:c/a.k},p=this.boundViewport?[].concat(ve(o),[d]):o,h=Ga(p,l,f),y=h.origin,m=h.scale,k=h.invert;i.emit({type:"render",data:{type:"minimap",element:this.element,ratio:f,start:function(){return a},nodes:o.map(function(v){return{left:m(v.left+y.x),top:m(v.top+y.y),width:m(v.width),height:m(v.height)}}),viewport:{left:m(d.left+y.x),top:m(d.top+y.y),width:m(d.width),height:m(d.height)},translate:function(w,E){var _=a.x,I=a.y,P=a.k;r.area.area.translate(_+k(w)*P,I+k(E)*P)},point:function(w,E){var _={x:(y.x-k(w))*a.k,y:(y.y-k(E))*a.k},I={x:_.x+u/2,y:_.y+c/2};r.area.area.translate(I.x,I.y)}}})}}])})(Ye);/*!
39
39
  * rete-render-utils v2.0.2
40
40
  * (c) 2024 Vitaliy Stoliarov
41
41
  * Released under the MIT license.
42
- * */function Ta(e,t){var n=re(e,2),r=n[0],i=r.x,o=r.y,a=n[1],s=a.x,u=a.y,c=Math.abs(o-u),l=i+Math.max(c/2,Math.abs(s-i))*t,f=s-Math.max(c/2,Math.abs(s-i))*t;return"M ".concat(i," ").concat(o," C ").concat(l," ").concat(o," ").concat(f," ").concat(u," ").concat(s," ").concat(u)}function La(e,t,n){var r=re(e,2),i=r[0],o=i.x,a=i.y,s=r[1],u=s.x,c=s.y,l=c>a?1:-1,f=n+Math.abs(o-u)/(n/2),d=(o+u)/2,p=a-l*f,h=(c-a)*t;return`
42
+ * */function Za(e,t){var n=ie(e,2),r=n[0],i=r.x,o=r.y,a=n[1],s=a.x,u=a.y,c=Math.abs(o-u),l=i+Math.max(c/2,Math.abs(s-i))*t,f=s-Math.max(c/2,Math.abs(s-i))*t;return"M ".concat(i," ").concat(o," C ").concat(l," ").concat(o," ").concat(f," ").concat(u," ").concat(s," ").concat(u)}function Ka(e,t,n){var r=ie(e,2),i=r[0],o=i.x,a=i.y,s=r[1],u=s.x,c=s.y,l=c>a?1:-1,f=n+Math.abs(o-u)/(n/2),d=(o+u)/2,p=a-l*f,h=(c-a)*t;return`
43
43
  M `.concat(o," ").concat(a,`
44
44
  C `).concat(o+f," ").concat(a,`
45
45
  `).concat(o+f," ").concat(p-h,`
@@ -47,25 +47,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47
47
  C `).concat(u-f," ").concat(p+h,`
48
48
  `).concat(u-f," ").concat(c,`
49
49
  `).concat(u," ").concat(c,`
50
- `)}function Ba(e,t){return Yt.apply(this,arguments)}function Yt(){return Yt=T(S.mark(function e(t,n){var r,i,o,a,s;return S.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t.offsetParent){c.next=5;break}return c.next=3,new Promise(function(l){return setTimeout(l,0)});case 3:c.next=0;break;case 5:if(r=t.offsetLeft,i=t.offsetTop,o=t.offsetParent,o){c.next=10;break}throw new Error("child has null offsetParent");case 10:for(;o!==null&&o!==n;)r+=o.offsetLeft+o.clientLeft,i+=o.offsetTop+o.clientTop,o=o.offsetParent;return a=t.offsetWidth,s=t.offsetHeight,c.abrupt("return",{x:r+a/2,y:i+s/2});case 14:case"end":return c.stop()}},e)})),Yt.apply(this,arguments)}var Fa=(function(){function e(){B(this,e),$(this,"listeners",new Set)}return F(e,[{key:"emit",value:function(n){this.listeners.forEach(function(r){r(n)})}},{key:"listen",value:function(n){var r=this;return this.listeners.add(n),function(){r.listeners.delete(n)}}}])})(),Ha=(function(){function e(){B(this,e),$(this,"elements",new Map)}return F(e,[{key:"getPosition",value:function(n){var r,i,o=Array.from(this.elements.values()).flat(),a=o.filter(function(s){return s.side===n.side&&s.nodeId===n.nodeId&&s.key===n.key});return a.length>1&&console.warn(["Found more than one element for socket with same key and side.","Probably it was not unmounted correctly"].join(" "),n),(r=(i=a.pop())===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:null}},{key:"add",value:function(n){var r=this.elements.get(n.element);this.elements.set(n.element,r?[].concat(de(r.filter(function(i){return!(i.nodeId===n.nodeId&&i.key===n.key&&i.side===n.side)})),[n]):[n])}},{key:"remove",value:function(n){this.elements.delete(n)}},{key:"snapshot",value:function(){return Array.from(this.elements.values()).flat()}}])})(),Ga=(function(){function e(){B(this,e),$(this,"sockets",new Ha),$(this,"emitter",new Fa),$(this,"area",null)}return F(e,[{key:"attach",value:function(n){var r=this;this.area||n.hasParent()&&(this.area=n.parentScope(ft),this.area.addPipe((function(){var i=T(S.mark(function o(a){var s,u,c,l,f,d,p,h,y,m,k;return S.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(!(a.type==="rendered"&&a.data.type==="socket")){w.next=8;break}return s=a.data,u=s.nodeId,c=s.key,l=s.side,f=s.element,w.next=4,r.calculatePosition(u,l,c,f);case 4:d=w.sent,d&&(r.sockets.add({nodeId:u,key:c,side:l,element:f,position:d}),r.emitter.emit({nodeId:u,key:c,side:l})),w.next=24;break;case 8:if(a.type!=="unmount"){w.next=12;break}r.sockets.remove(a.data.element),w.next=24;break;case 12:if(a.type!=="nodetranslated"){w.next=16;break}r.emitter.emit({nodeId:a.data.id}),w.next=24;break;case 16:if(a.type!=="noderesized"){w.next=23;break}return p=a.data.id,w.next=20,Promise.all(r.sockets.snapshot().filter(function(E){return E.nodeId===a.data.id&&E.side==="output"}).map((function(){var E=T(S.mark(function j(R){var P,_,A,I;return S.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return P=R.side,_=R.key,A=R.element,V.next=3,r.calculatePosition(p,P,_,A);case 3:I=V.sent,I&&(R.position=I);case 5:case"end":return V.stop()}},j)}));return function(j){return E.apply(this,arguments)}})()));case 20:r.emitter.emit({nodeId:p}),w.next=24;break;case 23:a.type==="render"&&a.data.type==="connection"&&(h=a.data.payload,y=h.source,m=h.target,k=y||m,r.emitter.emit({nodeId:k}));case 24:return w.abrupt("return",a);case 25:case"end":return w.stop()}},o)}));return function(o){return i.apply(this,arguments)}})()))}},{key:"listen",value:function(n,r,i,o){var a=this,s=this.emitter.listen(function(u){if(u.nodeId===n&&(!u.key||u.side===r)&&(!u.side||u.key===i)){var c,l=a.sockets.getPosition({side:r,nodeId:n,key:i});if(!l)return;var f=l.x,d=l.y,p=(c=a.area)===null||c===void 0?void 0:c.nodeViews.get(n);p&&o({x:f+p.position.x,y:d+p.position.y})}});return this.sockets.snapshot().forEach(function(u){u.nodeId===n&&a.emitter.emit(u)}),s}}])})();function Va(e,t,n){return t=W(t),me(e,si()?Reflect.construct(t,[],W(e).constructor):t.apply(e,n))}function si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(si=function(){return!!e})()}var Wa=(function(e){function t(n){var r;return B(this,t),r=Va(this,t),r.props=n,r}return oe(t,e),F(t,[{key:"calculatePosition",value:(function(){var n=T(S.mark(function i(o,a,s,u){var c,l,f,d;return S.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(f=(c=this.area)===null||c===void 0?void 0:c.nodeViews.get(o),f!=null&&f.element){h.next=3;break}return h.abrupt("return",null);case 3:return h.next=5,Ba(u,f.element);case 5:if(d=h.sent,!((l=this.props)!==null&&l!==void 0&&l.offset)){h.next=8;break}return h.abrupt("return",this.props.offset(d,o,a,s));case 8:return h.abrupt("return",{x:d.x+12*(a==="input"?-1:1),y:d.y});case 9:case"end":return h.stop()}},i,this)}));function r(i,o,a,s){return n.apply(this,arguments)}return r})()}])})(Ga);function qa(e){return new Wa(e)}function J(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var G="-ms-",Ge="-moz-",H="-webkit-",ui="comm",pt="rule",mn="decl",Ka="@import",Ya="@namespace",ci="@keyframes",Za="@layer",li=Math.abs,yn=String.fromCharCode,Zt=Object.assign;function Ua(e,t){return Z(e,0)^45?(((t<<2^Z(e,0))<<2^Z(e,1))<<2^Z(e,2))<<2^Z(e,3):0}function di(e){return e.trim()}function he(e,t){return(e=t.exec(e))?e[0]:e}function N(e,t,n){return e.replace(t,n)}function it(e,t,n){return e.indexOf(t,n)}function Z(e,t){return e.charCodeAt(t)|0}function Se(e,t,n){return e.slice(t,n)}function ue(e){return e.length}function fi(e){return e.length}function Be(e,t){return t.push(e),e}function Xa(e,t){return e.map(t).join("")}function Xn(e,t){return e.filter(function(n){return!he(n,t)})}var ht=1,Ie=1,pi=0,ae=0,q=0,Me="";function vt(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:ht,column:Ie,length:a,return:"",siblings:s}}function ge(e,t){return Zt(vt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function je(e){for(;e.root;)e=ge(e.root,{children:[e]});Be(e,e.siblings)}function Ja(){return q}function Qa(){return q=ae>0?Z(Me,--ae):0,Ie--,q===10&&(Ie=1,ht--),q}function ce(){return q=ae<pi?Z(Me,ae++):0,Ie++,q===10&&(Ie=1,ht++),q}function be(){return Z(Me,ae)}function ot(){return ae}function mt(e,t){return Se(Me,e,t)}function Ke(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 es(e){return ht=Ie=1,pi=ue(Me=e),ae=0,[]}function ts(e){return Me="",e}function zt(e){return di(mt(ae-1,Ut(e===91?e+2:e===40?e+1:e)))}function ns(e){for(;(q=be())&&q<33;)ce();return Ke(e)>2||Ke(q)>3?"":" "}function rs(e,t){for(;--t&&ce()&&!(q<48||q>102||q>57&&q<65||q>70&&q<97););return mt(e,ot()+(t<6&&be()==32&&ce()==32))}function Ut(e){for(;ce();)switch(q){case e:return ae;case 34:case 39:e!==34&&e!==39&&Ut(q);break;case 40:e===41&&Ut(e);break;case 92:ce();break}return ae}function is(e,t){for(;ce()&&e+q!==57;)if(e+q===84&&be()===47)break;return"/*"+mt(t,ae-1)+"*"+yn(e===47?e:ce())}function os(e){for(;!Ke(be());)ce();return mt(e,ae)}function as(e){return ts(at("",null,null,null,[""],e=es(e),0,[0],e))}function at(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,y=1,m=1,k=1,v=0,w="",E=i,j=o,R=r,P=w;m;)switch(h=v,v=ce()){case 40:if(h!=108&&Z(P,f-1)==58){it(P+=N(zt(v),"&","&\f"),"&\f",li(c?s[c-1]:0))!=-1&&(k=-1);break}case 34:case 39:case 91:P+=zt(v);break;case 9:case 10:case 13:case 32:P+=ns(h);break;case 92:P+=rs(ot()-1,7);continue;case 47:switch(be()){case 42:case 47:Be(ss(is(ce(),ot()),t,n,u),u),(Ke(h||1)==5||Ke(be()||1)==5)&&ue(P)&&Se(P,-1,void 0)!==" "&&(P+=" ");break;default:P+="/"}break;case 123*y:s[c++]=ue(P)*k;case 125*y:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+l:k==-1&&(P=N(P,/\f/g,"")),p>0&&(ue(P)-f||y===0&&h===47)&&Be(p>32?Qn(P+";",r,n,f-1,u):Qn(N(P," ","")+";",r,n,f-2,u),u);break;case 59:P+=";";default:if(Be(R=Jn(P,t,n,c,l,i,s,w,E=[],j=[],f,o),o),v===123)if(l===0)at(P,t,R,R,E,o,f,s,j);else{switch(d){case 99:if(Z(P,3)===110)break;case 108:if(Z(P,2)===97)break;default:l=0;case 100:case 109:case 115:}l?at(e,R,R,r&&Be(Jn(e,R,R,0,0,i,s,w,i,E=[],f,j),j),i,j,f,s,r?E:j):at(P,R,R,R,[""],j,0,s,j)}}c=l=p=0,y=k=1,w=P="",f=a;break;case 58:f=1+ue(P),p=h;default:if(y<1){if(v==123)--y;else if(v==125&&y++==0&&Qa()==125)continue}switch(P+=yn(v),v*y){case 38:k=l>0?1:(P+="\f",-1);break;case 44:s[c++]=(ue(P)-1)*k,k=1;break;case 64:be()===45&&(P+=zt(ce())),d=be(),l=f=ue(w=P+=os(ot())),v++;break;case 45:h===45&&ue(P)==2&&(y=0)}}return o}function Jn(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=fi(p),y=0,m=0,k=0;y<r;++y)for(var v=0,w=Se(e,d+1,d=li(m=a[y])),E=e;v<h;++v)(E=di(m>0?p[v]+" "+w:N(w,/&\f/g,p[v])))&&(u[k++]=E);return vt(e,t,n,i===0?pt:s,u,c,l,f)}function ss(e,t,n,r){return vt(e,t,n,ui,yn(Ja()),Se(e,2,-2),0,r)}function Qn(e,t,n,r,i){return vt(e,t,n,mn,Se(e,0,r),Se(e,r+1,-1),r,i)}function hi(e,t,n){switch(Ua(e,t)){case 5103:return H+"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 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return H+e+e;case 4855:return H+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Ge+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+Ge+e+G+e+e;case 5936:switch(Z(e,t+11)){case 114:return H+e+G+N(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+G+N(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+G+N(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return H+e+G+e+e;case 6165:return H+e+G+"flex-"+e+e;case 5187:return H+e+N(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+G+"flex-$1$2")+e;case 5443:return H+e+G+"flex-item-"+N(e,/flex-|-self/g,"")+(he(e,/flex-|baseline/)?"":G+"grid-row-"+N(e,/flex-|-self/g,""))+e;case 4675:return H+e+G+"flex-line-pack"+N(e,/align-content|flex-|-self/g,"")+e;case 5548:return H+e+G+N(e,"shrink","negative")+e;case 5292:return H+e+G+N(e,"basis","preferred-size")+e;case 6060:return H+"box-"+N(e,"-grow","")+H+e+G+N(e,"grow","positive")+e;case 4554:return H+N(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return N(N(N(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return N(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return N(N(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+G+"flex-pack:$3"),/space-between/,"justify")+H+e+e;case 4200:if(!he(e,/flex-|baseline/))return G+"grid-column-align"+Se(e,t)+e;break;case 2592:case 3360:return G+N(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,he(r.props,/grid-\w+-end/)})?~it(e+(n=n[t].value),"span",0)?e:G+N(e,"-start","")+e+G+"grid-row-span:"+(~it(n,"span",0)?he(n,/\d+/):+he(n,/\d+/)-+he(e,/\d+/))+";":G+N(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return he(r.props,/grid-\w+-start/)})?e:G+N(N(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return N(e,/(.+)-inline(.+)/,H+"$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(ue(e)-1-t>6)switch(Z(e,t+1)){case 109:if(Z(e,t+4)!==45)break;case 102:return N(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+Ge+(Z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~it(e,"stretch",0)?hi(N(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return N(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return G+i+":"+o+c+(a?G+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(Z(e,t+6)===121)return N(e,":",":"+H)+e;break;case 6444:switch(Z(e,Z(e,14)===45?18:11)){case 120:return N(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+H+(Z(e,14)===45?"inline-":"")+"box$3$1"+H+"$2$3$1"+G+"$2box$3")+e;case 100:return N(e,":",":"+G)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return N(e,"scroll-","scroll-snap-")+e}return e}function lt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function us(e,t,n,r){switch(e.type){case Za:if(e.children.length)break;case Ka:case Ya:case mn:return e.return=e.return||e.value;case ui:return"";case ci:return e.return=e.value+"{"+lt(e.children,r)+"}";case pt:if(!ue(e.value=e.props.join(",")))return""}return ue(n=lt(e.children,r))?e.return=e.value+"{"+n+"}":""}function cs(e){var t=fi(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function ls(e){return function(t){t.root||(t=t.return)&&e(t)}}function ds(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case mn:e.return=hi(e.value,e.length,n);return;case ci:return lt([ge(e,{value:N(e.value,"@","@"+H)})],r);case pt:if(e.length)return Xa(n=e.props,function(i){switch(he(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":je(ge(e,{props:[N(i,/:(read-\w+)/,":"+Ge+"$1")]})),je(ge(e,{props:[i]})),Zt(e,{props:Xn(n,r)});break;case"::placeholder":je(ge(e,{props:[N(i,/:(plac\w+)/,":"+H+"input-$1")]})),je(ge(e,{props:[N(i,/:(plac\w+)/,":"+Ge+"$1")]})),je(ge(e,{props:[N(i,/:(plac\w+)/,G+"input-$1")]})),je(ge(e,{props:[i]})),Zt(e,{props:Xn(n,r)});break}return""})}}var Re={},Mt,Dt;const Ne=typeof process<"u"&&Re!==void 0&&(Re.REACT_APP_SC_ATTR||Re.SC_ATTR)||"data-styled",vi="active",mi="data-styled-version",yt="6.4.3",gn=`/*!sc*/
51
- `,Ve=typeof window<"u"&&typeof document<"u";function er(e){if(typeof process<"u"&&Re!==void 0){const t=Re[e];if(t!==void 0&&t!=="")return t!=="false"}}const fs=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:(Dt=(Mt=er("REACT_APP_SC_DISABLE_SPEEDY"))!==null&&Mt!==void 0?Mt:er("SC_DISABLE_SPEEDY"))!==null&&Dt!==void 0?Dt:typeof process<"u"&&Re!==void 0&&!1),ps="sc-keyframes-";function gt(e,...t){return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`)}let st=new Map,dt=new Map,ut=1;const et=e=>{if(st.has(e))return st.get(e);for(;dt.has(ut);)ut++;const t=ut++;return st.set(e,t),dt.set(t,e),t},hs=e=>dt.get(e),vs=(e,t)=>{ut=t+1,st.set(e,t),dt.set(t,e)},bn=Object.freeze([]),ze=Object.freeze({});function ms(e,t,n=ze){return e.theme!==n.theme&&e.theme||t||n.theme}const ys=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,gs=/(^-|-$)/g;function yi(e){return e.replace(ys,"-").replace(gs,"")}const bs=/(a)(d)/gi,tr=e=>String.fromCharCode(e+(e>25?39:97));function gi(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=tr(t%52)+n;return(tr(t%52)+n).replace(bs,"$1-$2")}const Xt=5381,xe=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},bi=e=>xe(Xt,e);function ws(e){return gi(bi(e)>>>0)}function ks(e){return e.displayName||e.name||"Component"}function Jt(e){return typeof e=="string"&&!0}function xs(e){return Jt(e)?`styled.${e}`:`Styled(${ks(e)})`}const wi=Symbol.for("react.memo"),Os=Symbol.for("react.forward_ref"),Ss={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Cs={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ki={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ps={[Os]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[wi]:ki};function nr(e){return("type"in(t=e)&&t.type.$$typeof)===wi?ki:"$$typeof"in e?Ps[e.$$typeof]:Ss;var t}const $s=Object.defineProperty,js=Object.getOwnPropertyNames,_s=Object.getOwnPropertySymbols,Es=Object.getOwnPropertyDescriptor,As=Object.getPrototypeOf,Rs=Object.prototype;function xi(e,t,n){if(typeof t!="string"){const r=As(t);r&&r!==Rs&&xi(e,r,n);const i=js(t).concat(_s(t)),o=nr(e),a=nr(t);for(let s=0;s<i.length;++s){const u=i[s];if(!(u in Cs||n&&n[u]||a&&u in a||o&&u in o)){const c=Es(t,u);try{$s(e,u,c)}catch{}}}}return e}function bt(e){return typeof e=="function"}const Is=Symbol.for("react.forward_ref");function Oi(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&e.$$typeof===Is&&"styledComponentId"in e}function Fe(e,t){return e&&t?e+" "+t:e||t||""}function rr(e,t){return e.join("")}function Ye(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Qt(e,t,n=!1){if(!n&&!Ye(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let r=0;r<t.length;r++)e[r]=Qt(e[r],t[r]);else if(Ye(t))for(const r in t)e[r]=Qt(e[r],t[r]);return e}function Si(e,t){Object.defineProperty(e,"toString",{value:t})}const Ns=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const i=this.groupSizes,o=i.length;let a=o;for(;e>=a;)if(a<<=1,a<0)throw gt(16,`${e}`);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(let s=o;s<a;s++)this.groupSizes[s]=0}let n=this.indexOfGroup(e+1),r=0;for(let i=0,o=t.length;i<o;i++)this.tag.insertRule(n,t[i])&&(this.groupSizes[e]++,n++,r++);r>0&&this._cGroup>e&&(this._cIndex+=r)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(let i=n;i<r;i++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||this.groupSizes[e]===0)return t;const n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;for(let o=r;o<i;o++)t+=this.tag.getRule(o)+gn;return t}},zs=`style[${Ne}][${mi}="${yt}"]`,Ms=new RegExp(`^${Ne}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),ir=e=>typeof ShadowRoot<"u"&&e instanceof ShadowRoot||"host"in e&&e.nodeType===11,en=e=>{if(!e)return document;if(ir(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(ir(t))return t}return document},Ds=(e,t,n)=>{const r=n.split(",");let i;for(let o=0,a=r.length;o<a;o++)(i=r[o])&&e.registerName(t,i)},Ts=(e,t)=>{var n;const r=((n=t.textContent)!==null&&n!==void 0?n:"").split(gn),i=[];for(let o=0,a=r.length;o<a;o++){const s=r[o].trim();if(!s)continue;const u=s.match(Ms);if(u){const c=0|parseInt(u[1],10),l=u[2];c!==0&&(vs(l,c),Ds(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}},Tt=e=>{const t=en(e.options.target).querySelectorAll(zs);for(let n=0,r=t.length;n<r;n++){const i=t[n];i&&i.getAttribute(Ne)!==vi&&(Ts(e,i),i.parentNode&&i.parentNode.removeChild(i))}};let Te=!1;function Ls(){if(Te!==!1)return Te;if(typeof document<"u"){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return Te=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return Te=t.getAttribute("content")||void 0}return Te=typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}const Ci=(e,t)=>{const n=document.head,r=e||n,i=document.createElement("style"),o=(u=>{const c=Array.from(u.querySelectorAll(`style[${Ne}]`));return c[c.length-1]})(r),a=o!==void 0?o.nextSibling:null;i.setAttribute(Ne,vi),i.setAttribute(mi,yt);const s=t||Ls();return s&&i.setAttribute("nonce",s),r.insertBefore(i,a),i},Bs=class{constructor(e,t){this.element=Ci(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(n=>{var r;if(n.sheet)return n.sheet;const i=(r=n.getRootNode().styleSheets)!==null&&r!==void 0?r:document.styleSheets;for(let o=0,a=i.length;o<a;o++){const s=i[o];if(s.ownerNode===n)return s}throw gt(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}},Fs=class{constructor(e,t){this.element=Ci(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}};let or=Ve;const Hs={isServer:!Ve,useCSSOMInjection:!fs};class wt{static registerId(t){return et(t)}constructor(t=ze,n={},r){this.options=Object.assign(Object.assign({},Hs),t),this.gs=n,this.keyframeIds=new Set,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Ve&&or&&(or=!1,Tt(this)),Si(this,()=>(i=>{const o=i.getTag(),{length:a}=o;let s="";for(let u=0;u<a;u++){const c=hs(u);if(c===void 0)continue;const l=i.names.get(c);if(l===void 0||!l.size)continue;const f=o.getGroup(u);if(f.length===0)continue;const d=Ne+".g"+u+'[id="'+c+'"]';let p="";for(const h of l)h.length>0&&(p+=h+",");s+=f+d+'{content:"'+p+'"}'+gn}return s})(this))}rehydrate(){!this.server&&Ve&&Tt(this)}reconstructWithOptions(t,n=!0){const r=new wt(Object.assign(Object.assign({},this.options),t),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&Ve&&t.target!==this.options.target&&en(this.options.target)!==en(t.target)&&Tt(r),r}allocateGSInstance(t){return this.gs[t]=(this.gs[t]||0)+1}getTag(){return this.tag||(this.tag=(t=(({useCSSOMInjection:n,target:r,nonce:i})=>n?new Bs(r,i):new Fs(r,i))(this.options),new Ns(t)));var t}hasNameForId(t,n){var r,i;return(i=(r=this.names.get(t))===null||r===void 0?void 0:r.has(n))!==null&&i!==void 0&&i}registerName(t,n){et(t),t.startsWith(ps)&&this.keyframeIds.add(t);const r=this.names.get(t);r?r.add(n):this.names.set(t,new Set([n]))}insertRules(t,n,r){this.registerName(t,n),this.getTag().insertRules(et(t),r)}clearNames(t){this.names.has(t)&&this.names.get(t).clear()}clearRules(t){this.getTag().clearGroup(et(t)),this.clearNames(t)}clearTag(){this.tag=void 0}}const Pi=new WeakSet,Gs={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart: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};function Vs(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in Gs||e.startsWith("--")?String(t).trim():t+"px"}const ke=47;function ar(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t+=r>=65&&r<=90?"-"+String.fromCharCode(r+32):e[n]}return t.startsWith("ms-")?"-"+t:t}const Ws=Symbol.for("sc-keyframes");function qs(e){return typeof e=="object"&&e!==null&&Ws in e}function $i(e){return bt(e)&&!(e.prototype&&e.prototype.isReactComponent)}const ji=e=>e==null||e===!1||e==="",Ks=Symbol.for("react.client.reference");function sr(e){return e.$$typeof===Ks}function _i(e,t){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&!ji(r)&&(Array.isArray(r)&&Pi.has(r)||bt(r)?t.push(ar(n)+":",r,";"):Ye(r)?(t.push(n+" {"),_i(r,t),t.push("}")):t.push(ar(n)+": "+Vs(n,r)+";"))}}function Oe(e,t,n,r,i=[]){if(ji(e))return i;const o=typeof e;if(o==="string")return i.push(e),i;if(o==="function"){if(sr(e))return i;if($i(e)&&t){const a=e(t);return Oe(a,t,n,r,i)}return i.push(e),i}if(Array.isArray(e)){for(let a=0;a<e.length;a++)Oe(e[a],t,n,r,i);return i}return Oi(e)?(i.push(`.${e.styledComponentId}`),i):qs(e)?(n?(e.inject(n,r),i.push(e.getName(r))):i.push(e),i):sr(e)?i:Ye(e)?e.toString!==Object.prototype.toString?(i.push(e.toString()),i):(_i(e,i),i):(i.push(e.toString()),i)}const Ys=bi(yt);class Zs{constructor(t,n,r){this.rules=t,this.componentId=n,this.baseHash=xe(Ys,n),this.baseStyle=r,wt.registerId(n)}generateAndInjectStyles(t,n,r){let i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";{let o="";for(let a=0;a<this.rules.length;a++){const s=this.rules[a];if(typeof s=="string")o+=s;else if(s)if($i(s)){const u=s(t);typeof u=="string"?o+=u:u!=null&&u!==!1&&(o+=rr(Oe(u,t,n,r)))}else o+=rr(Oe(s,t,n,r))}if(o){this.dynamicNameCache||(this.dynamicNameCache=new Map);const a=r.hash?r.hash+o:o;let s=this.dynamicNameCache.get(a);if(!s){if(s=gi(xe(xe(this.baseHash,r.hash),o)>>>0),this.dynamicNameCache.size>=200){const u=this.dynamicNameCache.keys().next().value;u!==void 0&&this.dynamicNameCache.delete(u)}this.dynamicNameCache.set(a,s)}if(!n.hasNameForId(this.componentId,s)){const u=r(o,"."+s,void 0,this.componentId);n.insertRules(this.componentId,s,u)}i=Fe(i,s)}}return i}}const Us=/&/g;function Ei(e,t){let n=0;for(;--t>=0&&e.charCodeAt(t)===92;)n++;return!(1&~n)}function Lt(e){const t=e.length;let n="",r=0,i=0,o=0,a=!1,s=!1;for(let u=0;u<t;u++){const c=e.charCodeAt(u);if(o!==0||a||c!==ke||e.charCodeAt(u+1)!==42)if(a)c===42&&e.charCodeAt(u+1)===ke&&(a=!1,u++);else if(c!==34&&c!==39||Ei(e,u)){if(o===0)if(c===123)i++;else if(c===125){if(i--,i<0){s=!0;let l=u+1;for(;l<t;){const f=e.charCodeAt(l);if(f===59||f===10)break;l++}l<t&&e.charCodeAt(l)===59&&l++,i=0,u=l-1,r=l;continue}i===0&&(n+=e.substring(r,u+1),r=u+1)}else c===59&&i===0&&(n+=e.substring(r,u+1),r=u+1)}else o===0?o=c:o===c&&(o=0);else a=!0,u++}return s||i!==0||o!==0?(r<t&&i===0&&o===0&&(n+=e.substring(r)),n):e}function Ai(e,t){const n=t+" ",r=","+n;for(let i=0;i<e.length;i++){const o=e[i];if(o.type==="rule"){o.value=(n+o.value).replaceAll(",",r);const a=o.props,s=[];for(let u=0;u<a.length;u++)s[u]=n+a[u];o.props=s}Array.isArray(o.children)&&o.type!=="@keyframes"&&Ai(o.children,t)}return e}function Xs({options:e=ze,plugins:t=bn}=ze){let n,r,i;const o=(d,p,h)=>h.startsWith(r)&&h.endsWith(r)&&h.replaceAll(r,"").length>0?`.${n}`:d,a=t.slice();a.push(d=>{d.type===pt&&d.value.includes("&")&&(i||(i=new RegExp(`\\${r}\\b`,"g")),d.props[0]=d.props[0].replace(Us,r).replace(i,o))}),e.prefix&&a.push(ds),a.push(us);let s=[];const u=cs(a.concat(ls(d=>s.push(d)))),c=(d,p="",h="",y="&")=>{n=y,r=p,i=void 0;const m=(function(v){const w=v.indexOf("//")!==-1,E=v.indexOf("}")!==-1;if(!w&&!E)return v;if(!w)return Lt(v);const j=v.length;let R="",P=0,_=0,A=0,I=0,D=0,V=!1;for(;_<j;){const L=v.charCodeAt(_);if(L!==34&&L!==39||Ei(v,_))if(A===0)if(L===ke&&_+1<j&&v.charCodeAt(_+1)===42){for(_+=2;_+1<j&&(v.charCodeAt(_)!==42||v.charCodeAt(_+1)!==ke);)_++;_+=2}else if(L!==40)if(L!==41)if(I>0)_++;else if(L===42&&_+1<j&&v.charCodeAt(_+1)===ke)R+=v.substring(P,_),_+=2,P=_,V=!0;else if(L===ke&&_+1<j&&v.charCodeAt(_+1)===ke){for(R+=v.substring(P,_);_<j&&v.charCodeAt(_)!==10;)_++;P=_,V=!0}else L===123?D++:L===125&&D--,_++;else I>0&&I--,_++;else I++,_++;else _++;else A===0?A=L:A===L&&(A=0),_++}return V?(P<j&&(R+=v.substring(P)),D===0?R:Lt(R)):D===0?v:Lt(v)})(d);let k=as(h||p?h+" "+p+" { "+m+" }":m);return e.namespace&&(k=Ai(k,e.namespace)),s=[],lt(k,u),s},l=e;let f=Xt;for(let d=0;d<t.length;d++)t[d].name||gt(15),f=xe(f,t[d].name);return l!=null&&l.namespace&&(f=xe(f,l.namespace)),l!=null&&l.prefix&&(f=xe(f,"p")),c.hash=f!==Xt?f.toString():"",c}const Js=new wt,Qs=Xs(),Ri=Ee.createContext({shouldForwardProp:void 0,styleSheet:Js,stylis:Qs,stylisPlugins:void 0});Ri.Consumer;function eu(){return Ee.useContext(Ri)}const Ii=Ee.createContext(void 0);Ii.Consumer;const ur=Object.prototype.hasOwnProperty,Bt={};function tu(e,t){const n=typeof e!="string"?"sc":yi(e);Bt[n]=(Bt[n]||0)+1;const r=n+"-"+ws(yt+n+Bt[n]);return t?t+"-"+r:r}function nu(e,t,n){const r=Oi(e),i=e,o=!Jt(e),{attrs:a=bn,componentId:s=tu(t.displayName,t.parentComponentId),displayName:u=xs(e)}=t,c=t.displayName&&t.componentId?yi(t.displayName)+"-"+t.componentId:t.componentId||s,l=r&&i.attrs?i.attrs.concat(a).filter(Boolean):a;let{shouldForwardProp:f}=t;if(r&&i.shouldForwardProp){const y=i.shouldForwardProp;if(t.shouldForwardProp){const m=t.shouldForwardProp;f=(k,v)=>y(k,v)&&m(k,v)}else f=y}const d=new Zs(n,c,r?i.componentStyle:void 0);function p(y,m){return(function(k,v,w){const{attrs:E,componentStyle:j,defaultProps:R,foldedComponentIds:P,styledComponentId:_,target:A}=k,I=Ee.useContext(Ii),D=eu(),V=k.shouldForwardProp||D.shouldForwardProp,L=ms(v,I,R)||ze;let K,Y;{const x=Ee.useRef(null),O=x.current;if(O!==null&&O[1]===L&&O[2]===D.styleSheet&&O[3]===D.stylis&&O[7]===j&&(function(C,M,U){const ee=C,te=M;let De=0;for(const we in te)if(ur.call(te,we)&&(De++,ee[we]!==te[we]))return!1;return De===U})(O[0],v,O[4]))K=O[5],Y=O[6];else{K=(function(M,U,ee){const te=Object.assign(Object.assign({},U),{className:void 0,theme:ee}),De=M.length>1;for(let we=0;we<M.length;we++){const kt=M[we],Ue=bt(kt)?kt(De?Object.assign({},te):te):kt;for(const ye in Ue)ye==="className"?te.className=Fe(te.className,Ue[ye]):ye==="style"?te.style=Object.assign(Object.assign({},te.style),Ue[ye]):ye in U&&U[ye]===void 0||(te[ye]=Ue[ye])}return"className"in U&&typeof U.className=="string"&&(te.className=Fe(te.className,U.className)),te})(E,v,L),Y=(function(M,U,ee,te){return M.generateAndInjectStyles(U,ee,te)})(j,K,D.styleSheet,D.stylis);let C=0;for(const M in v)ur.call(v,M)&&C++;x.current=[v,L,D.styleSheet,D.stylis,C,K,Y,j]}}const se=K.as||A,Q=(function(x,O,C,M){const U={};for(const ee in x)x[ee]===void 0||ee[0]==="$"||ee==="as"||ee==="theme"&&x.theme===C||(ee==="forwardedAs"?U.as=x.forwardedAs:M&&!M(ee,O)||(U[ee]=x[ee]));return U})(K,se,L,V);let b=Fe(P,_);return Y&&(b+=" "+Y),K.className&&(b+=" "+K.className),Q[Jt(se)&&se.includes("-")?"class":"className"]=b,w&&(Q.ref=w),g.createElement(se,Q)})(h,y,m)}p.displayName=u;let h=Ee.forwardRef(p);return h.attrs=l,h.componentStyle=d,h.displayName=u,h.shouldForwardProp=f,h.foldedComponentIds=r?Fe(i.foldedComponentIds,i.styledComponentId):"",h.styledComponentId=c,h.target=r?i.target:e,Object.defineProperty(h,"defaultProps",{get(){return this._foldedDefaultProps},set(y){this._foldedDefaultProps=r?(function(m,...k){for(const v of k)Qt(m,v,!0);return m})({},i.defaultProps,y):y}}),Si(h,()=>`.${h.styledComponentId}`),o&&xi(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),h}var ru=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function cr(e,t){const n=[e[0]];for(let r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}const lr=e=>(Pi.add(e),e);function wn(e,...t){if(bt(e)||Ye(e))return lr(Oe(cr(bn,[e,...t])));const n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Oe(n):lr(Oe(cr(n,t)))}function tn(e,t,n=ze){if(!t)throw gt(1,t);const r=(i,...o)=>e(t,n,wn(i,...o));return r.attrs=i=>tn(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)})),r.withConfig=i=>tn(e,t,Object.assign(Object.assign({},n),i)),r}const Ni=e=>tn(nu,e),ne=Ni;ru.forEach(e=>{ne[e]=Ni(e)});function Ce(){return Ce=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},Ce.apply(null,arguments)}function iu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kn(e,t){if(e==null)return{};var n,r,i=iu(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}/*!
50
+ `)}function Ya(e,t){return Kt.apply(this,arguments)}function Kt(){return Kt=T(O.mark(function e(t,n){var r,i,o,a,s;return O.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t.offsetParent){c.next=5;break}return c.next=3,new Promise(function(l){return setTimeout(l,0)});case 3:c.next=0;break;case 5:if(r=t.offsetLeft,i=t.offsetTop,o=t.offsetParent,o){c.next=10;break}throw new Error("child has null offsetParent");case 10:for(;o!==null&&o!==n;)r+=o.offsetLeft+o.clientLeft,i+=o.offsetTop+o.clientTop,o=o.offsetParent;return a=t.offsetWidth,s=t.offsetHeight,c.abrupt("return",{x:r+a/2,y:i+s/2});case 14:case"end":return c.stop()}},e)})),Kt.apply(this,arguments)}var Xa=(function(){function e(){B(this,e),$(this,"listeners",new Set)}return H(e,[{key:"emit",value:function(n){this.listeners.forEach(function(r){r(n)})}},{key:"listen",value:function(n){var r=this;return this.listeners.add(n),function(){r.listeners.delete(n)}}}])})(),Ua=(function(){function e(){B(this,e),$(this,"elements",new Map)}return H(e,[{key:"getPosition",value:function(n){var r,i,o=Array.from(this.elements.values()).flat(),a=o.filter(function(s){return s.side===n.side&&s.nodeId===n.nodeId&&s.key===n.key});return a.length>1&&console.warn(["Found more than one element for socket with same key and side.","Probably it was not unmounted correctly"].join(" "),n),(r=(i=a.pop())===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:null}},{key:"add",value:function(n){var r=this.elements.get(n.element);this.elements.set(n.element,r?[].concat(ve(r.filter(function(i){return!(i.nodeId===n.nodeId&&i.key===n.key&&i.side===n.side)})),[n]):[n])}},{key:"remove",value:function(n){this.elements.delete(n)}},{key:"snapshot",value:function(){return Array.from(this.elements.values()).flat()}}])})(),Ja=(function(){function e(){B(this,e),$(this,"sockets",new Ua),$(this,"emitter",new Xa),$(this,"area",null)}return H(e,[{key:"attach",value:function(n){var r=this;this.area||n.hasParent()&&(this.area=n.parentScope(ft),this.area.addPipe((function(){var i=T(O.mark(function o(a){var s,u,c,l,f,d,p,h,y,m,k;return O.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(!(a.type==="rendered"&&a.data.type==="socket")){w.next=8;break}return s=a.data,u=s.nodeId,c=s.key,l=s.side,f=s.element,w.next=4,r.calculatePosition(u,l,c,f);case 4:d=w.sent,d&&(r.sockets.add({nodeId:u,key:c,side:l,element:f,position:d}),r.emitter.emit({nodeId:u,key:c,side:l})),w.next=24;break;case 8:if(a.type!=="unmount"){w.next=12;break}r.sockets.remove(a.data.element),w.next=24;break;case 12:if(a.type!=="nodetranslated"){w.next=16;break}r.emitter.emit({nodeId:a.data.id}),w.next=24;break;case 16:if(a.type!=="noderesized"){w.next=23;break}return p=a.data.id,w.next=20,Promise.all(r.sockets.snapshot().filter(function(E){return E.nodeId===a.data.id&&E.side==="output"}).map((function(){var E=T(O.mark(function _(I){var P,j,A,N;return O.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return P=I.side,j=I.key,A=I.element,V.next=3,r.calculatePosition(p,P,j,A);case 3:N=V.sent,N&&(I.position=N);case 5:case"end":return V.stop()}},_)}));return function(_){return E.apply(this,arguments)}})()));case 20:r.emitter.emit({nodeId:p}),w.next=24;break;case 23:a.type==="render"&&a.data.type==="connection"&&(h=a.data.payload,y=h.source,m=h.target,k=y||m,r.emitter.emit({nodeId:k}));case 24:return w.abrupt("return",a);case 25:case"end":return w.stop()}},o)}));return function(o){return i.apply(this,arguments)}})()))}},{key:"listen",value:function(n,r,i,o){var a=this,s=this.emitter.listen(function(u){if(u.nodeId===n&&(!u.key||u.side===r)&&(!u.side||u.key===i)){var c,l=a.sockets.getPosition({side:r,nodeId:n,key:i});if(!l)return;var f=l.x,d=l.y,p=(c=a.area)===null||c===void 0?void 0:c.nodeViews.get(n);p&&o({x:f+p.position.x,y:d+p.position.y})}});return this.sockets.snapshot().forEach(function(u){u.nodeId===n&&a.emitter.emit(u)}),s}}])})();function Qa(e,t,n){return t=W(t),me(e,ci()?Reflect.construct(t,[],W(e).constructor):t.apply(e,n))}function ci(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ci=function(){return!!e})()}var es=(function(e){function t(n){var r;return B(this,t),r=Qa(this,t),r.props=n,r}return oe(t,e),H(t,[{key:"calculatePosition",value:(function(){var n=T(O.mark(function i(o,a,s,u){var c,l,f,d;return O.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(f=(c=this.area)===null||c===void 0?void 0:c.nodeViews.get(o),f!=null&&f.element){h.next=3;break}return h.abrupt("return",null);case 3:return h.next=5,Ya(u,f.element);case 5:if(d=h.sent,!((l=this.props)!==null&&l!==void 0&&l.offset)){h.next=8;break}return h.abrupt("return",this.props.offset(d,o,a,s));case 8:return h.abrupt("return",{x:d.x+12*(a==="input"?-1:1),y:d.y});case 9:case"end":return h.stop()}},i,this)}));function r(i,o,a,s){return n.apply(this,arguments)}return r})()}])})(Ja);function ts(e){return new es(e)}function J(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var G="-ms-",Ge="-moz-",F="-webkit-",li="comm",pt="rule",mn="decl",ns="@import",rs="@namespace",di="@keyframes",is="@layer",fi=Math.abs,yn=String.fromCharCode,Yt=Object.assign;function os(e,t){return Y(e,0)^45?(((t<<2^Y(e,0))<<2^Y(e,1))<<2^Y(e,2))<<2^Y(e,3):0}function pi(e){return e.trim()}function pe(e,t){return(e=t.exec(e))?e[0]:e}function R(e,t,n){return e.replace(t,n)}function it(e,t,n){return e.indexOf(t,n)}function Y(e,t){return e.charCodeAt(t)|0}function Se(e,t,n){return e.slice(t,n)}function ue(e){return e.length}function hi(e){return e.length}function Be(e,t){return t.push(e),e}function as(e,t){return e.map(t).join("")}function Jn(e,t){return e.filter(function(n){return!pe(n,t)})}var ht=1,Ne=1,vi=0,ae=0,q=0,Me="";function vt(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:ht,column:Ne,length:a,return:"",siblings:s}}function ge(e,t){return Yt(vt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function _e(e){for(;e.root;)e=ge(e.root,{children:[e]});Be(e,e.siblings)}function ss(){return q}function us(){return q=ae>0?Y(Me,--ae):0,Ne--,q===10&&(Ne=1,ht--),q}function ce(){return q=ae<vi?Y(Me,ae++):0,Ne++,q===10&&(Ne=1,ht++),q}function be(){return Y(Me,ae)}function ot(){return ae}function mt(e,t){return Se(Me,e,t)}function Ze(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 cs(e){return ht=Ne=1,vi=ue(Me=e),ae=0,[]}function ls(e){return Me="",e}function zt(e){return pi(mt(ae-1,Xt(e===91?e+2:e===40?e+1:e)))}function ds(e){for(;(q=be())&&q<33;)ce();return Ze(e)>2||Ze(q)>3?"":" "}function fs(e,t){for(;--t&&ce()&&!(q<48||q>102||q>57&&q<65||q>70&&q<97););return mt(e,ot()+(t<6&&be()==32&&ce()==32))}function Xt(e){for(;ce();)switch(q){case e:return ae;case 34:case 39:e!==34&&e!==39&&Xt(q);break;case 40:e===41&&Xt(e);break;case 92:ce();break}return ae}function ps(e,t){for(;ce()&&e+q!==57;)if(e+q===84&&be()===47)break;return"/*"+mt(t,ae-1)+"*"+yn(e===47?e:ce())}function hs(e){for(;!Ze(be());)ce();return mt(e,ae)}function vs(e){return ls(at("",null,null,null,[""],e=cs(e),0,[0],e))}function at(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,y=1,m=1,k=1,v=0,w="",E=i,_=o,I=r,P=w;m;)switch(h=v,v=ce()){case 40:if(h!=108&&Y(P,f-1)==58){it(P+=R(zt(v),"&","&\f"),"&\f",fi(c?s[c-1]:0))!=-1&&(k=-1);break}case 34:case 39:case 91:P+=zt(v);break;case 9:case 10:case 13:case 32:P+=ds(h);break;case 92:P+=fs(ot()-1,7);continue;case 47:switch(be()){case 42:case 47:Be(ms(ps(ce(),ot()),t,n,u),u),(Ze(h||1)==5||Ze(be()||1)==5)&&ue(P)&&Se(P,-1,void 0)!==" "&&(P+=" ");break;default:P+="/"}break;case 123*y:s[c++]=ue(P)*k;case 125*y:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+l:k==-1&&(P=R(P,/\f/g,"")),p>0&&(ue(P)-f||y===0&&h===47)&&Be(p>32?er(P+";",r,n,f-1,u):er(R(P," ","")+";",r,n,f-2,u),u);break;case 59:P+=";";default:if(Be(I=Qn(P,t,n,c,l,i,s,w,E=[],_=[],f,o),o),v===123)if(l===0)at(P,t,I,I,E,o,f,s,_);else{switch(d){case 99:if(Y(P,3)===110)break;case 108:if(Y(P,2)===97)break;default:l=0;case 100:case 109:case 115:}l?at(e,I,I,r&&Be(Qn(e,I,I,0,0,i,s,w,i,E=[],f,_),_),i,_,f,s,r?E:_):at(P,I,I,I,[""],_,0,s,_)}}c=l=p=0,y=k=1,w=P="",f=a;break;case 58:f=1+ue(P),p=h;default:if(y<1){if(v==123)--y;else if(v==125&&y++==0&&us()==125)continue}switch(P+=yn(v),v*y){case 38:k=l>0?1:(P+="\f",-1);break;case 44:s[c++]=(ue(P)-1)*k,k=1;break;case 64:be()===45&&(P+=zt(ce())),d=be(),l=f=ue(w=P+=hs(ot())),v++;break;case 45:h===45&&ue(P)==2&&(y=0)}}return o}function Qn(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=hi(p),y=0,m=0,k=0;y<r;++y)for(var v=0,w=Se(e,d+1,d=fi(m=a[y])),E=e;v<h;++v)(E=pi(m>0?p[v]+" "+w:R(w,/&\f/g,p[v])))&&(u[k++]=E);return vt(e,t,n,i===0?pt:s,u,c,l,f)}function ms(e,t,n,r){return vt(e,t,n,li,yn(ss()),Se(e,2,-2),0,r)}function er(e,t,n,r,i){return vt(e,t,n,mn,Se(e,0,r),Se(e,r+1,-1),r,i)}function mi(e,t,n){switch(os(e,t)){case 5103:return F+"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 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return F+e+e;case 4855:return F+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Ge+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return F+e+Ge+e+G+e+e;case 5936:switch(Y(e,t+11)){case 114:return F+e+G+R(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+G+R(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+G+R(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return F+e+G+e+e;case 6165:return F+e+G+"flex-"+e+e;case 5187:return F+e+R(e,/(\w+).+(:[^]+)/,F+"box-$1$2"+G+"flex-$1$2")+e;case 5443:return F+e+G+"flex-item-"+R(e,/flex-|-self/g,"")+(pe(e,/flex-|baseline/)?"":G+"grid-row-"+R(e,/flex-|-self/g,""))+e;case 4675:return F+e+G+"flex-line-pack"+R(e,/align-content|flex-|-self/g,"")+e;case 5548:return F+e+G+R(e,"shrink","negative")+e;case 5292:return F+e+G+R(e,"basis","preferred-size")+e;case 6060:return F+"box-"+R(e,"-grow","")+F+e+G+R(e,"grow","positive")+e;case 4554:return F+R(e,/([^-])(transform)/g,"$1"+F+"$2")+e;case 6187:return R(R(R(e,/(zoom-|grab)/,F+"$1"),/(image-set)/,F+"$1"),e,"")+e;case 5495:case 3959:return R(e,/(image-set\([^]*)/,F+"$1$`$1");case 4968:return R(R(e,/(.+:)(flex-)?(.*)/,F+"box-pack:$3"+G+"flex-pack:$3"),/space-between/,"justify")+F+e+e;case 4200:if(!pe(e,/flex-|baseline/))return G+"grid-column-align"+Se(e,t)+e;break;case 2592:case 3360:return G+R(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,pe(r.props,/grid-\w+-end/)})?~it(e+(n=n[t].value),"span",0)?e:G+R(e,"-start","")+e+G+"grid-row-span:"+(~it(n,"span",0)?pe(n,/\d+/):+pe(n,/\d+/)-+pe(e,/\d+/))+";":G+R(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return pe(r.props,/grid-\w+-start/)})?e:G+R(R(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return R(e,/(.+)-inline(.+)/,F+"$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(ue(e)-1-t>6)switch(Y(e,t+1)){case 109:if(Y(e,t+4)!==45)break;case 102:return R(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+Ge+(Y(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~it(e,"stretch",0)?mi(R(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return R(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return G+i+":"+o+c+(a?G+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(Y(e,t+6)===121)return R(e,":",":"+F)+e;break;case 6444:switch(Y(e,Y(e,14)===45?18:11)){case 120:return R(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+F+(Y(e,14)===45?"inline-":"")+"box$3$1"+F+"$2$3$1"+G+"$2box$3")+e;case 100:return R(e,":",":"+G)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return R(e,"scroll-","scroll-snap-")+e}return e}function lt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ys(e,t,n,r){switch(e.type){case is:if(e.children.length)break;case ns:case rs:case mn:return e.return=e.return||e.value;case li:return"";case di:return e.return=e.value+"{"+lt(e.children,r)+"}";case pt:if(!ue(e.value=e.props.join(",")))return""}return ue(n=lt(e.children,r))?e.return=e.value+"{"+n+"}":""}function gs(e){var t=hi(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function bs(e){return function(t){t.root||(t=t.return)&&e(t)}}function ws(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case mn:e.return=mi(e.value,e.length,n);return;case di:return lt([ge(e,{value:R(e.value,"@","@"+F)})],r);case pt:if(e.length)return as(n=e.props,function(i){switch(pe(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":_e(ge(e,{props:[R(i,/:(read-\w+)/,":"+Ge+"$1")]})),_e(ge(e,{props:[i]})),Yt(e,{props:Jn(n,r)});break;case"::placeholder":_e(ge(e,{props:[R(i,/:(plac\w+)/,":"+F+"input-$1")]})),_e(ge(e,{props:[R(i,/:(plac\w+)/,":"+Ge+"$1")]})),_e(ge(e,{props:[R(i,/:(plac\w+)/,G+"input-$1")]})),_e(ge(e,{props:[i]})),Yt(e,{props:Jn(n,r)});break}return""})}}var Ie={},Mt,Dt;const Re=typeof process<"u"&&Ie!==void 0&&(Ie.REACT_APP_SC_ATTR||Ie.SC_ATTR)||"data-styled",yi="active",gi="data-styled-version",yt="6.4.3",gn=`/*!sc*/
51
+ `,Ve=typeof window<"u"&&typeof document<"u";function tr(e){if(typeof process<"u"&&Ie!==void 0){const t=Ie[e];if(t!==void 0&&t!=="")return t!=="false"}}const ks=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:(Dt=(Mt=tr("REACT_APP_SC_DISABLE_SPEEDY"))!==null&&Mt!==void 0?Mt:tr("SC_DISABLE_SPEEDY"))!==null&&Dt!==void 0?Dt:typeof process<"u"&&Ie!==void 0&&!1),xs="sc-keyframes-";function gt(e,...t){return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`)}let st=new Map,dt=new Map,ut=1;const et=e=>{if(st.has(e))return st.get(e);for(;dt.has(ut);)ut++;const t=ut++;return st.set(e,t),dt.set(t,e),t},Os=e=>dt.get(e),Ss=(e,t)=>{ut=t+1,st.set(e,t),dt.set(t,e)},bn=Object.freeze([]),ze=Object.freeze({});function Cs(e,t,n=ze){return e.theme!==n.theme&&e.theme||t||n.theme}const Ps=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,$s=/(^-|-$)/g;function bi(e){return e.replace(Ps,"-").replace($s,"")}const _s=/(a)(d)/gi,nr=e=>String.fromCharCode(e+(e>25?39:97));function wi(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=nr(t%52)+n;return(nr(t%52)+n).replace(_s,"$1-$2")}const Ut=5381,xe=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},ki=e=>xe(Ut,e);function js(e){return wi(ki(e)>>>0)}function Es(e){return e.displayName||e.name||"Component"}function Jt(e){return typeof e=="string"&&!0}function As(e){return Jt(e)?`styled.${e}`:`Styled(${Es(e)})`}const xi=Symbol.for("react.memo"),Is=Symbol.for("react.forward_ref"),Ns={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Rs={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Oi={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},zs={[Is]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[xi]:Oi};function rr(e){return("type"in(t=e)&&t.type.$$typeof)===xi?Oi:"$$typeof"in e?zs[e.$$typeof]:Ns;var t}const Ms=Object.defineProperty,Ds=Object.getOwnPropertyNames,Ts=Object.getOwnPropertySymbols,Ls=Object.getOwnPropertyDescriptor,Bs=Object.getPrototypeOf,Hs=Object.prototype;function Si(e,t,n){if(typeof t!="string"){const r=Bs(t);r&&r!==Hs&&Si(e,r,n);const i=Ds(t).concat(Ts(t)),o=rr(e),a=rr(t);for(let s=0;s<i.length;++s){const u=i[s];if(!(u in Rs||n&&n[u]||a&&u in a||o&&u in o)){const c=Ls(t,u);try{Ms(e,u,c)}catch{}}}}return e}function bt(e){return typeof e=="function"}const Fs=Symbol.for("react.forward_ref");function Ci(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&e.$$typeof===Fs&&"styledComponentId"in e}function He(e,t){return e&&t?e+" "+t:e||t||""}function ir(e,t){return e.join("")}function Ke(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Qt(e,t,n=!1){if(!n&&!Ke(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let r=0;r<t.length;r++)e[r]=Qt(e[r],t[r]);else if(Ke(t))for(const r in t)e[r]=Qt(e[r],t[r]);return e}function Pi(e,t){Object.defineProperty(e,"toString",{value:t})}const Gs=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const i=this.groupSizes,o=i.length;let a=o;for(;e>=a;)if(a<<=1,a<0)throw gt(16,`${e}`);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(let s=o;s<a;s++)this.groupSizes[s]=0}let n=this.indexOfGroup(e+1),r=0;for(let i=0,o=t.length;i<o;i++)this.tag.insertRule(n,t[i])&&(this.groupSizes[e]++,n++,r++);r>0&&this._cGroup>e&&(this._cIndex+=r)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(let i=n;i<r;i++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||this.groupSizes[e]===0)return t;const n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;for(let o=r;o<i;o++)t+=this.tag.getRule(o)+gn;return t}},Vs=`style[${Re}][${gi}="${yt}"]`,Ws=new RegExp(`^${Re}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),or=e=>typeof ShadowRoot<"u"&&e instanceof ShadowRoot||"host"in e&&e.nodeType===11,en=e=>{if(!e)return document;if(or(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(or(t))return t}return document},qs=(e,t,n)=>{const r=n.split(",");let i;for(let o=0,a=r.length;o<a;o++)(i=r[o])&&e.registerName(t,i)},Zs=(e,t)=>{var n;const r=((n=t.textContent)!==null&&n!==void 0?n:"").split(gn),i=[];for(let o=0,a=r.length;o<a;o++){const s=r[o].trim();if(!s)continue;const u=s.match(Ws);if(u){const c=0|parseInt(u[1],10),l=u[2];c!==0&&(Ss(l,c),qs(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}},Tt=e=>{const t=en(e.options.target).querySelectorAll(Vs);for(let n=0,r=t.length;n<r;n++){const i=t[n];i&&i.getAttribute(Re)!==yi&&(Zs(e,i),i.parentNode&&i.parentNode.removeChild(i))}};let Te=!1;function Ks(){if(Te!==!1)return Te;if(typeof document<"u"){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return Te=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return Te=t.getAttribute("content")||void 0}return Te=typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}const $i=(e,t)=>{const n=document.head,r=e||n,i=document.createElement("style"),o=(u=>{const c=Array.from(u.querySelectorAll(`style[${Re}]`));return c[c.length-1]})(r),a=o!==void 0?o.nextSibling:null;i.setAttribute(Re,yi),i.setAttribute(gi,yt);const s=t||Ks();return s&&i.setAttribute("nonce",s),r.insertBefore(i,a),i},Ys=class{constructor(e,t){this.element=$i(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(n=>{var r;if(n.sheet)return n.sheet;const i=(r=n.getRootNode().styleSheets)!==null&&r!==void 0?r:document.styleSheets;for(let o=0,a=i.length;o<a;o++){const s=i[o];if(s.ownerNode===n)return s}throw gt(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}},Xs=class{constructor(e,t){this.element=$i(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}};let ar=Ve;const Us={isServer:!Ve,useCSSOMInjection:!ks};class wt{static registerId(t){return et(t)}constructor(t=ze,n={},r){this.options=Object.assign(Object.assign({},Us),t),this.gs=n,this.keyframeIds=new Set,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Ve&&ar&&(ar=!1,Tt(this)),Pi(this,()=>(i=>{const o=i.getTag(),{length:a}=o;let s="";for(let u=0;u<a;u++){const c=Os(u);if(c===void 0)continue;const l=i.names.get(c);if(l===void 0||!l.size)continue;const f=o.getGroup(u);if(f.length===0)continue;const d=Re+".g"+u+'[id="'+c+'"]';let p="";for(const h of l)h.length>0&&(p+=h+",");s+=f+d+'{content:"'+p+'"}'+gn}return s})(this))}rehydrate(){!this.server&&Ve&&Tt(this)}reconstructWithOptions(t,n=!0){const r=new wt(Object.assign(Object.assign({},this.options),t),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&Ve&&t.target!==this.options.target&&en(this.options.target)!==en(t.target)&&Tt(r),r}allocateGSInstance(t){return this.gs[t]=(this.gs[t]||0)+1}getTag(){return this.tag||(this.tag=(t=(({useCSSOMInjection:n,target:r,nonce:i})=>n?new Ys(r,i):new Xs(r,i))(this.options),new Gs(t)));var t}hasNameForId(t,n){var r,i;return(i=(r=this.names.get(t))===null||r===void 0?void 0:r.has(n))!==null&&i!==void 0&&i}registerName(t,n){et(t),t.startsWith(xs)&&this.keyframeIds.add(t);const r=this.names.get(t);r?r.add(n):this.names.set(t,new Set([n]))}insertRules(t,n,r){this.registerName(t,n),this.getTag().insertRules(et(t),r)}clearNames(t){this.names.has(t)&&this.names.get(t).clear()}clearRules(t){this.getTag().clearGroup(et(t)),this.clearNames(t)}clearTag(){this.tag=void 0}}const _i=new WeakSet,Js={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart: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};function Qs(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in Js||e.startsWith("--")?String(t).trim():t+"px"}const ke=47;function sr(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t+=r>=65&&r<=90?"-"+String.fromCharCode(r+32):e[n]}return t.startsWith("ms-")?"-"+t:t}const eu=Symbol.for("sc-keyframes");function tu(e){return typeof e=="object"&&e!==null&&eu in e}function ji(e){return bt(e)&&!(e.prototype&&e.prototype.isReactComponent)}const Ei=e=>e==null||e===!1||e==="",nu=Symbol.for("react.client.reference");function ur(e){return e.$$typeof===nu}function Ai(e,t){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&!Ei(r)&&(Array.isArray(r)&&_i.has(r)||bt(r)?t.push(sr(n)+":",r,";"):Ke(r)?(t.push(n+" {"),Ai(r,t),t.push("}")):t.push(sr(n)+": "+Qs(n,r)+";"))}}function Oe(e,t,n,r,i=[]){if(Ei(e))return i;const o=typeof e;if(o==="string")return i.push(e),i;if(o==="function"){if(ur(e))return i;if(ji(e)&&t){const a=e(t);return Oe(a,t,n,r,i)}return i.push(e),i}if(Array.isArray(e)){for(let a=0;a<e.length;a++)Oe(e[a],t,n,r,i);return i}return Ci(e)?(i.push(`.${e.styledComponentId}`),i):tu(e)?(n?(e.inject(n,r),i.push(e.getName(r))):i.push(e),i):ur(e)?i:Ke(e)?e.toString!==Object.prototype.toString?(i.push(e.toString()),i):(Ai(e,i),i):(i.push(e.toString()),i)}const ru=ki(yt);class iu{constructor(t,n,r){this.rules=t,this.componentId=n,this.baseHash=xe(ru,n),this.baseStyle=r,wt.registerId(n)}generateAndInjectStyles(t,n,r){let i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";{let o="";for(let a=0;a<this.rules.length;a++){const s=this.rules[a];if(typeof s=="string")o+=s;else if(s)if(ji(s)){const u=s(t);typeof u=="string"?o+=u:u!=null&&u!==!1&&(o+=ir(Oe(u,t,n,r)))}else o+=ir(Oe(s,t,n,r))}if(o){this.dynamicNameCache||(this.dynamicNameCache=new Map);const a=r.hash?r.hash+o:o;let s=this.dynamicNameCache.get(a);if(!s){if(s=wi(xe(xe(this.baseHash,r.hash),o)>>>0),this.dynamicNameCache.size>=200){const u=this.dynamicNameCache.keys().next().value;u!==void 0&&this.dynamicNameCache.delete(u)}this.dynamicNameCache.set(a,s)}if(!n.hasNameForId(this.componentId,s)){const u=r(o,"."+s,void 0,this.componentId);n.insertRules(this.componentId,s,u)}i=He(i,s)}}return i}}const ou=/&/g;function Ii(e,t){let n=0;for(;--t>=0&&e.charCodeAt(t)===92;)n++;return!(1&~n)}function Lt(e){const t=e.length;let n="",r=0,i=0,o=0,a=!1,s=!1;for(let u=0;u<t;u++){const c=e.charCodeAt(u);if(o!==0||a||c!==ke||e.charCodeAt(u+1)!==42)if(a)c===42&&e.charCodeAt(u+1)===ke&&(a=!1,u++);else if(c!==34&&c!==39||Ii(e,u)){if(o===0)if(c===123)i++;else if(c===125){if(i--,i<0){s=!0;let l=u+1;for(;l<t;){const f=e.charCodeAt(l);if(f===59||f===10)break;l++}l<t&&e.charCodeAt(l)===59&&l++,i=0,u=l-1,r=l;continue}i===0&&(n+=e.substring(r,u+1),r=u+1)}else c===59&&i===0&&(n+=e.substring(r,u+1),r=u+1)}else o===0?o=c:o===c&&(o=0);else a=!0,u++}return s||i!==0||o!==0?(r<t&&i===0&&o===0&&(n+=e.substring(r)),n):e}function Ni(e,t){const n=t+" ",r=","+n;for(let i=0;i<e.length;i++){const o=e[i];if(o.type==="rule"){o.value=(n+o.value).replaceAll(",",r);const a=o.props,s=[];for(let u=0;u<a.length;u++)s[u]=n+a[u];o.props=s}Array.isArray(o.children)&&o.type!=="@keyframes"&&Ni(o.children,t)}return e}function au({options:e=ze,plugins:t=bn}=ze){let n,r,i;const o=(d,p,h)=>h.startsWith(r)&&h.endsWith(r)&&h.replaceAll(r,"").length>0?`.${n}`:d,a=t.slice();a.push(d=>{d.type===pt&&d.value.includes("&")&&(i||(i=new RegExp(`\\${r}\\b`,"g")),d.props[0]=d.props[0].replace(ou,r).replace(i,o))}),e.prefix&&a.push(ws),a.push(ys);let s=[];const u=gs(a.concat(bs(d=>s.push(d)))),c=(d,p="",h="",y="&")=>{n=y,r=p,i=void 0;const m=(function(v){const w=v.indexOf("//")!==-1,E=v.indexOf("}")!==-1;if(!w&&!E)return v;if(!w)return Lt(v);const _=v.length;let I="",P=0,j=0,A=0,N=0,D=0,V=!1;for(;j<_;){const L=v.charCodeAt(j);if(L!==34&&L!==39||Ii(v,j))if(A===0)if(L===ke&&j+1<_&&v.charCodeAt(j+1)===42){for(j+=2;j+1<_&&(v.charCodeAt(j)!==42||v.charCodeAt(j+1)!==ke);)j++;j+=2}else if(L!==40)if(L!==41)if(N>0)j++;else if(L===42&&j+1<_&&v.charCodeAt(j+1)===ke)I+=v.substring(P,j),j+=2,P=j,V=!0;else if(L===ke&&j+1<_&&v.charCodeAt(j+1)===ke){for(I+=v.substring(P,j);j<_&&v.charCodeAt(j)!==10;)j++;P=j,V=!0}else L===123?D++:L===125&&D--,j++;else N>0&&N--,j++;else N++,j++;else j++;else A===0?A=L:A===L&&(A=0),j++}return V?(P<_&&(I+=v.substring(P)),D===0?I:Lt(I)):D===0?v:Lt(v)})(d);let k=vs(h||p?h+" "+p+" { "+m+" }":m);return e.namespace&&(k=Ni(k,e.namespace)),s=[],lt(k,u),s},l=e;let f=Ut;for(let d=0;d<t.length;d++)t[d].name||gt(15),f=xe(f,t[d].name);return l!=null&&l.namespace&&(f=xe(f,l.namespace)),l!=null&&l.prefix&&(f=xe(f,"p")),c.hash=f!==Ut?f.toString():"",c}const su=new wt,uu=au(),Ri=Ee.createContext({shouldForwardProp:void 0,styleSheet:su,stylis:uu,stylisPlugins:void 0});Ri.Consumer;function cu(){return Ee.useContext(Ri)}const zi=Ee.createContext(void 0);zi.Consumer;const cr=Object.prototype.hasOwnProperty,Bt={};function lu(e,t){const n=typeof e!="string"?"sc":bi(e);Bt[n]=(Bt[n]||0)+1;const r=n+"-"+js(yt+n+Bt[n]);return t?t+"-"+r:r}function du(e,t,n){const r=Ci(e),i=e,o=!Jt(e),{attrs:a=bn,componentId:s=lu(t.displayName,t.parentComponentId),displayName:u=As(e)}=t,c=t.displayName&&t.componentId?bi(t.displayName)+"-"+t.componentId:t.componentId||s,l=r&&i.attrs?i.attrs.concat(a).filter(Boolean):a;let{shouldForwardProp:f}=t;if(r&&i.shouldForwardProp){const y=i.shouldForwardProp;if(t.shouldForwardProp){const m=t.shouldForwardProp;f=(k,v)=>y(k,v)&&m(k,v)}else f=y}const d=new iu(n,c,r?i.componentStyle:void 0);function p(y,m){return(function(k,v,w){const{attrs:E,componentStyle:_,defaultProps:I,foldedComponentIds:P,styledComponentId:j,target:A}=k,N=Ee.useContext(zi),D=cu(),V=k.shouldForwardProp||D.shouldForwardProp,L=Cs(v,N,I)||ze;let Z,K;{const x=Ee.useRef(null),S=x.current;if(S!==null&&S[1]===L&&S[2]===D.styleSheet&&S[3]===D.stylis&&S[7]===_&&(function(C,M,X){const ee=C,te=M;let De=0;for(const we in te)if(cr.call(te,we)&&(De++,ee[we]!==te[we]))return!1;return De===X})(S[0],v,S[4]))Z=S[5],K=S[6];else{Z=(function(M,X,ee){const te=Object.assign(Object.assign({},X),{className:void 0,theme:ee}),De=M.length>1;for(let we=0;we<M.length;we++){const kt=M[we],Xe=bt(kt)?kt(De?Object.assign({},te):te):kt;for(const ye in Xe)ye==="className"?te.className=He(te.className,Xe[ye]):ye==="style"?te.style=Object.assign(Object.assign({},te.style),Xe[ye]):ye in X&&X[ye]===void 0||(te[ye]=Xe[ye])}return"className"in X&&typeof X.className=="string"&&(te.className=He(te.className,X.className)),te})(E,v,L),K=(function(M,X,ee,te){return M.generateAndInjectStyles(X,ee,te)})(_,Z,D.styleSheet,D.stylis);let C=0;for(const M in v)cr.call(v,M)&&C++;x.current=[v,L,D.styleSheet,D.stylis,C,Z,K,_]}}const se=Z.as||A,Q=(function(x,S,C,M){const X={};for(const ee in x)x[ee]===void 0||ee[0]==="$"||ee==="as"||ee==="theme"&&x.theme===C||(ee==="forwardedAs"?X.as=x.forwardedAs:M&&!M(ee,S)||(X[ee]=x[ee]));return X})(Z,se,L,V);let b=He(P,j);return K&&(b+=" "+K),Z.className&&(b+=" "+Z.className),Q[Jt(se)&&se.includes("-")?"class":"className"]=b,w&&(Q.ref=w),g.createElement(se,Q)})(h,y,m)}p.displayName=u;let h=Ee.forwardRef(p);return h.attrs=l,h.componentStyle=d,h.displayName=u,h.shouldForwardProp=f,h.foldedComponentIds=r?He(i.foldedComponentIds,i.styledComponentId):"",h.styledComponentId=c,h.target=r?i.target:e,Object.defineProperty(h,"defaultProps",{get(){return this._foldedDefaultProps},set(y){this._foldedDefaultProps=r?(function(m,...k){for(const v of k)Qt(m,v,!0);return m})({},i.defaultProps,y):y}}),Pi(h,()=>`.${h.styledComponentId}`),o&&Si(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),h}var fu=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function lr(e,t){const n=[e[0]];for(let r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}const dr=e=>(_i.add(e),e);function wn(e,...t){if(bt(e)||Ke(e))return dr(Oe(lr(bn,[e,...t])));const n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Oe(n):dr(Oe(lr(n,t)))}function tn(e,t,n=ze){if(!t)throw gt(1,t);const r=(i,...o)=>e(t,n,wn(i,...o));return r.attrs=i=>tn(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)})),r.withConfig=i=>tn(e,t,Object.assign(Object.assign({},n),i)),r}const Mi=e=>tn(du,e),re=Mi;fu.forEach(e=>{re[e]=Mi(e)});function Ce(){return Ce=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},Ce.apply(null,arguments)}function pu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kn(e,t){if(e==null)return{};var n,r,i=pu(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}/*!
52
52
  * rete-react-plugin v2.0.7
53
53
  * (c) 2025 Vitaliy Stoliarov
54
54
  * Released under the MIT license.
55
- * */function ou(e){var t=e==null?void 0:e.createRoot,n=new WeakMap;function r(a){var s=n.get(a);if(s)return s;var u=document.createElement("span");return a.appendChild(u),n.set(a,u),u}function i(a){var s=n.get(a);s&&(s.remove(),n.delete(a))}if(t){var o=new WeakMap;return{mount:function(s,u){var c,l=r(u),f=o.get(l);return f||(f=t(l),o.set(l,f)),f.render(s),(c=l.firstElementChild)!==null&&c!==void 0?c:l},unmount:function(s){var u=r(s),c=o.get(u);c&&(c.unmount(),o.delete(u)),i(s)}}}return{mount:function(s,u){var c=r(u);if("render"in On&&typeof Le.render=="function"){var l=Le.render(s,c);return l||c}throw new Error("ReactDOM.render is not available")},unmount:function(s){var u=r(s);if("unmountComponentAtNode"in On&&typeof Le.unmountComponentAtNode=="function")Le.unmountComponentAtNode(u);else throw new Error("ReactDOM.unmountComponentAtNode is not available");i(s)}}}function au(e){var t=e.children,n=e.rendered;return g.useEffect(function(){n()}),t}function su(){var e=g.useRef(!1);return g.useEffect(function(){e.current=!0},[]),{apply:function(n){e.current?queueMicrotask(function(){Le.flushSync(n)}):n()}}}var zi=g.createContext({start:null,end:null,path:null});function uu(e){var t=e.children,n=g.useState(null),r=re(n,2),i=r[0],o=r[1],a=g.useState(null),s=re(a,2),u=s[0],c=s[1],l=g.useState(null),f=re(l,2),d=f[0],p=f[1],h="x"in e.start?e.start:i,y="x"in e.end?e.end:u,m=su();return g.useEffect(function(){var k=typeof e.start=="function"&&e.start(function(w){m.apply(function(){o(w)})}),v=typeof e.end=="function"&&e.end(function(w){m.apply(function(){c(w)})});return function(){k&&k(),v&&v()}},[]),g.useEffect(function(){h&&y&&e.path(h,y).then(function(k){m.apply(function(){p(k)})})},[h,y]),g.createElement(zi.Provider,{value:{start:h,end:y,path:d}},t)}function Mi(){return g.useContext(zi)}var dr,fr,cu=ne.svg(dr||(dr=J([`
55
+ * */function hu(e){var t=e==null?void 0:e.createRoot,n=new WeakMap;function r(a){var s=n.get(a);if(s)return s;var u=document.createElement("span");return a.appendChild(u),n.set(a,u),u}function i(a){var s=n.get(a);s&&(s.remove(),n.delete(a))}if(t){var o=new WeakMap;return{mount:function(s,u){var c,l=r(u),f=o.get(l);return f||(f=t(l),o.set(l,f)),f.render(s),(c=l.firstElementChild)!==null&&c!==void 0?c:l},unmount:function(s){var u=r(s),c=o.get(u);c&&(c.unmount(),o.delete(u)),i(s)}}}return{mount:function(s,u){var c=r(u);if("render"in On&&typeof Le.render=="function"){var l=Le.render(s,c);return l||c}throw new Error("ReactDOM.render is not available")},unmount:function(s){var u=r(s);if("unmountComponentAtNode"in On&&typeof Le.unmountComponentAtNode=="function")Le.unmountComponentAtNode(u);else throw new Error("ReactDOM.unmountComponentAtNode is not available");i(s)}}}function vu(e){var t=e.children,n=e.rendered;return g.useEffect(function(){n()}),t}function mu(){var e=g.useRef(!1);return g.useEffect(function(){e.current=!0},[]),{apply:function(n){e.current?queueMicrotask(function(){Le.flushSync(n)}):n()}}}var Di=g.createContext({start:null,end:null,path:null});function yu(e){var t=e.children,n=g.useState(null),r=ie(n,2),i=r[0],o=r[1],a=g.useState(null),s=ie(a,2),u=s[0],c=s[1],l=g.useState(null),f=ie(l,2),d=f[0],p=f[1],h="x"in e.start?e.start:i,y="x"in e.end?e.end:u,m=mu();return g.useEffect(function(){var k=typeof e.start=="function"&&e.start(function(w){m.apply(function(){o(w)})}),v=typeof e.end=="function"&&e.end(function(w){m.apply(function(){c(w)})});return function(){k&&k(),v&&v()}},[]),g.useEffect(function(){h&&y&&e.path(h,y).then(function(k){m.apply(function(){p(k)})})},[h,y]),g.createElement(Di.Provider,{value:{start:h,end:y,path:d}},t)}function Ti(){return g.useContext(Di)}var fr,pr,gu=re.svg(fr||(fr=J([`
56
56
  overflow: visible !important;
57
57
  position: absolute;
58
58
  pointer-events: none;
59
59
  width: 9999px;
60
60
  height: 9999px;
61
- `]))),lu=ne.path(fr||(fr=J([`
61
+ `]))),bu=re.path(pr||(pr=J([`
62
62
  fill: none;
63
63
  stroke-width: 5px;
64
64
  stroke: steelblue;
65
65
  pointer-events: auto;
66
66
  `,`
67
- `])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function Di(e){var t=Mi(),n=t.path;return n?g.createElement(cu,{"data-testid":"connection"},g.createElement(lu,{styles:e.styles,d:n})):null}function du(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=fu(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
68
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function fu(e,t){if(e){if(typeof e=="string")return pr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pr(e,t):void 0}}function pr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pu(e){for(var t=new e.constructor(e.type),n=t;n=Object.getPrototypeOf(n);){var r=Object.getOwnPropertyNames(n),i=du(r),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=t[a];typeof s!="function"&&Object.defineProperty(t,a,{value:e[a]})}}catch(u){i.e(u)}finally{i.f()}}return t}var hu="__reactContainer$";function vu(e){for(var t=e;t;){if(t._reactRootContainer||Object.keys(t).some(function(n){return n.startsWith(hu)}))return t;t=t.parentElement}}function hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hr(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ti(e,t){return{start:function(r){var i=vr({},t(r));function o(s){var u=vr({},t(s)),c=u.x-i.x,l=u.y-i.y;i=u,e(c,l)}function a(){window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}window.addEventListener("pointermove",o),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a)}}}function mu(e,t){g.useEffect(function(){var n=function(o){if(!t){var a=vu(o.target),s=g.version.startsWith("16")?document:a;s&&(o.stopPropagation(),s.dispatchEvent(pu(o)))}},r=e.current;return r==null||r.addEventListener("pointerdown",n),function(){r==null||r.removeEventListener("pointerdown",n)}},[e,t])}var mr,yu=ne.input(mr||(mr=J([`
67
+ `])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function Li(e){var t=Ti(),n=t.path;return n?g.createElement(gu,{"data-testid":"connection"},g.createElement(bu,{styles:e.styles,d:n})):null}function wu(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ku(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function ku(e,t){if(e){if(typeof e=="string")return hr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(e,t):void 0}}function hr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xu(e){for(var t=new e.constructor(e.type),n=t;n=Object.getPrototypeOf(n);){var r=Object.getOwnPropertyNames(n),i=wu(r),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=t[a];typeof s!="function"&&Object.defineProperty(t,a,{value:e[a]})}}catch(u){i.e(u)}finally{i.f()}}return t}var Ou="__reactContainer$";function Su(e){for(var t=e;t;){if(t._reactRootContainer||Object.keys(t).some(function(n){return n.startsWith(Ou)}))return t;t=t.parentElement}}function vr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vr(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bi(e,t){return{start:function(r){var i=mr({},t(r));function o(s){var u=mr({},t(s)),c=u.x-i.x,l=u.y-i.y;i=u,e(c,l)}function a(){window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}window.addEventListener("pointermove",o),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a)}}}function Cu(e,t){g.useEffect(function(){var n=function(o){if(!t){var a=Su(o.target),s=g.version.startsWith("16")?document:a;s&&(o.stopPropagation(),s.dispatchEvent(xu(o)))}},r=e.current;return r==null||r.addEventListener("pointerdown",n),function(){r==null||r.removeEventListener("pointerdown",n)}},[e,t])}var yr,Pu=re.input(yr||(yr=J([`
69
69
  width: 100%;
70
70
  border-radius: 30px;
71
71
  background-color: white;
@@ -74,7 +74,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
74
74
  font-size: 110%;
75
75
  box-sizing: border-box;
76
76
  `,`
77
- `])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function nn(e){var t=g.useState(e.data.value),n=re(t,2),r=n[0],i=n[1],o=g.useRef(null);return mu(o),g.useEffect(function(){i(e.data.value)},[e.data.value]),g.createElement(yu,{value:r,type:e.data.type,ref:o,readOnly:e.data.readonly,onChange:function(s){var u=e.data.type==="number"?+s.target.value:s.target.value;i(u),e.data.setValue(u)},styles:e.styles})}var rn="rgba(110,136,255,0.8)",Li="#ffd92c",le=24,ve=6,Bi="#96b38a",Fi=180,gu=Object.freeze({__proto__:null,$nodecolor:rn,$nodecolorselected:Li,$socketsize:le,$socketmargin:ve,$socketcolor:Bi,$nodewidth:Fi}),bu=["init","unmount"];function Hi(e){var t=e.init,n=e.unmount,r=kn(e,bu),i=g.useRef(null);return g.useEffect(function(){var o=i.current;return function(){o&&n(o)}},[]),g.useEffect(function(){i.current&&t(i.current)}),g.createElement("span",Ce({},r,{ref:i}))}var wu=["name","emit","payload"];function on(e){var t=e.name,n=e.emit,r=e.payload,i=kn(e,wu);return g.createElement(Hi,Ce({},i,{className:t,init:function(a){n({type:"render",data:{type:"control",element:a,payload:r}})},unmount:function(a){n({type:"unmount",data:{element:a}})}}))}var ku=["name","emit","nodeId","side","socketKey","payload"];function an(e){var t=e.name,n=e.emit,r=e.nodeId,i=e.side,o=e.socketKey,a=e.payload,s=kn(e,ku);return g.createElement(Hi,Ce({},s,{className:t,init:function(c){n({type:"render",data:{type:"socket",side:i,key:o,nodeId:r,element:c,payload:a}})},unmount:function(c){n({type:"unmount",data:{element:c}})}}))}var yr,gr,Gi=ne.div(yr||(yr=J([`
77
+ `])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function nn(e){var t=g.useState(e.data.value),n=ie(t,2),r=n[0],i=n[1],o=g.useRef(null);return Cu(o),g.useEffect(function(){i(e.data.value)},[e.data.value]),g.createElement(Pu,{value:r,type:e.data.type,ref:o,readOnly:e.data.readonly,onChange:function(s){var u=e.data.type==="number"?+s.target.value:s.target.value;i(u),e.data.setValue(u)},styles:e.styles})}var rn="rgba(110,136,255,0.8)",Hi="#ffd92c",le=24,he=6,Fi="#96b38a",Gi=180,$u=Object.freeze({__proto__:null,$nodecolor:rn,$nodecolorselected:Hi,$socketsize:le,$socketmargin:he,$socketcolor:Fi,$nodewidth:Gi}),_u=["init","unmount"];function Vi(e){var t=e.init,n=e.unmount,r=kn(e,_u),i=g.useRef(null);return g.useEffect(function(){var o=i.current;return function(){o&&n(o)}},[]),g.useEffect(function(){i.current&&t(i.current)}),g.createElement("span",Ce({},r,{ref:i}))}var ju=["name","emit","payload"];function on(e){var t=e.name,n=e.emit,r=e.payload,i=kn(e,ju);return g.createElement(Vi,Ce({},i,{className:t,init:function(a){n({type:"render",data:{type:"control",element:a,payload:r}})},unmount:function(a){n({type:"unmount",data:{element:a}})}}))}var Eu=["name","emit","nodeId","side","socketKey","payload"];function an(e){var t=e.name,n=e.emit,r=e.nodeId,i=e.side,o=e.socketKey,a=e.payload,s=kn(e,Eu);return g.createElement(Vi,Ce({},s,{className:t,init:function(c){n({type:"render",data:{type:"socket",side:i,key:o,nodeId:r,element:c,payload:a}})},unmount:function(c){n({type:"unmount",data:{element:c}})}}))}var gr,br,Wi=re.div(gr||(gr=J([`
78
78
  background: `,`;
79
79
  border: 2px solid #4e58bf;
80
80
  border-radius: 10px;
@@ -134,10 +134,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
134
134
  padding: `,"px ",`px;
135
135
  }
136
136
  `,`
137
- `])),rn,function(e){return Number.isFinite(e.width)?"".concat(e.width,"px"):"".concat(Fi,"px")},function(e){return Number.isFinite(e.height)?"".concat(e.height,"px"):"auto"},rn,function(e){return e.selected&&wn(gr||(gr=J([`
137
+ `])),rn,function(e){return Number.isFinite(e.width)?"".concat(e.width,"px"):"".concat(Gi,"px")},function(e){return Number.isFinite(e.height)?"".concat(e.height,"px"):"auto"},rn,function(e){return e.selected&&wn(br||(br=J([`
138
138
  background: `,`;
139
139
  border-color: #e3c000;
140
- `])),Li)},le/2+ve,le/2+ve,ve,le,le+2*ve,ve,le/2+ve,function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function Ft(e){e.sort(function(t,n){var r,i,o=((r=t[1])===null||r===void 0?void 0:r.index)||0,a=((i=n[1])===null||i===void 0?void 0:i.index)||0;return o-a})}function Vi(e){var t=Object.entries(e.data.inputs),n=Object.entries(e.data.outputs),r=Object.entries(e.data.controls),i=e.data.selected||!1,o=e.data,a=o.id,s=o.label,u=o.width,c=o.height;return Ft(t),Ft(n),Ft(r),g.createElement(Gi,{selected:i,width:u,height:c,styles:e.styles,"data-testid":"node"},g.createElement("div",{className:"title","data-testid":"title"},s),n.map(function(l){var f=re(l,2),d=f[0],p=f[1];return p&&g.createElement("div",{className:"output",key:d,"data-testid":"output-".concat(d)},g.createElement("div",{className:"output-title","data-testid":"output-title"},p.label),g.createElement(an,{name:"output-socket",side:"output",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"output-socket"}))}),r.map(function(l){var f=re(l,2),d=f[0],p=f[1];return p?g.createElement(on,{key:d,name:"control",emit:e.emit,payload:p,"data-testid":"control-".concat(d)}):null}),t.map(function(l){var f=re(l,2),d=f[0],p=f[1];return p&&g.createElement("div",{className:"input",key:d,"data-testid":"input-".concat(d)},g.createElement(an,{name:"input-socket",side:"input",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"input-socket"}),p&&(!p.control||!p.showControl)&&g.createElement("div",{className:"input-title","data-testid":"input-title"},p.label),p.control&&p.showControl&&g.createElement(on,{key:d,name:"input-control",emit:e.emit,payload:p.control,"data-testid":"input-control"}))}))}var br,wr,Wi=ne.div(br||(br=J([`
140
+ `])),Hi)},le/2+he,le/2+he,he,le,le+2*he,he,le/2+he,function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function Ht(e){e.sort(function(t,n){var r,i,o=((r=t[1])===null||r===void 0?void 0:r.index)||0,a=((i=n[1])===null||i===void 0?void 0:i.index)||0;return o-a})}function qi(e){var t=Object.entries(e.data.inputs),n=Object.entries(e.data.outputs),r=Object.entries(e.data.controls),i=e.data.selected||!1,o=e.data,a=o.id,s=o.label,u=o.width,c=o.height;return Ht(t),Ht(n),Ht(r),g.createElement(Wi,{selected:i,width:u,height:c,styles:e.styles,"data-testid":"node"},g.createElement("div",{className:"title","data-testid":"title"},s),n.map(function(l){var f=ie(l,2),d=f[0],p=f[1];return p&&g.createElement("div",{className:"output",key:d,"data-testid":"output-".concat(d)},g.createElement("div",{className:"output-title","data-testid":"output-title"},p.label),g.createElement(an,{name:"output-socket",side:"output",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"output-socket"}))}),r.map(function(l){var f=ie(l,2),d=f[0],p=f[1];return p?g.createElement(on,{key:d,name:"control",emit:e.emit,payload:p,"data-testid":"control-".concat(d)}):null}),t.map(function(l){var f=ie(l,2),d=f[0],p=f[1];return p&&g.createElement("div",{className:"input",key:d,"data-testid":"input-".concat(d)},g.createElement(an,{name:"input-socket",side:"input",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"input-socket"}),p&&(!p.control||!p.showControl)&&g.createElement("div",{className:"input-title","data-testid":"input-title"},p.label),p.control&&p.showControl&&g.createElement(on,{key:d,name:"input-control",emit:e.emit,payload:p.control,"data-testid":"input-control"}))}))}var wr,kr,Zi=re.div(wr||(wr=J([`
141
141
  display: inline-block;
142
142
  cursor: pointer;
143
143
  border: 1px solid white;
@@ -154,13 +154,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
154
154
  &.multiple {
155
155
  border-color: yellow;
156
156
  }
157
- `])),le/2,le,le,Bi),xu=ne.div(wr||(wr=J([`
157
+ `])),le/2,le,le,Fi),Au=re.div(kr||(kr=J([`
158
158
  border-radius: `,`px;
159
159
  padding: `,`px;
160
160
  &:hover `,` {
161
161
  border-width: 4px;
162
162
  }
163
- `])),(le+ve*2)/2,ve,Wi);function qi(e){return g.createElement(xu,null,g.createElement(Wi,{title:e.data.name}))}function Ou(e){var t=typeof(e==null?void 0:e.socketPositionWatcher)>"u"?qa():e.socketPositionWatcher,n=(e==null?void 0:e.customize)||{},r=n.node,i=n.connection,o=n.socket,a=n.control;return{attach:function(u){t.attach(u)},render:function(u,c){if(u.data.type==="node"){var l=c.parentScope(),f=r?r(u.data):Vi;return f&&g.createElement(f,{data:u.data.payload,emit:function(j){l.emit(j)}})}else if(u.data.type==="connection"){var d=i?i(u.data):Di,p=u.data.payload,h=p.sourceOutput,y=p.targetInput,m=p.source,k=p.target;return d&&g.createElement(uu,{start:u.data.start||function(E){return t.listen(m,"output",h,E)},end:u.data.end||function(E){return t.listen(k,"input",y,E)},path:(function(){var E=T(S.mark(function j(R,P){var _,A,I,D,V;return S.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=1,c.emit({type:"connectionpath",data:{payload:p,points:[R,P]}});case 1:if(_=L.sent,_){L.next=2;break}return L.abrupt("return","");case 2:if(A=_.data,I=A.path,D=A.points,V=.3,!(!I&&D.length!==2)){L.next=3;break}throw new Error("cannot render connection with a custom number of points");case 3:if(I){L.next=4;break}return L.abrupt("return",p.isLoop?La(D,V,120):Ta(D,V));case 4:return L.abrupt("return",I);case 5:case"end":return L.stop()}},j)}));return function(j,R){return E.apply(this,arguments)}})()},g.createElement(d,{data:u.data.payload}))}else if(u.data.type==="socket"){var v=o?o(u.data):qi;return v&&u.data.payload&&g.createElement(v,{data:u.data.payload})}else if(u.data.type==="control"){var w=a&&u.data.payload?a(u.data):u.data.payload instanceof Ae.InputControl?nn:null;return w&&g.createElement(w,{data:u.data.payload})}}}}var Su=Object.freeze({__proto__:null,vars:gu,setup:Ou,Connection:Di,useConnection:Mi,Control:nn,InputControl:nn,Node:Vi,NodeStyles:Gi,RefControl:on,RefSocket:an,Socket:qi});function Ki(e,t){var n=g.useRef(void 0);function r(){n.current&&clearTimeout(n.current)}var i=function(){r(),n.current=setTimeout(function(){e()},t)};return g.useEffect(function(){return r},[]),[i,r]}var Cu="rgba(110,136,255,0.8)",Pu="rgba(130, 153, 255, 0.8)",$u="rgba(69, 103, 255, 0.8)",tt="5px",sn=120,kr,xn=ne.div(kr||(kr=J([`
163
+ `])),(le+he*2)/2,he,Zi);function Ki(e){return g.createElement(Au,null,g.createElement(Zi,{title:e.data.name}))}function Iu(e){var t=typeof(e==null?void 0:e.socketPositionWatcher)>"u"?ts():e.socketPositionWatcher,n=(e==null?void 0:e.customize)||{},r=n.node,i=n.connection,o=n.socket,a=n.control;return{attach:function(u){t.attach(u)},render:function(u,c){if(u.data.type==="node"){var l=c.parentScope(),f=r?r(u.data):qi;return f&&g.createElement(f,{data:u.data.payload,emit:function(_){l.emit(_)}})}else if(u.data.type==="connection"){var d=i?i(u.data):Li,p=u.data.payload,h=p.sourceOutput,y=p.targetInput,m=p.source,k=p.target;return d&&g.createElement(yu,{start:u.data.start||function(E){return t.listen(m,"output",h,E)},end:u.data.end||function(E){return t.listen(k,"input",y,E)},path:(function(){var E=T(O.mark(function _(I,P){var j,A,N,D,V;return O.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=1,c.emit({type:"connectionpath",data:{payload:p,points:[I,P]}});case 1:if(j=L.sent,j){L.next=2;break}return L.abrupt("return","");case 2:if(A=j.data,N=A.path,D=A.points,V=.3,!(!N&&D.length!==2)){L.next=3;break}throw new Error("cannot render connection with a custom number of points");case 3:if(N){L.next=4;break}return L.abrupt("return",p.isLoop?Ka(D,V,120):Za(D,V));case 4:return L.abrupt("return",N);case 5:case"end":return L.stop()}},_)}));return function(_,I){return E.apply(this,arguments)}})()},g.createElement(d,{data:u.data.payload}))}else if(u.data.type==="socket"){var v=o?o(u.data):Ki;return v&&u.data.payload&&g.createElement(v,{data:u.data.payload})}else if(u.data.type==="control"){var w=a&&u.data.payload?a(u.data):u.data.payload instanceof Ae.InputControl?nn:null;return w&&g.createElement(w,{data:u.data.payload})}}}}var Nu=Object.freeze({__proto__:null,vars:$u,setup:Iu,Connection:Li,useConnection:Ti,Control:nn,InputControl:nn,Node:qi,NodeStyles:Wi,RefControl:on,RefSocket:an,Socket:Ki});function Yi(e,t){var n=g.useRef(void 0);function r(){n.current&&clearTimeout(n.current)}var i=function(){r(),n.current=setTimeout(function(){e()},t)};return g.useEffect(function(){return r},[]),[i,r]}var Ru="rgba(110,136,255,0.8)",zu="rgba(130, 153, 255, 0.8)",Mu="rgba(69, 103, 255, 0.8)",tt="5px",sn=120,xr,xn=re.div(xr||(xr=J([`
164
164
  color: #fff;
165
165
  padding: 4px;
166
166
  border-bottom: 1px solid `,`;
@@ -179,20 +179,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
179
179
  &:hover {
180
180
  background-color: `,`;
181
181
  }
182
- `])),$u,Cu,tt,tt,tt,tt,Pu),xr,Or,Sr,Yi=ne(xn)(xr||(xr=J([`
182
+ `])),Mu,Ru,tt,tt,tt,tt,zu),Or,Sr,Cr,Xi=re(xn)(Or||(Or=J([`
183
183
  `,`
184
- `])),function(e){return e.hasSubitems&&wn(Or||(Or=J([`&:after {
184
+ `])),function(e){return e.hasSubitems&&wn(Sr||(Sr=J([`&:after {
185
185
  content: '►';
186
186
  position: absolute;
187
187
  opacity: 0.6;
188
188
  right: 5px;
189
189
  top: 5px;
190
- }`])))}),Zi=ne.div(Sr||(Sr=J([`
190
+ }`])))}),Ui=re.div(Cr||(Cr=J([`
191
191
  position: absolute;
192
192
  top: 0;
193
193
  left: 100%;
194
194
  width: `,`px;
195
- `])),sn);function Ui(e){var t,n,r,i,o=g.useState(!1),a=re(o,2),s=a[0],u=a[1],c=g.useCallback(function(){u(!1)},[u]),l=Ki(c,e.delay),f=re(l,2),d=f[0],p=f[1],h=((t=e.components)===null||t===void 0||(n=t.item)===null||n===void 0?void 0:n.call(t,e.data))||Yi,y=((r=e.components)===null||r===void 0||(i=r.subitems)===null||i===void 0?void 0:i.call(r,e.data))||Zi;return g.createElement(h,{onClick:function(k){k.stopPropagation(),e.data.handler(),e.hide()},hasSubitems:!!e.data.subitems,onPointerDown:function(k){k.stopPropagation()},onPointerOver:function(){p(),u(!0)},onPointerLeave:function(){d&&d()},"data-testid":"context-menu-item"},e.children,e.data.subitems&&s&&g.createElement(y,null,e.data.subitems.map(function(m){return g.createElement(Ui,{key:m.key,data:m,delay:e.delay,hide:e.hide,components:e.components},m.label)})))}var Cr,Xi=ne.input(Cr||(Cr=J([`
195
+ `])),sn);function Ji(e){var t,n,r,i,o=g.useState(!1),a=ie(o,2),s=a[0],u=a[1],c=g.useCallback(function(){u(!1)},[u]),l=Yi(c,e.delay),f=ie(l,2),d=f[0],p=f[1],h=((t=e.components)===null||t===void 0||(n=t.item)===null||n===void 0?void 0:n.call(t,e.data))||Xi,y=((r=e.components)===null||r===void 0||(i=r.subitems)===null||i===void 0?void 0:i.call(r,e.data))||Ui;return g.createElement(h,{onClick:function(k){k.stopPropagation(),e.data.handler(),e.hide()},hasSubitems:!!e.data.subitems,onPointerDown:function(k){k.stopPropagation()},onPointerOver:function(){p(),u(!0)},onPointerLeave:function(){d&&d()},"data-testid":"context-menu-item"},e.children,e.data.subitems&&s&&g.createElement(y,null,e.data.subitems.map(function(m){return g.createElement(Ji,{key:m.key,data:m,delay:e.delay,hide:e.hide,components:e.components},m.label)})))}var Pr,Qi=re.input(Pr||(Pr=J([`
196
196
  color: white;
197
197
  padding: 1px 8px;
198
198
  border: 1px solid white;
@@ -202,20 +202,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
202
202
  width: 100%;
203
203
  box-sizing: border-box;
204
204
  background: transparent;
205
- `])));function ju(e){var t=e.component||Xi;return g.createElement(t,{value:e.value,onInput:function(r){e.onChange(r.target.value)},onPointerDown:function(r){r.stopPropagation()},"data-testid":"context-menu-search-input"})}var Pr,Ji=ne.div(Pr||(Pr=J([`
205
+ `])));function Du(e){var t=e.component||Qi;return g.createElement(t,{value:e.value,onInput:function(r){e.onChange(r.target.value)},onPointerDown:function(r){r.stopPropagation()},"data-testid":"context-menu-search-input"})}var $r,eo=re.div($r||($r=J([`
206
206
  padding: 10px;
207
207
  width: `,`px;
208
208
  margin-top: -20px;
209
209
  margin-left: -`,`px;
210
- `])),sn,sn/2);function _u(e){var t,n,r,i,o,a,s=Ki(e.onHide,e.delay),u=re(s,2),c=u[0],l=u[1],f=g.useState(""),d=re(f,2),p=d[0],h=d[1],y=new RegExp(p,"i"),m=e.items.filter(function(w){return w.label.match(y)}),k=((t=e.components)===null||t===void 0||(n=t.main)===null||n===void 0?void 0:n.call(t))||Ji,v=((r=e.components)===null||r===void 0||(i=r.common)===null||i===void 0?void 0:i.call(r))||xn;return g.createElement(k,{onMouseOver:function(){l()},onMouseLeave:function(){c==null||c()},onWheel:function(E){E.stopPropagation()},"data-testid":"context-menu"},e.searchBar&&g.createElement(v,null,g.createElement(ju,{value:p,onChange:h,component:(o=e.components)===null||o===void 0||(a=o.search)===null||a===void 0?void 0:a.call(o)})),m.map(function(w){return g.createElement(Ui,{key:w.key,data:w,delay:e.delay,hide:e.onHide,components:e.components},w.label)}))}function Eu(e){var t=typeof(e==null?void 0:e.delay)>"u"?1e3:e.delay;return{render:function(r){if(r.data.type==="contextmenu")return g.createElement(_u,{items:r.data.items,delay:t,searchBar:r.data.searchBar,onHide:r.data.onHide,components:e==null?void 0:e.customize})}}}var Au=Object.freeze({__proto__:null,setup:Eu,Item:Yi,Subitems:Zi,Menu:Ji,Search:Xi,Common:xn}),nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ru=typeof nt=="object"&&nt&&nt.Object===Object&&nt,Iu=typeof self=="object"&&self&&self.Object===Object&&self;Ru||Iu||Function("return this")();function Nu(){const e=g.useRef(!1);return g.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),g.useCallback(()=>e.current,[])}var $r={width:void 0,height:void 0};function zu(e){const{ref:t,box:n="content-box"}=e,[{width:r,height:i},o]=g.useState($r),a=Nu(),s=g.useRef({...$r}),u=g.useRef(void 0);return u.current=e.onResize,g.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const c=new ResizeObserver(([l])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",d=jr(l,f,"inlineSize"),p=jr(l,f,"blockSize");if(s.current.width!==d||s.current.height!==p){const y={width:d,height:p};s.current.width=d,s.current.height=p,u.current?u.current(y):a()&&o(y)}});return c.observe(t.current,{box:n}),()=>{c.disconnect()}},[n,t,a]),{width:r,height:i}}function jr(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function fe(e){return"".concat(e,"px")}var _r,Mu=ne.div(_r||(_r=J([`
210
+ `])),sn,sn/2);function Tu(e){var t,n,r,i,o,a,s=Yi(e.onHide,e.delay),u=ie(s,2),c=u[0],l=u[1],f=g.useState(""),d=ie(f,2),p=d[0],h=d[1],y=new RegExp(p,"i"),m=e.items.filter(function(w){return w.label.match(y)}),k=((t=e.components)===null||t===void 0||(n=t.main)===null||n===void 0?void 0:n.call(t))||eo,v=((r=e.components)===null||r===void 0||(i=r.common)===null||i===void 0?void 0:i.call(r))||xn;return g.createElement(k,{onMouseOver:function(){l()},onMouseLeave:function(){c==null||c()},onWheel:function(E){E.stopPropagation()},"data-testid":"context-menu"},e.searchBar&&g.createElement(v,null,g.createElement(Du,{value:p,onChange:h,component:(o=e.components)===null||o===void 0||(a=o.search)===null||a===void 0?void 0:a.call(o)})),m.map(function(w){return g.createElement(Ji,{key:w.key,data:w,delay:e.delay,hide:e.onHide,components:e.components},w.label)}))}function Lu(e){var t=typeof(e==null?void 0:e.delay)>"u"?1e3:e.delay;return{render:function(r){if(r.data.type==="contextmenu")return g.createElement(Tu,{items:r.data.items,delay:t,searchBar:r.data.searchBar,onHide:r.data.onHide,components:e==null?void 0:e.customize})}}}var Bu=Object.freeze({__proto__:null,setup:Lu,Item:Xi,Subitems:Ui,Menu:eo,Search:Qi,Common:xn}),nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Hu=typeof nt=="object"&&nt&&nt.Object===Object&&nt,Fu=typeof self=="object"&&self&&self.Object===Object&&self;Hu||Fu||Function("return this")();function Gu(){const e=g.useRef(!1);return g.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),g.useCallback(()=>e.current,[])}var _r={width:void 0,height:void 0};function Vu(e){const{ref:t,box:n="content-box"}=e,[{width:r,height:i},o]=g.useState(_r),a=Gu(),s=g.useRef({..._r}),u=g.useRef(void 0);return u.current=e.onResize,g.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const c=new ResizeObserver(([l])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",d=jr(l,f,"inlineSize"),p=jr(l,f,"blockSize");if(s.current.width!==d||s.current.height!==p){const y={width:d,height:p};s.current.width=d,s.current.height=p,u.current?u.current(y):a()&&o(y)}});return c.observe(t.current,{box:n}),()=>{c.disconnect()}},[n,t,a]),{width:r,height:i}}function jr(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function de(e){return"".concat(e,"px")}var Er,Wu=re.div(Er||(Er=J([`
211
211
  position: absolute;
212
212
  background: rgba(110, 136, 255, 0.8);
213
213
  border: 1px solid rgb(192 206 212 / 60%);
214
- `])));function Du(e){return g.createElement(Mu,{style:{left:fe(e.left),top:fe(e.top),width:fe(e.width),height:fe(e.height)},"data-testid":"minimap-node"})}var Er,Tu=ne.div(Er||(Er=J([`
214
+ `])));function qu(e){return g.createElement(Wu,{style:{left:de(e.left),top:de(e.top),width:de(e.width),height:de(e.height)},"data-testid":"minimap-node"})}var Ar,Zu=re.div(Ar||(Ar=J([`
215
215
  position: absolute;
216
216
  background: rgba(255, 251, 128, 0.32);
217
217
  border: 1px solid #ffe52b;
218
- `])));function Lu(e){var t=function(o){return o*e.containerWidth},n=function(o){return o/e.containerWidth},r=Ti(function(i,o){e.translate(n(-i),n(-o))},function(i){return{x:i.pageX,y:i.pageY}});return g.createElement(Tu,{onPointerDown:r.start,style:{left:fe(t(e.left)),top:fe(t(e.top)),width:fe(t(e.width)),height:fe(t(e.height))},"data-testid":"minimap-viewport"})}var Ar,Bu=ne.div(Ar||(Ar=J([`
218
+ `])));function Ku(e){var t=function(o){return o*e.containerWidth},n=function(o){return o/e.containerWidth},r=Bi(function(i,o){e.translate(n(-i),n(-o))},function(i){return{x:i.pageX,y:i.pageY}});return g.createElement(Zu,{onPointerDown:r.start,style:{left:de(t(e.left)),top:de(t(e.top)),width:de(t(e.width)),height:de(t(e.height))},"data-testid":"minimap-viewport"})}var Ir,Yu=re.div(Ir||(Ir=J([`
219
219
  position: absolute;
220
220
  right: 24px;
221
221
  bottom: 24px;
@@ -225,19 +225,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
225
225
  border: 1px solid #b1b7ff;
226
226
  border-radius: 8px;
227
227
  box-sizing: border-box;
228
- `])));function Fu(e){var t,n=g.useRef(null),r=zu({ref:n}),i=r.width,o=i===void 0?0:i,a=((t=n.current)===null||t===void 0?void 0:t.clientWidth)||o,s=g.useCallback(function(u){return u*a},[a]);return g.createElement(Bu,{size:e.size,style:{width:fe(e.size*e.ratio),height:fe(e.size)},onPointerDown:function(c){c.stopPropagation(),c.preventDefault()},onDoubleClick:function(c){if(c.stopPropagation(),c.preventDefault(),!!n.current){var l=n.current.getBoundingClientRect(),f=(c.clientX-l.left)/(e.size*e.ratio),d=(c.clientY-l.top)/(e.size*e.ratio);e.point(f,d)}},ref:n,"data-testid":"minimap"},a?e.nodes.map(function(u,c){return g.createElement(Du,{key:c,left:s(u.left),top:s(u.top),width:s(u.width),height:s(u.height)})}):null,g.createElement(Lu,Ce({},e.viewport,{start:e.start,containerWidth:a,translate:e.translate})))}function Hu(e){return{render:function(n){if(n.data.type==="minimap")return g.createElement(Fu,{nodes:n.data.nodes,size:(e==null?void 0:e.size)||200,ratio:n.data.ratio,viewport:n.data.viewport,start:n.data.start,translate:n.data.translate,point:n.data.point})}}}var Gu=Object.freeze({__proto__:null,setup:Hu}),Rr,We=20,Vu=ne.div(Rr||(Rr=J([`
228
+ `])));function Xu(e){var t,n=g.useRef(null),r=Vu({ref:n}),i=r.width,o=i===void 0?0:i,a=((t=n.current)===null||t===void 0?void 0:t.clientWidth)||o,s=g.useCallback(function(u){return u*a},[a]);return g.createElement(Yu,{size:e.size,style:{width:de(e.size*e.ratio),height:de(e.size)},onPointerDown:function(c){c.stopPropagation(),c.preventDefault()},onDoubleClick:function(c){if(c.stopPropagation(),c.preventDefault(),!!n.current){var l=n.current.getBoundingClientRect(),f=(c.clientX-l.left)/(e.size*e.ratio),d=(c.clientY-l.top)/(e.size*e.ratio);e.point(f,d)}},ref:n,"data-testid":"minimap"},a?e.nodes.map(function(u,c){return g.createElement(qu,{key:c,left:s(u.left),top:s(u.top),width:s(u.width),height:s(u.height)})}):null,g.createElement(Ku,Ce({},e.viewport,{start:e.start,containerWidth:a,translate:e.translate})))}function Uu(e){return{render:function(n){if(n.data.type==="minimap")return g.createElement(Xu,{nodes:n.data.nodes,size:(e==null?void 0:e.size)||200,ratio:n.data.ratio,viewport:n.data.viewport,start:n.data.start,translate:n.data.translate,point:n.data.point})}}}var Ju=Object.freeze({__proto__:null,setup:Uu}),Nr,We=20,Qu=re.div(Nr||(Nr=J([`
229
229
  width: `,`px;
230
230
  height: `,`px;
231
231
  box-sizing: border-box;
232
232
  background: `,`;
233
233
  border: 2px solid white;
234
234
  border-radius: `,`px;
235
- `])),We,We,function(e){return e.selected?"#ffd92c":"steelblue"},We);function Wu(e){var t=Ti(function(o,a){e.translate(o,a)},e.pointer),n=e.position,r=n.x,i=n.y;return g.createElement(Vu,{onPointerDown:function(a){a.stopPropagation(),a.preventDefault(),t.start(a),e.pointerdown()},onContextMenu:function(a){a.stopPropagation(),a.preventDefault(),e.contextMenu()},selected:e.selected,style:{position:"absolute",top:"".concat(i-We/2,"px"),left:"".concat(r-We/2,"px")},"data-testid":"pin"})}function qu(e){function t(n,r){return g.createElement(g.Fragment,null,n.pins.map(function(i){return g.createElement(Wu,Ce({},i,{key:i.id,contextMenu:function(){var a;e==null||(a=e.contextMenu)===null||a===void 0||a.call(e,i.id)},translate:function(a,s){var u;e==null||(u=e.translate)===null||u===void 0||u.call(e,i.id,a,s)},pointerdown:function(){var a;e==null||(a=e.pointerdown)===null||a===void 0||a.call(e,i.id)},pointer:r}))}))}return{render:function(r,i){var o=r.data,a=i.parentScope(ft);if(o.type==="reroute-pins")return t(o.data,function(){return a.area.pointer})}}}var Ku=Object.freeze({__proto__:null,setup:qu}),ct=Object.freeze({__proto__:null,classic:Su,contextMenu:Au,minimap:Gu,reroute:Ku});function Yu(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Zu(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
236
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Zu(e,t){if(e){if(typeof e=="string")return Ir(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ir(e,t):void 0}}function Ir(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nr(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uu(e,t,n){return t=W(t),me(e,Qi()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function Qi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qi=function(){return!!e})()}function Xu(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var Ju=(function(e){function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0];return B(this,t),n=Uu(this,t,["react-render"]),$(n,"presets",[]),n.renderer=ou({createRoot:a==null?void 0:a.createRoot}),n.addPipe(function(s){if(!s||ie(s)!=="object"||!("type"in s))return s;if(s.type==="unmount")n.unmount(s.data.element);else if(s.type==="render"){if("filled"in s.data&&s.data.filled)return s;if(n.mount(s.data.element,s))return rt(rt({},s),{},{data:rt(rt({},s.data),{},{filled:!0})})}return s}),n}return oe(t,e),F(t,[{key:"setParent",value:function(r){var i=this;Xu(t,"setParent",this)([r]),this.presets.forEach(function(o){o.attach&&o.attach(i)})}},{key:"mount",value:function(r,i){var o=this.parentScope(),a=Yu(this.presets),s;try{for(a.s();!(s=a.n()).done;){var u=s.value,c=u.render(i,this);if(c){var l=g.createElement(au,{rendered:function(){o.emit({type:"rendered",data:i.data})}},c);return this.renderer.mount(l,r),!0}}}catch(f){a.e(f)}finally{a.f()}}},{key:"unmount",value:function(r){this.renderer.unmount(r)}},{key:"addPreset",value:function(r){var i=r;i.attach&&i.attach(this),this.presets.push(i)}}])})(Ze);const zr=3,un=1e-4,Qu=1;function Mr(e){return{min:Number.isFinite(e)&&e>0?Math.min(e,zr):Qu,max:zr}}function ec(e,t,n){if(!Number.isFinite(e)||e<=0)return null;const r=e*(1+t),i=Math.min(Math.max(r,n.min),n.max);return!Number.isFinite(i)||Math.abs(i-e)<un?null:{zoom:i,delta:i/e-1}}function tc(e,t,n={}){const r=n.allowBelowMin?0:t.min-un;return e>=r&&e<=t.max+un}const Dr=new Ae.Socket("rel"),eo=240,nc=48,rc=74,ic=280,Ht=24,cn="#9ca3af",_e="#3b82f6",He="#f97316",Tr=.85;class oc extends Ae.Node{constructor(n,r,i,o,a){super(n);X(this,"width",eo);X(this,"height",nc);X(this,"isSource");X(this,"dmId");X(this,"depth");X(this,"targetAlias");X(this,"fieldCount");X(this,"description");X(this,"onOpenExternal");X(this,"isDraft");X(this,"isBlocked");X(this,"isJoinNotConfigured");X(this,"isCycleStub");X(this,"userHasAccess");X(this,"highlighted",!1);X(this,"dimmed",!1);this.dmId=r,this.isSource=i,this.depth=o,this.targetAlias=a.targetAlias,this.fieldCount=a.fieldCount,this.description=a.description,this.onOpenExternal=a.onOpenExternal,this.isDraft=a.isDraft??!1,this.isBlocked=a.isBlocked??!1,this.isJoinNotConfigured=a.isJoinNotConfigured??!1,this.isCycleStub=a.isCycleStub??!1,this.userHasAccess=a.userHasAccess,i||(this.height=rc)}}const{RefSocket:Gt}=ct.classic;function ac(e){const t=e.data;function n(s){var u;s.stopPropagation(),s.preventDefault(),(u=t.onOpenExternal)==null||u.call(t)}const r=Object.entries(t.outputs),i=Object.entries(t.inputs);if(t.isSource)return z.jsxs("div",{className:"text-primary flex items-center",style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?_e:t.isDraft?He:cn}`,boxShadow:t.highlighted?`0 0 0 3px ${_e}40, 0 0 12px ${_e}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",background:"#eff6ff",fontSize:13,fontWeight:600,position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[t.isDraft&&z.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:He,lineHeight:1},children:"Draft"}),z.jsx("div",{className:"truncate",style:{flex:1,padding:"0 14px"},title:t.label,children:t.label}),r.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5},children:z.jsx(Gt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]});const o=ao(t)?He:cn,a=so(t);return z.jsxs("div",{title:t.isCycleStub?uo:void 0,style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?_e:o}`,background:"var(--background)",boxShadow:t.highlighted?`0 0 0 3px ${_e}40, 0 0 12px ${_e}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",cursor:"default",position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[a&&z.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:He,lineHeight:1,whiteSpace:"nowrap"},children:a}),i.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",left:-5,top:"50%",marginTop:-5,zIndex:1},children:z.jsx(Gt,{name:"input-socket",side:"input",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s)),z.jsxs("div",{className:"bg-muted flex items-center justify-between",style:{padding:"8px 10px 8px 14px",fontSize:13,fontWeight:600,borderRadius:"6px 6px 0 0"},children:[z.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[z.jsx("span",{className:"truncate",title:t.label,children:t.label}),!t.userHasAccess&&z.jsx(co,{})]}),z.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-0.5",children:[t.description&&z.jsx("span",{className:"text-muted-foreground hover:text-foreground inline-flex cursor-default rounded p-0.5 transition-colors",title:t.description,children:z.jsx(lo,{style:{width:14,height:14}})}),z.jsx("button",{className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-0.5 transition-colors",onPointerDown:s=>{s.stopPropagation()},onClick:n,title:"Open in new tab","aria-label":"Open in new tab",children:z.jsx(fo,{style:{width:14,height:14}})})]})]}),z.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",style:{padding:"6px 14px 8px",fontSize:11,minWidth:0},children:[t.targetAlias&&z.jsx(po,{variant:"secondary",className:"inline-block max-w-[120px] truncate px-1.5 py-0 text-[10px]",title:t.targetAlias,children:t.targetAlias}),z.jsxs("span",{className:"ml-auto shrink-0",children:[t.fieldCount??0," field",t.fieldCount!==1?"s":""]})]}),r.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5,zIndex:1},children:z.jsx(Gt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]})}function sc(){return z.jsx("div",{style:{width:10,height:10,borderRadius:"50%",background:cn,border:"2px solid var(--background)"}})}async function uc(e,t,n,r,i,o,a,s,u){const c=new Pe,l=new ti(e),f=new Ra,d=new Ju({createRoot:oo.createRoot}),p=new Da,{useConnection:h}=ct.classic;function y(b){const{path:x}=h();if(!x)return null;const O=c.getNode(b.data.source),C=c.getNode(b.data.target),M=(O==null?void 0:O.isDraft)===!0||(O==null?void 0:O.isBlocked)===!0||(O==null?void 0:O.isJoinNotConfigured)===!0||(O==null?void 0:O.isCycleStub)===!0||(C==null?void 0:C.isDraft)===!0||(C==null?void 0:C.isBlocked)===!0||(C==null?void 0:C.isJoinNotConfigured)===!0||(C==null?void 0:C.isCycleStub)===!0,U=((O==null?void 0:O.dimmed)===!0||O===void 0)&&((C==null?void 0:C.dimmed)===!0||C===void 0);return z.jsx("svg",{"data-testid":"connection",style:{overflow:"visible",position:"absolute",pointerEvents:"none",width:9999,height:9999},children:z.jsx("path",{d:x,fill:"none",strokeWidth:"5px",stroke:M?He:"steelblue",strokeDasharray:M?"8 4":void 0,opacity:U?.15:1,style:{pointerEvents:"auto",transition:"opacity 0.2s"}})})}d.addPreset(ct.classic.setup({customize:{node(){return ac},socket(){return sc},connection(){return y}}})),d.addPreset(ct.minimap.setup()),f.addPreset($a.classic.setup()),c.use(l),l.use(f),l.use(d),l.use(p);const m=new Map,k=[],v=new Set,w=i==="DRAFT";m.set(t,{id:t,dmId:t,title:n,description:r,depth:0,isSource:!0,isDraft:w,userHasAccess:!0});let E=0;const j=new Map;j.set("",t);function R(b,x,O,C){const M=`${x}-${E++}`;return k.push({sourceId:b,targetId:M}),v.add(b),m.set(M,{id:M,dmId:x,...O}),j.set(C,M),M}if(a)for(const b of a.nodes){const x=b.aliasPath.lastIndexOf("."),O=x===-1?"":b.aliasPath.slice(0,x),C=j.get(O);C&&R(C,b.relationship.targetDataMart.id,{title:b.relationship.targetDataMart.title,description:b.relationship.targetDataMart.description,depth:b.depth,isSource:!1,targetAlias:b.relationship.targetAlias,fieldCount:(s==null?void 0:s.get(b.relationship.id))??0,isDraft:b.relationship.targetDataMart.status==="DRAFT",isBlocked:b.isBlocked,isJoinNotConfigured:b.relationship.joinConditions.length===0,isCycleStub:b.isCycleStub,userHasAccess:b.relationship.targetDataMart.userHasAccess},b.aliasPath)}else for(const b of o)R(t,b.targetDataMart.id,{title:b.targetDataMart.title,description:b.targetDataMart.description,depth:1,isSource:!1,targetAlias:b.targetAlias,fieldCount:(s==null?void 0:s.get(b.id))??0,isDraft:b.targetDataMart.status==="DRAFT",isBlocked:w,isJoinNotConfigured:b.joinConditions.length===0,isCycleStub:b.targetDataMart.id===t,userHasAccess:b.targetDataMart.userHasAccess},b.targetAlias);const P=new Map,_=new Map;for(const[b,x]of m){const O=new oc(x.title,x.dmId,x.isSource,x.depth,{targetAlias:x.targetAlias,fieldCount:x.fieldCount,description:x.description,isDraft:x.isDraft,isBlocked:x.isBlocked,isJoinNotConfigured:x.isJoinNotConfigured,isCycleStub:x.isCycleStub,userHasAccess:x.userHasAccess,onOpenExternal:()=>{u(x.dmId)}});v.has(b)&&!x.isCycleStub&&O.addOutput("out",new Ae.Output(Dr)),x.isSource||O.addInput("in",new Ae.Input(Dr)),await c.addNode(O),P.set(b,O);const C=_.get(x.depth)??[];_.has(x.depth)||_.set(x.depth,C),C.push(O)}for(const b of k){const x=P.get(b.sourceId),O=P.get(b.targetId);x&&O&&await c.addConnection(new Ae.Connection(x,"out",O,"in"))}const A=Math.max(...Array.from(_.keys()));for(let b=0;b<=A;b++){const x=_.get(b)??[];let O=0;for(const C of x)await l.translate(C.id,{x:b*(eo+ic),y:O}),O+=C.height+Ht;if(b===0&&x.length===1){const M=(_.get(1)??[]).reduce((U,ee)=>U+ee.height+Ht,-Ht);await l.translate(x[0].id,{x:0,y:Math.max(0,M/2-x[0].height/2)})}}const I=16,D=()=>{const{x:b,y:x,k:O}=l.area.transform,C=I*O;e.style.backgroundSize=`${C}px ${C}px`,e.style.backgroundPosition=`${b}px ${x}px`};let V=Mr(l.area.transform.k);const L=()=>{V=Mr(l.area.transform.k)};let K=!1;const Y=async()=>{K=!0;try{await Qe.zoomAt(l,c.getNodes(),{scale:Tr})}finally{K=!1}L(),D()};await Y();const se=async b=>{const x=e.clientWidth/2,O=e.clientHeight/2,{k:C}=l.area.transform,M=ec(C,b,V);M&&(await l.area.zoom(M.zoom,-x*M.delta,-O*M.delta),D())};return Qe.restrictor(l,{translation:()=>{const{k:b}=l.area.transform,x=Qe.getBoundingBox(l,c.getNodes()),O=e.getBoundingClientRect(),C=150;return{left:C-x.right*b,right:O.width-C-x.left*b,top:C-x.bottom*b,bottom:O.height-C-x.top*b}}}),l.addPipe(b=>{if(b.type==="zoom"){if(b.data.source==="dblclick")return;const x=b.data.zoom;if(!tc(x,V,{allowBelowMin:K}))return}if(b.type!=="nodetranslate")return(b.type==="translated"||b.type==="zoomed")&&D(),b}),{destroy:()=>{l.destroy()},fitView:Y,zoomBy:se,highlightNodes:b=>{const x=b.toLowerCase(),O=[];for(const C of c.getNodes()){const M={h:C.highlighted,d:C.dimmed};C.highlighted=x!==""&&C.label.toLowerCase().includes(x),C.dimmed=x!==""&&!C.highlighted,C.highlighted&&O.push(C),(M.h!==C.highlighted||M.d!==C.dimmed)&&l.update("node",C.id)}for(const C of c.getConnections())l.update("connection",C.id);O.length>0&&Qe.zoomAt(l,O,{scale:Tr})}}}function dc({dataMartId:e,dataMartTitle:t,dataMartDescription:n,dataMartStatus:r,relationships:i,relationshipGraph:o,connectedFieldCounts:a,searchQuery:s,onRequestFullscreen:u,className:c,style:l}){const f=g.useRef(null),d=g.useRef(null),p=g.useRef(s);p.current=s;const h=g.useCallback(y=>{const m=window.location.pathname.replace(/\/data-marts\/.*/,"");window.open(`${m}/data-marts/${y}/data-setup`,"_blank")},[]);return g.useEffect(()=>{const y=f.current;if(!y||i.length===0)return;let m=!1;return uc(y,e,t,n,r,i,o,a,h).then(k=>{if(m){k.destroy();return}d.current=k,p.current&&k.highlightNodes(p.current)}),()=>{var k;m=!0,(k=d.current)==null||k.destroy(),d.current=null,y.replaceChildren()}},[e,t,n,r,i,o,a,h]),g.useEffect(()=>{var y;(y=d.current)==null||y.highlightNodes(s)},[s]),i.length===0?null:z.jsxs("div",{className:`rel-canvas relative overflow-hidden rounded-lg border ${c??""}`,style:l??{height:480},children:[z.jsx("style",{children:`
235
+ `])),We,We,function(e){return e.selected?"#ffd92c":"steelblue"},We);function ec(e){var t=Bi(function(o,a){e.translate(o,a)},e.pointer),n=e.position,r=n.x,i=n.y;return g.createElement(Qu,{onPointerDown:function(a){a.stopPropagation(),a.preventDefault(),t.start(a),e.pointerdown()},onContextMenu:function(a){a.stopPropagation(),a.preventDefault(),e.contextMenu()},selected:e.selected,style:{position:"absolute",top:"".concat(i-We/2,"px"),left:"".concat(r-We/2,"px")},"data-testid":"pin"})}function tc(e){function t(n,r){return g.createElement(g.Fragment,null,n.pins.map(function(i){return g.createElement(ec,Ce({},i,{key:i.id,contextMenu:function(){var a;e==null||(a=e.contextMenu)===null||a===void 0||a.call(e,i.id)},translate:function(a,s){var u;e==null||(u=e.translate)===null||u===void 0||u.call(e,i.id,a,s)},pointerdown:function(){var a;e==null||(a=e.pointerdown)===null||a===void 0||a.call(e,i.id)},pointer:r}))}))}return{render:function(r,i){var o=r.data,a=i.parentScope(ft);if(o.type==="reroute-pins")return t(o.data,function(){return a.area.pointer})}}}var nc=Object.freeze({__proto__:null,setup:tc}),ct=Object.freeze({__proto__:null,classic:Nu,contextMenu:Bu,minimap:Ju,reroute:nc});function rc(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ic(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
236
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function ic(e,t){if(e){if(typeof e=="string")return Rr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rr(e,t):void 0}}function Rr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oc(e,t,n){return t=W(t),me(e,to()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function to(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(to=function(){return!!e})()}function ac(e,t,n,r){var i=qe(W(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var sc=(function(e){function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0];return B(this,t),n=oc(this,t,["react-render"]),$(n,"presets",[]),n.renderer=hu({createRoot:a==null?void 0:a.createRoot}),n.addPipe(function(s){if(!s||ne(s)!=="object"||!("type"in s))return s;if(s.type==="unmount")n.unmount(s.data.element);else if(s.type==="render"){if("filled"in s.data&&s.data.filled)return s;if(n.mount(s.data.element,s))return rt(rt({},s),{},{data:rt(rt({},s.data),{},{filled:!0})})}return s}),n}return oe(t,e),H(t,[{key:"setParent",value:function(r){var i=this;ac(t,"setParent",this)([r]),this.presets.forEach(function(o){o.attach&&o.attach(i)})}},{key:"mount",value:function(r,i){var o=this.parentScope(),a=rc(this.presets),s;try{for(a.s();!(s=a.n()).done;){var u=s.value,c=u.render(i,this);if(c){var l=g.createElement(vu,{rendered:function(){o.emit({type:"rendered",data:i.data})}},c);return this.renderer.mount(l,r),!0}}}catch(f){a.e(f)}finally{a.f()}}},{key:"unmount",value:function(r){this.renderer.unmount(r)}},{key:"addPreset",value:function(r){var i=r;i.attach&&i.attach(this),this.presets.push(i)}}])})(Ye);const Mr=3,un=1e-4,uc=1;function Dr(e){return{min:Number.isFinite(e)&&e>0?Math.min(e,Mr):uc,max:Mr}}function cc(e,t,n){if(!Number.isFinite(e)||e<=0)return null;const r=e*(1+t),i=Math.min(Math.max(r,n.min),n.max);return!Number.isFinite(i)||Math.abs(i-e)<un?null:{zoom:i,delta:i/e-1}}function lc(e,t,n={}){const r=n.allowBelowMin?0:t.min-un;return e>=r&&e<=t.max+un}const Tr=new Ae.Socket("rel"),no=240,dc=48,fc=74,pc=280,Ft=24,cn="#9ca3af",je="#3b82f6",Fe="#f97316",Lr=.85;class hc extends Ae.Node{constructor(n,r,i,o,a){super(n);U(this,"width",no);U(this,"height",dc);U(this,"isSource");U(this,"dmId");U(this,"depth");U(this,"targetAlias");U(this,"fieldCount");U(this,"description");U(this,"onOpenExternal");U(this,"isDraft");U(this,"isBlocked");U(this,"isJoinNotConfigured");U(this,"isCycleStub");U(this,"userHasAccess");U(this,"highlighted",!1);U(this,"dimmed",!1);this.dmId=r,this.isSource=i,this.depth=o,this.targetAlias=a.targetAlias,this.fieldCount=a.fieldCount,this.description=a.description,this.onOpenExternal=a.onOpenExternal,this.isDraft=a.isDraft??!1,this.isBlocked=a.isBlocked??!1,this.isJoinNotConfigured=a.isJoinNotConfigured??!1,this.isCycleStub=a.isCycleStub??!1,this.userHasAccess=a.userHasAccess,i||(this.height=fc)}}const{RefSocket:Gt}=ct.classic;function vc(e){const t=e.data;function n(s){var u;s.stopPropagation(),s.preventDefault(),(u=t.onOpenExternal)==null||u.call(t)}const r=Object.entries(t.outputs),i=Object.entries(t.inputs);if(t.isSource)return z.jsxs("div",{className:"text-primary flex items-center",style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?je:t.isDraft?Fe:cn}`,boxShadow:t.highlighted?`0 0 0 3px ${je}40, 0 0 12px ${je}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",background:"#eff6ff",fontSize:13,fontWeight:600,position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[t.isDraft&&z.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:Fe,lineHeight:1},children:"Draft"}),z.jsx("div",{className:"truncate",style:{flex:1,padding:"0 14px"},title:t.label,children:t.label}),r.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5},children:z.jsx(Gt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]});const o=uo(t)?Fe:cn,a=co(t);return z.jsxs("div",{title:t.isCycleStub?lo:void 0,style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?je:o}`,background:"var(--background)",boxShadow:t.highlighted?`0 0 0 3px ${je}40, 0 0 12px ${je}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",cursor:"default",position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[a&&z.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:Fe,lineHeight:1,whiteSpace:"nowrap"},children:a}),i.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",left:-5,top:"50%",marginTop:-5,zIndex:1},children:z.jsx(Gt,{name:"input-socket",side:"input",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s)),z.jsxs("div",{className:"bg-muted flex items-center justify-between",style:{padding:"8px 10px 8px 14px",fontSize:13,fontWeight:600,borderRadius:"6px 6px 0 0"},children:[z.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[z.jsx("span",{className:"truncate",title:t.label,children:t.label}),!t.userHasAccess&&z.jsx(fo,{})]}),z.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-0.5",children:[t.description&&z.jsx("span",{className:"text-muted-foreground hover:text-foreground inline-flex cursor-default rounded p-0.5 transition-colors",title:t.description,children:z.jsx(po,{style:{width:14,height:14}})}),z.jsx("button",{className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-0.5 transition-colors",onPointerDown:s=>{s.stopPropagation()},onClick:n,title:"Open in new tab","aria-label":"Open in new tab",children:z.jsx(ho,{style:{width:14,height:14}})})]})]}),z.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",style:{padding:"6px 14px 8px",fontSize:11,minWidth:0},children:[t.targetAlias&&z.jsx(vo,{variant:"secondary",className:"inline-block max-w-[120px] truncate px-1.5 py-0 text-[10px]",title:t.targetAlias,children:t.targetAlias}),z.jsxs("span",{className:"ml-auto shrink-0",children:[t.fieldCount??0," field",t.fieldCount!==1?"s":""]})]}),r.map(([s,u])=>u&&z.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5,zIndex:1},children:z.jsx(Gt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]})}function mc(){return z.jsx("div",{style:{width:10,height:10,borderRadius:"50%",background:cn,border:"2px solid var(--background)"}})}async function yc(e,t,n,r,i,o,a,s,u){const c=new Pe,l=new ri(e),f=new Ha,d=new sc({createRoot:so.createRoot}),p=new qa,{useConnection:h}=ct.classic;function y(b){const{path:x}=h();if(!x)return null;const S=c.getNode(b.data.source),C=c.getNode(b.data.target),M=(S==null?void 0:S.isDraft)===!0||(S==null?void 0:S.isBlocked)===!0||(S==null?void 0:S.isJoinNotConfigured)===!0||(S==null?void 0:S.isCycleStub)===!0||(C==null?void 0:C.isDraft)===!0||(C==null?void 0:C.isBlocked)===!0||(C==null?void 0:C.isJoinNotConfigured)===!0||(C==null?void 0:C.isCycleStub)===!0,X=((S==null?void 0:S.dimmed)===!0||S===void 0)&&((C==null?void 0:C.dimmed)===!0||C===void 0);return z.jsx("svg",{"data-testid":"connection",style:{overflow:"visible",position:"absolute",pointerEvents:"none",width:9999,height:9999},children:z.jsx("path",{d:x,fill:"none",strokeWidth:"5px",stroke:M?Fe:"steelblue",strokeDasharray:M?"8 4":void 0,opacity:X?.15:1,style:{pointerEvents:"auto",transition:"opacity 0.2s"}})})}d.addPreset(ct.classic.setup({customize:{node(){return vc},socket(){return mc},connection(){return y}}})),d.addPreset(ct.minimap.setup()),f.addPreset(Ma.classic.setup()),c.use(l),l.use(f),l.use(d),l.use(p);const m=new Map,k=[],v=new Set,w=i==="DRAFT";m.set(t,{id:t,dmId:t,title:n,description:r,depth:0,isSource:!0,isDraft:w,userHasAccess:!0});let E=0;const _=new Map;_.set("",t);function I(b,x,S,C){const M=`${x}-${E++}`;return k.push({sourceId:b,targetId:M}),v.add(b),m.set(M,{id:M,dmId:x,...S}),_.set(C,M),M}if(a)for(const b of a.nodes){const x=b.aliasPath.lastIndexOf("."),S=x===-1?"":b.aliasPath.slice(0,x),C=_.get(S);C&&I(C,b.relationship.targetDataMart.id,{title:b.relationship.targetDataMart.title,description:b.relationship.targetDataMart.description,depth:b.depth,isSource:!1,targetAlias:b.relationship.targetAlias,fieldCount:(s==null?void 0:s.get(b.relationship.id))??0,isDraft:b.relationship.targetDataMart.status==="DRAFT",isBlocked:b.isBlocked,isJoinNotConfigured:b.relationship.joinConditions.length===0,isCycleStub:b.isCycleStub,userHasAccess:b.relationship.targetDataMart.userHasAccess},b.aliasPath)}else for(const b of o)I(t,b.targetDataMart.id,{title:b.targetDataMart.title,description:b.targetDataMart.description,depth:1,isSource:!1,targetAlias:b.targetAlias,fieldCount:(s==null?void 0:s.get(b.id))??0,isDraft:b.targetDataMart.status==="DRAFT",isBlocked:w,isJoinNotConfigured:b.joinConditions.length===0,isCycleStub:b.targetDataMart.id===t,userHasAccess:b.targetDataMart.userHasAccess},b.targetAlias);const P=new Map,j=new Map;for(const[b,x]of m){const S=new hc(x.title,x.dmId,x.isSource,x.depth,{targetAlias:x.targetAlias,fieldCount:x.fieldCount,description:x.description,isDraft:x.isDraft,isBlocked:x.isBlocked,isJoinNotConfigured:x.isJoinNotConfigured,isCycleStub:x.isCycleStub,userHasAccess:x.userHasAccess,onOpenExternal:()=>{u(x.dmId)}});v.has(b)&&!x.isCycleStub&&S.addOutput("out",new Ae.Output(Tr)),x.isSource||S.addInput("in",new Ae.Input(Tr)),await c.addNode(S),P.set(b,S);const C=j.get(x.depth)??[];j.has(x.depth)||j.set(x.depth,C),C.push(S)}for(const b of k){const x=P.get(b.sourceId),S=P.get(b.targetId);x&&S&&await c.addConnection(new Ae.Connection(x,"out",S,"in"))}const A=Math.max(...Array.from(j.keys()));for(let b=0;b<=A;b++){const x=j.get(b)??[];let S=0;for(const C of x)await l.translate(C.id,{x:b*(no+pc),y:S}),S+=C.height+Ft;if(b===0&&x.length===1){const M=(j.get(1)??[]).reduce((X,ee)=>X+ee.height+Ft,-Ft);await l.translate(x[0].id,{x:0,y:Math.max(0,M/2-x[0].height/2)})}}const N=16,D=()=>{const{x:b,y:x,k:S}=l.area.transform,C=N*S;e.style.backgroundSize=`${C}px ${C}px`,e.style.backgroundPosition=`${b}px ${x}px`};let V=Dr(l.area.transform.k);const L=()=>{V=Dr(l.area.transform.k)};let Z=!1;const K=async()=>{Z=!0;try{await Qe.zoomAt(l,c.getNodes(),{scale:Lr})}finally{Z=!1}L(),D()};await K();const se=async b=>{const x=e.clientWidth/2,S=e.clientHeight/2,{k:C}=l.area.transform,M=cc(C,b,V);M&&(await l.area.zoom(M.zoom,-x*M.delta,-S*M.delta),D())};return Qe.restrictor(l,{translation:()=>{const{k:b}=l.area.transform,x=Qe.getBoundingBox(l,c.getNodes()),S=e.getBoundingClientRect(),C=150;return{left:C-x.right*b,right:S.width-C-x.left*b,top:C-x.bottom*b,bottom:S.height-C-x.top*b}}}),l.addPipe(b=>{if(b.type==="zoom"){if(b.data.source==="dblclick")return;const x=b.data.zoom;if(!lc(x,V,{allowBelowMin:Z}))return}if(b.type!=="nodetranslate")return(b.type==="translated"||b.type==="zoomed")&&D(),b}),{destroy:()=>{l.destroy()},fitView:K,zoomBy:se,highlightNodes:b=>{const x=b.toLowerCase(),S=[];for(const C of c.getNodes()){const M={h:C.highlighted,d:C.dimmed};C.highlighted=x!==""&&C.label.toLowerCase().includes(x),C.dimmed=x!==""&&!C.highlighted,C.highlighted&&S.push(C),(M.h!==C.highlighted||M.d!==C.dimmed)&&l.update("node",C.id)}for(const C of c.getConnections())l.update("connection",C.id);S.length>0&&Qe.zoomAt(l,S,{scale:Lr})}}}function wc({dataMartId:e,dataMartTitle:t,dataMartDescription:n,dataMartStatus:r,relationships:i,relationshipGraph:o,connectedFieldCounts:a,searchQuery:s,onRequestFullscreen:u,className:c,style:l}){const f=g.useRef(null),d=g.useRef(null),p=g.useRef(s);p.current=s;const h=g.useCallback(y=>{const m=window.location.pathname.replace(/\/data-marts\/.*/,"");window.open(`${m}/data-marts/${y}/data-setup`,"_blank")},[]);return g.useEffect(()=>{const y=f.current;if(!y||i.length===0)return;let m=!1;return yc(y,e,t,n,r,i,o,a,h).then(k=>{if(m){k.destroy();return}d.current=k,p.current&&k.highlightNodes(p.current)}),()=>{var k;m=!0,(k=d.current)==null||k.destroy(),d.current=null,y.replaceChildren()}},[e,t,n,r,i,o,a,h]),g.useEffect(()=>{var y;(y=d.current)==null||y.highlightNodes(s)},[s]),i.length===0?null:z.jsxs("div",{className:`rel-canvas relative overflow-hidden rounded-lg border ${c??""}`,style:l??{height:480},children:[z.jsx("style",{children:`
237
237
  .rel-canvas svg path { stroke-width: 1.5px !important; }
238
238
  .rel-canvas [data-testid="minimap"] { transform: scale(0.5); transform-origin: bottom right; }
239
239
  @keyframes node-pulse {
240
240
  0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 0 12px rgba(59, 130, 246, 0.4); }
241
241
  50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.5); }
242
242
  }
243
- `}),z.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-start gap-2",children:z.jsxs("div",{className:"flex flex-col gap-1.5",children:[z.jsx(Xe,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.fitView()},"aria-label":"Fit to view",children:z.jsx(vo,{className:"h-6 w-6"})}),z.jsx(Xe,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.zoomBy(.25)},"aria-label":"Zoom in",children:z.jsx(yo,{className:"h-6 w-6"})}),z.jsx(Xe,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.zoomBy(-.25)},"aria-label":"Zoom out",children:z.jsx(bo,{className:"h-6 w-6"})}),u&&z.jsx(Xe,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:u,"aria-label":"Expand diagram",children:z.jsx(io,{className:"h-6 w-6"})})]})}),z.jsx("div",{ref:f,style:{width:"100%",height:"100%",backgroundImage:"linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px)",backgroundSize:"16px 16px"}})]})}export{dc as RelationshipCanvas};
243
+ `}),z.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-start gap-2",children:z.jsxs("div",{className:"flex flex-col gap-1.5",children:[z.jsx(Ue,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.fitView()},"aria-label":"Fit to view",children:z.jsx(yo,{className:"h-6 w-6"})}),z.jsx(Ue,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.zoomBy(.25)},"aria-label":"Zoom in",children:z.jsx(bo,{className:"h-6 w-6"})}),z.jsx(Ue,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var y;(y=d.current)==null||y.zoomBy(-.25)},"aria-label":"Zoom out",children:z.jsx(ko,{className:"h-6 w-6"})}),u&&z.jsx(Ue,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:u,"aria-label":"Expand diagram",children:z.jsx(ao,{className:"h-6 w-6"})})]})}),z.jsx("div",{ref:f,style:{width:"100%",height:"100%",backgroundImage:"linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px)",backgroundSize:"16px 16px"}})]})}export{wc as RelationshipCanvas};