var Kc=Object.defineProperty;var Zc=(e,t,n)=>t in e?Kc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>Zc(e,typeof t!="symbol"?t+"":t,n);function Qc(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var pv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bi={exports:{}},En={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ho;function Jc(){if(Ho)return En;Ho=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var l in i)l!=="key"&&(o[l]=i[l])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:s,ref:i!==void 0?i:null,props:o}}return En.Fragment=t,En.jsx=n,En.jsxs=n,En}var Vo;function eu(){return Vo||(Vo=1,bi.exports=Jc()),bi.exports}var E=eu(),ki={exports:{}},oe={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Bo;function tu(){if(Bo)return oe;Bo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),a=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),f=Symbol.iterator;function d(x){return x===null||typeof x!="object"?null:(x=f&&x[f]||x["@@iterator"],typeof x=="function"?x:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function v(x,T,L){this.props=x,this.context=T,this.refs=m,this.updater=L||h}v.prototype.isReactComponent={},v.prototype.setState=function(x,T){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,T,"setState")},v.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function w(){}w.prototype=v.prototype;function C(x,T,L){this.props=x,this.context=T,this.refs=m,this.updater=L||h}var y=C.prototype=new w;y.constructor=C,g(y,v.prototype),y.isPureReactComponent=!0;var _=Array.isArray,p={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function S(x,T,L,V,B,X){return L=X.ref,{$$typeof:e,type:x,key:T,ref:L!==void 0?L:null,props:X}}function N(x,T){return S(x.type,T,void 0,void 0,void 0,x.props)}function R(x){return typeof x=="object"&&x!==null&&x.$$typeof===e}function H(x){var T={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(L){return T[L]})}var $=/\/+/g;function z(x,T){return typeof x=="object"&&x!==null&&x.key!=null?H(""+x.key):T.toString(36)}function O(){}function b(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(O,O):(x.status="pending",x.then(function(T){x.status==="pending"&&(x.status="fulfilled",x.value=T)},function(T){x.status==="pending"&&(x.status="rejected",x.reason=T)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function M(x,T,L,V,B){var X=typeof x;(X==="undefined"||X==="boolean")&&(x=null);var F=!1;if(x===null)F=!0;else switch(X){case"bigint":case"string":case"number":F=!0;break;case"object":switch(x.$$typeof){case e:case t:F=!0;break;case u:return F=x._init,M(F(x._payload),T,L,V,B)}}if(F)return B=B(x),F=V===""?"."+z(x,0):V,_(B)?(L="",F!=null&&(L=F.replace($,"$&/")+"/"),M(B,T,L,"",function(K){return K})):B!=null&&(R(B)&&(B=N(B,L+(B.key==null||x&&x.key===B.key?"":(""+B.key).replace($,"$&/")+"/")+F)),T.push(B)),1;F=0;var G=V===""?".":V+":";if(_(x))for(var q=0;q<x.length;q++)V=x[q],X=G+z(V,q),F+=M(V,T,L,X,B);else if(q=d(x),typeof q=="function")for(x=q.call(x),q=0;!(V=x.next()).done;)V=V.value,X=G+z(V,q++),F+=M(V,T,L,X,B);else if(X==="object"){if(typeof x.then=="function")return M(b(x),T,L,V,B);throw T=String(x),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return F}function j(x,T,L){if(x==null)return x;var V=[],B=0;return M(x,V,"","",function(X){return T.call(L,X,B++)}),V}function D(x){if(x._status===-1){var T=x._result;T=T(),T.then(function(L){(x._status===0||x._status===-1)&&(x._status=1,x._result=L)},function(L){(x._status===0||x._status===-1)&&(x._status=2,x._result=L)}),x._status===-1&&(x._status=0,x._result=T)}if(x._status===1)return x._result.default;throw x._result}var I=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)};function P(){}return oe.Children={map:j,forEach:function(x,T,L){j(x,function(){T.apply(this,arguments)},L)},count:function(x){var T=0;return j(x,function(){T++}),T},toArray:function(x){return j(x,function(T){return T})||[]},only:function(x){if(!R(x))throw Error("React.Children.only expected to receive a single React element child.");return x}},oe.Component=v,oe.Fragment=n,oe.Profiler=i,oe.PureComponent=C,oe.StrictMode=r,oe.Suspense=c,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,oe.act=function(){throw Error("act(...) is not supported in production builds of React.")},oe.cache=function(x){return function(){return x.apply(null,arguments)}},oe.cloneElement=function(x,T,L){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var V=g({},x.props),B=x.key,X=void 0;if(T!=null)for(F in T.ref!==void 0&&(X=void 0),T.key!==void 0&&(B=""+T.key),T)!k.call(T,F)||F==="key"||F==="__self"||F==="__source"||F==="ref"&&T.ref===void 0||(V[F]=T[F]);var F=arguments.length-2;if(F===1)V.children=L;else if(1<F){for(var G=Array(F),q=0;q<F;q++)G[q]=arguments[q+2];V.children=G}return S(x.type,B,void 0,void 0,X,V)},oe.createContext=function(x){return x={$$typeof:s,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:o,_context:x},x},oe.createElement=function(x,T,L){var V,B={},X=null;if(T!=null)for(V in T.key!==void 0&&(X=""+T.key),T)k.call(T,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(B[V]=T[V]);var F=arguments.length-2;if(F===1)B.children=L;else if(1<F){for(var G=Array(F),q=0;q<F;q++)G[q]=arguments[q+2];B.children=G}if(x&&x.defaultProps)for(V in F=x.defaultProps,F)B[V]===void 0&&(B[V]=F[V]);return S(x,X,void 0,void 0,null,B)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(x){return{$$typeof:l,render:x}},oe.isValidElement=R,oe.lazy=function(x){return{$$typeof:u,_payload:{_status:-1,_result:x},_init:D}},oe.memo=function(x,T){return{$$typeof:a,type:x,compare:T===void 0?null:T}},oe.startTransition=function(x){var T=p.T,L={};p.T=L;try{var V=x(),B=p.S;B!==null&&B(L,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(P,I)}catch(X){I(X)}finally{p.T=T}},oe.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()},oe.use=function(x){return p.H.use(x)},oe.useActionState=function(x,T,L){return p.H.useActionState(x,T,L)},oe.useCallback=function(x,T){return p.H.useCallback(x,T)},oe.useContext=function(x){return p.H.useContext(x)},oe.useDebugValue=function(){},oe.useDeferredValue=function(x,T){return p.H.useDeferredValue(x,T)},oe.useEffect=function(x,T){return p.H.useEffect(x,T)},oe.useId=function(){return p.H.useId()},oe.useImperativeHandle=function(x,T,L){return p.H.useImperativeHandle(x,T,L)},oe.useInsertionEffect=function(x,T){return p.H.useInsertionEffect(x,T)},oe.useLayoutEffect=function(x,T){return p.H.useLayoutEffect(x,T)},oe.useMemo=function(x,T){return p.H.useMemo(x,T)},oe.useOptimistic=function(x,T){return p.H.useOptimistic(x,T)},oe.useReducer=function(x,T,L){return p.H.useReducer(x,T,L)},oe.useRef=function(x){return p.H.useRef(x)},oe.useState=function(x){return p.H.useState(x)},oe.useSyncExternalStore=function(x,T,L){return p.H.useSyncExternalStore(x,T,L)},oe.useTransition=function(){return p.H.useTransition()},oe.version="19.0.0",oe}var Fo;function mn(){return Fo||(Fo=1,ki.exports=tu()),ki.exports}var A=mn();const Aa=Zr(A),gv=Qc({__proto__:null,default:Aa},[A]);var _i={exports:{}},Me={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var qo;function nu(){if(qo)return Me;qo=1;var e=mn();function t(c){var a="https://react.dev/errors/"+c;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+c+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(c,a,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:f==null?null:""+f,children:c,containerInfo:a,implementation:u}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,a){if(c==="font")return"";if(typeof a=="string")return a==="use-credentials"?a:""}return Me.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Me.createPortal=function(c,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)throw Error(t(299));return o(c,a,null,u)},Me.flushSync=function(c){var a=s.T,u=r.p;try{if(s.T=null,r.p=2,c)return c()}finally{s.T=a,r.p=u,r.d.f()}},Me.preconnect=function(c,a){typeof c=="string"&&(a?(a=a.crossOrigin,a=typeof a=="string"?a==="use-credentials"?a:"":void 0):a=null,r.d.C(c,a))},Me.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Me.preinit=function(c,a){if(typeof c=="string"&&a&&typeof a.as=="string"){var u=a.as,f=l(u,a.crossOrigin),d=typeof a.integrity=="string"?a.integrity:void 0,h=typeof a.fetchPriority=="string"?a.fetchPriority:void 0;u==="style"?r.d.S(c,typeof a.precedence=="string"?a.precedence:void 0,{crossOrigin:f,integrity:d,fetchPriority:h}):u==="script"&&r.d.X(c,{crossOrigin:f,integrity:d,fetchPriority:h,nonce:typeof a.nonce=="string"?a.nonce:void 0})}},Me.preinitModule=function(c,a){if(typeof c=="string")if(typeof a=="object"&&a!==null){if(a.as==null||a.as==="script"){var u=l(a.as,a.crossOrigin);r.d.M(c,{crossOrigin:u,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0})}}else a==null&&r.d.M(c)},Me.preload=function(c,a){if(typeof c=="string"&&typeof a=="object"&&a!==null&&typeof a.as=="string"){var u=a.as,f=l(u,a.crossOrigin);r.d.L(c,u,{crossOrigin:f,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0,type:typeof a.type=="string"?a.type:void 0,fetchPriority:typeof a.fetchPriority=="string"?a.fetchPriority:void 0,referrerPolicy:typeof a.referrerPolicy=="string"?a.referrerPolicy:void 0,imageSrcSet:typeof a.imageSrcSet=="string"?a.imageSrcSet:void 0,imageSizes:typeof a.imageSizes=="string"?a.imageSizes:void 0,media:typeof a.media=="string"?a.media:void 0})}},Me.preloadModule=function(c,a){if(typeof c=="string")if(a){var u=l(a.as,a.crossOrigin);r.d.m(c,{as:typeof a.as=="string"&&a.as!=="script"?a.as:void 0,crossOrigin:u,integrity:typeof a.integrity=="string"?a.integrity:void 0})}else r.d.m(c)},Me.requestFormReset=function(c){r.d.r(c)},Me.unstable_batchedUpdates=function(c,a){return c(a)},Me.useFormState=function(c,a,u){return s.H.useFormState(c,a,u)},Me.useFormStatus=function(){return s.H.useHostTransitionStatus()},Me.version="19.0.0",Me}var Xo;function ru(){if(Xo)return _i.exports;Xo=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_i.exports=nu(),_i.exports}var iu=ru();const mv=Zr(iu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ou=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),su=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Yo=e=>{const t=su(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ma=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),au=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var lu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cu=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},c)=>A.createElement("svg",{ref:c,...lu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ma("lucide",i),...!o&&!au(l)&&{"aria-hidden":"true"},...l},[...s.map(([a,u])=>A.createElement(a,u)),...Array.isArray(o)?o:[o]]));/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y=(e,t)=>{const n=A.forwardRef(({className:r,...i},o)=>A.createElement(cu,{ref:o,iconNode:t,className:Ma(`lucide-${ou(Yo(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Yo(e),n};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uu=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],yv=Y("archive",uu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const du=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vv=Y("arrow-down",du);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fu=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xv=Y("arrow-left",fu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],wv=Y("ban",hu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pu=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],bv=Y("book",pu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gu=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],kv=Y("bot",gu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mu=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],_v=Y("box",mu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yu=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Ev=Y("calendar",yu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vu=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sv=Y("check",vu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xu=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Cv=Y("chevron-down",xu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Nv=Y("chevron-right",wu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bu=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Tv=Y("chevron-up",bu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ku=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Av=Y("circle-alert",ku);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _u=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Mv=Y("circle-check-big",_u);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],jv=Y("circle-x",Eu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Su=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Rv=Y("code",Su);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cu=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Dv=Y("copy",Cu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nu=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Pv=Y("download",Nu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tu=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Ov=Y("ellipsis-vertical",Tu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Au=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],$v=Y("ellipsis",Au);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mu=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Iv=Y("external-link",Mu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ju=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Lv=Y("eye",ju);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ru=[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]],zv=Y("file-audio",Ru);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Du=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],Hv=Y("file-code",Du);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],Vv=Y("file-image",Pu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ou=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Bv=Y("file-json",Ou);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $u=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Fv=Y("file-spreadsheet",$u);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Iu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],qv=Y("file-text",Iu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]],Xv=Y("file-video",Lu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zu=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],Yv=Y("file",zu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hu=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Gv=Y("folder-input",Hu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vu=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Uv=Y("folder-open",Vu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bu=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Wv=Y("funnel",Bu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fu=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Kv=Y("git-merge",Fu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qu=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Zv=Y("grid-3x3",qu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xu=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Qv=Y("hard-drive",Xu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yu=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Jv=Y("history",Yu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ex=Y("info",Gu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uu=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],tx=Y("key",Uu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wu=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],nx=Y("link",Wu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ku=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],rx=Y("loader-circle",Ku);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zu=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],ix=Y("log-out",Zu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qu=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],ox=Y("mail",Qu);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ju=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],sx=Y("message-circle",Ju);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ed=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]],ax=Y("message-square-plus",ed);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const td=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],lx=Y("message-square",td);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nd=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],cx=Y("mic",nd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rd=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],ux=Y("network",rd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const id=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]],dx=Y("notepad-text",id);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const od=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],fx=Y("panel-left",od);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sd=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],hx=Y("panel-right",sd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ad=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],px=Y("panels-top-left",ad);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ld=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],gx=Y("paperclip",ld);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cd=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],mx=Y("pencil",cd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ud=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],yx=Y("play",ud);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dd=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vx=Y("plus",dd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fd=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],xx=Y("presentation",fd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hd=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],wx=Y("refresh-ccw",hd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pd=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bx=Y("refresh-cw",pd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gd=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kx=Y("search",gd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const md=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],_x=Y("send",md);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yd=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ex=Y("settings",yd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vd=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Sx=Y("share-2",vd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xd=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Cx=Y("sparkles",xd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wd=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Nx=Y("square-pen",wd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bd=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Tx=Y("star",bd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kd=[["path",{d:"M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4",key:"1fu5g2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.9 4.9 1.4 1.4",key:"b9915j"}],["path",{d:"m17.7 17.7 1.4 1.4",key:"qc3ed3"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.3 17.7-1.4 1.4",key:"5gca6"}],["path",{d:"m19.1 4.9-1.4 1.4",key:"wpu9u6"}]],Ax=Y("sun-moon",kd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _d=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Mx=Y("tag",_d);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ed=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],jx=Y("terminal",Ed);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sd=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],Rx=Y("thumbs-down",Sd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cd=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],Dx=Y("thumbs-up",Cd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nd=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Px=Y("trash-2",Nd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Td=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Ox=Y("trash",Td);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ad=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],$x=Y("triangle-alert",Ad);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Md=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Ix=Y("type",Md);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jd=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Lx=Y("upload",jd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rd=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zx=Y("user",Rd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dd=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Hx=Y("volume-2",Dd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pd=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Vx=Y("volume-x",Pd);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Od=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bx=Y("x",Od);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $d=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],Fx=Y("wrench",$d);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Id=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],qx=Y("zap",Id);var Ei={exports:{}},Si={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Go;function Ld(){if(Go)return Si;Go=1;var e=mn();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(f,d){var h=d(),g=r({inst:{value:h,getSnapshot:d}}),m=g[0].inst,v=g[1];return o(function(){m.value=h,m.getSnapshot=d,c(m)&&v({inst:m})},[f,h,d]),i(function(){return c(m)&&v({inst:m}),f(function(){c(m)&&v({inst:m})})},[f]),s(h),h}function c(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function a(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:l;return Si.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Si}var Uo;function zd(){return Uo||(Uo=1,Ei.exports=Ld()),Ei.exports}function co(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ft=co();function ja(e){Ft=e}var Hn={exec:()=>null};function ye(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Re.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,t)};return r}var Re={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Hd=/^(?:[ \t]*(?:\n|$))+/,Vd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uo=/(?:[*+-]|\d{1,9}[.)])/,Ra=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Da=ye(Ra).replace(/bull/g,uo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qd=ye(Ra).replace(/bull/g,uo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xd=/^[^\n]+/,ho=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yd=ye(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ho).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gd=ye(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,uo).getRegex(),Qr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",po=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ud=ye("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",po).replace("tag",Qr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pa=ye(fo).replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex(),Wd=ye(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pa).getRegex(),go={blockquote:Wd,code:Vd,def:Yd,fences:Bd,heading:Fd,hr:Qn,html:Ud,lheading:Da,list:Gd,newline:Hd,paragraph:Pa,table:Hn,text:Xd},Wo=ye("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex(),Kd={...go,lheading:qd,table:Wo,paragraph:ye(fo).replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Wo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex()},Zd={...go,html:ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",po).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Hn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ye(fo).replace("hr",Qn).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Da).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oa=/^( {2,}|\\)\n(?!\s*$)/,ef=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jr=/[\p{P}\p{S}]/u,mo=/[\s\p{P}\p{S}]/u,$a=/[^\s\p{P}\p{S}]/u,tf=ye(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mo).getRegex(),Ia=/(?!~)[\p{P}\p{S}]/u,nf=/(?!~)[\s\p{P}\p{S}]/u,rf=/(?:[^\s\p{P}\p{S}]|~)/u,of=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,La=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sf=ye(La,"u").replace(/punct/g,Jr).getRegex(),af=ye(La,"u").replace(/punct/g,Ia).getRegex(),za="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lf=ye(za,"gu").replace(/notPunctSpace/g,$a).replace(/punctSpace/g,mo).replace(/punct/g,Jr).getRegex(),cf=ye(za,"gu").replace(/notPunctSpace/g,rf).replace(/punctSpace/g,nf).replace(/punct/g,Ia).getRegex(),uf=ye("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$a).replace(/punctSpace/g,mo).replace(/punct/g,Jr).getRegex(),df=ye(/\\(punct)/,"gu").replace(/punct/g,Jr).getRegex(),ff=ye(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hf=ye(po).replace("(?:-->|$)","-->").getRegex(),pf=ye("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",hf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,gf=ye(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Pr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ha=ye(/^!?\[(label)\]\[(ref)\]/).replace("label",Pr).replace("ref",ho).getRegex(),Va=ye(/^!?\[(ref)\](?:\[\])?/).replace("ref",ho).getRegex(),mf=ye("reflink|nolink(?!\\()","g").replace("reflink",Ha).replace("nolink",Va).getRegex(),yo={_backpedal:Hn,anyPunctuation:df,autolink:ff,blockSkip:of,br:Oa,code:Jd,del:Hn,emStrongLDelim:sf,emStrongRDelimAst:lf,emStrongRDelimUnd:uf,escape:Qd,link:gf,nolink:Va,punctuation:tf,reflink:Ha,reflinkSearch:mf,tag:pf,text:ef,url:Hn},yf={...yo,link:ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Pr).getRegex(),reflink:ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pr).getRegex()},Bi={...yo,emStrongRDelimAst:cf,emStrongLDelim:af,url:ye(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vf={...Bi,br:ye(Oa).replace("{2,}","*").getRegex(),text:ye(Bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},gr={normal:go,gfm:Kd,pedantic:Zd},Sn={normal:yo,gfm:Bi,breaks:vf,pedantic:yf},xf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ko=e=>xf[e];function rt(e,t){if(t){if(Re.escapeTest.test(e))return e.replace(Re.escapeReplace,Ko)}else if(Re.escapeTestNoEncode.test(e))return e.replace(Re.escapeReplaceNoEncode,Ko);return e}function Zo(e){try{e=encodeURI(e).replace(Re.percentDecode,"%")}catch{return null}return e}function Qo(e,t){var o;const n=e.replace(Re.findPipe,(s,l,c)=>{let a=!1,u=l;for(;--u>=0&&c[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(Re.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Re.slashPipe,"|");return r}function Cn(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function wf(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Jo(e,t,n,r,i){const o=t.href,s=t.title||null,l=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:s,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function bf(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const i=r[1];return t.split(`
`).map(o=>{const s=o.match(n.other.beginningSpace);if(s===null)return o;const[l]=s;return l.length>=i.length?o.slice(i.length):o}).join(`
`)}var Or=class{constructor(e){we(this,"options");we(this,"rules");we(this,"lexer");this.options=e||Ft}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Cn(n,`
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=bf(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Cn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Cn(t[0],`
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Cn(t[0],`
`).split(`
`),r="",i="";const o=[];for(;n.length>0;){let s=!1;const l=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),s=!0;else if(!s)l.push(n[c]);else break;n=n.slice(c);const a=l.join(`
`),u=a.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
${a}`:a,i=i?`${i}
${u}`:u;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=f,n.length===0)break;const d=o.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){const h=d,g=h.raw+`
`+n.join(`
`),m=this.blockquote(g);o[o.length-1]=m,r=r.substring(0,r.length-h.raw.length)+m.raw,i=i.substring(0,i.length-h.text.length)+m.text;break}else if((d==null?void 0:d.type)==="list"){const h=d,g=h.raw+`
`+n.join(`
`),m=this.list(g);o[o.length-1]=m,r=r.substring(0,r.length-d.raw.length)+m.raw,i=i.substring(0,i.length-h.raw.length)+m.raw,n=g.substring(o.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let s=!1;for(;e;){let c=!1,a="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let f=t[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),d=e.split(`
`,1)[0],h=!f.trim(),g=0;if(this.options.pedantic?(g=2,u=f.trimStart()):h?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=f.slice(g),g+=t[1].length),h&&this.rules.other.blankLine.test(d)&&(a+=d+`
`,e=e.substring(d.length+1),c=!0),!c){const w=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),y=this.rules.other.fencesBeginRegex(g),_=this.rules.other.headingBeginRegex(g),p=this.rules.other.htmlBeginRegex(g);for(;e;){const k=e.split(`
`,1)[0];let S;if(d=k,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,"  "),S=d):S=d.replace(this.rules.other.tabCharGlobal,"    "),y.test(d)||_.test(d)||p.test(d)||w.test(d)||C.test(d))break;if(S.search(this.rules.other.nonSpaceChar)>=g||!d.trim())u+=`
`+S.slice(g);else{if(h||f.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||y.test(f)||_.test(f)||C.test(f))break;u+=`
`+d}!h&&!d.trim()&&(h=!0),a+=k+`
`,e=e.substring(k.length+1),f=S.slice(g)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(s=!0));let m=null,v;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(v=m[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:a,task:!!m,checked:v,loose:!1,text:u,tokens:[]}),i.raw+=a}const l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const a=i.items[c].tokens.filter(f=>f.type==="space"),u=a.length>0&&a.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=u}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var s;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Qo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(s=t[3])!=null&&s.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(const l of i)o.rows.push(Qo(l,o.header.length).map((c,a)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[a]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=Cn(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=wf(t[2],"()");if(o===-2)return;if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Jo(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Jo(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let s,l,c=o,a=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){a+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+a);const f=[...r[0]][0].length,d=e.slice(0,o+r.index+f+l);if(Math.min(o,l)%2){const g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},pt=class Fi{constructor(t){we(this,"tokens");we(this,"options");we(this,"state");we(this,"tokenizer");we(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ft,this.options.tokenizer=this.options.tokenizer||new Or,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Re,block:gr.normal,inline:Sn.normal};this.options.pedantic?(n.block=gr.pedantic,n.inline=Sn.pedantic):this.options.gfm&&(n.block=gr.gfm,this.options.breaks?n.inline=Sn.breaks:n.inline=Sn.gfm),this.tokenizer.rules=n}static get rules(){return{block:gr,inline:Sn}}static lex(t,n){return new Fi(n).lex(t)}static lexInline(t,n){return new Fi(n).inlineTokens(t)}lex(t){t=t.replace(Re.carriageReturn,`
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var i,o,s;for(this.options.pedantic&&(t=t.replace(Re.tabCharGlobal,"    ").replace(Re.spaceLine,""));t;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(a=>(l=a.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const a=n.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
`:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.at(-1).src=a.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if((s=this.options.extensions)!=null&&s.startBlock){let a=1/0;const u=t.slice(1);let f;this.options.extensions.startBlock.forEach(d=>{f=d.call({lexer:this},u),typeof f=="number"&&f>=0&&(a=Math.min(a,f))}),a<1/0&&a>=0&&(c=t.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const a=n.at(-1);r&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(l);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,a;let r=t,i=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,s="";for(;t;){o||(s=""),o=!1;let u;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(d=>(u=d.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const d=n.at(-1);u.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,s)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let f=t;if((a=this.options.extensions)!=null&&a.startInline){let d=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},h),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(u=this.tokenizer.inlineText(f)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),o=!0;const d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(t){const d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},$r=class{constructor(e){we(this,"options");we(this,"parser");this.options=e||Ft}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(Re.notSpaceStart))==null?void 0:o[0],i=e.replace(Re.endingNewline,"")+`
`;return r?'<pre><code class="language-'+rt(r)+'">'+(n?i:rt(i,!0))+`</code></pre>
`:"<pre><code>"+(n?i:rt(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){const t=e.ordered,n=e.start;let r="";for(let s=0;s<e.items.length;s++){const l=e.items[s];r+=this.listitem(l)}const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
`+r+"</"+i+`>
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+rt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){const o=e.rows[i];n="";for(let s=0;s<o.length;s++)n+=this.tablecell(o[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+r+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${rt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=Zo(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+rt(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Zo(e);if(i===null)return rt(n);e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${rt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:rt(e.text)}},vo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},gt=class qi{constructor(t){we(this,"options");we(this,"renderer");we(this,"textRenderer");this.options=t||Ft,this.options.renderer=this.options.renderer||new $r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vo}static parse(t,n){return new qi(n).parse(t)}static parseInline(t,n){return new qi(n).parseInline(t)}parse(t,n=!0){var i,o;let r="";for(let s=0;s<t.length;s++){const l=t[s];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){const a=l,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=u||"";continue}}const c=l;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let a=c,u=this.renderer.text(a);for(;s+1<t.length&&t[s+1].type==="text";)a=t[++s],u+=`
`+this.renderer.text(a);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const a='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(t,n=this.renderer){var i,o;let r="";for(let s=0;s<t.length;s++){const l=t[s];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=a||"";continue}}const c=l;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{const a='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Vi,Nr=(Vi=class{constructor(e){we(this,"options");we(this,"block");this.options=e||Ft}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?pt.lex:pt.lexInline}provideParser(){return this.block?gt.parse:gt.parseInline}},we(Vi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Vi),kf=class{constructor(...e){we(this,"defaults",co());we(this,"options",this.setOptions);we(this,"parse",this.parseMarkdown(!0));we(this,"parseInline",this.parseMarkdown(!1));we(this,"Parser",gt);we(this,"Renderer",$r);we(this,"TextRenderer",vo);we(this,"Lexer",pt);we(this,"Tokenizer",Or);we(this,"Hooks",Nr);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const s=o;for(const l of s.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of s.rows)for(const c of l)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const s=o;n=n.concat(this.walkTokens(s.items,t));break}default:{const s=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[s.type]?this.defaults.extensions.childTokens[s.type].forEach(l=>{const c=s[l].flat(1/0);n=n.concat(this.walkTokens(c,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new $r(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const s=o,l=n.renderer[s],c=i[s];i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Or(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const s=o,l=n.tokenizer[s],c=i[s];i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new Nr;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const s=o,l=n.hooks[s],c=i[s];Nr.passThroughHooks.has(o)?i[s]=a=>{if(this.defaults.async)return Promise.resolve(l.call(i,a)).then(f=>c.call(i,f));const u=l.call(i,a);return c.call(i,u)}:i[s]=(...a)=>{let u=l.apply(i,a);return u===!1&&(u=c.apply(i,a)),u}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pt.lex(e,t??this.defaults)}parser(e,t){return gt.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const i={...r},o={...this.defaults,...i},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?pt.lex:pt.lexInline,c=o.hooks?o.hooks.provideParser():e?gt.parse:gt.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(a=>l(a,o)).then(a=>o.hooks?o.hooks.processAllTokens(a):a).then(a=>o.walkTokens?Promise.all(this.walkTokens(a,o.walkTokens)).then(()=>a):a).then(a=>c(a,o)).then(a=>o.hooks?o.hooks.postprocess(a):a).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let a=l(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let u=c(a,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(a){return s(a)}}}onError(e,t){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+rt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Lt=new kf;function xe(e,t){return Lt.parse(e,t)}xe.options=xe.setOptions=function(e){return Lt.setOptions(e),xe.defaults=Lt.defaults,ja(xe.defaults),xe};xe.getDefaults=co;xe.defaults=Ft;xe.use=function(...e){return Lt.use(...e),xe.defaults=Lt.defaults,ja(xe.defaults),xe};xe.walkTokens=function(e,t){return Lt.walkTokens(e,t)};xe.parseInline=Lt.parseInline;xe.Parser=gt;xe.parser=gt.parse;xe.Renderer=$r;xe.TextRenderer=vo;xe.Lexer=pt;xe.lexer=pt.lex;xe.Tokenizer=Or;xe.Hooks=Nr;xe.parse=xe;xe.options;xe.setOptions;xe.use;xe.walkTokens;xe.parseInline;gt.parse;pt.lex;var Nn={},Kt={},mr={},Tt={},At={},Ci={},es;function Ba(){return es||(es=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(r){return r.type===t.Tag||r.type===t.Script||r.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype}(Ci)),Ci}var se={},ts;function ns(){if(ts)return se;ts=1;var e=se&&se.__extends||function(){var p=function(k,S){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,R){N.__proto__=R}||function(N,R){for(var H in R)Object.prototype.hasOwnProperty.call(R,H)&&(N[H]=R[H])},p(k,S)};return function(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");p(k,S);function N(){this.constructor=k}k.prototype=S===null?Object.create(S):(N.prototype=S.prototype,new N)}}(),t=se&&se.__assign||function(){return t=Object.assign||function(p){for(var k,S=1,N=arguments.length;S<N;S++){k=arguments[S];for(var R in k)Object.prototype.hasOwnProperty.call(k,R)&&(p[R]=k[R])}return p},t.apply(this,arguments)};Object.defineProperty(se,"__esModule",{value:!0}),se.cloneNode=se.hasChildren=se.isDocument=se.isDirective=se.isComment=se.isText=se.isCDATA=se.isTag=se.Element=se.Document=se.CDATA=se.NodeWithChildren=se.ProcessingInstruction=se.Comment=se.Text=se.DataNode=se.Node=void 0;var n=Ba(),r=function(){function p(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(p.prototype,"parentNode",{get:function(){return this.parent},set:function(k){this.parent=k},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return this.prev},set:function(k){this.prev=k},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return this.next},set:function(k){this.next=k},enumerable:!1,configurable:!0}),p.prototype.cloneNode=function(k){return k===void 0&&(k=!1),y(this,k)},p}();se.Node=r;var i=function(p){e(k,p);function k(S){var N=p.call(this)||this;return N.data=S,N}return Object.defineProperty(k.prototype,"nodeValue",{get:function(){return this.data},set:function(S){this.data=S},enumerable:!1,configurable:!0}),k}(r);se.DataNode=i;var o=function(p){e(k,p);function k(){var S=p!==null&&p.apply(this,arguments)||this;return S.type=n.ElementType.Text,S}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),k}(i);se.Text=o;var s=function(p){e(k,p);function k(){var S=p!==null&&p.apply(this,arguments)||this;return S.type=n.ElementType.Comment,S}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),k}(i);se.Comment=s;var l=function(p){e(k,p);function k(S,N){var R=p.call(this,N)||this;return R.name=S,R.type=n.ElementType.Directive,R}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),k}(i);se.ProcessingInstruction=l;var c=function(p){e(k,p);function k(S){var N=p.call(this)||this;return N.children=S,N}return Object.defineProperty(k.prototype,"firstChild",{get:function(){var S;return(S=this.children[0])!==null&&S!==void 0?S:null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"childNodes",{get:function(){return this.children},set:function(S){this.children=S},enumerable:!1,configurable:!0}),k}(r);se.NodeWithChildren=c;var a=function(p){e(k,p);function k(){var S=p!==null&&p.apply(this,arguments)||this;return S.type=n.ElementType.CDATA,S}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),k}(c);se.CDATA=a;var u=function(p){e(k,p);function k(){var S=p!==null&&p.apply(this,arguments)||this;return S.type=n.ElementType.Root,S}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),k}(c);se.Document=u;var f=function(p){e(k,p);function k(S,N,R,H){R===void 0&&(R=[]),H===void 0&&(H=S==="script"?n.ElementType.Script:S==="style"?n.ElementType.Style:n.ElementType.Tag);var $=p.call(this,R)||this;return $.name=S,$.attribs=N,$.type=H,$}return Object.defineProperty(k.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"tagName",{get:function(){return this.name},set:function(S){this.name=S},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"attributes",{get:function(){var S=this;return Object.keys(this.attribs).map(function(N){var R,H;return{name:N,value:S.attribs[N],namespace:(R=S["x-attribsNamespace"])===null||R===void 0?void 0:R[N],prefix:(H=S["x-attribsPrefix"])===null||H===void 0?void 0:H[N]}})},enumerable:!1,configurable:!0}),k}(c);se.Element=f;function d(p){return(0,n.isTag)(p)}se.isTag=d;function h(p){return p.type===n.ElementType.CDATA}se.isCDATA=h;function g(p){return p.type===n.ElementType.Text}se.isText=g;function m(p){return p.type===n.ElementType.Comment}se.isComment=m;function v(p){return p.type===n.ElementType.Directive}se.isDirective=v;function w(p){return p.type===n.ElementType.Root}se.isDocument=w;function C(p){return Object.prototype.hasOwnProperty.call(p,"children")}se.hasChildren=C;function y(p,k){k===void 0&&(k=!1);var S;if(g(p))S=new o(p.data);else if(m(p))S=new s(p.data);else if(d(p)){var N=k?_(p.children):[],R=new f(p.name,t({},p.attribs),N);N.forEach(function(O){return O.parent=R}),p.namespace!=null&&(R.namespace=p.namespace),p["x-attribsNamespace"]&&(R["x-attribsNamespace"]=t({},p["x-attribsNamespace"])),p["x-attribsPrefix"]&&(R["x-attribsPrefix"]=t({},p["x-attribsPrefix"])),S=R}else if(h(p)){var N=k?_(p.children):[],H=new a(N);N.forEach(function(b){return b.parent=H}),S=H}else if(w(p)){var N=k?_(p.children):[],$=new u(N);N.forEach(function(b){return b.parent=$}),p["x-mode"]&&($["x-mode"]=p["x-mode"]),S=$}else if(v(p)){var z=new l(p.name,p.data);p["x-name"]!=null&&(z["x-name"]=p["x-name"],z["x-publicId"]=p["x-publicId"],z["x-systemId"]=p["x-systemId"]),S=z}else throw new Error("Not implemented yet: ".concat(p.type));return S.startIndex=p.startIndex,S.endIndex=p.endIndex,p.sourceCodeLocation!=null&&(S.sourceCodeLocation=p.sourceCodeLocation),S}se.cloneNode=y;function _(p){for(var k=p.map(function(N){return y(N,!0)}),S=1;S<k.length;S++)k[S].prev=k[S-1],k[S-1].next=k[S];return k}return se}var rs;function Fa(){return rs||(rs=1,function(e){var t=At&&At.__createBinding||(Object.create?function(l,c,a,u){u===void 0&&(u=a);var f=Object.getOwnPropertyDescriptor(c,a);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[a]}}),Object.defineProperty(l,u,f)}:function(l,c,a,u){u===void 0&&(u=a),l[u]=c[a]}),n=At&&At.__exportStar||function(l,c){for(var a in l)a!=="default"&&!Object.prototype.hasOwnProperty.call(c,a)&&t(c,l,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=Ba(),i=ns();n(ns(),e);var o={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function l(c,a,u){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof a=="function"&&(u=a,a=o),typeof c=="object"&&(a=c,c=void 0),this.callback=c??null,this.options=a??o,this.elementCB=u??null}return l.prototype.onparserinit=function(c){this.parser=c},l.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(c){this.handleCallback(c)},l.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},l.prototype.onopentag=function(c,a){var u=this.options.xmlMode?r.ElementType.Tag:void 0,f=new i.Element(c,a,void 0,u);this.addNode(f),this.tagStack.push(f)},l.prototype.ontext=function(c){var a=this.lastNode;if(a&&a.type===r.ElementType.Text)a.data+=c,this.options.withEndIndices&&(a.endIndex=this.parser.endIndex);else{var u=new i.Text(c);this.addNode(u),this.lastNode=u}},l.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=c;return}var a=new i.Comment(c);this.addNode(a),this.lastNode=a},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var c=new i.Text(""),a=new i.CDATA([c]);this.addNode(a),c.parent=a,this.lastNode=c},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(c,a){var u=new i.ProcessingInstruction(c,a);this.addNode(u)},l.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},l.prototype.addNode=function(c){var a=this.tagStack[this.tagStack.length-1],u=a.children[a.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),a.children.push(c),u&&(c.prev=u,u.next=c),c.parent=a,this.lastNode=null},l}();e.DomHandler=s,e.default=s}(At)),At}var Ni={},is;function _f(){return is||(is=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,n){return t[n.toLowerCase()]=n,t},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")}(Ni)),Ni}var os;function qa(){if(os)return Tt;os=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.formatAttributes=r,Tt.escapeSpecialCharacters=o,Tt.revertEscapedCharacters=s,Tt.formatDOM=l;var e=Fa(),t=_f();function n(c){return t.CASE_SENSITIVE_TAG_NAMES_MAP[c]}function r(c){for(var a={},u=0,f=c.length;u<f;u++){var d=c[u];a[d.name]=d.value}return a}function i(c){c=c.toLowerCase();var a=n(c);return a||c}function o(c){return c.replace(t.CARRIAGE_RETURN_REGEX,t.CARRIAGE_RETURN_PLACEHOLDER)}function s(c){return c.replace(t.CARRIAGE_RETURN_PLACEHOLDER_REGEX,t.CARRIAGE_RETURN)}function l(c,a,u){a===void 0&&(a=null);for(var f=[],d,h=0,g=c.length;h<g;h++){var m=c[h];switch(m.nodeType){case 1:{var v=i(m.nodeName);d=new e.Element(v,r(m.attributes)),d.children=l(v==="template"?m.content.childNodes:m.childNodes,d);break}case 3:d=new e.Text(s(m.nodeValue));break;case 8:d=new e.Comment(m.nodeValue);break;default:continue}var w=f[h-1]||null;w&&(w.next=d),d.parent=a,d.prev=w,d.next=null,f.push(d)}return u&&(d=new e.ProcessingInstruction(u.substring(0,u.indexOf(" ")).toLowerCase(),u),d.next=f[0]||null,d.parent=a,f.unshift(d),f[1]&&(f[1].prev=f[0])),f}return Tt}var ss;function Ef(){if(ss)return mr;ss=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.default=m;var e=qa(),t="html",n="head",r="body",i=/<([a-zA-Z]+[0-9]?)/,o=/<head[^]*>/i,s=/<body[^]*>/i,l=function(v,w){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(v,w){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},a=typeof window=="object"&&window.DOMParser;if(typeof a=="function"){var u=new a,f="text/html";c=function(v,w){return w&&(v="<".concat(w,">").concat(v,"</").concat(w,">")),u.parseFromString(v,f)},l=c}if(typeof document=="object"&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(v,w){if(w){var C=d.documentElement.querySelector(w);return C&&(C.innerHTML=v),d}return d.documentElement.innerHTML=v,d}}var h=typeof document=="object"&&document.createElement("template"),g;h&&h.content&&(g=function(v){return h.innerHTML=v,h.content.childNodes});function m(v){var w,C;v=(0,e.escapeSpecialCharacters)(v);var y=v.match(i),_=y&&y[1]?y[1].toLowerCase():"";switch(_){case t:{var p=c(v);if(!o.test(v)){var k=p.querySelector(n);(w=k==null?void 0:k.parentNode)===null||w===void 0||w.removeChild(k)}if(!s.test(v)){var k=p.querySelector(r);(C=k==null?void 0:k.parentNode)===null||C===void 0||C.removeChild(k)}return p.querySelectorAll(t)}case n:case r:{var S=l(v).querySelectorAll(_);return s.test(v)&&o.test(v)?S[0].parentNode.childNodes:S}default:{if(g)return g(v);var k=l(v,r).querySelector(r);return k.childNodes}}}return mr}var as;function Sf(){if(as)return Kt;as=1;var e=Kt&&Kt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=i;var t=e(Ef()),n=qa(),r=/<(![a-zA-Z\s]+)>/;function i(o){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];var s=o.match(r),l=s?s[1]:void 0;return(0,n.formatDOM)((0,t.default)(o),null,l)}return Kt}var yr={},Ke={},Tn={},ls;function Cf(){if(ls)return Tn;ls=1;var e=0;Tn.SAME=e;var t=1;return Tn.CAMELCASE=t,Tn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},Tn}var cs;function Nf(){if(cs)return Ke;cs=1;const e=0,t=1,n=2,r=3,i=4,o=5,s=6;function l(p){return a.hasOwnProperty(p)?a[p]:null}function c(p,k,S,N,R,H,$){this.acceptsBooleans=k===n||k===r||k===i,this.attributeName=N,this.attributeNamespace=R,this.mustUseProperty=S,this.propertyName=p,this.type=k,this.sanitizeURL=H,this.removeEmptyString=$}const a={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(p=>{a[p]=new c(p,e,!1,p,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([p,k])=>{a[p]=new c(p,t,!1,k,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(p=>{a[p]=new c(p,n,!1,p.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(p=>{a[p]=new c(p,n,!1,p,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(p=>{a[p]=new c(p,r,!1,p.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(p=>{a[p]=new c(p,r,!0,p,null,!1,!1)}),["capture","download"].forEach(p=>{a[p]=new c(p,i,!1,p,null,!1,!1)}),["cols","rows","size","span"].forEach(p=>{a[p]=new c(p,s,!1,p,null,!1,!1)}),["rowSpan","start"].forEach(p=>{a[p]=new c(p,o,!1,p.toLowerCase(),null,!1,!1)});const f=/[\-\:]([a-z])/g,d=p=>p[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(p=>{const k=p.replace(f,d);a[k]=new c(k,t,!1,p,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(p=>{const k=p.replace(f,d);a[k]=new c(k,t,!1,p,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(p=>{const k=p.replace(f,d);a[k]=new c(k,t,!1,p,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(p=>{a[p]=new c(p,t,!1,p.toLowerCase(),null,!1,!1)});const h="xlinkHref";a[h]=new c("xlinkHref",t,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(p=>{a[p]=new c(p,t,!1,p.toLowerCase(),null,!0,!0)});const{CAMELCASE:g,SAME:m,possibleStandardNames:v}=Cf(),C=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",y=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+C+"]*$")),_=Object.keys(v).reduce((p,k)=>{const S=v[k];return S===m?p[k]=k:S===g?p[k.toLowerCase()]=k:p[k]=S,p},{});return Ke.BOOLEAN=r,Ke.BOOLEANISH_STRING=n,Ke.NUMERIC=o,Ke.OVERLOADED_BOOLEAN=i,Ke.POSITIVE_NUMERIC=s,Ke.RESERVED=e,Ke.STRING=t,Ke.getPropertyInfo=l,Ke.isCustomAttribute=y,Ke.possibleStandardNames=_,Ke}var An={},Zt={},Ti,us;function Tf(){if(us)return Ti;us=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
`,a="/",u="*",f="",d="comment",h="declaration";Ti=function(m,v){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];v=v||{};var w=1,C=1;function y(O){var b=O.match(t);b&&(w+=b.length);var M=O.lastIndexOf(c);C=~M?O.length-M:C+O.length}function _(){var O={line:w,column:C};return function(b){return b.position=new p(O),N(),b}}function p(O){this.start=O,this.end={line:w,column:C},this.source=v.source}p.prototype.content=m;function k(O){var b=new Error(v.source+":"+w+":"+C+": "+O);if(b.reason=O,b.filename=v.source,b.line=w,b.column=C,b.source=m,!v.silent)throw b}function S(O){var b=O.exec(m);if(b){var M=b[0];return y(M),m=m.slice(M.length),b}}function N(){S(n)}function R(O){var b;for(O=O||[];b=H();)b!==!1&&O.push(b);return O}function H(){var O=_();if(!(a!=m.charAt(0)||u!=m.charAt(1))){for(var b=2;f!=m.charAt(b)&&(u!=m.charAt(b)||a!=m.charAt(b+1));)++b;if(b+=2,f===m.charAt(b-1))return k("End of comment missing");var M=m.slice(2,b-2);return C+=2,y(M),m=m.slice(b),C+=2,O({type:d,comment:M})}}function $(){var O=_(),b=S(r);if(b){if(H(),!S(i))return k("property missing ':'");var M=S(o),j=O({type:h,property:g(b[0].replace(e,f)),value:M?g(M[0].replace(e,f)):f});return S(s),j}}function z(){var O=[];R(O);for(var b;b=$();)b!==!1&&(O.push(b),R(O));return O}return N(),z()};function g(m){return m?m.replace(l,f):f}return Ti}var ds;function Af(){if(ds)return Zt;ds=1;var e=Zt&&Zt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=n;var t=e(Tf());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),l=typeof i=="function";return s.forEach(function(c){if(c.type==="declaration"){var a=c.property,u=c.value;l?i(a,u,c):u&&(o=o||{},o[a]=u)}}),o}return Zt}var Mn={},fs;function Mf(){if(fs)return Mn;fs=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(a){return!a||n.test(a)||e.test(a)},s=function(a,u){return u.toUpperCase()},l=function(a,u){return"".concat(u,"-")},c=function(a,u){return u===void 0&&(u={}),o(a)?a:(a=a.toLowerCase(),u.reactCompat?a=a.replace(i,l):a=a.replace(r,l),a.replace(t,s))};return Mn.camelCase=c,Mn}var jn,hs;function jf(){if(hs)return jn;hs=1;var e=jn&&jn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Af()),n=Mf();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(s[(0,n.camelCase)(l,o)]=c)}),s}return r.default=r,jn=r,jn}var ps;function Xa(){return ps||(ps=1,function(e){var t=An&&An.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=o,e.setStyleProp=l;var n=mn(),r=t(jf()),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function o(u,f){return u.includes("-")?!i.has(u):!!(f&&typeof f.is=="string")}var s={reactCompat:!0};function l(u,f){if(typeof u=="string"){if(!u.trim()){f.style={};return}try{f.style=(0,r.default)(u,s)}catch{f.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var c=function(u){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(u.name)};e.canTextBeChildOfNode=c;var a=function(u){return u};e.returnFirstArg=a}(An)),An}var gs;function Ya(){if(gs)return yr;gs=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=o;var e=Nf(),t=Xa(),n=["checked","value"],r=["input","select","textarea"],i={reset:!0,submit:!0};function o(l,c){l===void 0&&(l={});var a={},u=!!(l.type&&i[l.type]);for(var f in l){var d=l[f];if((0,e.isCustomAttribute)(f)){a[f]=d;continue}var h=f.toLowerCase(),g=s(h);if(g){var m=(0,e.getPropertyInfo)(g);switch(n.includes(g)&&r.includes(c)&&!u&&(g=s("default"+h)),a[g]=d,m&&m.type){case e.BOOLEAN:a[g]=!0;break;case e.OVERLOADED_BOOLEAN:d===""&&(a[g]=!0);break}continue}t.PRESERVE_CUSTOM_ATTRIBUTES&&(a[f]=d)}return(0,t.setStyleProp)(l.style,a),a}function s(l){return e.possibleStandardNames[l]}return yr}var Qt={},ms;function Rf(){if(ms)return Qt;ms=1;var e=Qt&&Qt.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default=o;var t=mn(),n=e(Ya()),r=Xa(),i={cloneElement:t.cloneElement,createElement:t.createElement,isValidElement:t.isValidElement};function o(l,c){c===void 0&&(c={});for(var a=[],u=typeof c.replace=="function",f=c.transform||r.returnFirstArg,d=c.library||i,h=d.cloneElement,g=d.createElement,m=d.isValidElement,v=l.length,w=0;w<v;w++){var C=l[w];if(u){var y=c.replace(C,w);if(m(y)){v>1&&(y=h(y,{key:y.key||w})),a.push(f(y,C,w));continue}}if(C.type==="text"){var _=!C.data.trim().length;if(_&&C.parent&&!(0,r.canTextBeChildOfNode)(C.parent)||c.trim&&_)continue;a.push(f(C.data,C,w));continue}var p=C,k={};s(p)?((0,r.setStyleProp)(p.attribs.style,p.attribs),k=p.attribs):p.attribs&&(k=(0,n.default)(p.attribs,p.name));var S=void 0;switch(C.type){case"script":case"style":C.children[0]&&(k.dangerouslySetInnerHTML={__html:C.children[0].data});break;case"tag":C.name==="textarea"&&C.children[0]?k.defaultValue=C.children[0].data:C.children&&C.children.length&&(S=o(C.children,c));break;default:continue}v>1&&(k.key=w),a.push(f(g(C.name,k,S),C,w))}return a.length===1?a[0]:a}function s(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return Qt}var ys;function Df(){return ys||(ys=1,function(e){var t=Nn&&Nn.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=l;var n=t(Sf());e.htmlToDOM=n.default;var r=t(Ya());e.attributesToProps=r.default;var i=t(Rf());e.domToReact=i.default;var o=Fa();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return o.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return o.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return o.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return o.Text}});var s={lowerCaseAttributeNames:!1};function l(c,a){if(typeof c!="string")throw new TypeError("First argument must be a string");return c?(0,i.default)((0,n.default)(c,(a==null?void 0:a.htmlparser2)||s),a):[]}}(Nn)),Nn}var Pf=Df();const vs=Zr(Pf),Xx=vs.default||vs;function Se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Se(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Of={value:()=>{}};function ei(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Tr(n)}function Tr(e){this._=e}function $f(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Tr.prototype=ei.prototype={constructor:Tr,on:function(e,t){var n=this._,r=$f(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=If(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=xs(n[i],e.name,t);else if(t==null)for(i in n)n[i]=xs(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tr(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function If(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function xs(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Of,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xi="http://www.w3.org/1999/xhtml";const ws={svg:"http://www.w3.org/2000/svg",xhtml:Xi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ti(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ws.hasOwnProperty(t)?{space:ws[t],local:e}:e}function Lf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xi&&t.documentElement.namespaceURI===Xi?t.createElement(e):t.createElementNS(n,e)}}function zf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ga(e){var t=ti(e);return(t.local?zf:Lf)(t)}function Hf(){}function xo(e){return e==null?Hf:function(){return this.querySelector(e)}}function Vf(e){typeof e!="function"&&(e=xo(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=new Array(s),c,a,u=0;u<s;++u)(c=o[u])&&(a=e.call(c,c.__data__,u,o))&&("__data__"in c&&(a.__data__=c.__data__),l[u]=a);return new qe(r,this._parents)}function Bf(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ff(){return[]}function Ua(e){return e==null?Ff:function(){return this.querySelectorAll(e)}}function qf(e){return function(){return Bf(e.apply(this,arguments))}}function Xf(e){typeof e=="function"?e=qf(e):e=Ua(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],l=s.length,c,a=0;a<l;++a)(c=s[a])&&(r.push(e.call(c,c.__data__,a,s)),i.push(c));return new qe(r,i)}function Wa(e){return function(){return this.matches(e)}}function Ka(e){return function(t){return t.matches(e)}}var Yf=Array.prototype.find;function Gf(e){return function(){return Yf.call(this.children,e)}}function Uf(){return this.firstElementChild}function Wf(e){return this.select(e==null?Uf:Gf(typeof e=="function"?e:Ka(e)))}var Kf=Array.prototype.filter;function Zf(){return Array.from(this.children)}function Qf(e){return function(){return Kf.call(this.children,e)}}function Jf(e){return this.selectAll(e==null?Zf:Qf(typeof e=="function"?e:Ka(e)))}function eh(e){typeof e!="function"&&(e=Wa(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],c,a=0;a<s;++a)(c=o[a])&&e.call(c,c.__data__,a,o)&&l.push(c);return new qe(r,this._parents)}function Za(e){return new Array(e.length)}function th(){return new qe(this._enter||this._groups.map(Za),this._parents)}function Ir(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ir.prototype={constructor:Ir,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function nh(e){return function(){return e}}function rh(e,t,n,r,i,o){for(var s=0,l,c=t.length,a=o.length;s<a;++s)(l=t[s])?(l.__data__=o[s],r[s]=l):n[s]=new Ir(e,o[s]);for(;s<c;++s)(l=t[s])&&(i[s]=l)}function ih(e,t,n,r,i,o,s){var l,c,a=new Map,u=t.length,f=o.length,d=new Array(u),h;for(l=0;l<u;++l)(c=t[l])&&(d[l]=h=s.call(c,c.__data__,l,t)+"",a.has(h)?i[l]=c:a.set(h,c));for(l=0;l<f;++l)h=s.call(e,o[l],l,o)+"",(c=a.get(h))?(r[l]=c,c.__data__=o[l],a.delete(h)):n[l]=new Ir(e,o[l]);for(l=0;l<u;++l)(c=t[l])&&a.get(d[l])===c&&(i[l]=c)}function oh(e){return e.__data__}function sh(e,t){if(!arguments.length)return Array.from(this,oh);var n=t?ih:rh,r=this._parents,i=this._groups;typeof e!="function"&&(e=nh(e));for(var o=i.length,s=new Array(o),l=new Array(o),c=new Array(o),a=0;a<o;++a){var u=r[a],f=i[a],d=f.length,h=ah(e.call(u,u&&u.__data__,a,r)),g=h.length,m=l[a]=new Array(g),v=s[a]=new Array(g),w=c[a]=new Array(d);n(u,f,m,v,w,h,t);for(var C=0,y=0,_,p;C<g;++C)if(_=m[C]){for(C>=y&&(y=C+1);!(p=v[y])&&++y<g;);_._next=p||null}}return s=new qe(s,r),s._enter=l,s._exit=c,s}function ah(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lh(){return new qe(this._exit||this._groups.map(Za),this._parents)}function ch(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function uh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),c=0;c<s;++c)for(var a=n[c],u=r[c],f=a.length,d=l[c]=new Array(f),h,g=0;g<f;++g)(h=a[g]||u[g])&&(d[g]=h);for(;c<i;++c)l[c]=n[c];return new qe(l,this._parents)}function dh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function fh(e){e||(e=hh);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,c=i[o]=new Array(l),a,u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new qe(i,this._parents).order()}function hh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ph(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function gh(){return Array.from(this)}function mh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function yh(){let e=0;for(const t of this)++e;return e}function vh(){return!this.node()}function xh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&e.call(l,l.__data__,o,i);return this}function wh(e){return function(){this.removeAttribute(e)}}function bh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kh(e,t){return function(){this.setAttribute(e,t)}}function _h(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Eh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Sh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ch(e,t){var n=ti(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?bh:wh:typeof t=="function"?n.local?Sh:Eh:n.local?_h:kh)(n,t))}function Qa(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nh(e){return function(){this.style.removeProperty(e)}}function Th(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ah(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Mh(e,t,n){return arguments.length>1?this.each((t==null?Nh:typeof t=="function"?Ah:Th)(e,t,n??"")):sn(this.node(),e)}function sn(e,t){return e.style.getPropertyValue(t)||Qa(e).getComputedStyle(e,null).getPropertyValue(t)}function jh(e){return function(){delete this[e]}}function Rh(e,t){return function(){this[e]=t}}function Dh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ph(e,t){return arguments.length>1?this.each((t==null?jh:typeof t=="function"?Dh:Rh)(e,t)):this.node()[e]}function Ja(e){return e.trim().split(/^|\s+/)}function wo(e){return e.classList||new el(e)}function el(e){this._node=e,this._names=Ja(e.getAttribute("class")||"")}el.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function tl(e,t){for(var n=wo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function nl(e,t){for(var n=wo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Oh(e){return function(){tl(this,e)}}function $h(e){return function(){nl(this,e)}}function Ih(e,t){return function(){(t.apply(this,arguments)?tl:nl)(this,e)}}function Lh(e,t){var n=Ja(e+"");if(arguments.length<2){for(var r=wo(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Ih:t?Oh:$h)(n,t))}function zh(){this.textContent=""}function Hh(e){return function(){this.textContent=e}}function Vh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bh(e){return arguments.length?this.each(e==null?zh:(typeof e=="function"?Vh:Hh)(e)):this.node().textContent}function Fh(){this.innerHTML=""}function qh(e){return function(){this.innerHTML=e}}function Xh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Yh(e){return arguments.length?this.each(e==null?Fh:(typeof e=="function"?Xh:qh)(e)):this.node().innerHTML}function Gh(){this.nextSibling&&this.parentNode.appendChild(this)}function Uh(){return this.each(Gh)}function Wh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Kh(){return this.each(Wh)}function Zh(e){var t=typeof e=="function"?e:Ga(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Qh(){return null}function Jh(e,t){var n=typeof e=="function"?e:Ga(e),r=t==null?Qh:typeof t=="function"?t:xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ep(){var e=this.parentNode;e&&e.removeChild(this)}function tp(){return this.each(ep)}function np(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ip(e){return this.select(e?rp:np)}function op(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sp(e){return function(t){e.call(this,t,this.__data__)}}function ap(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function lp(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function cp(e,t,n){return function(){var r=this.__on,i,o=sp(t);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function up(e,t,n){var r=ap(e+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,a=l.length,u;c<a;++c)for(i=0,u=l[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(l=t?cp:lp,i=0;i<o;++i)this.each(l(r[i],t,n));return this}function rl(e,t,n){var r=Qa(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function dp(e,t){return function(){return rl(this,e,t)}}function fp(e,t){return function(){return rl(this,e,t.apply(this,arguments))}}function hp(e,t){return this.each((typeof t=="function"?fp:dp)(e,t))}function*pp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var il=[null];function qe(e,t){this._groups=e,this._parents=t}function Jn(){return new qe([[document.documentElement]],il)}function gp(){return this}qe.prototype=Jn.prototype={constructor:qe,select:Vf,selectAll:Xf,selectChild:Wf,selectChildren:Jf,filter:eh,data:sh,enter:th,exit:lh,join:ch,merge:uh,selection:gp,order:dh,sort:fh,call:ph,nodes:gh,node:mh,size:yh,empty:vh,each:xh,attr:Ch,style:Mh,property:Ph,classed:Lh,text:Bh,html:Yh,raise:Uh,lower:Kh,append:Zh,insert:Jh,remove:tp,clone:ip,datum:op,on:up,dispatch:hp,[Symbol.iterator]:pp};function Fe(e){return typeof e=="string"?new qe([[document.querySelector(e)]],[document.documentElement]):new qe([[e]],il)}function mp(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Qe(e,t){if(e=mp(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const yp={passive:!1},Fn={capture:!0,passive:!1};function Ai(e){e.stopImmediatePropagation()}function rn(e){e.preventDefault(),e.stopImmediatePropagation()}function ol(e){var t=e.document.documentElement,n=Fe(e).on("dragstart.drag",rn,Fn);"onselectstart"in t?n.on("selectstart.drag",rn,Fn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sl(e,t){var n=e.document.documentElement,r=Fe(e).on("dragstart.drag",null);t&&(r.on("click.drag",rn,Fn),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const vr=e=>()=>e;function Yi(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:c,dy:a,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:u}})}Yi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vp(e){return!e.ctrlKey&&!e.button}function xp(){return this.parentNode}function wp(e,t){return t??{x:e.x,y:e.y}}function bp(){return navigator.maxTouchPoints||"ontouchstart"in this}function al(){var e=vp,t=xp,n=wp,r=bp,i={},o=ei("start","drag","end"),s=0,l,c,a,u,f=0;function d(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",v).on("touchmove.drag",w,yp).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,p){if(!(u||!e.call(this,_,p))){var k=y(this,t.call(this,_,p),_,p,"mouse");k&&(Fe(_.view).on("mousemove.drag",g,Fn).on("mouseup.drag",m,Fn),ol(_.view),Ai(_),a=!1,l=_.clientX,c=_.clientY,k("start",_))}}function g(_){if(rn(_),!a){var p=_.clientX-l,k=_.clientY-c;a=p*p+k*k>f}i.mouse("drag",_)}function m(_){Fe(_.view).on("mousemove.drag mouseup.drag",null),sl(_.view,a),rn(_),i.mouse("end",_)}function v(_,p){if(e.call(this,_,p)){var k=_.changedTouches,S=t.call(this,_,p),N=k.length,R,H;for(R=0;R<N;++R)(H=y(this,S,_,p,k[R].identifier,k[R]))&&(Ai(_),H("start",_,k[R]))}}function w(_){var p=_.changedTouches,k=p.length,S,N;for(S=0;S<k;++S)(N=i[p[S].identifier])&&(rn(_),N("drag",_,p[S]))}function C(_){var p=_.changedTouches,k=p.length,S,N;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),S=0;S<k;++S)(N=i[p[S].identifier])&&(Ai(_),N("end",_,p[S]))}function y(_,p,k,S,N,R){var H=o.copy(),$=Qe(R||k,p),z,O,b;if((b=n.call(_,new Yi("beforestart",{sourceEvent:k,target:d,identifier:N,active:s,x:$[0],y:$[1],dx:0,dy:0,dispatch:H}),S))!=null)return z=b.x-$[0]||0,O=b.y-$[1]||0,function M(j,D,I){var P=$,x;switch(j){case"start":i[N]=M,x=s++;break;case"end":delete i[N],--s;case"drag":$=Qe(I||D,p),x=s;break}H.call(j,_,new Yi(j,{sourceEvent:D,subject:b,target:d,identifier:N,active:x,x:$[0]+z,y:$[1]+O,dx:$[0]-P[0],dy:$[1]-P[1],dispatch:H}),S)}}return d.filter=function(_){return arguments.length?(e=typeof _=="function"?_:vr(!!_),d):e},d.container=function(_){return arguments.length?(t=typeof _=="function"?_:vr(_),d):t},d.subject=function(_){return arguments.length?(n=typeof _=="function"?_:vr(_),d):n},d.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:vr(!!_),d):r},d.on=function(){var _=o.on.apply(o,arguments);return _===o?d:_},d.clickDistance=function(_){return arguments.length?(f=(_=+_)*_,d):Math.sqrt(f)},d}function bo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ll(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function er(){}var qn=.7,Lr=1/qn,on="\\s*([+-]?\\d+)\\s*",Xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kp=/^#([0-9a-f]{3,8})$/,_p=new RegExp(`^rgb\\(${on},${on},${on}\\)$`),Ep=new RegExp(`^rgb\\(${st},${st},${st}\\)$`),Sp=new RegExp(`^rgba\\(${on},${on},${on},${Xn}\\)$`),Cp=new RegExp(`^rgba\\(${st},${st},${st},${Xn}\\)$`),Np=new RegExp(`^hsl\\(${Xn},${st},${st}\\)$`),Tp=new RegExp(`^hsla\\(${Xn},${st},${st},${Xn}\\)$`),bs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};bo(er,zt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ks,formatHex:ks,formatHex8:Ap,formatHsl:Mp,formatRgb:_s,toString:_s});function ks(){return this.rgb().formatHex()}function Ap(){return this.rgb().formatHex8()}function Mp(){return cl(this).formatHsl()}function _s(){return this.rgb().formatRgb()}function zt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=kp.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Es(t):n===3?new Le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_p.exec(e))?new Le(t[1],t[2],t[3],1):(t=Ep.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sp.exec(e))?xr(t[1],t[2],t[3],t[4]):(t=Cp.exec(e))?xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Np.exec(e))?Ns(t[1],t[2]/100,t[3]/100,1):(t=Tp.exec(e))?Ns(t[1],t[2]/100,t[3]/100,t[4]):bs.hasOwnProperty(e)?Es(bs[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function Es(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function xr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Le(e,t,n,r)}function jp(e){return e instanceof er||(e=zt(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function Gi(e,t,n,r){return arguments.length===1?jp(e):new Le(e,t,n,r??1)}function Le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bo(Le,Gi,ll(er,{brighter(e){return e=e==null?Lr:Math.pow(Lr,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qn:Math.pow(qn,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le($t(this.r),$t(this.g),$t(this.b),zr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ss,formatHex:Ss,formatHex8:Rp,formatRgb:Cs,toString:Cs}));function Ss(){return`#${Rt(this.r)}${Rt(this.g)}${Rt(this.b)}`}function Rp(){return`#${Rt(this.r)}${Rt(this.g)}${Rt(this.b)}${Rt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cs(){const e=zr(this.opacity);return`${e===1?"rgb(":"rgba("}${$t(this.r)}, ${$t(this.g)}, ${$t(this.b)}${e===1?")":`, ${e})`}`}function zr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $t(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Rt(e){return e=$t(e),(e<16?"0":"")+e.toString(16)}function Ns(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Je(e,t,n,r)}function cl(e){if(e instanceof Je)return new Je(e.h,e.s,e.l,e.opacity);if(e instanceof er||(e=zt(e)),!e)return new Je;if(e instanceof Je)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Je(s,l,c,e.opacity)}function Dp(e,t,n,r){return arguments.length===1?cl(e):new Je(e,t,n,r??1)}function Je(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bo(Je,Dp,ll(er,{brighter(e){return e=e==null?Lr:Math.pow(Lr,e),new Je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qn:Math.pow(qn,e),new Je(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Le(Mi(e>=240?e-240:e+120,i,r),Mi(e,i,r),Mi(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Je(Ts(this.h),wr(this.s),wr(this.l),zr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zr(this.opacity);return`${e===1?"hsl(":"hsla("}${Ts(this.h)}, ${wr(this.s)*100}%, ${wr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ts(e){return e=(e||0)%360,e<0?e+360:e}function wr(e){return Math.max(0,Math.min(1,e||0))}function Mi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ko=e=>()=>e;function Pp(e,t){return function(n){return e+n*t}}function Op(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function $p(e){return(e=+e)==1?ul:function(t,n){return n-t?Op(t,n,e):ko(isNaN(t)?n:t)}}function ul(e,t){var n=t-e;return n?Pp(e,n):ko(isNaN(e)?t:e)}const Hr=function e(t){var n=$p(t);function r(i,o){var s=n((i=Gi(i)).r,(o=Gi(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),a=ul(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=a(u),i+""}}return r.gamma=e,r}(1);function Ip(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function Lp(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zp(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Vn(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function Hp(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function it(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vp(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Vn(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Ui=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ji=new RegExp(Ui.source,"g");function Bp(e){return function(){return e}}function Fp(e){return function(t){return e(t)+""}}function dl(e,t){var n=Ui.lastIndex=ji.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Ui.exec(e))&&(i=ji.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:it(r,i)})),n=ji.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?Fp(c[0].x):Bp(t):(t=c.length,function(a){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(a);return l.join("")})}function Vn(e,t){var n=typeof t,r;return t==null||n==="boolean"?ko(t):(n==="number"?it:n==="string"?(r=zt(t))?(t=r,Hr):dl:t instanceof zt?Hr:t instanceof Date?Hp:Lp(t)?Ip:Array.isArray(t)?zp:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vp:it)(e,t)}var As=180/Math.PI,Wi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fl(e,t,n,r,i,o){var s,l,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*As,skewX:Math.atan(c)*As,scaleX:s,scaleY:l}}var br;function qp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wi:fl(t.a,t.b,t.c,t.d,t.e,t.f)}function Xp(e){return e==null||(br||(br=document.createElementNS("http://www.w3.org/2000/svg","g")),br.setAttribute("transform",e),!(e=br.transform.baseVal.consolidate()))?Wi:(e=e.matrix,fl(e.a,e.b,e.c,e.d,e.e,e.f))}function hl(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function o(a,u,f,d,h,g){if(a!==f||u!==d){var m=h.push("translate(",null,t,null,n);g.push({i:m-4,x:it(a,f)},{i:m-2,x:it(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(a,u,f,d){a!==u?(a-u>180?u+=360:u-a>180&&(a+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:it(a,u)})):u&&f.push(i(f)+"rotate("+u+r)}function l(a,u,f,d){a!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:it(a,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(a,u,f,d,h,g){if(a!==f||u!==d){var m=h.push(i(h)+"scale(",null,",",null,")");g.push({i:m-4,x:it(a,f)},{i:m-2,x:it(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(a,u){var f=[],d=[];return a=e(a),u=e(u),o(a.translateX,a.translateY,u.translateX,u.translateY,f,d),s(a.rotate,u.rotate,f,d),l(a.skewX,u.skewX,f,d),c(a.scaleX,a.scaleY,u.scaleX,u.scaleY,f,d),a=u=null,function(h){for(var g=-1,m=d.length,v;++g<m;)f[(v=d[g]).i]=v.x(h);return f.join("")}}}var Yp=hl(qp,"px, ","px)","deg)"),Gp=hl(Xp,", ",")",")"),Up=1e-12;function Ms(e){return((e=Math.exp(e))+1/e)/2}function Wp(e){return((e=Math.exp(e))-1/e)/2}function Kp(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ar=function e(t,n,r){function i(o,s){var l=o[0],c=o[1],a=o[2],u=s[0],f=s[1],d=s[2],h=u-l,g=f-c,m=h*h+g*g,v,w;if(m<Up)w=Math.log(d/a)/t,v=function(S){return[l+S*h,c+S*g,a*Math.exp(t*S*w)]};else{var C=Math.sqrt(m),y=(d*d-a*a+r*m)/(2*a*n*C),_=(d*d-a*a-r*m)/(2*d*n*C),p=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(_*_+1)-_);w=(k-p)/t,v=function(S){var N=S*w,R=Ms(p),H=a/(n*C)*(R*Kp(t*N+p)-Wp(p));return[l+H*h,c+H*g,a*R/Ms(t*N+p)]}}return v.duration=w*1e3*t/Math.SQRT2,v}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,c=l*l;return e(s,l,c)},i}(Math.SQRT2,2,4);var an=0,In=0,Rn=0,pl=1e3,Vr,Ln,Br=0,Ht=0,ni=0,Yn=typeof performance=="object"&&performance.now?performance:Date,gl=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _o(){return Ht||(gl(Zp),Ht=Yn.now()+ni)}function Zp(){Ht=0}function Fr(){this._call=this._time=this._next=null}Fr.prototype=ml.prototype={constructor:Fr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_o():+n)+(t==null?0:+t),!this._next&&Ln!==this&&(Ln?Ln._next=this:Vr=this,Ln=this),this._call=e,this._time=n,Ki()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ki())}};function ml(e,t,n){var r=new Fr;return r.restart(e,t,n),r}function Qp(){_o(),++an;for(var e=Vr,t;e;)(t=Ht-e._time)>=0&&e._call.call(void 0,t),e=e._next;--an}function js(){Ht=(Br=Yn.now())+ni,an=In=0;try{Qp()}finally{an=0,e0(),Ht=0}}function Jp(){var e=Yn.now(),t=e-Br;t>pl&&(ni-=t,Br=e)}function e0(){for(var e,t=Vr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Vr=n);Ln=e,Ki(r)}function Ki(e){if(!an){In&&(In=clearTimeout(In));var t=e-Ht;t>24?(e<1/0&&(In=setTimeout(js,e-Yn.now()-ni)),Rn&&(Rn=clearInterval(Rn))):(Rn||(Br=Yn.now(),Rn=setInterval(Jp,pl)),an=1,gl(js))}}function Rs(e,t,n){var r=new Fr;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var t0=ei("start","end","cancel","interrupt"),n0=[],yl=0,Ds=1,Zi=2,Mr=3,Ps=4,Qi=5,jr=6;function ri(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;r0(e,n,{name:t,index:r,group:i,on:t0,tween:n0,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:yl})}function Eo(e,t){var n=tt(e,t);if(n.state>yl)throw new Error("too late; already scheduled");return n}function lt(e,t){var n=tt(e,t);if(n.state>Mr)throw new Error("too late; already running");return n}function tt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function r0(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ml(o,0,n.time);function o(a){n.state=Ds,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var u,f,d,h;if(n.state!==Ds)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Mr)return Rs(s);h.state===Ps?(h.state=jr,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=jr,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(Rs(function(){n.state===Mr&&(n.state=Ps,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=Zi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Zi){for(n.state=Mr,i=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function l(a){for(var u=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(c),n.state=Qi,1),f=-1,d=i.length;++f<d;)i[f].call(e,u);n.state===Qi&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=jr,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Rr(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Zi&&r.state<Qi,r.state=jr,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function i0(e){return this.each(function(){Rr(this,e)})}function o0(e,t){var n,r;return function(){var i=lt(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function s0(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=lt(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var l={name:t,value:n},c=0,a=i.length;c<a;++c)if(i[c].name===t){i[c]=l;break}c===a&&i.push(l)}o.tween=i}}function a0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=tt(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?o0:s0)(n,e,t))}function So(e,t,n){var r=e._id;return e.each(function(){var i=lt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return tt(i,r).value[t]}}function vl(e,t){var n;return(typeof t=="number"?it:t instanceof zt?Hr:(n=zt(t))?(t=n,Hr):dl)(e,t)}function l0(e){return function(){this.removeAttribute(e)}}function c0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function u0(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function d0(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function f0(e,t,n){var r,i,o;return function(){var s,l=n(this),c;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=l+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l)))}}function h0(e,t,n){var r,i,o;return function(){var s,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=l+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l)))}}function p0(e,t){var n=ti(e),r=n==="transform"?Gp:vl;return this.attrTween(e,typeof t=="function"?(n.local?h0:f0)(n,r,So(this,"attr."+e,t)):t==null?(n.local?c0:l0)(n):(n.local?d0:u0)(n,r,t))}function g0(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function m0(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function y0(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&m0(e,o)),n}return i._value=t,i}function v0(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&g0(e,o)),n}return i._value=t,i}function x0(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ti(e);return this.tween(n,(r.local?y0:v0)(r,t))}function w0(e,t){return function(){Eo(this,e).delay=+t.apply(this,arguments)}}function b0(e,t){return t=+t,function(){Eo(this,e).delay=t}}function k0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?w0:b0)(t,e)):tt(this.node(),t).delay}function _0(e,t){return function(){lt(this,e).duration=+t.apply(this,arguments)}}function E0(e,t){return t=+t,function(){lt(this,e).duration=t}}function S0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_0:E0)(t,e)):tt(this.node(),t).duration}function C0(e,t){if(typeof t!="function")throw new Error;return function(){lt(this,e).ease=t}}function N0(e){var t=this._id;return arguments.length?this.each(C0(t,e)):tt(this.node(),t).ease}function T0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;lt(this,e).ease=n}}function A0(e){if(typeof e!="function")throw new Error;return this.each(T0(this._id,e))}function M0(e){typeof e!="function"&&(e=Wa(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],c,a=0;a<s;++a)(c=o[a])&&e.call(c,c.__data__,a,o)&&l.push(c);return new yt(r,this._parents,this._name,this._id)}function j0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),l=0;l<o;++l)for(var c=t[l],a=n[l],u=c.length,f=s[l]=new Array(u),d,h=0;h<u;++h)(d=c[h]||a[h])&&(f[h]=d);for(;l<r;++l)s[l]=t[l];return new yt(s,this._parents,this._name,this._id)}function R0(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function D0(e,t,n){var r,i,o=R0(t)?Eo:lt;return function(){var s=o(this,e),l=s.on;l!==r&&(i=(r=l).copy()).on(t,n),s.on=i}}function P0(e,t){var n=this._id;return arguments.length<2?tt(this.node(),n).on.on(e):this.each(D0(n,e,t))}function O0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $0(){return this.on("end.remove",O0(this._id))}function I0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xo(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var l=r[s],c=l.length,a=o[s]=new Array(c),u,f,d=0;d<c;++d)(u=l[d])&&(f=e.call(u,u.__data__,d,l))&&("__data__"in u&&(f.__data__=u.__data__),a[d]=f,ri(a[d],t,n,d,a,tt(u,n)));return new yt(o,this._parents,t,n)}function L0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ua(e));for(var r=this._groups,i=r.length,o=[],s=[],l=0;l<i;++l)for(var c=r[l],a=c.length,u,f=0;f<a;++f)if(u=c[f]){for(var d=e.call(u,u.__data__,f,c),h,g=tt(u,n),m=0,v=d.length;m<v;++m)(h=d[m])&&ri(h,t,n,m,d,g);o.push(d),s.push(u)}return new yt(o,s,t,n)}var z0=Jn.prototype.constructor;function H0(){return new z0(this._groups,this._parents)}function V0(e,t){var n,r,i;return function(){var o=sn(this,e),s=(this.style.removeProperty(e),sn(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function xl(e){return function(){this.style.removeProperty(e)}}function B0(e,t,n){var r,i=n+"",o;return function(){var s=sn(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function F0(e,t,n){var r,i,o;return function(){var s=sn(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),sn(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,l))}}function q0(e,t){var n,r,i,o="style."+t,s="end."+o,l;return function(){var c=lt(this,e),a=c.on,u=c.value[o]==null?l||(l=xl(t)):void 0;(a!==n||i!==u)&&(r=(n=a).copy()).on(s,i=u),c.on=r}}function X0(e,t,n){var r=(e+="")=="transform"?Yp:vl;return t==null?this.styleTween(e,V0(e,r)).on("end.style."+e,xl(e)):typeof t=="function"?this.styleTween(e,F0(e,r,So(this,"style."+e,t))).each(q0(this._id,e)):this.styleTween(e,B0(e,r,t),n).on("end.style."+e,null)}function Y0(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function G0(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Y0(e,s,n)),r}return o._value=t,o}function U0(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,G0(e,t,n??""))}function W0(e){return function(){this.textContent=e}}function K0(e){return function(){var t=e(this);this.textContent=t??""}}function Z0(e){return this.tween("text",typeof e=="function"?K0(So(this,"text",e)):W0(e==null?"":e+""))}function Q0(e){return function(t){this.textContent=e.call(this,t)}}function J0(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Q0(i)),t}return r._value=e,r}function eg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,J0(e))}function tg(){for(var e=this._name,t=this._id,n=wl(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,c,a=0;a<l;++a)if(c=s[a]){var u=tt(c,t);ri(c,e,n,a,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yt(r,this._parents,e,n)}function ng(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var l={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var a=lt(this,r),u=a.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),a.on=t}),i===0&&o()})}var rg=0;function yt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function wl(){return++rg}var ht=Jn.prototype;yt.prototype={constructor:yt,select:I0,selectAll:L0,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:M0,merge:j0,selection:H0,transition:tg,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:P0,attr:p0,attrTween:x0,style:X0,styleTween:U0,text:Z0,textTween:eg,remove:$0,tween:a0,delay:k0,duration:S0,ease:N0,easeVarying:A0,end:ng,[Symbol.iterator]:ht[Symbol.iterator]};function ig(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var og={time:null,delay:0,duration:250,ease:ig};function sg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ag(e){var t,n;e instanceof yt?(t=e._id,e=e._name):(t=wl(),(n=og).time=_o(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,c,a=0;a<l;++a)(c=s[a])&&ri(c,e,t,a,s,n||sg(c,t));return new yt(r,this._parents,e,t)}Jn.prototype.interrupt=i0;Jn.prototype.transition=ag;const kr=e=>()=>e;function lg(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function mt(e,t,n){this.k=e,this.x=t,this.y=n}mt.prototype={constructor:mt,scale:function(e){return e===1?this:new mt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new mt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ii=new mt(1,0,0);bl.prototype=mt.prototype;function bl(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ii;return e.__zoom}function Ri(e){e.stopImmediatePropagation()}function Dn(e){e.preventDefault(),e.stopImmediatePropagation()}function cg(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ug(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Os(){return this.__zoom||ii}function dg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fg(){return navigator.maxTouchPoints||"ontouchstart"in this}function hg(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function kl(){var e=cg,t=ug,n=hg,r=dg,i=fg,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ar,a=ei("start","zoom","end"),u,f,d,h=500,g=150,m=0,v=10;function w(b){b.property("__zoom",Os).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",H).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(b,M,j,D){var I=b.selection?b.selection():b;I.property("__zoom",Os),b!==I?p(b,M,j,D):I.interrupt().each(function(){k(this,arguments).event(D).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},w.scaleBy=function(b,M,j,D){w.scaleTo(b,function(){var I=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return I*P},j,D)},w.scaleTo=function(b,M,j,D){w.transform(b,function(){var I=t.apply(this,arguments),P=this.__zoom,x=j==null?_(I):typeof j=="function"?j.apply(this,arguments):j,T=P.invert(x),L=typeof M=="function"?M.apply(this,arguments):M;return n(y(C(P,L),x,T),I,s)},j,D)},w.translateBy=function(b,M,j,D){w.transform(b,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof j=="function"?j.apply(this,arguments):j),t.apply(this,arguments),s)},null,D)},w.translateTo=function(b,M,j,D,I){w.transform(b,function(){var P=t.apply(this,arguments),x=this.__zoom,T=D==null?_(P):typeof D=="function"?D.apply(this,arguments):D;return n(ii.translate(T[0],T[1]).scale(x.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof j=="function"?-j.apply(this,arguments):-j),P,s)},D,I)};function C(b,M){return M=Math.max(o[0],Math.min(o[1],M)),M===b.k?b:new mt(M,b.x,b.y)}function y(b,M,j){var D=M[0]-j[0]*b.k,I=M[1]-j[1]*b.k;return D===b.x&&I===b.y?b:new mt(b.k,D,I)}function _(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function p(b,M,j,D){b.on("start.zoom",function(){k(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(D).end()}).tween("zoom",function(){var I=this,P=arguments,x=k(I,P).event(D),T=t.apply(I,P),L=j==null?_(T):typeof j=="function"?j.apply(I,P):j,V=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),B=I.__zoom,X=typeof M=="function"?M.apply(I,P):M,F=c(B.invert(L).concat(V/B.k),X.invert(L).concat(V/X.k));return function(G){if(G===1)G=X;else{var q=F(G),K=V/q[2];G=new mt(K,L[0]-q[0]*K,L[1]-q[1]*K)}x.zoom(null,G)}})}function k(b,M,j){return!j&&b.__zooming||new S(b,M)}function S(b,M){this.that=b,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,M),this.taps=0}S.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,M){return this.mouse&&b!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var M=Fe(this.that).datum();a.call(b,this.that,new lg(b,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:a}),M)}};function N(b,...M){if(!e.apply(this,arguments))return;var j=k(this,M).event(b),D=this.__zoom,I=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),P=Qe(b);if(j.wheel)(j.mouse[0][0]!==P[0]||j.mouse[0][1]!==P[1])&&(j.mouse[1]=D.invert(j.mouse[0]=P)),clearTimeout(j.wheel);else{if(D.k===I)return;j.mouse=[P,D.invert(P)],Rr(this),j.start()}Dn(b),j.wheel=setTimeout(x,g),j.zoom("mouse",n(y(C(D,I),j.mouse[0],j.mouse[1]),j.extent,s));function x(){j.wheel=null,j.end()}}function R(b,...M){if(d||!e.apply(this,arguments))return;var j=b.currentTarget,D=k(this,M,!0).event(b),I=Fe(b.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",V,!0),P=Qe(b,j),x=b.clientX,T=b.clientY;ol(b.view),Ri(b),D.mouse=[P,this.__zoom.invert(P)],Rr(this),D.start();function L(B){if(Dn(B),!D.moved){var X=B.clientX-x,F=B.clientY-T;D.moved=X*X+F*F>m}D.event(B).zoom("mouse",n(y(D.that.__zoom,D.mouse[0]=Qe(B,j),D.mouse[1]),D.extent,s))}function V(B){I.on("mousemove.zoom mouseup.zoom",null),sl(B.view,D.moved),Dn(B),D.event(B).end()}}function H(b,...M){if(e.apply(this,arguments)){var j=this.__zoom,D=Qe(b.changedTouches?b.changedTouches[0]:b,this),I=j.invert(D),P=j.k*(b.shiftKey?.5:2),x=n(y(C(j,P),D,I),t.apply(this,M),s);Dn(b),l>0?Fe(this).transition().duration(l).call(p,x,D,b):Fe(this).call(w.transform,x,D,b)}}function $(b,...M){if(e.apply(this,arguments)){var j=b.touches,D=j.length,I=k(this,M,b.changedTouches.length===D).event(b),P,x,T,L;for(Ri(b),x=0;x<D;++x)T=j[x],L=Qe(T,this),L=[L,this.__zoom.invert(L),T.identifier],I.touch0?!I.touch1&&I.touch0[2]!==L[2]&&(I.touch1=L,I.taps=0):(I.touch0=L,P=!0,I.taps=1+!!u);u&&(u=clearTimeout(u)),P&&(I.taps<2&&(f=L[0],u=setTimeout(function(){u=null},h)),Rr(this),I.start())}}function z(b,...M){if(this.__zooming){var j=k(this,M).event(b),D=b.changedTouches,I=D.length,P,x,T,L;for(Dn(b),P=0;P<I;++P)x=D[P],T=Qe(x,this),j.touch0&&j.touch0[2]===x.identifier?j.touch0[0]=T:j.touch1&&j.touch1[2]===x.identifier&&(j.touch1[0]=T);if(x=j.that.__zoom,j.touch1){var V=j.touch0[0],B=j.touch0[1],X=j.touch1[0],F=j.touch1[1],G=(G=X[0]-V[0])*G+(G=X[1]-V[1])*G,q=(q=F[0]-B[0])*q+(q=F[1]-B[1])*q;x=C(x,Math.sqrt(G/q)),T=[(V[0]+X[0])/2,(V[1]+X[1])/2],L=[(B[0]+F[0])/2,(B[1]+F[1])/2]}else if(j.touch0)T=j.touch0[0],L=j.touch0[1];else return;j.zoom("touch",n(y(x,T,L),j.extent,s))}}function O(b,...M){if(this.__zooming){var j=k(this,M).event(b),D=b.changedTouches,I=D.length,P,x;for(Ri(b),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),P=0;P<I;++P)x=D[P],j.touch0&&j.touch0[2]===x.identifier?delete j.touch0:j.touch1&&j.touch1[2]===x.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(x=Qe(x,this),Math.hypot(f[0]-x[0],f[1]-x[1])<v)){var T=Fe(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return w.wheelDelta=function(b){return arguments.length?(r=typeof b=="function"?b:kr(+b),w):r},w.filter=function(b){return arguments.length?(e=typeof b=="function"?b:kr(!!b),w):e},w.touchable=function(b){return arguments.length?(i=typeof b=="function"?b:kr(!!b),w):i},w.extent=function(b){return arguments.length?(t=typeof b=="function"?b:kr([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),w):t},w.scaleExtent=function(b){return arguments.length?(o[0]=+b[0],o[1]=+b[1],w):[o[0],o[1]]},w.translateExtent=function(b){return arguments.length?(s[0][0]=+b[0][0],s[1][0]=+b[1][0],s[0][1]=+b[0][1],s[1][1]=+b[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(b){return arguments.length?(n=b,w):n},w.duration=function(b){return arguments.length?(l=+b,w):l},w.interpolate=function(b){return arguments.length?(c=b,w):c},w.on=function(){var b=a.on.apply(a,arguments);return b===a?w:b},w.clickDistance=function(b){return arguments.length?(m=(b=+b)*b,w):Math.sqrt(m)},w.tapDistance=function(b){return arguments.length?(v=+b,w):v},w}const at={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Gn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_l=["Enter"," ","Escape"],El={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ln;(function(e){e.Strict="strict",e.Loose="loose"})(ln||(ln={}));var It;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(It||(It={}));var Un;(function(e){e.Partial="partial",e.Full="full"})(Un||(Un={}));const Sl={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Et;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Et||(Et={}));var qr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qr||(qr={}));var te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(te||(te={}));const $s={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top};function Cl(e){return e===null?null:e?"valid":"invalid"}const Nl=e=>"id"in e&&"source"in e&&"target"in e,pg=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Co=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),tr=(e,t=[0,0])=>{const{width:n,height:r}=vt(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},gg=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):Co(i)?i:t.nodeLookup.get(i.id));const l=s?Xr(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oi(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return si(n)},nr=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=Xr(r);n=oi(n,i)}}),si(n)},No=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const l={...rr(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const a of e.values()){const{measured:u,selectable:f=!0,hidden:d=!1}=a;if(s&&!f||d)continue;const h=u.width??a.width??a.initialWidth??null,g=u.height??a.height??a.initialHeight??null,m=Wn(l,un(a)),v=(h??0)*(g??0),w=o&&m>0;(!a.internals.handleBounds||w||m>=v||a.dragging)&&c.push(a)}return c},mg=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function yg(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function vg({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const l=yg(e,s),c=nr(l),a=To(c,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(a,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Tl({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:c,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},u=s.origin??r;let f=i;if(s.extent==="parent"&&!s.expandParent)if(!l)o==null||o("005",at.error005());else{const h=l.measured.width,g=l.measured.height;h&&g&&(f=[[c,a],[c+h,a+g]])}else l&&dn(s.extent)&&(f=[[s.extent[0][0]+c,s.extent[0][1]+a],[s.extent[1][0]+c,s.extent[1][1]+a]]);const d=dn(f)?Vt(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",at.error015())),{position:{x:d.x-c+(s.measured.width??0)*u[0],y:d.y-a+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function xg({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=o.has(d.id),g=!h&&d.parentId&&s.find(m=>m.id===d.parentId);(h||g)&&s.push(d)}const l=new Set(t.map(d=>d.id)),c=r.filter(d=>d.deletable!==!1),u=mg(s,c);for(const d of c)l.has(d.id)&&!u.find(g=>g.id===d.id)&&u.push(d);if(!i)return{edges:u,nodes:s};const f=await i({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const cn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vt=(e={x:0,y:0},t,n)=>({x:cn(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:cn(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Al(e,t,n){const{width:r,height:i}=vt(n),{x:o,y:s}=n.internals.positionAbsolute;return Vt(e,[[o,s],[o+r,s+i]],t)}const Is=(e,t,n)=>e<t?cn(Math.abs(e-t),1,t)/t:e>n?-cn(Math.abs(e-n),1,t)/t:0,Ml=(e,t,n=15,r=40)=>{const i=Is(e.x,r,t.width-r)*n,o=Is(e.y,r,t.height-r)*n;return[i,o]},oi=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ji=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),si=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),un=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Co(e)?e.internals.positionAbsolute:tr(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Xr=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Co(e)?e.internals.positionAbsolute:tr(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},jl=(e,t)=>si(oi(Ji(e),Ji(t))),Wn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ls=e=>et(e.width)&&et(e.height)&&et(e.x)&&et(e.y),et=e=>!isNaN(e)&&isFinite(e),wg=(e,t)=>{},ai=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),rr=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?ai(l,s):l},Yr=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Jt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function bg(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Jt(e,n),i=Jt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Jt(e.top??e.y??0,n),i=Jt(e.bottom??e.y??0,n),o=Jt(e.left??e.x??0,t),s=Jt(e.right??e.x??0,t);return{top:r,right:s,bottom:i,left:o,x:o+s,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function kg(e,t,n,r,i,o){const{x:s,y:l}=Yr(e,[t,n,r]),{x:c,y:a}=Yr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,f=o-a;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(f)}}const To=(e,t,n,r,i,o)=>{const s=bg(o,t,n),l=(t-s.x)/e.width,c=(n-s.y)/e.height,a=Math.min(l,c),u=cn(a,r,i),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,g=n/2-d*u,m=kg(e,h,g,u,t,n),v={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:h-v.left+v.right,y:g-v.top+v.bottom,zoom:u}},Gr=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function dn(e){return e!==void 0&&e!=="parent"}function vt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Rl(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Dl(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const l=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function zs(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function _g(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Eg(e){return{...El,...e||{}}}function Bn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=ot(e),l=rr({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:c,y:a}=n?ai(l,t):l;return{xSnapped:c,ySnapped:a,...l}}const Ao=e=>({width:e.offsetWidth,height:e.offsetHeight}),Pl=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Sg=["INPUT","SELECT","TEXTAREA"];function Ol(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Sg.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const $l=e=>"clientX"in e,ot=(e,t)=>{var o,s;const n=$l(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Hs=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Ao(s)}})};function Il({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:l}){const c=e*.125+i*.375+s*.375+n*.125,a=t*.125+o*.375+l*.375+r*.125,u=Math.abs(c-e),f=Math.abs(a-t);return[c,a,u,f]}function _r(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Vs({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case te.Left:return[t-_r(t-r,o),n];case te.Right:return[t+_r(r-t,o),n];case te.Top:return[t,n-_r(n-i,o)];case te.Bottom:return[t,n+_r(i-n,o)]}}function Ll({sourceX:e,sourceY:t,sourcePosition:n=te.Bottom,targetX:r,targetY:i,targetPosition:o=te.Top,curvature:s=.25}){const[l,c]=Vs({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[a,u]=Vs({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[f,d,h,g]=Il({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${r},${i}`,f,d,h,g]}function zl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[o,l,i,s]}function Cg({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:i=!1}){if(r!==void 0)return r;const o=i&&n?1e3:0,s=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return o+s}function Ng({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=oi(Xr(e),Xr(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Wn(s,si(o))>0}const Tg=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Ag=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Mg=(e,t)=>{if(!e.source||!e.target)return t;let n;return Nl(e)?n={...e}:n={...e,id:Tg(e)},Ag(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Hl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,l]=zl({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,l]}const Bs={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}},jg=({source:e,sourcePosition:t=te.Bottom,target:n})=>t===te.Left||t===te.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Fs=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Rg({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:r=te.Top,center:i,offset:o}){const s=Bs[t],l=Bs[r],c={x:e.x+s.x*o,y:e.y+s.y*o},a={x:n.x+l.x*o,y:n.y+l.y*o},u=jg({source:c,sourcePosition:t,target:a}),f=u.x!==0?"x":"y",d=u[f];let h=[],g,m;const v={x:0,y:0},w={x:0,y:0},[C,y,_,p]=zl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){g=i.x??C,m=i.y??y;const S=[{x:g,y:c.y},{x:g,y:a.y}],N=[{x:c.x,y:m},{x:a.x,y:m}];s[f]===d?h=f==="x"?S:N:h=f==="x"?N:S}else{const S=[{x:c.x,y:a.y}],N=[{x:a.x,y:c.y}];if(f==="x"?h=s.x===d?N:S:h=s.y===d?S:N,t===r){const O=Math.abs(e[f]-n[f]);if(O<=o){const b=Math.min(o-1,o-O);s[f]===d?v[f]=(c[f]>e[f]?-1:1)*b:w[f]=(a[f]>n[f]?-1:1)*b}}if(t!==r){const O=f==="x"?"y":"x",b=s[f]===l[O],M=c[O]>a[O],j=c[O]<a[O];(s[f]===1&&(!b&&M||b&&j)||s[f]!==1&&(!b&&j||b&&M))&&(h=f==="x"?S:N)}const R={x:c.x+v.x,y:c.y+v.y},H={x:a.x+w.x,y:a.y+w.y},$=Math.max(Math.abs(R.x-h[0].x),Math.abs(H.x-h[0].x)),z=Math.max(Math.abs(R.y-h[0].y),Math.abs(H.y-h[0].y));$>=z?(g=(R.x+H.x)/2,m=h[0].y):(g=h[0].x,m=(R.y+H.y)/2)}return[[e,{x:c.x+v.x,y:c.y+v.y},...h,{x:a.x+w.x,y:a.y+w.y},n],g,m,_,p]}function Dg(e,t,n,r){const i=Math.min(Fs(e,t)/2,Fs(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+i*a},${s}Q ${o},${s} ${o},${s+i*u}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${o},${s+i*c}Q ${o},${s} ${o+i*l},${s}`}function eo({sourceX:e,sourceY:t,sourcePosition:n=te.Bottom,targetX:r,targetY:i,targetPosition:o=te.Top,borderRadius:s=5,centerX:l,centerY:c,offset:a=20}){const[u,f,d,h,g]=Rg({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:c},offset:a});return[u.reduce((v,w,C)=>{let y="";return C>0&&C<u.length-1?y=Dg(u[C-1],w,u[C+1],s):y=`${C===0?"M":"L"}${w.x} ${w.y}`,v+=y,v},""),f,d,h,g]}function qs(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Pg(e){var f;const{sourceNode:t,targetNode:n}=e;if(!qs(t)||!qs(n))return null;const r=t.internals.handleBounds||Xs(t.handles),i=n.internals.handleBounds||Xs(n.handles),o=Ys((r==null?void 0:r.source)??[],e.sourceHandle),s=Ys(e.connectionMode===ln.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(f=e.onError)==null||f.call(e,"008",at.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||te.Bottom,c=(s==null?void 0:s.position)||te.Top,a=Kn(t,o,l),u=Kn(n,s,c);return{sourceX:a.x,sourceY:a.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:c}}function Xs(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Kn(e,t,n=te.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??vt(e);if(r)return{x:i+s/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case te.Top:return{x:i+s/2,y:o};case te.Right:return{x:i+s,y:o+l/2};case te.Bottom:return{x:i+s/2,y:o+l};case te.Left:return{x:i,y:o+l/2}}}function Ys(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function to(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Og(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const a=to(c,t);o.has(a)||(s.push({id:a,color:c.color||n,...c}),o.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Mo={nodeOrigin:[0,0],nodeExtent:Gn,elevateNodesOnSelect:!0,defaults:{}},$g={...Mo,checkEquality:!0};function jo(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Ig(e,t,n){const r=jo(Mo,n);for(const i of e.values())if(i.parentId)Ro(i,e,t,r);else{const o=tr(i,r.nodeOrigin),s=dn(i.extent)?i.extent:r.nodeExtent,l=Vt(o,s,vt(i));i.internals.positionAbsolute=l}}function no(e,t,n,r){var c,a;const i=jo($g,r);let o=e.length>0;const s=new Map(t),l=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(i.checkEquality&&u===(f==null?void 0:f.internals.userNode))t.set(u.id,f);else{const d=tr(u,i.nodeOrigin),h=dn(u.extent)?u.extent:i.nodeExtent,g=Vt(d,h,vt(u));f={...i.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:g,handleBounds:u.measured?f==null?void 0:f.internals.handleBounds:void 0,z:Vl(u,l),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(o=!1),u.parentId&&Ro(f,t,n,r)}return o}function Lg(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ro(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=jo(Mo,r),l=e.parentId,c=t.get(l);if(!c){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Lg(e,n);const a=i?1e3:0,{x:u,y:f,z:d}=zg(e,c,o,s,a),{positionAbsolute:h}=e.internals,g=u!==h.x||f!==h.y;(g||d!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:u,y:f}:h,z:d}})}function Vl(e,t){return(et(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function zg(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,l=vt(e),c=tr(e,n),a=dn(e.extent)?Vt(c,e.extent,l):c;let u=Vt({x:o+a.x,y:s+a.y},r,l);e.extent==="parent"&&(u=Al(u,l,t));const f=Vl(e,i),d=t.internals.z??0;return{x:u.x,y:u.y,z:d>=f?d+1:f}}function Do(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const a=((s=o.get(l.parentId))==null?void 0:s.expandedRect)??un(c),u=jl(a,l.rect);o.set(l.parentId,{expandedRect:u,parent:c})}return o.size>0&&o.forEach(({expandedRect:l,parent:c},a)=>{var y;const u=c.internals.positionAbsolute,f=vt(c),d=c.origin??r,h=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,g=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,m=Math.max(f.width,Math.round(l.width)),v=Math.max(f.height,Math.round(l.height)),w=(m-f.width)*d[0],C=(v-f.height)*d[1];(h>0||g>0||w||C)&&(i.push({id:a,type:"position",position:{x:c.position.x-h+w,y:c.position.y-g+C}}),(y=n.get(a))==null||y.forEach(_=>{e.some(p=>p.id===_.id)||i.push({id:_.id,type:"position",position:{x:_.position.x+h,y:_.position.y+g}})})),(f.width<l.width||f.height<l.height||h||g)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?d[0]*h-w:0),height:v+(g?d[1]*g-C:0)}})}),i}function Hg(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],a=window.getComputedStyle(s),{m22:u}=new window.DOMMatrixReadOnly(a.transform),f=[];for(const d of e.values()){const h=t.get(d.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),l=!0;continue}const g=Ao(d.nodeElement),m=h.measured.width!==g.width||h.measured.height!==g.height;if(!!(g.width&&g.height&&(m||!h.internals.handleBounds||d.force))){const w=d.nodeElement.getBoundingClientRect(),C=dn(h.extent)?h.extent:o;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Al(y,g,t.get(h.parentId)):C&&(y=Vt(y,C,g));const _={...h,measured:g,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:Hs("source",d.nodeElement,w,u,h.id),target:Hs("target",d.nodeElement,w,u,h.id)}}};t.set(h.id,_),h.parentId&&Ro(_,t,n,{nodeOrigin:i}),l=!0,m&&(c.push({id:h.id,type:"dimensions",dimensions:g}),h.expandParent&&h.parentId&&f.push({id:h.id,parentId:h.parentId,rect:un(_,i)}))}}if(f.length>0){const d=Do(f,t,n,i);c.push(...d)}return{changes:c,updatedInternals:l}}async function Vg({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function Gs(e,t,n,r,i,o){let s=i;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${i}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),o){s=`${i}-${e}-${o}`;const a=r.get(s)||new Map;r.set(s,a.set(n,t))}}function Bl(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:l},a=`${i}-${s}--${o}-${l}`,u=`${o}-${l}--${i}-${s}`;Gs("source",c,u,e,i,s),Gs("target",c,a,e,o,l),t.set(r.id,r)}}function Fl(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Fl(n,t):!1}function Us(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Bg(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Fl(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(o);l&&i.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Di({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,c;const i=[];for(const[a,u]of t){const f=(s=n.get(a))==null?void 0:s.internals.userNode;f&&i.push({...f,position:u.position,dragging:r})}if(!e)return[i[0],i];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((c=t.get(e))==null?void 0:c.position)||o.position,dragging:r}:i[0],i]}function Fg({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,l=new Map,c=!1,a={x:0,y:0},u=null,f=!1,d=null,h=!1,g=!1;function m({noDragClassName:w,handleSelector:C,domNode:y,isSelectable:_,nodeId:p,nodeClickDistance:k=0}){d=Fe(y);function S({x:$,y:z},O){const{nodeLookup:b,nodeExtent:M,snapGrid:j,snapToGrid:D,nodeOrigin:I,onNodeDrag:P,onSelectionDrag:x,onError:T,updateNodePositions:L}=t();o={x:$,y:z};let V=!1,B={x:0,y:0,x2:0,y2:0};if(l.size>1&&M){const X=nr(l);B=Ji(X)}for(const[X,F]of l){if(!b.has(X))continue;let G={x:$-F.distance.x,y:z-F.distance.y};D&&(G=ai(G,j));let q=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];if(l.size>1&&M&&!F.extent){const{positionAbsolute:ie}=F.internals,W=ie.x-B.x+M[0][0],Q=ie.x+F.measured.width-B.x2+M[1][0],Z=ie.y-B.y+M[0][1],le=ie.y+F.measured.height-B.y2+M[1][1];q=[[W,Z],[Q,le]]}const{position:K,positionAbsolute:ae}=Tl({nodeId:X,nextPosition:G,nodeLookup:b,nodeExtent:q,nodeOrigin:I,onError:T});V=V||F.position.x!==K.x||F.position.y!==K.y,F.position=K,F.internals.positionAbsolute=ae}if(g=g||V,!!V&&(L(l,!0),O&&(r||P||!p&&x))){const[X,F]=Di({nodeId:p,dragItems:l,nodeLookup:b});r==null||r(O,l,X,F),P==null||P(O,X,F),p||x==null||x(O,F)}}async function N(){if(!u)return;const{transform:$,panBy:z,autoPanSpeed:O,autoPanOnNodeDrag:b}=t();if(!b){c=!1,cancelAnimationFrame(s);return}const[M,j]=Ml(a,u,O);(M!==0||j!==0)&&(o.x=(o.x??0)-M/$[2],o.y=(o.y??0)-j/$[2],await z({x:M,y:j})&&S(o,null)),s=requestAnimationFrame(N)}function R($){var V;const{nodeLookup:z,multiSelectionActive:O,nodesDraggable:b,transform:M,snapGrid:j,snapToGrid:D,selectNodesOnDrag:I,onNodeDragStart:P,onSelectionDragStart:x,unselectNodesAndEdges:T}=t();f=!0,(!I||!_)&&!O&&p&&((V=z.get(p))!=null&&V.selected||T()),_&&I&&p&&(e==null||e(p));const L=Bn($.sourceEvent,{transform:M,snapGrid:j,snapToGrid:D,containerBounds:u});if(o=L,l=Bg(z,b,L,p),l.size>0&&(n||P||!p&&x)){const[B,X]=Di({nodeId:p,dragItems:l,nodeLookup:z});n==null||n($.sourceEvent,l,B,X),P==null||P($.sourceEvent,B,X),p||x==null||x($.sourceEvent,X)}}const H=al().clickDistance(k).on("start",$=>{const{domNode:z,nodeDragThreshold:O,transform:b,snapGrid:M,snapToGrid:j}=t();u=(z==null?void 0:z.getBoundingClientRect())||null,h=!1,g=!1,O===0&&R($),o=Bn($.sourceEvent,{transform:b,snapGrid:M,snapToGrid:j,containerBounds:u}),a=ot($.sourceEvent,u)}).on("drag",$=>{const{autoPanOnNodeDrag:z,transform:O,snapGrid:b,snapToGrid:M,nodeDragThreshold:j,nodeLookup:D}=t(),I=Bn($.sourceEvent,{transform:O,snapGrid:b,snapToGrid:M,containerBounds:u});if(($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||p&&!D.has(p))&&(h=!0),!h){if(!c&&z&&f&&(c=!0,N()),!f){const P=I.xSnapped-(o.x??0),x=I.ySnapped-(o.y??0);Math.sqrt(P*P+x*x)>j&&R($)}(o.x!==I.xSnapped||o.y!==I.ySnapped)&&l&&f&&(a=ot($.sourceEvent,u),S(I,$.sourceEvent))}}).on("end",$=>{if(!(!f||h)&&(c=!1,f=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:z,updateNodePositions:O,onNodeDragStop:b,onSelectionDragStop:M}=t();if(g&&(O(l,!1),g=!1),i||b||!p&&M){const[j,D]=Di({nodeId:p,dragItems:l,nodeLookup:z,dragging:!1});i==null||i($.sourceEvent,l,j,D),b==null||b($.sourceEvent,j,D),p||M==null||M($.sourceEvent,D)}}}).filter($=>{const z=$.target;return!$.button&&(!w||!Us(z,`.${w}`,y))&&(!C||Us(z,C,y))});d.call(H)}function v(){d==null||d.on(".drag",null)}return{update:m,destroy:v}}function qg(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Wn(i,un(o))>0&&r.push(o);return r}const Xg=250;function Yg(e,t,n,r){var l,c;let i=[],o=1/0;const s=qg(e,n,t+Xg);for(const a of s){const u=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((c=a.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:h}=Kn(a,f,f.position,!0),g=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));g>t||(g<o?(i=[{...f,x:d,y:h}],o=g):g===o&&i.push({...f,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(u=>u.type===a)??i[0]}return i[0]}function ql(e,t,n,r,i,o=!1){var a,u,f;const s=r.get(e);if(!s)return null;const l=i==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((u=s.internals.handleBounds)==null?void 0:u.source)??[],...((f=s.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return c&&o?{...c,...Kn(s,c,c.position,!0)}:c}function Xl(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Gg(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Yl=()=>!0;function Ug(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:l,nodeLookup:c,lib:a,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:g,onConnect:m,onConnectEnd:v,isValidConnection:w=Yl,onReconnectEnd:C,updateConnection:y,getTransform:_,getFromHandle:p,autoPanSpeed:k,dragThreshold:S=1}){const N=Pl(e.target);let R=0,H;const{x:$,y:z}=ot(e),O=N==null?void 0:N.elementFromPoint($,z),b=Xl(o,O),M=l==null?void 0:l.getBoundingClientRect();let j=!1;if(!M||!b)return;const D=ql(i,b,r,c,t);if(!D)return;let I=ot(e,M),P=!1,x=null,T=!1,L=null;function V(){if(!u||!M)return;const[ie,W]=Ml(I,M,k);d({x:ie,y:W}),R=requestAnimationFrame(V)}const B={...D,nodeId:i,type:b,position:D.position},X=c.get(i);let G={inProgress:!0,isValid:null,from:Kn(X,B,te.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:X,to:I,toHandle:null,toPosition:$s[B.position],toNode:null};function q(){j=!0,y(G),g==null||g(e,{nodeId:i,handleId:r,handleType:b})}S===0&&q();function K(ie){if(!j){const{x:le,y:J}=ot(ie),fe=le-$,be=J-z;if(!(fe*fe+be*be>S*S))return;q()}if(!p()||!B){ae(ie);return}const W=_();I=ot(ie,M),H=Yg(rr(I,W,!1,[1,1]),n,c,B),P||(V(),P=!0);const Q=Gl(ie,{handle:H,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:N,lib:a,flowId:f,nodeLookup:c});L=Q.handleDomNode,x=Q.connection,T=Gg(!!H,Q.isValid);const Z={...G,isValid:T,to:Q.toHandle&&T?Yr({x:Q.toHandle.x,y:Q.toHandle.y},W):I,toHandle:Q.toHandle,toPosition:T&&Q.toHandle?Q.toHandle.position:$s[B.position],toNode:Q.toHandle?c.get(Q.toHandle.nodeId):null};T&&H&&G.toHandle&&Z.toHandle&&G.toHandle.type===Z.toHandle.type&&G.toHandle.nodeId===Z.toHandle.nodeId&&G.toHandle.id===Z.toHandle.id&&G.to.x===Z.to.x&&G.to.y===Z.to.y||(y(Z),G=Z)}function ae(ie){if(j){(H||L)&&x&&T&&(m==null||m(x));const{inProgress:W,...Q}=G,Z={...Q,toPosition:G.toHandle?G.toPosition:null};v==null||v(ie,Z),o&&(C==null||C(ie,Z))}h(),cancelAnimationFrame(R),P=!1,T=!1,x=null,L=null,N.removeEventListener("mousemove",K),N.removeEventListener("mouseup",ae),N.removeEventListener("touchmove",K),N.removeEventListener("touchend",ae)}N.addEventListener("mousemove",K),N.addEventListener("mouseup",ae),N.addEventListener("touchmove",K),N.addEventListener("touchend",ae)}function Gl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:l,flowId:c,isValidConnection:a=Yl,nodeLookup:u}){const f=o==="target",d=t?s.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:g}=ot(e),m=s.elementFromPoint(h,g),v=m!=null&&m.classList.contains(`${l}-flow__handle`)?m:d,w={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const C=Xl(void 0,v),y=v.getAttribute("data-nodeid"),_=v.getAttribute("data-handleid"),p=v.classList.contains("connectable"),k=v.classList.contains("connectableend");if(!y||!C)return w;const S={source:f?y:r,sourceHandle:f?_:i,target:f?r:y,targetHandle:f?i:_};w.connection=S;const R=p&&k&&(n===ln.Strict?f&&C==="source"||!f&&C==="target":y!==r||_!==i);w.isValid=R&&a(S),w.toHandle=ql(y,C,_,u,n,!0)}return w}const ro={onPointerDown:Ug,isValid:Gl};function Wg({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Fe(e);function o({translateExtent:l,width:c,height:a,zoomStep:u=10,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const g=y=>{const _=n();if(y.sourceEvent.type!=="wheel"||!t)return;const p=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,k=_[2]*Math.pow(2,p);t.scaleTo(k)};let m=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(m=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},w=y=>{const _=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const p=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],k=[p[0]-m[0],p[1]-m[1]];m=p;const S=r()*Math.max(_[2],Math.log(_[2]))*(h?-1:1),N={x:_[0]-k[0]*S,y:_[1]-k[1]*S},R=[[0,0],[c,a]];t.setViewportConstrained({x:N.x,y:N.y,zoom:_[2]},R,l)},C=kl().on("start",v).on("zoom",f?w:null).on("zoom.wheel",d?g:null);i.call(C,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:Qe}}const Kg=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,li=e=>({x:e.x,y:e.y,zoom:e.k}),Pi=({x:e,y:t,zoom:n})=>ii.translate(e,t).scale(n),tn=(e,t)=>e.target.closest(`.${t}`),Ul=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Zg=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Oi=(e,t=0,n=Zg,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Wl=e=>{const t=e.ctrlKey&&Gr()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Qg({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:a}){return u=>{if(tn(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const v=Qe(u),w=Wl(u),C=f*Math.pow(2,w);r.scaleTo(n,C,v,u);return}const d=u.deltaMode===1?20:1;let h=i===It.Vertical?0:u.deltaX*d,g=i===It.Horizontal?0:u.deltaY*d;!Gr()&&u.shiftKey&&i!==It.Vertical&&(h=u.deltaY*d,g=0),r.translateBy(n,-(h/f)*o,-(g/f)*o,{internal:!0});const m=li(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,m)),e.isPanScrolling&&(c==null||c(u,m),e.panScrollTimeout=setTimeout(()=>{a==null||a(u,m),e.isPanScrolling=!1},150))}}function Jg({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",s=!t&&o&&!r.ctrlKey,l=tn(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,i)}}function em({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,l;if((o=r.sourceEvent)!=null&&o.internal)return;const i=li(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function tm({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,l;e.usedRightMouseButton=!!(n&&Ul(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((l=o.sourceEvent)!=null&&l.internal)&&(i==null||i(o.sourceEvent,li(o.transform)))}}function nm({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&Ul(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&Kg(e.prevViewport,s.transform))){const c=li(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,c)},n?150:0)}}}function rm({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:l,noPanClassName:c,lib:a}){return u=>{var g;const f=e||t,d=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(tn(u,`${a}-flow__node`)||tn(u,`${a}-flow__edge`)))return!0;if(!r&&!f&&!i&&!o&&!n||s||tn(u,l)&&u.type==="wheel"||tn(u,c)&&(u.type!=="wheel"||i&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((g=u.touches)==null?void 0:g.length)>1)return u.preventDefault(),!1;if(!f&&!i&&!d&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&h}}function im({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),d=kl().clickDistance(!et(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=Fe(e).call(d);y({x:o.x,y:o.y,zoom:cn(o.zoom,t,n)},[[0,0],[f.width,f.height]],i);const g=h.on("wheel.zoom"),m=h.on("dblclick.zoom");d.wheelDelta(Wl);function v(z,O){return h?new Promise(b=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Vn:Ar).transform(Oi(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>b(!0)),z)}):Promise.resolve(!1)}function w({noWheelClassName:z,noPanClassName:O,onPaneContextMenu:b,userSelectionActive:M,panOnScroll:j,panOnDrag:D,panOnScrollMode:I,panOnScrollSpeed:P,preventScrolling:x,zoomOnPinch:T,zoomOnScroll:L,zoomOnDoubleClick:V,zoomActivationKeyPressed:B,lib:X,onTransformChange:F}){M&&!u.isZoomingOrPanning&&C();const q=j&&!B&&!M?Qg({zoomPanValues:u,noWheelClassName:z,d3Selection:h,d3Zoom:d,panOnScrollMode:I,panOnScrollSpeed:P,zoomOnPinch:T,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):Jg({noWheelClassName:z,preventScrolling:x,d3ZoomHandler:g});if(h.on("wheel.zoom",q,{passive:!1}),!M){const ae=em({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:l});d.on("start",ae);const ie=tm({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!b,onPanZoom:s,onTransformChange:F});d.on("zoom",ie);const W=nm({zoomPanValues:u,panOnDrag:D,panOnScroll:j,onPaneContextMenu:b,onPanZoomEnd:c,onDraggingChange:a});d.on("end",W)}const K=rm({zoomActivationKeyPressed:B,panOnDrag:D,zoomOnScroll:L,panOnScroll:j,zoomOnDoubleClick:V,zoomOnPinch:T,userSelectionActive:M,noPanClassName:O,noWheelClassName:z,lib:X});d.filter(K),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function C(){d.on("zoom",null)}async function y(z,O,b){const M=Pi(z),j=d==null?void 0:d.constrain()(M,O,b);return j&&await v(j),new Promise(D=>D(j))}async function _(z,O){const b=Pi(z);return await v(b,O),new Promise(M=>M(b))}function p(z){if(h){const O=Pi(z),b=h.property("__zoom");(b.k!==z.zoom||b.x!==z.x||b.y!==z.y)&&(d==null||d.transform(h,O,null,{sync:!0}))}}function k(){const z=h?bl(h.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function S(z,O){return h?new Promise(b=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Vn:Ar).scaleTo(Oi(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>b(!0)),z)}):Promise.resolve(!1)}function N(z,O){return h?new Promise(b=>{d==null||d.interpolate((O==null?void 0:O.interpolate)==="linear"?Vn:Ar).scaleBy(Oi(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>b(!0)),z)}):Promise.resolve(!1)}function R(z){d==null||d.scaleExtent(z)}function H(z){d==null||d.translateExtent(z)}function $(z){const O=!et(z)||z<0?0:z;d==null||d.clickDistance(O)}return{update:w,destroy:C,setViewport:_,setViewportConstrained:y,getViewport:k,scaleTo:S,scaleBy:N,setScaleExtent:R,setTranslateExtent:H,syncViewport:p,setClickDistance:$}}var fn;(function(e){e.Line="line",e.Handle="handle"})(fn||(fn={}));function om({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,l=n-r,c=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(c[0]=c[0]*-1),l&&o&&(c[1]=c[1]*-1),c}function sm(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function kt(e,t){return Math.max(0,t-e)}function _t(e,t){return Math.max(0,e-t)}function Er(e,t,n){return Math.max(0,t-e,e-n)}function Ws(e,t){return e?!t:t}function am(e,t,n,r,i,o,s,l){let{affectsX:c,affectsY:a}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:h,ySnapped:g}=n,{minWidth:m,maxWidth:v,minHeight:w,maxHeight:C}=r,{x:y,y:_,width:p,height:k,aspectRatio:S}=e;let N=Math.floor(u?h-e.pointerX:0),R=Math.floor(f?g-e.pointerY:0);const H=p+(c?-N:N),$=k+(a?-R:R),z=-o[0]*p,O=-o[1]*k;let b=Er(H,m,v),M=Er($,w,C);if(s){let I=0,P=0;c&&N<0?I=kt(y+N+z,s[0][0]):!c&&N>0&&(I=_t(y+H+z,s[1][0])),a&&R<0?P=kt(_+R+O,s[0][1]):!a&&R>0&&(P=_t(_+$+O,s[1][1])),b=Math.max(b,I),M=Math.max(M,P)}if(l){let I=0,P=0;c&&N>0?I=_t(y+N,l[0][0]):!c&&N<0&&(I=kt(y+H,l[1][0])),a&&R>0?P=_t(_+R,l[0][1]):!a&&R<0&&(P=kt(_+$,l[1][1])),b=Math.max(b,I),M=Math.max(M,P)}if(i){if(u){const I=Er(H/S,w,C)*S;if(b=Math.max(b,I),s){let P=0;!c&&!a||c&&!a&&d?P=_t(_+O+H/S,s[1][1])*S:P=kt(_+O+(c?N:-N)/S,s[0][1])*S,b=Math.max(b,P)}if(l){let P=0;!c&&!a||c&&!a&&d?P=kt(_+H/S,l[1][1])*S:P=_t(_+(c?N:-N)/S,l[0][1])*S,b=Math.max(b,P)}}if(f){const I=Er($*S,m,v)/S;if(M=Math.max(M,I),s){let P=0;!c&&!a||a&&!c&&d?P=_t(y+$*S+z,s[1][0])/S:P=kt(y+(a?R:-R)*S+z,s[0][0])/S,M=Math.max(M,P)}if(l){let P=0;!c&&!a||a&&!c&&d?P=kt(y+$*S,l[1][0])/S:P=_t(y+(a?R:-R)*S,l[0][0])/S,M=Math.max(M,P)}}}R=R+(R<0?M:-M),N=N+(N<0?b:-b),i&&(d?H>$*S?R=(Ws(c,a)?-N:N)/S:N=(Ws(c,a)?-R:R)*S:u?(R=N/S,a=c):(N=R*S,c=a));const j=c?y+N:y,D=a?_+R:_;return{width:p+(c?-N:N),height:k+(a?-R:R),x:o[0]*N*(c?-1:1)+j,y:o[1]*R*(a?-1:1)+D}}const Kl={width:0,height:0,x:0,y:0},lm={...Kl,pointerX:0,pointerY:0,aspectRatio:1};function cm(e){return[[0,0],[e.measured.width,e.measured.height]]}function um(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,l=n[0]*o,c=n[1]*s;return[[r-l,i-c],[r+o-l,i+s-c]]}function dm({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=Fe(e);function s({controlPosition:c,boundaries:a,keepAspectRatio:u,resizeDirection:f,onResizeStart:d,onResize:h,onResizeEnd:g,shouldResize:m}){let v={...Kl},w={...lm};const C=sm(c);let y,_=null,p=[],k,S,N;const R=al().on("start",H=>{const{nodeLookup:$,transform:z,snapGrid:O,snapToGrid:b,nodeOrigin:M,paneDomNode:j}=n();if(y=$.get(t),!y)return;_=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:I}=Bn(H.sourceEvent,{transform:z,snapGrid:O,snapToGrid:b,containerBounds:_});v={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...v,pointerX:D,pointerY:I,aspectRatio:v.width/v.height},k=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(k=$.get(y.parentId),S=k&&y.extent==="parent"?cm(k):void 0),p=[],N=void 0;for(const[P,x]of $)if(x.parentId===t&&(p.push({id:P,position:{...x.position},extent:x.extent}),x.extent==="parent"||x.expandParent)){const T=um(x,y,x.origin??M);N?N=[[Math.min(T[0][0],N[0][0]),Math.min(T[0][1],N[0][1])],[Math.max(T[1][0],N[1][0]),Math.max(T[1][1],N[1][1])]]:N=T}d==null||d(H,{...v})}).on("drag",H=>{const{transform:$,snapGrid:z,snapToGrid:O,nodeOrigin:b}=n(),M=Bn(H.sourceEvent,{transform:$,snapGrid:z,snapToGrid:O,containerBounds:_}),j=[];if(!y)return;const{x:D,y:I,width:P,height:x}=v,T={},L=y.origin??b,{width:V,height:B,x:X,y:F}=am(w,C,M,a,u,L,S,N),G=V!==P,q=B!==x,K=X!==D&&G,ae=F!==I&&q;if(!K&&!ae&&!G&&!q)return;if((K||ae||L[0]===1||L[1]===1)&&(T.x=K?X:v.x,T.y=ae?F:v.y,v.x=T.x,v.y=T.y,p.length>0)){const Z=X-D,le=F-I;for(const J of p)J.position={x:J.position.x-Z+L[0]*(V-P),y:J.position.y-le+L[1]*(B-x)},j.push(J)}if((G||q)&&(T.width=G&&(!f||f==="horizontal")?V:v.width,T.height=q&&(!f||f==="vertical")?B:v.height,v.width=T.width,v.height=T.height),k&&y.expandParent){const Z=L[0]*(T.width??0);T.x&&T.x<Z&&(v.x=Z,w.x=w.x-(T.x-Z));const le=L[1]*(T.height??0);T.y&&T.y<le&&(v.y=le,w.y=w.y-(T.y-le))}const ie=om({width:v.width,prevWidth:P,height:v.height,prevHeight:x,affectsX:C.affectsX,affectsY:C.affectsY}),W={...v,direction:ie};(m==null?void 0:m(H,W))!==!1&&(h==null||h(H,W),r(T,j))}).on("end",H=>{g==null||g(H,{...v}),i==null||i({...v})});o.call(R)}function l(){o.on(".drag",null)}return{update:s,destroy:l}}var $i={exports:{}},Ii={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ks;function fm(){if(Ks)return Ii;Ks=1;var e=mn(),t=zd();function n(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Ii.useSyncExternalStoreWithSelector=function(a,u,f,d,h){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=l(function(){function w(k){if(!C){if(C=!0,y=k,k=d(k),h!==void 0&&m.hasValue){var S=m.value;if(h(S,k))return _=S}return _=k}if(S=_,r(y,k))return S;var N=d(k);return h!==void 0&&h(S,N)?(y=k,S):(y=k,_=N)}var C=!1,y,_,p=f===void 0?null:f;return[function(){return w(u())},p===null?void 0:function(){return w(p())}]},[u,f,d,h]);var v=i(a,g[0],g[1]);return s(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},Ii}var Zs;function hm(){return Zs||(Zs=1,$i.exports=fm()),$i.exports}var pm=hm();const gm=Zr(pm),mm={},Qs=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,h))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(mm?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,i,c);return c},ym=e=>e?Qs(e):Qs,{useDebugValue:vm}=Aa,{useSyncExternalStoreWithSelector:xm}=gm,wm=e=>e;function Zl(e,t=wm,n){const r=xm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return vm(r),r}const Js=(e,t)=>{const n=ym(e),r=(i,o=t)=>Zl(n,i,o);return Object.assign(r,n),r},bm=(e,t)=>e?Js(e,t):Js;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const ci=A.createContext(null),km=ci.Provider,Ql=at.error001();function de(e,t){const n=A.useContext(ci);if(n===null)throw new Error(Ql);return Zl(n,e,t)}function ke(){const e=A.useContext(ci);if(e===null)throw new Error(Ql);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ea={display:"none"},_m={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Jl="react-flow__node-desc",ec="react-flow__edge-desc",Em="react-flow__aria-live",Sm=e=>e.ariaLiveMessage,Cm=e=>e.ariaLabelConfig;function Nm({rfId:e}){const t=de(Sm);return E.jsx("div",{id:`${Em}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_m,children:t})}function Tm({rfId:e,disableKeyboardA11y:t}){const n=de(Cm);return E.jsxs(E.Fragment,{children:[E.jsx("div",{id:`${Jl}-${e}`,style:ea,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),E.jsx("div",{id:`${ec}-${e}`,style:ea,children:n["edge.a11yDescription.default"]}),!t&&E.jsx(Nm,{rfId:e})]})}const ui=A.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=`${e}`.split("-");return E.jsx("div",{className:Se(["react-flow__panel",n,...s]),style:r,ref:o,...i,children:t})});ui.displayName="Panel";function Am({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:E.jsx(ui,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:E.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Mm=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Sr=e=>e.id;function jm(e,t){return _e(e.selectedNodes.map(Sr),t.selectedNodes.map(Sr))&&_e(e.selectedEdges.map(Sr),t.selectedEdges.map(Sr))}function Rm({onSelectionChange:e}){const t=ke(),{selectedNodes:n,selectedEdges:r}=de(Mm,jm);return A.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const Dm=e=>!!e.onSelectionChangeHandlers;function Pm({onSelectionChange:e}){const t=de(Dm);return e||t?E.jsx(Rm,{onSelectionChange:e}):null}const tc=[0,0],Om={x:0,y:0,zoom:1},$m=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],ta=[...$m,"rfId"],Im=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),na={translateExtent:Gn,nodeOrigin:tc,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Lm(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:a}=de(Im,_e),u=ke();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{f.current=na,l()}),[]);const f=A.useRef(na);return A.useEffect(()=>{for(const d of ta){const h=e[d],g=f.current[d];h!==g&&(typeof e[d]>"u"||(d==="nodes"?t(h):d==="edges"?n(h):d==="minZoom"?r(h):d==="maxZoom"?i(h):d==="translateExtent"?o(h):d==="nodeExtent"?s(h):d==="paneClickDistance"?a(h):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Eg(h)}):d==="fitView"?u.setState({fitViewQueued:h}):d==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[d]:h})))}f.current=e},ta.map(d=>e[d])),null}function ra(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function zm(e){var r;const[t,n]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){n(e);return}const i=ra(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=ra())!=null&&r.matches?"dark":"light"}const ia=typeof document<"u"?document:null;function Zn(e=null,t={target:ia,actInsideInputWithModifier:!0}){const[n,r]=A.useState(!1),i=A.useRef(!1),o=A.useRef(new Set([])),[s,l]=A.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
`).replace(`

`,`
+`).split(`
`)),u=a.reduce((f,d)=>f.concat(...d),[]);return[a,u]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(t==null?void 0:t.target)??ia,a=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const u=h=>{var v,w;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!a)&&Ol(h))return!1;const m=sa(h.code,l);if(o.current.add(h[m]),oa(s,o.current,!1)){const C=((w=(v=h.composedPath)==null?void 0:v.call(h))==null?void 0:w[0])||h.target,y=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&h.preventDefault(),r(!0)}},f=h=>{const g=sa(h.code,l);oa(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[g]),h.key==="Meta"&&o.current.clear(),i.current=!1},d=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function oa(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function sa(e,t){return t.includes(e)?"code":"key"}const Hm=()=>{const e=ke();return A.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:l}=e.getState(),c=To(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:l,y:c}=s.getBoundingClientRect(),a={x:t.x-l,y:t.y-c},u=n.snapGrid??i,f=n.snapToGrid??o;return rr(a,r,f,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=Yr(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function nc(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...o};for(const c of s)Vm(c,l);n.push(l)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function Vm(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function rc(e,t){return nc(e,t)}function ic(e,t){return nc(e,t)}function jt(e,t){return{id:e,type:"select",selected:t}}function nn(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(jt(o.id,s)))}return r}function aa({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const l=t.get(s.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==s&&n.push({id:s.id,item:s,type:"replace"}),c===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function la(e){return{id:e.id,type:"remove"}}const ca=e=>pg(e),Bm=e=>Nl(e);function oc(e){return A.forwardRef(e)}const Fm=typeof window<"u"?A.useLayoutEffect:A.useEffect;function ua(e){const[t,n]=A.useState(BigInt(0)),[r]=A.useState(()=>qm(()=>n(i=>i+BigInt(1))));return Fm(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function qm(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const sc=A.createContext(null);function Xm({children:e}){const t=ke(),n=A.useCallback(l=>{const{nodes:c=[],setNodes:a,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d,fitViewQueued:h}=t.getState();let g=c;for(const v of l)g=typeof v=="function"?v(g):v;const m=aa({items:g,lookup:d});u&&a(g),m.length>0?f==null||f(m):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:C}=t.getState();v&&C(w)})},[]),r=ua(n),i=A.useCallback(l=>{const{edges:c=[],setEdges:a,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=t.getState();let h=c;for(const g of l)h=typeof g=="function"?g(h):g;u?a(h):f&&f(aa({items:h,lookup:d}))},[]),o=ua(i),s=A.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return E.jsx(sc.Provider,{value:s,children:e})}function Ym(){const e=A.useContext(sc);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Gm=e=>!!e.panZoom;function Po(){const e=Hm(),t=ke(),n=Ym(),r=de(Gm),i=A.useMemo(()=>{const o=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var w,C;const{nodeLookup:d,nodeOrigin:h}=t.getState(),g=ca(f)?f:d.get(f.id),m=g.parentId?Dl(g.position,g.measured,g.parentId,d,h):g.position,v={...g,position:m,width:((w=g.measured)==null?void 0:w.width)??g.width,height:((C=g.measured)==null?void 0:C.height)??g.height};return un(v)},a=(f,d,h={replace:!1})=>{s(g=>g.map(m=>{if(m.id===f){const v=typeof d=="function"?d(m):d;return h.replace&&ca(v)?v:{...m,...v}}return m}))},u=(f,d,h={replace:!1})=>{l(g=>g.map(m=>{if(m.id===f){const v=typeof d=="function"?d(m):d;return h.replace&&Bm(v)?v:{...m,...v}}return m}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=o(f))==null?void 0:d.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:h}=t.getState(),[g,m,v]=h;return{nodes:f.map(w=>({...w})),edges:d.map(w=>({...w})),viewport:{x:g,y:m,zoom:v}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:g,onNodesDelete:m,onEdgesDelete:v,triggerNodeChanges:w,triggerEdgeChanges:C,onDelete:y,onBeforeDelete:_}=t.getState(),{nodes:p,edges:k}=await xg({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:g,onBeforeDelete:_}),S=k.length>0,N=p.length>0;if(S){const R=k.map(la);v==null||v(k),C(R)}if(N){const R=p.map(la);m==null||m(p),w(R)}return(N||S)&&(y==null||y({nodes:p,edges:k})),{deletedNodes:p,deletedEdges:k}},getIntersectingNodes:(f,d=!0,h)=>{const g=Ls(f),m=g?f:c(f),v=h!==void 0;return m?(h||t.getState().nodes).filter(w=>{const C=t.getState().nodeLookup.get(w.id);if(C&&!g&&(w.id===f.id||!C.internals.positionAbsolute))return!1;const y=un(v?w:C),_=Wn(y,m);return d&&_>0||_>=m.width*m.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const m=Ls(f)?f:c(f);if(!m)return!1;const v=Wn(m,d);return h&&v>0||v>=m.width*m.height},updateNode:a,updateNodeData:(f,d,h={replace:!1})=>{a(f,g=>{const m=typeof d=="function"?d(g):d;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},updateEdge:u,updateEdgeData:(f,d,h={replace:!1})=>{u(f,g=>{const m=typeof d=="function"?d(g):d;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return gg(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}-${f}${d?`-${d}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??_g();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return A.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const da=e=>e.selected,Um=typeof window<"u"?window:void 0;function Wm({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ke(),{deleteElements:r}=Po(),i=Zn(e,{actInsideInputWithModifier:!1}),o=Zn(t,{target:Um});A.useEffect(()=>{if(i){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(da),edges:s.filter(da)}),n.setState({nodesSelectionActive:!1})}},[i]),A.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function Km(e){const t=ke();A.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=Ao(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",at.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const di={position:"absolute",width:"100%",height:"100%",top:0,left:0},Zm=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Qm({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=It.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:a,minZoom:u,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:h=!0,children:g,noWheelClassName:m,noPanClassName:v,onViewportChange:w,isControlledViewport:C,paneClickDistance:y}){const _=ke(),p=A.useRef(null),{userSelectionActive:k,lib:S}=de(Zm,_e),N=Zn(d),R=A.useRef();Km(p);const H=A.useCallback($=>{w==null||w({x:$[0],y:$[1],zoom:$[2]}),C||_.setState({transform:$})},[w,C]);return A.useEffect(()=>{if(p.current){R.current=im({domNode:p.current,minZoom:u,maxZoom:f,translateExtent:a,viewport:c,paneClickDistance:y,onDraggingChange:b=>_.setState({paneDragging:b}),onPanZoomStart:(b,M)=>{const{onViewportChangeStart:j,onMoveStart:D}=_.getState();D==null||D(b,M),j==null||j(M)},onPanZoom:(b,M)=>{const{onViewportChange:j,onMove:D}=_.getState();D==null||D(b,M),j==null||j(M)},onPanZoomEnd:(b,M)=>{const{onViewportChangeEnd:j,onMoveEnd:D}=_.getState();D==null||D(b,M),j==null||j(M)}});const{x:$,y:z,zoom:O}=R.current.getViewport();return _.setState({panZoom:R.current,transform:[$,z,O],domNode:p.current.closest(".react-flow")}),()=>{var b;(b=R.current)==null||b.destroy()}}},[]),A.useEffect(()=>{var $;($=R.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:N,preventScrolling:h,noPanClassName:v,userSelectionActive:k,noWheelClassName:m,lib:S,onTransformChange:H})},[e,t,n,r,i,o,s,l,N,h,v,k,m,S,H]),E.jsx("div",{className:"react-flow__renderer",ref:p,style:di,children:g})}const Jm=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ey(){const{userSelectionActive:e,userSelectionRect:t}=de(Jm,_e);return e&&t?E.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Li=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ty=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function ny({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Un.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:a,onPaneMouseEnter:u,onPaneMouseMove:f,onPaneMouseLeave:d,children:h}){const g=ke(),{userSelectionActive:m,elementsSelectable:v,dragging:w,connectionInProgress:C}=de(ty,_e),y=v&&(e||m),_=A.useRef(null),p=A.useRef(),k=A.useRef(new Set),S=A.useRef(new Set),N=A.useRef(!1),R=A.useRef(!1),H=D=>{if(N.current||C){N.current=!1;return}l==null||l(D),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},$=D=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){D.preventDefault();return}c==null||c(D)},z=a?D=>a(D):void 0,O=D=>{var L,V;const{resetSelectedElements:I,domNode:P}=g.getState();if(p.current=P==null?void 0:P.getBoundingClientRect(),!v||!e||D.button!==0||D.target!==_.current||!p.current)return;(V=(L=D.target)==null?void 0:L.setPointerCapture)==null||V.call(L,D.pointerId),R.current=!0,N.current=!1;const{x,y:T}=ot(D.nativeEvent,p.current);I(),g.setState({userSelectionRect:{width:0,height:0,startX:x,startY:T,x,y:T}}),o==null||o(D)},b=D=>{const{userSelectionRect:I,transform:P,nodeLookup:x,edgeLookup:T,connectionLookup:L,triggerNodeChanges:V,triggerEdgeChanges:B,defaultEdgeOptions:X}=g.getState();if(!p.current||!I)return;N.current=!0;const{x:F,y:G}=ot(D.nativeEvent,p.current),{startX:q,startY:K}=I,ae={startX:q,startY:K,x:F<q?F:q,y:G<K?G:K,width:Math.abs(F-q),height:Math.abs(G-K)},ie=k.current,W=S.current;k.current=new Set(No(x,ae,P,n===Un.Partial,!0).map(Z=>Z.id)),S.current=new Set;const Q=(X==null?void 0:X.selectable)??!0;for(const Z of k.current){const le=L.get(Z);if(le)for(const{edgeId:J}of le.values()){const fe=T.get(J);fe&&(fe.selectable??Q)&&S.current.add(J)}}if(!zs(ie,k.current)){const Z=nn(x,k.current,!0);V(Z)}if(!zs(W,S.current)){const Z=nn(T,S.current);B(Z)}g.setState({userSelectionRect:ae,userSelectionActive:!0,nodesSelectionActive:!1})},M=D=>{var P,x;if(D.button!==0||!R.current)return;(x=(P=D.target)==null?void 0:P.releasePointerCapture)==null||x.call(P,D.pointerId);const{userSelectionRect:I}=g.getState();!m&&I&&D.target===_.current&&(H==null||H(D)),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),s==null||s(D),(t||i)&&(N.current=!1),R.current=!1},j=r===!0||Array.isArray(r)&&r.includes(0);return E.jsxs("div",{className:Se(["react-flow__pane",{draggable:j,dragging:w,selection:e}]),onClick:y?void 0:Li(H,_),onContextMenu:Li($,_),onWheel:Li(z,_),onPointerEnter:y?void 0:u,onPointerDown:y?O:f,onPointerMove:y?b:f,onPointerUp:y?M:void 0,onPointerLeave:d,ref:_,style:di,children:[h,E.jsx(ey,{})]})}function io({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:l,onError:c}=t.getState(),a=l.get(e);if(!a){c==null||c("012",at.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(o({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([e])}function ac({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const l=ke(),[c,a]=A.useState(!1),u=A.useRef();return A.useEffect(()=>{u.current=Fg({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{io({id:f,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),A.useEffect(()=>{var f,d;if(t)(f=u.current)==null||f.destroy();else if(e.current)return(d=u.current)==null||d.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var h;(h=u.current)==null||h.destroy()}},[n,r,t,o,e,i]),c}const ry=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function lc(){const e=ke();return A.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:l,updateNodePositions:c,nodeLookup:a,nodeOrigin:u}=e.getState(),f=new Map,d=ry(s),h=i?o[0]:5,g=i?o[1]:5,m=n.direction.x*h*n.factor,v=n.direction.y*g*n.factor;for(const[,w]of a){if(!d(w))continue;let C={x:w.internals.positionAbsolute.x+m,y:w.internals.positionAbsolute.y+v};i&&(C=ai(C,o));const{position:y,positionAbsolute:_}=Tl({nodeId:w.id,nextPosition:C,nodeLookup:a,nodeExtent:r,nodeOrigin:u,onError:l});w.position=y,w.internals.positionAbsolute=_,f.set(w.id,w)}c(f)},[])}const Oo=A.createContext(null),iy=Oo.Provider;Oo.Consumer;const cc=()=>A.useContext(Oo),oy=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sy=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:l,toHandle:c,isValid:a}=s,u=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:u,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===ln.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:u&&a}};function ay({type:e="source",position:t=te.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:l,children:c,className:a,onMouseDown:u,onTouchStart:f,...d},h){var M,j;const g=s||null,m=e==="target",v=ke(),w=cc(),{connectOnClick:C,noPanClassName:y,rfId:_}=de(oy,_e),{connectingFrom:p,connectingTo:k,clickConnecting:S,isPossibleEndHandle:N,connectionInProcess:R,clickConnectionInProcess:H,valid:$}=de(sy(w,g,e),_e);w||(j=(M=v.getState()).onError)==null||j.call(M,"010",at.error010());const z=D=>{const{defaultEdgeOptions:I,onConnect:P,hasDefaultEdges:x}=v.getState(),T={...I,...D};if(x){const{edges:L,setEdges:V}=v.getState();V(Mg(T,L))}P==null||P(T),l==null||l(T)},O=D=>{if(!w)return;const I=$l(D.nativeEvent);if(i&&(I&&D.button===0||!I)){const P=v.getState();ro.onPointerDown(D.nativeEvent,{autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:m,handleId:g,nodeId:w,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:z,isValidConnection:n||P.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}I?u==null||u(D):f==null||f(D)},b=D=>{const{onClickConnectStart:I,onClickConnectEnd:P,connectionClickStartHandle:x,connectionMode:T,isValidConnection:L,lib:V,rfId:B,nodeLookup:X,connection:F}=v.getState();if(!w||!x&&!i)return;if(!x){I==null||I(D.nativeEvent,{nodeId:w,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:w,type:e,id:g}});return}const G=Pl(D.target),q=n||L,{connection:K,isValid:ae}=ro.isValid(D.nativeEvent,{handle:{nodeId:w,id:g,type:e},connectionMode:T,fromNodeId:x.nodeId,fromHandleId:x.id||null,fromType:x.type,isValidConnection:q,flowId:B,doc:G,lib:V,nodeLookup:X});ae&&K&&z(K);const ie=structuredClone(F);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,P==null||P(D,ie),v.setState({connectionClickStartHandle:null})};return E.jsx("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":t,"data-id":`${_}-${w}-${g}-${e}`,className:Se(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,a,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,clickconnecting:S,connectingfrom:p,connectingto:k,valid:$,connectionindicator:r&&(!R||N)&&(R||H?o:i)}]),onMouseDown:O,onTouchStart:O,onClick:C?b:void 0,ref:h,...d,children:c})}const Ur=A.memo(oc(ay));function ly({data:e,isConnectable:t,sourcePosition:n=te.Bottom}){return E.jsxs(E.Fragment,{children:[e==null?void 0:e.label,E.jsx(Ur,{type:"source",position:n,isConnectable:t})]})}function cy({data:e,isConnectable:t,targetPosition:n=te.Top,sourcePosition:r=te.Bottom}){return E.jsxs(E.Fragment,{children:[E.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,E.jsx(Ur,{type:"source",position:r,isConnectable:t})]})}function uy(){return null}function dy({data:e,isConnectable:t,targetPosition:n=te.Top}){return E.jsxs(E.Fragment,{children:[E.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Wr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},fa={input:ly,default:cy,output:dy,group:uy};function fy(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const hy=e=>{const{width:t,height:n,x:r,y:i}=nr(e.nodeLookup,{filter:o=>!!o.selected});return{width:et(t)?t:null,height:et(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function py({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ke(),{width:i,height:o,transformString:s,userSelectionActive:l}=de(hy,_e),c=lc(),a=A.useRef(null);if(A.useEffect(()=>{var d;n||(d=a.current)==null||d.focus({preventScroll:!0})},[n]),ac({nodeRef:a}),l||!i||!o)return null;const u=e?d=>{const h=r.getState().nodes.filter(g=>g.selected);e(d,h)}:void 0,f=d=>{Object.prototype.hasOwnProperty.call(Wr,d.key)&&(d.preventDefault(),c({direction:Wr[d.key],factor:d.shiftKey?4:1}))};return E.jsx("div",{className:Se(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:E.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:i,height:o}})})}const ha=typeof window<"u"?window:void 0,gy=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function uc({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:a,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:y,panOnScroll:_,panOnScrollSpeed:p,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:N,defaultViewport:R,translateExtent:H,minZoom:$,maxZoom:z,preventScrolling:O,onSelectionContextMenu:b,noWheelClassName:M,noPanClassName:j,disableKeyboardA11y:D,onViewportChange:I,isControlledViewport:P}){const{nodesSelectionActive:x,userSelectionActive:T}=de(gy),L=Zn(a,{target:ha}),V=Zn(m,{target:ha}),B=V||N,X=V||_,F=u&&B!==!0,G=L||T||F;return Wm({deleteKeyCode:c,multiSelectionKeyCode:g}),E.jsx(Qm,{onPaneContextMenu:o,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:y,panOnScroll:X,panOnScrollSpeed:p,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!L&&B,defaultViewport:R,translateExtent:H,minZoom:$,maxZoom:z,zoomActivationKeyCode:v,preventScrolling:O,noWheelClassName:M,noPanClassName:j,onViewportChange:I,isControlledViewport:P,paneClickDistance:l,children:E.jsxs(ny,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:B,isSelecting:!!G,selectionMode:f,selectionKeyPressed:L,selectionOnDrag:F,children:[e,x&&E.jsx(py,{onSelectionContextMenu:b,noPanClassName:j,disableKeyboardA11y:D})]})})}uc.displayName="FlowRenderer";const my=A.memo(uc),yy=e=>t=>e?No(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function vy(e){return de(A.useCallback(yy(e),[e]),_e)}const xy=e=>e.updateNodeInternals;function wy(){const e=de(xy),[t]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function by({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ke(),o=A.useRef(null),s=A.useRef(null),l=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),a=A.useRef(t),u=n&&!!e.internals.handleBounds;return A.useEffect(()=>{o.current&&!e.hidden&&(!u||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[u,e.hidden]),A.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),A.useEffect(()=>{if(o.current){const f=a.current!==t,d=l.current!==e.sourcePosition,h=c.current!==e.targetPosition;(f||d||h)&&(a.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function ky({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:c,nodesConnectable:a,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:g,rfId:m,nodeTypes:v,nodeClickDistance:w,onError:C}){const{node:y,internals:_,isParent:p}=de(q=>{const K=q.nodeLookup.get(e),ae=q.parentLookup.has(e);return{node:K,internals:K.internals,isParent:ae}},_e);let k=y.type||"default",S=(v==null?void 0:v[k])||fa[k];S===void 0&&(C==null||C("003",at.error003(k)),k="default",S=fa.default);const N=!!(y.draggable||l&&typeof y.draggable>"u"),R=!!(y.selectable||c&&typeof y.selectable>"u"),H=!!(y.connectable||a&&typeof y.connectable>"u"),$=!!(y.focusable||u&&typeof y.focusable>"u"),z=ke(),O=Rl(y),b=by({node:y,nodeType:k,hasDimensions:O,resizeObserver:f}),M=ac({nodeRef:b,disabled:y.hidden||!N,noDragClassName:d,handleSelector:y.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:w}),j=lc();if(y.hidden)return null;const D=vt(y),I=fy(y),P=R||N||t||n||r||i,x=n?q=>n(q,{..._.userNode}):void 0,T=r?q=>r(q,{..._.userNode}):void 0,L=i?q=>i(q,{..._.userNode}):void 0,V=o?q=>o(q,{..._.userNode}):void 0,B=s?q=>s(q,{..._.userNode}):void 0,X=q=>{const{selectNodesOnDrag:K,nodeDragThreshold:ae}=z.getState();R&&(!K||!N||ae>0)&&io({id:e,store:z,nodeRef:b}),t&&t(q,{..._.userNode})},F=q=>{if(!(Ol(q.nativeEvent)||g)){if(_l.includes(q.key)&&R){const K=q.key==="Escape";io({id:e,store:z,unselect:K,nodeRef:b})}else if(N&&y.selected&&Object.prototype.hasOwnProperty.call(Wr,q.key)){q.preventDefault();const{ariaLabelConfig:K}=z.getState();z.setState({ariaLiveMessage:K["node.a11yDescription.ariaLiveMessage"]({direction:q.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),j({direction:Wr[q.key],factor:q.shiftKey?4:1})}}},G=()=>{var Z;if(g||!((Z=b.current)!=null&&Z.matches(":focus-visible")))return;const{transform:q,width:K,height:ae,autoPanOnNodeFocus:ie,setCenter:W}=z.getState();if(!ie)return;No(new Map([[e,y]]),{x:0,y:0,width:K,height:ae},q,!0).length>0||W(y.position.x+D.width/2,y.position.y+D.height/2,{zoom:q[2]})};return E.jsx("div",{className:Se(["react-flow__node",`react-flow__node-${k}`,{[h]:N},y.className,{selected:y.selected,selectable:R,parent:p,draggable:N,dragging:M}]),ref:b,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:O?"visible":"hidden",...y.style,...I},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:x,onMouseMove:T,onMouseLeave:L,onContextMenu:V,onClick:X,onDoubleClick:B,onKeyDown:$?F:void 0,tabIndex:$?0:void 0,onFocus:$?G:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Jl}-${m}`,"aria-label":y.ariaLabel,...y.domAttributes,children:E.jsx(iy,{value:e,children:E.jsx(S,{id:e,data:y.data,type:k,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:y.selected??!1,selectable:R,draggable:N,deletable:y.deletable??!0,isConnectable:H,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:M,dragHandle:y.dragHandle,zIndex:_.z,parentId:y.parentId,...D})})})}const _y=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function dc(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=de(_y,_e),s=vy(e.onlyRenderVisibleElements),l=wy();return E.jsx("div",{className:"react-flow__nodes",style:di,children:s.map(c=>E.jsx(ky,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},c))})}dc.displayName="NodeRenderer";const Ey=A.memo(dc);function Sy(e){return de(A.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&Ng({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),_e)}const Cy=({color:e="none",strokeWidth:t=1})=>E.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Ny=({color:e="none",strokeWidth:t=1})=>E.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),pa={[qr.Arrow]:Cy,[qr.ArrowClosed]:Ny};function Ty(e){const t=ke();return A.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(pa,e)?pa[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",at.error009(e)),null)},[e])}const Ay=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=Ty(t);return c?E.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:E.jsx(c,{color:n,strokeWidth:s})}):null},fc=({defaultColor:e,rfId:t})=>{const n=de(o=>o.edges),r=de(o=>o.defaultEdgeOptions),i=A.useMemo(()=>Og(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?E.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:E.jsx("defs",{children:i.map(o=>E.jsx(Ay,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};fc.displayName="MarkerDefinitions";var My=A.memo(fc);function hc({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:a,...u}){const[f,d]=A.useState({x:1,y:0,width:0,height:0}),h=Se(["react-flow__edge-textwrapper",a]),g=A.useRef(null);return A.useEffect(()=>{if(g.current){const m=g.current.getBBox();d({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),n?E.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...u,children:[i&&E.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),E.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:r,children:n}),c]}):null}hc.displayName="EdgeText";const jy=A.memo(hc);function fi({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:a=20,...u}){return E.jsxs(E.Fragment,{children:[E.jsx("path",{...u,d:e,fill:"none",className:Se(["react-flow__edge-path",u.className])}),a&&E.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}),r&&et(t)&&et(n)?E.jsx(jy,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function ga({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===te.Left||e===te.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function pc({sourceX:e,sourceY:t,sourcePosition:n=te.Bottom,targetX:r,targetY:i,targetPosition:o=te.Top}){const[s,l]=ga({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,a]=ga({pos:o,x1:r,y1:i,x2:e,y2:t}),[u,f,d,h]=Il({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:a});return[`M${e},${t} C${s},${l} ${c},${a} ${r},${i}`,u,f,d,h]}function gc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s,targetPosition:l,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:w})=>{const[C,y,_]=pc({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l}),p=e.isInternal?void 0:t;return E.jsx(fi,{id:p,path:C,labelX:y,labelY:_,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:w})})}const Ry=gc({isInternal:!1}),mc=gc({isInternal:!0});Ry.displayName="SimpleBezierEdge";mc.displayName="SimpleBezierEdgeInternal";function yc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:h=te.Bottom,targetPosition:g=te.Top,markerEnd:m,markerStart:v,pathOptions:w,interactionWidth:C})=>{const[y,_,p]=eo({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:g,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset}),k=e.isInternal?void 0:t;return E.jsx(fi,{id:k,path:y,labelX:_,labelY:p,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:m,markerStart:v,interactionWidth:C})})}const vc=yc({isInternal:!1}),xc=yc({isInternal:!0});vc.displayName="SmoothStepEdge";xc.displayName="SmoothStepEdgeInternal";function wc(e){return A.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return E.jsx(vc,{...n,id:r,pathOptions:A.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Dy=wc({isInternal:!1}),bc=wc({isInternal:!0});Dy.displayName="StepEdge";bc.displayName="StepEdgeInternal";function kc(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:m})=>{const[v,w,C]=Hl({sourceX:n,sourceY:r,targetX:i,targetY:o}),y=e.isInternal?void 0:t;return E.jsx(fi,{id:y,path:v,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:m})})}const Py=kc({isInternal:!1}),_c=kc({isInternal:!0});Py.displayName="StraightEdge";_c.displayName="StraightEdgeInternal";function Ec(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=te.Bottom,targetPosition:l=te.Top,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,pathOptions:w,interactionWidth:C})=>{const[y,_,p]=Ll({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l,curvature:w==null?void 0:w.curvature}),k=e.isInternal?void 0:t;return E.jsx(fi,{id:k,path:y,labelX:_,labelY:p,label:c,labelStyle:a,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:C})})}const Oy=Ec({isInternal:!1}),Sc=Ec({isInternal:!0});Oy.displayName="BezierEdge";Sc.displayName="BezierEdgeInternal";const ma={default:Sc,straight:_c,step:bc,smoothstep:xc,simplebezier:mc},ya={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$y=(e,t,n)=>n===te.Left?e-t:n===te.Right?e+t:e,Iy=(e,t,n)=>n===te.Top?e-t:n===te.Bottom?e+t:e,va="react-flow__edgeupdater";function xa({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:l}){return E.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Se([va,`${va}-${l}`]),cx:$y(t,r,e),cy:Iy(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Ly({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:l,targetPosition:c,onReconnect:a,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const g=ke(),m=(_,p)=>{if(_.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:N,connectionMode:R,connectionRadius:H,lib:$,onConnectStart:z,onConnectEnd:O,cancelConnection:b,nodeLookup:M,rfId:j,panBy:D,updateConnection:I}=g.getState(),P=p.type==="target",x=(V,B)=>{d(!1),f==null||f(V,n,p.type,B)},T=V=>a==null?void 0:a(n,V),L=(V,B)=>{d(!0),u==null||u(_,n,p.type),z==null||z(V,B)};ro.onPointerDown(_.nativeEvent,{autoPanOnConnect:k,connectionMode:R,connectionRadius:H,domNode:S,handleId:p.id,nodeId:p.nodeId,nodeLookup:M,isTarget:P,edgeUpdaterType:p.type,lib:$,flowId:j,cancelConnection:b,panBy:D,isValidConnection:N,onConnect:T,onConnectStart:L,onConnectEnd:O,onReconnectEnd:x,updateConnection:I,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold})},v=_=>m(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=_=>m(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>h(!0),y=()=>h(!1);return E.jsxs(E.Fragment,{children:[(e===!0||e==="source")&&E.jsx(xa,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:v,onMouseEnter:C,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&E.jsx(xa,{position:c,centerX:o,centerY:s,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:y,type:"target"})]})}function zy({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:a,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:g,edgeTypes:m,noPanClassName:v,onError:w,disableKeyboardA11y:C}){let y=de(W=>W.edgeLookup.get(e));const _=de(W=>W.defaultEdgeOptions);y=_?{..._,...y}:y;let p=y.type||"default",k=(m==null?void 0:m[p])||ma[p];k===void 0&&(w==null||w("011",at.error011(p)),p="default",k=ma.default);const S=!!(y.focusable||t&&typeof y.focusable>"u"),N=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),R=!!(y.selectable||r&&typeof y.selectable>"u"),H=A.useRef(null),[$,z]=A.useState(!1),[O,b]=A.useState(!1),M=ke(),{zIndex:j,sourceX:D,sourceY:I,targetX:P,targetY:x,sourcePosition:T,targetPosition:L}=de(A.useCallback(W=>{const Q=W.nodeLookup.get(y.source),Z=W.nodeLookup.get(y.target);if(!Q||!Z)return{zIndex:y.zIndex,...ya};const le=Pg({id:e,sourceNode:Q,targetNode:Z,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:W.connectionMode,onError:w});return{zIndex:Cg({selected:y.selected,zIndex:y.zIndex,sourceNode:Q,targetNode:Z,elevateOnSelect:W.elevateEdgesOnSelect}),...le||ya}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),_e),V=A.useMemo(()=>y.markerStart?`url('#${to(y.markerStart,g)}')`:void 0,[y.markerStart,g]),B=A.useMemo(()=>y.markerEnd?`url('#${to(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||D===null||I===null||P===null||x===null)return null;const X=W=>{var J;const{addSelectedEdges:Q,unselectNodesAndEdges:Z,multiSelectionActive:le}=M.getState();R&&(M.setState({nodesSelectionActive:!1}),y.selected&&le?(Z({nodes:[],edges:[y]}),(J=H.current)==null||J.blur()):Q([e])),i&&i(W,y)},F=o?W=>{o(W,{...y})}:void 0,G=s?W=>{s(W,{...y})}:void 0,q=l?W=>{l(W,{...y})}:void 0,K=c?W=>{c(W,{...y})}:void 0,ae=a?W=>{a(W,{...y})}:void 0,ie=W=>{var Q;if(!C&&_l.includes(W.key)&&R){const{unselectNodesAndEdges:Z,addSelectedEdges:le}=M.getState();W.key==="Escape"?((Q=H.current)==null||Q.blur(),Z({edges:[y]})):le([e])}};return E.jsx("svg",{style:{zIndex:j},children:E.jsxs("g",{className:Se(["react-flow__edge",`react-flow__edge-${p}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!R&&!i,updating:$,selectable:R}]),onClick:X,onDoubleClick:F,onContextMenu:G,onMouseEnter:q,onMouseMove:K,onMouseLeave:ae,onKeyDown:S?ie:void 0,tabIndex:S?0:void 0,role:y.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":S?`${ec}-${g}`:void 0,ref:H,...y.domAttributes,children:[!O&&E.jsx(k,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:R,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:D,sourceY:I,targetX:P,targetY:x,sourcePosition:T,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:V,markerEnd:B,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),N&&E.jsx(Ly,{edge:y,isReconnectable:N,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:D,sourceY:I,targetX:P,targetY:x,sourcePosition:T,targetPosition:L,setUpdateHover:z,setReconnecting:b})]})})}const Hy=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Cc({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:a,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:w,elementsSelectable:C,onError:y}=de(Hy,_e),_=Sy(t);return E.jsxs("div",{className:"react-flow__edges",children:[E.jsx(My,{defaultColor:e,rfId:n}),_.map(p=>E.jsx(zy,{id:p,edgesFocusable:v,edgesReconnectable:w,elementsSelectable:C,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:a,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:m},p))]})}Cc.displayName="EdgeRenderer";const Vy=A.memo(Cc),By=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Fy({children:e}){const t=de(By);return E.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function qy(e){const t=Po(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Xy=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Yy(e){const t=de(Xy),n=ke();return A.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Gy(e){return e.connection.inProgress?{...e.connection,to:rr(e.connection.to,e.transform)}:{...e.connection}}function Uy(e){return Gy}function Wy(e){const t=Uy();return de(t,_e)}const Ky=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Zy({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:l,inProgress:c}=de(Ky,_e);return!(o&&i&&c)?null:E.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:E.jsx("g",{className:Se(["react-flow__connection",Cl(l)]),children:E.jsx(Nc,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Nc=({style:e,type:t=Et.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:l,fromPosition:c,to:a,toNode:u,toHandle:f,toPosition:d}=Wy();if(!i)return;if(n)return E.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:o.x,fromY:o.y,toX:a.x,toY:a.y,fromPosition:c,toPosition:d,connectionStatus:Cl(r),toNode:u,toHandle:f});let h="";const g={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:a.x,targetY:a.y,targetPosition:d};switch(t){case Et.Bezier:[h]=Ll(g);break;case Et.SimpleBezier:[h]=pc(g);break;case Et.Step:[h]=eo({...g,borderRadius:0});break;case Et.SmoothStep:[h]=eo(g);break;default:[h]=Hl(g)}return E.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Nc.displayName="ConnectionLine";const Qy={};function wa(e=Qy){A.useRef(e),ke(),A.useEffect(()=>{},[e])}function Jy(){ke(),A.useRef(!1),A.useEffect(()=>{},[])}function Tc({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:a,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:C,selectionOnDrag:y,selectionMode:_,multiSelectionKeyCode:p,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:N,onlyRenderVisibleElements:R,elementsSelectable:H,defaultViewport:$,translateExtent:z,minZoom:O,maxZoom:b,preventScrolling:M,defaultMarkerColor:j,zoomOnScroll:D,zoomOnPinch:I,panOnScroll:P,panOnScrollSpeed:x,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:V,onPaneClick:B,onPaneMouseEnter:X,onPaneMouseMove:F,onPaneMouseLeave:G,onPaneScroll:q,onPaneContextMenu:K,paneClickDistance:ae,nodeClickDistance:ie,onEdgeContextMenu:W,onEdgeMouseEnter:Q,onEdgeMouseMove:Z,onEdgeMouseLeave:le,reconnectRadius:J,onReconnect:fe,onReconnectStart:be,onReconnectEnd:ze,noDragClassName:je,noWheelClassName:He,noPanClassName:De,disableKeyboardA11y:Xe,nodeExtent:Ze,rfId:Ye,viewport:Ee,onViewportChange:Ve}){return wa(e),wa(t),Jy(),qy(n),Yy(Ee),E.jsx(my,{onPaneClick:B,onPaneMouseEnter:X,onPaneMouseMove:F,onPaneMouseLeave:G,onPaneContextMenu:K,onPaneScroll:q,paneClickDistance:ae,deleteKeyCode:N,selectionKeyCode:C,selectionOnDrag:y,selectionMode:_,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:H,zoomOnScroll:D,zoomOnPinch:I,zoomOnDoubleClick:L,panOnScroll:P,panOnScrollSpeed:x,panOnScrollMode:T,panOnDrag:V,defaultViewport:$,translateExtent:z,minZoom:O,maxZoom:b,onSelectionContextMenu:f,preventScrolling:M,noDragClassName:je,noWheelClassName:He,noPanClassName:De,disableKeyboardA11y:Xe,onViewportChange:Ve,isControlledViewport:!!Ee,children:E.jsxs(Fy,{children:[E.jsx(Vy,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:fe,onReconnectStart:be,onReconnectEnd:ze,onlyRenderVisibleElements:R,onEdgeContextMenu:W,onEdgeMouseEnter:Q,onEdgeMouseMove:Z,onEdgeMouseLeave:le,reconnectRadius:J,defaultMarkerColor:j,noPanClassName:De,disableKeyboardA11y:Xe,rfId:Ye}),E.jsx(Zy,{style:m,type:g,component:v,containerStyle:w}),E.jsx("div",{className:"react-flow__edgelabel-renderer"}),E.jsx(Ey,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:a,onNodeContextMenu:u,nodeClickDistance:ie,onlyRenderVisibleElements:R,noPanClassName:De,noDragClassName:je,disableKeyboardA11y:Xe,nodeExtent:Ze,rfId:Ye}),E.jsx("div",{className:"react-flow__viewport-portal"})]})})}Tc.displayName="GraphView";const e1=A.memo(Tc),ba=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c=.5,maxZoom:a=2,nodeOrigin:u,nodeExtent:f}={})=>{const d=new Map,h=new Map,g=new Map,m=new Map,v=r??t??[],w=n??e??[],C=u??[0,0],y=f??Gn;Bl(g,m,v);const _=no(w,d,h,{nodeOrigin:C,nodeExtent:y,elevateNodesOnSelect:!1});let p=[0,0,1];if(s&&i&&o){const k=nr(d,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:S,y:N,zoom:R}=To(k,i,o,c,a,(l==null?void 0:l.padding)??.1);p=[S,N,R]}return{rfId:"1",width:0,height:0,transform:p,nodes:w,nodesInitialized:_,nodeLookup:d,parentLookup:h,edges:v,edgeLookup:m,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:a,translateExtent:Gn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ln.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Sl},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:wg,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:El}},t1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:a,nodeOrigin:u,nodeExtent:f})=>bm((d,h)=>{async function g(){const{nodeLookup:m,panZoom:v,fitViewOptions:w,fitViewResolver:C,width:y,height:_,minZoom:p,maxZoom:k}=h();v&&(await vg({nodes:m,width:y,height:_,panZoom:v,minZoom:p,maxZoom:k},w),C==null||C.resolve(!0),d({fitViewResolver:null}))}return{...ba({nodes:e,edges:t,width:i,height:o,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:a,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:r}),setNodes:m=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:y,fitViewQueued:_}=h(),p=no(m,v,w,{nodeOrigin:C,nodeExtent:f,elevateNodesOnSelect:y,checkEquality:!0});_&&p?(g(),d({nodes:m,nodesInitialized:p,fitViewQueued:!1,fitViewOptions:void 0})):d({nodes:m,nodesInitialized:p})},setEdges:m=>{const{connectionLookup:v,edgeLookup:w}=h();Bl(v,w,m),d({edges:m})},setDefaultNodesAndEdges:(m,v)=>{if(m){const{setNodes:w}=h();w(m),d({hasDefaultNodes:!0})}if(v){const{setEdges:w}=h();w(v),d({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:C,domNode:y,nodeOrigin:_,nodeExtent:p,debug:k,fitViewQueued:S}=h(),{changes:N,updatedInternals:R}=Hg(m,w,C,y,_,p);R&&(Ig(w,C,{nodeOrigin:_,nodeExtent:p}),S?(g(),d({fitViewQueued:!1,fitViewOptions:void 0})):d({}),(N==null?void 0:N.length)>0&&(k&&console.log("React Flow: trigger node changes",N),v==null||v(N)))},updateNodePositions:(m,v=!1)=>{const w=[],C=[],{nodeLookup:y,triggerNodeChanges:_}=h();for(const[p,k]of m){const S=y.get(p),N=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),R={id:p,type:"position",position:N?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:v};N&&S.parentId&&w.push({id:p,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),C.push(R)}if(w.length>0){const{parentLookup:p,nodeOrigin:k}=h(),S=Do(w,y,p,k);C.push(...S)}_(C)},triggerNodeChanges:m=>{const{onNodesChange:v,setNodes:w,nodes:C,hasDefaultNodes:y,debug:_}=h();if(m!=null&&m.length){if(y){const p=rc(m,C);w(p)}_&&console.log("React Flow: trigger node changes",m),v==null||v(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:v,setEdges:w,edges:C,hasDefaultEdges:y,debug:_}=h();if(m!=null&&m.length){if(y){const p=ic(m,C);w(p)}_&&console.log("React Flow: trigger edge changes",m),v==null||v(m)}},addSelectedNodes:m=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:C,triggerNodeChanges:y,triggerEdgeChanges:_}=h();if(v){const p=m.map(k=>jt(k,!0));y(p);return}y(nn(C,new Set([...m]),!0)),_(nn(w))},addSelectedEdges:m=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:C,triggerNodeChanges:y,triggerEdgeChanges:_}=h();if(v){const p=m.map(k=>jt(k,!0));_(p);return}_(nn(w,new Set([...m]))),y(nn(C,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:v}={})=>{const{edges:w,nodes:C,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:p}=h(),k=m||C,S=v||w,N=k.map(H=>{const $=y.get(H.id);return $&&($.selected=!1),jt(H.id,!1)}),R=S.map(H=>jt(H.id,!1));_(N),p(R)},setMinZoom:m=>{const{panZoom:v,maxZoom:w}=h();v==null||v.setScaleExtent([m,w]),d({minZoom:m})},setMaxZoom:m=>{const{panZoom:v,minZoom:w}=h();v==null||v.setScaleExtent([w,m]),d({maxZoom:m})},setTranslateExtent:m=>{var v;(v=h().panZoom)==null||v.setTranslateExtent(m),d({translateExtent:m})},setPaneClickDistance:m=>{var v;(v=h().panZoom)==null||v.setClickDistance(m)},resetSelectedElements:()=>{const{edges:m,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:C,elementsSelectable:y}=h();if(!y)return;const _=v.reduce((k,S)=>S.selected?[...k,jt(S.id,!1)]:k,[]),p=m.reduce((k,S)=>S.selected?[...k,jt(S.id,!1)]:k,[]);w(_),C(p)},setNodeExtent:m=>{const{nodes:v,nodeLookup:w,parentLookup:C,nodeOrigin:y,elevateNodesOnSelect:_,nodeExtent:p}=h();m[0][0]===p[0][0]&&m[0][1]===p[0][1]&&m[1][0]===p[1][0]&&m[1][1]===p[1][1]||(no(v,w,C,{nodeOrigin:y,nodeExtent:m,elevateNodesOnSelect:_,checkEquality:!1}),d({nodeExtent:m}))},panBy:m=>{const{transform:v,width:w,height:C,panZoom:y,translateExtent:_}=h();return Vg({delta:m,panZoom:y,transform:v,translateExtent:_,width:w,height:C})},setCenter:async(m,v,w)=>{const{width:C,height:y,maxZoom:_,panZoom:p}=h();if(!p)return Promise.resolve(!1);const k=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:_;return await p.setViewport({x:C/2-m*k,y:y/2-v*k,zoom:k},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{d({connection:{...Sl}})},updateConnection:m=>{d({connection:m})},reset:()=>d({...ba()})}},Object.is);function n1({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:c,fitView:a,nodeOrigin:u,nodeExtent:f,children:d}){const[h]=A.useState(()=>t1({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,minZoom:s,maxZoom:l,fitViewOptions:c,nodeOrigin:u,nodeExtent:f}));return E.jsx(km,{value:h,children:E.jsx(Xm,{children:d})})}function r1({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:l,fitViewOptions:c,minZoom:a,maxZoom:u,nodeOrigin:f,nodeExtent:d}){return A.useContext(ci)?E.jsx(E.Fragment,{children:e}):E.jsx(n1,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:l,initialFitViewOptions:c,initialMinZoom:a,initialMaxZoom:u,nodeOrigin:f,nodeExtent:d,children:e})}const i1={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function o1({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:c,onInit:a,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:w,onNodeMouseEnter:C,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:p,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:N,onNodeDragStop:R,onNodesDelete:H,onEdgesDelete:$,onDelete:z,onSelectionChange:O,onSelectionDragStart:b,onSelectionDrag:M,onSelectionDragStop:j,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:P,onBeforeDelete:x,connectionMode:T,connectionLineType:L=Et.Bezier,connectionLineStyle:V,connectionLineComponent:B,connectionLineContainerStyle:X,deleteKeyCode:F="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:q=!1,selectionMode:K=Un.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:ie=Gr()?"Meta":"Control",zoomActivationKeyCode:W=Gr()?"Meta":"Control",snapToGrid:Q,snapGrid:Z,onlyRenderVisibleElements:le=!1,selectNodesOnDrag:J,nodesDraggable:fe,autoPanOnNodeFocus:be,nodesConnectable:ze,nodesFocusable:je,nodeOrigin:He=tc,edgesFocusable:De,edgesReconnectable:Xe,elementsSelectable:Ze=!0,defaultViewport:Ye=Om,minZoom:Ee=.5,maxZoom:Ve=2,translateExtent:Ge=Gn,preventScrolling:Pe=!0,nodeExtent:nt,defaultMarkerColor:Ue="#b1b1b7",zoomOnScroll:Oe=!0,zoomOnPinch:xt=!0,panOnScroll:$e=!1,panOnScrollSpeed:Ce=.5,panOnScrollMode:ut=It.Free,zoomOnDoubleClick:re=!0,panOnDrag:ne=!0,onPaneClick:ce,onPaneMouseEnter:pe,onPaneMouseMove:ue,onPaneMouseLeave:he,onPaneScroll:U,onPaneContextMenu:ge,paneClickDistance:me=0,nodeClickDistance:Ne=0,children:Ae,onReconnect:Te,onReconnectStart:dt,onReconnectEnd:ft,onEdgeContextMenu:Xt,onEdgeDoubleClick:wt,onEdgeMouseEnter:yn,onEdgeMouseMove:ir,onEdgeMouseLeave:Yt,reconnectRadius:Gt=10,onNodesChange:hi,onEdgesChange:Ct,noDragClassName:or="nodrag",noWheelClassName:pi="nowheel",noPanClassName:sr="nopan",fitView:ar,fitViewOptions:Ut,connectOnClick:lr,attributionPosition:vn,proOptions:cr,defaultEdgeOptions:gi,elevateNodesOnSelect:ur,elevateEdgesOnSelect:dr,disableKeyboardA11y:xn=!1,autoPanOnConnect:ee,autoPanOnNodeDrag:ve,autoPanSpeed:Be,connectionRadius:Ie,isValidConnection:We,onError:mi,style:Wt,id:Nt,nodeDragThreshold:yi,connectionDragThreshold:wn,viewport:bn,onViewportChange:fr,width:hr,height:vi,colorMode:xi="light",debug:kn,onScroll:bt,ariaLabelConfig:_n,...pr},Gc){const wi=Nt||"1",Uc=zm(xi),Wc=A.useCallback(zo=>{zo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),bt==null||bt(zo)},[bt]);return E.jsx("div",{"data-testid":"rf__wrapper",...pr,onScroll:Wc,style:{...Wt,...i1},ref:Gc,className:Se(["react-flow",i,Uc]),id:Nt,role:"application",children:E.jsxs(r1,{nodes:e,edges:t,width:hr,height:vi,fitView:ar,fitViewOptions:Ut,minZoom:Ee,maxZoom:Ve,nodeOrigin:He,nodeExtent:nt,children:[E.jsx(e1,{onInit:a,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:p,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:s,connectionLineType:L,connectionLineStyle:V,connectionLineComponent:B,connectionLineContainerStyle:X,selectionKeyCode:G,selectionOnDrag:q,selectionMode:K,deleteKeyCode:F,multiSelectionKeyCode:ie,panActivationKeyCode:ae,zoomActivationKeyCode:W,onlyRenderVisibleElements:le,defaultViewport:Ye,translateExtent:Ge,minZoom:Ee,maxZoom:Ve,preventScrolling:Pe,zoomOnScroll:Oe,zoomOnPinch:xt,zoomOnDoubleClick:re,panOnScroll:$e,panOnScrollSpeed:Ce,panOnScrollMode:ut,panOnDrag:ne,onPaneClick:ce,onPaneMouseEnter:pe,onPaneMouseMove:ue,onPaneMouseLeave:he,onPaneScroll:U,onPaneContextMenu:ge,paneClickDistance:me,nodeClickDistance:Ne,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:P,onReconnect:Te,onReconnectStart:dt,onReconnectEnd:ft,onEdgeContextMenu:Xt,onEdgeDoubleClick:wt,onEdgeMouseEnter:yn,onEdgeMouseMove:ir,onEdgeMouseLeave:Yt,reconnectRadius:Gt,defaultMarkerColor:Ue,noDragClassName:or,noWheelClassName:pi,noPanClassName:sr,rfId:wi,disableKeyboardA11y:xn,nodeExtent:nt,viewport:bn,onViewportChange:fr}),E.jsx(Lm,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:w,nodesDraggable:fe,autoPanOnNodeFocus:be,nodesConnectable:ze,nodesFocusable:je,edgesFocusable:De,edgesReconnectable:Xe,elementsSelectable:Ze,elevateNodesOnSelect:ur,elevateEdgesOnSelect:dr,minZoom:Ee,maxZoom:Ve,nodeExtent:nt,onNodesChange:hi,onEdgesChange:Ct,snapToGrid:Q,snapGrid:Z,connectionMode:T,translateExtent:Ge,connectOnClick:lr,defaultEdgeOptions:gi,fitView:ar,fitViewOptions:Ut,onNodesDelete:H,onEdgesDelete:$,onDelete:z,onNodeDragStart:S,onNodeDrag:N,onNodeDragStop:R,onSelectionDrag:M,onSelectionDragStart:b,onSelectionDragStop:j,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:sr,nodeOrigin:He,rfId:wi,autoPanOnConnect:ee,autoPanOnNodeDrag:ve,autoPanSpeed:Be,onError:mi,connectionRadius:Ie,isValidConnection:We,selectNodesOnDrag:J,nodeDragThreshold:yi,connectionDragThreshold:wn,onBeforeDelete:x,paneClickDistance:me,debug:kn,ariaLabelConfig:_n}),E.jsx(Pm,{onSelectionChange:O}),Ae,E.jsx(Am,{proOptions:cr,position:vn}),E.jsx(Tm,{rfId:wi,disableKeyboardA11y:xn})]})})}var Yx=oc(o1);function Gx(e){const[t,n]=A.useState(e),r=A.useCallback(i=>n(o=>rc(i,o)),[]);return[t,n,r]}function Ux(e){const[t,n]=A.useState(e),r=A.useCallback(i=>n(o=>ic(i,o)),[]);return[t,n,r]}function s1({dimensions:e,lineWidth:t,variant:n,className:r}){return E.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Se(["react-flow__background-pattern",n,r])})}function a1({radius:e,className:t}){return E.jsx("circle",{cx:e,cy:e,r:e,className:Se(["react-flow__background-pattern","dots",t])})}var St;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(St||(St={}));const l1={[St.Dots]:1,[St.Lines]:1,[St.Cross]:6},c1=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ac({id:e,variant:t=St.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:l,style:c,className:a,patternClassName:u}){const f=A.useRef(null),{transform:d,patternId:h}=de(c1,_e),g=r||l1[t],m=t===St.Dots,v=t===St.Cross,w=Array.isArray(n)?n:[n,n],C=[w[0]*d[2]||1,w[1]*d[2]||1],y=g*d[2],_=Array.isArray(o)?o:[o,o],p=v?[y,y]:C,k=[_[0]*d[2]||1+p[0]/2,_[1]*d[2]||1+p[1]/2],S=`${h}${e||""}`;return E.jsxs("svg",{className:Se(["react-flow__background",a]),style:{...c,...di,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[E.jsx("pattern",{id:S,x:d[0]%C[0],y:d[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:m?E.jsx(a1,{radius:y/2,className:u}):E.jsx(s1,{dimensions:p,lineWidth:i,variant:t,className:u})}),E.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}Ac.displayName="Background";const Wx=A.memo(Ac);function u1(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:E.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function d1(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:E.jsx("path",{d:"M0 0h32v4.2H0z"})})}function f1(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:E.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function h1(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function p1(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Cr({children:e,className:t,...n}){return E.jsx("button",{type:"button",className:Se(["react-flow__controls-button",t]),...n,children:e})}const g1=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Mc({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:a,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const g=ke(),{isInteractive:m,minZoomReached:v,maxZoomReached:w,ariaLabelConfig:C}=de(g1,_e),{zoomIn:y,zoomOut:_,fitView:p}=Po(),k=()=>{y(),o==null||o()},S=()=>{_(),s==null||s()},N=()=>{p(i),l==null||l()},R=()=>{g.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),c==null||c(!m)},H=d==="horizontal"?"horizontal":"vertical";return E.jsxs(ui,{className:Se(["react-flow__controls",H,a]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??C["controls.ariaLabel"],children:[t&&E.jsxs(E.Fragment,{children:[E.jsx(Cr,{onClick:k,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:w,children:E.jsx(u1,{})}),E.jsx(Cr,{onClick:S,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:v,children:E.jsx(d1,{})})]}),n&&E.jsx(Cr,{className:"react-flow__controls-fitview",onClick:N,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:E.jsx(f1,{})}),r&&E.jsx(Cr,{className:"react-flow__controls-interactive",onClick:R,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:m?E.jsx(p1,{}):E.jsx(h1,{})}),u]})}Mc.displayName="Controls";const Kx=A.memo(Mc);function m1({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:l,strokeWidth:c,className:a,borderRadius:u,shapeRendering:f,selected:d,onClick:h}){const{background:g,backgroundColor:m}=o||{},v=s||g||m;return E.jsx("rect",{className:Se(["react-flow__minimap-node",{selected:d},a]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:h?w=>h(w,e):void 0})}const y1=A.memo(m1),v1=e=>e.nodes.map(t=>t.id),zi=e=>e instanceof Function?e:()=>e;function x1({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=y1,onClick:s}){const l=de(v1,_e),c=zi(t),a=zi(e),u=zi(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return E.jsx(E.Fragment,{children:l.map(d=>E.jsx(b1,{id:d,nodeColorFunc:c,nodeStrokeColorFunc:a,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:f},d))})}function w1({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:l,onClick:c}){const{node:a,x:u,y:f,width:d,height:h}=de(g=>{const{internals:m}=g.nodeLookup.get(e),v=m.userNode,{x:w,y:C}=m.positionAbsolute,{width:y,height:_}=vt(v);return{node:v,x:w,y:C,width:y,height:_}},_e);return!a||a.hidden||!Rl(a)?null:E.jsx(l,{x:u,y:f,width:d,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:o,shapeRendering:s,onClick:c,id:a.id})}const b1=A.memo(w1);var k1=A.memo(x1);const _1=200,E1=150,S1=e=>!e.hidden,C1=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?jl(nr(e.nodeLookup,{filter:S1}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},N1="react-flow__minimap-desc";function jc({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:c,maskColor:a,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:g,pannable:m=!1,zoomable:v=!1,ariaLabel:w,inversePan:C,zoomStep:y=10,offsetScale:_=5}){const p=ke(),k=A.useRef(null),{boundingRect:S,viewBB:N,rfId:R,panZoom:H,translateExtent:$,flowWidth:z,flowHeight:O,ariaLabelConfig:b}=de(C1,_e),M=(e==null?void 0:e.width)??_1,j=(e==null?void 0:e.height)??E1,D=S.width/M,I=S.height/j,P=Math.max(D,I),x=P*M,T=P*j,L=_*P,V=S.x-(x-S.width)/2-L,B=S.y-(T-S.height)/2-L,X=x+L*2,F=T+L*2,G=`${N1}-${R}`,q=A.useRef(0),K=A.useRef();q.current=P,A.useEffect(()=>{if(k.current&&H)return K.current=Wg({domNode:k.current,panZoom:H,getTransform:()=>p.getState().transform,getViewScale:()=>q.current}),()=>{var Q;(Q=K.current)==null||Q.destroy()}},[H]),A.useEffect(()=>{var Q;(Q=K.current)==null||Q.update({translateExtent:$,width:z,height:O,inversePan:C,pannable:m,zoomStep:y,zoomable:v})},[m,v,C,y,$,z,O]);const ae=h?Q=>{var J;const[Z,le]=((J=K.current)==null?void 0:J.pointer(Q))||[0,0];h(Q,{x:Z,y:le})}:void 0,ie=g?A.useCallback((Q,Z)=>{const le=p.getState().nodeLookup.get(Z).internals.userNode;g(Q,le)},[]):void 0,W=w??b["minimap.ariaLabel"];return E.jsx(ui,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*P:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Se(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:E.jsxs("svg",{width:M,height:j,viewBox:`${V} ${B} ${X} ${F}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:k,onClick:ae,children:[W&&E.jsx("title",{id:G,children:W}),E.jsx(k1,{onClick:ie,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),E.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-L},${B-L}h${X+L*2}v${F+L*2}h${-X-L*2}z
        M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}jc.displayName="MiniMap";A.memo(jc);const T1=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,A1={[fn.Line]:"right",[fn.Handle]:"bottom-right"};function M1({nodeId:e,position:t,variant:n=fn.Handle,className:r,style:i=void 0,children:o,color:s,minWidth:l=10,minHeight:c=10,maxWidth:a=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:g,onResizeStart:m,onResize:v,onResizeEnd:w}){const C=cc(),y=typeof e=="string"?e:C,_=ke(),p=A.useRef(null),k=n===fn.Handle,S=de(A.useCallback(T1(k&&h),[k,h]),_e),N=A.useRef(null),R=t??A1[n];A.useEffect(()=>{if(!(!p.current||!y))return N.current||(N.current=dm({domNode:p.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:z,snapGrid:O,snapToGrid:b,nodeOrigin:M,domNode:j}=_.getState();return{nodeLookup:$,transform:z,snapGrid:O,snapToGrid:b,nodeOrigin:M,paneDomNode:j}},onChange:($,z)=>{const{triggerNodeChanges:O,nodeLookup:b,parentLookup:M,nodeOrigin:j}=_.getState(),D=[],I={x:$.x,y:$.y},P=b.get(y);if(P&&P.expandParent&&P.parentId){const x=P.origin??j,T=$.width??P.measured.width??0,L=$.height??P.measured.height??0,V={id:P.id,parentId:P.parentId,rect:{width:T,height:L,...Dl({x:$.x??P.position.x,y:$.y??P.position.y},{width:T,height:L},P.parentId,b,x)}},B=Do([V],b,M,j);D.push(...B),I.x=$.x?Math.max(x[0]*T,$.x):void 0,I.y=$.y?Math.max(x[1]*L,$.y):void 0}if(I.x!==void 0&&I.y!==void 0){const x={id:y,type:"position",position:{...I}};D.push(x)}if($.width!==void 0&&$.height!==void 0){const T={id:y,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};D.push(T)}for(const x of z){const T={...x,type:"position"};D.push(T)}O(D)},onEnd:({width:$,height:z})=>{const O={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:z}};_.getState().triggerNodeChanges([O])}})),N.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:a,maxHeight:u},keepAspectRatio:f,resizeDirection:d,onResizeStart:m,onResize:v,onResizeEnd:w,shouldResize:g}),()=>{var $;($=N.current)==null||$.destroy()}},[R,l,c,a,u,f,m,v,w,g]);const H=R.split("-");return E.jsx("div",{className:Se(["react-flow__resize-control","nodrag",...H,n,r]),ref:p,style:{...i,scale:S,...s&&{[k?"backgroundColor":"borderColor"]:s}},children:o})}A.memo(M1);const Dt=(e,t,n,r,i)=>{if(!r)throw new Error(i??`Invalid property path: ${t}
Couldn't access "${n}" in ${JSON.stringify(e)}`)},ka=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Dr=e=>Array.isArray(e),Rc=(e,t)=>e.filter((n,r)=>r!==t),j1=(e,t,n,r={})=>{const{remove:i=!1,createNew:o=!0,noError:s=!1}=r,l=e,c=typeof(a=t)=="string"?a:typeof a=="number"?String(a):a.reduce((d,h)=>typeof h=="number"?`${d}[${h}]`:d===""?h:`${d}.${h}`,"");var a;const u=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:s,fullData:l,fullPath:c}),f=Array.isArray(t)?t:(d=>Array.isArray(d)?d:d.split(/(\.|\[\d+\])/).filter(h=>h!=="."&&h!=="").map(h=>{const g=/\[(\d+)\]/.exec(h);return g?Number(g[1]):h}).flat())(t).filter(d=>d!=="");return Dr(e)&&i&&f.length===1?Rc(e,f[0]):zn(e,f,n,u)},zn=(e,t,n,r)=>{const i=ka(e)?Object.assign({},e):null,o=Dr(e)?[...e]:null;if(t.length===0)return e;if(!i&&!o)throw new Error("Can't assign property -- invalid input object");const{createNew:s,remove:l,noError:c,fullData:a,fullPath:u}=r,f=t[0];if(o&&typeof f=="string")return o.map(m=>zn(m,t,n,r));if(t.length===1){if(i&&typeof f=="string"){const m=R1(i,f,n,r);return m??i}return o&&typeof f=="number"?(D1(o,f,n,r),o):(Dt(a,u,f,c),e)}const d=i||o||[];if(l&&t.length===2&&typeof t[1]=="number"){const m=d[f],v=t[1];return Dr(m)?d[f]=Rc(m,v):Dt(a,u,f,c,"Trying to remove an indexed item from an object that is not an array"),d}const h=t.slice(1);if(f in e){if(g=d[f],!Dr(g)&&!ka(g)){if(!s)return Dt(a,u,f,c),d;d[f]={}}return d[f]=zn(d[f],h,n,r),d}var g;if(s){const m=typeof h[0]=="number"?[]:{};if(i)return d[f]=m,d[f]=zn(d[f],h,n,r),d;if(o&&Array.isArray(d)){d.push(m);const v=d.length-1;return d[v]=zn(d[v],h,n,r),d}}return Dt(a,u,f,c),d},R1=(e,t,n,r)=>{const{remove:i,createNew:o,noError:s,insertAfter:l,insertBefore:c,fullData:a,fullPath:u}=r;if(c!==void 0||l!==void 0){const d=Object.entries(e);let h=1/0;return h=typeof c=="number"?c:typeof l=="number"?l:d.findIndex(([g,m])=>g===(c??l)),l&&h++,d.splice(h,0,[t,n]),Object.fromEntries(d)}const f=t in e;i?f?delete e[t]:Dt(a,u,t,s):o||f?e[t]=n:Dt(a,u,t,s)},D1=(e,t,n,r)=>{const{noError:i,fullData:o,fullPath:s,createNew:l,insert:c}=r;c&&e.splice(t,0,n),t in e?e[t]=n:l?e.push(n):Dt(o,s,t,i)},hn=(e,t,n)=>{const r=Array.isArray(t)?t:P1(t);if(r.length===0)return e;const i=r[0];if(Array.isArray(e)&&typeof i!="number")return e.map(s=>hn(s,r));if(typeof e!="object"||e===null||!(i in e))return O1(e,i);const o=e[i];return r.length===1?o:hn(o,r.slice(1))},P1=e=>e.split(/(\.|\[\d+\])/).filter(t=>t!=="."&&t!=="").map(t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t}).flat(),O1=(e,t,n)=>{throw new Error(`Unable to extract object property
Looking for property: ${t}
In object: ${JSON.stringify(e)}`)};function Dc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function en(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(a){try{c(r.next(a))}catch(u){o(u)}}function l(a){try{c(r.throw(a))}catch(u){o(u)}}function c(a){var u;a.done?i(a.value):(u=a.value,u instanceof n?u:new n(function(f){f(u)})).then(s,l)}c((r=r.apply(e,[])).next())})}const Pc=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:o,textAreaRef:s})=>{if(typeof n!="string")return null;const l=n.slice(-1)===`
`?n+".":n;return E.jsxs("div",{style:{display:"grid"},children:[E.jsx("textarea",{id:`${t}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},o),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:c=>r(c.target.value),autoFocus:!0,onFocus:c=>{n.length<40&&c.target.select()},onKeyDown:i}),E.jsx("span",{className:e,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},o),children:l})]})},pn=e=>e!==null&&typeof e=="object",Oc=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!oo(r,t,n))return!1}if(!n&&r&&!oo(r,t))return!1;break;case"value":if(n&&!n(t,r)||!n&&r&&!gn(t,r))return!1}return!0},oo=(e="",t,n=gn)=>{const r=t.value;return Object.entries(r).some(([i,o])=>{const s=[...t.path,i],l=Object.assign(Object.assign({},t),{key:i,path:s,level:t.level+1,value:o,size:s.length,parentData:r});return pn(o)?oo(e,l,n):n(l,e)})},gn=(e,t="")=>{const{value:n}=e;if(n===null&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||t==="1":"false".includes(t.toLowerCase())||t==="0";default:return!1}},_a=({key:e,path:t},n="")=>!!gn({value:e},n)||!!t.some(r=>gn({value:r},n)),qt=(e,t)=>(t??"")+e.map(n=>n===""?"\0":n).join("."),$o=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,$1=(e,t,n)=>{const r=e.key,i=$o(e);if(Array.isArray(t))return!!i&&t.includes(i);const{key:o,modifier:s}=t;return(n!=="stringLineBreak"||r!=="Enter"||i!=="Shift"||o!=="Enter"||!(s!=null&&s.includes("Shift")))&&r===o&&(s===i||Array.isArray(s)&&s.includes(i))},Mt={key:"Enter"},Ea={confirm:Mt,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},Mt),{modifier:["Meta","Shift","Control"]}),objectLineBreak:Mt,stringConfirm:Mt,stringLineBreak:Object.assign(Object.assign({},Mt),{modifier:["Shift"]}),numberConfirm:Mt,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:Mt,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},Pt=(e,t,n="next",r)=>{const i=t.slice(0,t.length-1),o=t.slice(-1)[0];if(o===void 0)return null;const s=hn(e,i),l=I1(s);Array.isArray(s)||r(l,({key:u,value:f})=>[u,f]);const c=l.findIndex(u=>u.key===o),a=l[c+(n==="next"?1:-1)];return a?pn(a.value)?Object.keys(a.value).length===0?Pt(e,[...i,a.key],n,r):$c(e,[...i,a.key],n,r):[...i,a.key]:i.length===0?null:Pt(e,i,n,r)},$c=(e,t,n="next",r)=>{const i=hn(e,t);if(!pn(i))return t;const o=Array.isArray(i)?i.map((l,c)=>c):Object.keys(i);r(o,l=>[l,i]);const s=n==="next"?o[0]:o[o.length-1];return $c(e,[...t,s],n,r)},I1=e=>Array.isArray(e)?e.map((t,n)=>({index:n,value:t,key:n})):Object.entries(e).map(([t,n],r)=>({key:t,value:n,index:r})),Ic=(e,t)=>{var n,r,i,o;const s=e.current,l=(n=s==null?void 0:s.selectionStart)!==null&&n!==void 0?n:1/0,c=(r=s==null?void 0:s.selectionEnd)!==null&&r!==void 0?r:1/0,a=((i=s==null?void 0:s.textContent)===null||i===void 0?void 0:i.slice(0,l))+t+((o=s==null?void 0:s.textContent)===null||o===void 0?void 0:o.slice(c));return s.value=a,s==null||s.setSelectionRange(l+1,l+1),a},so=e=>{if(e!==Lc){if(Array.isArray(e))return e.map(t=>so(t));if(e&&typeof e=="object")for(const t in e)e[t]=so(e[t]);return e}},Lc="__​undefined__",Io={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},zc=A.createContext({getStyles:()=>({}),icons:{}}),L1=({theme:e=Io,icons:t={},docRoot:n,children:r})=>{const i=z1(e,n);return E.jsx(zc.Provider,{value:{getStyles:(o,s)=>typeof i[o]=="function"?i[o](s):i[o],icons:t},children:r})},ct=()=>A.useContext(zc),z1=(e,t)=>{var n,r,i,o;const s={},l=(Array.isArray(e)?e:[e]).map(u=>H1(u)?Hi({fragments:{},styles:u},s):Hi(u,s)),c=Hi(Io,{});Object.keys(c).forEach(u=>{const f=u;l.forEach(d=>{d[f]&&(c[f]=Object.assign(Object.assign({},c[f]),d[f]))})});const a=Object.assign({},c);return Object.entries(s).forEach(([u,f])=>{const d=u;a[d]=h=>{const g=f(h)||{};return Object.assign(Object.assign({},c[d]),g)}}),typeof(a==null?void 0:a.inputHighlight)!="function"&&(!((n=a==null?void 0:a.inputHighlight)===null||n===void 0)&&n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",(r=a==null?void 0:a.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof(a==null?void 0:a.iconCopy)!="function"&&(!((i=a==null?void 0:a.iconCopy)===null||i===void 0)&&i.color)&&t.style.setProperty("--jer-icon-copy-color",(o=a==null?void 0:a.iconCopy)===null||o===void 0?void 0:o.color),a},Hi=(e,t)=>{const{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([o,s])=>{const l=(Array.isArray(s)?s:[s]).reduce((c,a)=>{var u,f;if(typeof a=="function")return t[o]=a,Object.assign({},c);if(typeof a=="string"){const d=(u=n==null?void 0:n[a])!==null&&u!==void 0?u:a;return typeof d=="string"?Object.assign(Object.assign({},c),{[(f=V1[o])!==null&&f!==void 0?f:"color"]:d}):Object.assign(Object.assign({},c),d)}return Object.assign(Object.assign({},c),a)},{});i[o]=l}),i},H1=e=>!("styles"in e),V1={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},Hc=A.createContext(null),B1=({children:e,onEditEvent:t,onCollapse:n})=>{const[r,i]=A.useState(null),[o,s]=A.useState(null),[l,c]=A.useState(null),[a,u]=A.useState({path:null,pathString:null}),f=A.useRef(null),d=A.useRef("next"),h=A.useRef(null);return E.jsx(Hc.Provider,{value:{collapseState:r,setCollapseState:g=>{i(g),n&&g!==null&&(Array.isArray(g)?g.forEach(m=>n(m)):n(g)),g!==null&&setTimeout(()=>i(null),2e3)},getMatchingCollapseState:g=>{if(Array.isArray(r)){for(const m of r)if(Sa(g,m))return m;return null}return Sa(g,r)?r:null},currentlyEditingElement:o,setCurrentlyEditingElement:(g,m)=>{const v=typeof g=="string"||g===null?g:qt(g,m==="key"?"key_":void 0);o!==null&&v!==null&&f.current!==null&&f.current(),s(v),t&&t(g,m==="key"),f.current=typeof m=="function"?m:null},areChildrenBeingEdited:g=>o!==null&&o.includes(g),previouslyEditedElement:h.current,setPreviouslyEditedElement:g=>{h.current=g},tabDirection:d.current,setTabDirection:g=>{d.current=g},previousValue:l,setPreviousValue:c,dragSource:a,setDragSource:u},children:e})},Bt=()=>{const e=A.useContext(Hc);if(!e)throw new Error("Missing Context Provider");return e},Sa=(e,t)=>{if(t===null)return!1;if(!t.includeChildren)return t.path.every((n,r)=>e[r]===n)&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},ao="**INVALID_FUNCTION**",F1=({nodeData:e,showStringQuotes:t=!0,stringTruncate:n=200,pathString:r,canEdit:i,setIsEditing:o,styles:s,translate:l,value:c,TextWrapper:a=({children:u})=>u})=>{const u=c??e.value,[f,d]=A.useState(!1),h=t?'"':"",g=u.length>n,m=()=>{i?o(!0):d(!f)};return E.jsxs("div",{id:`${r}_display`,onDoubleClick:m,onClick:v=>{(v.getModifierState("Control")||v.getModifierState("Meta"))&&m()},className:"jer-value-string",style:s,children:[h,g?E.jsxs(E.Fragment,f?{children:[E.jsx(a,{children:E.jsxs("span",{children:[u,h]})}),E.jsxs("span",{className:"jer-string-expansion jer-show-less",onClick:()=>d(!1),children:[" ",l("SHOW_LESS",e)]})]}:{children:[E.jsxs(a,{children:[E.jsx("span",{children:u.slice(0,n-2).trimEnd()})," "]}),E.jsx("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>d(!0),children:"..."}),h]}):E.jsx(a,{children:`${u}${h}`})]})},q1=({styles:e,pathString:t,value:n,setValue:r,handleEdit:i,handleKeyboard:o,keyboardCommon:s})=>{const l=A.useRef(null);return E.jsx(Pc,{className:"jer-input-text",textAreaRef:l,name:t,value:n,setValue:r,handleKeyPress:c=>{o(c,Object.assign({stringConfirm:i,stringLineBreak:()=>{const a=Ic(l,`
`);r(a)}},s))},styles:e})},X1=e=>{var{isEditing:t,path:n,enumType:r}=e,i=Dc(e,["isEditing","path","enumType"]);const{getStyles:o}=ct(),s=qt(n),{value:l,setValue:c,nodeData:a,handleEdit:u,handleKeyboard:f,keyboardCommon:d}=i;return t&&r?E.jsxs("div",{className:"jer-select jer-select-enums",children:[E.jsx("select",{name:`${s}-value-select`,className:"jer-select-inner",onChange:h=>c(h.target.value),value:l,autoFocus:!0,onKeyDown:h=>{f(h,Object.assign({stringConfirm:u},d))},children:r.values.map(h=>E.jsx("option",{value:h,children:h},h))}),E.jsx("span",{className:"focus"})]}):t?E.jsx(q1,Object.assign({styles:o("input",a),pathString:s},i,{setValue:i.setValue})):E.jsx(F1,Object.assign({pathString:s,styles:o("string",a)},i))},Y1=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:a}=ct();return n?E.jsx("input",{className:"jer-input-number",type:"text",name:qt(r),value:e,onChange:u=>t(u.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:u=>setTimeout(()=>u.target.select(),10),onKeyDown:u=>l(u,Object.assign({numberConfirm:o,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+"em"},a("input",s))}):E.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:a("number",s),children:e})},G1=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:a}=ct();return typeof e!="boolean"?null:n?E.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:qt(r),checked:e,onChange:()=>t(!e),onKeyDown:u=>{u.key===" "&&u.preventDefault(),l(u,Object.assign({booleanConfirm:o,booleanToggle:()=>t(!e)},c))},autoFocus:!0}):E.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:a("boolean",s),children:String(e)})},U1=(e,t)=>{const n=A.useRef(void 0),r=A.useRef(t);A.useEffect(()=>{r.current=t},[t]);const i=o=>{r.current(o)};A.useEffect(()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout(()=>{window.addEventListener("keydown",i)},100),()=>{window.clearTimeout(n.current),window.removeEventListener("keydown",i)}},[e])},W1=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:s})=>{const{getStyles:l}=ct();return U1(t,c=>o(c,Object.assign({confirm:r},s))),E.jsx("div",{onDoubleClick:()=>n(!0),className:"jer-value-null",style:l("null",i),children:String(e)})},K1=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===ao&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return E.jsx("span",{className:"jer-value-invalid",children:t})},Z1=({size:e,style:t,className:n})=>E.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:[E.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),E.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),Q1=({size:e,style:t,className:n})=>E.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,transform:"translate(0, 0.5)",children:[E.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),E.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),J1=({size:e,style:t,className:n})=>E.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:E.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),ev=({size:e,style:t,className:n})=>E.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[E.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),E.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),E.jsx("path",{d:"M15 10l-4 4 4 4"})]}),tv=({size:e,style:t,className:n})=>E.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[E.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),E.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),nv=({size:e,style:t,className:n})=>E.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:E.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),rv=({size:e,style:t,className:n})=>E.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:n,style:t,children:E.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),Ot=({name:e,nodeData:t})=>{var n,r,i,o,s,l,c;const{getStyles:a,icons:u}=ct(),f={size:"1.4em",className:"jer-icon"};switch(e){case"add":return(n=u==null?void 0:u.add)!==null&&n!==void 0?n:E.jsx(Z1,Object.assign({},f,{style:a("iconAdd",t)}));case"edit":return(r=u==null?void 0:u.edit)!==null&&r!==void 0?r:E.jsx(Q1,Object.assign({},f,{style:a("iconEdit",t)}));case"delete":return(i=u==null?void 0:u.delete)!==null&&i!==void 0?i:E.jsx(J1,Object.assign({},f,{style:a("iconDelete",t),size:"1.45em"}));case"copy":return(o=u==null?void 0:u.copy)!==null&&o!==void 0?o:E.jsx(ev,Object.assign({},f,{style:a("iconCopy",t),size:"1.2em"}));case"ok":return(s=u==null?void 0:u.ok)!==null&&s!==void 0?s:E.jsx(tv,Object.assign({},f,{style:Object.assign({fontSize:"90%"},a("iconOk",t))}));case"cancel":return(l=u==null?void 0:u.cancel)!==null&&l!==void 0?l:E.jsx(nv,Object.assign({},f,{style:Object.assign({fontSize:"130%"},a("iconCancel",t))}));case"chevron":return(c=u==null?void 0:u.chevron)!==null&&c!==void 0?c:E.jsx(rv,{size:"1em",style:a("iconCollection",t)});default:return E.jsx(E.Fragment,{})}},Vc=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:o,nodeData:s,translate:l,keyboardControls:c,handleKeyboard:a,editConfirmRef:u,getNewKeyOptions:f,jsonStringify:d})=>{const{getStyles:h}=ct(),g=l("KEY_NEW",s),[m,v]=A.useState(g),[w,C]=A.useState(!1),{key:y,path:_,value:p}=s,k=Array.isArray(w),S=N=>{var R;if(!N)return void C(!1);const H=Object.keys(hn(s.fullData,_)),$=f?(R=f(s))===null||R===void 0?void 0:R.filter(z=>!H.includes(z)):null;$&&v(""),C($==null||$)};return E.jsxs("div",{className:"jer-edit-buttons",style:{opacity:w?1:void 0},onClick:N=>N.stopPropagation(),children:[r&&E.jsx("div",{onClick:N=>{var R;N.stopPropagation();let H,$,z="value",O="",b=null;if(r){const M=$o(N);if(M&&c.clipboardModifier.includes(M)?(H=iv(_),O=H,z="path"):(H=p,O=typeof H=="object"?d(p):String(H)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:H,stringValue:O,path:_,key:y,type:z,errorMessage:"Can't access clipboard API"}));(R=navigator.clipboard)===null||R===void 0||R.writeText(O).then(()=>$=!0).catch(j=>{$=!1,b=j.message}).finally(()=>{typeof r=="function"&&r({success:$,errorMessage:b,value:H,stringValue:O,path:_,key:y,type:z})})}},className:"jer-copy-pulse",children:E.jsx(Ot,{name:"copy",nodeData:s})}),e&&E.jsx("div",{onClick:e,children:E.jsx(Ot,{name:"edit",nodeData:s})}),t&&E.jsx("div",{onClick:t,children:E.jsx(Ot,{name:"delete",nodeData:s})}),n&&E.jsx("div",{onClick:()=>{i==="object"?S(!0):n("")},children:E.jsx(Ot,{name:"add",nodeData:s})}),o==null?void 0:o.map(({Element:N,onClick:R},H)=>E.jsx("div",{onClick:$=>R&&R(s,$),children:E.jsx(N,{nodeData:s})},H)),w&&n&&i==="object"&&E.jsxs(E.Fragment,{children:[k?E.jsxs("div",{className:"jer-select jer-select-keys",children:[E.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:N=>{n(N.target.value),S(!1)},defaultValue:"",autoFocus:!0,onKeyDown:N=>{a(N,{cancel:()=>S(!1)})},children:[E.jsx("option",{value:"",disabled:!0,children:w.length>0?l("KEY_SELECT",s):l("NO_KEY_OPTIONS",s)}),w.map(N=>E.jsx("option",{value:N,children:N},N))]}),E.jsx("span",{className:"focus"})]}):E.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:m,onChange:N=>v(N.target.value),autoFocus:!0,onFocus:N=>N.target.select(),onKeyDown:N=>{a(N,{stringConfirm:()=>{n&&(S(!1),n(m),v(g))},cancel:()=>{S(!1),v(g)}})},style:h("input",s)}),E.jsx(Lo,{onOk:()=>{k&&!m||(S(!1),n(m))},onCancel:()=>{S(!1)},nodeData:s,editConfirmRef:u,hideOk:k})]})]})},Lo=({onOk:e,onCancel:t,nodeData:n,editConfirmRef:r,hideOk:i=!1})=>E.jsxs("div",{className:"jer-confirm-buttons",children:[!i&&E.jsx("div",{onClick:e,ref:r,children:E.jsx(Ot,{name:"ok",nodeData:n})}),E.jsx("div",{onClick:t,children:E.jsx(Ot,{name:"cancel",nodeData:n})})]}),iv=e=>e.reduce((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`,""),ov=["string","number","boolean","null","object","array"],Bc=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:i,onEdit:o,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:a,restrictAddFilter:u,restrictDragFilter:f,translate:d,errorMessageTimeout:h}=e,{currentlyEditingElement:g,setCurrentlyEditingElement:m}=Bt(),[v,w]=A.useState(null),C=Object.assign(Object.assign({},r),{collapsed:t}),{path:y,key:_,size:p}=C,k=qt(y),S=!c(C),N=!a(C),R=!u(C),H=!f(C)&&N&&g===null,$=I=>{l&&(w(I),setTimeout(()=>w(null),h)),console.warn("Error",I)},z=A.useCallback((I,P)=>{$(I.message),s&&s({currentData:C.fullData,errorValue:P,currentValue:n,name:_,path:y,error:I})},[s,l]),O=g===k,b=g===`key_${k}`,M=typeof y.slice(-1)[0]=="number",j={isEditing:O,isEditingKey:b,isArray:M,canEditKey:i!==null&&S&&R&&N&&!M},D=_===""&&y.length>0?d("EMPTY_STRING",C):null;return{pathString:k,nodeData:C,path:y,name:_,size:p,canEdit:S,canDelete:N,canAdd:R,canDrag:H,error:v,showError:$,onError:z,setError:w,handleEditKey:I=>{if(m(null),_===I||!i)return;const P=y.slice(0,-1);if(Object.keys(i).includes(I))return void z({code:"KEY_EXISTS",message:d("ERROR_KEY_EXISTS",C)},I);const x=Object.fromEntries(Object.entries(i).map(([T,L])=>T===_?[I,L]:[T,L]));o(x,P).then(T=>{T&&z({code:"UPDATE_ERROR",message:T},I)})},derivedValues:j,emptyStringKey:D}},Fc=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:o,translate:s})=>{const{getStyles:l}=ct(),{dragSource:c,setDragSource:a}=Bt(),[u,f]=A.useState(!1),d=qt(n),h=A.useMemo(()=>e?{onDragStart:w=>{w.stopPropagation(),a({path:n,pathString:d})},onDragEnd:w=>{w.stopPropagation(),a({path:null,pathString:null})}}:{},[e,d]),g=A.useMemo(()=>w=>t?{onDragOver:C=>{C.stopPropagation(),C.preventDefault()},onDrop:C=>{C.stopPropagation(),v(w),a({path:null,pathString:null}),f(!1)},onDragEnter:C=>{var y;C.stopPropagation(),d.startsWith((y=c.pathString)!==null&&y!==void 0?y:"")||f(w)},onDragExit:C=>{C.stopPropagation(),f(!1)}}:{},[c,t,d]),m=A.useMemo(()=>t&&c.pathString!==null?E.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},g("below"))):null,[c,t,n.length]),v=w=>{var C,y;const _=(C=c.path)===null||C===void 0?void 0:C.slice(-1)[0],p=(y=c.path)===null||y===void 0?void 0:y.slice(0,-1).join("."),k=n.slice(0,-1).join(""),{parentData:S}=r;typeof _=="string"&&S&&!Array.isArray(S)&&Object.keys(S).includes(_)&&_ in S&&p!==k?o({code:"KEY_EXISTS",message:s("ERROR_KEY_EXISTS",r)},_):i(c.path,n,w).then(N=>{N&&o({code:"UPDATE_ERROR",message:N},r.value)})};return{dragSourceProps:h,getDropTargetProps:g,BottomDropTarget:m,DropTargetPadding:({position:w,nodeData:C})=>u===w?E.jsx("div",{className:"jer-drag-n-drop-padding",style:l("dropZone",C)}):null,handleDrop:v}},sv=(e,t,n,r)=>{var i,o,s;if(!t.current)return 0;const l=parseInt((i=getComputedStyle(n.current).getPropertyValue("line-height"))!==null&&i!==void 0?i:"16px"),c=((s=(o=t.current)===null||o===void 0?void 0:o.offsetWidth)!==null&&s!==void 0?s:0)/(.5*l),a=r(e).replace(/\\n/g,`
`).split(`
`).map(u=>Math.ceil(u.length/c)).reduce((u,f)=>u+f,0)*l;return Math.min(a+30,window.innerHeight-50)},Kr=({isEditingKey:e,canEditKey:t,pathString:n,path:r,name:i,handleKeyboard:o,handleEditKey:s,handleCancel:l,handleClick:c,keyValueArray:a,styles:u,getNextOrPrevious:f,emptyStringKey:d})=>{const{setCurrentlyEditingElement:h}=Bt();return e?E.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:n,defaultValue:i,autoFocus:!0,onFocus:g=>g.target.select(),onKeyDown:g=>o(g,{stringConfirm:()=>s(g.target.value),cancel:l,tabForward:()=>{if(s(g.target.value),a){const m=a==null?void 0:a[0][0];h(m?[...r,m]:f("next"))}else h(r)},tabBack:()=>{s(g.target.value),h(f("prev"))}}),style:{width:String(i).length/1.5+.5+"em"}}):E.jsxs("span",{className:"jer-key-text",style:Object.assign(Object.assign({},u),{minWidth:`${Math.min(String(i).length+1,5)}ch`,flexShrink:i.length>10?1:0}),onDoubleClick:()=>t&&h(r,"key"),onClick:c,children:[d?E.jsx("span",{className:"jer-empty-string",children:d}):i,i!==""||d?E.jsx("span",{className:"jer-key-colon",children:":"}):null]})},qc=e=>{const{data:t,parentData:n,onEdit:r,onDelete:i,onChange:o,onMove:s,enableClipboard:l,canDragOnto:c,restrictTypeSelection:a,searchFilter:u,searchText:f,showLabel:d,stringTruncate:h,showStringQuotes:g,indent:m,translate:v,customNodeDefinitions:w,customNodeData:C,handleKeyboard:y,keyboardControls:_,sort:p,editConfirmRef:k,jsonStringify:S}=e,{getStyles:N}=ct(),{setCurrentlyEditingElement:R,setCollapseState:H,previouslyEditedElement:$,setPreviouslyEditedElement:z,tabDirection:O,setTabDirection:b,previousValue:M,setPreviousValue:j}=Bt(),[D,I]=A.useState(typeof t=="function"?ao:t),{pathString:P,nodeData:x,path:T,name:L,canEdit:V,canDelete:B,canDrag:X,error:F,onError:G,handleEditKey:q,emptyStringKey:K,derivedValues:ae}=Bc({props:e}),{dragSourceProps:ie,getDropTargetProps:W,BottomDropTarget:Q,DropTargetPadding:Z}=Fc({canDrag:X,canDragOnto:c,path:T,nodeData:x,onMove:s,onError:G,translate:v}),[le,J]=A.useState(lo(t,C)),fe=A.useCallback(U=>{if(!o)return void I(U);const ge=o({currentData:x.fullData,newValue:U,currentValue:D,name:L,path:T});I(ge)},[o]);A.useEffect(()=>{I(typeof t=="function"?ao:t),J(lo(t,C))},[t,F]);const{CustomNode:be,customNodeProps:ze,hideKey:je,showEditTools:He=!0,showOnEdit:De,showOnView:Xe,passOriginalNode:Ze}=C,Ye=[...ov,...w.filter(({showInTypesSelector:U=!1,name:ge})=>U&&!!ge).map(({name:U})=>U)],Ee=A.useMemo(()=>{if(typeof a=="boolean")return a?[]:Ye;if(Array.isArray(a))return a;const U=a(x);return typeof U=="boolean"?U?[]:Ye:U},[x,a]),[Ve,Ge]=A.useState(((U,ge)=>{var me;if(typeof U!="string")return null;const Ne=ge.filter(Ae=>Ae instanceof Object&&Ae.enum&&Ae.values.includes(U)&&Ae.matchPriority);return Ne.sort((Ae,Te)=>{var dt,ft;return((dt=Te.matchPriority)!==null&&dt!==void 0?dt:0)-((ft=Ae.matchPriority)!==null&&ft!==void 0?ft:0)}),(me=Ne[0])!==null&&me!==void 0?me:null})(D,Ee)),{isEditing:Pe}=ae,nt=Oc("value",x,u,f);if(Pe&&(!nt||!V)){const U=Pt(x.fullData,T,O,p);R(U||$)}if(!nt)return null;const Ue=U=>{let ge;if(R(null),j(null),U===void 0||(me=>me&&typeof me=="object"&&"type"in me&&"target"in me&&"preventDefault"in me&&typeof me.preventDefault=="function")(U))switch(le){case"object":ge={[v("DEFAULT_NEW_KEY",x)]:D};break;case"array":ge=D??[];break;case"number":{const me=Number(D);ge=isNaN(me)?0:me;break}default:ge=D}else ge=U;r(ge,T).then(me=>{me&&G({code:"UPDATE_ERROR",message:me},ge)})},Oe=()=>{R(null),M===null?(I(t),j(null)):r(M,T)},{isEditingKey:xt,canEditKey:$e}=ae,Ce=!Pe&&F,ut=Pe&&Ee.length>1,re=(le!=="invalid"||be)&&!F&&He,ne=d&&!je,ce=be&&(Pe&&De||!Pe&&Xe),pe={value:D,parentData:n,setValue:fe,isEditing:Pe,canEdit:V,setIsEditing:V?()=>R(T):()=>{},handleEdit:Ue,handleCancel:Oe,path:T,stringTruncate:h,showStringQuotes:g,nodeData:x,enumType:Ve,translate:v,handleKeyboard:y,keyboardCommon:{cancel:Oe,tabForward:()=>{b("next"),z(P);const U=Pt(x.fullData,T,"next",p);U&&(Ue(),R(U))},tabBack:()=>{b("prev"),z(P);const U=Pt(x.fullData,T,"prev",p);U&&(Ue(),R(U))}}},ue={canEditKey:$e,isEditingKey:xt,pathString:P,path:T,name:L,handleKeyboard:y,handleEditKey:q,handleCancel:Oe,styles:N("property",x),getNextOrPrevious:U=>Pt(x.fullData,T,U,p),emptyStringKey:K},he=ce?E.jsx(be,Object.assign({},e,{value:D,customNodeProps:ze,setValue:fe,handleEdit:Ue,handleCancel:Oe,handleKeyPress:U=>y(U,{stringConfirm:Ue,cancel:Oe}),isEditing:Pe,setIsEditing:()=>R(T),getStyles:N,originalNode:Ze?Ca(t,pe):void 0,originalNodeKey:Ze?E.jsx(Kr,Object.assign({},ue)):void 0,canEdit:V,keyboardCommon:pe.keyboardCommon,onError:G})):Ca(t,pe);return E.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:m/2+"em",position:"relative"},draggable:X},ie,W("above"),{children:[Q,E.jsx(Z,{position:"above",nodeData:x}),E.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:L.length>10?"wrap":"nowrap"},children:[ne&&E.jsx(Kr,Object.assign({},ue)),E.jsxs("div",{className:"jer-value-and-buttons",children:[E.jsx("div",{className:"jer-input-component",children:he}),Pe?E.jsx(Lo,{onOk:Ue,onCancel:Oe,nodeData:x,editConfirmRef:k}):re&&E.jsx(Vc,{startEdit:V?()=>{j(M),R(T,Oe)}:void 0,handleDelete:B?()=>{i(D,T).then(U=>{U&&G({code:"DELETE_ERROR",message:U},D)})}:void 0,enableClipboard:l,translate:v,customButtons:e.customButtons,nodeData:x,handleKeyboard:y,keyboardControls:_,editConfirmRef:k,jsonStringify:S}),ut&&E.jsxs("div",{className:"jer-select jer-select-types",children:[E.jsx("select",{name:`${L}-type-select`,className:"jer-select-inner",onChange:U=>(ge=>{const me=w.find(Te=>Te.name===ge);if(me)return r(me.defaultValue,T),J(ge),Ge(null),R(null),void H({path:T,collapsed:!1,includeChildren:!1});const Ne=Ee.find(Te=>Te instanceof Object&&Te.enum===ge);if(Ne)return typeof D=="string"&&Ne.values.includes(D)||r(Ne.values[0],T).then(Te=>{Te&&(G({code:"UPDATE_ERROR",message:Te},Ae),R(null))}),void Ge(Ne);const Ae=av(D,ge,v("DEFAULT_NEW_KEY",x),C!=null&&C.CustomNode?v("DEFAULT_STRING",x):void 0);r(Ae,T).then(Te=>{Te?(G({code:"UPDATE_ERROR",message:Te},Ae),R(null)):Ge(null)})})(U.target.value),value:Ve?Ve.enum:le,children:Ee.map(U=>U instanceof Object&&"enum"in U?E.jsx("option",{value:U.enum,children:U.enum},U.enum):E.jsx("option",{value:U,children:U},U))}),E.jsx("span",{className:"focus"})]}),Ce&&E.jsx("span",{className:"jer-error-slug",style:N("error",x),children:F})]})]}),E.jsx(Z,{position:"below",nodeData:x})]}))},lo=(e,t)=>t!=null&&t.CustomNode&&(t!=null&&t.name)&&t.showInTypesSelector?t.name:typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":e===null?"null":"invalid",Ca=(e,t)=>{const n=lo(e),{value:r}=t;switch(n){case"string":return E.jsx(X1,Object.assign({},t,{value:r}));case"number":return E.jsx(Y1,Object.assign({},t,{value:r}));case"boolean":return E.jsx(G1,Object.assign({},t,{value:r}));case"null":return E.jsx(W1,Object.assign({},t));default:return E.jsx(K1,Object.assign({},t))}},av=(e,t,n,r)=>{switch(t){case"string":return r??String(e);case"number":{const i=Number(e);return isNaN(i)?0:i}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},Xc=(e=[],t)=>{const n=e.filter(({condition:g})=>g(t));if(n.length===0)return{};const r=n[0],{element:i,wrapperElement:o,customNodeProps:s,wrapperProps:l,hideKey:c=!1,showEditTools:a=!0,showOnEdit:u=!1,showOnView:f=!0,showCollectionWrapper:d=!0}=r,h=Dc(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,customNodeProps:s,wrapperProps:l,hideKey:c,showEditTools:a,showOnEdit:u,showOnView:f,showCollectionWrapper:d},h)},Yc=e=>{const{getStyles:t}=ct(),{collapseState:n,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:o,setCurrentlyEditingElement:s,areChildrenBeingEdited:l,previousValue:c,setPreviousValue:a}=Bt(),{mainContainerRef:u,data:f,nodeData:d,parentData:h,showCollectionCount:g,onEdit:m,onAdd:v,onDelete:w,canDragOnto:C,collapseFilter:y,collapseAnimationTime:_,onMove:p,enableClipboard:k,searchFilter:S,searchText:N,indent:R,sort:H,showArrayIndices:$,defaultValue:z,newKeyOptions:O,translate:b,customNodeDefinitions:M,customNodeData:j,jsonParse:D,jsonStringify:I,TextEditor:P,keyboardControls:x,handleKeyboard:T,insertAtTop:L,onCollapse:V,editConfirmRef:B,collapseClickZones:X}=e,[F,G]=A.useState(I(f)),q=y(d),{contentRef:K,isAnimating:ae,maxHeight:ie,collapsed:W,animateCollapse:Q,cssTransitionValue:Z}=((ee,ve,Be,Ie,We)=>{const[mi,Wt]=A.useState(Be?0:void 0),[Nt,yi]=A.useState(Be),wn=A.useRef(!1),bn=A.useRef(null),fr=A.useRef(0),hr=A.useRef(0),vi=ve/1e3+"s",xi=A.useCallback(kn=>{var bt,_n;if(Nt!==kn){switch(window.clearTimeout(hr.current),wn.current=!0,kn){case!0:{const pr=(_n=(bt=bn.current)===null||bt===void 0?void 0:bt.offsetHeight)!==null&&_n!==void 0?_n:0;fr.current=pr,Wt(pr),setTimeout(()=>{Wt(0)},5);break}case!1:Wt(fr.current||sv(ee,bn,Ie,We))}yi(!Nt),hr.current=window.setTimeout(()=>{wn.current=!1,kn||Wt(void 0)},ve)}},[ve,Nt,ee,Ie,We]);return{contentRef:bn,isAnimating:wn.current,animateCollapse:xi,maxHeight:mi,collapsed:Nt,cssTransitionValue:vi}})(f,_,q,u,I),{pathString:le,nodeData:J,path:fe,name:be,size:ze,canEdit:je,canDelete:He,canAdd:De,canDrag:Xe,error:Ze,setError:Ye,onError:Ee,handleEditKey:Ve,emptyStringKey:Ge,derivedValues:Pe}=Bc({props:e,collapsed:W}),{dragSourceProps:nt,getDropTargetProps:Ue,BottomDropTarget:Oe,DropTargetPadding:xt}=Fc({canDrag:Xe,canDragOnto:C,path:fe,nodeData:J,onMove:p,onError:Ee,translate:b}),$e=A.useRef(!q),{isEditing:Ce,isEditingKey:ut,isArray:re,canEditKey:ne}=Pe;A.useEffect(()=>{G(I(f))},[f,I]),A.useEffect(()=>{const ee=y(J)&&!Ce;$e.current=!ee,Q(ee)},[y]),A.useEffect(()=>{if(n!==null){const ee=i(fe);ee&&($e.current=!0,Q(ee.collapsed))}},[n]);const ce=A.useRef(null),pe=A.useCallback((ee,ve)=>{if(typeof z!="function")return z;const Be=z(ee,ve);return Be!==void 0?Be:null},[z]),ue=A.useCallback(ee=>O?typeof O!="function"?O:O(ee):null,[O]),{CustomNode:he,customNodeProps:U,CustomWrapper:ge,wrapperProps:me={},hideKey:Ne,showEditTools:Ae=!0,showOnEdit:Te,showOnView:dt,showCollectionWrapper:ft=!0}=j,Xt=l(le);if(Xt&&W&&Q(!1),!(Oc("collection",J,S,N)||J.level===0)&&!Xt)return null;const wt=Array.isArray(f)?"array":"object",yn=wt==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},ir=ee=>{if(ee.key!=="Tab"||ee.getModifierState("Shift"))T(ee,{objectConfirm:Gt,cancel:Ct});else{ee.preventDefault();const ve=Ic(ce,"	");G(ve)}},Yt=ee=>{ee.stopPropagation();const ve=$o(ee);if(ve&&x.collapseModifier.includes(ve))return $e.current=!0,void r({collapsed:!W,path:fe,includeChildren:!0});o&&o.includes(le)||($e.current=!0,r(null),V&&V({path:fe,collapsed:!W,includeChildren:!1}),Q(!W))},Gt=()=>{try{const ee=D(F);if(s(null),a(null),Ye(null),I(ee)===I(f))return;m(ee,fe).then(ve=>{ve&&Ee({code:"UPDATE_ERROR",message:ve},ee)})}catch{Ee({code:"INVALID_JSON",message:b("ERROR_INVALID_JSON",J)},F)}},hi=fe.length>0?()=>{w(f,fe).then(ee=>{ee&&Ee({code:"DELETE_ERROR",message:ee},f)})}:void 0,Ct=()=>{s(null),c===null?(Ye(null),G(I(f)),a(null)):m(c,fe)},or=g==="when-closed"?W:g,pi=!Ce&&Ae,sr=($||!re)&&!Ne&&be!==void 0,ar=he&&(Ce&&Te||!Ce&&dt),Ut=Object.entries(f).map(([ee,ve])=>[wt==="array"?Number(ee):ee,ve]);wt==="object"&&H(Ut,ee=>ee);const lr=$e.current?Ce?E.jsxs("div",{className:"jer-collection-text-edit",children:[P?E.jsx(P,{value:F,onChange:G,onKeyDown:ee=>T(ee,{objectConfirm:Gt,cancel:Ct})}):E.jsx(Pc,{textAreaRef:ce,className:"jer-collection-text-area",name:le,value:F,setValue:G,handleKeyPress:ir,styles:t("input",J)}),E.jsx("div",{className:"jer-collection-input-button-row",children:E.jsx(Lo,{onOk:Gt,onCancel:Ct,nodeData:J,editConfirmRef:B})})]}):Ut.map(([ee,ve],Be)=>{const Ie={key:ee,value:ve,path:[...fe,ee],level:fe.length+1,index:Be,size:pn(ve)?Object.keys(ve).length:null,parentData:f,fullData:J.fullData},We=Xc(M,Ie);return E.jsx("div",{className:"jer-collection-element",style:t("collectionElement",Ie),children:pn(ve)&&!(We!=null&&We.renderCollectionAsValue)?E.jsx(Yc,Object.assign({},e,{data:ve,parentData:f,nodeData:Ie,showCollectionCount:g,canDragOnto:je,customNodeData:We}),ee):E.jsx(qc,Object.assign({},e,{data:ve,parentData:f,nodeData:Ie,canDragOnto:je,showLabel:wt==="object"||$,customNodeData:We}),ee)},ee)}):null,vn=!!ft&&W&&!Xt;vn||($e.current=!0);const cr=Object.assign(Object.assign({},e),{data:f,value:f,parentData:h,nodeData:J,setValue:ee=>en(void 0,void 0,void 0,function*(){return yield m(ee,fe)}),handleEdit:Gt,handleCancel:Ct,handleKeyPress:ir,isEditing:Ce,setIsEditing:()=>s(fe),getStyles:t,canDragOnto:je,canEdit:je,keyboardCommon:{},onError:Ee}),gi=ar?E.jsx(he,Object.assign({customNodeProps:U},cr,{children:lr})):lr,ur=pi&&E.jsx(Vc,{startEdit:je?()=>{$e.current=!0,a(null),s(fe)}:void 0,handleAdd:De?ee=>{Q(!1);const ve=pe(J,ee);if(wt==="array"){const Be=L.array?0:f.length,Ie=L.array?{insert:!0}:{};v(ve,[...fe,Be],Ie).then(We=>{We&&Ee({code:"ADD_ERROR",message:We},ve)})}else if(ee in f)Ee({code:"KEY_EXISTS",message:b("ERROR_KEY_EXISTS",J)},ee);else{const Be=L.object?{insertBefore:0}:{};v(ve,[...fe,ee],Be).then(Ie=>{Ie&&Ee({code:"ADD_ERROR",message:Ie},ve)})}}:void 0,handleDelete:He?hi:void 0,enableClipboard:k,type:wt,nodeData:J,translate:b,customButtons:e.customButtons,keyboardControls:x,handleKeyboard:T,getNewKeyOptions:ue,editConfirmRef:B,jsonStringify:I}),dr={canEditKey:ne,isEditingKey:ut,pathString:le,path:fe,name:be,handleKeyboard:T,handleEditKey:Ve,handleCancel:Ct,keyValueArray:Ut,styles:t("property",J),getNextOrPrevious:ee=>Pt(J.fullData,fe,ee,H),handleClick:X.includes("property")?Yt:ee=>ee.stopPropagation(),emptyStringKey:Ge},xn=E.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(fe.length===0?0:R/2)+"em"},t("collection",J)),{position:"relative"}),draggable:Xe},nt,Ue("above"),{children:[E.jsx("div",{className:"jer-clickzone",style:{width:R/2+1+"em",zIndex:10+2*J.level},onClick:X.includes("left")?Yt:void 0}),!Ce&&Oe,E.jsx(xt,{position:"above",nodeData:J}),ft?E.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:X.includes("header")?Yt:void 0,children:[E.jsxs("div",{className:"jer-collection-name",children:[E.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(W?" jer-rotate-90":""),style:{zIndex:11+2*J.level,transition:Z},onClick:Yt,children:E.jsx(Ot,{name:"chevron",rotate:W,nodeData:J})}),sr&&E.jsx(Kr,Object.assign({},dr)),!Ce&&E.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",J),children:yn.open})]}),!Ce&&or&&E.jsx("div",{className:"jer-collection-item-count"+(or?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},t("itemCount",J)),{transition:Z}),children:ze===1?b("ITEM_SINGLE",Object.assign(Object.assign({},J),{size:1}),1):b("ITEMS_MULTIPLE",J,ze)}),E.jsx("div",{className:"jer-brackets"+(vn?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},t("bracket",J)),{transition:Z}),children:yn.close}),ur]}):Ne?E.jsx(E.Fragment,{}):E.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[E.jsx(Kr,Object.assign({},dr)),ur]}),E.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:vn||ae?"clip":"visible",maxHeight:Xt?void 0:ie},t("collectionInner",J)),{transition:Z}),ref:K,children:[gi,E.jsx("div",{className:Ce?"jer-collection-error-row":"jer-collection-error-row-edit",children:Ze&&E.jsx("span",{className:"jer-error-slug",style:t("error",J),children:Ze})}),!Ce&&ft&&E.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},t("bracket",J)),{marginLeft:(R<3?-1:R<6?-.5:0)+"em"}),children:yn.close})]}),E.jsx(xt,{position:"below",nodeData:J})]}));return ge?E.jsx(ge,Object.assign({customNodeProps:me},cr,{children:xn})):xn},lv={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>"},cv=(e,t)=>(n,r,i)=>((o,s,l,c,a)=>{if(s[c]){const f=s[c](l);if(f!==null)return f}const u=c in o?o[c]:lv[c];return a===void 0?u:u==null?void 0:u.replace("{{count}}",String(a))})(e,t,r,n,i);var Na=[],Pn=[];(function(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",i=t.singleTag===!0,o=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=Na.indexOf(o);s===-1&&(s=Na.push(o)-1,Pn[s]={}),n=Pn[s]&&Pn[s][r]?Pn[s][r]:Pn[s][r]=l()}else n=l();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var c=document.createElement("style");if(c.setAttribute("type","text/css"),t.attributes)for(var a=Object.keys(t.attributes),u=0;u<a.length;u++)c.setAttribute(a[u],t.attributes[a[u]]);var f=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(f,c),c}})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const uv=({data:e,setData:t,rootName:n="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:s=r,onChange:l,onError:c,showErrorMessages:a=!0,enableClipboard:u=!0,indent:f=2,collapse:d=!1,collapseAnimationTime:h=300,showCollectionCount:g=!0,restrictEdit:m=!1,restrictDelete:v=!1,restrictAdd:w=!1,restrictTypeSelection:C=!1,restrictDrag:y=!0,viewOnly:_,searchFilter:p,searchText:k,searchDebounceTime:S=350,keySort:N=!1,showArrayIndices:R=!0,showStringQuotes:H=!0,defaultValue:$=null,newKeyOptions:z,minWidth:O=250,maxWidth:b="min(600px, 90vw)",rootFontSize:M,stringTruncate:j=250,translations:D={},className:I,id:P,customText:x={},customNodeDefinitions:T=[],customButtons:L=[],jsonParse:V=JSON.parse,jsonStringify:B=(W,Q)=>JSON.stringify(W,Q,2),TextEditor:X,errorMessageTimeout:F=2500,keyboardControls:G={},externalTriggers:q,insertAtTop:K=!1,onCollapse:ae,collapseClickZones:ie=["header","left"]})=>{const{getStyles:W}=ct(),{setCurrentlyEditingElement:Q}=Bt(),Z=A.useMemo(()=>$n(d),[d]),le=A.useMemo(()=>cv(D,x),[D,x]),[J,fe]=A.useState(k),[be,ze]=(({setData:re,data:ne})=>{const[ce,pe]=A.useState(re?void 0:ne),ue=A.useCallback(he=>{re?re(he):pe(he)},[re]);return A.useEffect(()=>{re||pe(ne)},[ne]),[re?ne:ce,ue]})({setData:t,data:e}),je=A.useRef(null);A.useEffect(()=>{Q(null);const re=setTimeout(()=>fe(k),S);return()=>clearTimeout(re)},[k,S]);const He={key:n,path:[],level:0,index:0,value:be,size:typeof be=="object"&&be!==null?Object.keys(be).length:1,parentData:null,fullData:be},De=(re,ne)=>en(void 0,void 0,void 0,function*(){const ce=yield re(ne);if(ce===!0||ce===void 0)return void ze(ne.newData);const pe=fv(ce)?ce:["error",ce],[ue,he]=pe;if(ue==="error")return ze(ne.currentData),he===!1?le("ERROR_UPDATE",He):String(he);ze(he)}),Xe=A.useMemo(()=>$n(m,_),[m,_]),Ze=A.useMemo(()=>$n(v,_),[v,_]),Ye=A.useMemo(()=>$n(w,_),[w,_]),Ee=A.useMemo(()=>$n(y,_),[y,_]),Ve=A.useMemo(()=>dv(p),[p]),Ge=A.useMemo(()=>(re=>{const ne=Object.assign({},Ea);for(const ce of Object.keys(Ea)){const pe=ce;if(re[pe]){const ue=re[pe],he=["clipboardModifier","collapseModifier"].includes(ce)?Array.isArray(ue)?ue:[ue]:typeof ue=="string"?{key:ue}:ue;ne[pe]=he,["stringConfirm","numberConfirm","booleanConfirm"].forEach(U=>{!re[U]&&re.confirm&&(ne[U]=ne.confirm)})}}return ne})(G),[G]),Pe=A.useCallback((re,ne)=>((ce,pe,ue)=>{const he=Object.entries(pe);for(const[U,ge]of he)if($1(ue,ce[U],U)){ue.preventDefault(),ge();break}})(Ge,ne,re),[Ge]),nt=A.useMemo(()=>{const re=Ta(T,"stringifyReplacer");return ne=>B(ne,re)},[T,B]),Ue=A.useMemo(()=>{const re=Ta(T,"parseReviver");return ne=>{const ce=V(ne,re);return so(ce)}},[T,V]),Oe=A.useRef(null);((re,ne)=>{const{setCurrentlyEditingElement:ce,currentlyEditingElement:pe,setCollapseState:ue}=Bt();A.useEffect(()=>{if(!re)return;const{collapse:he,edit:U}=re;he&&ue(he);const ge=!(U!=null&&U.path)||qt(U.path)===pe;switch(U==null?void 0:U.action){case"accept":ge&&(ne.current&&ne.current.click(),ce(null));break;case"cancel":ge&&ce(null);break;default:U!=null&&U.path&&ce(U.path)}},[re])})(q,Oe);const xt=A.useCallback((re,ne)=>{N!==!1&&(typeof N!="function"?re.sort((ce,pe)=>{const ue=ne(ce)[0],he=ne(pe)[0];return ue<he?-1:ue>he?1:0}):re.sort((ce,pe)=>N(ne(ce),ne(pe))))},[N]),$e=Xc(T,He),Ce={mainContainerRef:je,name:n,nodeData:He,onEdit:(re,ne)=>en(void 0,void 0,void 0,function*(){const{currentData:ce,newData:pe,currentValue:ue,newValue:he}=On(be,ne,re,"update");if(ue!==he)return yield De(i,{currentData:ce,newData:pe,currentValue:ue,newValue:he,name:ne.slice(-1)[0],path:ne})}),onDelete:(re,ne)=>en(void 0,void 0,void 0,function*(){const{currentData:ce,newData:pe,currentValue:ue,newValue:he}=On(be,ne,re,"delete");return yield De(o,{currentData:ce,newData:pe,currentValue:ue,newValue:he,name:ne.slice(-1)[0],path:ne})}),onAdd:(re,ne,ce)=>en(void 0,void 0,void 0,function*(){const{currentData:pe,newData:ue,currentValue:he,newValue:U}=On(be,ne,re,"add",ce);return yield De(s,{currentData:pe,newData:ue,currentValue:he,newValue:U,name:ne.slice(-1)[0],path:ne})}),onChange:l,onError:c,showErrorMessages:a,onMove:(re,ne,ce)=>en(void 0,void 0,void 0,function*(){if(re===null)return;const{currentData:pe,newData:ue,currentValue:he}=On(be,re,"","delete"),U=re.slice(-1)[0],ge=ne.slice(0,-1),me=ne.slice(-1)[0];let Ne=typeof me=="number"?ce==="above"?me:me+1:typeof U=="number"?`arr_${U}`:U;re.slice(0,-1).join(".")===ne.slice(0,-1).join(".")&&typeof U=="number"&&typeof Ne=="number"&&U<Ne&&(Ne-=1);const Ae=typeof Ne=="number"?{insert:!0}:ce==="above"?{insertBefore:me}:{insertAfter:me},{newData:Te,newValue:dt}=On(ue,[...ge,Ne],he,"add",Ae);return yield De(i,{currentData:pe,newData:Te,currentValue:he,newValue:dt,name:ne.slice(-1)[0],path:ne})}),showCollectionCount:g,collapseFilter:Z,collapseAnimationTime:h,restrictEditFilter:Xe,restrictDeleteFilter:Ze,restrictAddFilter:Ye,restrictTypeSelection:C,restrictDragFilter:Ee,canDragOnto:!1,searchFilter:Ve,searchText:J,enableClipboard:u,keySort:N,sort:xt,showArrayIndices:R,showStringQuotes:H,indent:f,defaultValue:$,newKeyOptions:z,stringTruncate:j,translate:le,customNodeDefinitions:T,customNodeData:$e,customButtons:L,parentData:null,jsonParse:Ue,jsonStringify:nt,TextEditor:X,errorMessageTimeout:F,handleKeyboard:Pe,keyboardControls:Ge,insertAtTop:{object:K===!0||K==="object",array:K===!0||K==="array"},onCollapse:ae,editConfirmRef:Oe,collapseClickZones:ie},ut=Object.assign(Object.assign({},W("container",He)),{minWidth:O,maxWidth:b});return ut.fontSize=M??ut.fontSize,E.jsx("div",{id:P,ref:je,className:`jer-editor-container ${I??""}`,style:ut,children:pn(be)&&!$e.renderCollectionAsValue?E.jsx(Yc,Object.assign({data:be},Ce)):E.jsx(qc,Object.assign({data:be,showLabel:!0},Ce))})},Zx=e=>{var t;const[n,r]=A.useState();return A.useEffect(()=>{const i=document.documentElement;r(i)},[]),n?E.jsx(L1,{theme:(t=e.theme)!==null&&t!==void 0?t:Io,icons:e.icons,docRoot:n,children:E.jsx(B1,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:E.jsx(uv,Object.assign({},e))})}):null},On=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};const o=Object.assign({remove:r==="delete"},i),s=r!=="add"?hn(e,t):void 0;return{currentData:e,newData:j1(e,t,n,o),currentValue:s,newValue:r!=="delete"?n:void 0}},$n=(e,t)=>t?()=>!0:typeof e=="boolean"?()=>e:typeof e=="number"?({level:n})=>n>=e:e,dv=e=>{if(e!==void 0)return e==="value"?gn:e==="key"?_a:e==="all"?(t,n)=>gn(t,n)||_a(t,n):e},fv=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]),Ta=(e,t)=>{const n=t==="stringifyReplacer"?[r=>r===void 0?Lc:r]:[];if(n.push(...e.map(r=>r[t]).filter(r=>!!r)),n.length!==0)return(r,i)=>{let o=i;for(const s of n)o=s(o);return o}};export{Fx as $,vv as A,wv as B,jv as C,Xv as D,Ov as E,Yv as F,yv as G,xx as H,ex as I,Ex as J,Ix as K,rx as L,ax as M,ux as N,Pv as O,vx as P,Ox as Q,gv as R,kx as S,$x as T,kv as U,Kv as V,tx as W,Bx as X,bv as Y,nx as Z,_v as _,iu as a,Zv as a0,Vx as a1,Hx as a2,Dx as a3,Rx as a4,$v as a5,px as a6,mx as a7,Gv as a8,Px as a9,yx as aA,Ax as aB,ix as aC,Uv as aD,Nv as aE,Tx as aF,Jv as aG,Mx as aH,Cx as aI,Ev as aJ,Wv as aK,ox as aL,Lx as aM,Zx as aN,pv as aO,Zr as aP,mn as aQ,ru as aR,sx as aa,wx as ab,xv as ac,hx as ad,bx as ae,Nx as af,fx as ag,Ll as ah,Ur as ai,te as aj,Iv as ak,lx as al,Qv as am,Sx as an,jx as ao,qx as ap,zx as aq,n1 as ar,Gx as as,Ux as at,Po as au,Yx as av,Wx as aw,Kx as ax,ui as ay,qr as az,mv as b,Aa as c,Bv as d,Fv as e,qv as f,Hv as g,zv as h,Vv as i,E as j,Cv as k,Sv as l,Tv as m,Mv as n,cx as o,xe as p,Xx as q,A as r,Pf as s,Dv as t,Av as u,dx as v,gx as w,_x as x,Lv as y,Rv as z};
