build-valuecurve/tools/flowchart/assets/index-C0Tb9hP5.js

3 lines
214 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const vo=!1;var Lr=Array.isArray,xl=Array.prototype.indexOf,Vr=Array.from,El=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,ms=Object.getOwnPropertyDescriptors,ys=Object.prototype,Sl=Array.prototype,Br=Object.getPrototypeOf,yi=Object.isExtensible;function Pn(e){return typeof e=="function"}const Sn=()=>{};function kl(e){return e()}function po(e){for(var t=0;t<e.length;t++)e[t]()}function _s(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}function Ce(e,t,n=!1){return e===void 0?n?t():t:e}function Xn(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const xe=2,Ho=4,Fr=8,ws=1<<24,St=16,kt=32,qt=64,Kr=128,je=512,Ee=1024,ze=2048,st=4096,He=8192,wt=16384,Lo=32768,Rt=65536,_i=1<<17,bs=1<<18,tn=1<<19,xs=1<<20,mt=1<<25,Gt=32768,mo=1<<21,Vo=1<<22,It=1<<23,ot=Symbol("$state"),Es=Symbol("legacy props"),Cl=Symbol(""),ln=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Bo(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Nl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Pl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ml(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Al(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Tl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Il(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ol(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Rl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ql=1,Hl=2,Ss=4,Ll=8,Vl=16,Bl=1,Fl=2,Kl=4,Yl=8,Wl=16,ks=1,Zl=2,be=Symbol(),Xl="http://www.w3.org/1999/xhtml",Gl="@attach";function Ul(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ql(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Cs(e){return e===this.v}function Ns(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ps(e){return!Ns(e,this.v)}let kn=!1,jl=!1;function Jl(){kn=!0}const $l=[];function Ms(e,t=!1,n=!1){return pr(e,new Map,"",$l,null,n)}function pr(e,t,n,r,o=null,i=!1){if(typeof e=="object"&&e!==null){var s=t.get(e);if(s!==void 0)return s;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Lr(e)){var a=Array(e.length);t.set(e,a),o!==null&&t.set(o,a);for(var l=0;l<e.length;l+=1){var c=e[l];l in e&&(a[l]=pr(c,t,n,r,null,i))}return a}if(Br(e)===ys){a={},t.set(e,a),o!==null&&t.set(o,a);for(var d in e)a[d]=pr(e[d],t,n,r,null,i);return a}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON=="function"&&!i)return pr(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}let fe=null;function gn(e){fe=e}function Fo(e){return Ko().get(e)}function As(e,t){return Ko().set(e,t),t}function ec(e){return Ko().has(e)}function re(e,t=!1,n){fe={p:fe,i:!1,c:null,e:null,s:e,x:null,l:kn&&!t?{s:null,u:null,$:[]}:null}}function oe(e){var t=fe,n=t.e;if(n!==null){t.e=null;for(var r of n)Ws(r)}return t.i=!0,fe=t.p,{}}function Gn(){return!kn||fe!==null&&fe.l===null}function Ko(e){return fe===null&&Bo(),fe.c??=new Map(tc(fe)||void 0)}function tc(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let cn=[];function nc(){var e=cn;cn=[],po(e)}function nn(e){if(cn.length===0){var t=cn;queueMicrotask(()=>{t===cn&&nc()})}cn.push(e)}function Ts(e){var t=ie;if(t===null)return ne.f|=It,e;if((t.f&Lo)===0){if((t.f&Kr)===0)throw e;t.b.error(e)}else vn(e,t)}function vn(e,t){for(;t!==null;){if((t.f&Kr)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const ar=new Set;let ve=null,Fe=null,et=[],Yo=null,yo=!1;class Ue{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=0;#l=null;#i=new Set;#o=new Set;skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#r>0}process(t){et=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[]};for(const r of t)this.#s(r,n);this.is_fork||this.#u(),this.is_deferred()?(this.#a(n.effects),this.#a(n.render_effects)):(ve=null,wi(n.render_effects),wi(n.effects),this.#l?.resolve()),Fe=null}#s(t,n){t.f^=Ee;for(var r=t.first;r!==null;){var o=r.f,i=(o&(kt|qt))!==0,s=i&&(o&Ee)!==0,a=s||(o&He)!==0||this.skipped_effects.has(r);if((r.f&Kr)!==0&&r.b?.is_pending()&&(n={parent:n,effect:r,effects:[],render_effects:[]}),!a&&r.fn!==null){i?r.f^=Ee:(o&Ho)!==0?n.effects.push(r):$n(r)&&((r.f&St)!==0&&this.#i.add(r),Ln(r));var l=r.first;if(l!==null){r=l;continue}}var c=r.parent;for(r=r.next;r===null&&c!==null;)c===n.effect&&(this.#a(n.effects),this.#a(n.render_effects),n=n.parent),r=c.next,c=c.parent}}#a(t){for(const n of t)(n.f&ze)!==0?this.#i.add(n):(n.f&st)!==0&&this.#o.add(n),this.#c(n.deps),ke(n,Ee)}#c(t){if(t!==null)for(const n of t)(n.f&xe)===0||(n.f&Gt)===0||(n.f^=Gt,this.#c(n.deps))}capture(t,n){this.previous.has(t)||this.previous.set(t,n),(t.f&It)===0&&(this.current.set(t,t.v),Fe?.set(t,t.v))}activate(){ve=this,this.apply()}deactivate(){ve===this&&(ve=null,Fe=null)}flush(){if(this.activate(),et.length>0){if(rc(),ve!==null&&ve!==this)return}else this.#n===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#u(){if(this.#r===0){for(const t of this.#e)t();this.#e.clear()}this.#n===0&&this.#d()}#d(){if(ar.size>1){this.previous.clear();var t=Fe,n=!0,r={parent:null,effect:null,effects:[],render_effects:[]};for(const i of ar){if(i===this){n=!1;continue}const s=[];for(const[l,c]of this.current){if(i.current.has(l))if(n&&c!==i.current.get(l))i.current.set(l,c);else continue;s.push(l)}if(s.length===0)continue;const a=[...i.current.keys()].filter(l=>!this.current.has(l));if(a.length>0){var o=et;et=[];const l=new Set,c=new Map;for(const d of s)Ds(d,a,l,c);if(et.length>0){ve=i,i.apply();for(const d of et)i.#s(d,r);i.deactivate()}et=o}}ve=null,Fe=t}this.committed=!0,ar.delete(this)}increment(t){this.#n+=1,t&&(this.#r+=1)}decrement(t){this.#n-=1,t&&(this.#r-=1),this.revive()}revive(){for(const t of this.#i)this.#o.delete(t),ke(t,ze),Ut(t);for(const t of this.#o)ke(t,st),Ut(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#l??=_s()).promise}static ensure(){if(ve===null){const t=ve=new Ue;ar.add(ve),Ue.enqueue(()=>{ve===t&&t.flush()})}return ve}static enqueue(t){nn(t)}apply(){}}function rc(){var e=Wt;yo=!0;var t=null;try{var n=0;for(Er(!0);et.length>0;){var r=Ue.ensure();if(n++>1e3){var o,i;oc()}r.process(et),zt.clear()}}finally{yo=!1,Er(e),Yo=null}}function oc(){try{Tl()}catch(e){vn(e,Yo)}}let gt=null;function wi(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(wt|He))===0&&$n(r)&&(gt=new Set,Ln(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?js(r):r.fn=null),gt?.size>0)){zt.clear();for(const o of gt){if((o.f&(wt|He))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)gt.has(s)&&(gt.delete(s),i.push(s)),s=s.parent;for(let a=i.length-1;a>=0;a--){const l=i[a];(l.f&(wt|He))===0&&Ln(l)}}gt.clear()}}gt=null}}function Ds(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&xe)!==0?Ds(o,t,n,r):(i&(Vo|St))!==0&&(i&ze)===0&&Is(o,t,r)&&(ke(o,ze),Ut(o))}}function Is(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const o of e.deps){if(t.includes(o))return!0;if((o.f&xe)!==0&&Is(o,t,n))return n.set(o,!0),!0}return n.set(e,!1),!1}function Ut(e){for(var t=Yo=e;t.parent!==null;){t=t.parent;var n=t.f;if(yo&&t===ie&&(n&St)!==0&&(n&bs)===0)return;if((n&(qt|kt))!==0){if((n&Ee)===0)return;t.f^=Ee}}et.push(t)}function zs(e){let t=0,n=Qt(0),r;return()=>{qn()&&(u(n),Yr(()=>(t===0&&(r=qe(()=>e(()=>On(n)))),t+=1,()=>{nn(()=>{t-=1,t===0&&(r?.(),r=void 0,On(n))})})))}}var ic=Rt|tn|Kr;function sc(e,t,n){new ac(e,t,n)}class ac{parent;#e=!1;#t;#n=null;#r;#l;#i;#o=null;#s=null;#a=null;#c=null;#u=null;#d=0;#f=0;#g=!1;#h=null;#_=zs(()=>(this.#h=Qt(this.#d),()=>{this.#h=null}));constructor(t,n,r){this.#t=t,this.#r=n,this.#l=r,this.parent=ie.b,this.#e=!!this.#r.pending,this.#i=Jn(()=>{ie.b=this;{var o=this.#m();try{this.#o=Te(()=>r(o))}catch(i){this.error(i)}this.#f>0?this.#p():this.#e=!1}return()=>{this.#u?.remove()}},ic)}#w(){try{this.#o=Te(()=>this.#l(this.#t))}catch(t){this.error(t)}this.#e=!1}#b(){const t=this.#r.pending;t&&(this.#s=Te(()=>t(this.#t)),Ue.enqueue(()=>{var n=this.#m();this.#o=this.#v(()=>(Ue.ensure(),Te(()=>this.#l(n)))),this.#f>0?this.#p():(Yt(this.#s,()=>{this.#s=null}),this.#e=!1)}))}#m(){var t=this.#t;return this.#e&&(this.#u=bt(),this.#t.before(this.#u),t=this.#u),t}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#r.pending}#v(t){var n=ie,r=ne,o=fe;lt(this.#i),De(this.#i),gn(this.#i.ctx);try{return t()}catch(i){return Ts(i),null}finally{lt(n),De(r),gn(o)}}#p(){const t=this.#r.pending;this.#o!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#u),ea(this.#o,this.#c)),this.#s===null&&(this.#s=Te(()=>t(this.#t)))}#y(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t);return}this.#f+=t,this.#f===0&&(this.#e=!1,this.#s&&Yt(this.#s,()=>{this.#s=null}),this.#c&&(this.#t.before(this.#c),this.#c=null))}update_pending_count(t){this.#y(t),this.#d+=t,this.#h&&pn(this.#h,this.#d)}get_effect_pending(){return this.#_(),u(this.#h)}error(t){var n=this.#r.onerror;let r=this.#r.failed;if(this.#g||!n&&!r)throw t;this.#o&&(_e(this.#o),this.#o=null),this.#s&&(_e(this.#s),this.#s=null),this.#a&&(_e(this.#a),this.#a=null);var o=!1,i=!1;const s=()=>{if(o){Ql();return}o=!0,i&&Rl(),Ue.ensure(),this.#d=0,this.#a!==null&&Yt(this.#a,()=>{this.#a=null}),this.#e=this.has_pending_snippet(),this.#o=this.#v(()=>(this.#g=!1,Te(()=>this.#l(this.#t)))),this.#f>0?this.#p():this.#e=!1};var a=ne;try{De(null),i=!0,n?.(t,s),i=!1}catch(l){vn(l,this.#i&&this.#i.parent)}finally{De(a)}r&&nn(()=>{this.#a=this.#v(()=>{Ue.ensure(),this.#g=!0;try{return Te(()=>{r(this.#t,()=>t,()=>s)})}catch(l){return vn(l,this.#i.parent),null}finally{this.#g=!1}})})}}function Os(e,t,n,r){const o=Gn()?Un:Wo;if(n.length===0&&e.length===0){r(t.map(o));return}var i=ve,s=ie,a=lc();function l(){Promise.all(n.map(c=>cc(c))).then(c=>{a();try{r([...t.map(o),...c])}catch(d){(s.f&wt)===0&&vn(d,s)}i?.deactivate(),xr()}).catch(c=>{vn(c,s)})}e.length>0?Promise.all(e).then(()=>{a();try{return l()}finally{i?.deactivate(),xr()}}):l()}function lc(){var e=ie,t=ne,n=fe,r=ve;return function(i=!0){lt(e),De(t),gn(n),i&&r?.activate()}}function xr(){lt(null),De(null),gn(null)}function Un(e){var t=xe|ze,n=ne!==null&&(ne.f&xe)!==0?ne:null;return ie!==null&&(ie.f|=tn),{ctx:fe,deps:null,effects:null,equals:Cs,f:t,fn:e,reactions:null,rv:0,v:be,wv:0,parent:n??ie,ac:null}}function cc(e,t){let n=ie;n===null&&Nl();var r=n.b,o=void 0,i=Qt(be),s=!ne,a=new Map;return _c(()=>{var l=_s();o=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).then(()=>{c===ve&&c.committed&&c.deactivate(),xr()})}catch(f){l.reject(f),xr()}var c=ve;if(s){var d=!r.is_pending();r.update_pending_count(1),c.increment(d),a.get(c)?.reject(ln),a.delete(c),a.set(c,l)}const h=(f,g=void 0)=>{if(c.activate(),g)g!==ln&&(i.f|=It,pn(i,g));else{(i.f&It)!==0&&(i.f^=It),pn(i,f);for(const[v,_]of a){if(a.delete(v),v===c)break;_.reject(ln)}}s&&(r.update_pending_count(-1),c.decrement(d))};l.promise.then(h,f=>h(null,f||"unknown"))}),Go(()=>{for(const l of a.values())l.reject(ln)}),new Promise(l=>{function c(d){function h(){d===o?l(i):c(o)}d.then(h,h)}c(o)})}function m(e){const t=Un(e);return ta(t),t}function Wo(e){const t=Un(e);return t.equals=Ps,t}function Rs(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)_e(t[n])}}function uc(e){for(var t=e.parent;t!==null;){if((t.f&xe)===0)return(t.f&wt)===0?t:null;t=t.parent}return null}function Zo(e){var t,n=ie;lt(uc(e));try{e.f&=~Gt,Rs(e),t=ia(e)}finally{lt(n)}return t}function qs(e){var t=Zo(e);if(e.equals(t)||(ve?.is_fork||(e.v=t),e.wv=ra()),!rn)if(Fe!==null)(qn()||ve?.is_fork)&&Fe.set(e,t);else{var n=(e.f&je)===0?st:Ee;ke(e,n)}}let _o=new Set;const zt=new Map;let Hs=!1;function Qt(e,t){var n={f:0,v:e,reactions:null,equals:Cs,rv:0,wv:0};return n}function se(e,t){const n=Qt(e);return ta(n),n}function dc(e,t=!1,n=!0){const r=Qt(e);return t||(r.equals=Ps),kn&&n&&fe!==null&&fe.l!==null&&(fe.l.s??=[]).push(r),r}function R(e,t,n=!1){ne!==null&&(!rt||(ne.f&_i)!==0)&&Gn()&&(ne.f&(xe|St|Vo|_i))!==0&&!xt?.includes(e)&&Ol();let r=n?nt(t):t;return pn(e,r)}function pn(e,t){if(!e.equals(t)){var n=e.v;rn?zt.set(e,t):zt.set(e,n),e.v=t;var r=Ue.ensure();r.capture(e,n),(e.f&xe)!==0&&((e.f&ze)!==0&&Zo(e),ke(e,(e.f&je)!==0?Ee:st)),e.wv=ra(),Ls(e,ze),Gn()&&ie!==null&&(ie.f&Ee)!==0&&(ie.f&(kt|qt))===0&&(Be===null?xc([e]):Be.push(e)),!r.is_fork&&_o.size>0&&!Hs&&fc()}return t}function fc(){Hs=!1;var e=Wt;Er(!0);const t=Array.from(_o);try{for(const n of t)(n.f&Ee)!==0&&ke(n,st),$n(n)&&Ln(n)}finally{Er(e)}_o.clear()}function On(e){R(e,e.v+1)}function Ls(e,t){var n=e.reactions;if(n!==null)for(var r=Gn(),o=n.length,i=0;i<o;i++){var s=n[i],a=s.f;if(!(!r&&s===ie)){var l=(a&ze)===0;if(l&&ke(s,t),(a&xe)!==0){var c=s;Fe?.delete(c),(a&Gt)===0&&(a&je&&(s.f|=Gt),Ls(c,st))}else l&&((a&St)!==0&&gt!==null&&gt.add(s),Ut(s))}}}function nt(e){if(typeof e!="object"||e===null||ot in e)return e;const t=Br(e);if(t!==ys&&t!==Sl)return e;var n=new Map,r=Lr(e),o=se(0),i=Zt,s=a=>{if(Zt===i)return a();var l=ne,c=Zt;De(null),Ei(i);var d=a();return De(l),Ei(c),d};return r&&n.set("length",se(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Il();var d=n.get(l);return d===void 0?d=s(()=>{var h=se(c.value);return n.set(l,h),h}):R(d,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const d=s(()=>se(be));n.set(l,d),On(o)}}else R(c,be),On(o);return!0},get(a,l,c){if(l===ot)return e;var d=n.get(l),h=l in a;if(d===void 0&&(!h||Dt(a,l)?.writable)&&(d=s(()=>{var g=nt(h?a[l]:be),v=se(g);return v}),n.set(l,d)),d!==void 0){var f=u(d);return f===be?void 0:f}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var d=n.get(l);d&&(c.value=u(d))}else if(c===void 0){var h=n.get(l),f=h?.v;if(h!==void 0&&f!==be)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return c},has(a,l){if(l===ot)return!0;var c=n.get(l),d=c!==void 0&&c.v!==be||Reflect.has(a,l);if(c!==void 0||ie!==null&&(!d||Dt(a,l)?.writable)){c===void 0&&(c=s(()=>{var f=d?nt(a[l]):be,g=se(f);return g}),n.set(l,c));var h=u(c);if(h===be)return!1}return d},set(a,l,c,d){var h=n.get(l),f=l in a;if(r&&l==="length")for(var g=c;g<h.v;g+=1){var v=n.get(g+"");v!==void 0?R(v,be):g in a&&(v=s(()=>se(be)),n.set(g+"",v))}if(h===void 0)(!f||Dt(a,l)?.writable)&&(h=s(()=>se(void 0)),R(h,nt(c)),n.set(l,h));else{f=h.v!==be;var _=s(()=>nt(c));R(h,_)}var y=Reflect.getOwnPropertyDescriptor(a,l);if(y?.set&&y.set.call(d,c),!f){if(r&&typeof l=="string"){var w=n.get("length"),C=Number(l);Number.isInteger(C)&&C>=w.v&&R(w,C+1)}On(o)}return!0},ownKeys(a){u(o);var l=Reflect.ownKeys(a).filter(h=>{var f=n.get(h);return f===void 0||f.v!==be});for(var[c,d]of n)d.v!==be&&!(c in a)&&l.push(c);return l},setPrototypeOf(){zl()}})}function bi(e){try{if(e!==null&&typeof e=="object"&&ot in e)return e[ot]}catch{}return e}function hc(e,t){return Object.is(bi(e),bi(t))}var Ae,Vs,Bs,Fs;function gc(){if(Ae===void 0){Ae=window,Vs=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Bs=Dt(t,"firstChild").get,Fs=Dt(t,"nextSibling").get,yi(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),yi(n)&&(n.__t=void 0)}}function bt(e=""){return document.createTextNode(e)}function vt(e){return Bs.call(e)}function Qn(e){return Fs.call(e)}function ee(e,t){return vt(e)}function le(e,t=!1){{var n=vt(e);return n instanceof Comment&&n.data===""?Qn(n):n}}function $(e,t=1,n=!1){let r=e;for(;t--;)r=Qn(r);return r}function vc(e){e.textContent=""}function Ks(){return!1}function pc(e,t){if(t){const n=document.body;e.autofocus=!0,nn(()=>{document.activeElement===n&&e.focus()})}}function Xo(e){var t=ne,n=ie;De(null),lt(null);try{return e()}finally{De(t),lt(n)}}function Ys(e){ie===null&&(ne===null&&Al(),Ml()),rn&&Pl()}function mc(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function We(e,t,n){var r=ie;r!==null&&(r.f&He)!==0&&(e|=He);var o={ctx:fe,deps:null,nodes:null,f:e|ze|je,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Ln(o),o.f|=Lo}catch(a){throw _e(o),a}else t!==null&&Ut(o);var i=o;if(n&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&tn)===0&&(i=i.first,(e&St)!==0&&(e&Rt)!==0&&i!==null&&(i.f|=Rt)),i!==null&&(i.parent=r,r!==null&&mc(i,r),ne!==null&&(ne.f&xe)!==0&&(e&qt)===0)){var s=ne;(s.effects??=[]).push(i)}return o}function qn(){return ne!==null&&!rt}function Go(e){const t=We(Fr,null,!1);return ke(t,Ee),t.teardown=e,t}function at(e){Ys();var t=ie.f,n=!ne&&(t&kt)!==0&&(t&Lo)===0;if(n){var r=fe;(r.e??=[]).push(e)}else return Ws(e)}function Ws(e){return We(Ho|xs,e,!1)}function Zs(e){return Ys(),We(Fr|xs,e,!0)}function Xs(e){Ue.ensure();const t=We(qt|tn,e,!0);return()=>{_e(t)}}function yc(e){Ue.ensure();const t=We(qt|tn,e,!0);return(n={})=>new Promise(r=>{n.outro?Yt(t,()=>{_e(t),r(void 0)}):(_e(t),r(void 0))})}function jn(e){return We(Ho,e,!1)}function _c(e){return We(Vo|tn,e,!0)}function Yr(e,t=0){return We(Fr|t,e,!0)}function he(e,t=[],n=[],r=[]){Os(r,t,n,o=>{We(Fr,()=>e(...o.map(u)),!0)})}function Jn(e,t=0){var n=We(St|t,e,!0);return n}function Gs(e,t=0){var n=We(ws|t,e,!0);return n}function Te(e){return We(kt|tn,e,!0)}function Us(e){var t=e.teardown;if(t!==null){const n=rn,r=ne;xi(!0),De(null);try{t.call(null)}finally{xi(n),De(r)}}}function Qs(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const o=n.ac;o!==null&&Xo(()=>{o.abort(ln)});var r=n.next;(n.f&qt)!==0?n.parent=null:_e(n,t),n=r}}function wc(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&kt)===0&&_e(t),t=n}}function _e(e,t=!0){var n=!1;(t||(e.f&bs)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(bc(e.nodes.start,e.nodes.end),n=!0),Qs(e,t&&!n),Sr(e,0),ke(e,wt);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Us(e);var o=e.parent;o!==null&&o.first!==null&&js(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function bc(e,t){for(;e!==null;){var n=e===t?null:Qn(e);e.remove(),e=n}}function js(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Yt(e,t,n=!0){var r=[];Js(e,r,!0);var o=()=>{n&&_e(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||o();for(var a of r)a.out(s)}else o()}function Js(e,t,n){if((e.f&He)===0){e.f^=He;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var o=e.first;o!==null;){var i=o.next,s=(o.f&Rt)!==0||(o.f&kt)!==0&&(e.f&St)!==0;Js(o,t,s?n:!1),o=i}}}function Uo(e){$s(e,!0)}function $s(e,t){if((e.f&He)!==0){e.f^=He,(e.f&Ee)===0&&(ke(e,ze),Ut(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Rt)!==0||(n.f&kt)!==0;$s(n,o?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function ea(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var o=n===r?null:Qn(n);t.append(n),n=o}}let Wt=!1;function Er(e){Wt=e}let rn=!1;function xi(e){rn=e}let ne=null,rt=!1;function De(e){ne=e}let ie=null;function lt(e){ie=e}let xt=null;function ta(e){ne!==null&&(xt===null?xt=[e]:xt.push(e))}let Pe=null,Oe=0,Be=null;function xc(e){Be=e}let na=1,Hn=0,Zt=Hn;function Ei(e){Zt=e}function ra(){return++na}function $n(e){var t=e.f;if((t&ze)!==0)return!0;if(t&xe&&(e.f&=~Gt),(t&st)!==0){var n=e.deps;if(n!==null)for(var r=n.length,o=0;o<r;o++){var i=n[o];if($n(i)&&qs(i),i.wv>e.wv)return!0}(t&je)!==0&&Fe===null&&ke(e,Ee)}return!1}function oa(e,t,n=!0){var r=e.reactions;if(r!==null&&!xt?.includes(e))for(var o=0;o<r.length;o++){var i=r[o];(i.f&xe)!==0?oa(i,t,!1):t===i&&(n?ke(i,ze):(i.f&Ee)!==0&&ke(i,st),Ut(i))}}function ia(e){var t=Pe,n=Oe,r=Be,o=ne,i=xt,s=fe,a=rt,l=Zt,c=e.f;Pe=null,Oe=0,Be=null,ne=(c&(kt|qt))===0?e:null,xt=null,gn(e.ctx),rt=!1,Zt=++Hn,e.ac!==null&&(Xo(()=>{e.ac.abort(ln)}),e.ac=null);try{e.f|=mo;var d=e.fn,h=d(),f=e.deps;if(Pe!==null){var g;if(Sr(e,Oe),f!==null&&Oe>0)for(f.length=Oe+Pe.length,g=0;g<Pe.length;g++)f[Oe+g]=Pe[g];else e.deps=f=Pe;if(qn()&&(e.f&je)!==0)for(g=Oe;g<f.length;g++)(f[g].reactions??=[]).push(e)}else f!==null&&Oe<f.length&&(Sr(e,Oe),f.length=Oe);if(Gn()&&Be!==null&&!rt&&f!==null&&(e.f&(xe|st|ze))===0)for(g=0;g<Be.length;g++)oa(Be[g],e);return o!==null&&o!==e&&(Hn++,Be!==null&&(r===null?r=Be:r.push(...Be))),(e.f&It)!==0&&(e.f^=It),h}catch(v){return Ts(v)}finally{e.f^=mo,Pe=t,Oe=n,Be=r,ne=o,xt=i,gn(s),rt=a,Zt=l}}function Ec(e,t){let n=t.reactions;if(n!==null){var r=xl.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}n===null&&(t.f&xe)!==0&&(Pe===null||!Pe.includes(t))&&(ke(t,st),(t.f&je)!==0&&(t.f^=je,t.f&=~Gt),Rs(t),Sr(t,0))}function Sr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ec(e,n[r])}function Ln(e){var t=e.f;if((t&wt)===0){ke(e,Ee);var n=ie,r=Wt;ie=e,Wt=!0;try{(t&(St|ws))!==0?wc(e):Qs(e),Us(e);var o=ia(e);e.teardown=typeof o=="function"?o:null,e.wv=na;var i;vo&&jl&&(e.f&ze)!==0&&e.deps}finally{Wt=r,ie=n}}}function u(e){var t=e.f,n=(t&xe)!==0;if(ne!==null&&!rt){var r=ie!==null&&(ie.f&wt)!==0;if(!r&&!xt?.includes(e)){var o=ne.deps;if((ne.f&mo)!==0)e.rv<Hn&&(e.rv=Hn,Pe===null&&o!==null&&o[Oe]===e?Oe++:Pe===null?Pe=[e]:Pe.includes(e)||Pe.push(e));else{(ne.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[ne]:i.includes(ne)||i.push(ne)}}}if(rn){if(zt.has(e))return zt.get(e);if(n){var s=e,a=s.v;return((s.f&Ee)===0&&s.reactions!==null||aa(s))&&(a=Zo(s)),zt.set(s,a),a}}else n&&(!Fe?.has(e)||ve?.is_fork&&!qn())&&(s=e,$n(s)&&qs(s),Wt&&qn()&&(s.f&je)===0&&sa(s));if(Fe?.has(e))return Fe.get(e);if((e.f&It)!==0)throw e.v;return e.v}function sa(e){if(e.deps!==null){e.f^=je;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&xe)!==0&&(t.f&je)===0&&sa(t)}}function aa(e){if(e.v===be)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(zt.has(t)||(t.f&xe)!==0&&aa(t))return!0;return!1}function qe(e){var t=rt;try{return rt=!0,e()}finally{rt=t}}const Sc=-7169;function ke(e,t){e.f=e.f&Sc|t}function kc(e,t){var n={};for(var r in e)t.includes(r)||(n[r]=e[r]);for(var o of Object.getOwnPropertySymbols(e))Object.propertyIsEnumerable.call(e,o)&&!t.includes(o)&&(n[o]=e[o]);return n}function la(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(ot in e)wo(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&ot in n&&wo(n)}}}function wo(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{wo(e[r],t)}catch{}const n=Br(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=ms(n);for(let o in r){const i=r[o].get;if(i)try{i.call(e)}catch{}}}}}function Cc(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Nc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Pc(e){return Nc.includes(e)}const Mc={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Ac(e){return e=e.toLowerCase(),Mc[e]??e}const Tc=["touchstart","touchmove"];function Dc(e){return Tc.includes(e)}const ca=new Set,bo=new Set;function Qo(e,t,n,r={}){function o(i){if(r.capture||Tn.call(t,i),!i.cancelBubble)return Xo(()=>n?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?nn(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function xo(e,t,n,r={}){var o=Qo(t,e,n,r);return()=>{e.removeEventListener(t,o,r)}}function kr(e,t,n,r,o){var i={capture:r,passive:o},s=Qo(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Go(()=>{t.removeEventListener(e,s,i)})}function jo(e){for(var t=0;t<e.length;t++)ca.add(e[t]);for(var n of bo)n(e)}let Si=null;function Tn(e){var t=this,n=t.ownerDocument,r=e.type,o=e.composedPath?.()||[],i=o[0]||e.target;Si=e;var s=0,a=Si===e&&e.__root;if(a){var l=o.indexOf(a);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=o.indexOf(t);if(c===-1)return;l<=c&&(s=l)}if(i=o[s]||e.target,i!==t){El(e,"currentTarget",{configurable:!0,get(){return i||n}});var d=ne,h=ie;De(null),lt(null);try{for(var f,g=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var _=i["__"+r];_!=null&&(!i.disabled||e.target===i)&&_.call(i,e)}catch(y){f?g.push(y):f=y}if(e.cancelBubble||v===t||v===null)break;i=v}if(f){for(let y of g)queueMicrotask(()=>{throw y});throw f}}finally{e.__root=t,delete e.currentTarget,De(d),lt(h)}}}function ua(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function mn(e,t){var n=ie;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ae(e,t){var n=(t&ks)!==0,r=(t&Zl)!==0,o,i=!e.startsWith("<!>");return()=>{o===void 0&&(o=ua(i?e:"<!>"+e),n||(o=vt(o)));var s=r||Vs?document.importNode(o,!0):o.cloneNode(!0);if(n){var a=vt(s),l=s.lastChild;mn(a,l)}else mn(s,s);return s}}function Ic(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&ks)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(!s){var a=ua(i),l=vt(a);if(o)for(s=document.createDocumentFragment();vt(l);)s.appendChild(vt(l));else s=vt(l)}var c=s.cloneNode(!0);if(o){var d=vt(c),h=c.lastChild;mn(d,h)}else mn(c,c);return c}}function me(e,t){return Ic(e,t,"svg")}function zc(e=""){{var t=bt(e+"");return mn(t,t),t}}function Se(){var e=document.createDocumentFragment(),t=document.createComment(""),n=bt();return e.append(t,n),mn(t,n),e}function F(e,t){e!==null&&e.before(t)}function Re(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function Oc(e,t){return Rc(e,t)}const sn=new Map;function Rc(e,{target:t,anchor:n,props:r={},events:o,context:i,intro:s=!0}){gc();var a=new Set,l=h=>{for(var f=0;f<h.length;f++){var g=h[f];if(!a.has(g)){a.add(g);var v=Dc(g);t.addEventListener(g,Tn,{passive:v});var _=sn.get(g);_===void 0?(document.addEventListener(g,Tn,{passive:v}),sn.set(g,1)):sn.set(g,_+1)}}};l(Vr(ca)),bo.add(l);var c=void 0,d=yc(()=>{var h=n??t.appendChild(bt());return sc(h,{pending:()=>{}},f=>{if(i){re({});var g=fe;g.c=i}o&&(r.$$events=o),c=e(f,r)||{},i&&oe()}),()=>{for(var f of a){t.removeEventListener(f,Tn);var g=sn.get(f);--g===0?(document.removeEventListener(f,Tn),sn.delete(f)):sn.set(f,g)}bo.delete(l),h!==n&&h.parentNode?.removeChild(h)}});return qc.set(c,d),c}let qc=new WeakMap;class Jo{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#l=!0;constructor(t,n=!0){this.anchor=t,this.#l=n}#i=()=>{var t=ve;if(this.#e.has(t)){var n=this.#e.get(t),r=this.#t.get(n);if(r)Uo(r),this.#r.delete(n);else{var o=this.#n.get(n);o&&(this.#t.set(n,o.effect),this.#n.delete(n),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),r=o.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===t)break;const a=this.#n.get(s);a&&(_e(a.effect),this.#n.delete(s))}for(const[i,s]of this.#t){if(i===n||this.#r.has(i))continue;const a=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();ea(s,c),c.append(bt()),this.#n.set(i,{effect:s,fragment:c})}else _e(s);this.#r.delete(i),this.#t.delete(i)};this.#l||!r?(this.#r.add(i),Yt(s,a,!1)):a()}}};#o=t=>{this.#e.delete(t);const n=Array.from(this.#e.values());for(const[r,o]of this.#n)n.includes(r)||(_e(o.effect),this.#n.delete(r))};ensure(t,n){var r=ve,o=Ks();if(n&&!this.#t.has(t)&&!this.#n.has(t))if(o){var i=document.createDocumentFragment(),s=bt();i.append(s),this.#n.set(t,{effect:Te(()=>n(s)),fragment:i})}else this.#t.set(t,Te(()=>n(this.anchor)));if(this.#e.set(r,t),o){for(const[a,l]of this.#t)a===t?r.skipped_effects.delete(l):r.skipped_effects.add(l);for(const[a,l]of this.#n)a===t?r.skipped_effects.delete(l.effect):r.skipped_effects.add(l.effect);r.oncommit(this.#i),r.ondiscard(this.#o)}else this.#i()}}function de(e,t,n=!1){var r=new Jo(e),o=n?Rt:0;function i(s,a){r.ensure(s,a)}Jn(()=>{var s=!1;t((a,l=!0)=>{s=!0,i(l,a)}),s||i(!1,null)},o)}function Hc(e,t){Yr(()=>{var n=t();for(var r in n){var o=n[r];o?e.style.setProperty(r,o):e.style.removeProperty(r)}})}function Lc(e,t,n){for(var r=[],o=t.length,i,s=t.length,a=0;a<o;a++){let h=t[a];Yt(h,()=>{if(i){if(i.pending.delete(h),i.done.add(h),i.pending.size===0){var f=e.outrogroups;Eo(Vr(i.done)),f.delete(i),f.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=r.length===0&&n!==null;if(l){var c=n,d=c.parentNode;vc(d),d.append(c),e.items.clear()}Eo(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function Eo(e,t=!0){for(var n=0;n<e.length;n++)_e(e[n],t)}var ki;function Wr(e,t,n,r,o,i=null){var s=e,a=new Map,l=(t&Ss)!==0;if(l){var c=e;s=c.appendChild(bt())}var d=null,h=Wo(()=>{var w=n();return Lr(w)?w:w==null?[]:Vr(w)}),f,g=!0;function v(){y.fallback=d,Vc(y,f,s,t,r),d!==null&&(f.length===0?(d.f&mt)===0?Uo(d):(d.f^=mt,Dn(d,null,s)):Yt(d,()=>{d=null}))}var _=Jn(()=>{f=u(h);for(var w=f.length,C=new Set,k=ve,b=Ks(),A=0;A<w;A+=1){var T=f[A],z=r(T,A),M=g?null:a.get(z);M?(M.v&&pn(M.v,T),M.i&&pn(M.i,A),b&&k.skipped_effects.delete(M.e)):(M=Bc(a,g?s:ki??=bt(),T,z,A,o,t,n),g||(M.e.f|=mt),a.set(z,M)),C.add(z)}if(w===0&&i&&!d&&(g?d=Te(()=>i(s)):(d=Te(()=>i(ki??=bt())),d.f|=mt)),!g)if(b){for(const[H,K]of a)C.has(H)||k.skipped_effects.add(K.e);k.oncommit(v),k.ondiscard(()=>{})}else v();u(h)}),y={effect:_,items:a,outrogroups:null,fallback:d};g=!1}function Vc(e,t,n,r,o){var i=(r&Ll)!==0,s=t.length,a=e.items,l=e.effect.first,c,d=null,h,f=[],g=[],v,_,y,w;if(i)for(w=0;w<s;w+=1)v=t[w],_=o(v,w),y=a.get(_).e,(y.f&mt)===0&&(y.nodes?.a?.measure(),(h??=new Set).add(y));for(w=0;w<s;w+=1){if(v=t[w],_=o(v,w),y=a.get(_).e,e.outrogroups!==null)for(const K of e.outrogroups)K.pending.delete(y),K.done.delete(y);if((y.f&mt)!==0)if(y.f^=mt,y===l)Dn(y,null,n);else{var C=d?d.next:l;y===e.effect.last&&(e.effect.last=y.prev),y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),Pt(e,d,y),Pt(e,y,C),Dn(y,C,n),d=y,f=[],g=[],l=d.next;continue}if((y.f&He)!==0&&(Uo(y),i&&(y.nodes?.a?.unfix(),(h??=new Set).delete(y))),y!==l){if(c!==void 0&&c.has(y)){if(f.length<g.length){var k=g[0],b;d=k.prev;var A=f[0],T=f[f.length-1];for(b=0;b<f.length;b+=1)Dn(f[b],k,n);for(b=0;b<g.length;b+=1)c.delete(g[b]);Pt(e,A.prev,T.next),Pt(e,d,A),Pt(e,T,k),l=k,d=T,w-=1,f=[],g=[]}else c.delete(y),Dn(y,l,n),Pt(e,y.prev,y.next),Pt(e,y,d===null?e.effect.first:d.next),Pt(e,d,y),d=y;continue}for(f=[],g=[];l!==null&&l!==y;)(c??=new Set).add(l),g.push(l),l=l.next;if(l===null)continue}(y.f&mt)===0&&f.push(y),d=y,l=y.next}if(e.outrogroups!==null){for(const K of e.outrogroups)K.pending.size===0&&(Eo(Vr(K.done)),e.outrogroups?.delete(K));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||c!==void 0){var z=[];if(c!==void 0)for(y of c)(y.f&He)===0&&z.push(y);for(;l!==null;)(l.f&He)===0&&l!==e.fallback&&z.push(l),l=l.next;var M=z.length;if(M>0){var H=(r&Ss)!==0&&s===0?n:null;if(i){for(w=0;w<M;w+=1)z[w].nodes?.a?.measure();for(w=0;w<M;w+=1)z[w].nodes?.a?.fix()}Lc(e,z,H)}}i&&nn(()=>{if(h!==void 0)for(y of h)y.nodes?.a?.apply()})}function Bc(e,t,n,r,o,i,s,a){var l=(s&ql)!==0?(s&Vl)===0?dc(n,!1,!1):Qt(n):null,c=(s&Hl)!==0?Qt(o):null;return{v:l,i:c,e:Te(()=>(i(t,l??n,c??o,a),()=>{e.delete(r)}))}}function Dn(e,t,n){if(e.nodes)for(var r=e.nodes.start,o=e.nodes.end,i=t&&(t.f&mt)===0?t.nodes.start:n;r!==null;){var s=Qn(r);if(i.before(r),r===o)return;r=s}}function Pt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ye(e,t,...n){var r=new Jo(e);Jn(()=>{const o=t()??null;r.ensure(o,o&&(i=>o(i,...n)))},Rt)}function Zr(e,t,n){var r=new Jo(e);Jn(()=>{var o=t()??null;r.ensure(o,o&&(i=>n(i,o)))},Rt)}function Ne(e,t,n){jn(()=>{var r=qe(()=>t(e,n?.())||{});if(n&&r?.update){var o=!1,i={};Yr(()=>{var s=n();la(s),o&&Ns(i,s)&&(i=s,r.update(s))}),o=!0}if(r?.destroy)return()=>r.destroy()})}function Fc(e,t){var n=void 0,r;Gs(()=>{n!==(n=t())&&(r&&(_e(r),r=null),n&&(r=Te(()=>{jn(()=>n(e))})))})}function da(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=da(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Kc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=da(e))&&(r&&(r+=" "),r+=t);return r}function Ht(e){return typeof e=="object"?Kc(e):e??""}const Ci=[...`
\r\f \v\uFEFF`];function Yc(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var o in n)if(n[o])r=r?r+" "+o:o;else if(r.length)for(var i=o.length,s=0;(s=r.indexOf(o,s))>=0;){var a=s+i;(s===0||Ci.includes(r[s-1]))&&(a===r.length||Ci.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function Ni(e,t=!1){var n=t?" !important;":";",r="";for(var o in e){var i=e[o];i!=null&&i!==""&&(r+=" "+o+": "+i+n)}return r}function no(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Wc(e,t){if(t){var n="",r,o;if(Array.isArray(t)?(r=t[0],o=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,a=!1,l=[];r&&l.push(...Object.keys(r).map(no)),o&&l.push(...Object.keys(o).map(no));var c=0,d=-1;const _=e.length;for(var h=0;h<_;h++){var f=e[h];if(a?f==="/"&&e[h-1]==="*"&&(a=!1):i?i===f&&(i=!1):f==="/"&&e[h+1]==="*"?a=!0:f==='"'||f==="'"?i=f:f==="("?s++:f===")"&&s--,!a&&i===!1&&s===0){if(f===":"&&d===-1)d=h;else if(f===";"||h===_-1){if(d!==-1){var g=no(e.substring(c,d).trim());if(!l.includes(g)){f!==";"&&h++;var v=e.substring(c,h).trim();n+=" "+v+";"}}c=h+1,d=-1}}}}return r&&(n+=Ni(r)),o&&(n+=Ni(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function ut(e,t,n,r,o,i){var s=e.__className;if(s!==n||s===void 0){var a=Yc(n,r,i);a==null?e.removeAttribute("class"):t?e.className=a:e.setAttribute("class",a),e.__className=n}else if(i&&o!==i)for(var l in i){var c=!!i[l];(o==null||c!==!!o[l])&&e.classList.toggle(l,c)}return i}function ro(e,t={},n,r){for(var o in n){var i=n[o];t[o]!==i&&(n[o]==null?e.style.removeProperty(o):e.style.setProperty(o,i,r))}}function Le(e,t,n,r){var o=e.__style;if(o!==t){var i=Wc(t,r);i==null?e.removeAttribute("style"):e.style.cssText=i,e.__style=t}else r&&(Array.isArray(r)?(ro(e,n?.[0],r[0]),ro(e,n?.[1],r[1],"important")):ro(e,n,r));return r}function So(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Lr(t))return Ul();for(var r of e.options)r.selected=t.includes(Pi(r));return}for(r of e.options){var o=Pi(r);if(hc(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Zc(e){var t=new MutationObserver(()=>{So(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Go(()=>{t.disconnect()})}function Pi(e){return"__value"in e?e.__value:e.value}const Mt=Symbol("class"),pt=Symbol("style"),fa=Symbol("is custom element"),ha=Symbol("is html");function Xc(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function G(e,t,n,r){var o=ga(e);o[t]!==(o[t]=n)&&(t==="loading"&&(e[Cl]=n),n==null?e.removeAttribute(t):typeof n!="string"&&va(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Gc(e,t,n,r,o=!1,i=!1){var s=ga(e),a=s[fa],l=!s[ha],c=t||{},d=e.tagName==="OPTION";for(var h in t)h in n||(n[h]=null);n.class?n.class=Ht(n.class):(r||n[Mt])&&(n.class=null),n[pt]&&(n.style??=null);var f=va(e);for(const b in n){let A=n[b];if(d&&b==="value"&&A==null){e.value=e.__value="",c[b]=A;continue}if(b==="class"){var g=e.namespaceURI==="http://www.w3.org/1999/xhtml";ut(e,g,A,r,t?.[Mt],n[Mt]),c[b]=A,c[Mt]=n[Mt];continue}if(b==="style"){Le(e,A,t?.[pt],n[pt]),c[b]=A,c[pt]=n[pt];continue}var v=c[b];if(!(A===v&&!(A===void 0&&e.hasAttribute(b)))){c[b]=A;var _=b[0]+b[1];if(_!=="$$")if(_==="on"){const T={},z="$$"+b;let M=b.slice(2);var y=Pc(M);if(Cc(M)&&(M=M.slice(0,-7),T.capture=!0),!y&&v){if(A!=null)continue;e.removeEventListener(M,c[z],T),c[z]=null}if(A!=null)if(y)e[`__${M}`]=A,jo([M]);else{let H=function(K){c[b].call(this,K)};var k=H;c[z]=Qo(M,e,H,T)}else y&&(e[`__${M}`]=void 0)}else if(b==="style")G(e,b,A);else if(b==="autofocus")pc(e,!!A);else if(!a&&(b==="__value"||b==="value"&&A!=null))e.value=e.__value=A;else if(b==="selected"&&d)Xc(e,A);else{var w=b;l||(w=Ac(w));var C=w==="defaultValue"||w==="defaultChecked";if(A==null&&!a&&!C)if(s[b]=null,w==="value"||w==="checked"){let T=e;const z=t===void 0;if(w==="value"){let M=T.defaultValue;T.removeAttribute(w),T.defaultValue=M,T.value=T.__value=z?M:null}else{let M=T.defaultChecked;T.removeAttribute(w),T.defaultChecked=M,T.checked=z?M:!1}}else e.removeAttribute(b);else C||f.includes(w)&&(a||typeof A!="string")?(e[w]=A,w in s&&(s[w]=be)):typeof A!="function"&&G(e,w,A)}}}return c}function Lt(e,t,n=[],r=[],o=[],i,s=!1,a=!1){Os(o,n,r,l=>{var c=void 0,d={},h=e.nodeName==="SELECT",f=!1;if(Gs(()=>{var v=t(...l.map(u)),_=Gc(e,c,v,i,s,a);f&&h&&"value"in v&&So(e,v.value);for(let w of Object.getOwnPropertySymbols(d))v[w]||_e(d[w]);for(let w of Object.getOwnPropertySymbols(v)){var y=v[w];w.description===Gl&&(!c||y!==c[w])&&(d[w]&&_e(d[w]),d[w]=Te(()=>Fc(e,()=>y))),_[w]=y}c=_}),h){var g=e;jn(()=>{So(g,c.value,!0),Zc(g)})}f=!0})}function ga(e){return e.__attributes??={[fa]:e.nodeName.includes("-"),[ha]:e.namespaceURI===Xl}}var Mi=new Map;function va(e){var t=e.getAttribute("is")||e.nodeName,n=Mi.get(t);if(n)return n;Mi.set(t,n=[]);for(var r,o=e,i=Element.prototype;i!==o;){r=ms(o);for(var s in r)r[s].set&&n.push(s);o=Br(o)}return n}class $o{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(t){this.#n=t}observe(t,n){var r=this.#e.get(t)||new Set;return r.add(n),this.#e.set(t,r),this.#r().observe(t,this.#n),()=>{var o=this.#e.get(t);o.delete(n),o.size===0&&(this.#e.delete(t),this.#t.unobserve(t))}}#r(){return this.#t??(this.#t=new ResizeObserver(t=>{for(var n of t){$o.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}}))}}var Uc=new $o({box:"border-box"});function Ai(e,t,n){var r=Uc.observe(e,()=>n(e[t]));jn(()=>(qe(()=>n(e[t])),r))}function Ti(e,t){return e===t||e?.[ot]===t}function er(e={},t,n,r){return jn(()=>{var o,i;return Yr(()=>{o=i,i=[],qe(()=>{e!==n(...i)&&(t(e,...i),o&&Ti(n(...o),e)&&t(null,...o))})}),()=>{nn(()=>{i&&Ti(n(...i),e)&&t(null,...i)})}}),e}function Qc(e=!1){const t=fe,n=t.l.u;if(!n)return;let r=()=>la(t.s);if(e){let o=0,i={};const s=Un(()=>{let a=!1;const l=t.s;for(const c in l)l[c]!==i[c]&&(i[c]=l[c],a=!0);return a&&o++,o});r=()=>u(s)}n.b.length&&Zs(()=>{Di(t,r),po(n.b)}),at(()=>{const o=qe(()=>n.m.map(kl));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&at(()=>{Di(t,r),po(n.a)})}function Di(e,t){if(e.l.s)for(const n of e.l.s)u(n);t()}let lr=!1;function jc(e){var t=lr;try{return lr=!1,[e(),lr]}finally{lr=t}}const Jc={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Vt(e,t,n){return new Proxy({props:e,exclude:t},Jc)}const $c={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Pn(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];Pn(o)&&(o=o());const i=Dt(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Pn(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Dt(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===ot||t===Es)return!1;for(let n of e.props)if(Pn(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(Pn(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function At(...e){return new Proxy({props:e},$c)}function L(e,t,n,r){var o=!kn||(n&Fl)!==0,i=(n&Yl)!==0,s=(n&Wl)!==0,a=r,l=!0,c=()=>(l&&(l=!1,a=s?qe(r):r),a),d;if(i){var h=ot in e||Es in e;d=Dt(e,t)?.set??(h&&t in e?k=>e[t]=k:void 0)}var f,g=!1;i?[f,g]=jc(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=c(),d&&(o&&Dl(),d(f)));var v;if(o?v=()=>{var k=e[t];return k===void 0?c():(l=!0,k)}:v=()=>{var k=e[t];return k!==void 0&&(a=void 0),k===void 0?a:k},o&&(n&Kl)===0)return v;if(d){var _=e.$$legacy;return(function(k,b){return arguments.length>0?((!o||!b||_||g)&&d(b?v():k),k):v()})}var y=!1,w=((n&Bl)!==0?Un:Wo)(()=>(y=!1,v()));i&&u(w);var C=ie;return(function(k,b){if(arguments.length>0){const A=b?u(w):o&&i?nt(k):k;return R(w,A),y=!0,a!==void 0&&(a=A),k}return rn&&y||(C.f&wt)!==0?w.v:u(w)})}function eu(e){fe===null&&Bo(),kn&&fe.l!==null?tu(fe).m.push(e):at(()=>{const t=qe(e);if(typeof t=="function")return t})}function ei(e){fe===null&&Bo(),eu(()=>()=>qe(e))}function tu(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const nu="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(nu);var ru={value:()=>{}};function Xr(){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 mr(n)}function mr(e){this._=e}function ou(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}mr.prototype=Xr.prototype={constructor:mr,on:function(e,t){var n=this._,r=ou(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=iu(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Ii(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Ii(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new mr(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[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],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function iu(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Ii(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=ru,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ko="http://www.w3.org/1999/xhtml";const zi={svg:"http://www.w3.org/2000/svg",xhtml:ko,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zi.hasOwnProperty(t)?{space:zi[t],local:e}:e}function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ko&&t.documentElement.namespaceURI===ko?t.createElement(e):t.createElementNS(n,e)}}function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pa(e){var t=Gr(e);return(t.local?au:su)(t)}function lu(){}function ti(e){return e==null?lu:function(){return this.querySelector(e)}}function cu(e){typeof e!="function"&&(e=ti(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),a[d]=c);return new Ve(r,this._parents)}function uu(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function du(){return[]}function ma(e){return e==null?du:function(){return this.querySelectorAll(e)}}function fu(e){return function(){return uu(e.apply(this,arguments))}}function hu(e){typeof e=="function"?e=fu(e):e=ma(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),o.push(l));return new Ve(r,o)}function ya(e){return function(){return this.matches(e)}}function _a(e){return function(t){return t.matches(e)}}var gu=Array.prototype.find;function vu(e){return function(){return gu.call(this.children,e)}}function pu(){return this.firstElementChild}function mu(e){return this.select(e==null?pu:vu(typeof e=="function"?e:_a(e)))}var yu=Array.prototype.filter;function _u(){return Array.from(this.children)}function wu(e){return function(){return yu.call(this.children,e)}}function bu(e){return this.selectAll(e==null?_u:wu(typeof e=="function"?e:_a(e)))}function xu(e){typeof e!="function"&&(e=ya(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Ve(r,this._parents)}function wa(e){return new Array(e.length)}function Eu(){return new Ve(this._enter||this._groups.map(wa),this._parents)}function Cr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cr.prototype={constructor:Cr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Su(e){return function(){return e}}function ku(e,t,n,r,o,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Cr(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function Cu(e,t,n,r,o,i,s){var a,l,c=new Map,d=t.length,h=i.length,f=new Array(d),g;for(a=0;a<d;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",c.has(g)?o[a]=l:c.set(g,l));for(a=0;a<h;++a)g=s.call(e,i[a],a,i)+"",(l=c.get(g))?(r[a]=l,l.__data__=i[a],c.delete(g)):n[a]=new Cr(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(f[a])===l&&(o[a]=l)}function Nu(e){return e.__data__}function Pu(e,t){if(!arguments.length)return Array.from(this,Nu);var n=t?Cu:ku,r=this._parents,o=this._groups;typeof e!="function"&&(e=Su(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var d=r[c],h=o[c],f=h.length,g=Mu(e.call(d,d&&d.__data__,c,r)),v=g.length,_=a[c]=new Array(v),y=s[c]=new Array(v),w=l[c]=new Array(f);n(d,h,_,y,w,g,t);for(var C=0,k=0,b,A;C<v;++C)if(b=_[C]){for(C>=k&&(k=C+1);!(A=y[k])&&++k<v;);b._next=A||null}}return s=new Ve(s,r),s._enter=a,s._exit=l,s}function Mu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Au(){return new Ve(this._exit||this._groups.map(wa),this._parents)}function Tu(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Du(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var c=n[l],d=r[l],h=c.length,f=a[l]=new Array(h),g,v=0;v<h;++v)(g=c[v]||d[v])&&(f[v]=g);for(;l<o;++l)a[l]=n[l];return new Ve(a,this._parents)}function Iu(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function zu(e){e||(e=Ou);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),c,d=0;d<a;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new Ve(o,this._parents).order()}function Ou(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ru(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qu(){return Array.from(this)}function Hu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Lu(){let e=0;for(const t of this)++e;return e}function Vu(){return!this.node()}function Bu(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function Fu(e){return function(){this.removeAttribute(e)}}function Ku(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yu(e,t){return function(){this.setAttribute(e,t)}}function Wu(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Xu(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 Gu(e,t){var n=Gr(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?Ku:Fu:typeof t=="function"?n.local?Xu:Zu:n.local?Wu:Yu)(n,t))}function ba(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Uu(e){return function(){this.style.removeProperty(e)}}function Qu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ju(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ju(e,t,n){return arguments.length>1?this.each((t==null?Uu:typeof t=="function"?ju:Qu)(e,t,n??"")):yn(this.node(),e)}function yn(e,t){return e.style.getPropertyValue(t)||ba(e).getComputedStyle(e,null).getPropertyValue(t)}function $u(e){return function(){delete this[e]}}function ed(e,t){return function(){this[e]=t}}function td(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function nd(e,t){return arguments.length>1?this.each((t==null?$u:typeof t=="function"?td:ed)(e,t)):this.node()[e]}function xa(e){return e.trim().split(/^|\s+/)}function ni(e){return e.classList||new Ea(e)}function Ea(e){this._node=e,this._names=xa(e.getAttribute("class")||"")}Ea.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 Sa(e,t){for(var n=ni(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function ka(e,t){for(var n=ni(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function rd(e){return function(){Sa(this,e)}}function od(e){return function(){ka(this,e)}}function id(e,t){return function(){(t.apply(this,arguments)?Sa:ka)(this,e)}}function sd(e,t){var n=xa(e+"");if(arguments.length<2){for(var r=ni(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?id:t?rd:od)(n,t))}function ad(){this.textContent=""}function ld(e){return function(){this.textContent=e}}function cd(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ud(e){return arguments.length?this.each(e==null?ad:(typeof e=="function"?cd:ld)(e)):this.node().textContent}function dd(){this.innerHTML=""}function fd(e){return function(){this.innerHTML=e}}function hd(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gd(e){return arguments.length?this.each(e==null?dd:(typeof e=="function"?hd:fd)(e)):this.node().innerHTML}function vd(){this.nextSibling&&this.parentNode.appendChild(this)}function pd(){return this.each(vd)}function md(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yd(){return this.each(md)}function _d(e){var t=typeof e=="function"?e:pa(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wd(){return null}function bd(e,t){var n=typeof e=="function"?e:pa(e),r=t==null?wd:typeof t=="function"?t:ti(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function xd(){var e=this.parentNode;e&&e.removeChild(this)}function Ed(){return this.each(xd)}function Sd(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kd(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Cd(e){return this.select(e?kd:Sd)}function Nd(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Pd(e){return function(t){e.call(this,t,this.__data__)}}function Md(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 Ad(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function Td(e,t,n){return function(){var r=this.__on,o,i=Pd(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Dd(e,t,n){var r=Md(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,d;l<c;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?Td:Ad,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Ca(e,t,n){var r=ba(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Id(e,t){return function(){return Ca(this,e,t)}}function zd(e,t){return function(){return Ca(this,e,t.apply(this,arguments))}}function Od(e,t){return this.each((typeof t=="function"?zd:Id)(e,t))}function*Rd(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Na=[null];function Ve(e,t){this._groups=e,this._parents=t}function tr(){return new Ve([[document.documentElement]],Na)}function qd(){return this}Ve.prototype=tr.prototype={constructor:Ve,select:cu,selectAll:hu,selectChild:mu,selectChildren:bu,filter:xu,data:Pu,enter:Eu,exit:Au,join:Tu,merge:Du,selection:qd,order:Iu,sort:zu,call:Ru,nodes:qu,node:Hu,size:Lu,empty:Vu,each:Bu,attr:Gu,style:Ju,property:nd,classed:sd,text:ud,html:gd,raise:pd,lower:yd,append:_d,insert:bd,remove:Ed,clone:Cd,datum:Nd,on:Dd,dispatch:Od,[Symbol.iterator]:Rd};function Ke(e){return typeof e=="string"?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],Na)}function Hd(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xe(e,t){if(e=Hd(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ld={passive:!1},Vn={capture:!0,passive:!1};function oo(e){e.stopImmediatePropagation()}function dn(e){e.preventDefault(),e.stopImmediatePropagation()}function Pa(e){var t=e.document.documentElement,n=Ke(e).on("dragstart.drag",dn,Vn);"onselectstart"in t?n.on("selectstart.drag",dn,Vn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ma(e,t){var n=e.document.documentElement,r=Ke(e).on("dragstart.drag",null);t&&(r.on("click.drag",dn,Vn),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 cr=e=>()=>e;function Co(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Co.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Vd(e){return!e.ctrlKey&&!e.button}function Bd(){return this.parentNode}function Fd(e,t){return t??{x:e.x,y:e.y}}function Kd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yd(){var e=Vd,t=Bd,n=Fd,r=Kd,o={},i=Xr("start","drag","end"),s=0,a,l,c,d,h=0;function f(b){b.on("mousedown.drag",g).filter(r).on("touchstart.drag",y).on("touchmove.drag",w,Ld).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(b,A){if(!(d||!e.call(this,b,A))){var T=k(this,t.call(this,b,A),b,A,"mouse");T&&(Ke(b.view).on("mousemove.drag",v,Vn).on("mouseup.drag",_,Vn),Pa(b.view),oo(b),c=!1,a=b.clientX,l=b.clientY,T("start",b))}}function v(b){if(dn(b),!c){var A=b.clientX-a,T=b.clientY-l;c=A*A+T*T>h}o.mouse("drag",b)}function _(b){Ke(b.view).on("mousemove.drag mouseup.drag",null),Ma(b.view,c),dn(b),o.mouse("end",b)}function y(b,A){if(e.call(this,b,A)){var T=b.changedTouches,z=t.call(this,b,A),M=T.length,H,K;for(H=0;H<M;++H)(K=k(this,z,b,A,T[H].identifier,T[H]))&&(oo(b),K("start",b,T[H]))}}function w(b){var A=b.changedTouches,T=A.length,z,M;for(z=0;z<T;++z)(M=o[A[z].identifier])&&(dn(b),M("drag",b,A[z]))}function C(b){var A=b.changedTouches,T=A.length,z,M;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),z=0;z<T;++z)(M=o[A[z].identifier])&&(oo(b),M("end",b,A[z]))}function k(b,A,T,z,M,H){var K=i.copy(),P=Xe(H||T,A),x,N,p;if((p=n.call(b,new Co("beforestart",{sourceEvent:T,target:f,identifier:M,active:s,x:P[0],y:P[1],dx:0,dy:0,dispatch:K}),z))!=null)return x=p.x-P[0]||0,N=p.y-P[1]||0,function E(S,D,O){var I=P,q;switch(S){case"start":o[M]=E,q=s++;break;case"end":delete o[M],--s;case"drag":P=Xe(O||D,A),q=s;break}K.call(S,b,new Co(S,{sourceEvent:D,subject:p,target:f,identifier:M,active:q,x:P[0]+x,y:P[1]+N,dx:P[0]-I[0],dy:P[1]-I[1],dispatch:K}),z)}}return f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:cr(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:cr(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:cr(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:cr(!!b),f):r},f.on=function(){var b=i.on.apply(i,arguments);return b===i?f:b},f.clickDistance=function(b){return arguments.length?(h=(b=+b)*b,f):Math.sqrt(h)},f}function ri(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Aa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function nr(){}var Bn=.7,Nr=1/Bn,fn="\\s*([+-]?\\d+)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wd=/^#([0-9a-f]{3,8})$/,Zd=new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`),Xd=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),Gd=new RegExp(`^rgba\\(${fn},${fn},${fn},${Fn}\\)$`),Ud=new RegExp(`^rgba\\(${it},${it},${it},${Fn}\\)$`),Qd=new RegExp(`^hsl\\(${Fn},${it},${it}\\)$`),jd=new RegExp(`^hsla\\(${Fn},${it},${it},${Fn}\\)$`),Oi={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};ri(nr,jt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ri,formatHex:Ri,formatHex8:Jd,formatHsl:$d,formatRgb:qi,toString:qi});function Ri(){return this.rgb().formatHex()}function Jd(){return this.rgb().formatHex8()}function $d(){return Ta(this).formatHsl()}function qi(){return this.rgb().formatRgb()}function jt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Hi(t):n===3?new Ie(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ur(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ur(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=Zd.exec(e))?new Ie(t[1],t[2],t[3],1):(t=Xd.exec(e))?new Ie(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gd.exec(e))?ur(t[1],t[2],t[3],t[4]):(t=Ud.exec(e))?ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Qd.exec(e))?Bi(t[1],t[2]/100,t[3]/100,1):(t=jd.exec(e))?Bi(t[1],t[2]/100,t[3]/100,t[4]):Oi.hasOwnProperty(e)?Hi(Oi[e]):e==="transparent"?new Ie(NaN,NaN,NaN,0):null}function Hi(e){return new Ie(e>>16&255,e>>8&255,e&255,1)}function ur(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ie(e,t,n,r)}function ef(e){return e instanceof nr||(e=jt(e)),e?(e=e.rgb(),new Ie(e.r,e.g,e.b,e.opacity)):new Ie}function No(e,t,n,r){return arguments.length===1?ef(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ri(Ie,No,Aa(nr,{brighter(e){return e=e==null?Nr:Math.pow(Nr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bn:Math.pow(Bn,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ie(Xt(this.r),Xt(this.g),Xt(this.b),Pr(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:Li,formatHex:Li,formatHex8:tf,formatRgb:Vi,toString:Vi}));function Li(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}`}function tf(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}${Kt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vi(){const e=Pr(this.opacity);return`${e===1?"rgb(":"rgba("}${Xt(this.r)}, ${Xt(this.g)}, ${Xt(this.b)}${e===1?")":`, ${e})`}`}function Pr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kt(e){return e=Xt(e),(e<16?"0":"")+e.toString(16)}function Bi(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ge(e,t,n,r)}function Ta(e){if(e instanceof Ge)return new Ge(e.h,e.s,e.l,e.opacity);if(e instanceof nr||(e=jt(e)),!e)return new Ge;if(e instanceof Ge)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new Ge(s,a,l,e.opacity)}function nf(e,t,n,r){return arguments.length===1?Ta(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ri(Ge,nf,Aa(nr,{brighter(e){return e=e==null?Nr:Math.pow(Nr,e),new Ge(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bn:Math.pow(Bn,e),new Ge(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,o=2*n-r;return new Ie(io(e>=240?e-240:e+120,o,r),io(e,o,r),io(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Ge(Fi(this.h),dr(this.s),dr(this.l),Pr(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=Pr(this.opacity);return`${e===1?"hsl(":"hsla("}${Fi(this.h)}, ${dr(this.s)*100}%, ${dr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fi(e){return e=(e||0)%360,e<0?e+360:e}function dr(e){return Math.max(0,Math.min(1,e||0))}function io(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 oi=e=>()=>e;function rf(e,t){return function(n){return e+n*t}}function of(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function sf(e){return(e=+e)==1?Da:function(t,n){return n-t?of(t,n,e):oi(isNaN(t)?n:t)}}function Da(e,t){var n=t-e;return n?rf(e,n):oi(isNaN(e)?t:e)}const Mr=(function e(t){var n=sf(t);function r(o,i){var s=n((o=No(o)).r,(i=No(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Da(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return r.gamma=e,r})(1);function af(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function lf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cf(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Rn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function uf(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function df(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Rn(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Po=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,so=new RegExp(Po.source,"g");function ff(e){return function(){return e}}function hf(e){return function(t){return e(t)+""}}function Ia(e,t){var n=Po.lastIndex=so.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Po.exec(e))&&(o=so.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:tt(r,o)})),n=so.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?hf(l[0].x):ff(t):(t=l.length,function(c){for(var d=0,h;d<t;++d)a[(h=l[d]).i]=h.x(c);return a.join("")})}function Rn(e,t){var n=typeof t,r;return t==null||n==="boolean"?oi(t):(n==="number"?tt:n==="string"?(r=jt(t))?(t=r,Mr):Ia:t instanceof jt?Mr:t instanceof Date?uf:lf(t)?af:Array.isArray(t)?cf:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?df:tt)(e,t)}var Ki=180/Math.PI,Mo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function za(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Ki,skewX:Math.atan(l)*Ki,scaleX:s,scaleY:a}}var fr;function gf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Mo:za(t.a,t.b,t.c,t.d,t.e,t.f)}function vf(e){return e==null||(fr||(fr=document.createElementNS("http://www.w3.org/2000/svg","g")),fr.setAttribute("transform",e),!(e=fr.transform.baseVal.consolidate()))?Mo:(e=e.matrix,za(e.a,e.b,e.c,e.d,e.e,e.f))}function Oa(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,d,h,f,g,v){if(c!==h||d!==f){var _=g.push("translate(",null,t,null,n);v.push({i:_-4,x:tt(c,h)},{i:_-2,x:tt(d,f)})}else(h||f)&&g.push("translate("+h+t+f+n)}function s(c,d,h,f){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),f.push({i:h.push(o(h)+"rotate(",null,r)-2,x:tt(c,d)})):d&&h.push(o(h)+"rotate("+d+r)}function a(c,d,h,f){c!==d?f.push({i:h.push(o(h)+"skewX(",null,r)-2,x:tt(c,d)}):d&&h.push(o(h)+"skewX("+d+r)}function l(c,d,h,f,g,v){if(c!==h||d!==f){var _=g.push(o(g)+"scale(",null,",",null,")");v.push({i:_-4,x:tt(c,h)},{i:_-2,x:tt(d,f)})}else(h!==1||f!==1)&&g.push(o(g)+"scale("+h+","+f+")")}return function(c,d){var h=[],f=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,h,f),s(c.rotate,d.rotate,h,f),a(c.skewX,d.skewX,h,f),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,h,f),c=d=null,function(g){for(var v=-1,_=f.length,y;++v<_;)h[(y=f[v]).i]=y.x(g);return h.join("")}}}var pf=Oa(gf,"px, ","px)","deg)"),mf=Oa(vf,", ",")",")"),yf=1e-12;function Yi(e){return((e=Math.exp(e))+1/e)/2}function _f(e){return((e=Math.exp(e))-1/e)/2}function wf(e){return((e=Math.exp(2*e))-1)/(e+1)}const yr=(function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],d=s[0],h=s[1],f=s[2],g=d-a,v=h-l,_=g*g+v*v,y,w;if(_<yf)w=Math.log(f/c)/t,y=function(z){return[a+z*g,l+z*v,c*Math.exp(t*z*w)]};else{var C=Math.sqrt(_),k=(f*f-c*c+r*_)/(2*c*n*C),b=(f*f-c*c-r*_)/(2*f*n*C),A=Math.log(Math.sqrt(k*k+1)-k),T=Math.log(Math.sqrt(b*b+1)-b);w=(T-A)/t,y=function(z){var M=z*w,H=Yi(A),K=c/(n*C)*(H*wf(t*M+A)-_f(A));return[a+K*g,l+K*v,c*H/Yi(t*M+A)]}}return y.duration=w*1e3*t/Math.SQRT2,y}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o})(Math.SQRT2,2,4);var _n=0,In=0,Mn=0,Ra=1e3,Ar,zn,Tr=0,Jt=0,Ur=0,Kn=typeof performance=="object"&&performance.now?performance:Date,qa=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ii(){return Jt||(qa(bf),Jt=Kn.now()+Ur)}function bf(){Jt=0}function Dr(){this._call=this._time=this._next=null}Dr.prototype=Ha.prototype={constructor:Dr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ii():+n)+(t==null?0:+t),!this._next&&zn!==this&&(zn?zn._next=this:Ar=this,zn=this),this._call=e,this._time=n,Ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ao())}};function Ha(e,t,n){var r=new Dr;return r.restart(e,t,n),r}function xf(){ii(),++_n;for(var e=Ar,t;e;)(t=Jt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_n}function Wi(){Jt=(Tr=Kn.now())+Ur,_n=In=0;try{xf()}finally{_n=0,Sf(),Jt=0}}function Ef(){var e=Kn.now(),t=e-Tr;t>Ra&&(Ur-=t,Tr=e)}function Sf(){for(var e,t=Ar,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:Ar=n);zn=e,Ao(r)}function Ao(e){if(!_n){In&&(In=clearTimeout(In));var t=e-Jt;t>24?(e<1/0&&(In=setTimeout(Wi,e-Kn.now()-Ur)),Mn&&(Mn=clearInterval(Mn))):(Mn||(Tr=Kn.now(),Mn=setInterval(Ef,Ra)),_n=1,qa(Wi))}}function Zi(e,t,n){var r=new Dr;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var kf=Xr("start","end","cancel","interrupt"),Cf=[],La=0,Xi=1,To=2,_r=3,Gi=4,Do=5,wr=6;function Qr(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Nf(e,n,{name:t,index:r,group:o,on:kf,tween:Cf,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:La})}function si(e,t){var n=Je(e,t);if(n.state>La)throw new Error("too late; already scheduled");return n}function dt(e,t){var n=Je(e,t);if(n.state>_r)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nf(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Ha(i,0,n.time);function i(c){n.state=Xi,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,h,f,g;if(n.state!==Xi)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===_r)return Zi(s);g.state===Gi?(g.state=wr,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=wr,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(Zi(function(){n.state===_r&&(n.state=Gi,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=To,n.on.call("start",e,e.__data__,n.index,n.group),n.state===To){for(n.state=_r,o=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++h]=g);o.length=h+1}}function a(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Do,1),h=-1,f=o.length;++h<f;)o[h].call(e,d);n.state===Do&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=wr,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function br(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>To&&r.state<Do,r.state=wr,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Pf(e){return this.each(function(){br(this,e)})}function Mf(e,t){var n,r;return function(){var o=dt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Af(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=dt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}i.tween=o}}function Tf(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Je(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?Mf:Af)(n,e,t))}function ai(e,t,n){var r=e._id;return e.each(function(){var o=dt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Je(o,r).value[t]}}function Va(e,t){var n;return(typeof t=="number"?tt:t instanceof jt?Mr:(n=jt(t))?(t=n,Mr):Ia)(e,t)}function Df(e){return function(){this.removeAttribute(e)}}function If(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zf(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function Of(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function Rf(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function qf(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function Hf(e,t){var n=Gr(e),r=n==="transform"?mf:Va;return this.attrTween(e,typeof t=="function"?(n.local?qf:Rf)(n,r,ai(this,"attr."+e,t)):t==null?(n.local?If:Df)(n):(n.local?Of:zf)(n,r,t))}function Lf(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vf(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Bf(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Vf(e,i)),n}return o._value=t,o}function Ff(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Lf(e,i)),n}return o._value=t,o}function Kf(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=Gr(e);return this.tween(n,(r.local?Bf:Ff)(r,t))}function Yf(e,t){return function(){si(this,e).delay=+t.apply(this,arguments)}}function Wf(e,t){return t=+t,function(){si(this,e).delay=t}}function Zf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yf:Wf)(t,e)):Je(this.node(),t).delay}function Xf(e,t){return function(){dt(this,e).duration=+t.apply(this,arguments)}}function Gf(e,t){return t=+t,function(){dt(this,e).duration=t}}function Uf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xf:Gf)(t,e)):Je(this.node(),t).duration}function Qf(e,t){if(typeof t!="function")throw new Error;return function(){dt(this,e).ease=t}}function jf(e){var t=this._id;return arguments.length?this.each(Qf(t,e)):Je(this.node(),t).ease}function Jf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;dt(this,e).ease=n}}function $f(e){if(typeof e!="function")throw new Error;return this.each(Jf(this._id,e))}function eh(e){typeof e!="function"&&(e=ya(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Et(r,this._parents,this._name,this._id)}function th(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],c=n[a],d=l.length,h=s[a]=new Array(d),f,g=0;g<d;++g)(f=l[g]||c[g])&&(h[g]=f);for(;a<r;++a)s[a]=t[a];return new Et(s,this._parents,this._name,this._id)}function nh(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 rh(e,t,n){var r,o,i=nh(t)?si:dt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function oh(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(rh(n,e,t))}function ih(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function sh(){return this.on("end.remove",ih(this._id))}function ah(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ti(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,c=i[s]=new Array(l),d,h,f=0;f<l;++f)(d=a[f])&&(h=e.call(d,d.__data__,f,a))&&("__data__"in d&&(h.__data__=d.__data__),c[f]=h,Qr(c[f],t,n,f,c,Je(d,n)));return new Et(i,this._parents,t,n)}function lh(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ma(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],c=l.length,d,h=0;h<c;++h)if(d=l[h]){for(var f=e.call(d,d.__data__,h,l),g,v=Je(d,n),_=0,y=f.length;_<y;++_)(g=f[_])&&Qr(g,t,n,_,f,v);i.push(f),s.push(d)}return new Et(i,s,t,n)}var ch=tr.prototype.constructor;function uh(){return new ch(this._groups,this._parents)}function dh(e,t){var n,r,o;return function(){var i=yn(this,e),s=(this.style.removeProperty(e),yn(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Ba(e){return function(){this.style.removeProperty(e)}}function fh(e,t,n){var r,o=n+"",i;return function(){var s=yn(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function hh(e,t,n){var r,o,i;return function(){var s=yn(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),yn(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function gh(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=dt(this,e),c=l.on,d=l.value[i]==null?a||(a=Ba(t)):void 0;(c!==n||o!==d)&&(r=(n=c).copy()).on(s,o=d),l.on=r}}function vh(e,t,n){var r=(e+="")=="transform"?pf:Va;return t==null?this.styleTween(e,dh(e,r)).on("end.style."+e,Ba(e)):typeof t=="function"?this.styleTween(e,hh(e,r,ai(this,"style."+e,t))).each(gh(this._id,e)):this.styleTween(e,fh(e,r,t),n).on("end.style."+e,null)}function ph(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function mh(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&ph(e,s,n)),r}return i._value=t,i}function yh(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,mh(e,t,n??""))}function _h(e){return function(){this.textContent=e}}function wh(e){return function(){var t=e(this);this.textContent=t??""}}function bh(e){return this.tween("text",typeof e=="function"?wh(ai(this,"text",e)):_h(e==null?"":e+""))}function xh(e){return function(t){this.textContent=e.call(this,t)}}function Eh(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&xh(o)),t}return r._value=e,r}function Sh(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,Eh(e))}function kh(){for(var e=this._name,t=this._id,n=Fa(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var d=Je(l,t);Qr(l,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Et(r,this._parents,e,n)}function Ch(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var c=dt(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&i()})}var Nh=0;function Et(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Fa(){return++Nh}var ht=tr.prototype;Et.prototype={constructor:Et,select:ah,selectAll:lh,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:eh,merge:th,selection:uh,transition:kh,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:oh,attr:Hf,attrTween:Kf,style:vh,styleTween:yh,text:bh,textTween:Sh,remove:sh,tween:Tf,delay:Zf,duration:Uf,ease:jf,easeVarying:$f,end:Ch,[Symbol.iterator]:ht[Symbol.iterator]};function Ph(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Mh={time:null,delay:0,duration:250,ease:Ph};function Ah(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 Th(e){var t,n;e instanceof Et?(t=e._id,e=e._name):(t=Fa(),(n=Mh).time=ii(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Qr(l,e,t,c,s,n||Ah(l,t));return new Et(r,this._parents,e,t)}tr.prototype.interrupt=Pf;tr.prototype.transition=Th;const hr=e=>()=>e;function Dh(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function yt(e,t,n){this.k=e,this.x=t,this.y=n}yt.prototype={constructor:yt,scale:function(e){return e===1?this:new yt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yt(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 jr=new yt(1,0,0);Ka.prototype=yt.prototype;function Ka(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jr;return e.__zoom}function ao(e){e.stopImmediatePropagation()}function An(e){e.preventDefault(),e.stopImmediatePropagation()}function Ih(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function zh(){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 Ui(){return this.__zoom||jr}function Oh(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Rh(){return navigator.maxTouchPoints||"ontouchstart"in this}function qh(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Ya(){var e=Ih,t=zh,n=qh,r=Oh,o=Rh,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=yr,c=Xr("start","zoom","end"),d,h,f,g=500,v=150,_=0,y=10;function w(p){p.property("__zoom",Ui).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",K).filter(o).on("touchstart.zoom",P).on("touchmove.zoom",x).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(p,E,S,D){var O=p.selection?p.selection():p;O.property("__zoom",Ui),p!==O?A(p,E,S,D):O.interrupt().each(function(){T(this,arguments).event(D).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},w.scaleBy=function(p,E,S,D){w.scaleTo(p,function(){var O=this.__zoom.k,I=typeof E=="function"?E.apply(this,arguments):E;return O*I},S,D)},w.scaleTo=function(p,E,S,D){w.transform(p,function(){var O=t.apply(this,arguments),I=this.__zoom,q=S==null?b(O):typeof S=="function"?S.apply(this,arguments):S,V=I.invert(q),W=typeof E=="function"?E.apply(this,arguments):E;return n(k(C(I,W),q,V),O,s)},S,D)},w.translateBy=function(p,E,S,D){w.transform(p,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof S=="function"?S.apply(this,arguments):S),t.apply(this,arguments),s)},null,D)},w.translateTo=function(p,E,S,D,O){w.transform(p,function(){var I=t.apply(this,arguments),q=this.__zoom,V=D==null?b(I):typeof D=="function"?D.apply(this,arguments):D;return n(jr.translate(V[0],V[1]).scale(q.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof S=="function"?-S.apply(this,arguments):-S),I,s)},D,O)};function C(p,E){return E=Math.max(i[0],Math.min(i[1],E)),E===p.k?p:new yt(E,p.x,p.y)}function k(p,E,S){var D=E[0]-S[0]*p.k,O=E[1]-S[1]*p.k;return D===p.x&&O===p.y?p:new yt(p.k,D,O)}function b(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function A(p,E,S,D){p.on("start.zoom",function(){T(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(D).end()}).tween("zoom",function(){var O=this,I=arguments,q=T(O,I).event(D),V=t.apply(O,I),W=S==null?b(V):typeof S=="function"?S.apply(O,I):S,Y=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),B=O.__zoom,U=typeof E=="function"?E.apply(O,I):E,Z=l(B.invert(W).concat(Y/B.k),U.invert(W).concat(Y/U.k));return function(X){if(X===1)X=U;else{var Q=Z(X),ue=Y/Q[2];X=new yt(ue,W[0]-Q[0]*ue,W[1]-Q[1]*ue)}q.zoom(null,X)}})}function T(p,E,S){return!S&&p.__zooming||new z(p,E)}function z(p,E){this.that=p,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(p,E),this.taps=0}z.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,E){return this.mouse&&p!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var E=Ke(this.that).datum();c.call(p,this.that,new Dh(p,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:c}),E)}};function M(p,...E){if(!e.apply(this,arguments))return;var S=T(this,E).event(p),D=this.__zoom,O=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,r.apply(this,arguments)))),I=Xe(p);if(S.wheel)(S.mouse[0][0]!==I[0]||S.mouse[0][1]!==I[1])&&(S.mouse[1]=D.invert(S.mouse[0]=I)),clearTimeout(S.wheel);else{if(D.k===O)return;S.mouse=[I,D.invert(I)],br(this),S.start()}An(p),S.wheel=setTimeout(q,v),S.zoom("mouse",n(k(C(D,O),S.mouse[0],S.mouse[1]),S.extent,s));function q(){S.wheel=null,S.end()}}function H(p,...E){if(f||!e.apply(this,arguments))return;var S=p.currentTarget,D=T(this,E,!0).event(p),O=Ke(p.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Y,!0),I=Xe(p,S),q=p.clientX,V=p.clientY;Pa(p.view),ao(p),D.mouse=[I,this.__zoom.invert(I)],br(this),D.start();function W(B){if(An(B),!D.moved){var U=B.clientX-q,Z=B.clientY-V;D.moved=U*U+Z*Z>_}D.event(B).zoom("mouse",n(k(D.that.__zoom,D.mouse[0]=Xe(B,S),D.mouse[1]),D.extent,s))}function Y(B){O.on("mousemove.zoom mouseup.zoom",null),Ma(B.view,D.moved),An(B),D.event(B).end()}}function K(p,...E){if(e.apply(this,arguments)){var S=this.__zoom,D=Xe(p.changedTouches?p.changedTouches[0]:p,this),O=S.invert(D),I=S.k*(p.shiftKey?.5:2),q=n(k(C(S,I),D,O),t.apply(this,E),s);An(p),a>0?Ke(this).transition().duration(a).call(A,q,D,p):Ke(this).call(w.transform,q,D,p)}}function P(p,...E){if(e.apply(this,arguments)){var S=p.touches,D=S.length,O=T(this,E,p.changedTouches.length===D).event(p),I,q,V,W;for(ao(p),q=0;q<D;++q)V=S[q],W=Xe(V,this),W=[W,this.__zoom.invert(W),V.identifier],O.touch0?!O.touch1&&O.touch0[2]!==W[2]&&(O.touch1=W,O.taps=0):(O.touch0=W,I=!0,O.taps=1+!!d);d&&(d=clearTimeout(d)),I&&(O.taps<2&&(h=W[0],d=setTimeout(function(){d=null},g)),br(this),O.start())}}function x(p,...E){if(this.__zooming){var S=T(this,E).event(p),D=p.changedTouches,O=D.length,I,q,V,W;for(An(p),I=0;I<O;++I)q=D[I],V=Xe(q,this),S.touch0&&S.touch0[2]===q.identifier?S.touch0[0]=V:S.touch1&&S.touch1[2]===q.identifier&&(S.touch1[0]=V);if(q=S.that.__zoom,S.touch1){var Y=S.touch0[0],B=S.touch0[1],U=S.touch1[0],Z=S.touch1[1],X=(X=U[0]-Y[0])*X+(X=U[1]-Y[1])*X,Q=(Q=Z[0]-B[0])*Q+(Q=Z[1]-B[1])*Q;q=C(q,Math.sqrt(X/Q)),V=[(Y[0]+U[0])/2,(Y[1]+U[1])/2],W=[(B[0]+Z[0])/2,(B[1]+Z[1])/2]}else if(S.touch0)V=S.touch0[0],W=S.touch0[1];else return;S.zoom("touch",n(k(q,V,W),S.extent,s))}}function N(p,...E){if(this.__zooming){var S=T(this,E).event(p),D=p.changedTouches,O=D.length,I,q;for(ao(p),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),I=0;I<O;++I)q=D[I],S.touch0&&S.touch0[2]===q.identifier?delete S.touch0:S.touch1&&S.touch1[2]===q.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),S.taps===2&&(q=Xe(q,this),Math.hypot(h[0]-q[0],h[1]-q[1])<y)){var V=Ke(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return w.wheelDelta=function(p){return arguments.length?(r=typeof p=="function"?p:hr(+p),w):r},w.filter=function(p){return arguments.length?(e=typeof p=="function"?p:hr(!!p),w):e},w.touchable=function(p){return arguments.length?(o=typeof p=="function"?p:hr(!!p),w):o},w.extent=function(p){return arguments.length?(t=typeof p=="function"?p:hr([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),w):t},w.scaleExtent=function(p){return arguments.length?(i[0]=+p[0],i[1]=+p[1],w):[i[0],i[1]]},w.translateExtent=function(p){return arguments.length?(s[0][0]=+p[0][0],s[1][0]=+p[1][0],s[0][1]=+p[0][1],s[1][1]=+p[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(p){return arguments.length?(n=p,w):n},w.duration=function(p){return arguments.length?(a=+p,w):a},w.interpolate=function(p){return arguments.length?(l=p,w):l},w.on=function(){var p=c.on.apply(c,arguments);return p===c?w:p},w.clickDistance=function(p){return arguments.length?(_=(p=+p)*p,w):Math.sqrt(_)},w.tapDistance=function(p){return arguments.length?(y=+p,w):y},w}const Yn={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."},Io=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Wa=["Enter"," ","Escape"],Hh={"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 wn;(function(e){e.Strict="strict",e.Loose="loose"})(wn||(wn={}));var hn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(hn||(hn={}));var Ir;(function(e){e.Partial="partial",e.Full="full"})(Ir||(Ir={}));const zo={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Tt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Tt||(Tt={}));var zr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zr||(zr={}));var j;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(j||(j={}));const Qi={[j.Left]:j.Right,[j.Right]:j.Left,[j.Top]:j.Bottom,[j.Bottom]:j.Top};function Lh(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function ji(e,t,n){if(!n)return;const r=[];e.forEach((o,i)=>{t?.has(i)||r.push(o)}),r.length&&n(r)}function Vh(e){return e===null?null:e?"valid":"invalid"}const Za=e=>"id"in e&&"source"in e&&"target"in e,Bh=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),li=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rr=(e,t=[0,0])=>{const{width:n,height:r}=Bt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Fh=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):li(o)?o:t.nodeLookup.get(o.id));const a=s?Or(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jr(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $r(n)},or=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Jr(n,Or(o)),r=!0)}),r?$r(n):{x:0,y:0,width:0,height:0}},ci=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...sr(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const c of e.values()){const{measured:d,selectable:h=!0,hidden:f=!1}=c;if(s&&!h||f)continue;const g=d.width??c.width??c.initialWidth??null,v=d.height??c.height??c.initialHeight??null,_=Wn(a,xn(c)),y=(g??0)*(v??0),w=i&&_>0;(!c.internals.handleBounds||w||_>=y||c.dragging)&&l.push(c)}return l},Kh=(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 Yh(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function Wh({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Yh(e,s),l=or(a),c=ui(l,t,n,s?.minZoom??o,s?.maxZoom??i,s?.padding??.1);return await r.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function Xa({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let h=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",Yn.error005());else{const g=a.measured.width,v=a.measured.height;g&&v&&(h=[[l,c],[l+g,c+v]])}else a&&En(s.extent)&&(h=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=En(h)?$t(t,h,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",Yn.error015()),{position:{x:f.x-l+(s.measured.width??0)*d[0],y:f.y-c+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function Zh({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),v=!g&&f.parentId&&s.find(_=>_.id===f.parentId);(g||v)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=Kh(s,l);for(const f of l)a.has(f.id)&&!d.find(v=>v.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const h=await o({nodes:s,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:s}:{edges:[],nodes:[]}:h}const bn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$t=(e={x:0,y:0},t,n)=>({x:bn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:bn(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ga(e,t,n){const{width:r,height:o}=Bt(n),{x:i,y:s}=n.internals.positionAbsolute;return $t(e,[[i,s],[i+r,s+o]],t)}const Ji=(e,t,n)=>e<t?bn(Math.abs(e-t),1,t)/t:e>n?-bn(Math.abs(e-n),1,t)/t:0,Ua=(e,t,n=15,r=40)=>{const o=Ji(e.x,r,t.width-r)*n,i=Ji(e.y,r,t.height-r)*n;return[o,i]},Jr=(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)}),Oo=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),$r=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xn=(e,t=[0,0])=>{const{x:n,y:r}=li(e)?e.internals.positionAbsolute:rr(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Or=(e,t=[0,0])=>{const{x:n,y:r}=li(e)?e.internals.positionAbsolute:rr(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Qa=(e,t)=>$r(Jr(Oo(e),Oo(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)},$i=e=>_t(e.width)&&_t(e.height)&&_t(e.x)&&_t(e.y),_t=e=>!isNaN(e)&&isFinite(e),Xh=(e,t)=>{},ir=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),sr=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?ir(a,s):a},Rr=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function an(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 Gh(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=an(e,n),o=an(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=an(e.top??e.y??0,n),o=an(e.bottom??e.y??0,n),i=an(e.left??e.x??0,t),s=an(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Uh(e,t,n,r,o,i){const{x:s,y:a}=Rr(e,[t,n,r]),{x:l,y:c}=Rr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-l,h=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(h)}}const ui=(e,t,n,r,o,i)=>{const s=Gh(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),d=bn(c,r,o),h=e.x+e.width/2,f=e.y+e.height/2,g=t/2-h*d,v=n/2-f*d,_=Uh(e,g,v,d,t,n),y={left:Math.min(_.left-s.left,0),top:Math.min(_.top-s.top,0),right:Math.min(_.right-s.right,0),bottom:Math.min(_.bottom-s.bottom,0)};return{x:g-y.left+y.right,y:v-y.top+y.bottom,zoom:d}},Zn=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function En(e){return e!=null&&e!=="parent"}function Bt(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ja(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Qh(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function jh(e){return{...Hh,...e||{}}}function lo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=Qe(e),a=sr({x:i-(o?.left??0),y:s-(o?.top??0)},r),{x:l,y:c}=n?ir(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Ja=e=>({width:e.offsetWidth,height:e.offsetHeight}),$a=e=>e?.getRootNode?.()||window?.document,Jh=["INPUT","SELECT","TEXTAREA"];function el(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Jh.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const tl=e=>"clientX"in e,Qe=(e,t)=>{const n=tl(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},es=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Ja(s)}})};function $h({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),h=Math.abs(c-t);return[l,c,d,h]}function gr(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ts({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case j.Left:return[t-gr(t-r,i),n];case j.Right:return[t+gr(r-t,i),n];case j.Top:return[t,n-gr(n-o,i)];case j.Bottom:return[t,n+gr(o-n,i)]}}function nl({sourceX:e,sourceY:t,sourcePosition:n=j.Bottom,targetX:r,targetY:o,targetPosition:i=j.Top,curvature:s=.25}){const[a,l]=ts({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,d]=ts({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[h,f,g,v]=$h({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${r},${o}`,h,f,g,v]}function rl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function eg({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function tg({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Jr(Or(e),Or(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Wn(s,$r(i))>0}const ng=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,rg=(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)),og=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||ng;let o;return Za(e)?o={...e}:o={...e,id:r(e)},rg(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function ol({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=rl({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const ns={[j.Left]:{x:-1,y:0},[j.Right]:{x:1,y:0},[j.Top]:{x:0,y:-1},[j.Bottom]:{x:0,y:1}},ig=({source:e,sourcePosition:t=j.Bottom,target:n})=>t===j.Left||t===j.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},rs=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sg({source:e,sourcePosition:t=j.Bottom,target:n,targetPosition:r=j.Top,center:o,offset:i,stepPosition:s}){const a=ns[t],l=ns[r],c={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},h=ig({source:c,sourcePosition:t,target:d}),f=h.x!==0?"x":"y",g=h[f];let v=[],_,y;const w={x:0,y:0},C={x:0,y:0},[,,k,b]=rl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(_=o.x??c.x+(d.x-c.x)*s,y=o.y??(c.y+d.y)/2):(_=o.x??(c.x+d.x)/2,y=o.y??c.y+(d.y-c.y)*s);const T=[{x:_,y:c.y},{x:_,y:d.y}],z=[{x:c.x,y},{x:d.x,y}];a[f]===g?v=f==="x"?T:z:v=f==="x"?z:T}else{const T=[{x:c.x,y:d.y}],z=[{x:d.x,y:c.y}];if(f==="x"?v=a.x===g?z:T:v=a.y===g?T:z,t===r){const x=Math.abs(e[f]-n[f]);if(x<=i){const N=Math.min(i-1,i-x);a[f]===g?w[f]=(c[f]>e[f]?-1:1)*N:C[f]=(d[f]>n[f]?-1:1)*N}}if(t!==r){const x=f==="x"?"y":"x",N=a[f]===l[x],p=c[x]>d[x],E=c[x]<d[x];(a[f]===1&&(!N&&p||N&&E)||a[f]!==1&&(!N&&E||N&&p))&&(v=f==="x"?T:z)}const M={x:c.x+w.x,y:c.y+w.y},H={x:d.x+C.x,y:d.y+C.y},K=Math.max(Math.abs(M.x-v[0].x),Math.abs(H.x-v[0].x)),P=Math.max(Math.abs(M.y-v[0].y),Math.abs(H.y-v[0].y));K>=P?(_=(M.x+H.x)/2,y=v[0].y):(_=v[0].x,y=(M.y+H.y)/2)}return[[e,{x:c.x+w.x,y:c.y+w.y},...v,{x:d.x+C.x,y:d.y+C.y},n],_,y,k,b]}function ag(e,t,n,r){const o=Math.min(rs(e,t)/2,rs(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*c},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function di({sourceX:e,sourceY:t,sourcePosition:n=j.Bottom,targetX:r,targetY:o,targetPosition:i=j.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:d=.5}){const[h,f,g,v,_]=sg({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:d});return[h.reduce((w,C,k)=>{let b="";return k>0&&k<h.length-1?b=ag(h[k-1],C,h[k+1],s):b=`${k===0?"M":"L"}${C.x} ${C.y}`,w+=b,w},""),f,g,v,_]}function os(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function lg(e){const{sourceNode:t,targetNode:n}=e;if(!os(t)||!os(n))return null;const r=t.internals.handleBounds||is(t.handles),o=n.internals.handleBounds||is(n.handles),i=ss(r?.source??[],e.sourceHandle),s=ss(e.connectionMode===wn.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",Yn.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||j.Bottom,l=s?.position||j.Top,c=en(t,i,a),d=en(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function is(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 en(e,t,n=j.Left,r=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Bt(e);if(r)return{x:o+s/2,y:i+a/2};switch(t?.position??n){case j.Top:return{x:o+s/2,y:i};case j.Right:return{x:o+s,y:i+a/2};case j.Bottom:return{x:o+s/2,y:i+a};case j.Left:return{x:o,y:i+a/2}}}function ss(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ro(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function cg(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){const c=Ro(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const il=1e3,ug=10,fi={nodeOrigin:[0,0],nodeExtent:Io,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},dg={...fi,checkEquality:!0};function hi(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function fg(e,t,n){const r=hi(fi,n);for(const o of e.values())if(o.parentId)vi(o,e,t,r);else{const i=rr(o,r.nodeOrigin),s=En(o.extent)?o.extent:r.nodeExtent,a=$t(i,s,Bt(o));o.internals.positionAbsolute=a}}function hg(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function gi(e){return e==="manual"}function gg(e,t,n,r={}){const o=hi(dg,r),i={i:0},s=new Map(t),a=o?.elevateNodesOnSelect&&!gi(o.zIndexMode)?il:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let d=s.get(c.id);if(o.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const h=rr(c,o.nodeOrigin),f=En(c.extent)?c.extent:o.nodeExtent,g=$t(h,f,Bt(c));d={...o.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:g,handleBounds:hg(c,d),z:sl(c,a,o.zIndexMode),userNode:c}},t.set(c.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(l=!1),c.parentId&&vi(d,t,n,r,i)}return l}function vg(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 vi(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=hi(fi,r),c=e.parentId,d=t.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}vg(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*ug),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const h=i&&!gi(l)?il:0,{x:f,y:g,z:v}=pg(e,d,s,a,h,l),{positionAbsolute:_}=e.internals,y=f!==_.x||g!==_.y;(y||v!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:f,y:g}:_,z:v}})}function sl(e,t,n){const r=_t(e.zIndex)?e.zIndex:0;return gi(n)?r:r+(e.selected?t:0)}function pg(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Bt(e),c=rr(e,n),d=En(e.extent)?$t(c,e.extent,l):c;let h=$t({x:s+d.x,y:a+d.y},r,l);e.extent==="parent"&&(h=Ga(h,l,t));const f=sl(e,o,i),g=t.internals.z??0;return{x:h.x,y:h.y,z:g>=f?g+1:f}}function mg(e,t,n,r=[0,0]){const o=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??xn(a),c=Qa(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,d=Bt(a),h=a.origin??r,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,g=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,v=Math.max(d.width,Math.round(s.width)),_=Math.max(d.height,Math.round(s.height)),y=(v-d.width)*h[0],w=(_-d.height)*h[1];(f>0||g>0||y||w)&&(o.push({id:l,type:"position",position:{x:a.position.x-f+y,y:a.position.y-g+w}}),n.get(l)?.forEach(C=>{e.some(k=>k.id===C.id)||o.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(d.width<s.width||d.height<s.height||f||g)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:v+(f?h[0]*f-y:0),height:_+(g?h[1]*g-w:0)}})}),o}function yg(e,t,n,r,o,i,s){const a=r?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],d=window.getComputedStyle(a),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const g of e.values()){const v=t.get(g.id);if(!v)continue;if(v.hidden){t.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),l=!0;continue}const _=Ja(g.nodeElement),y=v.measured.width!==_.width||v.measured.height!==_.height;if(!!(_.width&&_.height&&(y||!v.internals.handleBounds||g.force))){const C=g.nodeElement.getBoundingClientRect(),k=En(v.extent)?v.extent:i;let{positionAbsolute:b}=v.internals;v.parentId&&v.extent==="parent"?b=Ga(b,_,t.get(v.parentId)):k&&(b=$t(b,k,_));const A={...v,measured:_,internals:{...v.internals,positionAbsolute:b,handleBounds:{source:es("source",g.nodeElement,C,h,v.id),target:es("target",g.nodeElement,C,h,v.id)}}};t.set(v.id,A),v.parentId&&vi(A,t,n,{nodeOrigin:o,zIndexMode:s}),l=!0,y&&(c.push({id:v.id,type:"dimensions",dimensions:_}),v.expandParent&&v.parentId&&f.push({id:v.id,parentId:v.parentId,rect:xn(A,o)}))}}if(f.length>0){const g=mg(f,t,n,o);c.push(...g)}return{changes:c,updatedInternals:l}}async function _g({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function as(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const c=r.get(s)||new Map;r.set(s,c.set(n,t))}}function wg(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},c=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;as("source",l,d,e,o,s),as("target",l,c,e,i,a),t.set(r.id,r)}}function al(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:al(n,t):!1}function ls(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function bg(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!al(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function co({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const o=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&o.push({...l,position:a.position,dragging:r})}if(!e)return[o[0],o];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:r}:o[0],o]}function xg({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=ir(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Eg({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},d=null,h=!1,f=null,g=!1,v=!1,_=null;function y({noDragClassName:C,handleSelector:k,domNode:b,isSelectable:A,nodeId:T,nodeClickDistance:z=0}){f=Ke(b);function M({x,y:N}){const{nodeLookup:p,nodeExtent:E,snapGrid:S,snapToGrid:D,nodeOrigin:O,onNodeDrag:I,onSelectionDrag:q,onError:V,updateNodePositions:W}=t();i={x,y:N};let Y=!1;const B=a.size>1,U=B&&E?Oo(or(a)):null,Z=B&&D?xg({dragItems:a,snapGrid:S,x,y:N}):null;for(const[X,Q]of a){if(!p.has(X))continue;let ue={x:x-Q.distance.x,y:N-Q.distance.y};D&&(ue=Z?{x:Math.round(ue.x+Z.x),y:Math.round(ue.y+Z.y)}:ir(ue,S));let we=null;if(B&&E&&!Q.extent&&U){const{positionAbsolute:te}=Q.internals,Me=te.x-U.x+E[0][0],Ct=te.x+Q.measured.width-U.x2+E[1][0],Nt=te.y-U.y+E[0][1],ft=te.y+Q.measured.height-U.y2+E[1][1];we=[[Me,Nt],[Ct,ft]]}const{position:J,positionAbsolute:pe}=Xa({nodeId:X,nextPosition:ue,nodeLookup:p,nodeExtent:we||E,nodeOrigin:O,onError:V});Y=Y||Q.position.x!==J.x||Q.position.y!==J.y,Q.position=J,Q.internals.positionAbsolute=pe}if(v=v||Y,!!Y&&(W(a,!0),_&&(r||I||!T&&q))){const[X,Q]=co({nodeId:T,dragItems:a,nodeLookup:p});r?.(_,a,X,Q),I?.(_,X,Q),T||q?.(_,Q)}}async function H(){if(!d)return;const{transform:x,panBy:N,autoPanSpeed:p,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(s);return}const[S,D]=Ua(c,d,p);(S!==0||D!==0)&&(i.x=(i.x??0)-S/x[2],i.y=(i.y??0)-D/x[2],await N({x:S,y:D})&&M(i)),s=requestAnimationFrame(H)}function K(x){const{nodeLookup:N,multiSelectionActive:p,nodesDraggable:E,transform:S,snapGrid:D,snapToGrid:O,selectNodesOnDrag:I,onNodeDragStart:q,onSelectionDragStart:V,unselectNodesAndEdges:W}=t();h=!0,(!I||!A)&&!p&&T&&(N.get(T)?.selected||W()),A&&I&&T&&e?.(T);const Y=lo(x.sourceEvent,{transform:S,snapGrid:D,snapToGrid:O,containerBounds:d});if(i=Y,a=bg(N,E,Y,T),a.size>0&&(n||q||!T&&V)){const[B,U]=co({nodeId:T,dragItems:a,nodeLookup:N});n?.(x.sourceEvent,a,B,U),q?.(x.sourceEvent,B,U),T||V?.(x.sourceEvent,U)}}const P=Yd().clickDistance(z).on("start",x=>{const{domNode:N,nodeDragThreshold:p,transform:E,snapGrid:S,snapToGrid:D}=t();d=N?.getBoundingClientRect()||null,g=!1,v=!1,_=x.sourceEvent,p===0&&K(x),i=lo(x.sourceEvent,{transform:E,snapGrid:S,snapToGrid:D,containerBounds:d}),c=Qe(x.sourceEvent,d)}).on("drag",x=>{const{autoPanOnNodeDrag:N,transform:p,snapGrid:E,snapToGrid:S,nodeDragThreshold:D,nodeLookup:O}=t(),I=lo(x.sourceEvent,{transform:p,snapGrid:E,snapToGrid:S,containerBounds:d});if(_=x.sourceEvent,(x.sourceEvent.type==="touchmove"&&x.sourceEvent.touches.length>1||T&&!O.has(T))&&(g=!0),!g){if(!l&&N&&h&&(l=!0,H()),!h){const q=Qe(x.sourceEvent,d),V=q.x-c.x,W=q.y-c.y;Math.sqrt(V*V+W*W)>D&&K(x)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&a&&h&&(c=Qe(x.sourceEvent,d),M(I))}}).on("end",x=>{if(!(!h||g)&&(l=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:N,updateNodePositions:p,onNodeDragStop:E,onSelectionDragStop:S}=t();if(v&&(p(a,!1),v=!1),o||E||!T&&S){const[D,O]=co({nodeId:T,dragItems:a,nodeLookup:N,dragging:!1});o?.(x.sourceEvent,a,D,O),E?.(x.sourceEvent,D,O),T||S?.(x.sourceEvent,O)}}}).filter(x=>{const N=x.target;return!x.button&&(!C||!ls(N,`.${C}`,b))&&(!k||ls(N,k,b))});f.call(P)}function w(){f?.on(".drag",null)}return{update:y,destroy:w}}function Sg(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Wn(o,xn(i))>0&&r.push(i);return r}const kg=250;function Cg(e,t,n,r){let o=[],i=1/0;const s=Sg(e,n,t+kg);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:d,y:h}=en(a,c,c.position,!0),f=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));f>t||(f<i?(o=[{...c,x:d,y:h}],i=f):f===i&&o.push({...c,x:d,y:h}))}}if(!o.length)return null;if(o.length>1){const a=r.type==="source"?"target":"source";return o.find(l=>l.type===a)??o[0]}return o[0]}function ll(e,t,n,r,o,i=!1){const s=r.get(e);if(!s)return null;const a=o==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...en(s,l,l.position,!0)}:l}function cl(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ng(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ul=()=>!0;function Pg(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:_,onConnectEnd:y,isValidConnection:w=ul,onReconnectEnd:C,updateConnection:k,getTransform:b,getFromHandle:A,autoPanSpeed:T,dragThreshold:z=1,handleDomNode:M}){const H=$a(e.target);let K=0,P;const{x,y:N}=Qe(e),p=cl(i,M),E=a?.getBoundingClientRect();let S=!1;if(!E||!p)return;const D=ll(o,p,r,l,t);if(!D)return;let O=Qe(e,E),I=!1,q=null,V=!1,W=null;function Y(){if(!d||!E)return;const[J,pe]=Ua(O,E,T);f({x:J,y:pe}),K=requestAnimationFrame(Y)}const B={...D,nodeId:o,type:p,position:D.position},U=l.get(o);let X={inProgress:!0,isValid:null,from:en(U,B,j.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:U,to:O,toHandle:null,toPosition:Qi[B.position],toNode:null,pointer:O};function Q(){S=!0,k(X),v?.(e,{nodeId:o,handleId:r,handleType:p})}z===0&&Q();function ue(J){if(!S){const{x:ft,y:ce}=Qe(J),ye=ft-x,Ze=ce-N;if(!(ye*ye+Ze*Ze>z*z))return;Q()}if(!A()||!B){we(J);return}const pe=b();O=Qe(J,E),P=Cg(sr(O,pe,!1,[1,1]),n,l,B),I||(Y(),I=!0);const te=dl(J,{handle:P,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:H,lib:c,flowId:h,nodeLookup:l});W=te.handleDomNode,q=te.connection,V=Ng(!!P,te.isValid);const Me=l.get(o),Ct=Me?en(Me,B,j.Left,!0):X.from,Nt={...X,from:Ct,isValid:V,to:te.toHandle&&V?Rr({x:te.toHandle.x,y:te.toHandle.y},pe):O,toHandle:te.toHandle,toPosition:V&&te.toHandle?te.toHandle.position:Qi[B.position],toNode:te.toHandle?l.get(te.toHandle.nodeId):null,pointer:O};k(Nt),X=Nt}function we(J){if(!("touches"in J&&J.touches.length>0)){if(S){(P||W)&&q&&V&&_?.(q);const{inProgress:pe,...te}=X,Me={...te,toPosition:X.toHandle?X.toPosition:null};y?.(J,Me),i&&C?.(J,Me)}g(),cancelAnimationFrame(K),I=!1,V=!1,q=null,W=null,H.removeEventListener("mousemove",ue),H.removeEventListener("mouseup",we),H.removeEventListener("touchmove",ue),H.removeEventListener("touchend",we)}}H.addEventListener("mousemove",ue),H.addEventListener("mouseup",we),H.addEventListener("touchmove",ue),H.addEventListener("touchend",we)}function dl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=ul,nodeLookup:d}){const h=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:v}=Qe(e),_=s.elementFromPoint(g,v),y=_?.classList.contains(`${a}-flow__handle`)?_:f,w={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const C=cl(void 0,y),k=y.getAttribute("data-nodeid"),b=y.getAttribute("data-handleid"),A=y.classList.contains("connectable"),T=y.classList.contains("connectableend");if(!k||!C)return w;const z={source:h?k:r,sourceHandle:h?b:o,target:h?r:k,targetHandle:h?o:b};w.connection=z;const H=A&&T&&(n===wn.Strict?h&&C==="source"||!h&&C==="target":k!==r||b!==o);w.isValid=H&&c(z),w.toHandle=ll(k,C,b,d,n,!0)}return w}const cs={onPointerDown:Pg,isValid:dl};function Mg({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Ke(e);function i({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:g=!1}){const v=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const b=n(),A=k.sourceEvent.ctrlKey&&Zn()?10:1,T=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*d,z=b[2]*Math.pow(2,T*A);t.scaleTo(z)};let _=[0,0];const y=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(_=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},w=k=>{const b=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const A=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],T=[A[0]-_[0],A[1]-_[1]];_=A;const z=r()*Math.max(b[2],Math.log(b[2]))*(g?-1:1),M={x:b[0]-T[0]*z,y:b[1]-T[1]*z},H=[[0,0],[l,c]];t.setViewportConstrained({x:M.x,y:M.y,zoom:b[2]},H,a)},C=Ya().on("start",y).on("zoom",h?w:null).on("zoom.wheel",f?v:null);o.call(C,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:Xe}}const eo=e=>({x:e.x,y:e.y,zoom:e.k}),uo=({x:e,y:t,zoom:n})=>jr.translate(e,t).scale(n),un=(e,t)=>e.target.closest(`.${t}`),fl=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ag=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fo=(e,t=0,n=Ag,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},hl=e=>{const t=e.ctrlKey&&Zn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Tg({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(un(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(d.ctrlKey&&s){const y=Xe(d),w=hl(d),C=h*Math.pow(2,w);r.scaleTo(n,C,y,d);return}const f=d.deltaMode===1?20:1;let g=o===hn.Vertical?0:d.deltaX*f,v=o===hn.Horizontal?0:d.deltaY*f;!Zn()&&d.shiftKey&&o!==hn.Vertical&&(g=d.deltaY*f,v=0),r.translateBy(n,-(g/h)*i,-(v/h)*i,{internal:!0});const _=eo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(d,_),e.panScrollTimeout=setTimeout(()=>{c?.(d,_),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(d,_))}}function Dg({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=un(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function Ig({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const o=eo(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}function zg({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&fl(t,e.mouseButton??0)),i.sourceEvent?.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,eo(i.transform))}}function Og({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&fl(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=eo(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(s.sourceEvent,a)},n?150:0)}}}function Rg({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:d}){return h=>{const f=e||t,g=n&&h.ctrlKey,v=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(un(h,`${c}-flow__node`)||un(h,`${c}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!v||un(h,a)&&v||un(h,l)&&(!v||o&&v&&!e)||!n&&h.ctrlKey&&v)return!1;if(!n&&h.type==="touchstart"&&h.touches?.length>1)return h.preventDefault(),!1;if(!f&&!o&&!g&&v||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const _=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||v)&&_}}function qg({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=Ya().scaleExtent([t,n]).translateExtent(r),f=Ke(e).call(h);C({x:o.x,y:o.y,zoom:bn(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const g=f.on("wheel.zoom"),v=f.on("dblclick.zoom");h.wheelDelta(hl);function _(P,x){return f?new Promise(N=>{h?.interpolate(x?.interpolate==="linear"?Rn:yr).transform(fo(f,x?.duration,x?.ease,()=>N(!0)),P)}):Promise.resolve(!1)}function y({noWheelClassName:P,noPanClassName:x,onPaneContextMenu:N,userSelectionActive:p,panOnScroll:E,panOnDrag:S,panOnScrollMode:D,panOnScrollSpeed:O,preventScrolling:I,zoomOnPinch:q,zoomOnScroll:V,zoomOnDoubleClick:W,zoomActivationKeyPressed:Y,lib:B,onTransformChange:U,connectionInProgress:Z,paneClickDistance:X,selectionOnDrag:Q}){p&&!c.isZoomingOrPanning&&w();const ue=E&&!Y&&!p;h.clickDistance(Q?1/0:!_t(X)||X<0?0:X);const we=ue?Tg({zoomPanValues:c,noWheelClassName:P,d3Selection:f,d3Zoom:h,panOnScrollMode:D,panOnScrollSpeed:O,zoomOnPinch:q,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Dg({noWheelClassName:P,preventScrolling:I,d3ZoomHandler:g});if(f.on("wheel.zoom",we,{passive:!1}),!p){const pe=Ig({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});h.on("start",pe);const te=zg({zoomPanValues:c,panOnDrag:S,onPaneContextMenu:!!N,onPanZoom:i,onTransformChange:U});h.on("zoom",te);const Me=Og({zoomPanValues:c,panOnDrag:S,panOnScroll:E,onPaneContextMenu:N,onPanZoomEnd:a,onDraggingChange:l});h.on("end",Me)}const J=Rg({zoomActivationKeyPressed:Y,panOnDrag:S,zoomOnScroll:V,panOnScroll:E,zoomOnDoubleClick:W,zoomOnPinch:q,userSelectionActive:p,noPanClassName:x,noWheelClassName:P,lib:B,connectionInProgress:Z});h.filter(J),W?f.on("dblclick.zoom",v):f.on("dblclick.zoom",null)}function w(){h.on("zoom",null)}async function C(P,x,N){const p=uo(P),E=h?.constrain()(p,x,N);return E&&await _(E),new Promise(S=>S(E))}async function k(P,x){const N=uo(P);return await _(N,x),new Promise(p=>p(N))}function b(P){if(f){const x=uo(P),N=f.property("__zoom");(N.k!==P.zoom||N.x!==P.x||N.y!==P.y)&&h?.transform(f,x,null,{sync:!0})}}function A(){const P=f?Ka(f.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function T(P,x){return f?new Promise(N=>{h?.interpolate(x?.interpolate==="linear"?Rn:yr).scaleTo(fo(f,x?.duration,x?.ease,()=>N(!0)),P)}):Promise.resolve(!1)}function z(P,x){return f?new Promise(N=>{h?.interpolate(x?.interpolate==="linear"?Rn:yr).scaleBy(fo(f,x?.duration,x?.ease,()=>N(!0)),P)}):Promise.resolve(!1)}function M(P){h?.scaleExtent(P)}function H(P){h?.translateExtent(P)}function K(P){const x=!_t(P)||P<0?0:P;h?.clickDistance(x)}return{update:y,destroy:w,setViewport:k,setViewportConstrained:C,getViewport:A,scaleTo:T,scaleBy:z,setScaleExtent:M,setTranslateExtent:H,syncViewport:b,setClickDistance:K}}var us;(function(e){e.Line="line",e.Handle="handle"})(us||(us={}));function pi(){const e={};return[t=>{if(t&&!ec(e))throw new Error(t);return Fo(e)},t=>As(e,t)]}const[Hg,Lg]=pi(),[Vg,Bg]=pi(),[Fg,Kg]=pi();var Yg=ae("<div><!></div>");function qr(e,t){re(t,!0);let n=L(t,"id",3,null),r=L(t,"type",3,"source"),o=L(t,"position",19,()=>j.Top),i=L(t,"isConnectableStart",3,!0),s=L(t,"isConnectableEnd",3,!0),a=Vt(t,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const l=Hg("Handle must be used within a Custom Node component"),c=Vg("Handle must be used within a Custom Node component");let d=m(()=>r()==="target"),h=m(()=>t.isConnectable!==void 0?t.isConnectable:c.value),f=Ft(),g=m(()=>f.ariaLabelConfig),v=null;Zs(()=>{if(t.onconnect||t.ondisconnect){f.edges;let x=f.connectionLookup.get(`${l}-${r()}${n()?`-${n()}`:""}`);if(v&&!Lh(x,v)){const N=x??new Map;ji(v,N,t.ondisconnect),ji(N,v,t.onconnect)}v=new Map(x)}});let _=m(()=>{if(!f.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:x,toHandle:N,isValid:p}=f.connection,E=x&&x.nodeId===l&&x.type===r()&&x.id===n(),S=N&&N.nodeId===l&&N.type===r()&&N.id===n(),D=f.connectionMode===wn.Strict?x?.type!==r():l!==x?.nodeId||n()!==x?.id;return[!0,E,S,D,S&&p]}),y=m(()=>Xn(u(_),5)),w=m(()=>u(y)[0]),C=m(()=>u(y)[1]),k=m(()=>u(y)[2]),b=m(()=>u(y)[3]),A=m(()=>u(y)[4]);function T(x){const N=f.onbeforeconnect?f.onbeforeconnect(x):x;N&&(f.addEdge(N),f.onconnect?.(x))}function z(x){const N=tl(x);x.currentTarget&&(N&&x.button===0||!N)&&cs.onPointerDown(x,{handleId:n(),nodeId:l,isTarget:u(d),connectionRadius:f.connectionRadius,domNode:f.domNode,nodeLookup:f.nodeLookup,connectionMode:f.connectionMode,lib:"svelte",autoPanOnConnect:f.autoPanOnConnect,autoPanSpeed:f.autoPanSpeed,flowId:f.flowId,isValidConnection:t.isValidConnection??f.isValidConnection,updateConnection:f.updateConnection,cancelConnection:f.cancelConnection,panBy:f.panBy,onConnect:T,onConnectStart:(p,E)=>{f.onconnectstart?.(p,{nodeId:E.nodeId,handleId:E.handleId,handleType:E.handleType})},onConnectEnd:(p,E)=>{f.onconnectend?.(p,E)},getTransform:()=>[f.viewport.x,f.viewport.y,f.viewport.zoom],getFromHandle:()=>f.connection.fromHandle,dragThreshold:f.connectionDragThreshold,handleDomNode:x.currentTarget})}function M(x){if(!l||!f.clickConnectStartHandle&&!i())return;if(!f.clickConnectStartHandle){f.onclickconnectstart?.(x,{nodeId:l,handleId:n(),handleType:r()}),f.clickConnectStartHandle={nodeId:l,type:r(),id:n()};return}const N=$a(x.target),p=t.isValidConnection??f.isValidConnection,{connectionMode:E,clickConnectStartHandle:S,flowId:D,nodeLookup:O}=f,{connection:I,isValid:q}=cs.isValid(x,{handle:{nodeId:l,id:n(),type:r()},connectionMode:E,fromNodeId:S.nodeId,fromHandleId:S.id??null,fromType:S.type,isValidConnection:p,flowId:D,doc:N,lib:"svelte",nodeLookup:O});q&&I&&T(I);const V=structuredClone(Ms(f.connection));delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,f.onclickconnectend?.(x,V),f.clickConnectStartHandle=null}var H=Yg(),K=()=>{};Lt(H,()=>({"data-handleid":n(),"data-nodeid":l,"data-handlepos":o(),"data-id":`${f.flowId??""}-${l??""}-${n()??"null"??""}-${r()??""}`,class:["svelte-flow__handle",`svelte-flow__handle-${o()}`,f.noDragClass,f.noPanClass,o(),t.class],onmousedown:z,ontouchstart:z,onclick:f.clickConnect?M:void 0,onkeypress:K,style:t.style,role:"button","aria-label":u(g)["handle.ariaLabel"],tabindex:"-1",...a,[Mt]:{valid:u(A),connectingto:u(k),connectingfrom:u(C),source:!u(d),target:u(d),connectablestart:i(),connectableend:s(),connectable:u(h),connectionindicator:u(h)&&(!u(w)||u(b))&&(u(w)||f.clickConnectStartHandle?s():i())}}));var P=ee(H);Ye(P,()=>t.children??Sn),F(e,H),oe()}var Wg=ae("<!> <!>",1);function gl(e,t){re(t,!0);let n=L(t,"targetPosition",19,()=>j.Top),r=L(t,"sourcePosition",19,()=>j.Bottom);var o=Wg(),i=le(o);qr(i,{type:"target",get position(){return n()}});var s=$(i),a=$(s);qr(a,{type:"source",get position(){return r()}}),he(()=>Re(s,` ${t.data?.label??""} `)),F(e,o),oe()}var Zg=ae(" <!>",1);function Xg(e,t){re(t,!0);let n=L(t,"data",19,()=>({label:"Node"})),r=L(t,"sourcePosition",19,()=>j.Bottom);var o=Zg(),i=le(o),s=$(i);qr(s,{type:"source",get position(){return r()}}),he(()=>Re(i,`${n()?.label??""} `)),F(e,o),oe()}var Gg=ae(" <!>",1);function Ug(e,t){re(t,!0);let n=L(t,"data",19,()=>({label:"Node"})),r=L(t,"targetPosition",19,()=>j.Top);var o=Gg(),i=le(o),s=$(i);qr(s,{type:"target",get position(){return r()}}),he(()=>Re(i,`${n()?.label??""} `)),F(e,o),oe()}function Qg(e,t){}function ho(e,t,n){if(!n||!t)return;const r=n==="root"?t:t.querySelector(`.svelte-flow__${n}`);r&&r.appendChild(e)}function jg(e,t){const n=m(Ft),r=m(()=>u(n).domNode);let o;return u(r)?ho(e,u(r),t):o=Xs(()=>{at(()=>{ho(e,u(r),t),o?.()})}),{async update(i){ho(e,u(r),i)},destroy(){e.parentNode&&e.parentNode.removeChild(e),o?.()}}}function Jg(){let e=se(typeof window>"u");if(u(e)){const t=Xs(()=>{at(()=>{R(e,!1),t?.()})})}return{get value(){return u(e)}}}const ds=e=>Bh(e),$g=e=>Za(e);function ct(e){return e===void 0?void 0:`${e}px`}const Hr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ev=ae("<div><!></div>");function tv(e,t){re(t,!0);let n=L(t,"x",3,0),r=L(t,"y",3,0),o=L(t,"selectEdgeOnClick",3,!1),i=L(t,"transparent",3,!1),s=Vt(t,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const a=Ft(),l=Fg("EdgeLabel must be used within a Custom Edge component");let c=m(()=>a.visible.edges.get(l)?.zIndex);var d=ev(),h=()=>{o()&&l&&a.handleEdgeSelection(l)};Lt(d,g=>({class:["svelte-flow__edge-label",{transparent:i()},t.class],tabindex:"-1",onclick:h,...s,[pt]:g}),[()=>({display:Jg().value?"none":void 0,cursor:o()?"pointer":void 0,transform:`translate(-50%, -50%) translate(${n()??""}px,${r()??""}px)`,"pointer-events":"all",width:ct(t.width),height:ct(t.height),"z-index":u(c)})],void 0,void 0,"svelte-1wg91mu");var f=ee(d);Ye(f,()=>t.children??Sn),Ne(d,(g,v)=>jg?.(g,v),()=>"edge-labels"),F(e,d),oe()}var nv=me("<path></path>"),rv=me('<path fill="none"></path><!><!>',1);function to(e,t){let n=L(t,"interactionWidth",3,20),r=Vt(t,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var o=rv(),i=le(o),s=$(i);{var a=d=>{var h=nv();Lt(h,()=>({d:t.path,"stroke-opacity":0,"stroke-width":n(),fill:"none",class:"svelte-flow__edge-interaction",...r})),F(d,h)};de(s,d=>{n()>0&&d(a)})}var l=$(s);{var c=d=>{tv(d,{get x(){return t.labelX},get y(){return t.labelY},get style(){return t.labelStyle},selectEdgeOnClick:!0,children:(h,f)=>{var g=zc();he(()=>Re(g,t.label)),F(h,g)},$$slots:{default:!0}})};de(l,d=>{t.label&&d(c)})}he(()=>{G(i,"id",t.id),G(i,"d",t.path),ut(i,0,Ht(["svelte-flow__edge-path",t.class])),G(i,"marker-start",t.markerStart),G(i,"marker-end",t.markerEnd),Le(i,t.style)}),F(e,o)}function vl(e,t){re(t,!0);let n=m(()=>nl({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,curvature:t.pathOptions?.curvature})),r=m(()=>Xn(u(n),3)),o=m(()=>u(r)[0]),i=m(()=>u(r)[1]),s=m(()=>u(r)[2]);to(e,{get id(){return t.id},get path(){return u(o)},get labelX(){return u(i)},get labelY(){return u(s)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),oe()}function ov(e,t){re(t,!0);let n=m(()=>di({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),r=m(()=>Xn(u(n),3)),o=m(()=>u(r)[0]),i=m(()=>u(r)[1]),s=m(()=>u(r)[2]);to(e,{get path(){return u(o)},get labelX(){return u(i)},get labelY(){return u(s)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),oe()}function iv(e,t){re(t,!0);let n=m(()=>ol({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY})),r=m(()=>Xn(u(n),3)),o=m(()=>u(r)[0]),i=m(()=>u(r)[1]),s=m(()=>u(r)[2]);to(e,{get path(){return u(o)},get labelX(){return u(i)},get labelY(){return u(s)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),oe()}function sv(e,t){re(t,!0);let n=m(()=>di({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,borderRadius:0})),r=m(()=>Xn(u(n),3)),o=m(()=>u(r)[0]),i=m(()=>u(r)[1]),s=m(()=>u(r)[2]);to(e,{get path(){return u(o)},get labelX(){return u(i)},get labelY(){return u(s)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),oe()}class av{#e;#t;constructor(t,n){this.#e=t,this.#t=zs(n)}get current(){return this.#t(),this.#e()}}const lv=/\(.+\)/,cv=new Set(["all","print","screen","and","or","not","only"]);class uv extends av{constructor(t,n){let r=lv.test(t)||t.split(/[\s,]+/).some(i=>cv.has(i.trim()))?t:`(${t})`;const o=window.matchMedia(r);super(()=>o.matches,i=>xo(o,"change",i))}}function dv(e,t,n,r){const o=new Map;return ci(e,{x:0,y:0,width:n,height:r},t,!0).forEach(i=>{o.set(i.id,i)}),o}function fs(e){const{edges:t,defaultEdgeOptions:n,nodeLookup:r,previousEdges:o,connectionMode:i,onerror:s,onlyRenderVisible:a,elevateEdgesOnSelect:l,zIndexMode:c}=e,d=new Map;for(const h of t){const f=r.get(h.source),g=r.get(h.target);if(!f||!g)continue;if(a){const{visibleNodes:y,transform:w,width:C,height:k}=e;if(tg({sourceNode:f,targetNode:g,width:C,height:k,transform:w}))y.set(f.id,f),y.set(g.id,g);else continue}const v=o.get(h.id);if(v&&h===v.edge&&f==v.sourceNode&&g==v.targetNode){d.set(h.id,v);continue}const _=lg({id:h.id,sourceNode:f,targetNode:g,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:i,onError:s});_&&d.set(h.id,{...n,...h,..._,zIndex:eg({selected:h.selected,zIndex:h.zIndex??n.zIndex,sourceNode:f,targetNode:g,elevateOnSelect:l,zIndexMode:c}),sourceNode:f,targetNode:g,edge:h})}return d}const pl={input:Xg,output:Ug,default:gl,group:Qg},ml={straight:iv,smoothstep:ov,default:vl,step:sv};function fv(e,t,n,r,o,i){if(t&&!n&&r&&o){const s=or(i,{filter:a=>!!((a.width||a.initialWidth)&&(a.height||a.initialHeight))});return ui(s,r,o,.5,2,.1)}else return n??{x:0,y:0,zoom:1}}function hv(e){class t{#e=m(()=>e.props.id??"1");get flowId(){return u(this.#e)}set flowId(r){R(this.#e,r)}#t=se(null);get domNode(){return u(this.#t)}set domNode(r){R(this.#t,r)}#n=se(null);get panZoom(){return u(this.#n)}set panZoom(r){R(this.#n,r)}#r=se(e.width??0);get width(){return u(this.#r)}set width(r){R(this.#r,r)}#l=se(e.height??0);get height(){return u(this.#l)}set height(r){R(this.#l,r)}#i=se(e.props.zIndexMode??"basic");get zIndexMode(){return u(this.#i)}set zIndexMode(r){R(this.#i,r)}#o=m(()=>{const r=gg(e.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:e.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&r&&(this.fitViewOptions?.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),r});get nodesInitialized(){return u(this.#o)}set nodesInitialized(r){R(this.#o,r)}#s=m(()=>this.panZoom!==null);get viewportInitialized(){return u(this.#s)}set viewportInitialized(r){R(this.#s,r)}#a=m(()=>(wg(this.connectionLookup,this.edgeLookup,e.edges),e.edges));get _edges(){return u(this.#a)}set _edges(r){R(this.#a,r)}get nodes(){return this.nodesInitialized,e.nodes}set nodes(r){e.nodes=r}get edges(){return this._edges}set edges(r){e.edges=r}_prevSelectedNodes=[];_prevSelectedNodeIds=new Set;#c=m(()=>{const r=this._prevSelectedNodeIds.size,o=new Set,i=this.nodes.filter(s=>(s.selected&&(o.add(s.id),this._prevSelectedNodeIds.delete(s.id)),s.selected));return(r!==o.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=i),this._prevSelectedNodeIds=o,this._prevSelectedNodes});get selectedNodes(){return u(this.#c)}set selectedNodes(r){R(this.#c,r)}_prevSelectedEdges=[];_prevSelectedEdgeIds=new Set;#u=m(()=>{const r=this._prevSelectedEdgeIds.size,o=new Set,i=this.edges.filter(s=>(s.selected&&(o.add(s.id),this._prevSelectedEdgeIds.delete(s.id)),s.selected));return(r!==o.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=i),this._prevSelectedEdgeIds=o,this._prevSelectedEdges});get selectedEdges(){return u(this.#u)}set selectedEdges(r){R(this.#u,r)}selectionChangeHandlers=new Map;nodeLookup=new Map;parentLookup=new Map;connectionLookup=new Map;edgeLookup=new Map;_prevVisibleEdges=new Map;#d=m(()=>{const{nodes:r,_edges:o,_prevVisibleEdges:i,nodeLookup:s,connectionMode:a,onerror:l,onlyRenderVisibleElements:c,defaultEdgeOptions:d,zIndexMode:h}=this;let f,g;const v={edges:o,defaultEdgeOptions:d,previousEdges:i,nodeLookup:s,connectionMode:a,elevateEdgesOnSelect:e.props.elevateEdgesOnSelect??!0,zIndexMode:h,onerror:l};if(c){const{viewport:_,width:y,height:w}=this,C=[_.x,_.y,_.zoom];f=dv(s,C,y,w),g=fs({...v,onlyRenderVisible:!0,visibleNodes:f,transform:C,width:y,height:w})}else f=this.nodeLookup,g=fs(v);return{nodes:f,edges:g}});get visible(){return u(this.#d)}set visible(r){R(this.#d,r)}#f=m(()=>e.props.nodesDraggable??!0);get nodesDraggable(){return u(this.#f)}set nodesDraggable(r){R(this.#f,r)}#g=m(()=>e.props.nodesConnectable??!0);get nodesConnectable(){return u(this.#g)}set nodesConnectable(r){R(this.#g,r)}#h=m(()=>e.props.elementsSelectable??!0);get elementsSelectable(){return u(this.#h)}set elementsSelectable(r){R(this.#h,r)}#_=m(()=>e.props.nodesFocusable??!0);get nodesFocusable(){return u(this.#_)}set nodesFocusable(r){R(this.#_,r)}#w=m(()=>e.props.edgesFocusable??!0);get edgesFocusable(){return u(this.#w)}set edgesFocusable(r){R(this.#w,r)}#b=m(()=>e.props.disableKeyboardA11y??!1);get disableKeyboardA11y(){return u(this.#b)}set disableKeyboardA11y(r){R(this.#b,r)}#m=m(()=>e.props.minZoom??.5);get minZoom(){return u(this.#m)}set minZoom(r){R(this.#m,r)}#v=m(()=>e.props.maxZoom??2);get maxZoom(){return u(this.#v)}set maxZoom(r){R(this.#v,r)}#p=m(()=>e.props.nodeOrigin??[0,0]);get nodeOrigin(){return u(this.#p)}set nodeOrigin(r){R(this.#p,r)}#y=m(()=>e.props.nodeExtent??Io);get nodeExtent(){return u(this.#y)}set nodeExtent(r){R(this.#y,r)}#x=m(()=>e.props.translateExtent??Io);get translateExtent(){return u(this.#x)}set translateExtent(r){R(this.#x,r)}#E=m(()=>e.props.defaultEdgeOptions??{});get defaultEdgeOptions(){return u(this.#E)}set defaultEdgeOptions(r){R(this.#E,r)}#S=m(()=>e.props.nodeDragThreshold??1);get nodeDragThreshold(){return u(this.#S)}set nodeDragThreshold(r){R(this.#S,r)}#k=m(()=>e.props.autoPanOnNodeDrag??!0);get autoPanOnNodeDrag(){return u(this.#k)}set autoPanOnNodeDrag(r){R(this.#k,r)}#C=m(()=>e.props.autoPanOnConnect??!0);get autoPanOnConnect(){return u(this.#C)}set autoPanOnConnect(r){R(this.#C,r)}#N=m(()=>e.props.autoPanOnNodeFocus??!0);get autoPanOnNodeFocus(){return u(this.#N)}set autoPanOnNodeFocus(r){R(this.#N,r)}#P=m(()=>e.props.autoPanSpeed??15);get autoPanSpeed(){return u(this.#P)}set autoPanSpeed(r){R(this.#P,r)}#M=m(()=>e.props.connectionDragThreshold??1);get connectionDragThreshold(){return u(this.#M)}set connectionDragThreshold(r){R(this.#M,r)}fitViewQueued=e.props.fitView??!1;fitViewOptions=e.props.fitViewOptions;fitViewResolver=null;#A=m(()=>e.props.snapGrid??null);get snapGrid(){return u(this.#A)}set snapGrid(r){R(this.#A,r)}#T=se(!1);get dragging(){return u(this.#T)}set dragging(r){R(this.#T,r)}#D=se(null);get selectionRect(){return u(this.#D)}set selectionRect(r){R(this.#D,r)}#I=se(!1);get selectionKeyPressed(){return u(this.#I)}set selectionKeyPressed(r){R(this.#I,r)}#z=se(!1);get multiselectionKeyPressed(){return u(this.#z)}set multiselectionKeyPressed(r){R(this.#z,r)}#O=se(!1);get deleteKeyPressed(){return u(this.#O)}set deleteKeyPressed(r){R(this.#O,r)}#R=se(!1);get panActivationKeyPressed(){return u(this.#R)}set panActivationKeyPressed(r){R(this.#R,r)}#q=se(!1);get zoomActivationKeyPressed(){return u(this.#q)}set zoomActivationKeyPressed(r){R(this.#q,r)}#H=se(null);get selectionRectMode(){return u(this.#H)}set selectionRectMode(r){R(this.#H,r)}#L=se("");get ariaLiveMessage(){return u(this.#L)}set ariaLiveMessage(r){R(this.#L,r)}#V=m(()=>e.props.selectionMode??Ir.Partial);get selectionMode(){return u(this.#V)}set selectionMode(r){R(this.#V,r)}#B=m(()=>({...pl,...e.props.nodeTypes}));get nodeTypes(){return u(this.#B)}set nodeTypes(r){R(this.#B,r)}#F=m(()=>({...ml,...e.props.edgeTypes}));get edgeTypes(){return u(this.#F)}set edgeTypes(r){R(this.#F,r)}#K=m(()=>e.props.noPanClass??"nopan");get noPanClass(){return u(this.#K)}set noPanClass(r){R(this.#K,r)}#Y=m(()=>e.props.noDragClass??"nodrag");get noDragClass(){return u(this.#Y)}set noDragClass(r){R(this.#Y,r)}#W=m(()=>e.props.noWheelClass??"nowheel");get noWheelClass(){return u(this.#W)}set noWheelClass(r){R(this.#W,r)}#Z=m(()=>jh(e.props.ariaLabelConfig));get ariaLabelConfig(){return u(this.#Z)}set ariaLabelConfig(r){R(this.#Z,r)}#X=se(fv(this.nodesInitialized,e.props.fitView,e.props.initialViewport,this.width,this.height,this.nodeLookup));get _viewport(){return u(this.#X)}set _viewport(r){R(this.#X,r)}get viewport(){return e.viewport??this._viewport}set viewport(r){e.viewport&&(e.viewport=r),this._viewport=r}#G=se(zo);get _connection(){return u(this.#G)}set _connection(r){R(this.#G,r)}#U=m(()=>this._connection.inProgress?{...this._connection,to:sr(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection);get connection(){return u(this.#U)}set connection(r){R(this.#U,r)}#Q=m(()=>e.props.connectionMode??wn.Strict);get connectionMode(){return u(this.#Q)}set connectionMode(r){R(this.#Q,r)}#j=m(()=>e.props.connectionRadius??20);get connectionRadius(){return u(this.#j)}set connectionRadius(r){R(this.#j,r)}#J=m(()=>e.props.isValidConnection??(()=>!0));get isValidConnection(){return u(this.#J)}set isValidConnection(r){R(this.#J,r)}#$=m(()=>e.props.selectNodesOnDrag??!0);get selectNodesOnDrag(){return u(this.#$)}set selectNodesOnDrag(r){R(this.#$,r)}#ee=m(()=>e.props.defaultMarkerColor===void 0?"#b1b1b7":e.props.defaultMarkerColor);get defaultMarkerColor(){return u(this.#ee)}set defaultMarkerColor(r){R(this.#ee,r)}#te=m(()=>cg(e.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd}));get markers(){return u(this.#te)}set markers(r){R(this.#te,r)}#ne=m(()=>e.props.onlyRenderVisibleElements??!1);get onlyRenderVisibleElements(){return u(this.#ne)}set onlyRenderVisibleElements(r){R(this.#ne,r)}#re=m(()=>e.props.onflowerror??Xh);get onerror(){return u(this.#re)}set onerror(r){R(this.#re,r)}#oe=m(()=>e.props.ondelete);get ondelete(){return u(this.#oe)}set ondelete(r){R(this.#oe,r)}#ie=m(()=>e.props.onbeforedelete);get onbeforedelete(){return u(this.#ie)}set onbeforedelete(r){R(this.#ie,r)}#se=m(()=>e.props.onbeforeconnect);get onbeforeconnect(){return u(this.#se)}set onbeforeconnect(r){R(this.#se,r)}#ae=m(()=>e.props.onconnect);get onconnect(){return u(this.#ae)}set onconnect(r){R(this.#ae,r)}#le=m(()=>e.props.onconnectstart);get onconnectstart(){return u(this.#le)}set onconnectstart(r){R(this.#le,r)}#ce=m(()=>e.props.onconnectend);get onconnectend(){return u(this.#ce)}set onconnectend(r){R(this.#ce,r)}#ue=m(()=>e.props.onbeforereconnect);get onbeforereconnect(){return u(this.#ue)}set onbeforereconnect(r){R(this.#ue,r)}#de=m(()=>e.props.onreconnect);get onreconnect(){return u(this.#de)}set onreconnect(r){R(this.#de,r)}#fe=m(()=>e.props.onreconnectstart);get onreconnectstart(){return u(this.#fe)}set onreconnectstart(r){R(this.#fe,r)}#he=m(()=>e.props.onreconnectend);get onreconnectend(){return u(this.#he)}set onreconnectend(r){R(this.#he,r)}#ge=m(()=>e.props.clickConnect??!0);get clickConnect(){return u(this.#ge)}set clickConnect(r){R(this.#ge,r)}#ve=m(()=>e.props.onclickconnectstart);get onclickconnectstart(){return u(this.#ve)}set onclickconnectstart(r){R(this.#ve,r)}#pe=m(()=>e.props.onclickconnectend);get onclickconnectend(){return u(this.#pe)}set onclickconnectend(r){R(this.#pe,r)}#me=se(null);get clickConnectStartHandle(){return u(this.#me)}set clickConnectStartHandle(r){R(this.#me,r)}#ye=m(()=>e.props.onselectiondrag);get onselectiondrag(){return u(this.#ye)}set onselectiondrag(r){R(this.#ye,r)}#_e=m(()=>e.props.onselectiondragstart);get onselectiondragstart(){return u(this.#_e)}set onselectiondragstart(r){R(this.#_e,r)}#we=m(()=>e.props.onselectiondragstop);get onselectiondragstop(){return u(this.#we)}set onselectiondragstop(r){R(this.#we,r)}resolveFitView=async()=>{this.panZoom&&(await Wh({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),this.fitViewResolver?.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)};_prefersDark=new uv("(prefers-color-scheme: dark)",e.props.colorModeSSR==="dark");#be=m(()=>e.props.colorMode==="system"?this._prefersDark.current?"dark":"light":e.props.colorMode??"light");get colorMode(){return u(this.#be)}set colorMode(r){R(this.#be,r)}constructor(){}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=zo,this.clickConnectStartHandle=null,this.viewport=e.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=""}}return new t}function Ft(){const e=Fo(qo);if(!e)throw new Error("To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />");return e.getStore()}const qo=Symbol();function gv(e){const t=hv(e);function n(P){t.nodeTypes={...pl,...P}}function r(P){t.edgeTypes={...ml,...P}}function o(P){t.edges=og(P,t.edges)}const i=(P,x=!1)=>{t.nodes=t.nodes.map(N=>{if(t.connection.inProgress&&t.connection.fromNode.id===N.id){const E=t.nodeLookup.get(N.id);E&&(t.connection={...t.connection,from:en(E,t.connection.fromHandle,j.Left,!0)})}const p=P.get(N.id);return p?{...N,position:p.position,dragging:x}:N})};function s(P){const{changes:x,updatedInternals:N}=yg(P,t.nodeLookup,t.parentLookup,t.domNode,t.nodeOrigin,t.nodeExtent,t.zIndexMode);if(!N)return;fg(t.nodeLookup,t.parentLookup,{nodeOrigin:t.nodeOrigin,nodeExtent:t.nodeExtent,zIndexMode:t.zIndexMode}),t.fitViewQueued&&t.resolveFitView();const p=new Map;for(const E of x){const S=t.nodeLookup.get(E.id)?.internals.userNode;if(!S)continue;const D={...S};switch(E.type){case"dimensions":{const O={...D.measured,...E.dimensions};E.setAttributes&&(D.width=E.dimensions?.width??D.width,D.height=E.dimensions?.height??D.height),D.measured=O;break}case"position":D.position=E.position??D.position;break}p.set(E.id,D)}t.nodes=t.nodes.map(E=>p.get(E.id)??E)}function a(P){const x=t.fitViewResolver??Promise.withResolvers();return t.fitViewQueued=!0,t.fitViewOptions=P,t.fitViewResolver=x,t.nodes=[...t.nodes],x.promise}async function l(P,x,N){const p=typeof N?.zoom<"u"?N.zoom:t.maxZoom,E=t.panZoom;return E?(await E.setViewport({x:t.width/2-P*p,y:t.height/2-x*p,zoom:p},{duration:N?.duration,ease:N?.ease,interpolate:N?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function c(P,x){const N=t.panZoom;return N?N.scaleBy(P,x):Promise.resolve(!1)}function d(P){return c(1.2,P)}function h(P){return c(1/1.2,P)}function f(P){const x=t.panZoom;x&&(x.setScaleExtent([P,t.maxZoom]),t.minZoom=P)}function g(P){const x=t.panZoom;x&&(x.setScaleExtent([t.minZoom,P]),t.maxZoom=P)}function v(P){const x=t.panZoom;x&&(x.setTranslateExtent(P),t.translateExtent=P)}function _(P,x=null){let N=!1;const p=P.map(E=>(x?x.has(E.id):!0)&&E.selected?(N=!0,{...E,selected:!1}):E);return[N,p]}function y(P){const x=P?.nodes?new Set(P.nodes.map(O=>O.id)):null,[N,p]=_(t.nodes,x);N&&(t.nodes=p);const E=P?.edges?new Set(P.edges.map(O=>O.id)):null,[S,D]=_(t.edges,E);S&&(t.edges=D)}function w(P){const x=t.multiselectionKeyPressed;t.nodes=t.nodes.map(N=>{const p=P.includes(N.id),E=x&&N.selected||p;return!!N.selected!==E?{...N,selected:E}:N}),x||y({nodes:[]})}function C(P){const x=t.multiselectionKeyPressed;t.edges=t.edges.map(N=>{const p=P.includes(N.id),E=x&&N.selected||p;return!!N.selected!==E?{...N,selected:E}:N}),x||y({edges:[]})}function k(P,x,N){const p=t.nodeLookup.get(P);if(!p){console.warn("012",Yn.error012(P));return}t.selectionRect=null,t.selectionRectMode=null,p.selected?(x||p.selected&&t.multiselectionKeyPressed)&&(y({nodes:[p],edges:[]}),requestAnimationFrame(()=>N?.blur())):w([P])}function b(P){const x=t.edgeLookup.get(P);if(!x){console.warn("012",Yn.error012(P));return}(x.selectable||t.elementsSelectable&&typeof x.selectable>"u")&&(t.selectionRect=null,t.selectionRectMode=null,x.selected?x.selected&&t.multiselectionKeyPressed&&y({nodes:[],edges:[x]}):C([P]))}function A(P,x){const{nodeExtent:N,snapGrid:p,nodeOrigin:E,nodeLookup:S,nodesDraggable:D,onerror:O}=t,I=new Map,q=p?.[0]??5,V=p?.[1]??5,W=P.x*q*x,Y=P.y*V*x;for(const B of S.values()){if(!(B.selected&&(B.draggable||D&&typeof B.draggable>"u")))continue;let Z={x:B.internals.positionAbsolute.x+W,y:B.internals.positionAbsolute.y+Y};p&&(Z=ir(Z,p));const{position:X,positionAbsolute:Q}=Xa({nodeId:B.id,nextPosition:Z,nodeLookup:S,nodeExtent:N,nodeOrigin:E,onError:O});B.position=X,B.internals.positionAbsolute=Q,I.set(B.id,B)}i(I)}function T(P){return _g({delta:P,panZoom:t.panZoom,transform:[t.viewport.x,t.viewport.y,t.viewport.zoom],translateExtent:t.translateExtent,width:t.width,height:t.height})}const z=P=>{t._connection={...P}};function M(){t._connection=zo}function H(){t.resetStoreValues(),y()}return Object.assign(t,{setNodeTypes:n,setEdgeTypes:r,addEdge:o,updateNodePositions:i,updateNodeInternals:s,zoomIn:d,zoomOut:h,fitView:a,setCenter:l,setMinZoom:f,setMaxZoom:g,setTranslateExtent:v,unselectNodesAndEdges:y,addSelectedNodes:w,addSelectedEdges:C,handleNodeSelection:k,handleEdgeSelection:b,moveSelectedNodes:A,panBy:T,updateConnection:z,cancelConnection:M,reset:H})}function vv(e,t){const{minZoom:n,maxZoom:r,initialViewport:o,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:a,translateExtent:l,setPanZoomInstance:c,onDraggingChange:d,onTransformChange:h}=t,f=qg({domNode:e,minZoom:n,maxZoom:r,translateExtent:l,viewport:o,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:a,onDraggingChange:d}),g=f.getViewport();return(o.x!==g.x||o.y!==g.y||o.zoom!==g.zoom)&&h([g.x,g.y,g.zoom]),c(f),f.update(t),{update(v){f.update(v)}}}var pv=ae('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function mv(e,t){re(t,!0);let n=L(t,"store",15),r=m(()=>n().panActivationKeyPressed||t.panOnDrag),o=m(()=>n().panActivationKeyPressed||t.panOnScroll);const{viewport:i}=n();let s=!1;at(()=>{!s&&n().viewportInitialized&&(t.oninit?.(),s=!0)});var a=pv(),l=ee(a);Ye(l,()=>t.children),Ne(a,(c,d)=>vv?.(c,d),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:i,onDraggingChange:c=>{n(n().dragging=c,!0)},setPanZoomInstance:c=>{n(n().panZoom=c,!0)},onPanZoomStart:t.onmovestart,onPanZoom:t.onmove,onPanZoomEnd:t.onmoveend,zoomOnScroll:t.zoomOnScroll,zoomOnDoubleClick:t.zoomOnDoubleClick,zoomOnPinch:t.zoomOnPinch,panOnScroll:u(o),panOnDrag:u(r),panOnScrollSpeed:t.panOnScrollSpeed,panOnScrollMode:t.panOnScrollMode,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof t.preventScrolling=="boolean"?t.preventScrolling:!0,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:"svelte",paneClickDistance:t.paneClickDistance,selectionOnDrag:t.selectionOnDrag,onTransformChange:c=>{n(n().viewport={x:c[0],y:c[1],zoom:c[2]},!0)},connectionInProgress:n().connection.inProgress})),F(e,a),oe()}function hs(e,t){return n=>{n.target===t&&e?.(n)}}function gs(e){return t=>{const n=e.has(t.id);return!!t.selected!==n?{...t,selected:n}:t}}function vs(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}var yv=ae("<div><!></div>");function _v(e,t){re(t,!0);let n=L(t,"store",15),r=L(t,"panOnDrag",3,!0),o=L(t,"paneClickDistance",3,1),i,s=null,a=new Set,l=new Set,c=m(()=>n().panActivationKeyPressed||r()),d=m(()=>n().selectionKeyPressed||!!n().selectionRect||t.selectionOnDrag&&u(c)!==!0),h=m(()=>n().elementsSelectable&&(u(d)||n().selectionRectMode==="user")),f=!1;function g(M){if(s=i?.getBoundingClientRect(),!s)return;const H=M.target===i,K=!H&&!!M.target.closest(".nokey"),P=t.selectionOnDrag&&H||n().selectionKeyPressed;if(K||!u(d)||!P||M.button!==0||!M.isPrimary)return;M.target?.setPointerCapture?.(M.pointerId),f=!1;const{x,y:N}=Qe(M,s);n(n().selectionRect={width:0,height:0,startX:x,startY:N,x,y:N},!0),H||(M.stopPropagation(),M.preventDefault())}function v(M){if(!u(d)||!s||!n().selectionRect)return;const H=Qe(M,s),{startX:K=0,startY:P=0}=n().selectionRect;if(!f){const S=n().selectionKeyPressed?0:o();if(Math.hypot(H.x-K,H.y-P)<=S)return;n().unselectNodesAndEdges(),t.onselectionstart?.(M)}f=!0;const x={...n().selectionRect,x:H.x<K?H.x:K,y:H.y<P?H.y:P,width:Math.abs(H.x-K),height:Math.abs(H.y-P)},N=a,p=l;a=new Set(ci(n().nodeLookup,x,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===Ir.Partial,!0).map(S=>S.id));const E=n().defaultEdgeOptions.selectable??!0;l=new Set;for(const S of a){const D=n().connectionLookup.get(S);if(D)for(const{edgeId:O}of D.values()){const I=n().edgeLookup.get(O);I&&(I.selectable??E)&&l.add(O)}}vs(N,a)||n(n().nodes=n().nodes.map(gs(a)),!0),vs(p,l)||n(n().edges=n().edges.map(gs(l)),!0),n(n().selectionRectMode="user",!0),n(n().selectionRect=x,!0)}function _(M){M.button===0&&(M.target?.releasePointerCapture?.(M.pointerId),!f&&M.target===i&&C?.(M),n(n().selectionRect=null,!0),f&&n(n().selectionRectMode=a.size>0?"nodes":null,!0),f&&t.onselectionend?.(M))}const y=M=>{if(Array.isArray(u(c))&&u(c).includes(2)){M.preventDefault();return}t.onpanecontextmenu?.({event:M})},w=M=>{f&&(M.stopPropagation(),f=!1)};function C(M){if(f||n().connection.inProgress){f=!1;return}t.onpaneclick?.({event:M}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var k=yv();let b;var A=m(()=>u(h)?void 0:hs(C,i));k.__click=function(...M){u(A)?.apply(this,M)},k.__pointermove=function(...M){(u(h)?v:void 0)?.apply(this,M)},k.__pointerup=function(...M){(u(h)?_:void 0)?.apply(this,M)};var T=m(()=>hs(y,i));k.__contextmenu=function(...M){u(T)?.apply(this,M)};var z=ee(k);Ye(z,()=>t.children),er(k,M=>i=M,()=>i),he(M=>b=ut(k,1,"svelte-flow__pane svelte-flow__container",null,b,M),[()=>({draggable:r()===!0||Array.isArray(r())&&r().includes(0),dragging:n().dragging,selection:u(d)})]),kr("pointerdown",k,function(...M){(u(h)?g:void 0)?.apply(this,M)},!0),kr("click",k,function(...M){(u(h)?w:void 0)?.apply(this,M)},!0),F(e,k),oe()}jo(["click","pointermove","pointerup","contextmenu"]);var wv=ae('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function bv(e,t){re(t,!0);var n=wv();let r;var o=ee(n);Ye(o,()=>t.children),he(()=>r=Le(n,"",r,{transform:`translate(${t.store.viewport.x??""}px, ${t.store.viewport.y??""}px) scale(${t.store.viewport.zoom??""})`})),F(e,n),oe()}function yl(e,t){const{store:n,onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s}=t,a=Eg({onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s,getStoreItems:()=>{const{snapGrid:c,viewport:d}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:c||[0,0],snapToGrid:!!c,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[d.x,d.y,d.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function l(c,d){if(d.disabled){a.destroy();return}a.update({domNode:c,noDragClassName:d.noDragClass,handleSelector:d.handleSelector,nodeId:d.nodeId,isSelectable:d.isSelectable,nodeClickDistance:d.nodeClickDistance})}return l(e,t),{update(c){l(e,c)},destroy(){a.destroy()}}}var xv=ae('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-13pq11u"> </div>'),Ev=ae('<div class="a11y-hidden svelte-13pq11u"> </div> <div class="a11y-hidden svelte-13pq11u"> </div> <!>',1);function Sv(e,t){re(t,!0);var n=Ev(),r=le(n),o=ee(r),i=$(r,2),s=ee(i),a=$(i,2);{var l=c=>{var d=xv(),h=ee(d);he(()=>{G(d,"id",`${kv}-${t.store.flowId}`),Re(h,t.store.ariaLiveMessage)}),F(c,d)};de(a,c=>{t.store.disableKeyboardA11y||c(l)})}he(()=>{G(r,"id",`${_l}-${t.store.flowId}`),Re(o,t.store.disableKeyboardA11y?t.store.ariaLabelConfig["node.a11yDescription.default"]:t.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),G(i,"id",`${wl}-${t.store.flowId}`),Re(s,t.store.ariaLabelConfig["edge.a11yDescription.default"])}),F(e,n),oe()}const _l="svelte-flow__node-desc",wl="svelte-flow__edge-desc",kv="svelte-flow__aria-live";var Cv=ae("<div><!></div>");function Nv(e,t){re(t,!0);let n=L(t,"store",15),r=m(()=>Ce(t.node.data,()=>({}),!0)),o=m(()=>Ce(t.node.selected,!1)),i=m(()=>t.node.draggable),s=m(()=>t.node.selectable),a=m(()=>Ce(t.node.deletable,!0)),l=m(()=>t.node.connectable),c=m(()=>t.node.focusable),d=m(()=>Ce(t.node.hidden,!1)),h=m(()=>Ce(t.node.dragging,!1)),f=m(()=>Ce(t.node.style,"")),g=m(()=>t.node.class),v=m(()=>Ce(t.node.type,"default")),_=m(()=>t.node.parentId),y=m(()=>t.node.sourcePosition),w=m(()=>t.node.targetPosition),C=m(()=>Ce(t.node.measured,()=>({width:0,height:0}),!0).width),k=m(()=>Ce(t.node.measured,()=>({width:0,height:0}),!0).height),b=m(()=>t.node.initialWidth),A=m(()=>t.node.initialHeight),T=m(()=>t.node.width),z=m(()=>t.node.height),M=m(()=>t.node.dragHandle),H=m(()=>Ce(t.node.internals.z,0)),K=m(()=>t.node.internals.positionAbsolute.x),P=m(()=>t.node.internals.positionAbsolute.y),x=m(()=>t.node.internals.userNode),{id:N}=t.node,p=m(()=>u(i)??n().nodesDraggable),E=m(()=>u(s)??n().elementsSelectable),S=m(()=>u(l)??n().nodesConnectable),D=m(()=>ja(t.node)),O=m(()=>!!t.node.internals.handleBounds),I=m(()=>u(D)&&u(O)),q=m(()=>u(c)??n().nodesFocusable);function V(ce){return n().parentLookup.has(ce)}let W=m(()=>V(N)),Y=se(null),B=null,U=u(v),Z=u(y),X=u(w),Q=m(()=>n().nodeTypes[u(v)]??gl),ue=m(()=>n().ariaLabelConfig),we={get value(){return u(S)}};Lg(N),Bg(we);let J=m(()=>{const ce=u(C)===void 0?u(T)??u(b):u(T),ye=u(k)===void 0?u(z)??u(A):u(z);if(!(ce===void 0&&ye===void 0&&u(f)===void 0))return`${u(f)};${ce?`width:${ct(ce)};`:""}${ye?`height:${ct(ye)};`:""}`});at(()=>{(u(v)!==U||u(y)!==Z||u(w)!==X)&&u(Y)!==null&&requestAnimationFrame(()=>{u(Y)!==null&&n().updateNodeInternals(new Map([[N,{id:N,nodeElement:u(Y),force:!0}]]))}),U=u(v),Z=u(y),X=u(w)}),at(()=>{t.resizeObserver&&(!u(I)||u(Y)!==B)&&(B&&t.resizeObserver.unobserve(B),u(Y)&&t.resizeObserver.observe(u(Y)),B=u(Y))}),ei(()=>{B&&t.resizeObserver?.unobserve(B)});function pe(ce){u(E)&&(!n().selectNodesOnDrag||!u(p)||n().nodeDragThreshold>0)&&n().handleNodeSelection(N),t.onnodeclick?.({node:u(x),event:ce})}function te(ce){if(!(el(ce)||n().disableKeyboardA11y))if(Wa.includes(ce.key)&&u(E)){const ye=ce.key==="Escape";n().handleNodeSelection(N,ye,u(Y))}else u(p)&&t.node.selected&&Object.prototype.hasOwnProperty.call(Hr,ce.key)&&(ce.preventDefault(),n(n().ariaLiveMessage=u(ue)["node.a11yDescription.ariaLiveMessage"]({direction:ce.key.replace("Arrow","").toLowerCase(),x:~~t.node.internals.positionAbsolute.x,y:~~t.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(Hr[ce.key],ce.shiftKey?4:1))}const Me=()=>{if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!u(Y)?.matches(":focus-visible"))return;const{width:ce,height:ye,viewport:Ze}=n();ci(new Map([[N,t.node]]),{x:0,y:0,width:ce,height:ye},[Ze.x,Ze.y,Ze.zoom],!0).length>0||n().setCenter(t.node.position.x+(t.node.measured.width??0)/2,t.node.position.y+(t.node.measured.height??0)/2,{zoom:Ze.zoom})};var Ct=Se(),Nt=le(Ct);{var ft=ce=>{var ye=Cv();Lt(ye,()=>({"data-id":N,class:["svelte-flow__node",`svelte-flow__node-${u(v)}`,u(g)],style:u(J),onclick:pe,onpointerenter:t.onnodepointerenter?ge=>t.onnodepointerenter({node:u(x),event:ge}):void 0,onpointerleave:t.onnodepointerleave?ge=>t.onnodepointerleave({node:u(x),event:ge}):void 0,onpointermove:t.onnodepointermove?ge=>t.onnodepointermove({node:u(x),event:ge}):void 0,oncontextmenu:t.onnodecontextmenu?ge=>t.onnodecontextmenu({node:u(x),event:ge}):void 0,onkeydown:u(q)?te:void 0,onfocus:u(q)?Me:void 0,tabIndex:u(q)?0:void 0,role:t.node.ariaRole??(u(q)?"group":void 0),"aria-roledescription":"node","aria-describedby":n().disableKeyboardA11y?void 0:`${_l}-${n().flowId}`,...t.node.domAttributes,[Mt]:{dragging:u(h),selected:u(o),draggable:u(p),connectable:u(S),selectable:u(E),nopan:u(p),parent:u(W)},[pt]:{"z-index":u(H),transform:`translate(${u(K)??""}px, ${u(P)??""}px)`,visibility:u(D)?"visible":"hidden"}}));var Ze=ee(ye);Zr(Ze,()=>u(Q),(ge,on)=>{on(ge,{get data(){return u(r)},get id(){return N},get selected(){return u(o)},get selectable(){return u(E)},get deletable(){return u(a)},get sourcePosition(){return u(y)},get targetPosition(){return u(w)},get zIndex(){return u(H)},get dragging(){return u(h)},get draggable(){return u(p)},get dragHandle(){return u(M)},get parentId(){return u(_)},get type(){return u(v)},get isConnectable(){return u(S)},get positionAbsoluteX(){return u(K)},get positionAbsoluteY(){return u(P)},get width(){return u(T)},get height(){return u(z)}})}),Ne(ye,(ge,on)=>yl?.(ge,on),()=>({nodeId:N,isSelectable:u(E),disabled:!u(p),handleSelector:u(M),noDragClass:n().noDragClass,nodeClickDistance:t.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(ge,on,Cn,Nn)=>{t.onnodedrag?.({event:ge,targetNode:Cn,nodes:Nn})},onDragStart:(ge,on,Cn,Nn)=>{t.onnodedragstart?.({event:ge,targetNode:Cn,nodes:Nn})},onDragStop:(ge,on,Cn,Nn)=>{t.onnodedragstop?.({event:ge,targetNode:Cn,nodes:Nn})},store:n()})),er(ye,ge=>R(Y,ge),()=>u(Y)),F(ce,ye)};de(Nt,ce=>{u(d)||ce(ft)})}F(e,Ct),oe()}var Pv=ae('<div class="svelte-flow__nodes"></div>');function Mv(e,t){re(t,!0);let n=L(t,"store",15);const r=typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(a=>{const l=a.target.getAttribute("data-id");s.set(l,{id:l,nodeElement:a.target,force:!0})}),n().updateNodeInternals(s)});ei(()=>{r?.disconnect()});var o=Pv();Wr(o,21,()=>n().visible.nodes.values(),i=>i.id,(i,s)=>{Nv(i,{get node(){return u(s)},get resizeObserver(){return r},get nodeClickDistance(){return t.nodeClickDistance},get onnodeclick(){return t.onnodeclick},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get onnodecontextmenu(){return t.onnodecontextmenu},get store(){return n()},set store(a){n(a)}})}),F(e,o),oe()}var Av=me('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function Tv(e,t){re(t,!0);let n=m(()=>t.edge.id),r=m(()=>t.edge.source),o=m(()=>t.edge.target),i=m(()=>t.edge.sourceX),s=m(()=>t.edge.sourceY),a=m(()=>t.edge.targetX),l=m(()=>t.edge.targetY),c=m(()=>t.edge.sourcePosition),d=m(()=>t.edge.targetPosition),h=m(()=>Ce(t.edge.animated,!1)),f=m(()=>Ce(t.edge.selected,!1)),g=m(()=>t.edge.label),v=m(()=>t.edge.labelStyle),_=m(()=>Ce(t.edge.data,()=>({}),!0)),y=m(()=>t.edge.style),w=m(()=>t.edge.interactionWidth),C=m(()=>Ce(t.edge.type,"default")),k=m(()=>t.edge.sourceHandle),b=m(()=>t.edge.targetHandle),A=m(()=>t.edge.markerStart),T=m(()=>t.edge.markerEnd),z=m(()=>t.edge.selectable),M=m(()=>t.edge.focusable),H=m(()=>Ce(t.edge.deletable,!0)),K=m(()=>t.edge.hidden),P=m(()=>t.edge.zIndex),x=m(()=>t.edge.class),N=m(()=>t.edge.ariaLabel);Kg(u(n));let p=null,E=m(()=>u(z)??t.store.elementsSelectable),S=m(()=>u(M)??t.store.edgesFocusable),D=m(()=>t.store.edgeTypes[u(C)]??vl),O=m(()=>u(A)?`url('#${Ro(u(A),t.store.flowId)}')`:void 0),I=m(()=>u(T)?`url('#${Ro(u(T),t.store.flowId)}')`:void 0);function q(Z){const X=t.store.edgeLookup.get(u(n));X&&(u(E)&&t.store.handleEdgeSelection(u(n)),t.onedgeclick?.({event:Z,edge:X}))}function V(Z,X){const Q=t.store.edgeLookup.get(u(n));Q&&X({event:Z,edge:Q})}function W(Z){if(!t.store.disableKeyboardA11y&&Wa.includes(Z.key)&&u(E)){const{unselectNodesAndEdges:X,addSelectedEdges:Q}=t.store;Z.key==="Escape"?(p?.blur(),X({edges:[t.edge]})):Q([u(n)])}}var Y=Se(),B=le(Y);{var U=Z=>{var X=Av();let Q;var ue=ee(X);Lt(ue,()=>({class:["svelte-flow__edge",u(x)],"data-id":u(n),onclick:q,oncontextmenu:t.onedgecontextmenu?J=>{V(J,t.onedgecontextmenu)}:void 0,onpointerenter:t.onedgepointerenter?J=>{V(J,t.onedgepointerenter)}:void 0,onpointerleave:t.onedgepointerleave?J=>{V(J,t.onedgepointerleave)}:void 0,"aria-label":u(N)===null?void 0:u(N)?u(N):`Edge from ${u(r)} to ${u(o)}`,"aria-describedby":u(S)?`${wl}-${t.store.flowId}`:void 0,role:t.edge.ariaRole??(u(S)?"group":"img"),"aria-roledescription":"edge",onkeydown:u(S)?W:void 0,tabindex:u(S)?0:void 0,...t.edge.domAttributes,[Mt]:{animated:u(h),selected:u(f),selectable:u(E)}}));var we=ee(ue);Zr(we,()=>u(D),(J,pe)=>{pe(J,{get id(){return u(n)},get source(){return u(r)},get target(){return u(o)},get sourceX(){return u(i)},get sourceY(){return u(s)},get targetX(){return u(a)},get targetY(){return u(l)},get sourcePosition(){return u(c)},get targetPosition(){return u(d)},get animated(){return u(h)},get selected(){return u(f)},get label(){return u(g)},get labelStyle(){return u(v)},get data(){return u(_)},get style(){return u(y)},get interactionWidth(){return u(w)},get selectable(){return u(E)},get deletable(){return u(H)},get type(){return u(C)},get sourceHandleId(){return u(k)},get targetHandleId(){return u(b)},get markerStart(){return u(O)},get markerEnd(){return u(I)}})}),er(ue,J=>p=J,()=>p),he(()=>Q=Le(X,"",Q,{"z-index":u(P)})),F(Z,X)};de(B,Z=>{u(K)||Z(U)})}F(e,Y),oe()}Jl();var Dv=me("<defs></defs>");function Iv(e,t){re(t,!1);const n=Ft();Qc();var r=Dv();Wr(r,5,()=>n.markers,o=>o.id,(o,i)=>{qv(o,At(()=>u(i)))}),F(e,r),oe()}var zv=me('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),Ov=me('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),Rv=me('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function qv(e,t){re(t,!0);let n=L(t,"width",3,12.5),r=L(t,"height",3,12.5),o=L(t,"markerUnits",3,"strokeWidth"),i=L(t,"orient",3,"auto-start-reverse"),s=L(t,"color",3,"none");var a=Rv(),l=ee(a);{var c=h=>{var f=zv();let g;he(()=>{G(f,"stroke-width",t.strokeWidth),g=Le(f,"",g,{stroke:s()})}),F(h,f)},d=h=>{var f=Se(),g=le(f);{var v=_=>{var y=Ov();let w;he(()=>{G(y,"stroke-width",t.strokeWidth),w=Le(y,"",w,{stroke:s(),fill:s()})}),F(_,y)};de(g,_=>{t.type===zr.ArrowClosed&&_(v)},!0)}F(h,f)};de(l,h=>{t.type===zr.Arrow?h(c):h(d,!1)})}he(()=>{G(a,"id",t.id),G(a,"markerWidth",`${n()}`),G(a,"markerHeight",`${r()}`),G(a,"markerUnits",o()),G(a,"orient",i())}),F(e,a),oe()}var Hv=ae('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function Lv(e,t){re(t,!0);let n=L(t,"store",15);var r=Hv(),o=ee(r),i=ee(o);Iv(i,{});var s=$(o,2);Wr(s,17,()=>n().visible.edges.values(),a=>a.id,(a,l)=>{Tv(a,{get edge(){return u(l)},get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return n()},set store(c){n(c)}})}),F(e,r),oe()}var Vv=ae('<div class="svelte-flow__selection svelte-1vr3gfi"></div>');function bl(e,t){re(t,!0);let n=L(t,"x",3,0),r=L(t,"y",3,0),o=L(t,"width",3,0),i=L(t,"height",3,0),s=L(t,"isVisible",3,!0);var a=Se(),l=le(a);{var c=d=>{var h=Vv();let f;he(g=>f=Le(h,"",f,g),[()=>({width:typeof o()=="string"?o():ct(o()),height:typeof i()=="string"?i():ct(i()),transform:`translate(${n()}px, ${r()}px)`})]),F(d,h)};de(l,d=>{s()&&d(c)})}F(e,a),oe()}var Bv=ae("<div><!></div>");function Fv(e,t){re(t,!0);let n=se(void 0);at(()=>{t.store.disableKeyboardA11y||u(n)?.focus({preventScroll:!0})});let r=m(()=>{if(t.store.selectionRectMode==="nodes"){t.store.nodes;const d=or(t.store.nodeLookup,{filter:h=>!!h.selected});if(d.width>0&&d.height>0)return d}return null});function o(d){const h=t.store.nodes.filter(f=>f.selected);t.onselectioncontextmenu?.({nodes:h,event:d})}function i(d){const h=t.store.nodes.filter(f=>f.selected);t.onselectionclick?.({nodes:h,event:d})}function s(d){Object.prototype.hasOwnProperty.call(Hr,d.key)&&(d.preventDefault(),t.store.moveSelectedNodes(Hr[d.key],d.shiftKey?4:1))}var a=Se(),l=le(a);{var c=d=>{var h=Bv();h.__contextmenu=o,h.__click=i,h.__keydown=function(...v){(t.store.disableKeyboardA11y?void 0:s)?.apply(this,v)};let f;var g=ee(h);bl(g,{width:"100%",height:"100%",x:0,y:0}),Ne(h,(v,_)=>yl?.(v,_),()=>({disabled:!1,store:t.store,onDrag:(v,_,y,w)=>{t.onnodedrag?.({event:v,targetNode:null,nodes:w})},onDragStart:(v,_,y,w)=>{t.onnodedragstart?.({event:v,targetNode:null,nodes:w})},onDragStop:(v,_,y,w)=>{t.onnodedragstop?.({event:v,targetNode:null,nodes:w})}})),er(h,v=>R(n,v),()=>u(n)),he(v=>{ut(h,1,Ht(["svelte-flow__selection-wrapper",t.store.noPanClass]),"svelte-sf2y5e"),G(h,"role",t.store.disableKeyboardA11y?void 0:"button"),G(h,"tabindex",t.store.disableKeyboardA11y?void 0:-1),f=Le(h,"",f,v)},[()=>({width:ct(u(r).width),height:ct(u(r).height),transform:`translate(${u(r).x??""}px, ${u(r).y??""}px)`})]),F(d,h)};de(l,d=>{t.store.selectionRectMode==="nodes"&&u(r)&&_t(u(r).x)&&_t(u(r).y)&&d(c)})}F(e,a),oe()}jo(["contextmenu","click","keydown"]);function Kv(e){switch(e){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function $e(e,t){let{enabled:n=!0,trigger:r,type:o="keydown"}=t;function i(a){const l=Array.isArray(r)?r:[r],c=[a.metaKey,a.altKey,a.shiftKey,a.ctrlKey].reduce((d,h,f)=>h?d|1<<f:d,0);for(const d of l){const h={preventDefault:!1,enabled:!0,...d},{modifier:f,key:g,callback:v,preventDefault:_,enabled:y}=h;if(y){if(a.key!==g)continue;if(f===null||f===!1){if(c!==0)continue}else if(f!==void 0&&f?.[0]?.length>0){const C=Array.isArray(f)?f:[f];let k=!1;for(const b of C)if((Array.isArray(b)?b:[b]).reduce((T,z)=>T|Kv(z),0)===c){k=!0;break}if(!k)continue}_&&a.preventDefault();const w={node:e,trigger:h,originalEvent:a};e.dispatchEvent(new CustomEvent("shortcut",{detail:w})),v?.(w)}}}let s;return n&&(s=xo(e,o,i)),{update:a=>{const{enabled:l=!0,type:c="keydown"}=a;n&&(!l||o!==c)?s?.():!n&&l&&(s=xo(e,c,i)),n=l,o=c,r=a.trigger},destroy:()=>{s?.()}}}function Yv(){const e=m(Ft),t=i=>{const s=ds(i)?i:u(e).nodeLookup.get(i.id),a=s.parentId?Qh(s.position,s.measured,s.parentId,u(e).nodeLookup,u(e).nodeOrigin):s.position,l={...s,position:a,width:s.measured?.width??s.width,height:s.measured?.height??s.height};return xn(l)};function n(i,s,a={replace:!1}){u(e).nodes=qe(()=>u(e).nodes).map(l=>{if(l.id===i){const c=typeof s=="function"?s(l):s;return a?.replace&&ds(c)?c:{...l,...c}}return l})}function r(i,s,a={replace:!1}){u(e).edges=qe(()=>u(e).edges).map(l=>{if(l.id===i){const c=typeof s=="function"?s(l):s;return a.replace&&$g(c)?c:{...l,...c}}return l})}const o=i=>u(e).nodeLookup.get(i);return{zoomIn:u(e).zoomIn,zoomOut:u(e).zoomOut,getInternalNode:o,getNode:i=>o(i)?.internals.userNode,getNodes:i=>i===void 0?u(e).nodes:ps(u(e).nodeLookup,i),getEdge:i=>u(e).edgeLookup.get(i),getEdges:i=>i===void 0?u(e).edges:ps(u(e).edgeLookup,i),setZoom:(i,s)=>{const a=u(e).panZoom;return a?a.scaleTo(i,{duration:s?.duration}):Promise.resolve(!1)},getZoom:()=>u(e).viewport.zoom,setViewport:async(i,s)=>{const a=u(e).viewport;return u(e).panZoom?(await u(e).panZoom.setViewport({x:i.x??a.x,y:i.y??a.y,zoom:i.zoom??a.zoom},s),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>Ms(u(e).viewport),setCenter:async(i,s,a)=>u(e).setCenter(i,s,a),fitView:i=>u(e).fitView(i),fitBounds:async(i,s)=>{if(!u(e).panZoom)return Promise.resolve(!1);const a=ui(i,u(e).width,u(e).height,u(e).minZoom,u(e).maxZoom,s?.padding??.1);return await u(e).panZoom.setViewport(a,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)},getIntersectingNodes:(i,s=!0,a)=>{const l=$i(i),c=l?i:t(i);return c?(a||u(e).nodes).filter(d=>{const h=u(e).nodeLookup.get(d.id);if(!h||!l&&d.id===i.id)return!1;const f=xn(h),g=Wn(f,c);return s&&g>0||g>=f.width*f.height||g>=c.width*c.height}):[]},isNodeIntersecting:(i,s,a=!0)=>{const c=$i(i)?i:t(i);if(!c)return!1;const d=Wn(c,s);return a&&d>0||d>=s.width*s.height||d>=c.width*c.height},deleteElements:async({nodes:i=[],edges:s=[]})=>{const{nodes:a,edges:l}=await Zh({nodesToRemove:i,edgesToRemove:s,nodes:u(e).nodes,edges:u(e).edges,onBeforeDelete:u(e).onbeforedelete});return a&&(u(e).nodes=qe(()=>u(e).nodes).filter(c=>!a.some(({id:d})=>d===c.id))),l&&(u(e).edges=qe(()=>u(e).edges).filter(c=>!l.some(({id:d})=>d===c.id))),(a.length>0||l.length>0)&&u(e).ondelete?.({nodes:a,edges:l}),{deletedNodes:a,deletedEdges:l}},screenToFlowPosition:(i,s={snapToGrid:!0})=>{if(!u(e).domNode)return i;const a=s.snapToGrid?u(e).snapGrid:!1,{x:l,y:c,zoom:d}=u(e).viewport,{x:h,y:f}=u(e).domNode.getBoundingClientRect(),g={x:i.x-h,y:i.y-f};return sr(g,[l,c,d],a!==null,a||[1,1])},flowToScreenPosition:i=>{if(!u(e).domNode)return i;const{x:s,y:a,zoom:l}=u(e).viewport,{x:c,y:d}=u(e).domNode.getBoundingClientRect(),h=Rr(i,[s,a,l]);return{x:h.x+c,y:h.y+d}},toObject:()=>structuredClone({nodes:[...u(e).nodes],edges:[...u(e).edges],viewport:{...u(e).viewport}}),updateNode:n,updateNodeData:(i,s,a)=>{const l=u(e).nodeLookup.get(i)?.internals.userNode;if(!l)return;const c=typeof s=="function"?s(l):s;n(i,d=>({...d,data:a?.replace?c:{...d.data,...c}}))},updateEdge:r,getNodesBounds:i=>Fh(i,{nodeLookup:u(e).nodeLookup,nodeOrigin:u(e).nodeOrigin}),getHandleConnections:({type:i,id:s,nodeId:a})=>Array.from(u(e).connectionLookup.get(`${a}-${i}-${s??null}`)?.values()??[])}}function ps(e,t){const n=[];for(const r of t){const o=e.get(r);if(o){const i="internals"in o?o.internals?.userNode:o;n.push(i)}}return n}function Wv(e,t){re(t,!0);let n=L(t,"store",15),r=L(t,"selectionKey",3,"Shift"),o=L(t,"multiSelectionKey",19,()=>Zn()?"Meta":"Control"),i=L(t,"deleteKey",3,"Backspace"),s=L(t,"panActivationKey",3," "),a=L(t,"zoomActivationKey",19,()=>Zn()?"Meta":"Control"),{deleteElements:l}=Yv();function c(_){return _!==null&&typeof _=="object"}function d(_){return c(_)?_.modifier||[]:[]}function h(_){return _==null?"":c(_)?_.key:_}function f(_,y){return(Array.isArray(_)?_:[_]).map(C=>{const k=h(C);return{key:k,modifier:d(C),enabled:k!==null,callback:y}})}function g(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function v(){const _=n().nodes.filter(w=>w.selected),y=n().edges.filter(w=>w.selected);l({nodes:_,edges:y})}kr("blur",Ae,g),kr("contextmenu",Ae,g),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!0,!0)),type:"keydown"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!1,!0)),type:"keyup"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(o(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(o(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(i(),_=>{!(_.originalEvent.ctrlKey||_.originalEvent.metaKey||_.originalEvent.shiftKey)&&!el(_.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),v())}),type:"keydown"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(i(),()=>n(n().deleteKeyPressed=!1,!0)),type:"keyup"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(s(),()=>n(n().panActivationKeyPressed=!0,!0)),type:"keydown"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(s(),()=>n(n().panActivationKeyPressed=!1,!0)),type:"keyup"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(a(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Ne(Ae,(_,y)=>$e?.(_,y),()=>({trigger:f(a(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),oe()}var Zv=me('<path fill="none" class="svelte-flow__connection-path"></path>'),Xv=me('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function Gv(e,t){re(t,!0);let n=m(()=>{if(!t.store.connection.inProgress)return"";const s={sourceX:t.store.connection.from.x,sourceY:t.store.connection.from.y,sourcePosition:t.store.connection.fromPosition,targetX:t.store.connection.to.x,targetY:t.store.connection.to.y,targetPosition:t.store.connection.toPosition};switch(t.type){case Tt.Bezier:{const[a]=nl(s);return a}case Tt.Straight:{const[a]=ol(s);return a}case Tt.Step:case Tt.SmoothStep:{const[a]=di({...s,borderRadius:t.type===Tt.Step?0:void 0});return a}}});var r=Se(),o=le(r);{var i=s=>{var a=Xv(),l=ee(a),c=ee(l);{var d=f=>{var g=Se(),v=le(g);Zr(v,()=>t.LineComponent,(_,y)=>{y(_,{})}),F(f,g)},h=f=>{var g=Zv();he(()=>{G(g,"d",u(n)),Le(g,t.style)}),F(f,g)};de(c,f=>{t.LineComponent?f(d):f(h,!1)})}he(f=>{G(a,"width",t.store.width),G(a,"height",t.store.height),Le(a,t.containerStyle),ut(l,0,f)},[()=>Ht(["svelte-flow__connection",Vh(t.store.connection.isValid)])]),F(s,a)};de(o,s=>{t.store.connection.inProgress&&s(i)})}F(e,r),oe()}var Uv=ae("<div><!></div>");function mi(e,t){re(t,!0);let n=L(t,"position",3,"top-right"),r=Vt(t,["$$slots","$$events","$$legacy","position","style","class","children"]),o=m(()=>`${n()}`.split("-"));var i=Uv();Lt(i,a=>({class:a,style:t.style,...r}),[()=>["svelte-flow__panel",t.class,...u(o)]]);var s=ee(i);Ye(s,()=>t.children??Sn),F(e,i),oe()}var Qv=ae('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function jv(e,t){re(t,!0);let n=L(t,"position",3,"bottom-right");var r=Se(),o=le(r);{var i=s=>{mi(s,{get position(){return n()},class:"svelte-flow__attribution","data-message":"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us",children:(a,l)=>{var c=Qv();F(a,c)},$$slots:{default:!0}})};de(o,s=>{t.proOptions?.hideAttribution||s(i)})}F(e,r),oe()}var Jv=ae("<div><!></div>");function $v(e,t){re(t,!0);let n=L(t,"domNode",15),r=L(t,"clientWidth",15),o=L(t,"clientHeight",15),i=m(()=>t.rest.class),s=m(()=>kc(t.rest,["id","class","nodeTypes","edgeTypes","colorMode","isValidConnection","onmove","onmovestart","onmoveend","onflowerror","ondelete","onbeforedelete","onbeforeconnect","onconnect","onconnectstart","onconnectend","onbeforereconnect","onreconnect","onreconnectstart","onreconnectend","onclickconnectstart","onclickconnectend","oninit","onselectionchange","onselectiondragstart","onselectiondrag","onselectiondragstop","onselectionstart","onselectionend","clickConnect","fitView","fitViewOptions","nodeOrigin","nodeDragThreshold","connectionDragThreshold","minZoom","maxZoom","initialViewport","connectionRadius","connectionMode","selectionMode","selectNodesOnDrag","snapGrid","defaultMarkerColor","translateExtent","nodeExtent","onlyRenderVisibleElements","autoPanOnConnect","autoPanOnNodeDrag","colorModeSSR","defaultEdgeOptions","elevateNodesOnSelect","elevateEdgesOnSelect","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","elementsSelectable","nodesFocusable","edgesFocusable","disableKeyboardA11y","noDragClass","noPanClass","noWheelClass","ariaLabelConfig","autoPanSpeed","panOnScrollSpeed","zIndexMode"]));function a(d){d.currentTarget.scrollTo({top:0,left:0,behavior:"auto"}),t.rest.onscroll&&t.rest.onscroll(d)}var l=Jv();Lt(l,d=>({class:["svelte-flow","svelte-flow__container",u(i),t.colorMode],"data-testid":"svelte-flow__wrapper",role:"application",onscroll:a,...u(s),[pt]:d}),[()=>({width:ct(t.width),height:ct(t.height)})],void 0,void 0,"svelte-mkap6j");var c=ee(l);Ye(c,()=>t.children??Sn),er(l,d=>n(d),()=>n()),Ai(l,"clientHeight",o),Ai(l,"clientWidth",r),F(e,l),oe()}var e0=ae('<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>',1),t0=ae("<!> <!>",1),n0=ae("<!> <!> <!> <!> <!>",1);function r0(e,t){re(t,!0);let n=L(t,"paneClickDistance",3,1),r=L(t,"nodeClickDistance",3,1),o=L(t,"panOnScrollMode",19,()=>hn.Free),i=L(t,"preventScrolling",3,!0),s=L(t,"zoomOnScroll",3,!0),a=L(t,"zoomOnDoubleClick",3,!0),l=L(t,"zoomOnPinch",3,!0),c=L(t,"panOnScroll",3,!1),d=L(t,"panOnScrollSpeed",3,.5),h=L(t,"panOnDrag",3,!0),f=L(t,"selectionOnDrag",3,!1),g=L(t,"connectionLineType",19,()=>Tt.Bezier),v=L(t,"nodes",31,()=>nt([])),_=L(t,"edges",31,()=>nt([])),y=L(t,"viewport",15,void 0),w=Vt(t,["$$slots","$$events","$$legacy","width","height","proOptions","selectionKey","deleteKey","panActivationKey","multiSelectionKey","zoomActivationKey","paneClickDistance","nodeClickDistance","onmovestart","onmoveend","onmove","oninit","onnodeclick","onnodecontextmenu","onnodedrag","onnodedragstart","onnodedragstop","onnodepointerenter","onnodepointermove","onnodepointerleave","onselectionclick","onselectioncontextmenu","onselectionstart","onselectionend","onedgeclick","onedgecontextmenu","onedgepointerenter","onedgepointerleave","onpaneclick","onpanecontextmenu","panOnScrollMode","preventScrolling","zoomOnScroll","zoomOnDoubleClick","zoomOnPinch","panOnScroll","panOnScrollSpeed","panOnDrag","selectionOnDrag","connectionLineComponent","connectionLineStyle","connectionLineContainerStyle","connectionLineType","attributionPosition","children","nodes","edges","viewport"]),C=gv({props:w,width:t.width,height:t.height,get nodes(){return v()},set nodes(b){v(b)},get edges(){return _()},set edges(b){_(b)},get viewport(){return y()},set viewport(b){y(b)}});const k=Fo(qo);k&&k.setStore&&k.setStore(C),As(qo,{provider:!1,getStore(){return C}}),at(()=>{const b={nodes:C.selectedNodes,edges:C.selectedEdges};qe(()=>t.onselectionchange)?.(b);for(const A of C.selectionChangeHandlers.values())A(b)}),ei(()=>{C.reset()}),$v(e,{get colorMode(){return C.colorMode},get width(){return t.width},get height(){return t.height},get rest(){return w},get domNode(){return C.domNode},set domNode(b){C.domNode=b},get clientWidth(){return C.width},set clientWidth(b){C.width=b},get clientHeight(){return C.height},set clientHeight(b){C.height=b},children:(b,A)=>{var T=n0(),z=le(T);Wv(z,{get selectionKey(){return t.selectionKey},get deleteKey(){return t.deleteKey},get panActivationKey(){return t.panActivationKey},get multiSelectionKey(){return t.multiSelectionKey},get zoomActivationKey(){return t.zoomActivationKey},get store(){return C},set store(x){C=x}});var M=$(z,2);mv(M,{get panOnScrollMode(){return o()},get preventScrolling(){return i()},get zoomOnScroll(){return s()},get zoomOnDoubleClick(){return a()},get zoomOnPinch(){return l()},get panOnScroll(){return c()},get panOnScrollSpeed(){return d()},get panOnDrag(){return h()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get onmovestart(){return t.onmovestart},get onmove(){return t.onmove},get onmoveend(){return t.onmoveend},get oninit(){return t.oninit},get store(){return C},set store(x){C=x},children:(x,N)=>{_v(x,{get onpaneclick(){return t.onpaneclick},get onpanecontextmenu(){return t.onpanecontextmenu},get onselectionstart(){return t.onselectionstart},get onselectionend(){return t.onselectionend},get panOnDrag(){return h()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get store(){return C},set store(p){C=p},children:(p,E)=>{var S=t0(),D=le(S);bv(D,{get store(){return C},set store(I){C=I},children:(I,q)=>{var V=e0(),W=$(le(V),2);Lv(W,{get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return C},set store(Z){C=Z}});var Y=$(W,4);Gv(Y,{get type(){return g()},get LineComponent(){return t.connectionLineComponent},get containerStyle(){return t.connectionLineContainerStyle},get style(){return t.connectionLineStyle},get store(){return C},set store(Z){C=Z}});var B=$(Y,2);Mv(B,{get nodeClickDistance(){return r()},get onnodeclick(){return t.onnodeclick},get onnodecontextmenu(){return t.onnodecontextmenu},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return C},set store(Z){C=Z}});var U=$(B,2);Fv(U,{get onselectionclick(){return t.onselectionclick},get onselectioncontextmenu(){return t.onselectioncontextmenu},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return C},set store(Z){C=Z}}),F(I,V)},$$slots:{default:!0}});var O=$(D,2);{let I=m(()=>!!(C.selectionRect&&C.selectionRectMode==="user")),q=m(()=>C.selectionRect?.width),V=m(()=>C.selectionRect?.height),W=m(()=>C.selectionRect?.x),Y=m(()=>C.selectionRect?.y);bl(O,{get isVisible(){return u(I)},get width(){return u(q)},get height(){return u(V)},get x(){return u(W)},get y(){return u(Y)}})}F(p,S)},$$slots:{default:!0}})},$$slots:{default:!0}});var H=$(M,2);jv(H,{get proOptions(){return t.proOptions},get position(){return t.attributionPosition}});var K=$(H,2);Sv(K,{get store(){return C}});var P=$(K,2);Ye(P,()=>t.children??Sn),F(b,T)},$$slots:{default:!0}}),oe()}var o0=ae("<button><!></button>");function vr(e,t){let n=Vt(t,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var r=o0();Lt(r,()=>({type:"button",onclick:t.onclick,class:["svelte-flow__controls-button",t.class],...n,[pt]:{"--xy-controls-button-background-color-props":t.bgColor,"--xy-controls-button-background-color-hover-props":t.bgColorHover,"--xy-controls-button-color-props":t.color,"--xy-controls-button-color-hover-props":t.colorHover,"--xy-controls-button-border-color-props":t.borderColor}}));var o=ee(r);Ye(o,()=>t.children??Sn),F(e,r)}var i0=me('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>');function s0(e){var t=i0();F(e,t)}var a0=me('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function l0(e){var t=a0();F(e,t)}var c0=me('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><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"></path></svg>');function u0(e){var t=c0();F(e,t)}var d0=me('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><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"></path></svg>');function f0(e){var t=d0();F(e,t)}var h0=me('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><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"></path></svg>');function g0(e){var t=h0();F(e,t)}var v0=ae("<!> <!>",1),p0=ae("<!> <!> <!> <!> <!> <!>",1);function m0(e,t){re(t,!0);let n=L(t,"position",3,"bottom-left"),r=L(t,"orientation",3,"vertical"),o=L(t,"showZoom",3,!0),i=L(t,"showFitView",3,!0),s=L(t,"showLock",3,!0),a=Vt(t,["$$slots","$$events","$$legacy","position","orientation","showZoom","showFitView","showLock","style","class","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","fitViewOptions","children","before","after"]),l=m(Ft);const c={bgColor:t.buttonBgColor,bgColorHover:t.buttonBgColorHover,color:t.buttonColor,colorHover:t.buttonColorHover,borderColor:t.buttonBorderColor};let d=m(()=>u(l).nodesDraggable||u(l).nodesConnectable||u(l).elementsSelectable),h=m(()=>u(l).viewport.zoom<=u(l).minZoom),f=m(()=>u(l).viewport.zoom>=u(l).maxZoom),g=m(()=>u(l).ariaLabelConfig),v=m(()=>r()==="horizontal"?"horizontal":"vertical");const _=()=>{u(l).zoomIn()},y=()=>{u(l).zoomOut()},w=()=>{u(l).fitView(t.fitViewOptions)},C=()=>{let k=!u(d);u(l).nodesDraggable=k,u(l).nodesConnectable=k,u(l).elementsSelectable=k};{let k=m(()=>["svelte-flow__controls",u(v),t.class]);mi(e,At({get class(){return u(k)},get position(){return n()},"data-testid":"svelte-flow__controls",get"aria-label"(){return u(g)["controls.ariaLabel"]},get style(){return t.style}},()=>a,{children:(b,A)=>{var T=p0(),z=le(T);{var M=I=>{var q=Se(),V=le(q);Ye(V,()=>t.before),F(I,q)};de(z,I=>{t.before&&I(M)})}var H=$(z,2);{var K=I=>{var q=v0(),V=le(q);vr(V,At({onclick:_,class:"svelte-flow__controls-zoomin",get title(){return u(g)["controls.zoomIn.ariaLabel"]},get"aria-label"(){return u(g)["controls.zoomIn.ariaLabel"]},get disabled(){return u(f)}},()=>c,{children:(Y,B)=>{s0(Y)},$$slots:{default:!0}}));var W=$(V,2);vr(W,At({onclick:y,class:"svelte-flow__controls-zoomout",get title(){return u(g)["controls.zoomOut.ariaLabel"]},get"aria-label"(){return u(g)["controls.zoomOut.ariaLabel"]},get disabled(){return u(h)}},()=>c,{children:(Y,B)=>{l0(Y)},$$slots:{default:!0}})),F(I,q)};de(H,I=>{o()&&I(K)})}var P=$(H,2);{var x=I=>{vr(I,At({class:"svelte-flow__controls-fitview",onclick:w,get title(){return u(g)["controls.fitView.ariaLabel"]},get"aria-label"(){return u(g)["controls.fitView.ariaLabel"]}},()=>c,{children:(q,V)=>{u0(q)},$$slots:{default:!0}}))};de(P,I=>{i()&&I(x)})}var N=$(P,2);{var p=I=>{vr(I,At({class:"svelte-flow__controls-interactive",onclick:C,get title(){return u(g)["controls.interactive.ariaLabel"]},get"aria-label"(){return u(g)["controls.interactive.ariaLabel"]}},()=>c,{children:(q,V)=>{var W=Se(),Y=le(W);{var B=Z=>{g0(Z)},U=Z=>{f0(Z)};de(Y,Z=>{u(d)?Z(B):Z(U,!1)})}F(q,W)},$$slots:{default:!0}}))};de(N,I=>{s()&&I(p)})}var E=$(N,2);{var S=I=>{var q=Se(),V=le(q);Ye(V,()=>t.children),F(I,q)};de(E,I=>{t.children&&I(S)})}var D=$(E,2);{var O=I=>{var q=Se(),V=le(q);Ye(V,()=>t.after),F(I,q)};de(D,I=>{t.after&&I(O)})}F(b,T)},$$slots:{default:!0}}))}oe()}var Ot;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ot||(Ot={}));var y0=me("<circle></circle>");function _0(e,t){var n=y0();he(()=>{G(n,"cx",t.radius),G(n,"cy",t.radius),G(n,"r",t.radius),ut(n,0,Ht(["svelte-flow__background-pattern","dots",t.class]))}),F(e,n)}var w0=me("<path></path>");function b0(e,t){re(t,!0);var n=w0();he(()=>{G(n,"stroke-width",t.lineWidth),G(n,"d",`M${t.dimensions[0]/2} 0 V${t.dimensions[1]} M0 ${t.dimensions[1]/2} H${t.dimensions[0]}`),ut(n,0,Ht(["svelte-flow__background-pattern",t.variant,t.class]))}),F(e,n),oe()}const x0={[Ot.Dots]:1,[Ot.Lines]:1,[Ot.Cross]:6};var E0=me('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function S0(e,t){re(t,!0);let n=L(t,"variant",19,()=>Ot.Dots),r=L(t,"gap",3,20),o=L(t,"lineWidth",3,1),i=m(Ft),s=m(()=>n()===Ot.Dots),a=m(()=>n()===Ot.Cross),l=m(()=>Array.isArray(r())?r():[r(),r()]),c=m(()=>`background-pattern-${u(i).flowId}-${t.id??""}`),d=m(()=>[u(l)[0]*u(i).viewport.zoom||1,u(l)[1]*u(i).viewport.zoom||1]),h=m(()=>(t.size??x0[n()])*u(i).viewport.zoom),f=m(()=>u(a)?[u(h),u(h)]:u(d)),g=m(()=>u(s)?[u(h)/2,u(h)/2]:[u(f)[0]/2,u(f)[1]/2]);var v=E0();let _;var y=ee(v),w=ee(y);{var C=A=>{{let T=m(()=>u(h)/2);_0(A,{get radius(){return u(T)},get class(){return t.patternClass}})}},k=A=>{b0(A,{get dimensions(){return u(f)},get variant(){return n()},get lineWidth(){return o()},get class(){return t.patternClass}})};de(w,A=>{u(s)?A(C):A(k,!1)})}var b=$(y);he(()=>{ut(v,0,Ht(["svelte-flow__background","svelte-flow__container",t.class])),_=Le(v,"",_,{"--xy-background-color-props":t.bgColor,"--xy-background-pattern-color-props":t.patternColor}),G(y,"id",u(c)),G(y,"x",u(i).viewport.x%u(d)[0]),G(y,"y",u(i).viewport.y%u(d)[1]),G(y,"width",u(d)[0]),G(y,"height",u(d)[1]),G(y,"patternTransform",`translate(-${u(g)[0]},-${u(g)[1]})`),G(b,"fill",`url(#${u(c)})`)}),F(e,v),oe()}var k0=me("<rect></rect>");function C0(e,t){let n=L(t,"borderRadius",3,5),r=L(t,"strokeWidth",3,2);var o=Se(),i=le(o);{var s=l=>{const c=m(()=>t.nodeComponent);var d=Se(),h=le(d);Zr(h,()=>u(c),(f,g)=>{g(f,{get id(){return t.id},get x(){return t.x},get y(){return t.y},get width(){return t.width},get height(){return t.height},get borderRadius(){return n()},get class(){return t.class},get color(){return t.color},get shapeRendering(){return t.shapeRendering},get strokeColor(){return t.strokeColor},get strokeWidth(){return r()},get selected(){return t.selected}})}),F(l,d)},a=l=>{var c=k0();let d,h;he(()=>{d=ut(c,0,Ht(["svelte-flow__minimap-node",t.class]),null,d,{selected:t.selected}),G(c,"x",t.x),G(c,"y",t.y),G(c,"rx",n()),G(c,"ry",n()),G(c,"width",t.width),G(c,"height",t.height),G(c,"shape-rendering",t.shapeRendering),h=Le(c,"",h,{fill:t.color,stroke:t.strokeColor,"stroke-width":r()})}),F(l,c)};de(i,l=>{t.nodeComponent?l(s):l(a,!1)})}F(e,o)}function N0(e,t){const n=Mg({domNode:e,panZoom:t.panZoom,getTransform:()=>{const{viewport:o}=t.store;return[o.x,o.y,o.zoom]},getViewScale:t.getViewScale});n.update({translateExtent:t.translateExtent,width:t.width,height:t.height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:t.pannable,zoomable:t.zoomable});function r(o){n.update({translateExtent:o.translateExtent,width:o.width,height:o.height,inversePan:o.inversePan,zoomStep:o.zoomStep,pannable:o.pannable,zoomable:o.zoomable})}return{update:r,destroy(){n.destroy()}}}const go=e=>e instanceof Function?e:()=>e;var P0=me("<title> </title>"),M0=me('<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>'),A0=ae('<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>',1);function T0(e,t){re(t,!0);let n=L(t,"position",3,"bottom-right"),r=L(t,"nodeStrokeColor",3,"transparent"),o=L(t,"nodeClass",3,""),i=L(t,"nodeBorderRadius",3,5),s=L(t,"nodeStrokeWidth",3,2),a=L(t,"width",3,200),l=L(t,"height",3,150),c=L(t,"pannable",3,!0),d=L(t,"zoomable",3,!0),h=Vt(t,["$$slots","$$events","$$legacy","position","ariaLabel","nodeStrokeColor","nodeColor","nodeClass","nodeBorderRadius","nodeStrokeWidth","nodeComponent","bgColor","maskColor","maskStrokeColor","maskStrokeWidth","width","height","pannable","zoomable","inversePan","zoomStep","class"]),f=m(Ft),g=m(()=>u(f).ariaLabelConfig);const v=t.nodeColor===void 0?void 0:go(t.nodeColor),_=go(r()),y=go(o()),w=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";let C=m(()=>`svelte-flow__minimap-desc-${u(f).flowId}`),k=m(()=>({x:-u(f).viewport.x/u(f).viewport.zoom,y:-u(f).viewport.y/u(f).viewport.zoom,width:u(f).width/u(f).viewport.zoom,height:u(f).height/u(f).viewport.zoom})),b=m(()=>Qa(or(u(f).nodeLookup,{filter:O=>!O.hidden}),u(k))),A=m(()=>u(b).width/a()),T=m(()=>u(b).height/l()),z=m(()=>Math.max(u(A),u(T))),M=m(()=>u(z)*a()),H=m(()=>u(z)*l()),K=m(()=>5*u(z)),P=m(()=>u(b).x-(u(M)-u(b).width)/2-u(K)),x=m(()=>u(b).y-(u(H)-u(b).height)/2-u(K)),N=m(()=>u(M)+u(K)*2),p=m(()=>u(H)+u(K)*2);const E=()=>u(z);var S=A0(),D=le(S);{let O=m(()=>["svelte-flow__minimap",t.class]);Hc(D,()=>({"--xy-minimap-background-color-props":t.bgColor})),mi(D.lastChild,At({get position(){return n()},get class(){return u(O)},"data-testid":"svelte-flow__minimap"},()=>h,{children:(I,q)=>{var V=Se(),W=le(V);{var Y=B=>{var U=M0();let Z;var X=ee(U);{var Q=J=>{var pe=P0(),te=ee(pe);he(()=>{G(pe,"id",u(C)),Re(te,t.ariaLabel??u(g)["minimap.ariaLabel"])}),F(J,pe)};de(X,J=>{(t.ariaLabel??u(g)["minimap.ariaLabel"])&&J(Q)})}var ue=$(X);Wr(ue,17,()=>u(f).nodes,J=>J.id,(J,pe)=>{const te=m(()=>u(f).nodeLookup.get(u(pe).id));var Me=Se(),Ct=le(Me);{var Nt=ft=>{const ce=m(()=>Bt(u(te)));{let ye=m(()=>v?.(u(te))),Ze=m(()=>_(u(te))),ge=m(()=>y(u(te)));C0(ft,At({get id(){return u(te).id},get x(){return u(te).internals.positionAbsolute.x},get y(){return u(te).internals.positionAbsolute.y}},()=>u(ce),{get selected(){return u(te).selected},get nodeComponent(){return t.nodeComponent},get color(){return u(ye)},get borderRadius(){return i()},get strokeColor(){return u(Ze)},get strokeWidth(){return s()},get shapeRendering(){return w},get class(){return u(ge)}}))}};de(Ct,ft=>{u(te)&&ja(u(te))&&!u(te).hidden&&ft(Nt)})}F(J,Me)});var we=$(ue);Ne(U,(J,pe)=>N0?.(J,pe),()=>({store:u(f),panZoom:u(f).panZoom,getViewScale:E,translateExtent:u(f).translateExtent,width:u(f).width,height:u(f).height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:c(),zoomable:d()})),he(()=>{G(U,"width",a()),G(U,"height",l()),G(U,"viewBox",`${u(P)??""} ${u(x)??""} ${u(N)??""} ${u(p)??""}`),G(U,"aria-labelledby",u(C)),Z=Le(U,"",Z,{"--xy-minimap-mask-background-color-props":t.maskColor,"--xy-minimap-mask-stroke-color-props":t.maskStrokeColor,"--xy-minimap-mask-stroke-width-props":t.maskStrokeWidth?t.maskStrokeWidth*u(z):void 0}),G(we,"d",`M${u(P)-u(K)},${u(x)-u(K)}h${u(N)+u(K)*2}v${u(p)+u(K)*2}h${-u(N)-u(K)*2}z
M${u(k).x??""},${u(k).y??""}h${u(k).width??""}v${u(k).height??""}h${-u(k).width}z`)}),F(B,U)};de(W,B=>{u(f).panZoom&&B(Y)})}F(I,V)},$$slots:{default:!0}}))}F(e,S),oe()}var D0=ae("<!> <!> <!>",1),I0=ae('<div class="test-info svelte-1n46o8q"><h2 class="svelte-1n46o8q"> </h2> <span> </span> <div class="info-section svelte-1n46o8q"><h3 class="svelte-1n46o8q">Description</h3> <p class="svelte-1n46o8q"> </p></div> <div class="info-section svelte-1n46o8q"><h3 class="svelte-1n46o8q">When to Use</h3> <p class="svelte-1n46o8q"> </p></div> <div class="info-section svelte-1n46o8q"><h3 class="svelte-1n46o8q">Example</h3> <p class="example svelte-1n46o8q"> </p></div></div>'),z0=ae(`<div class="placeholder svelte-1n46o8q"><h2 class="svelte-1n46o8q">Select a Test</h2> <p class="svelte-1n46o8q">Click on any <span class="highlight svelte-1n46o8q">blue test node</span> in the flowchart to see detailed information about that statistical test.</p> <div class="legend svelte-1n46o8q"><h3 class="svelte-1n46o8q">Legend</h3> <div class="legend-item svelte-1n46o8q"><div class="legend-box start svelte-1n46o8q"></div> <span class="svelte-1n46o8q">Start Point</span></div> <div class="legend-item svelte-1n46o8q"><div class="legend-box decision svelte-1n46o8q"></div> <span class="svelte-1n46o8q">Decision Point</span></div> <div class="legend-item svelte-1n46o8q"><div class="legend-box test svelte-1n46o8q"></div> <span class="svelte-1n46o8q">Statistical Test</span></div></div> <div class="quick-ref svelte-1n46o8q"><h3 class="svelte-1n46o8q">Quick Reference</h3> <table class="svelte-1n46o8q"><thead><tr><th class="svelte-1n46o8q">Scenario</th><th class="svelte-1n46o8q">Parametric</th><th class="svelte-1n46o8q">Non-Parametric</th></tr></thead><tbody><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">1 sample vs value</td><td class="svelte-1n46o8q">One-Sample T</td><td class="svelte-1n46o8q">Wilcoxon</td></tr><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">2 independent groups</td><td class="svelte-1n46o8q">T-Test / Welch's</td><td class="svelte-1n46o8q">Mann-Whitney U</td></tr><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">2 paired groups</td><td class="svelte-1n46o8q">Paired T-Test</td><td class="svelte-1n46o8q">Wilcoxon</td></tr><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">3+ groups</td><td class="svelte-1n46o8q">ANOVA</td><td class="svelte-1n46o8q">Kruskal-Wallis</td></tr><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">Correlation</td><td class="svelte-1n46o8q">Pearson</td><td class="svelte-1n46o8q">Spearman</td></tr><tr class="svelte-1n46o8q"><td class="svelte-1n46o8q">Categorical</td><td class="svelte-1n46o8q">Chi-Square</td><td class="svelte-1n46o8q">Fisher's Exact</td></tr></tbody></table></div></div>`),O0=ae('<div class="app-container svelte-1n46o8q"><h1 class="svelte-1n46o8q">Statistical Test Decision Flowchart</h1> <p class="subtitle svelte-1n46o8q">Svelte Version - Click on any blue test node to learn more</p> <div class="main-content svelte-1n46o8q"><div class="flowchart-container svelte-1n46o8q"><!></div> <div class="info-panel svelte-1n46o8q"><!></div></div></div>');function R0(e){const t="background: #c8e6c9; border: 2px solid #2e7d32; border-radius: 25px; padding: 15px 25px; font-weight: bold; font-size: 14px;",n="background: #fff3e0; border: 2px solid #e65100; border-radius: 8px; padding: 12px 18px; font-weight: 500; font-size: 12px; text-align: center;",r="background: #e1f5fe; border: 2px solid #01579b; border-radius: 8px; padding: 12px 20px; font-weight: bold; font-size: 12px; color: #01579b; cursor: pointer;";let o=nt([{id:"start",position:{x:500,y:0},data:{label:"What is your research goal?"},style:t},{id:"q1",position:{x:450,y:100},data:{label:"Comparing groups or measuring relationship?"},style:n+" width: 180px;"},{id:"q2",position:{x:280,y:230},data:{label:"How many groups?"},style:n},{id:"q3",position:{x:820,y:230},data:{label:"Data type?"},style:n},{id:"q4",position:{x:80,y:360},data:{label:"Data normal?"},style:n},{id:"q5",position:{x:280,y:360},data:{label:"Independent or paired?"},style:n+" width: 130px;"},{id:"q6",position:{x:520,y:360},data:{label:"Data normal?"},style:n},{id:"q11",position:{x:720,y:360},data:{label:"Data normal?"},style:n},{id:"q12",position:{x:920,y:360},data:{label:"Sample size adequate?"},style:n+" width: 120px;"},{id:"t1",position:{x:20,y:480},data:{label:"One-Sample T-Test"},style:r},{id:"t2",position:{x:20,y:560},data:{label:"Wilcoxon Signed-Rank"},style:r},{id:"q7",position:{x:200,y:480},data:{label:"Data normal?"},style:n},{id:"q8",position:{x:360,y:480},data:{label:"Data normal?"},style:n},{id:"q10",position:{x:560,y:480},data:{label:"Equal variances?"},style:n},{id:"t8",position:{x:700,y:480},data:{label:"Kruskal-Wallis Test"},style:r},{id:"t11",position:{x:740,y:620},data:{label:"Pearson Correlation"},style:r},{id:"t12",position:{x:890,y:620},data:{label:"Spearman Correlation"},style:r},{id:"t13",position:{x:940,y:480},data:{label:"Chi-Square Test"},style:r},{id:"t14",position:{x:1080,y:480},data:{label:"Fisher's Exact Test"},style:r},{id:"q9",position:{x:150,y:600},data:{label:"Equal variances?"},style:n},{id:"t3",position:{x:280,y:600},data:{label:"Mann-Whitney U"},style:r},{id:"t6",position:{x:340,y:600},data:{label:"Paired T-Test"},style:r},{id:"t7",position:{x:340,y:680},data:{label:"Wilcoxon Signed-Rank"},style:r},{id:"t9",position:{x:540,y:580},data:{label:"One-Way ANOVA"},style:r},{id:"t10",position:{x:680,y:580},data:{label:"Welch's ANOVA"},style:r},{id:"t4",position:{x:100,y:720},data:{label:"Independent T-Test"},style:r},{id:"t5",position:{x:240,y:720},data:{label:"Welch's T-Test"},style:r}]),i=nt([{id:"e-start-q1",source:"start",target:"q1"},{id:"e-q1-q2",source:"q1",target:"q2",label:"Comparing Groups"},{id:"e-q1-q3",source:"q1",target:"q3",label:"Measuring Relationship"},{id:"e-q2-q4",source:"q2",target:"q4",label:"1 group vs value"},{id:"e-q2-q5",source:"q2",target:"q5",label:"2 groups"},{id:"e-q2-q6",source:"q2",target:"q6",label:"3+ groups"},{id:"e-q3-q11",source:"q3",target:"q11",label:"Both Continuous"},{id:"e-q3-q12",source:"q3",target:"q12",label:"Both Categorical"},{id:"e-q4-t1",source:"q4",target:"t1",label:"Yes"},{id:"e-q4-t2",source:"q4",target:"t2",label:"No"},{id:"e-q5-q7",source:"q5",target:"q7",label:"Independent"},{id:"e-q5-q8",source:"q5",target:"q8",label:"Paired"},{id:"e-q6-q10",source:"q6",target:"q10",label:"Yes"},{id:"e-q6-t8",source:"q6",target:"t8",label:"No"},{id:"e-q7-q9",source:"q7",target:"q9",label:"Yes"},{id:"e-q7-t3",source:"q7",target:"t3",label:"No"},{id:"e-q8-t6",source:"q8",target:"t6",label:"Yes"},{id:"e-q8-t7",source:"q8",target:"t7",label:"No"},{id:"e-q9-t4",source:"q9",target:"t4",label:"Yes"},{id:"e-q9-t5",source:"q9",target:"t5",label:"No"},{id:"e-q10-t9",source:"q10",target:"t9",label:"Yes"},{id:"e-q10-t10",source:"q10",target:"t10",label:"No"},{id:"e-q11-t11",source:"q11",target:"t11",label:"Yes"},{id:"e-q11-t12",source:"q11",target:"t12",label:"No"},{id:"e-q12-t13",source:"q12",target:"t13",label:"Yes (freq ≥ 5)"},{id:"e-q12-t14",source:"q12",target:"t14",label:"No (small)"}]);const s={t1:{name:"One-Sample T-Test",description:"Compares a sample mean to a known or hypothesized population value.",use:"Testing if your sample differs from a target value.",example:"Is the average weight of products equal to 500g specification?",parametric:!0},t2:{name:"Wilcoxon Signed-Rank Test",description:"Non-parametric alternative to one-sample t-test for non-normal data.",use:"When data is skewed or ordinal.",example:"Do median satisfaction ratings differ from neutral (3)?",parametric:!1},t3:{name:"Mann-Whitney U Test",description:"Compares distributions of two independent groups without assuming normality.",use:"Non-parametric alternative to independent t-test.",example:"Do two groups have different rank distributions?",parametric:!1},t4:{name:"Independent T-Test",description:"Compares means of two independent groups with equal variances.",use:"Classic comparison of two unrelated groups.",example:"Do men and women differ in average height?",parametric:!0},t5:{name:"Welch's T-Test",description:"Compares means of two groups without assuming equal variances.",use:"Robust alternative when variances differ.",example:"Comparing treatment vs control with different variability.",parametric:!0},t6:{name:"Paired T-Test",description:"Compares means of two related measurements (same subjects measured twice).",use:"Before-after studies, matched pairs.",example:"Does blood pressure change after medication?",parametric:!0},t7:{name:"Wilcoxon Signed-Rank Test",description:"Non-parametric paired comparison for non-normal data.",use:"Paired data that violates normality.",example:"Do rankings improve after training?",parametric:!1},t8:{name:"Kruskal-Wallis Test",description:"Non-parametric comparison of 3+ groups based on ranks.",use:"Alternative to ANOVA for non-normal data.",example:"Do satisfaction scores differ across 4 product types?",parametric:!1},t9:{name:"One-Way ANOVA",description:"Compares means across 3 or more groups simultaneously.",use:"Testing if any group differs from others.",example:"Do students from different schools perform differently?",parametric:!0},t10:{name:"Welch's ANOVA",description:"ANOVA alternative when group variances are unequal.",use:"Robust multi-group comparison.",example:"Comparing yields across treatments with different variability.",parametric:!0},t11:{name:"Pearson Correlation",description:"Measures linear relationship strength between two continuous variables.",use:"Quantifying linear association.",example:"How strongly are height and weight related?",parametric:!0},t12:{name:"Spearman Correlation",description:"Measures monotonic relationship using ranks, robust to outliers.",use:"Non-linear but consistent relationships.",example:"Do income and happiness increase together?",parametric:!1},t13:{name:"Chi-Square Test",description:"Tests independence between two categorical variables.",use:"Association between categories.",example:"Is survival rate related to passenger class?",parametric:!1},t14:{name:"Fisher's Exact Test",description:"Exact test for categorical association with small samples.",use:"When expected frequencies are below 5.",example:"Association in a 2x2 table with few observations.",parametric:!1}};let a=se(null);function l(w){const C=w.detail.node.id;C.startsWith("t")?R(a,s[C],!0):R(a,null)}var c=O0(),d=$(ee(c),4),h=ee(d),f=ee(h);r0(f,{get nodes(){return o},get edges(){return i},fitView:!0,fitViewOptions:{padding:.2,minZoom:.5,maxZoom:1},minZoom:.3,maxZoom:2,onnodeclick:l,children:(w,C)=>{var k=D0(),b=le(k);m0(b,{});var A=$(b,2);S0(A,{variant:"dots",gap:12,size:1});var T=$(A,2);T0(T,{}),F(w,k)},$$slots:{default:!0}});var g=$(h,2),v=ee(g);{var _=w=>{var C=I0(),k=ee(C),b=ee(k),A=$(k,2),T=ee(A),z=$(A,2),M=$(ee(z),2),H=ee(M),K=$(z,2),P=$(ee(K),2),x=ee(P),N=$(K,2),p=$(ee(N),2),E=ee(p);he(()=>{Re(b,u(a).name),ut(A,1,`badge ${u(a).parametric?"parametric":"non-parametric"}`,"svelte-1n46o8q"),Re(T,u(a).parametric?"Parametric":"Non-Parametric"),Re(H,u(a).description),Re(x,u(a).use),Re(E,u(a).example)}),F(w,C)},y=w=>{var C=z0();F(w,C)};de(v,w=>{u(a)?w(_):w(y,!1)})}F(e,c)}Oc(R0,{target:document.getElementById("app")});