singleton-pipeline 0.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/docs/reference.md +1038 -0
- package/package.json +75 -0
- package/packages/cli/package.json +18 -0
- package/packages/cli/src/commands/new.js +440 -0
- package/packages/cli/src/commands/repl.js +551 -0
- package/packages/cli/src/executor.js +2646 -0
- package/packages/cli/src/index.js +107 -0
- package/packages/cli/src/parser.js +78 -0
- package/packages/cli/src/runners/_shared.js +83 -0
- package/packages/cli/src/runners/claude.js +119 -0
- package/packages/cli/src/runners/codex-instructions.js +75 -0
- package/packages/cli/src/runners/codex.js +162 -0
- package/packages/cli/src/runners/copilot.js +208 -0
- package/packages/cli/src/runners/index.js +20 -0
- package/packages/cli/src/runners/opencode.js +265 -0
- package/packages/cli/src/scanner.js +47 -0
- package/packages/cli/src/security/policy.js +126 -0
- package/packages/cli/src/shell.js +542 -0
- package/packages/cli/src/theme.js +46 -0
- package/packages/cli/src/timeline.js +146 -0
- package/packages/server/package.json +11 -0
- package/packages/server/src/index.js +43 -0
- package/packages/server/src/routes/agents.js +32 -0
- package/packages/server/src/routes/files.js +42 -0
- package/packages/server/src/routes/pipelines.js +74 -0
- package/packages/web/dist/assets/index-CCFWfCA2.css +1 -0
- package/packages/web/dist/assets/index-CnKytBly.js +55 -0
- package/packages/web/dist/index.html +13 -0
- package/packages/web/package.json +23 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();/**
|
|
2
|
+
* @vue/shared v3.5.32
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function Fs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ie={},Yn=[],At=()=>{},gu=()=>!1,sr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),lr=e=>e.startsWith("onUpdate:"),We=Object.assign,Ls=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},dd=Object.prototype.hasOwnProperty,Ne=(e,t)=>dd.call(e,t),de=Array.isArray,Gn=e=>jo(e)==="[object Map]",vu=e=>jo(e)==="[object Set]",Tl=e=>jo(e)==="[object Date]",pe=e=>typeof e=="function",He=e=>typeof e=="string",lt=e=>typeof e=="symbol",Me=e=>e!==null&&typeof e=="object",mu=e=>(Me(e)||pe(e))&&pe(e.then)&&pe(e.catch),yu=Object.prototype.toString,jo=e=>yu.call(e),hd=e=>jo(e).slice(8,-1),_u=e=>jo(e)==="[object Object]",ar=e=>He(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xo=Fs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ur=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},pd=/-\w/g,et=ur(e=>e.replace(pd,t=>t.slice(1).toUpperCase())),gd=/\B([A-Z])/g,zn=ur(e=>e.replace(gd,"-$1").toLowerCase()),cr=ur(e=>e.charAt(0).toUpperCase()+e.slice(1)),Or=ur(e=>e?`on${cr(e)}`:""),ft=(e,t)=>!Object.is(e,t),xi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},wu=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Ys=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Il;const fr=()=>Il||(Il=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function tt(e){if(de(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=He(o)?_d(o):tt(o);if(i)for(const r in i)t[r]=i[r]}return t}else if(He(e)||Me(e))return e}const vd=/;(?![^(]*\))/g,md=/:([^]+)/,yd=/\/\*[^]*?\*\//g;function _d(e){const t={};return e.replace(yd,"").split(vd).forEach(n=>{if(n){const o=n.split(md);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Xe(e){let t="";if(He(e))t=e;else if(de(e))for(let n=0;n<e.length;n++){const o=Xe(e[n]);o&&(t+=o+" ")}else if(Me(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function wd(e){if(!e)return null;let{class:t,style:n}=e;return t&&!He(t)&&(e.class=Xe(t)),n&&(e.style=tt(n)),e}const bd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xd=Fs(bd);function bu(e){return!!e||e===""}function $d(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Gs(e[o],t[o]);return n}function Gs(e,t){if(e===t)return!0;let n=Tl(e),o=Tl(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=lt(e),o=lt(t),n||o)return e===t;if(n=de(e),o=de(t),n||o)return n&&o?$d(e,t):!1;if(n=Me(e),o=Me(t),n||o){if(!n||!o)return!1;const i=Object.keys(e).length,r=Object.keys(t).length;if(i!==r)return!1;for(const s in e){const l=e.hasOwnProperty(s),a=t.hasOwnProperty(s);if(l&&!a||!l&&a||!Gs(e[s],t[s]))return!1}}return String(e)===String(t)}const xu=e=>!!(e&&e.__v_isRef===!0),Oe=e=>He(e)?e:e==null?"":de(e)||Me(e)&&(e.toString===yu||!pe(e.toString))?xu(e)?Oe(e.value):JSON.stringify(e,$u,2):String(e),$u=(e,t)=>xu(t)?$u(e,t.value):Gn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,i],r)=>(n[Rr(o,r)+" =>"]=i,n),{})}:vu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Rr(n))}:lt(t)?Rr(t):Me(t)&&!de(t)&&!_u(t)?String(t):t,Rr=(e,t="")=>{var n;return lt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
+
* @vue/reactivity v3.5.32
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let Ke;class Su{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ke,!t&&Ke&&(this.index=(Ke.scopes||(Ke.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Ke;try{return Ke=this,t()}finally{Ke=n}}}on(){++this._on===1&&(this.prevScope=Ke,Ke=this)}off(){this._on>0&&--this._on===0&&(Ke=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Eu(e){return new Su(e)}function Us(){return Ke}function $i(e,t=!1){Ke&&Ke.cleanups.push(e)}let De;const zr=new WeakSet;class Nu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ke&&Ke.active&&Ke.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,zr.has(this)&&(zr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Mu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Al(this),ku(this);const t=De,n=vt;De=this,vt=!0;try{return this.fn()}finally{Tu(this),De=t,vt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ks(t);this.deps=this.depsTail=void 0,Al(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?zr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ss(this)&&this.run()}get dirty(){return ss(this)}}let Cu=0,$o,So;function Mu(e,t=!1){if(e.flags|=8,t){e.next=So,So=e;return}e.next=$o,$o=e}function Xs(){Cu++}function Ws(){if(--Cu>0)return;if(So){let t=So;for(So=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$o;){let t=$o;for($o=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function ku(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Tu(e){let t,n=e.depsTail,o=n;for(;o;){const i=o.prevDep;o.version===-1?(o===n&&(n=i),Ks(o),Sd(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=i}e.deps=t,e.depsTail=n}function ss(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Iu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Iu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ao)||(e.globalVersion=Ao,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ss(e))))return;e.flags|=2;const t=e.dep,n=De,o=vt;De=e,vt=!0;try{ku(e);const i=e.fn(e._value);(t.version===0||ft(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{De=n,vt=o,Tu(e),e.flags&=-3}}function Ks(e,t=!1){const{dep:n,prevSub:o,nextSub:i}=e;if(o&&(o.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Ks(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Sd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let vt=!0;const Au=[];function qt(){Au.push(vt),vt=!1}function jt(){const e=Au.pop();vt=e===void 0?!0:e}function Al(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=De;De=void 0;try{t()}finally{De=n}}}let Ao=0;class Ed{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class dr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!De||!vt||De===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==De)n=this.activeLink=new Ed(De,this),De.deps?(n.prevDep=De.depsTail,De.depsTail.nextDep=n,De.depsTail=n):De.deps=De.depsTail=n,Pu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=De.depsTail,n.nextDep=void 0,De.depsTail.nextDep=n,De.depsTail=n,De.deps===n&&(De.deps=o)}return n}trigger(t){this.version++,Ao++,this.notify(t)}notify(t){Xs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ws()}}}function Pu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Pu(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Oi=new WeakMap,Cn=Symbol(""),ls=Symbol(""),Po=Symbol("");function Ze(e,t,n){if(vt&&De){let o=Oi.get(e);o||Oi.set(e,o=new Map);let i=o.get(n);i||(o.set(n,i=new dr),i.map=o,i.key=n),i.track()}}function Gt(e,t,n,o,i,r){const s=Oi.get(e);if(!s){Ao++;return}const l=a=>{a&&a.trigger()};if(Xs(),t==="clear")s.forEach(l);else{const a=de(e),u=a&&ar(n);if(a&&n==="length"){const c=Number(o);s.forEach((f,d)=>{(d==="length"||d===Po||!lt(d)&&d>=c)&&l(f)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),u&&l(s.get(Po)),t){case"add":a?u&&l(s.get("length")):(l(s.get(Cn)),Gn(e)&&l(s.get(ls)));break;case"delete":a||(l(s.get(Cn)),Gn(e)&&l(s.get(ls)));break;case"set":Gn(e)&&l(s.get(Cn));break}}Ws()}function Nd(e,t){const n=Oi.get(e);return n&&n.get(t)}function Bn(e){const t=Se(e);return t===e?t:(Ze(t,"iterate",Po),st(e)?t:t.map(mt))}function hr(e){return Ze(e=Se(e),"iterate",Po),e}function Mt(e,t){return Jt(e)?Jn(Mn(e)?mt(t):t):mt(t)}const Cd={__proto__:null,[Symbol.iterator](){return Br(this,Symbol.iterator,e=>Mt(this,e))},concat(...e){return Bn(this).concat(...e.map(t=>de(t)?Bn(t):t))},entries(){return Br(this,"entries",e=>(e[1]=Mt(this,e[1]),e))},every(e,t){return Ht(this,"every",e,t,void 0,arguments)},filter(e,t){return Ht(this,"filter",e,t,n=>n.map(o=>Mt(this,o)),arguments)},find(e,t){return Ht(this,"find",e,t,n=>Mt(this,n),arguments)},findIndex(e,t){return Ht(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ht(this,"findLast",e,t,n=>Mt(this,n),arguments)},findLastIndex(e,t){return Ht(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ht(this,"forEach",e,t,void 0,arguments)},includes(...e){return Hr(this,"includes",e)},indexOf(...e){return Hr(this,"indexOf",e)},join(e){return Bn(this).join(e)},lastIndexOf(...e){return Hr(this,"lastIndexOf",e)},map(e,t){return Ht(this,"map",e,t,void 0,arguments)},pop(){return ao(this,"pop")},push(...e){return ao(this,"push",e)},reduce(e,...t){return Pl(this,"reduce",e,t)},reduceRight(e,...t){return Pl(this,"reduceRight",e,t)},shift(){return ao(this,"shift")},some(e,t){return Ht(this,"some",e,t,void 0,arguments)},splice(...e){return ao(this,"splice",e)},toReversed(){return Bn(this).toReversed()},toSorted(e){return Bn(this).toSorted(e)},toSpliced(...e){return Bn(this).toSpliced(...e)},unshift(...e){return ao(this,"unshift",e)},values(){return Br(this,"values",e=>Mt(this,e))}};function Br(e,t,n){const o=hr(e),i=o[t]();return o!==e&&!st(e)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=n(r.value)),r}),i}const Md=Array.prototype;function Ht(e,t,n,o,i,r){const s=hr(e),l=s!==e&&!st(e),a=s[t];if(a!==Md[t]){const f=a.apply(e,r);return l?mt(f):f}let u=n;s!==e&&(l?u=function(f,d){return n.call(this,Mt(e,f),d,e)}:n.length>2&&(u=function(f,d){return n.call(this,f,d,e)}));const c=a.call(s,u,o);return l&&i?i(c):c}function Pl(e,t,n,o){const i=hr(e),r=i!==e&&!st(e);let s=n,l=!1;i!==e&&(r?(l=o.length===0,s=function(u,c,f){return l&&(l=!1,u=Mt(e,u)),n.call(this,u,Mt(e,c),f,e)}):n.length>3&&(s=function(u,c,f){return n.call(this,u,c,f,e)}));const a=i[t](s,...o);return l?Mt(e,a):a}function Hr(e,t,n){const o=Se(e);Ze(o,"iterate",Po);const i=o[t](...n);return(i===-1||i===!1)&&gr(n[0])?(n[0]=Se(n[0]),o[t](...n)):i}function ao(e,t,n=[]){qt(),Xs();const o=Se(e)[t].apply(e,n);return Ws(),jt(),o}const kd=Fs("__proto__,__v_isRef,__isVue"),Du=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(lt));function Td(e){lt(e)||(e=String(e));const t=Se(this);return Ze(t,"has",e),t.hasOwnProperty(e)}class Ou{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return o===(i?r?Vd:Hu:r?Bu:zu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const s=de(t);if(!i){let a;if(s&&(a=Cd[n]))return a;if(n==="hasOwnProperty")return Td}const l=Reflect.get(t,n,Be(t)?t:o);if((lt(n)?Du.has(n):kd(n))||(i||Ze(t,"get",n),r))return l;if(Be(l)){const a=s&&ar(n)?l:l.value;return i&&Me(a)?Ri(a):a}return Me(l)?i?Ri(l):pr(l):l}}class Ru extends Ou{constructor(t=!1){super(!1,t)}set(t,n,o,i){let r=t[n];const s=de(t)&&ar(n);if(!this._isShallow){const u=Jt(r);if(!st(o)&&!Jt(o)&&(r=Se(r),o=Se(o)),!s&&Be(r)&&!Be(o))return u||(r.value=o),!0}const l=s?Number(n)<t.length:Ne(t,n),a=Reflect.set(t,n,o,Be(t)?t:i);return t===Se(i)&&(l?ft(o,r)&&Gt(t,"set",n,o):Gt(t,"add",n,o)),a}deleteProperty(t,n){const o=Ne(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&o&&Gt(t,"delete",n,void 0),i}has(t,n){const o=Reflect.has(t,n);return(!lt(n)||!Du.has(n))&&Ze(t,"has",n),o}ownKeys(t){return Ze(t,"iterate",de(t)?"length":Cn),Reflect.ownKeys(t)}}class Id extends Ou{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Ad=new Ru,Pd=new Id,Dd=new Ru(!0);const as=e=>e,ri=e=>Reflect.getPrototypeOf(e);function Od(e,t,n){return function(...o){const i=this.__v_raw,r=Se(i),s=Gn(r),l=e==="entries"||e===Symbol.iterator&&s,a=e==="keys"&&s,u=i[e](...o),c=n?as:t?Jn:mt;return!t&&Ze(r,"iterate",a?ls:Cn),We(Object.create(u),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:l?[c(f[0]),c(f[1])]:c(f),done:d}}})}}function si(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Rd(e,t){const n={get(i){const r=this.__v_raw,s=Se(r),l=Se(i);e||(ft(i,l)&&Ze(s,"get",i),Ze(s,"get",l));const{has:a}=ri(s),u=t?as:e?Jn:mt;if(a.call(s,i))return u(r.get(i));if(a.call(s,l))return u(r.get(l));r!==s&&r.get(i)},get size(){const i=this.__v_raw;return!e&&Ze(Se(i),"iterate",Cn),i.size},has(i){const r=this.__v_raw,s=Se(r),l=Se(i);return e||(ft(i,l)&&Ze(s,"has",i),Ze(s,"has",l)),i===l?r.has(i):r.has(i)||r.has(l)},forEach(i,r){const s=this,l=s.__v_raw,a=Se(l),u=t?as:e?Jn:mt;return!e&&Ze(a,"iterate",Cn),l.forEach((c,f)=>i.call(r,u(c),u(f),s))}};return We(n,e?{add:si("add"),set:si("set"),delete:si("delete"),clear:si("clear")}:{add(i){const r=Se(this),s=ri(r),l=Se(i),a=!t&&!st(i)&&!Jt(i)?l:i;return s.has.call(r,a)||ft(i,a)&&s.has.call(r,i)||ft(l,a)&&s.has.call(r,l)||(r.add(a),Gt(r,"add",a,a)),this},set(i,r){!t&&!st(r)&&!Jt(r)&&(r=Se(r));const s=Se(this),{has:l,get:a}=ri(s);let u=l.call(s,i);u||(i=Se(i),u=l.call(s,i));const c=a.call(s,i);return s.set(i,r),u?ft(r,c)&&Gt(s,"set",i,r):Gt(s,"add",i,r),this},delete(i){const r=Se(this),{has:s,get:l}=ri(r);let a=s.call(r,i);a||(i=Se(i),a=s.call(r,i)),l&&l.call(r,i);const u=r.delete(i);return a&&Gt(r,"delete",i,void 0),u},clear(){const i=Se(this),r=i.size!==0,s=i.clear();return r&&Gt(i,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Od(i,e,t)}),n}function Zs(e,t){const n=Rd(e,t);return(o,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?o:Reflect.get(Ne(n,i)&&i in o?n:o,i,r)}const zd={get:Zs(!1,!1)},Bd={get:Zs(!1,!0)},Hd={get:Zs(!0,!1)};const zu=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,Vd=new WeakMap;function Fd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ld(e){return e.__v_skip||!Object.isExtensible(e)?0:Fd(hd(e))}function pr(e){return Jt(e)?e:qs(e,!1,Ad,zd,zu)}function Yd(e){return qs(e,!1,Dd,Bd,Bu)}function Ri(e){return qs(e,!0,Pd,Hd,Hu)}function qs(e,t,n,o,i){if(!Me(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Ld(e);if(r===0)return e;const s=i.get(e);if(s)return s;const l=new Proxy(e,r===2?o:n);return i.set(e,l),l}function Mn(e){return Jt(e)?Mn(e.__v_raw):!!(e&&e.__v_isReactive)}function Jt(e){return!!(e&&e.__v_isReadonly)}function st(e){return!!(e&&e.__v_isShallow)}function gr(e){return e?!!e.__v_raw:!1}function Se(e){const t=e&&e.__v_raw;return t?Se(t):e}function Eo(e){return!Ne(e,"__v_skip")&&Object.isExtensible(e)&&wu(e,"__v_skip",!0),e}const mt=e=>Me(e)?pr(e):e,Jn=e=>Me(e)?Ri(e):e;function Be(e){return e?e.__v_isRef===!0:!1}function ye(e){return Vu(e,!1)}function dn(e){return Vu(e,!0)}function Vu(e,t){return Be(e)?e:new Gd(e,t)}class Gd{constructor(t,n){this.dep=new dr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Se(t),this._value=n?t:mt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||st(t)||Jt(t);t=o?t:Se(t),ft(t,n)&&(this._rawValue=t,this._value=o?t:mt(t),this.dep.trigger())}}function Z(e){return Be(e)?e.value:e}function _e(e){return pe(e)?e():Z(e)}const Ud={get:(e,t,n)=>t==="__v_raw"?e:Z(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return Be(i)&&!Be(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function Fu(e){return Mn(e)?e:new Proxy(e,Ud)}class Xd{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new dr,{get:o,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Wd(e){return new Xd(e)}function Kd(e){const t=de(e)?new Array(e.length):{};for(const n in e)t[n]=Lu(e,n);return t}class Zd{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=lt(n)?n:String(n),this._raw=Se(t);let i=!0,r=t;if(!de(t)||lt(this._key)||!ar(this._key))do i=!gr(r)||st(r);while(i&&(r=r.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=Z(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Be(this._raw[this._key])){const n=this._object[this._key];if(Be(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Nd(this._raw,this._key)}}class qd{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ee(e,t,n){return Be(e)?e:pe(e)?new qd(e):Me(e)&&arguments.length>1?Lu(e,t,n):ye(e)}function Lu(e,t,n){return new Zd(e,t,n)}class jd{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new dr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ao-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&De!==this)return Mu(this,!0),!0}get value(){const t=this.dep.track();return Iu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Jd(e,t,n=!1){let o,i;return pe(e)?o=e:(o=e.get,i=e.set),new jd(o,i,n)}const li={},zi=new WeakMap;let wn;function Qd(e,t=!1,n=wn){if(n){let o=zi.get(n);o||zi.set(n,o=[]),o.push(e)}}function eh(e,t,n=Ie){const{immediate:o,deep:i,once:r,scheduler:s,augmentJob:l,call:a}=n,u=M=>i?M:st(M)||i===!1||i===0?Ut(M,1):Ut(M);let c,f,d,h,E=!1,b=!1;if(Be(e)?(f=()=>e.value,E=st(e)):Mn(e)?(f=()=>u(e),E=!0):de(e)?(b=!0,E=e.some(M=>Mn(M)||st(M)),f=()=>e.map(M=>{if(Be(M))return M.value;if(Mn(M))return u(M);if(pe(M))return a?a(M,2):M()})):pe(e)?t?f=a?()=>a(e,2):e:f=()=>{if(d){qt();try{d()}finally{jt()}}const M=wn;wn=c;try{return a?a(e,3,[h]):e(h)}finally{wn=M}}:f=At,t&&i){const M=f,B=i===!0?1/0:i;f=()=>Ut(M(),B)}const C=Us(),w=()=>{c.stop(),C&&C.active&&Ls(C.effects,c)};if(r&&t){const M=t;t=(...B)=>{M(...B),w()}}let k=b?new Array(e.length).fill(li):li;const $=M=>{if(!(!(c.flags&1)||!c.dirty&&!M))if(t){const B=c.run();if(i||E||(b?B.some((G,F)=>ft(G,k[F])):ft(B,k))){d&&d();const G=wn;wn=c;try{const F=[B,k===li?void 0:b&&k[0]===li?[]:k,h];k=B,a?a(t,3,F):t(...F)}finally{wn=G}}}else c.run()};return l&&l($),c=new Nu(f),c.scheduler=s?()=>s($,!1):$,h=M=>Qd(M,!1,c),d=c.onStop=()=>{const M=zi.get(c);if(M){if(a)a(M,4);else for(const B of M)B();zi.delete(c)}},t?o?$(!0):k=c.run():s?s($.bind(null,!0),!0):c.run(),w.pause=c.pause.bind(c),w.resume=c.resume.bind(c),w.stop=w,w}function Ut(e,t=1/0,n){if(t<=0||!Me(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Be(e))Ut(e.value,t,n);else if(de(e))for(let o=0;o<e.length;o++)Ut(e[o],t,n);else if(vu(e)||Gn(e))e.forEach(o=>{Ut(o,t,n)});else if(_u(e)){for(const o in e)Ut(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Ut(e[o],t,n)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.32
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function Jo(e,t,n,o){try{return o?e(...o):e()}catch(i){vr(i,t,n)}}function Rt(e,t,n,o){if(pe(e)){const i=Jo(e,t,n,o);return i&&mu(i)&&i.catch(r=>{vr(r,t,n)}),i}if(de(e)){const i=[];for(let r=0;r<e.length;r++)i.push(Rt(e[r],t,n,o));return i}}function vr(e,t,n,o=!0){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Ie;if(t){let l=t.parent;const a=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,a,u)===!1)return}l=l.parent}if(r){qt(),Jo(r,null,10,[e,a,u]),jt();return}}th(e,n,i,o,s)}function th(e,t,n,o=!0,i=!1){if(i)throw e;console.error(e)}const Je=[];let Nt=-1;const Un=[];let an=null,Fn=0;const Yu=Promise.resolve();let Bi=null;function Pt(e){const t=Bi||Yu;return e?t.then(this?e.bind(this):e):t}function nh(e){let t=Nt+1,n=Je.length;for(;t<n;){const o=t+n>>>1,i=Je[o],r=Do(i);r<e||r===e&&i.flags&2?t=o+1:n=o}return t}function js(e){if(!(e.flags&1)){const t=Do(e),n=Je[Je.length-1];!n||!(e.flags&2)&&t>=Do(n)?Je.push(e):Je.splice(nh(t),0,e),e.flags|=1,Gu()}}function Gu(){Bi||(Bi=Yu.then(Xu))}function oh(e){de(e)?Un.push(...e):an&&e.id===-1?an.splice(Fn+1,0,e):e.flags&1||(Un.push(e),e.flags|=1),Gu()}function Dl(e,t,n=Nt+1){for(;n<Je.length;n++){const o=Je[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Je.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Uu(e){if(Un.length){const t=[...new Set(Un)].sort((n,o)=>Do(n)-Do(o));if(Un.length=0,an){an.push(...t);return}for(an=t,Fn=0;Fn<an.length;Fn++){const n=an[Fn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}an=null,Fn=0}}const Do=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Xu(e){try{for(Nt=0;Nt<Je.length;Nt++){const t=Je[Nt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Jo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Nt<Je.length;Nt++){const t=Je[Nt];t&&(t.flags&=-2)}Nt=-1,Je.length=0,Uu(),Bi=null,(Je.length||Un.length)&&Xu()}}let Ue=null,Wu=null;function Hi(e){const t=Ue;return Ue=e,Wu=e&&e.type.__scopeId||null,t}function dt(e,t=Ue,n){if(!t||e._n)return e;const o=(...i)=>{o._d&&Li(-1);const r=Hi(t);let s;try{s=e(...i)}finally{Hi(r),o._d&&Li(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Ku(e,t){if(Ue===null)return e;const n=wr(Ue),o=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[r,s,l,a=Ie]=t[i];r&&(pe(r)&&(r={mounted:r,updated:r}),r.deep&&Ut(s),o.push({dir:r,instance:n,value:s,oldValue:void 0,arg:l,modifiers:a}))}return e}function yn(e,t,n,o){const i=e.dirs,r=t&&t.dirs;for(let s=0;s<i.length;s++){const l=i[s];r&&(l.oldValue=r[s].value);let a=l.dir[o];a&&(qt(),Rt(a,n,8,[e.el,l,e,t]),jt())}}function Qt(e,t){if(qe){let n=qe.provides;const o=qe.parent&&qe.parent.provides;o===n&&(n=qe.provides=Object.create(o)),n[e]=t}}function ct(e,t,n=!1){const o=vn();if(o||Wn){let i=Wn?Wn._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&pe(t)?t.call(o&&o.proxy):t}}const ih=Symbol.for("v-scx"),rh=()=>ct(ih);function sh(e,t){return Js(e,null,t)}function xe(e,t,n){return Js(e,t,n)}function Js(e,t,n=Ie){const{immediate:o,deep:i,flush:r,once:s}=n,l=We({},n),a=t&&o||!t&&r!=="post";let u;if(zo){if(r==="sync"){const h=rh();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=At,h.resume=At,h.pause=At,h}}const c=qe;l.call=(h,E,b)=>Rt(h,c,E,b);let f=!1;r==="post"?l.scheduler=h=>{nt(h,c&&c.suspense)}:r!=="sync"&&(f=!0,l.scheduler=(h,E)=>{E?h():js(h)}),l.augmentJob=h=>{t&&(h.flags|=4),f&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const d=eh(e,t,l);return zo&&(u?u.push(d):a&&d()),d}function lh(e,t,n){const o=this.proxy,i=He(e)?e.includes(".")?Zu(o,e):()=>o[e]:e.bind(o,o);let r;pe(t)?r=t:(r=t.handler,n=t);const s=Qo(this),l=Js(i,r.bind(o),n);return s(),l}function Zu(e,t){const n=t.split(".");return()=>{let o=e;for(let i=0;i<n.length&&o;i++)o=o[n[i]];return o}}const ah=Symbol("_vte"),uh=e=>e.__isTeleport,ch=Symbol("_leaveCb");function Qs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Qs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Pe(e,t){return pe(e)?We({name:e.name},t,{setup:e}):e}function qu(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ol(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vi=new WeakMap;function No(e,t,n,o,i=!1){if(de(e)){e.forEach((b,C)=>No(b,t&&(de(t)?t[C]:t),n,o,i));return}if(Xn(o)&&!i){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&No(e,t,n,o.component.subTree);return}const r=o.shapeFlag&4?wr(o.component):o.el,s=i?null:r,{i:l,r:a}=e,u=t&&t.r,c=l.refs===Ie?l.refs={}:l.refs,f=l.setupState,d=Se(f),h=f===Ie?gu:b=>Ol(c,b)?!1:Ne(d,b),E=(b,C)=>!(C&&Ol(c,C));if(u!=null&&u!==a){if(Rl(t),He(u))c[u]=null,h(u)&&(f[u]=null);else if(Be(u)){const b=t;E(u,b.k)&&(u.value=null),b.k&&(c[b.k]=null)}}if(pe(a))Jo(a,l,12,[s,c]);else{const b=He(a),C=Be(a);if(b||C){const w=()=>{if(e.f){const k=b?h(a)?f[a]:c[a]:E()||!e.k?a.value:c[e.k];if(i)de(k)&&Ls(k,r);else if(de(k))k.includes(r)||k.push(r);else if(b)c[a]=[r],h(a)&&(f[a]=c[a]);else{const $=[r];E(a,e.k)&&(a.value=$),e.k&&(c[e.k]=$)}}else b?(c[a]=s,h(a)&&(f[a]=s)):C&&(E(a,e.k)&&(a.value=s),e.k&&(c[e.k]=s))};if(s){const k=()=>{w(),Vi.delete(e)};k.id=-1,Vi.set(e,k),nt(k,n)}else Rl(e),w()}}}function Rl(e){const t=Vi.get(e);t&&(t.flags|=8,Vi.delete(e))}fr().requestIdleCallback;fr().cancelIdleCallback;const Xn=e=>!!e.type.__asyncLoader,ju=e=>e.type.__isKeepAlive;function fh(e,t){Ju(e,"a",t)}function dh(e,t){Ju(e,"da",t)}function Ju(e,t,n=qe){const o=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(mr(t,o,n),n){let i=n.parent;for(;i&&i.parent;)ju(i.parent.vnode)&&hh(o,t,n,i),i=i.parent}}function hh(e,t,n,o){const i=mr(t,e,o,!0);tl(()=>{Ls(o[t],i)},n)}function mr(e,t,n=qe,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...s)=>{qt();const l=Qo(n),a=Rt(t,n,e,s);return l(),jt(),a});return o?i.unshift(r):i.push(r),r}}const on=e=>(t,n=qe)=>{(!zo||e==="sp")&&mr(e,(...o)=>t(...o),n)},Qu=on("bm"),_t=on("m"),ph=on("bu"),gh=on("u"),el=on("bum"),tl=on("um"),vh=on("sp"),mh=on("rtg"),yh=on("rtc");function _h(e,t=qe){mr("ec",e,t)}const ec="components";function tc(e,t){return oc(ec,e,!0,t)||e}const nc=Symbol.for("v-ndc");function bn(e){return He(e)?oc(ec,e,!1)||e:e||nc}function oc(e,t,n=!0,o=!1){const i=Ue||qe;if(i){const r=i.type;{const l=np(r,!1);if(l&&(l===t||l===et(t)||l===cr(et(t))))return r}const s=zl(i[e]||r[e],t)||zl(i.appContext[e],t);return!s&&o?r:s}}function zl(e,t){return e&&(e[t]||e[et(t)]||e[cr(et(t))])}function yt(e,t,n,o){let i;const r=n&&n[o],s=de(e);if(s||He(e)){const l=s&&Mn(e);let a=!1,u=!1;l&&(a=!st(e),u=Jt(e),e=hr(e)),i=new Array(e.length);for(let c=0,f=e.length;c<f;c++)i[c]=t(a?u?Jn(mt(e[c])):mt(e[c]):e[c],c,void 0,r&&r[c])}else if(typeof e=="number"){i=new Array(e);for(let l=0;l<e;l++)i[l]=t(l+1,l,void 0,r&&r[l])}else if(Me(e))if(e[Symbol.iterator])i=Array.from(e,(l,a)=>t(l,a,void 0,r&&r[a]));else{const l=Object.keys(e);i=new Array(l.length);for(let a=0,u=l.length;a<u;a++){const c=l[a];i[a]=t(e[c],c,a,r&&r[a])}}else i=[];return n&&(n[o]=i),i}function Re(e,t,n={},o,i){if(Ue.ce||Ue.parent&&Xn(Ue.parent)&&Ue.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),K(),Ve(be,null,[me("slot",n,o&&o())],u?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),K();const s=r&&ic(r(n)),l=n.key||s&&s.key,a=Ve(be,{key:(l&&!lt(l)?l:`_${t}`)+(!s&&o?"_fb":"")},s||(o?o():[]),s&&e._===1?64:-2);return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function ic(e){return e.some(t=>Oo(t)?!(t.type===en||t.type===be&&!ic(t.children)):!0)?e:null}const us=e=>e?Nc(e)?wr(e):us(e.parent):null,Co=We(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>us(e.parent),$root:e=>us(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ac(e),$forceUpdate:e=>e.f||(e.f=()=>{js(e.update)}),$nextTick:e=>e.n||(e.n=Pt.bind(e.proxy)),$watch:e=>lh.bind(e)}),Vr=(e,t)=>e!==Ie&&!e.__isScriptSetup&&Ne(e,t),wh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:i,props:r,accessCache:s,type:l,appContext:a}=e;if(t[0]!=="$"){const d=s[t];if(d!==void 0)switch(d){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(Vr(o,t))return s[t]=1,o[t];if(i!==Ie&&Ne(i,t))return s[t]=2,i[t];if(Ne(r,t))return s[t]=3,r[t];if(n!==Ie&&Ne(n,t))return s[t]=4,n[t];cs&&(s[t]=0)}}const u=Co[t];let c,f;if(u)return t==="$attrs"&&Ze(e.attrs,"get",""),u(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==Ie&&Ne(n,t))return s[t]=4,n[t];if(f=a.config.globalProperties,Ne(f,t))return f[t]},set({_:e},t,n){const{data:o,setupState:i,ctx:r}=e;return Vr(i,t)?(i[t]=n,!0):o!==Ie&&Ne(o,t)?(o[t]=n,!0):Ne(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,props:r,type:s}},l){let a;return!!(n[l]||e!==Ie&&l[0]!=="$"&&Ne(e,l)||Vr(t,l)||Ne(r,l)||Ne(o,l)||Ne(Co,l)||Ne(i.config.globalProperties,l)||(a=s.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ne(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function rc(){return sc().slots}function nl(){return sc().attrs}function sc(e){const t=vn();return t.setupContext||(t.setupContext=Mc(t))}function Bl(e){return de(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function bh(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}let cs=!0;function xh(e){const t=ac(e),n=e.proxy,o=e.ctx;cs=!1,t.beforeCreate&&Hl(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:s,watch:l,provide:a,inject:u,created:c,beforeMount:f,mounted:d,beforeUpdate:h,updated:E,activated:b,deactivated:C,beforeDestroy:w,beforeUnmount:k,destroyed:$,unmounted:M,render:B,renderTracked:G,renderTriggered:F,errorCaptured:X,serverPrefetch:ne,expose:W,inheritAttrs:q,components:I,directives:re,filters:g}=t;if(u&&$h(u,o,null),s)for(const A in s){const T=s[A];pe(T)&&(o[A]=T.bind(n))}if(i){const A=i.call(n,n);Me(A)&&(e.data=pr(A))}if(cs=!0,r)for(const A in r){const T=r[A],H=pe(T)?T.bind(n,n):pe(T.get)?T.get.bind(n,n):At,D=!pe(T)&&pe(T.set)?T.set.bind(n):At,Y=ce({get:H,set:D});Object.defineProperty(o,A,{enumerable:!0,configurable:!0,get:()=>Y.value,set:J=>Y.value=J})}if(l)for(const A in l)lc(l[A],o,n,A);if(a){const A=pe(a)?a.call(n):a;Reflect.ownKeys(A).forEach(T=>{Qt(T,A[T])})}c&&Hl(c,e,"c");function _(A,T){de(T)?T.forEach(H=>A(H.bind(n))):T&&A(T.bind(n))}if(_(Qu,f),_(_t,d),_(ph,h),_(gh,E),_(fh,b),_(dh,C),_(_h,X),_(yh,G),_(mh,F),_(el,k),_(tl,M),_(vh,ne),de(W))if(W.length){const A=e.exposed||(e.exposed={});W.forEach(T=>{Object.defineProperty(A,T,{get:()=>n[T],set:H=>n[T]=H,enumerable:!0})})}else e.exposed||(e.exposed={});B&&e.render===At&&(e.render=B),q!=null&&(e.inheritAttrs=q),I&&(e.components=I),re&&(e.directives=re),ne&&qu(e)}function $h(e,t,n=At){de(e)&&(e=fs(e));for(const o in e){const i=e[o];let r;Me(i)?"default"in i?r=ct(i.from||o,i.default,!0):r=ct(i.from||o):r=ct(i),Be(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:s=>r.value=s}):t[o]=r}}function Hl(e,t,n){Rt(de(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function lc(e,t,n,o){let i=o.includes(".")?Zu(n,o):()=>n[o];if(He(e)){const r=t[e];pe(r)&&xe(i,r)}else if(pe(e))xe(i,e.bind(n));else if(Me(e))if(de(e))e.forEach(r=>lc(r,t,n,o));else{const r=pe(e.handler)?e.handler.bind(n):t[e.handler];pe(r)&&xe(i,r,e)}}function ac(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,l=r.get(t);let a;return l?a=l:!i.length&&!n&&!o?a=t:(a={},i.length&&i.forEach(u=>Fi(a,u,s,!0)),Fi(a,t,s)),Me(t)&&r.set(t,a),a}function Fi(e,t,n,o=!1){const{mixins:i,extends:r}=t;r&&Fi(e,r,n,!0),i&&i.forEach(s=>Fi(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const l=Sh[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const Sh={data:Vl,props:Fl,emits:Fl,methods:vo,computed:vo,beforeCreate:je,created:je,beforeMount:je,mounted:je,beforeUpdate:je,updated:je,beforeDestroy:je,beforeUnmount:je,destroyed:je,unmounted:je,activated:je,deactivated:je,errorCaptured:je,serverPrefetch:je,components:vo,directives:vo,watch:Nh,provide:Vl,inject:Eh};function Vl(e,t){return t?e?function(){return We(pe(e)?e.call(this,this):e,pe(t)?t.call(this,this):t)}:t:e}function Eh(e,t){return vo(fs(e),fs(t))}function fs(e){if(de(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function je(e,t){return e?[...new Set([].concat(e,t))]:t}function vo(e,t){return e?We(Object.create(null),e,t):t}function Fl(e,t){return e?de(e)&&de(t)?[...new Set([...e,...t])]:We(Object.create(null),Bl(e),Bl(t??{})):t}function Nh(e,t){if(!e)return t;if(!t)return e;const n=We(Object.create(null),e);for(const o in t)n[o]=je(e[o],t[o]);return n}function uc(){return{app:null,config:{isNativeTag:gu,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ch=0;function Mh(e,t){return function(o,i=null){pe(o)||(o=We({},o)),i!=null&&!Me(i)&&(i=null);const r=uc(),s=new WeakSet,l=[];let a=!1;const u=r.app={_uid:Ch++,_component:o,_props:i,_container:null,_context:r,_instance:null,version:rp,get config(){return r.config},set config(c){},use(c,...f){return s.has(c)||(c&&pe(c.install)?(s.add(c),c.install(u,...f)):pe(c)&&(s.add(c),c(u,...f))),u},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),u},component(c,f){return f?(r.components[c]=f,u):r.components[c]},directive(c,f){return f?(r.directives[c]=f,u):r.directives[c]},mount(c,f,d){if(!a){const h=u._ceVNode||me(o,i);return h.appContext=r,d===!0?d="svg":d===!1&&(d=void 0),e(h,c,d),a=!0,u._container=c,c.__vue_app__=u,wr(h.component)}},onUnmount(c){l.push(c)},unmount(){a&&(Rt(l,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return r.provides[c]=f,u},runWithContext(c){const f=Wn;Wn=u;try{return c()}finally{Wn=f}}};return u}}let Wn=null;const kh=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${et(t)}Modifiers`]||e[`${zn(t)}Modifiers`];function Th(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Ie;let i=n;const r=t.startsWith("update:"),s=r&&kh(o,t.slice(7));s&&(s.trim&&(i=n.map(c=>He(c)?c.trim():c)),s.number&&(i=n.map(Ys)));let l,a=o[l=Or(t)]||o[l=Or(et(t))];!a&&r&&(a=o[l=Or(zn(t))]),a&&Rt(a,e,6,i);const u=o[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Rt(u,e,6,i)}}const Ih=new WeakMap;function cc(e,t,n=!1){const o=n?Ih:t.emitsCache,i=o.get(e);if(i!==void 0)return i;const r=e.emits;let s={},l=!1;if(!pe(e)){const a=u=>{const c=cc(u,t,!0);c&&(l=!0,We(s,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(Me(e)&&o.set(e,null),null):(de(r)?r.forEach(a=>s[a]=null):We(s,r),Me(e)&&o.set(e,s),s)}function yr(e,t){return!e||!sr(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ne(e,t[0].toLowerCase()+t.slice(1))||Ne(e,zn(t))||Ne(e,t))}function Ll(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[r],slots:s,attrs:l,emit:a,render:u,renderCache:c,props:f,data:d,setupState:h,ctx:E,inheritAttrs:b}=e,C=Hi(e);let w,k;try{if(n.shapeFlag&4){const M=i||o,B=M;w=kt(u.call(B,M,c,f,h,d,E)),k=l}else{const M=t;w=kt(M.length>1?M(f,{attrs:l,slots:s,emit:a}):M(f,null)),k=t.props?l:Ah(l)}}catch(M){Mo.length=0,vr(M,e,1),w=me(en)}let $=w;if(k&&b!==!1){const M=Object.keys(k),{shapeFlag:B}=$;M.length&&B&7&&(r&&M.some(lr)&&(k=Ph(k,r)),$=eo($,k,!1,!0))}return n.dirs&&($=eo($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&Qs($,n.transition),w=$,Hi(C),w}const Ah=e=>{let t;for(const n in e)(n==="class"||n==="style"||sr(n))&&((t||(t={}))[n]=e[n]);return t},Ph=(e,t)=>{const n={};for(const o in e)(!lr(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function Dh(e,t,n){const{props:o,children:i,component:r}=e,{props:s,children:l,patchFlag:a}=t,u=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?Yl(o,s,u):!!s;if(a&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const d=c[f];if(fc(s,o,d)&&!yr(u,d))return!0}}}else return(i||l)&&(!l||!l.$stable)?!0:o===s?!1:o?s?Yl(o,s,u):!0:!!s;return!1}function Yl(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let i=0;i<o.length;i++){const r=o[i];if(fc(t,e,r)&&!yr(n,r))return!0}return!1}function fc(e,t,n){const o=e[n],i=t[n];return n==="style"&&Me(o)&&Me(i)?!Gs(o,i):o!==i}function Oh({vnode:e,parent:t,suspense:n},o){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=o,e=i),i===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const dc={},hc=()=>Object.create(dc),pc=e=>Object.getPrototypeOf(e)===dc;function Rh(e,t,n,o=!1){const i={},r=hc();e.propsDefaults=Object.create(null),gc(e,t,i,r);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=o?i:Yd(i):e.type.props?e.props=i:e.props=r,e.attrs=r}function zh(e,t,n,o){const{props:i,attrs:r,vnode:{patchFlag:s}}=e,l=Se(i),[a]=e.propsOptions;let u=!1;if((o||s>0)&&!(s&16)){if(s&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let d=c[f];if(yr(e.emitsOptions,d))continue;const h=t[d];if(a)if(Ne(r,d))h!==r[d]&&(r[d]=h,u=!0);else{const E=et(d);i[E]=ds(a,l,E,h,e,!1)}else h!==r[d]&&(r[d]=h,u=!0)}}}else{gc(e,t,i,r)&&(u=!0);let c;for(const f in l)(!t||!Ne(t,f)&&((c=zn(f))===f||!Ne(t,c)))&&(a?n&&(n[f]!==void 0||n[c]!==void 0)&&(i[f]=ds(a,l,f,void 0,e,!0)):delete i[f]);if(r!==l)for(const f in r)(!t||!Ne(t,f))&&(delete r[f],u=!0)}u&&Gt(e.attrs,"set","")}function gc(e,t,n,o){const[i,r]=e.propsOptions;let s=!1,l;if(t)for(let a in t){if(xo(a))continue;const u=t[a];let c;i&&Ne(i,c=et(a))?!r||!r.includes(c)?n[c]=u:(l||(l={}))[c]=u:yr(e.emitsOptions,a)||(!(a in o)||u!==o[a])&&(o[a]=u,s=!0)}if(r){const a=Se(n),u=l||Ie;for(let c=0;c<r.length;c++){const f=r[c];n[f]=ds(i,a,f,u[f],e,!Ne(u,f))}}return s}function ds(e,t,n,o,i,r){const s=e[n];if(s!=null){const l=Ne(s,"default");if(l&&o===void 0){const a=s.default;if(s.type!==Function&&!s.skipFactory&&pe(a)){const{propsDefaults:u}=i;if(n in u)o=u[n];else{const c=Qo(i);o=u[n]=a.call(null,t),c()}}else o=a;i.ce&&i.ce._setProp(n,o)}s[0]&&(r&&!l?o=!1:s[1]&&(o===""||o===zn(n))&&(o=!0))}return o}const Bh=new WeakMap;function vc(e,t,n=!1){const o=n?Bh:t.propsCache,i=o.get(e);if(i)return i;const r=e.props,s={},l=[];let a=!1;if(!pe(e)){const c=f=>{a=!0;const[d,h]=vc(f,t,!0);We(s,d),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!a)return Me(e)&&o.set(e,Yn),Yn;if(de(r))for(let c=0;c<r.length;c++){const f=et(r[c]);Gl(f)&&(s[f]=Ie)}else if(r)for(const c in r){const f=et(c);if(Gl(f)){const d=r[c],h=s[f]=de(d)||pe(d)?{type:d}:We({},d),E=h.type;let b=!1,C=!0;if(de(E))for(let w=0;w<E.length;++w){const k=E[w],$=pe(k)&&k.name;if($==="Boolean"){b=!0;break}else $==="String"&&(C=!1)}else b=pe(E)&&E.name==="Boolean";h[0]=b,h[1]=C,(b||Ne(h,"default"))&&l.push(f)}}const u=[s,l];return Me(e)&&o.set(e,u),u}function Gl(e){return e[0]!=="$"&&!xo(e)}const ol=e=>e==="_"||e==="_ctx"||e==="$stable",il=e=>de(e)?e.map(kt):[kt(e)],Hh=(e,t,n)=>{if(t._n)return t;const o=dt((...i)=>il(t(...i)),n);return o._c=!1,o},mc=(e,t,n)=>{const o=e._ctx;for(const i in e){if(ol(i))continue;const r=e[i];if(pe(r))t[i]=Hh(i,r,o);else if(r!=null){const s=il(r);t[i]=()=>s}}},yc=(e,t)=>{const n=il(t);e.slots.default=()=>n},_c=(e,t,n)=>{for(const o in t)(n||!ol(o))&&(e[o]=t[o])},Vh=(e,t,n)=>{const o=e.slots=hc();if(e.vnode.shapeFlag&32){const i=t._;i?(_c(o,t,n),n&&wu(o,"_",i,!0)):mc(t,o)}else t&&yc(e,t)},Fh=(e,t,n)=>{const{vnode:o,slots:i}=e;let r=!0,s=Ie;if(o.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:_c(i,t,n):(r=!t.$stable,mc(t,i)),s=t}else t&&(yc(e,t),s={default:1});if(r)for(const l in i)!ol(l)&&s[l]==null&&delete i[l]},nt=Xh;function Lh(e){return Yh(e)}function Yh(e,t){const n=fr();n.__VUE__=!0;const{insert:o,remove:i,patchProp:r,createElement:s,createText:l,createComment:a,setText:u,setElementText:c,parentNode:f,nextSibling:d,setScopeId:h=At,insertStaticContent:E}=e,b=(y,N,p,v=null,m=null,x=null,S=void 0,z=null,R=!!N.dynamicChildren)=>{if(y===N)return;y&&!uo(y,N)&&(v=ie(y),J(y,m,x,!0),y=null),N.patchFlag===-2&&(R=!1,N.dynamicChildren=null);const{type:O,ref:L,shapeFlag:V}=N;switch(O){case _r:C(y,N,p,v);break;case en:w(y,N,p,v);break;case Lr:y==null&&k(N,p,v,S);break;case be:I(y,N,p,v,m,x,S,z,R);break;default:V&1?B(y,N,p,v,m,x,S,z,R):V&6?re(y,N,p,v,m,x,S,z,R):(V&64||V&128)&&O.process(y,N,p,v,m,x,S,z,R,he)}L!=null&&m?No(L,y&&y.ref,x,N||y,!N):L==null&&y&&y.ref!=null&&No(y.ref,null,x,y,!0)},C=(y,N,p,v)=>{if(y==null)o(N.el=l(N.children),p,v);else{const m=N.el=y.el;N.children!==y.children&&u(m,N.children)}},w=(y,N,p,v)=>{y==null?o(N.el=a(N.children||""),p,v):N.el=y.el},k=(y,N,p,v)=>{[y.el,y.anchor]=E(y.children,N,p,v,y.el,y.anchor)},$=({el:y,anchor:N},p,v)=>{let m;for(;y&&y!==N;)m=d(y),o(y,p,v),y=m;o(N,p,v)},M=({el:y,anchor:N})=>{let p;for(;y&&y!==N;)p=d(y),i(y),y=p;i(N)},B=(y,N,p,v,m,x,S,z,R)=>{if(N.type==="svg"?S="svg":N.type==="math"&&(S="mathml"),y==null)G(N,p,v,m,x,S,z,R);else{const O=y.el&&y.el._isVueCE?y.el:null;try{O&&O._beginPatch(),ne(y,N,m,x,S,z,R)}finally{O&&O._endPatch()}}},G=(y,N,p,v,m,x,S,z)=>{let R,O;const{props:L,shapeFlag:V,transition:j,dirs:oe}=y;if(R=y.el=s(y.type,x,L&&L.is,L),V&8?c(R,y.children):V&16&&X(y.children,R,null,v,m,Fr(y,x),S,z),oe&&yn(y,null,v,"created"),F(R,y,y.scopeId,S,v),L){for(const ve in L)ve!=="value"&&!xo(ve)&&r(R,ve,null,L[ve],x,v);"value"in L&&r(R,"value",null,L.value,x),(O=L.onVnodeBeforeMount)&&Et(O,v,y)}oe&&yn(y,null,v,"beforeMount");const ge=Gh(m,j);ge&&j.beforeEnter(R),o(R,N,p),((O=L&&L.onVnodeMounted)||ge||oe)&&nt(()=>{try{O&&Et(O,v,y),ge&&j.enter(R),oe&&yn(y,null,v,"mounted")}finally{}},m)},F=(y,N,p,v,m)=>{if(p&&h(y,p),v)for(let x=0;x<v.length;x++)h(y,v[x]);if(m){let x=m.subTree;if(N===x||$c(x.type)&&(x.ssContent===N||x.ssFallback===N)){const S=m.vnode;F(y,S,S.scopeId,S.slotScopeIds,m.parent)}}},X=(y,N,p,v,m,x,S,z,R=0)=>{for(let O=R;O<y.length;O++){const L=y[O]=z?Yt(y[O]):kt(y[O]);b(null,L,N,p,v,m,x,S,z)}},ne=(y,N,p,v,m,x,S)=>{const z=N.el=y.el;let{patchFlag:R,dynamicChildren:O,dirs:L}=N;R|=y.patchFlag&16;const V=y.props||Ie,j=N.props||Ie;let oe;if(p&&_n(p,!1),(oe=j.onVnodeBeforeUpdate)&&Et(oe,p,N,y),L&&yn(N,y,p,"beforeUpdate"),p&&_n(p,!0),(V.innerHTML&&j.innerHTML==null||V.textContent&&j.textContent==null)&&c(z,""),O?W(y.dynamicChildren,O,z,p,v,Fr(N,m),x):S||T(y,N,z,null,p,v,Fr(N,m),x,!1),R>0){if(R&16)q(z,V,j,p,m);else if(R&2&&V.class!==j.class&&r(z,"class",null,j.class,m),R&4&&r(z,"style",V.style,j.style,m),R&8){const ge=N.dynamicProps;for(let ve=0;ve<ge.length;ve++){const Te=ge[ve],ze=V[Te],Ye=j[Te];(Ye!==ze||Te==="value")&&r(z,Te,ze,Ye,m,p)}}R&1&&y.children!==N.children&&c(z,N.children)}else!S&&O==null&&q(z,V,j,p,m);((oe=j.onVnodeUpdated)||L)&&nt(()=>{oe&&Et(oe,p,N,y),L&&yn(N,y,p,"updated")},v)},W=(y,N,p,v,m,x,S)=>{for(let z=0;z<N.length;z++){const R=y[z],O=N[z],L=R.el&&(R.type===be||!uo(R,O)||R.shapeFlag&198)?f(R.el):p;b(R,O,L,null,v,m,x,S,!0)}},q=(y,N,p,v,m)=>{if(N!==p){if(N!==Ie)for(const x in N)!xo(x)&&!(x in p)&&r(y,x,N[x],null,m,v);for(const x in p){if(xo(x))continue;const S=p[x],z=N[x];S!==z&&x!=="value"&&r(y,x,z,S,m,v)}"value"in p&&r(y,"value",N.value,p.value,m)}},I=(y,N,p,v,m,x,S,z,R)=>{const O=N.el=y?y.el:l(""),L=N.anchor=y?y.anchor:l("");let{patchFlag:V,dynamicChildren:j,slotScopeIds:oe}=N;oe&&(z=z?z.concat(oe):oe),y==null?(o(O,p,v),o(L,p,v),X(N.children||[],p,L,m,x,S,z,R)):V>0&&V&64&&j&&y.dynamicChildren&&y.dynamicChildren.length===j.length?(W(y.dynamicChildren,j,p,m,x,S,z),(N.key!=null||m&&N===m.subTree)&&wc(y,N,!0)):T(y,N,p,L,m,x,S,z,R)},re=(y,N,p,v,m,x,S,z,R)=>{N.slotScopeIds=z,y==null?N.shapeFlag&512?m.ctx.activate(N,p,v,S,R):g(N,p,v,m,x,S,R):P(y,N,R)},g=(y,N,p,v,m,x,S)=>{const z=y.component=Jh(y,v,m);if(ju(y)&&(z.ctx.renderer=he),Qh(z,!1,S),z.asyncDep){if(m&&m.registerDep(z,_,S),!y.el){const R=z.subTree=me(en);w(null,R,N,p),y.placeholder=R.el}}else _(z,y,N,p,m,x,S)},P=(y,N,p)=>{const v=N.component=y.component;if(Dh(y,N,p))if(v.asyncDep&&!v.asyncResolved){A(v,N,p);return}else v.next=N,v.update();else N.el=y.el,v.vnode=N},_=(y,N,p,v,m,x,S)=>{const z=()=>{if(y.isMounted){let{next:V,bu:j,u:oe,parent:ge,vnode:ve}=y;{const $t=bc(y);if($t){V&&(V.el=ve.el,A(y,V,S)),$t.asyncDep.then(()=>{nt(()=>{y.isUnmounted||O()},m)});return}}let Te=V,ze;_n(y,!1),V?(V.el=ve.el,A(y,V,S)):V=ve,j&&xi(j),(ze=V.props&&V.props.onVnodeBeforeUpdate)&&Et(ze,ge,V,ve),_n(y,!0);const Ye=Ll(y),xt=y.subTree;y.subTree=Ye,b(xt,Ye,f(xt.el),ie(xt),y,m,x),V.el=Ye.el,Te===null&&Oh(y,Ye.el),oe&&nt(oe,m),(ze=V.props&&V.props.onVnodeUpdated)&&nt(()=>Et(ze,ge,V,ve),m)}else{let V;const{el:j,props:oe}=N,{bm:ge,m:ve,parent:Te,root:ze,type:Ye}=y,xt=Xn(N);_n(y,!1),ge&&xi(ge),!xt&&(V=oe&&oe.onVnodeBeforeMount)&&Et(V,Te,N),_n(y,!0);{ze.ce&&ze.ce._hasShadowRoot()&&ze.ce._injectChildStyle(Ye,y.parent?y.parent.type:void 0);const $t=y.subTree=Ll(y);b(null,$t,p,v,y,m,x),N.el=$t.el}if(ve&&nt(ve,m),!xt&&(V=oe&&oe.onVnodeMounted)){const $t=N;nt(()=>Et(V,Te,$t),m)}(N.shapeFlag&256||Te&&Xn(Te.vnode)&&Te.vnode.shapeFlag&256)&&y.a&&nt(y.a,m),y.isMounted=!0,N=p=v=null}};y.scope.on();const R=y.effect=new Nu(z);y.scope.off();const O=y.update=R.run.bind(R),L=y.job=R.runIfDirty.bind(R);L.i=y,L.id=y.uid,R.scheduler=()=>js(L),_n(y,!0),O()},A=(y,N,p)=>{N.component=y;const v=y.vnode.props;y.vnode=N,y.next=null,zh(y,N.props,v,p),Fh(y,N.children,p),qt(),Dl(y),jt()},T=(y,N,p,v,m,x,S,z,R=!1)=>{const O=y&&y.children,L=y?y.shapeFlag:0,V=N.children,{patchFlag:j,shapeFlag:oe}=N;if(j>0){if(j&128){D(O,V,p,v,m,x,S,z,R);return}else if(j&256){H(O,V,p,v,m,x,S,z,R);return}}oe&8?(L&16&&ee(O,m,x),V!==O&&c(p,V)):L&16?oe&16?D(O,V,p,v,m,x,S,z,R):ee(O,m,x,!0):(L&8&&c(p,""),oe&16&&X(V,p,v,m,x,S,z,R))},H=(y,N,p,v,m,x,S,z,R)=>{y=y||Yn,N=N||Yn;const O=y.length,L=N.length,V=Math.min(O,L);let j;for(j=0;j<V;j++){const oe=N[j]=R?Yt(N[j]):kt(N[j]);b(y[j],oe,p,null,m,x,S,z,R)}O>L?ee(y,m,x,!0,!1,V):X(N,p,v,m,x,S,z,R,V)},D=(y,N,p,v,m,x,S,z,R)=>{let O=0;const L=N.length;let V=y.length-1,j=L-1;for(;O<=V&&O<=j;){const oe=y[O],ge=N[O]=R?Yt(N[O]):kt(N[O]);if(uo(oe,ge))b(oe,ge,p,null,m,x,S,z,R);else break;O++}for(;O<=V&&O<=j;){const oe=y[V],ge=N[j]=R?Yt(N[j]):kt(N[j]);if(uo(oe,ge))b(oe,ge,p,null,m,x,S,z,R);else break;V--,j--}if(O>V){if(O<=j){const oe=j+1,ge=oe<L?N[oe].el:v;for(;O<=j;)b(null,N[O]=R?Yt(N[O]):kt(N[O]),p,ge,m,x,S,z,R),O++}}else if(O>j)for(;O<=V;)J(y[O],m,x,!0),O++;else{const oe=O,ge=O,ve=new Map;for(O=ge;O<=j;O++){const rt=N[O]=R?Yt(N[O]):kt(N[O]);rt.key!=null&&ve.set(rt.key,O)}let Te,ze=0;const Ye=j-ge+1;let xt=!1,$t=0;const lo=new Array(Ye);for(O=0;O<Ye;O++)lo[O]=0;for(O=oe;O<=V;O++){const rt=y[O];if(ze>=Ye){J(rt,m,x,!0);continue}let St;if(rt.key!=null)St=ve.get(rt.key);else for(Te=ge;Te<=j;Te++)if(lo[Te-ge]===0&&uo(rt,N[Te])){St=Te;break}St===void 0?J(rt,m,x,!0):(lo[St-ge]=O+1,St>=$t?$t=St:xt=!0,b(rt,N[St],p,null,m,x,S,z,R),ze++)}const Cl=xt?Uh(lo):Yn;for(Te=Cl.length-1,O=Ye-1;O>=0;O--){const rt=ge+O,St=N[rt],Ml=N[rt+1],kl=rt+1<L?Ml.el||xc(Ml):v;lo[O]===0?b(null,St,p,kl,m,x,S,z,R):xt&&(Te<0||O!==Cl[Te]?Y(St,p,kl,2):Te--)}}},Y=(y,N,p,v,m=null)=>{const{el:x,type:S,transition:z,children:R,shapeFlag:O}=y;if(O&6){Y(y.component.subTree,N,p,v);return}if(O&128){y.suspense.move(N,p,v);return}if(O&64){S.move(y,N,p,he);return}if(S===be){o(x,N,p);for(let V=0;V<R.length;V++)Y(R[V],N,p,v);o(y.anchor,N,p);return}if(S===Lr){$(y,N,p);return}if(v!==2&&O&1&&z)if(v===0)z.beforeEnter(x),o(x,N,p),nt(()=>z.enter(x),m);else{const{leave:V,delayLeave:j,afterLeave:oe}=z,ge=()=>{y.ctx.isUnmounted?i(x):o(x,N,p)},ve=()=>{x._isLeaving&&x[ch](!0),V(x,()=>{ge(),oe&&oe()})};j?j(x,ge,ve):ve()}else o(x,N,p)},J=(y,N,p,v=!1,m=!1)=>{const{type:x,props:S,ref:z,children:R,dynamicChildren:O,shapeFlag:L,patchFlag:V,dirs:j,cacheIndex:oe,memo:ge}=y;if(V===-2&&(m=!1),z!=null&&(qt(),No(z,null,p,y,!0),jt()),oe!=null&&(N.renderCache[oe]=void 0),L&256){N.ctx.deactivate(y);return}const ve=L&1&&j,Te=!Xn(y);let ze;if(Te&&(ze=S&&S.onVnodeBeforeUnmount)&&Et(ze,N,y),L&6)Q(y.component,p,v);else{if(L&128){y.suspense.unmount(p,v);return}ve&&yn(y,null,N,"beforeUnmount"),L&64?y.type.remove(y,N,p,he,v):O&&!O.hasOnce&&(x!==be||V>0&&V&64)?ee(O,N,p,!1,!0):(x===be&&V&384||!m&&L&16)&&ee(R,N,p),v&&le(y)}const Ye=ge!=null&&oe==null;(Te&&(ze=S&&S.onVnodeUnmounted)||ve||Ye)&&nt(()=>{ze&&Et(ze,N,y),ve&&yn(y,null,N,"unmounted"),Ye&&(y.el=null)},p)},le=y=>{const{type:N,el:p,anchor:v,transition:m}=y;if(N===be){ue(p,v);return}if(N===Lr){M(y);return}const x=()=>{i(p),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(y.shapeFlag&1&&m&&!m.persisted){const{leave:S,delayLeave:z}=m,R=()=>S(p,x);z?z(y.el,x,R):R()}else x()},ue=(y,N)=>{let p;for(;y!==N;)p=d(y),i(y),y=p;i(N)},Q=(y,N,p)=>{const{bum:v,scope:m,job:x,subTree:S,um:z,m:R,a:O}=y;Ul(R),Ul(O),v&&xi(v),m.stop(),x&&(x.flags|=8,J(S,y,N,p)),z&&nt(z,N),nt(()=>{y.isUnmounted=!0},N)},ee=(y,N,p,v=!1,m=!1,x=0)=>{for(let S=x;S<y.length;S++)J(y[S],N,p,v,m)},ie=y=>{if(y.shapeFlag&6)return ie(y.component.subTree);if(y.shapeFlag&128)return y.suspense.next();const N=d(y.anchor||y.el),p=N&&N[ah];return p?d(p):N};let fe=!1;const we=(y,N,p)=>{let v;y==null?N._vnode&&(J(N._vnode,null,null,!0),v=N._vnode.component):b(N._vnode||null,y,N,null,null,null,p),N._vnode=y,fe||(fe=!0,Dl(v),Uu(),fe=!1)},he={p:b,um:J,m:Y,r:le,mt:g,mc:X,pc:T,pbc:W,n:ie,o:e};return{render:we,hydrate:void 0,createApp:Mh(we)}}function Fr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function _n({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Gh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function wc(e,t,n=!1){const o=e.children,i=t.children;if(de(o)&&de(i))for(let r=0;r<o.length;r++){const s=o[r];let l=i[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=i[r]=Yt(i[r]),l.el=s.el),!n&&l.patchFlag!==-2&&wc(s,l)),l.type===_r&&(l.patchFlag===-1&&(l=i[r]=Yt(l)),l.el=s.el),l.type===en&&!l.el&&(l.el=s.el)}}function Uh(e){const t=e.slice(),n=[0];let o,i,r,s,l;const a=e.length;for(o=0;o<a;o++){const u=e[o];if(u!==0){if(i=n[n.length-1],e[i]<u){t[o]=i,n.push(o);continue}for(r=0,s=n.length-1;r<s;)l=r+s>>1,e[n[l]]<u?r=l+1:s=l;u<e[n[r]]&&(r>0&&(t[o]=n[r-1]),n[r]=o)}}for(r=n.length,s=n[r-1];r-- >0;)n[r]=s,s=t[s];return n}function bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bc(t)}function Ul(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function xc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?xc(t.subTree):null}const $c=e=>e.__isSuspense;function Xh(e,t){t&&t.pendingBranch?de(e)?t.effects.push(...e):t.effects.push(e):oh(e)}const be=Symbol.for("v-fgt"),_r=Symbol.for("v-txt"),en=Symbol.for("v-cmt"),Lr=Symbol.for("v-stc"),Mo=[];let Qe=null;function K(e=!1){Mo.push(Qe=e?null:[])}function Wh(){Mo.pop(),Qe=Mo[Mo.length-1]||null}let Qn=1;function Li(e,t=!1){Qn+=e,e<0&&Qe&&t&&(Qe.hasOnce=!0)}function Sc(e){return e.dynamicChildren=Qn>0?Qe||Yn:null,Wh(),Qn>0&&Qe&&Qe.push(e),e}function te(e,t,n,o,i,r){return Sc(U(e,t,n,o,i,r,!0))}function Ve(e,t,n,o,i){return Sc(me(e,t,n,o,i,!0))}function Oo(e){return e?e.__v_isVNode===!0:!1}function uo(e,t){return e.type===t.type&&e.key===t.key}const Ec=({key:e})=>e??null,Si=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?He(e)||Be(e)||pe(e)?{i:Ue,r:e,k:t,f:!!n}:e:null);function U(e,t=null,n=null,o=0,i=null,r=e===be?0:1,s=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ec(t),ref:t&&Si(t),scopeId:Wu,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ue};return l?(rl(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=He(n)?8:16),Qn>0&&!s&&Qe&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Qe.push(a),a}const me=Kh;function Kh(e,t=null,n=null,o=0,i=null,r=!1){if((!e||e===nc)&&(e=en),Oo(e)){const l=eo(e,t,!0);return n&&rl(l,n),Qn>0&&!r&&Qe&&(l.shapeFlag&6?Qe[Qe.indexOf(e)]=l:Qe.push(l)),l.patchFlag=-2,l}if(op(e)&&(e=e.__vccOpts),t){t=Zh(t);let{class:l,style:a}=t;l&&!He(l)&&(t.class=Xe(l)),Me(a)&&(gr(a)&&!de(a)&&(a=We({},a)),t.style=tt(a))}const s=He(e)?1:$c(e)?128:uh(e)?64:Me(e)?4:pe(e)?2:0;return U(e,t,n,o,i,s,r,!0)}function Zh(e){return e?gr(e)||pc(e)?We({},e):e:null}function eo(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:s,children:l,transition:a}=e,u=t?Ro(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Ec(u),ref:t&&t.ref?n&&r?de(r)?r.concat(Si(t)):[r,Si(t)]:Si(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==be?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&eo(e.ssContent),ssFallback:e.ssFallback&&eo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Qs(c,a.clone(c)),c}function hn(e=" ",t=0){return me(_r,null,e,t)}function Ae(e="",t=!1){return t?(K(),Ve(en,null,e)):me(en,null,e)}function kt(e){return e==null||typeof e=="boolean"?me(en):de(e)?me(be,null,e.slice()):Oo(e)?Yt(e):me(_r,null,String(e))}function Yt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:eo(e)}function rl(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(de(t))n=16;else if(typeof t=="object")if(o&65){const i=t.default;i&&(i._c&&(i._d=!1),rl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!pc(t)?t._ctx=Ue:i===3&&Ue&&(Ue.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else pe(t)?(t={default:t,_ctx:Ue},n=32):(t=String(t),o&64?(n=16,t=[hn(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ro(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const i in o)if(i==="class")t.class!==o.class&&(t.class=Xe([t.class,o.class]));else if(i==="style")t.style=tt([t.style,o.style]);else if(sr(i)){const r=t[i],s=o[i];s&&r!==s&&!(de(r)&&r.includes(s))?t[i]=r?[].concat(r,s):s:s==null&&r==null&&!lr(i)&&(t[i]=s)}else i!==""&&(t[i]=o[i])}return t}function Et(e,t,n,o=null){Rt(e,t,7,[n,o])}const qh=uc();let jh=0;function Jh(e,t,n){const o=e.type,i=(t?t.appContext:e.appContext)||qh,r={uid:jh++,vnode:e,type:o,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Su(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:vc(o,i),emitsOptions:cc(o,i),emit:null,emitted:null,propsDefaults:Ie,inheritAttrs:o.inheritAttrs,ctx:Ie,data:Ie,props:Ie,attrs:Ie,slots:Ie,refs:Ie,setupState:Ie,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=Th.bind(null,r),e.ce&&e.ce(r),r}let qe=null;const vn=()=>qe||Ue;let Yi,hs;{const e=fr(),t=(n,o)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(o),r=>{i.length>1?i.forEach(s=>s(r)):i[0](r)}};Yi=t("__VUE_INSTANCE_SETTERS__",n=>qe=n),hs=t("__VUE_SSR_SETTERS__",n=>zo=n)}const Qo=e=>{const t=qe;return Yi(e),e.scope.on(),()=>{e.scope.off(),Yi(t)}},Xl=()=>{qe&&qe.scope.off(),Yi(null)};function Nc(e){return e.vnode.shapeFlag&4}let zo=!1;function Qh(e,t=!1,n=!1){t&&hs(t);const{props:o,children:i}=e.vnode,r=Nc(e);Rh(e,o,r,t),Vh(e,i,n||t);const s=r?ep(e,t):void 0;return t&&hs(!1),s}function ep(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wh);const{setup:o}=n;if(o){qt();const i=e.setupContext=o.length>1?Mc(e):null,r=Qo(e),s=Jo(o,e,0,[e.props,i]),l=mu(s);if(jt(),r(),(l||e.sp)&&!Xn(e)&&qu(e),l){if(s.then(Xl,Xl),t)return s.then(a=>{Wl(e,a)}).catch(a=>{vr(a,e,0)});e.asyncDep=s}else Wl(e,s)}else Cc(e)}function Wl(e,t,n){pe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Me(t)&&(e.setupState=Fu(t)),Cc(e)}function Cc(e,t,n){const o=e.type;e.render||(e.render=o.render||At);{const i=Qo(e);qt();try{xh(e)}finally{jt(),i()}}}const tp={get(e,t){return Ze(e,"get",""),e[t]}};function Mc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,tp),slots:e.slots,emit:e.emit,expose:t}}function wr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Fu(Eo(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Co)return Co[n](e)},has(t,n){return n in t||n in Co}})):e.proxy}function np(e,t=!0){return pe(e)?e.displayName||e.name:e.name||t&&e.__name}function op(e){return pe(e)&&"__vccOpts"in e}const ce=(e,t)=>Jd(e,t,zo);function Ce(e,t,n){try{Li(-1);const o=arguments.length;return o===2?Me(t)&&!de(t)?Oo(t)?me(e,null,[t]):me(e,t):me(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Oo(n)&&(n=[n]),me(e,t,n))}finally{Li(1)}}function ip(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(ft(n[o],t[o]))return!1;return Qn>0&&Qe&&Qe.push(e),!0}const rp="3.5.32";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.32
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let ps;const Kl=typeof window<"u"&&window.trustedTypes;if(Kl)try{ps=Kl.createPolicy("vue",{createHTML:e=>e})}catch{}const kc=ps?e=>ps.createHTML(e):e=>e,sp="http://www.w3.org/2000/svg",lp="http://www.w3.org/1998/Math/MathML",Lt=typeof document<"u"?document:null,Zl=Lt&&Lt.createElement("template"),ap={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?Lt.createElementNS(sp,e):t==="mathml"?Lt.createElementNS(lp,e):n?Lt.createElement(e,{is:n}):Lt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>Lt.createTextNode(e),createComment:e=>Lt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Lt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Zl.innerHTML=kc(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Zl.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},up=Symbol("_vtc");function cp(e,t,n){const o=e[up];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ql=Symbol("_vod"),fp=Symbol("_vsh"),dp=Symbol(""),hp=/(?:^|;)\s*display\s*:/;function pp(e,t,n){const o=e.style,i=He(n);let r=!1;if(n&&!i){if(t)if(He(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Ei(o,l,"")}else for(const s in t)n[s]==null&&Ei(o,s,"");for(const s in n)s==="display"&&(r=!0),Ei(o,s,n[s])}else if(i){if(t!==n){const s=o[dp];s&&(n+=";"+s),o.cssText=n,r=hp.test(n)}}else t&&e.removeAttribute("style");ql in e&&(e[ql]=r?o.display:"",e[fp]&&(o.display="none"))}const jl=/\s*!important$/;function Ei(e,t,n){if(de(n))n.forEach(o=>Ei(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=gp(e,t);jl.test(n)?e.setProperty(zn(o),n.replace(jl,""),"important"):e[o]=n}}const Jl=["Webkit","Moz","ms"],Yr={};function gp(e,t){const n=Yr[t];if(n)return n;let o=et(t);if(o!=="filter"&&o in e)return Yr[t]=o;o=cr(o);for(let i=0;i<Jl.length;i++){const r=Jl[i]+o;if(r in e)return Yr[t]=r}return t}const Ql="http://www.w3.org/1999/xlink";function ea(e,t,n,o,i,r=xd(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ql,t.slice(6,t.length)):e.setAttributeNS(Ql,t,n):n==null||r&&!bu(n)?e.removeAttribute(t):e.setAttribute(t,r?"":lt(n)?String(n):n)}function ta(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?kc(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=bu(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function Ln(e,t,n,o){e.addEventListener(t,n,o)}function vp(e,t,n,o){e.removeEventListener(t,n,o)}const na=Symbol("_vei");function mp(e,t,n,o,i=null){const r=e[na]||(e[na]={}),s=r[t];if(o&&s)s.value=o;else{const[l,a]=yp(t);if(o){const u=r[t]=bp(o,i);Ln(e,l,u,a)}else s&&(vp(e,l,s,a),r[t]=void 0)}}const oa=/(?:Once|Passive|Capture)$/;function yp(e){let t;if(oa.test(e)){t={};let o;for(;o=e.match(oa);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):zn(e.slice(2)),t]}let Gr=0;const _p=Promise.resolve(),wp=()=>Gr||(_p.then(()=>Gr=0),Gr=Date.now());function bp(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Rt(xp(o,n.value),t,5,[o])};return n.value=e,n.attached=wp(),n}function xp(e,t){if(de(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const ia=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$p=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?cp(e,o,s):t==="style"?pp(e,n,o):sr(t)?lr(t)||mp(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Sp(e,t,o,s))?(ta(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ea(e,t,o,s,r,t!=="value")):e._isVueCE&&(Ep(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!He(o)))?ta(e,et(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),ea(e,t,o,s))};function Sp(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ia(t)&&pe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return ia(t)&&He(n)?!1:t in e}function Ep(e,t){const n=e._def.props;if(!n)return!1;const o=et(t);return Array.isArray(n)?n.some(i=>et(i)===o):Object.keys(n).some(i=>et(i)===o)}const ra=e=>{const t=e.props["onUpdate:modelValue"]||!1;return de(t)?n=>xi(t,n):t};function Np(e){e.target.composing=!0}function sa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ur=Symbol("_assign");function la(e,t,n){return t&&(e=e.trim()),n&&(e=Ys(e)),e}const Tc={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Ur]=ra(i);const r=o||i.props&&i.props.type==="number";Ln(e,t?"change":"input",s=>{s.target.composing||e[Ur](la(e.value,n,r))}),(n||r)&&Ln(e,"change",()=>{e.value=la(e.value,n,r)}),t||(Ln(e,"compositionstart",Np),Ln(e,"compositionend",sa),Ln(e,"change",sa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Ur]=ra(s),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Ys(e.value):e.value,a=t??"";if(l===a)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===a)||(e.value=a)}},Cp=["ctrl","shift","alt","meta"],Mp={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Cp.some(n=>e[`${n}Key`]&&!t.includes(n))},gs=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((i,...r)=>{for(let s=0;s<t.length;s++){const l=Mp[t[s]];if(l&&l(i,t))return}return e(i,...r)}))},kp=We({patchProp:$p},ap);let aa;function Tp(){return aa||(aa=Lh(kp))}const Ip=((...e)=>{const t=Tp().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=Pp(o);if(!i)return;const r=t._component;!pe(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,Ap(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t});function Ap(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Pp(e){return He(e)?document.querySelector(e):e}const mn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Dp={class:"sidebar"},Op={class:"sidebar__nodes"},Rp={class:"sidebar__io-row"},zp={class:"sidebar__list"},Bp={key:0,class:"sidebar__state"},Hp={key:1,class:"sidebar__state sidebar__state--error"},Vp={key:2,class:"sidebar__state"},Fp=["onDragstart"],Lp={class:"agent-card__head"},Yp={class:"agent-card__id"},Gp={key:0,class:"agent-card__model"},Up={class:"agent-card__desc"},Xp={key:0,class:"agent-card__tags"},Wp={class:"agent-card__ports"},Kp={__name:"AgentSidebar",props:{agents:{type:Array,required:!0},loading:Boolean,error:String},setup(e){function t(o,i){o.dataTransfer.setData("application/singleton-agent",JSON.stringify(i)),o.dataTransfer.effectAllowed="move"}function n(o,i){o.dataTransfer.setData("application/singleton-node",JSON.stringify({kind:"input",subtype:i})),o.dataTransfer.effectAllowed="move"}return(o,i)=>(K(),te("aside",Dp,[i[6]||(i[6]=U("div",{class:"sidebar__header"},[U("h2",{class:"sidebar__title"},"Agents"),U("p",{class:"sidebar__hint"},"Drag vers le canvas →")],-1)),U("div",Op,[i[4]||(i[4]=U("div",{class:"sidebar__subtitle"},"Nœuds Input",-1)),U("div",Rp,[U("div",{class:"io-card",draggable:"true",onDragstart:i[0]||(i[0]=r=>n(r,"file")),title:"Fichier — chemin fixe ou demandé au runtime"},[...i[2]||(i[2]=[U("span",{class:"io-card__label"},"file",-1),U("span",{class:"io-card__hint"},"Input",-1)])],32),U("div",{class:"io-card",draggable:"true",onDragstart:i[1]||(i[1]=r=>n(r,"text")),title:"Texte — question posée à chaque run"},[...i[3]||(i[3]=[U("span",{class:"io-card__label"},"text",-1),U("span",{class:"io-card__hint"},"Input",-1)])],32)])]),U("div",zp,[e.loading?(K(),te("div",Bp,"Chargement…")):e.error?(K(),te("div",Hp,"Erreur : "+Oe(e.error),1)):e.agents.length===0?(K(),te("div",Vp,[...i[5]||(i[5]=[hn(" Aucun agent détecté. Lance ",-1),U("code",null,"singleton scan",-1),hn(" à la racine. ",-1)])])):Ae("",!0),(K(!0),te(be,null,yt(e.agents,r=>{var s;return K(),te("article",{key:r.id,class:"agent-card",draggable:"true",onDragstart:l=>t(l,r)},[U("header",Lp,[U("span",Yp,Oe(r.id),1),r.model?(K(),te("span",Gp,Oe(r.model),1)):Ae("",!0)]),U("p",Up,Oe(r.description),1),(s=r.tags)!=null&&s.length?(K(),te("div",Xp,[(K(!0),te(be,null,yt(r.tags,l=>(K(),te("span",{key:l,class:"agent-card__tag"},Oe(l),1))),128))])):Ae("",!0),U("footer",Wp,[U("span",null,"in: "+Oe(r.inputs.join(", ")||"—"),1),U("span",null,"out: "+Oe(r.outputs.join(", ")||"—"),1)])],40,Fp)}),128))])]))}},Zp=mn(Kp,[["__scopeId","data-v-82474bb7"]]);function Bo(e){return Us()?($i(e),!0):!1}function Xt(e){return typeof e=="function"?e():Z(e)}const qp=typeof window<"u"&&typeof document<"u",jp=e=>typeof e<"u",Jp=Object.prototype.toString,Qp=e=>Jp.call(e)==="[object Object]",eg=()=>{};function tg(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const Ic=e=>e();function ng(e=Ic){const t=ye(!0);function n(){t.value=!1}function o(){t.value=!0}return{isActive:Ri(t),pause:n,resume:o,eventFilter:(...r)=>{t.value&&e(...r)}}}function ua(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function og(e,t,n={}){const{eventFilter:o=Ic,...i}=n;return xe(e,tg(o,t),i)}function Hn(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:l,isActive:a}=ng(o);return{stop:og(e,t,{...i,eventFilter:r}),pause:s,resume:l,isActive:a}}function ig(e,t={}){if(!Be(e))return Kd(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Wd(()=>({get(){return e.value[o]},set(i){var r;if((r=Xt(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const l=[...e.value];l[o]=i,e.value=l}else{const l={...e.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[o]=i}}));return n}function vs(e,t=!1){function n(f,{flush:d="sync",deep:h=!1,timeout:E,throwOnTimeout:b}={}){let C=null;const k=[new Promise($=>{C=xe(e,M=>{f(M)!==t&&(C==null||C(),$(M))},{flush:d,deep:h,immediate:!0})})];return E!=null&&k.push(ua(E,b).then(()=>Xt(e)).finally(()=>C==null?void 0:C())),Promise.race(k)}function o(f,d){if(!Be(f))return n(M=>M===f,d);const{flush:h="sync",deep:E=!1,timeout:b,throwOnTimeout:C}=d??{};let w=null;const $=[new Promise(M=>{w=xe([e,f],([B,G])=>{t!==(B===G)&&(w==null||w(),M(B))},{flush:h,deep:E,immediate:!0})})];return b!=null&&$.push(ua(b,C).then(()=>Xt(e)).finally(()=>(w==null||w(),Xt(e)))),Promise.race($)}function i(f){return n(d=>!!d,f)}function r(f){return o(null,f)}function s(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function a(f,d){return n(h=>{const E=Array.from(h);return E.includes(f)||E.includes(Xt(f))},d)}function u(f){return c(1,f)}function c(f=1,d){let h=-1;return n(()=>(h+=1,h>=f),d)}return Array.isArray(Xt(e))?{toMatch:n,toContains:a,changed:u,changedTimes:c,get not(){return vs(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:l,toBeUndefined:s,changed:u,changedTimes:c,get not(){return vs(e,!t)}}}function ms(e){return vs(e)}function rg(e){var t;const n=Xt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Ac=qp?window:void 0;function Pc(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Ac):[t,n,o,i]=e,!t)return eg;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},l=(c,f,d,h)=>(c.addEventListener(f,d,h),()=>c.removeEventListener(f,d,h)),a=xe(()=>[rg(t),Xt(i)],([c,f])=>{if(s(),!c)return;const d=Qp(f)?{...f}:f;r.push(...n.flatMap(h=>o.map(E=>l(c,h,E,d))))},{immediate:!0,flush:"post"}),u=()=>{a(),s()};return Bo(u),u}function sg(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ca(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Ac,eventName:r="keydown",passive:s=!1,dedupe:l=!1}=o,a=sg(t);return Pc(i,r,c=>{c.repeat&&Xt(l)||a(c)&&n(c)},s)}function lg(e){return JSON.parse(JSON.stringify(e))}function Xr(e,t,n,o={}){var i,r,s;const{clone:l=!1,passive:a=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=o,h=vn(),E=n||(h==null?void 0:h.emit)||((i=h==null?void 0:h.$emit)==null?void 0:i.bind(h))||((s=(r=h==null?void 0:h.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(h==null?void 0:h.proxy));let b=u;t||(t="modelValue"),b=b||`update:${t.toString()}`;const C=$=>l?typeof l=="function"?l($):lg($):$,w=()=>jp(e[t])?C(e[t]):f,k=$=>{d?d($)&&E(b,$):E(b,$)};if(a){const $=w(),M=ye($);let B=!1;return xe(()=>e[t],G=>{B||(B=!0,M.value=C(G),Pt(()=>B=!1))}),xe(M,G=>{!B&&(G!==e[t]||c)&&k(G)},{deep:c}),M}else return ce({get(){return w()},set($){k($)}})}var ag={value:()=>{}};function br(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ni(n)}function Ni(e){this._=e}function ug(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ni.prototype=br.prototype={constructor:Ni,on:function(e,t){var n=this._,o=ug(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=cg(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=fa(n[i],e.name,t);else if(t==null)for(i in n)n[i]=fa(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ni(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function cg(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function fa(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=ag,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var ys="http://www.w3.org/1999/xhtml";const da={svg:"http://www.w3.org/2000/svg",xhtml:ys,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),da.hasOwnProperty(t)?{space:da[t],local:e}:e}function fg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ys&&t.documentElement.namespaceURI===ys?t.createElement(e):t.createElementNS(n,e)}}function dg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Dc(e){var t=xr(e);return(t.local?dg:fg)(t)}function hg(){}function sl(e){return e==null?hg:function(){return this.querySelector(e)}}function pg(e){typeof e!="function"&&(e=sl(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=new Array(s),a,u,c=0;c<s;++c)(a=r[c])&&(u=e.call(a,a.__data__,c,r))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new at(o,this._parents)}function gg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vg(){return[]}function Oc(e){return e==null?vg:function(){return this.querySelectorAll(e)}}function mg(e){return function(){return gg(e.apply(this,arguments))}}function yg(e){typeof e=="function"?e=mg(e):e=Oc(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(o.push(e.call(a,a.__data__,u,s)),i.push(a));return new at(o,i)}function Rc(e){return function(){return this.matches(e)}}function zc(e){return function(t){return t.matches(e)}}var _g=Array.prototype.find;function wg(e){return function(){return _g.call(this.children,e)}}function bg(){return this.firstElementChild}function xg(e){return this.select(e==null?bg:wg(typeof e=="function"?e:zc(e)))}var $g=Array.prototype.filter;function Sg(){return Array.from(this.children)}function Eg(e){return function(){return $g.call(this.children,e)}}function Ng(e){return this.selectAll(e==null?Sg:Eg(typeof e=="function"?e:zc(e)))}function Cg(e){typeof e!="function"&&(e=Rc(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=[],a,u=0;u<s;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&l.push(a);return new at(o,this._parents)}function Bc(e){return new Array(e.length)}function Mg(){return new at(this._enter||this._groups.map(Bc),this._parents)}function Gi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gi.prototype={constructor:Gi,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 kg(e){return function(){return e}}function Tg(e,t,n,o,i,r){for(var s=0,l,a=t.length,u=r.length;s<u;++s)(l=t[s])?(l.__data__=r[s],o[s]=l):n[s]=new Gi(e,r[s]);for(;s<a;++s)(l=t[s])&&(i[s]=l)}function Ig(e,t,n,o,i,r,s){var l,a,u=new Map,c=t.length,f=r.length,d=new Array(c),h;for(l=0;l<c;++l)(a=t[l])&&(d[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?i[l]=a:u.set(h,a));for(l=0;l<f;++l)h=s.call(e,r[l],l,r)+"",(a=u.get(h))?(o[l]=a,a.__data__=r[l],u.delete(h)):n[l]=new Gi(e,r[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(d[l])===a&&(i[l]=a)}function Ag(e){return e.__data__}function Pg(e,t){if(!arguments.length)return Array.from(this,Ag);var n=t?Ig:Tg,o=this._parents,i=this._groups;typeof e!="function"&&(e=kg(e));for(var r=i.length,s=new Array(r),l=new Array(r),a=new Array(r),u=0;u<r;++u){var c=o[u],f=i[u],d=f.length,h=Dg(e.call(c,c&&c.__data__,u,o)),E=h.length,b=l[u]=new Array(E),C=s[u]=new Array(E),w=a[u]=new Array(d);n(c,f,b,C,w,h,t);for(var k=0,$=0,M,B;k<E;++k)if(M=b[k]){for(k>=$&&($=k+1);!(B=C[$])&&++$<E;);M._next=B||null}}return s=new at(s,o),s._enter=l,s._exit=a,s}function Dg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Og(){return new at(this._exit||this._groups.map(Bc),this._parents)}function Rg(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function zg(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),l=new Array(i),a=0;a<s;++a)for(var u=n[a],c=o[a],f=u.length,d=l[a]=new Array(f),h,E=0;E<f;++E)(h=u[E]||c[E])&&(d[E]=h);for(;a<i;++a)l[a]=n[a];return new at(l,this._parents)}function Bg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Hg(e){e||(e=Vg);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],l=s.length,a=i[r]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new at(i,this._parents).order()}function Vg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Fg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Lg(){return Array.from(this)}function Yg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function Gg(){let e=0;for(const t of this)++e;return e}function Ug(){return!this.node()}function Xg(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,l;r<s;++r)(l=i[r])&&e.call(l,l.__data__,r,i);return this}function Wg(e){return function(){this.removeAttribute(e)}}function Kg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zg(e,t){return function(){this.setAttribute(e,t)}}function qg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function jg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Jg(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 Qg(e,t){var n=xr(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Kg:Wg:typeof t=="function"?n.local?Jg:jg:n.local?qg:Zg)(n,t))}function Hc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ev(e){return function(){this.style.removeProperty(e)}}function tv(e,t,n){return function(){this.style.setProperty(e,t,n)}}function nv(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ov(e,t,n){return arguments.length>1?this.each((t==null?ev:typeof t=="function"?nv:tv)(e,t,n??"")):to(this.node(),e)}function to(e,t){return e.style.getPropertyValue(t)||Hc(e).getComputedStyle(e,null).getPropertyValue(t)}function iv(e){return function(){delete this[e]}}function rv(e,t){return function(){this[e]=t}}function sv(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function lv(e,t){return arguments.length>1?this.each((t==null?iv:typeof t=="function"?sv:rv)(e,t)):this.node()[e]}function Vc(e){return e.trim().split(/^|\s+/)}function ll(e){return e.classList||new Fc(e)}function Fc(e){this._node=e,this._names=Vc(e.getAttribute("class")||"")}Fc.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 Lc(e,t){for(var n=ll(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Yc(e,t){for(var n=ll(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function av(e){return function(){Lc(this,e)}}function uv(e){return function(){Yc(this,e)}}function cv(e,t){return function(){(t.apply(this,arguments)?Lc:Yc)(this,e)}}function fv(e,t){var n=Vc(e+"");if(arguments.length<2){for(var o=ll(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?cv:t?av:uv)(n,t))}function dv(){this.textContent=""}function hv(e){return function(){this.textContent=e}}function pv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function gv(e){return arguments.length?this.each(e==null?dv:(typeof e=="function"?pv:hv)(e)):this.node().textContent}function vv(){this.innerHTML=""}function mv(e){return function(){this.innerHTML=e}}function yv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _v(e){return arguments.length?this.each(e==null?vv:(typeof e=="function"?yv:mv)(e)):this.node().innerHTML}function wv(){this.nextSibling&&this.parentNode.appendChild(this)}function bv(){return this.each(wv)}function xv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $v(){return this.each(xv)}function Sv(e){var t=typeof e=="function"?e:Dc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ev(){return null}function Nv(e,t){var n=typeof e=="function"?e:Dc(e),o=t==null?Ev:typeof t=="function"?t:sl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Cv(){var e=this.parentNode;e&&e.removeChild(this)}function Mv(){return this.each(Cv)}function kv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Iv(e){return this.select(e?Tv:kv)}function Av(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Pv(e){return function(t){e.call(this,t,this.__data__)}}function Dv(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ov(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function Rv(e,t,n){return function(){var o=this.__on,i,r=Pv(t);if(o){for(var s=0,l=o.length;s<l;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function zv(e,t,n){var o=Dv(e+""),i,r=o.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(i=0,c=l[a];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?Rv:Ov,i=0;i<r;++i)this.each(l(o[i],t,n));return this}function Gc(e,t,n){var o=Hc(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Bv(e,t){return function(){return Gc(this,e,t)}}function Hv(e,t){return function(){return Gc(this,e,t.apply(this,arguments))}}function Vv(e,t){return this.each((typeof t=="function"?Hv:Bv)(e,t))}function*Fv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var Uc=[null];function at(e,t){this._groups=e,this._parents=t}function ei(){return new at([[document.documentElement]],Uc)}function Lv(){return this}at.prototype=ei.prototype={constructor:at,select:pg,selectAll:yg,selectChild:xg,selectChildren:Ng,filter:Cg,data:Pg,enter:Mg,exit:Og,join:Rg,merge:zg,selection:Lv,order:Bg,sort:Hg,call:Fg,nodes:Lg,node:Yg,size:Gg,empty:Ug,each:Xg,attr:Qg,style:ov,property:lv,classed:fv,text:gv,html:_v,raise:bv,lower:$v,append:Sv,insert:Nv,remove:Mv,clone:Iv,datum:Av,on:zv,dispatch:Vv,[Symbol.iterator]:Fv};function ht(e){return typeof e=="string"?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],Uc)}function Yv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ct(e,t){if(e=Yv(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Gv={passive:!1},Ho={capture:!0,passive:!1};function Wr(e){e.stopImmediatePropagation()}function Kn(e){e.preventDefault(),e.stopImmediatePropagation()}function Xc(e){var t=e.document.documentElement,n=ht(e).on("dragstart.drag",Kn,Ho);"onselectstart"in t?n.on("selectstart.drag",Kn,Ho):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Wc(e,t){var n=e.document.documentElement,o=ht(e).on("dragstart.drag",null);t&&(o.on("click.drag",Kn,Ho),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ai=e=>()=>e;function _s(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:l,dx:a,dy:u,dispatch:c}){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:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}_s.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Uv(e){return!e.ctrlKey&&!e.button}function Xv(){return this.parentNode}function Wv(e,t){return t??{x:e.x,y:e.y}}function Kv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zv(){var e=Uv,t=Xv,n=Wv,o=Kv,i={},r=br("start","drag","end"),s=0,l,a,u,c,f=0;function d(M){M.on("mousedown.drag",h).filter(o).on("touchstart.drag",C).on("touchmove.drag",w,Gv).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(M,B){if(!(c||!e.call(this,M,B))){var G=$(this,t.call(this,M,B),M,B,"mouse");G&&(ht(M.view).on("mousemove.drag",E,Ho).on("mouseup.drag",b,Ho),Xc(M.view),Wr(M),u=!1,l=M.clientX,a=M.clientY,G("start",M))}}function E(M){if(Kn(M),!u){var B=M.clientX-l,G=M.clientY-a;u=B*B+G*G>f}i.mouse("drag",M)}function b(M){ht(M.view).on("mousemove.drag mouseup.drag",null),Wc(M.view,u),Kn(M),i.mouse("end",M)}function C(M,B){if(e.call(this,M,B)){var G=M.changedTouches,F=t.call(this,M,B),X=G.length,ne,W;for(ne=0;ne<X;++ne)(W=$(this,F,M,B,G[ne].identifier,G[ne]))&&(Wr(M),W("start",M,G[ne]))}}function w(M){var B=M.changedTouches,G=B.length,F,X;for(F=0;F<G;++F)(X=i[B[F].identifier])&&(Kn(M),X("drag",M,B[F]))}function k(M){var B=M.changedTouches,G=B.length,F,X;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),F=0;F<G;++F)(X=i[B[F].identifier])&&(Wr(M),X("end",M,B[F]))}function $(M,B,G,F,X,ne){var W=r.copy(),q=Ct(ne||G,B),I,re,g;if((g=n.call(M,new _s("beforestart",{sourceEvent:G,target:d,identifier:X,active:s,x:q[0],y:q[1],dx:0,dy:0,dispatch:W}),F))!=null)return I=g.x-q[0]||0,re=g.y-q[1]||0,function P(_,A,T){var H=q,D;switch(_){case"start":i[X]=P,D=s++;break;case"end":delete i[X],--s;case"drag":q=Ct(T||A,B),D=s;break}W.call(_,M,new _s(_,{sourceEvent:A,subject:g,target:d,identifier:X,active:D,x:q[0]+I,y:q[1]+re,dx:q[0]-H[0],dy:q[1]-H[1],dispatch:W}),F)}}return d.filter=function(M){return arguments.length?(e=typeof M=="function"?M:ai(!!M),d):e},d.container=function(M){return arguments.length?(t=typeof M=="function"?M:ai(M),d):t},d.subject=function(M){return arguments.length?(n=typeof M=="function"?M:ai(M),d):n},d.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:ai(!!M),d):o},d.on=function(){var M=r.on.apply(r,arguments);return M===r?d:M},d.clickDistance=function(M){return arguments.length?(f=(M=+M)*M,d):Math.sqrt(f)},d}function al(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Kc(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function ti(){}var Vo=.7,Ui=1/Vo,Zn="\\s*([+-]?\\d+)\\s*",Fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qv=/^#([0-9a-f]{3,8})$/,jv=new RegExp(`^rgb\\(${Zn},${Zn},${Zn}\\)$`),Jv=new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`),Qv=new RegExp(`^rgba\\(${Zn},${Zn},${Zn},${Fo}\\)$`),em=new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${Fo}\\)$`),tm=new RegExp(`^hsl\\(${Fo},${Dt},${Dt}\\)$`),nm=new RegExp(`^hsla\\(${Fo},${Dt},${Dt},${Fo}\\)$`),ha={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};al(ti,An,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pa,formatHex:pa,formatHex8:om,formatHsl:im,formatRgb:ga,toString:ga});function pa(){return this.rgb().formatHex()}function om(){return this.rgb().formatHex8()}function im(){return Zc(this).formatHsl()}function ga(){return this.rgb().formatRgb()}function An(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?va(t):n===3?new ot(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ui(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ui(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=jv.exec(e))?new ot(t[1],t[2],t[3],1):(t=Jv.exec(e))?new ot(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qv.exec(e))?ui(t[1],t[2],t[3],t[4]):(t=em.exec(e))?ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tm.exec(e))?_a(t[1],t[2]/100,t[3]/100,1):(t=nm.exec(e))?_a(t[1],t[2]/100,t[3]/100,t[4]):ha.hasOwnProperty(e)?va(ha[e]):e==="transparent"?new ot(NaN,NaN,NaN,0):null}function va(e){return new ot(e>>16&255,e>>8&255,e&255,1)}function ui(e,t,n,o){return o<=0&&(e=t=n=NaN),new ot(e,t,n,o)}function rm(e){return e instanceof ti||(e=An(e)),e?(e=e.rgb(),new ot(e.r,e.g,e.b,e.opacity)):new ot}function ws(e,t,n,o){return arguments.length===1?rm(e):new ot(e,t,n,o??1)}function ot(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}al(ot,ws,Kc(ti,{brighter(e){return e=e==null?Ui:Math.pow(Ui,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ot(kn(this.r),kn(this.g),kn(this.b),Xi(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:ma,formatHex:ma,formatHex8:sm,formatRgb:ya,toString:ya}));function ma(){return`#${En(this.r)}${En(this.g)}${En(this.b)}`}function sm(){return`#${En(this.r)}${En(this.g)}${En(this.b)}${En((isNaN(this.opacity)?1:this.opacity)*255)}`}function ya(){const e=Xi(this.opacity);return`${e===1?"rgb(":"rgba("}${kn(this.r)}, ${kn(this.g)}, ${kn(this.b)}${e===1?")":`, ${e})`}`}function Xi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function En(e){return e=kn(e),(e<16?"0":"")+e.toString(16)}function _a(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pt(e,t,n,o)}function Zc(e){if(e instanceof pt)return new pt(e.h,e.s,e.l,e.opacity);if(e instanceof ti||(e=An(e)),!e)return new pt;if(e instanceof pt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,l=r-i,a=(r+i)/2;return l?(t===r?s=(n-o)/l+(n<o)*6:n===r?s=(o-t)/l+2:s=(t-n)/l+4,l/=a<.5?r+i:2-r-i,s*=60):l=a>0&&a<1?0:s,new pt(s,l,a,e.opacity)}function lm(e,t,n,o){return arguments.length===1?Zc(e):new pt(e,t,n,o??1)}function pt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}al(pt,lm,Kc(ti,{brighter(e){return e=e==null?Ui:Math.pow(Ui,e),new pt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new pt(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,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new ot(Kr(e>=240?e-240:e+120,i,o),Kr(e,i,o),Kr(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new pt(wa(this.h),ci(this.s),ci(this.l),Xi(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=Xi(this.opacity);return`${e===1?"hsl(":"hsla("}${wa(this.h)}, ${ci(this.s)*100}%, ${ci(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wa(e){return e=(e||0)%360,e<0?e+360:e}function ci(e){return Math.max(0,Math.min(1,e||0))}function Kr(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 ul=e=>()=>e;function am(e,t){return function(n){return e+n*t}}function um(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function cm(e){return(e=+e)==1?qc:function(t,n){return n-t?um(t,n,e):ul(isNaN(t)?n:t)}}function qc(e,t){var n=t-e;return n?am(e,n):ul(isNaN(e)?t:e)}const Wi=(function e(t){var n=cm(t);function o(i,r){var s=n((i=ws(i)).r,(r=ws(r)).r),l=n(i.g,r.g),a=n(i.b,r.b),u=qc(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=l(c),i.b=a(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function fm(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=e[i]*(1-r)+t[i]*r;return o}}function dm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hm(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),r=new Array(n),s;for(s=0;s<o;++s)i[s]=ko(e[s],t[s]);for(;s<n;++s)r[s]=t[s];return function(l){for(s=0;s<o;++s)r[s]=i[s](l);return r}}function pm(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gm(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ko(e[i],t[i]):o[i]=t[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var bs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zr=new RegExp(bs.source,"g");function vm(e){return function(){return e}}function mm(e){return function(t){return e(t)+""}}function jc(e,t){var n=bs.lastIndex=Zr.lastIndex=0,o,i,r,s=-1,l=[],a=[];for(e=e+"",t=t+"";(o=bs.exec(e))&&(i=Zr.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),l[s]?l[s]+=r:l[++s]=r),(o=o[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,a.push({i:s,x:Tt(o,i)})),n=Zr.lastIndex;return n<t.length&&(r=t.slice(n),l[s]?l[s]+=r:l[++s]=r),l.length<2?a[0]?mm(a[0].x):vm(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}function ko(e,t){var n=typeof t,o;return t==null||n==="boolean"?ul(t):(n==="number"?Tt:n==="string"?(o=An(t))?(t=o,Wi):jc:t instanceof An?Wi:t instanceof Date?pm:dm(t)?fm:Array.isArray(t)?hm:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gm:Tt)(e,t)}var ba=180/Math.PI,xs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jc(e,t,n,o,i,r){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*o)&&(n-=e*a,o-=t*a),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,a/=l),e*o<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*ba,skewX:Math.atan(a)*ba,scaleX:s,scaleY:l}}var fi;function ym(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xs:Jc(t.a,t.b,t.c,t.d,t.e,t.f)}function _m(e){return e==null||(fi||(fi=document.createElementNS("http://www.w3.org/2000/svg","g")),fi.setAttribute("transform",e),!(e=fi.transform.baseVal.consolidate()))?xs:(e=e.matrix,Jc(e.a,e.b,e.c,e.d,e.e,e.f))}function Qc(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,f,d,h,E){if(u!==f||c!==d){var b=h.push("translate(",null,t,null,n);E.push({i:b-4,x:Tt(u,f)},{i:b-2,x:Tt(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,o)-2,x:Tt(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function l(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,o)-2,x:Tt(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function a(u,c,f,d,h,E){if(u!==f||c!==d){var b=h.push(i(h)+"scale(",null,",",null,")");E.push({i:b-4,x:Tt(u,f)},{i:b-2,x:Tt(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var E=-1,b=d.length,C;++E<b;)f[(C=d[E]).i]=C.x(h);return f.join("")}}}var wm=Qc(ym,"px, ","px)","deg)"),bm=Qc(_m,", ",")",")"),xm=1e-12;function xa(e){return((e=Math.exp(e))+1/e)/2}function $m(e){return((e=Math.exp(e))-1/e)/2}function Sm(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ci=(function e(t,n,o){function i(r,s){var l=r[0],a=r[1],u=r[2],c=s[0],f=s[1],d=s[2],h=c-l,E=f-a,b=h*h+E*E,C,w;if(b<xm)w=Math.log(d/u)/t,C=function(F){return[l+F*h,a+F*E,u*Math.exp(t*F*w)]};else{var k=Math.sqrt(b),$=(d*d-u*u+o*b)/(2*u*n*k),M=(d*d-u*u-o*b)/(2*d*n*k),B=Math.log(Math.sqrt($*$+1)-$),G=Math.log(Math.sqrt(M*M+1)-M);w=(G-B)/t,C=function(F){var X=F*w,ne=xa(B),W=u/(n*k)*(ne*Sm(t*X+B)-$m(B));return[l+W*h,a+W*E,u*ne/xa(t*X+B)]}}return C.duration=w*1e3*t/Math.SQRT2,C}return i.rho=function(r){var s=Math.max(.001,+r),l=s*s,a=l*l;return e(s,l,a)},i})(Math.SQRT2,2,4);var no=0,mo=0,co=0,ef=1e3,Ki,yo,Zi=0,Pn=0,$r=0,Lo=typeof performance=="object"&&performance.now?performance:Date,tf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cl(){return Pn||(tf(Em),Pn=Lo.now()+$r)}function Em(){Pn=0}function qi(){this._call=this._time=this._next=null}qi.prototype=nf.prototype={constructor:qi,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?cl():+n)+(t==null?0:+t),!this._next&&yo!==this&&(yo?yo._next=this:Ki=this,yo=this),this._call=e,this._time=n,$s()},stop:function(){this._call&&(this._call=null,this._time=1/0,$s())}};function nf(e,t,n){var o=new qi;return o.restart(e,t,n),o}function Nm(){cl(),++no;for(var e=Ki,t;e;)(t=Pn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--no}function $a(){Pn=(Zi=Lo.now())+$r,no=mo=0;try{Nm()}finally{no=0,Mm(),Pn=0}}function Cm(){var e=Lo.now(),t=e-Zi;t>ef&&($r-=t,Zi=e)}function Mm(){for(var e,t=Ki,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ki=n);yo=e,$s(o)}function $s(e){if(!no){mo&&(mo=clearTimeout(mo));var t=e-Pn;t>24?(e<1/0&&(mo=setTimeout($a,e-Lo.now()-$r)),co&&(co=clearInterval(co))):(co||(Zi=Lo.now(),co=setInterval(Cm,ef)),no=1,tf($a))}}function Sa(e,t,n){var o=new qi;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var km=br("start","end","cancel","interrupt"),Tm=[],of=0,Ea=1,Ss=2,Mi=3,Na=4,Es=5,ki=6;function Sr(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Im(e,n,{name:t,index:o,group:i,on:km,tween:Tm,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:of})}function fl(e,t){var n=wt(e,t);if(n.state>of)throw new Error("too late; already scheduled");return n}function zt(e,t){var n=wt(e,t);if(n.state>Mi)throw new Error("too late; already running");return n}function wt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Im(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=nf(r,0,n.time);function r(u){n.state=Ea,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,d,h;if(n.state!==Ea)return a();for(c in o)if(h=o[c],h.name===n.name){if(h.state===Mi)return Sa(s);h.state===Na?(h.state=ki,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=ki,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(Sa(function(){n.state===Mi&&(n.state=Na,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Ss,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ss){for(n.state=Mi,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Es,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===Es&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=ki,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Ti(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>Ss&&o.state<Es,o.state=ki,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Am(e){return this.each(function(){Ti(this,e)})}function Pm(e,t){var n,o;return function(){var i=zt(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,l=o.length;s<l;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Dm(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=zt(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var l={name:t,value:n},a=0,u=i.length;a<u;++a)if(i[a].name===t){i[a]=l;break}a===u&&i.push(l)}r.tween=i}}function Om(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=wt(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Pm:Dm)(n,e,t))}function dl(e,t,n){var o=e._id;return e.each(function(){var i=zt(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return wt(i,o).value[t]}}function rf(e,t){var n;return(typeof t=="number"?Tt:t instanceof An?Wi:(n=An(t))?(t=n,Wi):jc)(e,t)}function Rm(e){return function(){this.removeAttribute(e)}}function zm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bm(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Hm(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Vm(e,t,n){var o,i,r;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l)))}}function Fm(e,t,n){var o,i,r;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l)))}}function Lm(e,t){var n=xr(e),o=n==="transform"?bm:rf;return this.attrTween(e,typeof t=="function"?(n.local?Fm:Vm)(n,o,dl(this,"attr."+e,t)):t==null?(n.local?zm:Rm)(n):(n.local?Hm:Bm)(n,o,t))}function Ym(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Gm(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Um(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Gm(e,r)),n}return i._value=t,i}function Xm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Ym(e,r)),n}return i._value=t,i}function Wm(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 o=xr(e);return this.tween(n,(o.local?Um:Xm)(o,t))}function Km(e,t){return function(){fl(this,e).delay=+t.apply(this,arguments)}}function Zm(e,t){return t=+t,function(){fl(this,e).delay=t}}function qm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Km:Zm)(t,e)):wt(this.node(),t).delay}function jm(e,t){return function(){zt(this,e).duration=+t.apply(this,arguments)}}function Jm(e,t){return t=+t,function(){zt(this,e).duration=t}}function Qm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jm:Jm)(t,e)):wt(this.node(),t).duration}function ey(e,t){if(typeof t!="function")throw new Error;return function(){zt(this,e).ease=t}}function ty(e){var t=this._id;return arguments.length?this.each(ey(t,e)):wt(this.node(),t).ease}function ny(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zt(this,e).ease=n}}function oy(e){if(typeof e!="function")throw new Error;return this.each(ny(this._id,e))}function iy(e){typeof e!="function"&&(e=Rc(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=[],a,u=0;u<s;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&l.push(a);return new tn(o,this._parents,this._name,this._id)}function ry(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),l=0;l<r;++l)for(var a=t[l],u=n[l],c=a.length,f=s[l]=new Array(c),d,h=0;h<c;++h)(d=a[h]||u[h])&&(f[h]=d);for(;l<o;++l)s[l]=t[l];return new tn(s,this._parents,this._name,this._id)}function sy(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 ly(e,t,n){var o,i,r=sy(t)?fl:zt;return function(){var s=r(this,e),l=s.on;l!==o&&(i=(o=l).copy()).on(t,n),s.on=i}}function ay(e,t){var n=this._id;return arguments.length<2?wt(this.node(),n).on.on(e):this.each(ly(n,e,t))}function uy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function cy(){return this.on("end.remove",uy(this._id))}function fy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=sl(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var l=o[s],a=l.length,u=r[s]=new Array(a),c,f,d=0;d<a;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,Sr(u[d],t,n,d,u,wt(c,n)));return new tn(r,this._parents,t,n)}function dy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oc(e));for(var o=this._groups,i=o.length,r=[],s=[],l=0;l<i;++l)for(var a=o[l],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var d=e.call(c,c.__data__,f,a),h,E=wt(c,n),b=0,C=d.length;b<C;++b)(h=d[b])&&Sr(h,t,n,b,d,E);r.push(d),s.push(c)}return new tn(r,s,t,n)}var hy=ei.prototype.constructor;function py(){return new hy(this._groups,this._parents)}function gy(e,t){var n,o,i;return function(){var r=to(this,e),s=(this.style.removeProperty(e),to(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function sf(e){return function(){this.style.removeProperty(e)}}function vy(e,t,n){var o,i=n+"",r;return function(){var s=to(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function my(e,t,n){var o,i,r;return function(){var s=to(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),to(this,e))),s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l))}}function yy(e,t){var n,o,i,r="style."+t,s="end."+r,l;return function(){var a=zt(this,e),u=a.on,c=a.value[r]==null?l||(l=sf(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),a.on=o}}function _y(e,t,n){var o=(e+="")=="transform"?wm:rf;return t==null?this.styleTween(e,gy(e,o)).on("end.style."+e,sf(e)):typeof t=="function"?this.styleTween(e,my(e,o,dl(this,"style."+e,t))).each(yy(this._id,e)):this.styleTween(e,vy(e,o,t),n).on("end.style."+e,null)}function wy(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function by(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&wy(e,s,n)),o}return r._value=t,r}function xy(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,by(e,t,n??""))}function $y(e){return function(){this.textContent=e}}function Sy(e){return function(){var t=e(this);this.textContent=t??""}}function Ey(e){return this.tween("text",typeof e=="function"?Sy(dl(this,"text",e)):$y(e==null?"":e+""))}function Ny(e){return function(t){this.textContent=e.call(this,t)}}function Cy(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Ny(i)),t}return o._value=e,o}function My(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,Cy(e))}function ky(){for(var e=this._name,t=this._id,n=lf(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=wt(a,t);Sr(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tn(o,this._parents,e,n)}function Ty(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var l={value:s},a={value:function(){--i===0&&r()}};n.each(function(){var u=zt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),i===0&&r()})}var Iy=0;function tn(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function lf(){return++Iy}var Vt=ei.prototype;tn.prototype={constructor:tn,select:fy,selectAll:dy,selectChild:Vt.selectChild,selectChildren:Vt.selectChildren,filter:iy,merge:ry,selection:py,transition:ky,call:Vt.call,nodes:Vt.nodes,node:Vt.node,size:Vt.size,empty:Vt.empty,each:Vt.each,on:ay,attr:Lm,attrTween:Wm,style:_y,styleTween:xy,text:Ey,textTween:My,remove:cy,tween:Om,delay:qm,duration:Qm,ease:ty,easeVarying:oy,end:Ty,[Symbol.iterator]:Vt[Symbol.iterator]};function Ay(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Py={time:null,delay:0,duration:250,ease:Ay};function Dy(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 Oy(e){var t,n;e instanceof tn?(t=e._id,e=e._name):(t=lf(),(n=Py).time=cl(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Sr(a,e,t,u,s,n||Dy(a,t));return new tn(o,this._parents,e,t)}ei.prototype.interrupt=Am;ei.prototype.transition=Oy;const di=e=>()=>e;function Ry(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function Wt(e,t,n){this.k=e,this.x=t,this.y=n}Wt.prototype={constructor:Wt,scale:function(e){return e===1?this:new Wt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Wt(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 oo=new Wt(1,0,0);Wt.prototype;function qr(e){e.stopImmediatePropagation()}function fo(e){e.preventDefault(),e.stopImmediatePropagation()}function zy(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function By(){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 Ca(){return this.__zoom||oo}function Hy(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Vy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fy(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Ly(){var e=zy,t=By,n=Fy,o=Hy,i=Vy,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Ci,u=br("start","zoom","end"),c,f,d,h=500,E=150,b=0,C=10;function w(g){g.property("__zoom",Ca).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",q).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(g,P,_,A){var T=g.selection?g.selection():g;T.property("__zoom",Ca),g!==T?B(g,P,_,A):T.interrupt().each(function(){G(this,arguments).event(A).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},w.scaleBy=function(g,P,_,A){w.scaleTo(g,function(){var T=this.__zoom.k,H=typeof P=="function"?P.apply(this,arguments):P;return T*H},_,A)},w.scaleTo=function(g,P,_,A){w.transform(g,function(){var T=t.apply(this,arguments),H=this.__zoom,D=_==null?M(T):typeof _=="function"?_.apply(this,arguments):_,Y=H.invert(D),J=typeof P=="function"?P.apply(this,arguments):P;return n($(k(H,J),D,Y),T,s)},_,A)},w.translateBy=function(g,P,_,A){w.transform(g,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,A)},w.translateTo=function(g,P,_,A,T){w.transform(g,function(){var H=t.apply(this,arguments),D=this.__zoom,Y=A==null?M(H):typeof A=="function"?A.apply(this,arguments):A;return n(oo.translate(Y[0],Y[1]).scale(D.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof _=="function"?-_.apply(this,arguments):-_),H,s)},A,T)};function k(g,P){return P=Math.max(r[0],Math.min(r[1],P)),P===g.k?g:new Wt(P,g.x,g.y)}function $(g,P,_){var A=P[0]-_[0]*g.k,T=P[1]-_[1]*g.k;return A===g.x&&T===g.y?g:new Wt(g.k,A,T)}function M(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function B(g,P,_,A){g.on("start.zoom",function(){G(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){G(this,arguments).event(A).end()}).tween("zoom",function(){var T=this,H=arguments,D=G(T,H).event(A),Y=t.apply(T,H),J=_==null?M(Y):typeof _=="function"?_.apply(T,H):_,le=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ue=T.__zoom,Q=typeof P=="function"?P.apply(T,H):P,ee=a(ue.invert(J).concat(le/ue.k),Q.invert(J).concat(le/Q.k));return function(ie){if(ie===1)ie=Q;else{var fe=ee(ie),we=le/fe[2];ie=new Wt(we,J[0]-fe[0]*we,J[1]-fe[1]*we)}D.zoom(null,ie)}})}function G(g,P,_){return!_&&g.__zooming||new F(g,P)}function F(g,P){this.that=g,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,P),this.taps=0}F.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,P){return this.mouse&&g!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var P=ht(this.that).datum();u.call(g,this.that,new Ry(g,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),P)}};function X(g,...P){if(!e.apply(this,arguments))return;var _=G(this,P).event(g),A=this.__zoom,T=Math.max(r[0],Math.min(r[1],A.k*Math.pow(2,o.apply(this,arguments)))),H=Ct(g);if(_.wheel)(_.mouse[0][0]!==H[0]||_.mouse[0][1]!==H[1])&&(_.mouse[1]=A.invert(_.mouse[0]=H)),clearTimeout(_.wheel);else{if(A.k===T)return;_.mouse=[H,A.invert(H)],Ti(this),_.start()}fo(g),_.wheel=setTimeout(D,E),_.zoom("mouse",n($(k(A,T),_.mouse[0],_.mouse[1]),_.extent,s));function D(){_.wheel=null,_.end()}}function ne(g,...P){if(d||!e.apply(this,arguments))return;var _=g.currentTarget,A=G(this,P,!0).event(g),T=ht(g.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",le,!0),H=Ct(g,_),D=g.clientX,Y=g.clientY;Xc(g.view),qr(g),A.mouse=[H,this.__zoom.invert(H)],Ti(this),A.start();function J(ue){if(fo(ue),!A.moved){var Q=ue.clientX-D,ee=ue.clientY-Y;A.moved=Q*Q+ee*ee>b}A.event(ue).zoom("mouse",n($(A.that.__zoom,A.mouse[0]=Ct(ue,_),A.mouse[1]),A.extent,s))}function le(ue){T.on("mousemove.zoom mouseup.zoom",null),Wc(ue.view,A.moved),fo(ue),A.event(ue).end()}}function W(g,...P){if(e.apply(this,arguments)){var _=this.__zoom,A=Ct(g.changedTouches?g.changedTouches[0]:g,this),T=_.invert(A),H=_.k*(g.shiftKey?.5:2),D=n($(k(_,H),A,T),t.apply(this,P),s);fo(g),l>0?ht(this).transition().duration(l).call(B,D,A,g):ht(this).call(w.transform,D,A,g)}}function q(g,...P){if(e.apply(this,arguments)){var _=g.touches,A=_.length,T=G(this,P,g.changedTouches.length===A).event(g),H,D,Y,J;for(qr(g),D=0;D<A;++D)Y=_[D],J=Ct(Y,this),J=[J,this.__zoom.invert(J),Y.identifier],T.touch0?!T.touch1&&T.touch0[2]!==J[2]&&(T.touch1=J,T.taps=0):(T.touch0=J,H=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),H&&(T.taps<2&&(f=J[0],c=setTimeout(function(){c=null},h)),Ti(this),T.start())}}function I(g,...P){if(this.__zooming){var _=G(this,P).event(g),A=g.changedTouches,T=A.length,H,D,Y,J;for(fo(g),H=0;H<T;++H)D=A[H],Y=Ct(D,this),_.touch0&&_.touch0[2]===D.identifier?_.touch0[0]=Y:_.touch1&&_.touch1[2]===D.identifier&&(_.touch1[0]=Y);if(D=_.that.__zoom,_.touch1){var le=_.touch0[0],ue=_.touch0[1],Q=_.touch1[0],ee=_.touch1[1],ie=(ie=Q[0]-le[0])*ie+(ie=Q[1]-le[1])*ie,fe=(fe=ee[0]-ue[0])*fe+(fe=ee[1]-ue[1])*fe;D=k(D,Math.sqrt(ie/fe)),Y=[(le[0]+Q[0])/2,(le[1]+Q[1])/2],J=[(ue[0]+ee[0])/2,(ue[1]+ee[1])/2]}else if(_.touch0)Y=_.touch0[0],J=_.touch0[1];else return;_.zoom("touch",n($(D,Y,J),_.extent,s))}}function re(g,...P){if(this.__zooming){var _=G(this,P).event(g),A=g.changedTouches,T=A.length,H,D;for(qr(g),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),H=0;H<T;++H)D=A[H],_.touch0&&_.touch0[2]===D.identifier?delete _.touch0:_.touch1&&_.touch1[2]===D.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(D=Ct(D,this),Math.hypot(f[0]-D[0],f[1]-D[1])<C)){var Y=ht(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return w.wheelDelta=function(g){return arguments.length?(o=typeof g=="function"?g:di(+g),w):o},w.filter=function(g){return arguments.length?(e=typeof g=="function"?g:di(!!g),w):e},w.touchable=function(g){return arguments.length?(i=typeof g=="function"?g:di(!!g),w):i},w.extent=function(g){return arguments.length?(t=typeof g=="function"?g:di([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),w):t},w.scaleExtent=function(g){return arguments.length?(r[0]=+g[0],r[1]=+g[1],w):[r[0],r[1]]},w.translateExtent=function(g){return arguments.length?(s[0][0]=+g[0][0],s[1][0]=+g[1][0],s[0][1]=+g[0][1],s[1][1]=+g[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(g){return arguments.length?(n=g,w):n},w.duration=function(g){return arguments.length?(l=+g,w):l},w.interpolate=function(g){return arguments.length?(a=g,w):a},w.on=function(){var g=u.on.apply(u,arguments);return g===u?w:g},w.clickDistance=function(g){return arguments.length?(b=(g=+g)*g,w):Math.sqrt(b)},w.tapDistance=function(g){return arguments.length?(C=+g,w):C},w}var ae=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ae||{}),hl=(e=>(e.Partial="partial",e.Full="full",e))(hl||{}),xn=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(xn||{}),pn=(e=>(e.Strict="strict",e.Loose="loose",e))(pn||{}),Ns=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Ns||{}),To=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(To||{}),af=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(af||{});const Yy=["INPUT","SELECT","TEXTAREA"],Gy=typeof document<"u"?document:null;function Cs(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return Yy.includes(o==null?void 0:o.nodeName)||i||!!r}function Uy(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ma(e,t,n,o){const i=t.replace("+",`
|
|
18
|
+
`).replace(`
|
|
19
|
+
|
|
20
|
+
`,`
|
|
21
|
+
+`).split(`
|
|
22
|
+
`).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,l)=>n.has(s)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(e.toLowerCase()),r}function Xy(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Wy(n.code,e);return Array.isArray(e)?e.some(i=>Ma(n[o],i,t,n.type==="keyup")):Ma(n[o],e,t,n.type==="keyup")}}function Wy(e,t){return t.includes(e)?"code":"key"}function Io(e,t){const n=ce(()=>_e(t==null?void 0:t.target)??Gy),o=dn(_e(e)===!0);let i=!1;const r=new Set;let s=a(_e(e));xe(()=>_e(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&l(),s=a(u)},{immediate:!0}),Pc(["blur","contextmenu"],l),ca((...u)=>s(...u),u=>{var c,f;const d=_e(t==null?void 0:t.actInsideInputWithModifier)??!0,h=_e(t==null?void 0:t.preventDefault)??!1;if(i=Uy(u),(!i||i&&!d)&&Cs(u))return;const b=((f=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:f[0])||u.target,C=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";!h&&(i||!C)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),ca((...u)=>s(...u),u=>{const c=_e(t==null?void 0:t.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!c)&&Cs(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,r.clear(),o.value=_e(e)===!0}function a(u){return u===null?(l(),()=>!1):typeof u=="boolean"?(l(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?Xy(u,r):u}return o}const uf="vue-flow__node-desc",cf="vue-flow__edge-desc",Ky="vue-flow__aria-live",ff=["Enter"," ","Escape"],qn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function ji(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Ji(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Er(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Dn(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function df(e,t){return{x:Dn(e.x,t[0][0],t[1][0]),y:Dn(e.y,t[0][1],t[1][1])}}function ka(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function gn(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Tn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!gn(e)}function _o(e){return Tn(e)&&"computedPosition"in e}function hi(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Zy(e){return hi(e.width)&&hi(e.height)&&hi(e.x)&&hi(e.y)}function qy(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Eo({width:0,height:0}),computedPosition:Eo({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Fe(e.data)?e.data:{},events:Eo(Fe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function hf(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focusable??(n==null?void 0:n.focusable),data:Fe(e.data)?e.data:{},events:Eo(Fe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function pf(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const l of n)l[s]===i&&r.add(l[o]);return t.filter(l=>r.has(l.id))}function jy(...e){if(e.length===3){const[r,s,l]=e;return pf(r,s,l,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>gn(r)&&r.source===o).map(r=>n.find(s=>Tn(s)&&s.id===r.target))}function Jy(...e){if(e.length===3){const[r,s,l]=e;return pf(r,s,l,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>gn(r)&&r.target===o).map(r=>n.find(s=>Tn(s)&&s.id===r.source))}function gf({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function Qy(e,t){return t.some(n=>gn(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))}function Yo({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Go({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const l={x:(e-n)/i,y:(t-o)/i};return r?Nr(l,s):l}function vf(e,t){return{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)}}function Qi({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function mf({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function e0(e,t){return mf(vf(Qi(e),Qi(t)))}function pl(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=vf(t,Qi({...o.computedPosition,...o.dimensions}))}return mf(t)}function yf(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...Go(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const l of e){const{dimensions:a,selectable:u=!0,hidden:c=!1}=l,f=a.width??l.width??null,d=a.height??l.height??null;if(i&&!u||c)continue;const h=Ji(r,ji(l)),E=f===null||d===null,b=o&&h>0,C=(f??0)*(d??0);(E||b||h>=C||l.dragging)&&s.push(l)}return s}function $n(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function Vn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return ni(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function t0(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Vn(e,n),i=Vn(e,t);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof e=="object"){const o=Vn(e.top??e.y??0,n),i=Vn(e.bottom??e.y??0,n),r=Vn(e.left??e.x??0,t),s=Vn(e.right??e.x??0,t);return{top:o,right:s,bottom:i,left:r,x:r+s,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function n0(e,t,n,o,i,r){const{x:s,y:l}=Yo(e,{x:t,y:n,zoom:o}),{x:a,y:u}=Yo({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=i-a,f=r-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(f)}}function Ta(e,t,n,o,i,r=.1){const s=t0(r,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Dn(u,o,i),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*c,E=n/2-d*c,b=n0(e,h,E,c,t,n),C={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:h-C.left+C.right,y:E-C.top+C.bottom,zoom:c}}function o0(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function _f(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:_f(n,t):!1}function Uo(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Ms(e){const t=e.ctrlKey&&Xo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Ia(e,t,n){return e<t?Dn(Math.abs(e-t),1,t)/t:e>n?-Dn(Math.abs(e-n),1,t)/t:0}function wf(e,t,n=15,o=40){const i=Ia(e.x,o,t.width-o)*n,r=Ia(e.y,o,t.height-o)*n;return[i,r]}function jr(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}function Aa(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(a=>a.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const l=t.findIndex(a=>a.id===s.id);l!==-1&&t.splice(l,1)}const r=t.map(s=>s.id);for(const s of t)for(const l of e)if(l.id===s.id)switch(l.type){case"select":s.selected=l.selected;break;case"position":if(_o(s)&&(typeof l.position<"u"&&(s.position=l.position),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&s.parentNode)){const a=t[r.indexOf(s.parentNode)];a&&_o(a)&&jr(s,a)}break;case"dimensions":if(_o(s)&&(typeof l.dimensions<"u"&&(s.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(s.style={...s.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(s.resizing=l.resizing),s.expandParent&&s.parentNode)){const a=t[r.indexOf(s.parentNode)];a&&_o(a)&&(!!a.dimensions.width&&!!a.dimensions.height?jr(s,a):Pt(()=>{jr(s,a)}))}break}return t}function sn(e,t){return{id:e,type:"select",selected:t}}function Pa(e){return{item:e,type:"add"}}function Da(e){return{id:e,type:"remove"}}function Oa(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function un(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(sn(r.id,s)))}return o}const Ra=()=>{};function se(e){const t=new Set;let n=Ra,o=()=>!1;const i=()=>t.size>0||o(),r=d=>{n=d},s=()=>{n=Ra},l=d=>{o=d},a=()=>{o=()=>!1},u=d=>{t.delete(d)};return{on:d=>{t.add(d);const h=()=>u(d);return Bo(h),{off:h}},off:u,trigger:d=>{const h=[n];return i()?h.push(...t):e&&h.push(e),Promise.allSettled(h.map(E=>E(d)))},hasListeners:i,listeners:t,setEmitter:r,removeEmitter:s,setHasEmitListeners:l,removeHasEmitListeners:a}}function za(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function i0(e,t,n,o){var i,r;const s=new Map;for(const[l,a]of e)(a.selected||a.id===o)&&(!a.parentNode||!_f(a,e))&&(a.draggable||t&&typeof a.draggable>"u")&&e.get(l)&&s.set(l,{id:a.id,position:a.position||{x:0,y:0},distance:{x:n.x-((i=a.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=a.computedPosition)==null?void 0:r.y)||0},from:{x:a.computedPosition.x,y:a.computedPosition.y},extent:a.extent,parentNode:a.parentNode,dimensions:{...a.dimensions},expandParent:a.expandParent});return Array.from(s.values())}function Jr({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function bf(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function r0(e,t,n){const[o,i,r,s]=typeof e!="string"?bf(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function s0(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=r0(i,e,o);r&&(i=r)}else t(new Ge(Le.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,l,a]=bf(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+a,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function l0({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function gl(e,t,n,o,i){const r=l0(e.dimensions,s0(e,n,o,i)),s=df(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function io(e,t,n=ae.Left,o=!1){const i=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:s,height:l}=t??f0(e);if(o)return{x:i+s/2,y:r+l/2};switch((t==null?void 0:t.position)??n){case ae.Top:return{x:i+s/2,y:r};case ae.Right:return{x:i+s,y:r+l/2};case ae.Bottom:return{x:i+s/2,y:r+l};case ae.Left:return{x:i,y:r+l/2}}}function Ba(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function a0({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:l,viewport:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Qi({x:(0-a.x)/a.zoom,y:(0-a.y)/a.zoom,width:s/a.zoom,height:l/a.zoom}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),d=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*d)>0}function u0(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Le=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Le||{});const Ha={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
|
|
23
|
+
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
24
|
+
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
25
|
+
Node: ${e}
|
|
26
|
+
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
27
|
+
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
28
|
+
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
29
|
+
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
30
|
+
Edge: ${e}
|
|
31
|
+
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
32
|
+
Edge: ${e}
|
|
33
|
+
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
34
|
+
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
35
|
+
Edge: ${e}
|
|
36
|
+
Source: ${t}
|
|
37
|
+
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
38
|
+
Edge: ${e}
|
|
39
|
+
Source: ${t}
|
|
40
|
+
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
41
|
+
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
42
|
+
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ge extends Error{constructor(t,...n){var o;super((o=Ha[t])==null?void 0:o.call(Ha,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function vl(e){return"clientX"in e}function c0(e){return"sourceEvent"in e}function It(e,t){const n=vl(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}}const Xo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function f0(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Nr(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const d0=()=>!0;function Qr(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function h0(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())Ji(i,ji(r))>0&&o.push(r);return o}const p0=250;function g0(e,t,n,o){var i,r;let s=[],l=Number.POSITIVE_INFINITY;const a=h0(e,n,t+p0);for(const u of a){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]];for(const f of c){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:d,y:h}=io(u,f,f.position,!0),E=Math.sqrt((d-e.x)**2+(h-e.y)**2);E>t||(E<l?(s=[{...f,x:d,y:h}],l=E):E===l&&s.push({...f,x:d,y:h}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function Va(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:l,flowId:a,isValidConnection:u=d0},c,f,d,h){const E=r==="target",b=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:C,y:w}=It(e),k=s.elementFromPoint(C,w),$=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:b,M={handleDomNode:$,isValid:!1,connection:null,toHandle:null};if($){const B=xf(void 0,$),G=$.getAttribute("data-nodeid"),F=$.getAttribute("data-handleid"),X=$.classList.contains("connectable"),ne=$.classList.contains("connectableend");if(!G||!B)return M;const W={source:E?G:o,sourceHandle:E?F:i,target:E?o:G,targetHandle:E?i:F};M.connection=W;const I=X&&ne&&(n===pn.Strict?E&&B==="source"||!E&&B==="target":G!==o||F!==i);M.isValid=I&&u(W,{nodes:f,edges:c,sourceNode:d(W.source),targetNode:d(W.target)}),M.toHandle=$f(G,B,F,h,n,!0)}return M}function xf(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function v0(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function m0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function $f(e,t,n,o,i,r=!1){var s,l,a;const u=o.get(e);if(!u)return null;const c=i===pn.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((l=u.handleBounds)==null?void 0:l.source)??[],...((a=u.handleBounds)==null?void 0:a.target)??[]],f=(n?c==null?void 0:c.find(d=>d.id===n):c==null?void 0:c[0])??null;return f&&r?{...f,...io(u,f,f.position,!0)}:f}const ks={[ae.Left]:ae.Right,[ae.Right]:ae.Left,[ae.Top]:ae.Bottom,[ae.Bottom]:ae.Top},y0=["production","prod"];function ni(e,...t){Sf()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Sf(){return!y0.includes("production")}function Fa(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Er(s)}}):null}function Ts(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Pt(()=>{s.blur()})):n([e])}function Fe(e){return typeof Z(e)<"u"}function _0(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ge(Le.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return gn(e)?i=e:i={...e,id:gf(e)},i=hf(i,void 0,o),Qy(i,t)?!1:i}function w0(e,t,n,o,i){if(!t.source||!t.target)return i(new Ge(Le.EDGE_INVALID,e.id)),!1;if(!n)return i(new Ge(Le.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...s}=e;return{...s,id:o?gf(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function La(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!Tn(s)){n(new Ge(Le.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const l=qy(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=l}for(const r of i){const s=t(r.parentNode)||i.find(l=>l.id===r.parentNode);r.parentNode&&!s&&n(new Ge(Le.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function Ya(e,t,n,o,i,r){let s=i;const l=o.get(s)||new Map;o.set(s,l.set(n,t)),s=`${i}-${e}`;const a=o.get(s)||new Map;if(o.set(s,a.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function es(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:l=null}=o,a={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:l},u=`${i}-${s}--${r}-${l}`,c=`${r}-${l}--${i}-${s}`;Ya("source",a,c,e,i,s),Ya("target",a,u,e,r,l)}}function Ga(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ts(e,t,n,o,i,r,s,l){const a=[];for(const u of e){const c=gn(u)?u:_0(u,l,i,r);if(!c)continue;const f=n(c.source),d=n(c.target);if(!f||!d){i(new Ge(Le.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!f){i(new Ge(Le.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!d){i(new Ge(Le.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:l,nodes:s,sourceNode:f,targetNode:d})){i(new Ge(Le.EDGE_INVALID,c.id));continue}const h=o(c.id);a.push({...hf(c,h,r),sourceNode:f,targetNode:d})}return a}const Ua=Symbol("vueFlow"),Ef=Symbol("nodeId"),Nf=Symbol("nodeRef"),b0=Symbol("edgeId"),x0=Symbol("edgeRef"),Cr=Symbol("slots");function Cf(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:s,nodeDragThreshold:l,viewport:a,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:f,panBy:d,findNode:h,multiSelectionActive:E,nodesSelectionActive:b,selectNodesOnDrag:C,removeSelectedElements:w,addSelectedNodes:k,updateNodePositions:$,emits:M}=ke(),{onStart:B,onDrag:G,onStop:F,onClick:X,el:ne,disabled:W,id:q,selectable:I,dragHandle:re}=e,g=dn(!1);let P=[],_,A=null,T={x:void 0,y:void 0},H={x:0,y:0},D=null,Y=!1,J=!1,le=0,ue=!1;const Q=E0(),ee=({x:y,y:N})=>{T={x:y,y:N};let p=!1;if(P=P.map(v=>{const m={x:y-v.distance.x,y:N-v.distance.y},{computedPosition:x}=gl(v,n.value?Nr(m,o.value):m,M.error,s.value,v.parentNode?h(v.parentNode):void 0);return p=p||v.position.x!==x.x||v.position.y!==x.y,v.position=x,v}),J=J||p,!!p&&($(P,!0,!0),g.value=!0,D)){const[v,m]=Jr({id:q,dragItems:P,findNode:h});G({event:D,node:v,nodes:m})}},ie=()=>{if(!A)return;const[y,N]=wf(H,A,c.value);if(y!==0||N!==0){const p={x:(T.x??0)-y/a.value.zoom,y:(T.y??0)-N/a.value.zoom};d({x:y,y:N})&&ee(p)}le=requestAnimationFrame(ie)},fe=(y,N)=>{Y=!0;const p=h(q);!C.value&&!E.value&&p&&(p.selected||w()),p&&_e(I)&&C.value&&Ts(p,E.value,k,w,b,!1,N);const v=Q(y.sourceEvent);if(T=v,P=i0(r.value,f.value,v,q),P.length){const[m,x]=Jr({id:q,dragItems:P,findNode:h});B({event:y.sourceEvent,node:m,nodes:x})}},we=(y,N)=>{var p;y.sourceEvent.type==="touchmove"&&y.sourceEvent.touches.length>1||(J=!1,l.value===0&&fe(y,N),T=Q(y.sourceEvent),A=((p=t.value)==null?void 0:p.getBoundingClientRect())||null,H=It(y.sourceEvent,A))},he=(y,N)=>{const p=Q(y.sourceEvent);if(!ue&&Y&&u.value&&(ue=!0,ie()),!Y){const v=p.xSnapped-(T.x??0),m=p.ySnapped-(T.y??0);Math.sqrt(v*v+m*m)>l.value&&fe(y,N)}(T.x!==p.xSnapped||T.y!==p.ySnapped)&&P.length&&Y&&(D=y.sourceEvent,H=It(y.sourceEvent,A),ee(p))},$e=y=>{let N=!1;if(!Y&&!g.value&&!E.value){const p=y.sourceEvent,v=Q(p),m=v.xSnapped-(T.x??0),x=v.ySnapped-(T.y??0),S=Math.sqrt(m*m+x*x);S!==0&&S<=l.value&&(X==null||X(p),N=!0)}if(P.length&&!N){J&&($(P,!1,!1),J=!1);const[p,v]=Jr({id:q,dragItems:P,findNode:h});F({event:y.sourceEvent,node:p,nodes:v})}P=[],g.value=!1,ue=!1,Y=!1,T={x:void 0,y:void 0},cancelAnimationFrame(le)};return xe([()=>_e(W),ne],([y,N],p,v)=>{if(N){const m=ht(N);y||(_=Zv().on("start",x=>we(x,N)).on("drag",x=>he(x,N)).on("end",x=>$e(x)).filter(x=>{const S=x.target,z=_e(re);return!x.button&&(!i.value||!za(S,`.${i.value}`,N)&&(!z||za(S,z,N)))}),m.call(_)),v(()=>{m.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),g}function $0(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),updateStart:se(),update:se(),updateEnd:se()}}function S0(e,t){const n=$0();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function E0(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=ke();return i=>{var r;const s=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},l=c0(i)?i.sourceEvent:i,{x:a,y:u}=It(l,s),c=Go({x:a,y:u},e.value),{x:f,y:d}=n.value?Nr(c,t.value):c;return{xSnapped:f,ySnapped:d,...c}}}function pi(){return!0}function Mf({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:l,vueFlowRef:a,connectionMode:u,connectionRadius:c,connectOnClick:f,connectionClickStartHandle:d,nodesConnectable:h,autoPanOnConnect:E,autoPanSpeed:b,findNode:C,panBy:w,startConnection:k,updateConnection:$,endConnection:M,emits:B,viewport:G,edges:F,nodes:X,isValidConnection:ne,nodeLookup:W}=ke();let q=null,I=!1,re=null;function g(_){var A;const T=_e(n)==="target",H=vl(_),D=ka(_.target),Y=_.currentTarget;if(Y&&(H&&_.button===0||!H)){let J=function(L){p=It(L,$e),ee=g0(Go(p,G.value,!1,[1,1]),c.value,W.value,x),v||(m(),v=!0);const V=Va(L,{handle:ee,connectionMode:u.value,fromNodeId:_e(t),fromHandleId:_e(e),fromType:T?"target":"source",isValidConnection:Q,doc:D,lib:"vue",flowId:l,nodeLookup:W.value},F.value,X.value,C,W.value);re=V.handleDomNode,q=V.connection,I=m0(!!ee,V.isValid);const j={...O,isValid:I,to:V.toHandle&&I?Yo({x:V.toHandle.x,y:V.toHandle.y},G.value):p,toHandle:V.toHandle,toPosition:I&&V.toHandle?V.toHandle.position:ks[x.position],toNode:V.toHandle?W.value.get(V.toHandle.nodeId):null};if(I&&ee&&(O!=null&&O.toHandle)&&j.toHandle&&O.toHandle.type===j.toHandle.type&&O.toHandle.nodeId===j.toHandle.nodeId&&O.toHandle.id===j.toHandle.id&&O.to.x===j.to.x&&O.to.y===j.to.y)return;const oe=ee??V.toHandle;if($(oe&&I?Yo({x:oe.x,y:oe.y},G.value):p,oe,v0(!!oe,I)),O=j,!ee&&!I&&!re)return Qr(N);q&&q.source!==q.target&&re&&(Qr(N),N=re,re.classList.add("connecting","vue-flow__handle-connecting"),re.classList.toggle("valid",!!I),re.classList.toggle("vue-flow__handle-valid",!!I))},le=function(L){"touches"in L&&L.touches.length>0||((ee||re)&&q&&I&&(r?r(L,q):B.connect(q)),B.connectEnd(L),i&&(s==null||s(L)),Qr(N),cancelAnimationFrame(ie),M(L),v=!1,I=!1,q=null,re=null,D.removeEventListener("mousemove",J),D.removeEventListener("mouseup",le),D.removeEventListener("touchmove",J),D.removeEventListener("touchend",le))};const ue=C(_e(t));let Q=_e(o)||ne.value||pi;!Q&&ue&&(Q=(T?ue.isValidSourcePos:ue.isValidTargetPos)||pi);let ee,ie=0;const{x:fe,y:we}=It(_),he=xf(_e(i),Y),$e=(A=a.value)==null?void 0:A.getBoundingClientRect();if(!$e||!he)return;const y=$f(_e(t),he,_e(e),W.value,u.value);if(!y)return;let N,p=It(_,$e),v=!1;const m=()=>{if(!E.value)return;const[L,V]=wf(p,$e,b.value);w({x:L,y:V}),ie=requestAnimationFrame(m)},x={...y,nodeId:_e(t),type:he,position:y.position},S=W.value.get(_e(t)),R={inProgress:!0,isValid:null,from:io(S,x,ae.Left,!0),fromHandle:x,fromPosition:x.position,fromNode:S,to:p,toHandle:null,toPosition:ks[x.position],toNode:null};k({nodeId:_e(t),id:_e(e),type:he,position:(Y==null?void 0:Y.getAttribute("data-handlepos"))||ae.Top,...p},{x:fe-$e.left,y:we-$e.top}),B.connectStart({event:_,nodeId:_e(t),handleId:_e(e),handleType:he});let O=R;D.addEventListener("mousemove",J),D.addEventListener("mouseup",le),D.addEventListener("touchmove",J),D.addEventListener("touchend",le)}}function P(_){var A,T;if(!f.value)return;const H=_e(n)==="target";if(!d.value){B.clickConnectStart({event:_,nodeId:_e(t),handleId:_e(e)}),k({nodeId:_e(t),type:_e(n),id:_e(e),position:ae.Top,...It(_)},void 0,!0);return}let D=_e(o)||ne.value||pi;const Y=C(_e(t));if(!D&&Y&&(D=(H?Y.isValidSourcePos:Y.isValidTargetPos)||pi),Y&&(typeof Y.connectable>"u"?h.value:Y.connectable)===!1)return;const J=ka(_.target),le=Va(_,{handle:{nodeId:_e(t),id:_e(e),type:_e(n),position:ae.Top,...It(_)},connectionMode:u.value,fromNodeId:d.value.nodeId,fromHandleId:d.value.id??null,fromType:d.value.type,isValidConnection:D,doc:J,lib:"vue",flowId:l,nodeLookup:W.value},F.value,X.value,C,W.value),ue=((A=le.connection)==null?void 0:A.source)===((T=le.connection)==null?void 0:T.target);le.isValid&&le.connection&&!ue&&B.connect(le.connection),B.clickConnectEnd(_),M(_,!0)}return{handlePointerDown:g,handleClick:P}}function N0(){return ct(Ef,"")}function kf(e){const t=e??N0()??"",n=ct(Nf,ye(null)),{findNode:o,edges:i,emits:r}=ke(),s=o(t);return s||r.error(new Ge(Le.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:ce(()=>o(s.parentNode)),connectedEdges:ce(()=>$n([s],i.value))}}function C0(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),dragStart:se(),drag:se(),dragStop:se()}}function M0(e,t){const n=C0();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Tf(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:l}=ke();return(a,u=!1)=>{const c=r.value?i.value[0]:5,f=r.value?i.value[1]:5,d=u?4:1,h=a.x*c*d,E=a.y*f*d,b=[];for(const C of e.value)if(C.draggable||s&&typeof C.draggable>"u"){const w={x:C.computedPosition.x+h,y:C.computedPosition.y+E},{position:k}=gl(C,w,l.error,t.value,C.parentNode?o(C.parentNode):void 0);b.push({id:C.id,position:k,from:C.position,distance:{x:a.x,y:a.y},dimensions:C.dimensions})}n(b,!0,!1)}}const gi=.1,k0=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function rn(){return ni("Viewport not initialized yet."),Promise.resolve(!1)}const T0={zoomIn:rn,zoomOut:rn,zoomTo:rn,fitView:rn,setCenter:rn,fitBounds:rn,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:rn,setTransform:rn,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function I0(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?ko:Ci).scaleBy(ns(e.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(l=>{var a;const{x:u,y:c}=df({x:-o,y:-i},e.translateExtent),f=oo.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(a=e.d3Zoom)==null||a.interpolate((s==null?void 0:s.interpolate)==="linear"?ko:Ci).transform(ns(e.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{l(!0)}),f):l(!1)})}return ce(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?ko:Ci).scaleTo(ns(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:gi,includeHiddenNodes:!1,duration:0})=>{var r,s;const l=[];for(const d of e.nodes)d.dimensions.width&&d.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!d.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(d.id))&&l.push(d);if(!l.length)return Promise.resolve(!1);const a=pl(l),{x:u,y:c,zoom:f}=Ta(a,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??gi);return n(u,c,f,i)},setCenter:(i,r,s)=>{const l=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:e.maxZoom,a=e.dimensions.width/2-i*l,u=e.dimensions.height/2-r*l;return n(a,u,l,s)},fitBounds:(i,r={padding:gi})=>{const{x:s,y:l,zoom:a}=Ta(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??gi);return n(s,l,a,r)},project:i=>Go(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),l={x:i.x-r,y:i.y-s};return Go(l,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),l={x:i.x+r,y:i.y+s};return Yo(l,e.viewport)}return{x:0,y:0}}}:T0)}function ns(e,t=0,n=k0,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function A0(e,t,n){const o=Eu(!0);return o.run(()=>{const i=()=>{o.run(()=>{let b,C,w=!!(n.nodes.value.length||n.edges.value.length);b=Hn([e.modelValue,()=>{var k,$;return($=(k=e.modelValue)==null?void 0:k.value)==null?void 0:$.length}],([k])=>{k&&Array.isArray(k)&&(C==null||C.pause(),n.setElements(k),!C&&!w&&k.length?w=!0:C==null||C.resume())}),C=Hn([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([k,$])=>{var M;(M=e.modelValue)!=null&&M.value&&Array.isArray(e.modelValue.value)&&(b==null||b.pause(),e.modelValue.value=[...k,...$],Pt(()=>{b==null||b.resume()}))},{immediate:w}),$i(()=>{b==null||b.stop(),C==null||C.stop()})})},r=()=>{o.run(()=>{let b,C,w=!!n.nodes.value.length;b=Hn([e.nodes,()=>{var k,$;return($=(k=e.nodes)==null?void 0:k.value)==null?void 0:$.length}],([k])=>{k&&Array.isArray(k)&&(C==null||C.pause(),n.setNodes(k),!C&&!w&&k.length?w=!0:C==null||C.resume())}),C=Hn([n.nodes,()=>n.nodes.value.length],([k])=>{var $;($=e.nodes)!=null&&$.value&&Array.isArray(e.nodes.value)&&(b==null||b.pause(),e.nodes.value=[...k],Pt(()=>{b==null||b.resume()}))},{immediate:w}),$i(()=>{b==null||b.stop(),C==null||C.stop()})})},s=()=>{o.run(()=>{let b,C,w=!!n.edges.value.length;b=Hn([e.edges,()=>{var k,$;return($=(k=e.edges)==null?void 0:k.value)==null?void 0:$.length}],([k])=>{k&&Array.isArray(k)&&(C==null||C.pause(),n.setEdges(k),!C&&!w&&k.length?w=!0:C==null||C.resume())}),C=Hn([n.edges,()=>n.edges.value.length],([k])=>{var $;($=e.edges)!=null&&$.value&&Array.isArray(e.edges.value)&&(b==null||b.pause(),e.edges.value=[...k],Pt(()=>{b==null||b.resume()}))},{immediate:w}),$i(()=>{b==null||b.stop(),C==null||C.stop()})})},l=()=>{o.run(()=>{xe(()=>t.maxZoom,()=>{t.maxZoom&&Fe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},a=()=>{o.run(()=>{xe(()=>t.minZoom,()=>{t.minZoom&&Fe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{xe(()=>t.translateExtent,()=>{t.translateExtent&&Fe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{xe(()=>t.nodeExtent,()=>{t.nodeExtent&&Fe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{xe(()=>t.applyDefault,()=>{Fe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},d=()=>{o.run(()=>{const b=async C=>{let w=C;typeof t.autoConnect=="function"&&(w=await t.autoConnect(C)),w!==!1&&n.addEdges([w])};xe(()=>t.autoConnect,()=>{Fe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),xe(n.autoConnect,(C,w,k)=>{C?n.onConnect(b):n.hooks.value.connect.off(b),k(()=>{n.hooks.value.connect.off(b)})},{immediate:!0})})},h=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const C of Object.keys(t)){const w=C;if(!b.includes(w)){const k=Ee(()=>t[w]),$=n[w];Be($)&&o.run(()=>{xe(k,M=>{Fe(M)&&($.value=M)},{immediate:!0})})}}};(()=>{i(),r(),s(),a(),l(),u(),c(),f(),d(),h()})()}),()=>o.stop()}function P0(){return{edgesChange:se(),nodesChange:se(),nodeDoubleClick:se(),nodeClick:se(),nodeMouseEnter:se(),nodeMouseMove:se(),nodeMouseLeave:se(),nodeContextMenu:se(),nodeDragStart:se(),nodeDrag:se(),nodeDragStop:se(),nodesInitialized:se(),miniMapNodeClick:se(),miniMapNodeDoubleClick:se(),miniMapNodeMouseEnter:se(),miniMapNodeMouseMove:se(),miniMapNodeMouseLeave:se(),connect:se(),connectStart:se(),connectEnd:se(),clickConnectStart:se(),clickConnectEnd:se(),paneReady:se(),init:se(),move:se(),moveStart:se(),moveEnd:se(),selectionDragStart:se(),selectionDrag:se(),selectionDragStop:se(),selectionContextMenu:se(),selectionStart:se(),selectionEnd:se(),viewportChangeStart:se(),viewportChange:se(),viewportChangeEnd:se(),paneScroll:se(),paneClick:se(),paneContextMenu:se(),paneMouseEnter:se(),paneMouseMove:se(),paneMouseLeave:se(),edgeContextMenu:se(),edgeMouseEnter:se(),edgeMouseMove:se(),edgeMouseLeave:se(),edgeDoubleClick:se(),edgeClick:se(),edgeUpdateStart:se(),edgeUpdate:se(),edgeUpdateEnd:se(),updateNodeInternals:se(),error:se(e=>ni(e.message))}}function D0(e,t){const n=vn();Qu(()=>{for(const[i,r]of Object.entries(t.value)){const s=l=>{e(i,l)};r.setEmitter(s),Bo(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),Bo(r.removeHasEmitListeners)}});function o(i){var r;const s=O0(i);return!!((r=n==null?void 0:n.vnode.props)==null?void 0:r[s])}}function O0(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function If(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:hl.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:To.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:xn.Bezier,style:{}},connectionMode:pn.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:Xo()?"Meta":"Control",zoomActivationKeyCode:Xo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:P0(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const R0=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function z0(e,t,n){const o=I0(e),i=p=>{const v=p??[];e.hooks.updateNodeInternals.trigger(v)},r=p=>Jy(p,e.nodes,e.edges),s=p=>jy(p,e.nodes,e.edges),l=p=>$n(p,e.edges),a=({id:p,type:v,nodeId:m})=>{var x;const S=p?`-${v}-${p}`:`-${v}`;return Array.from(((x=e.connectionLookup.get(`${m}${S}`))==null?void 0:x.values())??[])},u=p=>{if(p)return t.value.get(p)},c=p=>{if(p)return n.value.get(p)},f=(p,v,m)=>{var x,S;const z=[];for(const R of p){const O={id:R.id,type:"position",dragging:m,from:R.from};if(v&&(O.position=R.position,R.parentNode)){const L=u(R.parentNode);O.position={x:O.position.x-(((x=L==null?void 0:L.computedPosition)==null?void 0:x.x)??0),y:O.position.y-(((S=L==null?void 0:L.computedPosition)==null?void 0:S.y)??0)}}z.push(O)}z!=null&&z.length&&e.hooks.nodesChange.trigger(z)},d=p=>{if(!e.vueFlowRef)return;const v=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!v)return;const m=window.getComputedStyle(v),{m22:x}=new window.DOMMatrixReadOnly(m.transform),S=[];for(const z of p){const R=z,O=u(R.id);if(O){const L=Er(R.nodeElement);if(!!(L.width&&L.height&&(O.dimensions.width!==L.width||O.dimensions.height!==L.height||R.forceUpdate))){const j=R.nodeElement.getBoundingClientRect();O.dimensions=L,O.handleBounds.source=Fa("source",R.nodeElement,j,x,O.id),O.handleBounds.target=Fa("target",R.nodeElement,j,x,O.id),S.push({id:O.id,type:"dimensions",dimensions:L})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),S.length&&e.hooks.nodesChange.trigger(S)},h=(p,v)=>{const m=new Set,x=new Set;for(const R of p)Tn(R)?m.add(R.id):gn(R)&&x.add(R.id);const S=un(t.value,m,!0),z=un(n.value,x);if(e.multiSelectionActive){for(const R of m)S.push(sn(R,v));for(const R of x)z.push(sn(R,v))}S.length&&e.hooks.nodesChange.trigger(S),z.length&&e.hooks.edgesChange.trigger(z)},E=p=>{if(e.multiSelectionActive){const v=p.map(m=>sn(m.id,!0));e.hooks.nodesChange.trigger(v);return}e.hooks.nodesChange.trigger(un(t.value,new Set(p.map(v=>v.id)),!0)),e.hooks.edgesChange.trigger(un(n.value))},b=p=>{if(e.multiSelectionActive){const v=p.map(m=>sn(m.id,!0));e.hooks.edgesChange.trigger(v);return}e.hooks.edgesChange.trigger(un(n.value,new Set(p.map(v=>v.id)))),e.hooks.nodesChange.trigger(un(t.value,new Set,!0))},C=p=>{h(p,!0)},w=p=>{const m=(p||e.nodes).map(x=>(x.selected=!1,sn(x.id,!1)));e.hooks.nodesChange.trigger(m)},k=p=>{const m=(p||e.edges).map(x=>(x.selected=!1,sn(x.id,!1)));e.hooks.edgesChange.trigger(m)},$=p=>{if(!p||!p.length)return h([],!1);const v=p.reduce((m,x)=>{const S=sn(x.id,!1);return Tn(x)?m.nodes.push(S):m.edges.push(S),m},{nodes:[],edges:[]});v.nodes.length&&e.hooks.nodesChange.trigger(v.nodes),v.edges.length&&e.hooks.edgesChange.trigger(v.edges)},M=p=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([p,e.maxZoom]),e.minZoom=p},B=p=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,p]),e.maxZoom=p},G=p=>{var v;(v=e.d3Zoom)==null||v.translateExtent(p),e.translateExtent=p},F=p=>{e.nodeExtent=p,i()},X=p=>{var v;(v=e.d3Zoom)==null||v.clickDistance(p)},ne=p=>{e.nodesDraggable=p,e.nodesConnectable=p,e.elementsSelectable=p},W=p=>{const v=p instanceof Function?p(e.nodes):p;!e.initialized&&!v.length||(e.nodes=La(v,u,e.hooks.error.trigger))},q=p=>{const v=p instanceof Function?p(e.edges):p;if(!e.initialized&&!v.length)return;const m=ts(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);es(e.connectionLookup,n.value,m),e.edges=m},I=p=>{const v=p instanceof Function?p([...e.nodes,...e.edges]):p;!e.initialized&&!v.length||(W(v.filter(Tn)),q(v.filter(gn)))},re=p=>{let v=p instanceof Function?p(e.nodes):p;v=Array.isArray(v)?v:[v];const m=La(v,u,e.hooks.error.trigger),x=[];for(const S of m)x.push(Pa(S));x.length&&e.hooks.nodesChange.trigger(x)},g=p=>{let v=p instanceof Function?p(e.edges):p;v=Array.isArray(v)?v:[v];const m=ts(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),x=[];for(const S of m)x.push(Pa(S));x.length&&e.hooks.edgesChange.trigger(x)},P=(p,v=!0,m=!1)=>{const x=p instanceof Function?p(e.nodes):p,S=Array.isArray(x)?x:[x],z=[],R=[];function O(V){const j=l(V);for(const oe of j)(!Fe(oe.deletable)||oe.deletable)&&R.push(Oa(oe.id,oe.source,oe.target,oe.sourceHandle,oe.targetHandle))}function L(V){const j=[];for(const oe of e.nodes)oe.parentNode===V&&j.push(oe);if(j.length){for(const oe of j)z.push(Da(oe.id));v&&O(j);for(const oe of j)L(oe.id)}}for(const V of S){const j=typeof V=="string"?u(V):V;j&&(Fe(j.deletable)&&!j.deletable||(z.push(Da(j.id)),v&&O([j]),m&&L(j.id)))}R.length&&e.hooks.edgesChange.trigger(R),z.length&&e.hooks.nodesChange.trigger(z)},_=p=>{const v=p instanceof Function?p(e.edges):p,m=Array.isArray(v)?v:[v],x=[];for(const S of m){const z=typeof S=="string"?c(S):S;z&&(Fe(z.deletable)&&!z.deletable||x.push(Oa(typeof S=="string"?S:S.id,z.source,z.target,z.sourceHandle,z.targetHandle)))}e.hooks.edgesChange.trigger(x)},A=(p,v,m=!0)=>{const x=c(p.id);if(!x)return!1;const S=e.edges.indexOf(x),z=w0(p,v,x,m,e.hooks.error.trigger);if(z){const[R]=ts([z],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((O,L)=>L===S?R:O),es(e.connectionLookup,n.value,[R]),R}return!1},T=(p,v,m={replace:!1})=>{const x=c(p);if(!x)return;const S=typeof v=="function"?v(x):v;x.data=m.replace?S:{...x.data,...S}},H=p=>Aa(p,e.nodes),D=p=>{const v=Aa(p,e.edges);return es(e.connectionLookup,n.value,v),v},Y=(p,v,m={replace:!1})=>{const x=u(p);if(!x)return;const S=typeof v=="function"?v(x):v;m.replace?e.nodes.splice(e.nodes.indexOf(x),1,S):Object.assign(x,S)},J=(p,v,m={replace:!1})=>{const x=u(p);if(!x)return;const S=typeof v=="function"?v(x):v;x.data=m.replace?S:{...x.data,...S}},le=(p,v,m=!1)=>{m?e.connectionClickStartHandle=p:e.connectionStartHandle=p,e.connectionEndHandle=null,e.connectionStatus=null,v&&(e.connectionPosition=v)},ue=(p,v=null,m=null)=>{e.connectionStartHandle&&(e.connectionPosition=p,e.connectionEndHandle=v,e.connectionStatus=m)},Q=(p,v)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,v?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ee=p=>{const v=Zy(p),m=v?null:_o(p)?p:u(p.id);return!v&&!m?[null,null,v]:[v?p:ji(m),m,v]},ie=(p,v=!0,m=e.nodes)=>{const[x,S,z]=ee(p);if(!x)return[];const R=[];for(const O of m||e.nodes){if(!z&&(O.id===S.id||!O.computedPosition))continue;const L=ji(O),V=Ji(L,x);(v&&V>0||V>=L.width*L.height||V>=Number(x.width)*Number(x.height))&&R.push(O)}return R},fe=(p,v,m=!0)=>{const[x]=ee(p);if(!x)return!1;const S=Ji(x,v);return m&&S>0||S>=Number(x.width)*Number(x.height)},we=p=>{const{viewport:v,dimensions:m,d3Zoom:x,d3Selection:S,translateExtent:z}=e;if(!x||!S||!p.x&&!p.y)return!1;const R=oo.translate(v.x+p.x,v.y+p.y).scale(v.zoom),O=[[0,0],[m.width,m.height]],L=x.constrain()(R,O,z),V=e.viewport.x!==L.x||e.viewport.y!==L.y||e.viewport.zoom!==L.k;return x.transform(S,L),V},he=p=>{const v=p instanceof Function?p(e):p,m=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Fe(v.defaultEdgeOptions)&&(e.defaultEdgeOptions=v.defaultEdgeOptions);const x=v.modelValue||v.nodes||v.edges?[]:void 0;x&&(v.modelValue&&x.push(...v.modelValue),v.nodes&&x.push(...v.nodes),v.edges&&x.push(...v.edges),I(x));const S=()=>{Fe(v.maxZoom)&&B(v.maxZoom),Fe(v.minZoom)&&M(v.minZoom),Fe(v.translateExtent)&&G(v.translateExtent)};for(const z of Object.keys(v)){const R=z,O=v[R];![...R0,...m].includes(R)&&Fe(O)&&(e[R]=O)}ms(()=>e.d3Zoom).not.toBeNull().then(S),e.initialized||(e.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:d,setElements:I,setNodes:W,setEdges:q,addNodes:re,addEdges:g,removeNodes:P,removeEdges:_,findNode:u,findEdge:c,updateEdge:A,updateEdgeData:T,updateNode:Y,updateNodeData:J,applyEdgeChanges:D,applyNodeChanges:H,addSelectedElements:C,addSelectedNodes:E,addSelectedEdges:b,setMinZoom:M,setMaxZoom:B,setTranslateExtent:G,setNodeExtent:F,setPaneClickDistance:X,removeSelectedElements:$,removeSelectedNodes:w,removeSelectedEdges:k,startConnection:le,updateConnection:ue,endConnection:Q,setInteractive:ne,setState:he,getIntersectingNodes:ie,getIncomers:r,getOutgoers:s,getConnectedEdges:l,getHandleConnections:a,isNodeIntersecting:fe,panBy:we,fitView:p=>o.value.fitView(p),zoomIn:p=>o.value.zoomIn(p),zoomOut:p=>o.value.zoomOut(p),zoomTo:(p,v)=>o.value.zoomTo(p,v),setViewport:(p,v)=>o.value.setViewport(p,v),setTransform:(p,v)=>o.value.setTransform(p,v),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(p,v,m)=>o.value.setCenter(p,v,m),fitBounds:(p,v)=>o.value.fitBounds(p,v),project:p=>o.value.project(p),screenToFlowCoordinate:p=>o.value.screenToFlowCoordinate(p),flowToScreenCoordinate:p=>o.value.flowToScreenCoordinate(p),toObject:()=>{const p=[],v=[];for(const m of e.nodes){const{computedPosition:x,handleBounds:S,selected:z,dimensions:R,isParent:O,resizing:L,dragging:V,events:j,...oe}=m;p.push(oe)}for(const m of e.edges){const{selected:x,sourceNode:S,targetNode:z,events:R,...O}=m;v.push(O)}return JSON.parse(JSON.stringify({nodes:p,edges:v,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:p=>new Promise(v=>{const{nodes:m,edges:x,position:S,zoom:z,viewport:R}=p;m&&W(m),x&&q(x);const[O,L]=R!=null&&R.x&&(R!=null&&R.y)?[R.x,R.y]:S??[null,null];if(O&&L){const V=(R==null?void 0:R.zoom)||z||e.viewport.zoom;return ms(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:O,y:L,zoom:V}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const p=If();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const v=oo.translate(p.defaultViewport.x??0,p.defaultViewport.y??0).scale(Dn(p.defaultViewport.zoom??1,p.minZoom,p.maxZoom)),m=e.viewportRef.getBoundingClientRect(),x=[[0,0],[m.width,m.height]],S=e.d3Zoom.constrain()(v,x,p.translateExtent);e.d3Zoom.transform(e.d3Selection,S)}he(p)},$destroy:()=>{}}}const B0=["data-id","data-handleid","data-nodeid","data-handlepos"],H0={name:"Handle",compatConfig:{MODE:3}},On=Pe({...H0,props:{id:{default:null},type:{},position:{default:()=>ae.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=bh(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ee(()=>n.type??"source"),i=Ee(()=>n.isValidConnection??null),{id:r,connectionStartHandle:s,connectionClickStartHandle:l,connectionEndHandle:a,vueFlowRef:u,nodesConnectable:c,noDragClassName:f,noPanClassName:d}=ke(),{id:h,node:E,nodeEl:b,connectedEdges:C}=kf(),w=ye(),k=Ee(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),$=Ee(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),M=Ee(()=>{var q,I,re,g,P,_;return((q=s.value)==null?void 0:q.nodeId)===h&&((I=s.value)==null?void 0:I.id)===e.id&&((re=s.value)==null?void 0:re.type)===o.value||((g=a.value)==null?void 0:g.nodeId)===h&&((P=a.value)==null?void 0:P.id)===e.id&&((_=a.value)==null?void 0:_.type)===o.value}),B=Ee(()=>{var q,I,re;return((q=l.value)==null?void 0:q.nodeId)===h&&((I=l.value)==null?void 0:I.id)===e.id&&((re=l.value)==null?void 0:re.type)===o.value}),{handlePointerDown:G,handleClick:F}=Mf({nodeId:h,handleId:e.id,isValidConnection:i,type:o}),X=ce(()=>typeof e.connectable=="string"&&e.connectable==="single"?!C.value.some(q=>{const I=q[`${o.value}Handle`];return q[o.value]!==h?!1:I?I===e.id:!0}):typeof e.connectable=="number"?C.value.filter(q=>{const I=q[`${o.value}Handle`];return q[o.value]!==h?!1:I?I===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(E,C.value):Fe(e.connectable)?e.connectable:c.value);_t(()=>{var q;if(!E.dimensions.width||!E.dimensions.height)return;const I=(q=E.handleBounds[o.value])==null?void 0:q.find(H=>H.id===e.id);if(!u.value||I)return;const re=u.value.querySelector(".vue-flow__transformationpane");if(!b.value||!w.value||!re||!e.id)return;const g=b.value.getBoundingClientRect(),P=w.value.getBoundingClientRect(),_=window.getComputedStyle(re),{m22:A}=new window.DOMMatrixReadOnly(_.transform),T={id:e.id,position:e.position,x:(P.left-g.left)/A,y:(P.top-g.top)/A,type:o.value,nodeId:h,...Er(w.value)};E.handleBounds[o.value]=[...E.handleBounds[o.value]??[],T]});function ne(q){const I=vl(q);X.value&&k.value&&(I&&q.button===0||!I)&&G(q)}function W(q){!h||!l.value&&!k.value||X.value&&F(q)}return t({handleClick:F,handlePointerDown:G,onClick:W,onPointerDown:ne}),(q,I)=>(K(),te("div",{ref_key:"handle",ref:w,"data-id":`${Z(r)}-${Z(h)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":Z(h),"data-handlepos":q.position,class:Xe(["vue-flow__handle",[`vue-flow__handle-${q.position}`,`vue-flow__handle-${e.id}`,Z(f),Z(d),o.value,{connectable:X.value,connecting:B.value,connectablestart:k.value,connectableend:$.value,connectionindicator:X.value&&(k.value&&!M.value||$.value&&M.value)}]]),onMousedown:ne,onTouchstartPassive:ne,onClick:W},[Re(q.$slots,"default",{id:q.id})],42,B0))}}),Mr=function({sourcePosition:e=ae.Bottom,targetPosition:t=ae.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const l=s.label??n;return[Ce(On,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof l!="string"&&l?Ce(l):Ce(be,[l]),Ce(On,{type:"source",position:e,connectable:o,isValidConnection:r})]};Mr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Mr.inheritAttrs=!1;Mr.compatConfig={MODE:3};const V0=Mr,kr=function({targetPosition:e=ae.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??t;return[Ce(On,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?Ce(r):Ce(be,[r])]};kr.props=["targetPosition","label","isValidTargetPos","connectable","data"];kr.inheritAttrs=!1;kr.compatConfig={MODE:3};const F0=kr,Tr=function({sourcePosition:e=ae.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??t;return[typeof r!="string"&&r?Ce(r):Ce(be,[r]),Ce(On,{type:"source",position:e,connectable:n,isValidConnection:o})]};Tr.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Tr.inheritAttrs=!1;Tr.compatConfig={MODE:3};const L0=Tr,Y0=["transform"],G0=["width","height","x","y","rx","ry"],U0=["y"],X0={name:"EdgeText",compatConfig:{MODE:3}},W0=Pe({...X0,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ye({x:0,y:0,width:0,height:0}),n=ye(null),o=ce(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);_t(i),xe([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(K(),te("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(K(),te("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:tt(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,G0)):Ae("",!0),U("text",Ro(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Re(r.$slots,"default",{},()=>[typeof r.label!="string"?(K(),Ve(bn(r.label),{key:0})):(K(),te(be,{key:1},[hn(Oe(r.label),1)],64))])],16,U0)],8,Y0))}}),K0=["id","d","marker-end","marker-start"],Z0=["d","stroke-width"],q0={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Ir=Pe({...q0,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ye(null),o=ye(null),i=ye(null),r=nl();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,l)=>(K(),te(be,null,[U("path",Ro(Z(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,K0),s.interactionWidth?(K(),te("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Z0)):Ae("",!0),s.label&&s.labelX&&s.labelY?(K(),Ve(W0,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Ae("",!0)],64))}});function Af({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,l=o<t?o+s:o-s;return[r,l,i,s]}function Pf({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:l}){const a=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+l*.375+o*.125,c=Math.abs(a-e),f=Math.abs(u-t);return[a,u,c,f]}function vi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xa({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,l;switch(e){case ae.Left:s=t-vi(t-o,r),l=n;break;case ae.Right:s=t+vi(o-t,r),l=n;break;case ae.Top:s=t,l=n-vi(n-i,r);break;case ae.Bottom:s=t,l=n+vi(i-n,r);break}return[s,l]}function Df(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:r,targetPosition:s=ae.Top,curvature:l=.25}=e,[a,u]=Xa({pos:o,x1:t,y1:n,x2:i,y2:r,c:l}),[c,f]=Xa({pos:s,x1:i,y1:r,x2:t,y2:n,c:l}),[d,h,E,b]=Pf({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${t},${n} C${a},${u} ${c},${f} ${i},${r}`,d,h,E,b]}function Wa({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case ae.Left:case ae.Right:r=.5*(t+o),s=n;break;case ae.Top:case ae.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function Of(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:r,targetPosition:s=ae.Top}=e,[l,a]=Wa({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=Wa({pos:s,x1:i,y1:r,x2:t,y2:n}),[f,d,h,E]=Pf({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${t},${n} C${l},${a} ${u},${c} ${i},${r}`,f,d,h,E]}const Ka={[ae.Left]:{x:-1,y:0},[ae.Right]:{x:1,y:0},[ae.Top]:{x:0,y:-1},[ae.Bottom]:{x:0,y:1}};function j0({source:e,sourcePosition:t=ae.Bottom,target:n}){return t===ae.Left||t===ae.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}}function Za(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function J0({source:e,sourcePosition:t=ae.Bottom,target:n,targetPosition:o=ae.Top,center:i,offset:r}){const s=Ka[t],l=Ka[o],a={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+l.x*r,y:n.y+l.y*r},c=j0({source:a,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",d=c[f];let h,E,b;const C={x:0,y:0},w={x:0,y:0},[k,$,M,B]=Af({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){E=i.x??k,b=i.y??$;const F=[{x:E,y:a.y},{x:E,y:u.y}],X=[{x:a.x,y:b},{x:u.x,y:b}];s[f]===d?h=f==="x"?F:X:h=f==="x"?X:F}else{const F=[{x:a.x,y:u.y}],X=[{x:u.x,y:a.y}];if(f==="x"?h=s.x===d?X:F:h=s.y===d?F:X,t===o){const re=Math.abs(e[f]-n[f]);if(re<=r){const g=Math.min(r-1,r-re);s[f]===d?C[f]=(a[f]>e[f]?-1:1)*g:w[f]=(u[f]>n[f]?-1:1)*g}}if(t!==o){const re=f==="x"?"y":"x",g=s[f]===l[re],P=a[re]>u[re],_=a[re]<u[re];(s[f]===1&&(!g&&P||g&&_)||s[f]!==1&&(!g&&_||g&&P))&&(h=f==="x"?F:X)}const ne={x:a.x+C.x,y:a.y+C.y},W={x:u.x+w.x,y:u.y+w.y},q=Math.max(Math.abs(ne.x-h[0].x),Math.abs(W.x-h[0].x)),I=Math.max(Math.abs(ne.y-h[0].y),Math.abs(W.y-h[0].y));q>=I?(E=(ne.x+W.x)/2,b=h[0].y):(E=h[0].x,b=(ne.y+W.y)/2)}return[[e,{x:a.x+C.x,y:a.y+C.y},...h,{x:u.x+w.x,y:u.y+w.y},n],E,b,M,B]}function Q0(e,t,n,o){const i=Math.min(Za(e,t)/2,Za(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${r},${s+i*a}Q ${r},${s} ${r+i*l},${s}`}function Is(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:r,targetPosition:s=ae.Top,borderRadius:l=5,centerX:a,centerY:u,offset:c=20}=e,[f,d,h,E,b]=J0({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:a,y:u},offset:c});return[f.reduce((w,k,$)=>{let M;return $>0&&$<f.length-1?M=Q0(f[$-1],k,f[$+1],l):M=`${$===0?"M":"L"}${k.x} ${k.y}`,w+=M,w},""),d,h,E,b]}function e_(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,l,a]=Af({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,l,a]}const t_=Pe({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=e_(e);return Ce(Ir,{path:n,labelX:o,labelY:i,...t,...e})}}}),n_=t_,o_=Pe({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Is({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return Ce(Ir,{path:n,labelX:o,labelY:i,...t,...e})}}}),Rf=o_,i_=Pe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Ce(Rf,{...e,...t,borderRadius:0})}}),r_=i_,s_=Pe({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Df({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return Ce(Ir,{path:n,labelX:o,labelY:i,...t,...e})}}}),l_=s_,a_=Pe({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Of({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return Ce(Ir,{path:n,labelX:o,labelY:i,...t,...e})}}}),u_=a_,c_={input:L0,default:V0,output:F0},f_={default:l_,straight:n_,step:r_,smoothstep:Rf,simplebezier:u_};function d_(e,t,n){const o=ce(()=>b=>t.value.get(b)),i=ce(()=>b=>n.value.get(b)),r=ce(()=>{const b={...f_,...e.edgeTypes},C=Object.keys(b);for(const w of e.edges)w.type&&!C.includes(w.type)&&(b[w.type]=w.type);return b}),s=ce(()=>{const b={...c_,...e.nodeTypes},C=Object.keys(b);for(const w of e.nodes)w.type&&!C.includes(w.type)&&(b[w.type]=w.type);return b}),l=ce(()=>e.onlyRenderVisibleElements?yf(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),a=ce(()=>{if(e.onlyRenderVisibleElements){const b=[];for(const C of e.edges){const w=t.value.get(C.source),k=t.value.get(C.target);a0({sourcePos:w.computedPosition||{x:0,y:0},targetPos:k.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:k.dimensions.width,targetHeight:k.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(C)}return b}return e.edges}),u=ce(()=>[...l.value,...a.value]),c=ce(()=>{const b=[];for(const C of e.nodes)C.selected&&b.push(C);return b}),f=ce(()=>{const b=[];for(const C of e.edges)C.selected&&b.push(C);return b}),d=ce(()=>[...c.value,...f.value]),h=ce(()=>{const b=[];for(const C of e.nodes)C.dimensions.width&&C.dimensions.height&&C.handleBounds!==void 0&&b.push(C);return b}),E=ce(()=>l.value.length>0&&h.value.length===l.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:a,getNodes:l,getSelectedElements:d,getSelectedNodes:c,getSelectedEdges:f,getNodesInitialized:h,areNodesInitialized:E}}class Sn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=vn())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??Sn.instance;return Sn.instance=o??new Sn,n&&(n.config.globalProperties.$vueFlowStorage=Sn.instance),Sn.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=If(),i=pr(o),r={};for(const[d,h]of Object.entries(i.hooks)){const E=`on${d.charAt(0).toUpperCase()+d.slice(1)}`;r[E]=h.on}const s={};for(const[d,h]of Object.entries(i.hooks))s[d]=h.trigger;const l=ce(()=>{const d=new Map;for(const h of i.nodes)d.set(h.id,h);return d}),a=ce(()=>{const d=new Map;for(const h of i.edges)d.set(h.id,h);return d}),u=d_(i,l,a),c=z0(i,l,a);c.setState({...i,...n});const f={...r,...u,...c,...ig(i),nodeLookup:l,edgeLookup:a,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function ke(e){const t=Sn.getInstance(),n=Us(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r??(n==null?void 0:n.vueFlowId);let l;if(n){const a=ct(Ua,null);typeof a<"u"&&a!==null&&(!s||a.id===s)&&(l=a)}if(l||s&&(l=t.get(s)),!l||s&&l.id!==s){const a=r??t.getId(),u=t.create(a,i);l=u,(n??Eu(!0)).run(()=>{xe(u.applyDefault,(f,d,h)=>{const E=C=>{u.applyNodeChanges(C)},b=C=>{u.applyEdgeChanges(C)};f?(u.onNodesChange(E),u.onEdgesChange(b)):(u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(b)),h(()=>{u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(b)})},{immediate:!0}),Bo(()=>{if(l){const f=t.get(l.id);f?f.$destroy():ni(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&(Qt(Ua,l),n.vueFlowId=l.id),o){const a=vn();(a==null?void 0:a.type.name)!=="VueFlow"&&l.emits.error(new Ge(Le.USEVUEFLOW_OPTIONS))}return l}function h_(e){const{emits:t,dimensions:n}=ke();let o;_t(()=>{const i=()=>{var r,s;if(!e.value||!(((s=(r=e.value).checkVisibility)==null?void 0:s.call(r))??!0))return;const l=Er(e.value);(l.width===0||l.height===0)&&t.error(new Ge(Le.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),el(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const p_={name:"UserSelection",compatConfig:{MODE:3}},g_=Pe({...p_,props:{userSelectionRect:{}},setup(e){return(t,n)=>(K(),te("div",{class:"vue-flow__selection vue-flow__container",style:tt({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),v_=["tabIndex"],m_={name:"NodesSelection",compatConfig:{MODE:3}},y_=Pe({...m_,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=ke(),l=Tf(),a=ye(null),u=Cf({el:a,onStart(E){t.selectionDragStart(E),t.nodeDragStart(E)},onDrag(E){t.selectionDrag(E),t.nodeDrag(E)},onStop(E){t.selectionDragStop(E),t.nodeDragStop(E)}});_t(()=>{var E;r.value||(E=a.value)==null||E.focus({preventScroll:!0})});const c=ce(()=>pl(o.value)),f=ce(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function d(E){t.selectionContextMenu({event:E,nodes:o.value})}function h(E){r.value||qn[E.key]&&(E.preventDefault(),l({x:qn[E.key].x,y:qn[E.key].y},E.shiftKey))}return(E,b)=>!Z(s)&&c.value.width&&c.value.height?(K(),te("div",{key:0,class:Xe(["vue-flow__nodesselection vue-flow__container",Z(i)]),style:tt({transform:`translate(${Z(n).x}px,${Z(n).y}px) scale(${Z(n).zoom})`})},[U("div",{ref_key:"el",ref:a,class:Xe([{dragging:Z(u)},"vue-flow__nodesselection-rect"]),style:tt(f.value),tabIndex:Z(r)?void 0:-1,onContextmenu:d,onKeydown:h},null,46,v_)],6)):Ae("",!0)}});function __(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const w_={name:"Pane",compatConfig:{MODE:3}},b_=Pe({...w_,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:l,elementsSelectable:a,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:f,removeNodes:d,removeEdges:h,selectionMode:E,deleteKeyCode:b,multiSelectionKeyCode:C,multiSelectionActive:w,edgeLookup:k,nodeLookup:$,connectionLookup:M,defaultEdgeOptions:B,connectionStartHandle:G,panOnDrag:F}=ke(),X=dn(null),ne=dn(new Set),W=dn(new Set),q=dn(null),I=Ee(()=>a.value&&(e.isSelecting||r.value)),re=Ee(()=>G.value!==null);let g=!1,P=!1;const _=Io(b,{actInsideInputWithModifier:!1}),A=Io(C);xe(_,Q=>{Q&&(d(f.value),h(c.value),u.value=!1)}),xe(A,Q=>{w.value=Q});function T(Q,ee){return ie=>{ie.target===ee&&(Q==null||Q(ie))}}function H(Q){if(g||re.value){g=!1;return}i.paneClick(Q),s(),u.value=!1}function D(Q){var ee;if(Array.isArray(F.value)&&((ee=F.value)!=null&&ee.includes(2))){Q.preventDefault();return}i.paneContextMenu(Q)}function Y(Q){i.paneScroll(Q)}function J(Q){var ee,ie,fe;if(q.value=((ee=t.value)==null?void 0:ee.getBoundingClientRect())??null,!a.value||!e.isSelecting||Q.button!==0||Q.target!==X.value||!q.value)return;(fe=(ie=Q.target)==null?void 0:ie.setPointerCapture)==null||fe.call(ie,Q.pointerId);const{x:we,y:he}=__(Q,q.value);P=!0,g=!1,s(),l.value={width:0,height:0,startX:we,startY:he,x:we,y:he},i.selectionStart(Q)}function le(Q){var ee;if(!q.value||!l.value)return;g=!0;const{x:ie,y:fe}=It(Q,q.value),{startX:we=0,startY:he=0}=l.value,$e={startX:we,startY:he,x:ie<we?ie:we,y:fe<he?fe:he,width:Math.abs(ie-we),height:Math.abs(fe-he)},y=ne.value,N=W.value;ne.value=new Set(yf(n.value,$e,o.value,E.value===hl.Partial,!0).map(v=>v.id)),W.value=new Set;const p=((ee=B.value)==null?void 0:ee.selectable)??!0;for(const v of ne.value){const m=M.value.get(v);if(m)for(const{edgeId:x}of m.values()){const S=k.value.get(x);S&&(S.selectable??p)&&W.value.add(x)}}if(!Ga(y,ne.value)){const v=un($.value,ne.value,!0);i.nodesChange(v)}if(!Ga(N,W.value)){const v=un(k.value,W.value);i.edgesChange(v)}l.value=$e,r.value=!0,u.value=!1}function ue(Q){var ee;Q.button!==0||!P||((ee=Q.target)==null||ee.releasePointerCapture(Q.pointerId),!r.value&&l.value&&Q.target===X.value&&H(Q),r.value=!1,l.value=null,u.value=ne.value.size>0,i.selectionEnd(Q),e.selectionKeyPressed&&(g=!1),P=!1)}return(Q,ee)=>(K(),te("div",{ref_key:"container",ref:X,class:Xe(["vue-flow__pane vue-flow__container",{selection:Q.isSelecting}]),onClick:ee[0]||(ee[0]=ie=>I.value?void 0:T(H,X.value)(ie)),onContextmenu:ee[1]||(ee[1]=ie=>T(D,X.value)(ie)),onWheelPassive:ee[2]||(ee[2]=ie=>T(Y,X.value)(ie)),onPointerenter:ee[3]||(ee[3]=ie=>I.value?void 0:Z(i).paneMouseEnter(ie)),onPointerdown:ee[4]||(ee[4]=ie=>I.value?J(ie):Z(i).paneMouseMove(ie)),onPointermove:ee[5]||(ee[5]=ie=>I.value?le(ie):Z(i).paneMouseMove(ie)),onPointerup:ee[6]||(ee[6]=ie=>I.value?ue(ie):void 0),onPointerleave:ee[7]||(ee[7]=ie=>Z(i).paneMouseLeave(ie))},[Re(Q.$slots,"default"),Z(r)&&Z(l)?(K(),Ve(g_,{key:0,"user-selection-rect":Z(l)},null,8,["user-selection-rect"])):Ae("",!0),Z(u)&&Z(f).length?(K(),Ve(y_,{key:1})):Ae("",!0)],34))}}),x_={name:"Transform",compatConfig:{MODE:3}},$_=Pe({...x_,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=ke(),i=ce(()=>n.value?!o.value:!1),r=ce(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,l)=>(K(),te("div",{class:"vue-flow__transformationpane vue-flow__container",style:tt({transform:r.value,opacity:i.value?0:void 0})},[Re(s.$slots,"default")],4))}}),S_={name:"Viewport",compatConfig:{MODE:3}},E_=Pe({...S_,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:l,panOnScroll:a,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:f,zoomOnDoubleClick:d,zoomOnPinch:h,zoomOnScroll:E,preventScrolling:b,noWheelClassName:C,noPanClassName:w,emits:k,connectionStartHandle:$,userSelectionActive:M,paneDragging:B,d3Zoom:G,d3Selection:F,d3ZoomHandler:X,viewport:ne,viewportRef:W,paneClickDistance:q}=ke();h_(W);const I=dn(!1),re=dn(!1);let g=null,P=!1,_=0,A={x:0,y:0,zoom:0};const T=Io(l),H=Io(s),D=Io(r),Y=Ee(()=>(!H.value||H.value&&s.value===!0)&&(T.value||f.value)),J=Ee(()=>T.value||a.value),le=Ee(()=>s.value===!0&&Y.value!==!0),ue=Ee(()=>H.value&&s.value!==!0||M.value||le.value),Q=Ee(()=>$.value!==null);_t(()=>{if(!W.value){ni("Viewport element is missing");return}const he=W.value,$e=he.getBoundingClientRect(),y=Ly().clickDistance(q.value).scaleExtent([t.value,n.value]).translateExtent(i.value),N=ht(he).call(y),p=N.on("wheel.zoom"),v=oo.translate(o.value.x??0,o.value.y??0).scale(Dn(o.value.zoom??1,t.value,n.value)),m=[[0,0],[$e.width,$e.height]],x=y.constrain()(v,m,i.value);y.transform(N,x),y.wheelDelta(Ms),G.value=y,F.value=N,X.value=p,ne.value={x:x.x,y:x.y,zoom:x.k},y.on("start",S=>{var z;if(!S.sourceEvent)return null;_=S.sourceEvent.button,I.value=!0;const R=fe(S.transform);((z=S.sourceEvent)==null?void 0:z.type)==="mousedown"&&(B.value=!0),A=R,k.viewportChangeStart(R),k.moveStart({event:S,flowTransform:R})}),y.on("end",S=>{if(!S.sourceEvent)return null;if(I.value=!1,B.value=!1,ee(Y.value,_??0)&&!P&&k.paneContextMenu(S.sourceEvent),P=!1,ie(A,S.transform)){const z=fe(S.transform);A=z,k.viewportChangeEnd(z),k.moveEnd({event:S,flowTransform:z})}}),y.filter(S=>{var z;const R=D.value||E.value,O=h.value&&S.ctrlKey,L=S.button,V=S.type==="wheel";if(L===1&&S.type==="mousedown"&&(we(S,"vue-flow__node")||we(S,"vue-flow__edge")))return!0;if(!Y.value&&!R&&!J.value&&!d.value&&!h.value||M.value||Q.value&&!V||!d.value&&S.type==="dblclick"||we(S,C.value)&&V||we(S,w.value)&&(!V||J.value&&V&&!D.value)||!h.value&&S.ctrlKey&&V||!R&&!J.value&&!O&&V)return!1;if(!h&&S.type==="touchstart"&&((z=S.touches)==null?void 0:z.length)>1)return S.preventDefault(),!1;if(!Y.value&&(S.type==="mousedown"||S.type==="touchstart")||le.value&&Array.isArray(f.value)&&f.value.includes(0)&&L===0||Array.isArray(f.value)&&!f.value.includes(L)&&(S.type==="mousedown"||S.type==="touchstart"))return!1;const j=Array.isArray(f.value)&&f.value.includes(L)||s.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!L||L<=1;return(!S.ctrlKey||T.value||V)&&j}),xe([M,Y],()=>{M.value&&!I.value?y.on("zoom",null):M.value||y.on("zoom",S=>{ne.value={x:S.transform.x,y:S.transform.y,zoom:S.transform.k};const z=fe(S.transform);P=ee(Y.value,_??0),k.viewportChange(z),k.move({event:S,flowTransform:z})})},{immediate:!0}),xe([M,J,u,D,h,b,C],()=>{J.value&&!D.value&&!M.value?N.on("wheel.zoom",S=>{if(we(S,C.value))return!1;const z=D.value||E.value,R=h.value&&S.ctrlKey;if(!(!b.value||J.value||z||R))return!1;S.preventDefault(),S.stopImmediatePropagation();const L=N.property("__zoom").k||1,V=Xo();if(!T.value&&S.ctrlKey&&h.value&&V){const Te=Ct(S),ze=Ms(S),Ye=L*2**ze;y.scaleTo(N,Ye,Te,S);return}const j=S.deltaMode===1?20:1;let oe=u.value===To.Vertical?0:S.deltaX*j,ge=u.value===To.Horizontal?0:S.deltaY*j;!V&&S.shiftKey&&u.value!==To.Vertical&&!oe&&ge&&(oe=ge,ge=0),y.translateBy(N,-(oe/L)*c.value,-(ge/L)*c.value);const ve=fe(N.property("__zoom"));g&&clearTimeout(g),re.value?(k.move({event:S,flowTransform:ve}),k.viewportChange(ve),g=setTimeout(()=>{k.moveEnd({event:S,flowTransform:ve}),k.viewportChangeEnd(ve),re.value=!1},150)):(re.value=!0,k.moveStart({event:S,flowTransform:ve}),k.viewportChangeStart(ve))},{passive:!1}):typeof p<"u"&&N.on("wheel.zoom",function(S,z){const R=!b.value&&S.type==="wheel"&&!S.ctrlKey,O=D.value||E.value,L=h.value&&S.ctrlKey;if(!O&&!a.value&&!L&&S.type==="wheel"||R||we(S,C.value))return null;S.preventDefault(),p.call(this,S,z)},{passive:!1})},{immediate:!0})});function ee(he,$e){return $e===2&&Array.isArray(he)&&he.includes(2)}function ie(he,$e){return he.x!==$e.x&&!Number.isNaN($e.x)||he.y!==$e.y&&!Number.isNaN($e.y)||he.zoom!==$e.k&&!Number.isNaN($e.k)}function fe(he){return{x:he.x,y:he.y,zoom:he.k}}function we(he,$e){return he.target.closest(`.${$e}`)}return(he,$e)=>(K(),te("div",{ref_key:"viewportRef",ref:W,class:"vue-flow__viewport vue-flow__container"},[me(b_,{"is-selecting":ue.value,"selection-key-pressed":Z(H),class:Xe({connecting:Q.value,dragging:Z(B),draggable:Z(f)===!0||Array.isArray(Z(f))&&Z(f).includes(0)})},{default:dt(()=>[me($_,null,{default:dt(()=>[Re(he.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),N_=["id"],C_=["id"],M_=["id"],k_={name:"A11yDescriptions",compatConfig:{MODE:3}},T_=Pe({...k_,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=ke();return(i,r)=>(K(),te(be,null,[U("div",{id:`${Z(uf)}-${Z(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Oe(Z(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,N_),U("div",{id:`${Z(cf)}-${Z(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,C_),Z(n)?Ae("",!0):(K(),te("div",{key:0,id:`${Z(Ky)}-${Z(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Oe(Z(o)),9,M_))],64))}});function I_(){const e=ke();xe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function A_(e,t,n){return n===ae.Left?e-t:n===ae.Right?e+t:e}function P_(e,t,n){return n===ae.Top?e-t:n===ae.Bottom?e+t:e}const ml=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=ae.Top,type:i}){return Ce("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:A_(t,e,o),cy:P_(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};ml.props=["radius","centerX","centerY","position","type"];ml.compatConfig={MODE:3};const qa=ml,D_=Pe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:l,getEdgeTypes:a,removeSelectedEdges:u,findEdge:c,findNode:f,isValidConnection:d,multiSelectionActive:h,disableKeyboardA11y:E,elementsSelectable:b,edgesUpdatable:C,edgesFocusable:w,hooks:k}=ke(),$=ce(()=>c(e.id)),{emit:M,on:B}=S0($.value,r),G=ct(Cr),F=vn(),X=ye(!1),ne=ye(!1),W=ye(""),q=ye(null),I=ye("source"),re=ye(null),g=Ee(()=>typeof $.value.selectable>"u"?b.value:$.value.selectable),P=Ee(()=>typeof $.value.updatable>"u"?C.value:$.value.updatable),_=Ee(()=>typeof $.value.focusable>"u"?w.value:$.value.focusable);Qt(b0,e.id),Qt(x0,re);const A=ce(()=>$.value.class instanceof Function?$.value.class($.value):$.value.class),T=ce(()=>$.value.style instanceof Function?$.value.style($.value):$.value.style),H=ce(()=>{const v=$.value.type||"default",m=G==null?void 0:G[`edge-${v}`];if(m)return m;let x=$.value.template??a.value[v];if(typeof x=="string"&&F){const S=Object.keys(F.appContext.components);S&&S.includes(v)&&(x=tc(v,!1))}return x&&typeof x!="string"?x:(r.error(new Ge(Le.EDGE_TYPE_MISSING,x)),!1)}),{handlePointerDown:D}=Mf({nodeId:W,handleId:q,type:I,isValidConnection:d,edgeUpdaterType:I,onEdgeUpdate:le,onEdgeUpdateEnd:ue});return()=>{const v=f($.value.source),m=f($.value.target),x="pathOptions"in $.value?$.value.pathOptions:{};if(!v&&!m)return r.error(new Ge(Le.EDGE_SOURCE_TARGET_MISSING,$.value.id,$.value.source,$.value.target)),null;if(!v)return r.error(new Ge(Le.EDGE_SOURCE_MISSING,$.value.id,$.value.source)),null;if(!m)return r.error(new Ge(Le.EDGE_TARGET_MISSING,$.value.id,$.value.target)),null;if(!$.value||$.value.hidden||v.hidden||m.hidden)return null;let S;o.value===pn.Strict?S=v.handleBounds.source:S=[...v.handleBounds.source||[],...v.handleBounds.target||[]];const z=Ba(S,$.value.sourceHandle);let R;o.value===pn.Strict?R=m.handleBounds.target:R=[...m.handleBounds.target||[],...m.handleBounds.source||[]];const O=Ba(R,$.value.targetHandle),L=(z==null?void 0:z.position)||ae.Bottom,V=(O==null?void 0:O.position)||ae.Top,{x:j,y:oe}=io(v,z,L),{x:ge,y:ve}=io(m,O,V);return $.value.sourceX=j,$.value.sourceY=oe,$.value.targetX=ge,$.value.targetY=ve,Ce("g",{ref:re,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${H.value===!1?"default":$.value.type||"default"}`,l.value,A.value,{updating:X.value,selected:$.value.selected,animated:$.value.animated,inactive:!g.value&&!k.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":$.value.ariaLabel===null?void 0:$.value.ariaLabel??`Edge from ${$.value.source} to ${$.value.target}`,"aria-describedby":_.value?`${cf}-${t}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...$.value.domAttributes,onClick:ee,onContextmenu:ie,onDblclick:fe,onMouseenter:we,onMousemove:he,onMouseleave:$e,onKeyDown:_.value?p:void 0},[ne.value?null:Ce(H.value===!1?a.value.default:H.value,{id:e.id,sourceNode:v,targetNode:m,source:$.value.source,target:$.value.target,type:$.value.type,updatable:P.value,selected:$.value.selected,animated:$.value.animated,label:$.value.label,labelStyle:$.value.labelStyle,labelShowBg:$.value.labelShowBg,labelBgStyle:$.value.labelBgStyle,labelBgPadding:$.value.labelBgPadding,labelBgBorderRadius:$.value.labelBgBorderRadius,data:$.value.data,events:{...$.value.events,...B},style:T.value,markerStart:`url('#${Uo($.value.markerStart,t)}')`,markerEnd:`url('#${Uo($.value.markerEnd,t)}')`,sourcePosition:L,targetPosition:V,sourceX:j,sourceY:oe,targetX:ge,targetY:ve,sourceHandleId:$.value.sourceHandle,targetHandleId:$.value.targetHandle,interactionWidth:$.value.interactionWidth,...x}),[P.value==="source"||P.value===!0?[Ce("g",{onMousedown:y,onMouseenter:Y,onMouseout:J},Ce(qa,{position:L,centerX:j,centerY:oe,radius:i.value,type:"source","data-type":"source"}))]:null,P.value==="target"||P.value===!0?[Ce("g",{onMousedown:N,onMouseenter:Y,onMouseout:J},Ce(qa,{position:V,centerX:ge,centerY:ve,radius:i.value,type:"target","data-type":"target"}))]:null]])};function Y(){X.value=!0}function J(){X.value=!1}function le(v,m){M.update({event:v,edge:$.value,connection:m})}function ue(v){M.updateEnd({event:v,edge:$.value}),ne.value=!1}function Q(v,m){v.button===0&&(ne.value=!0,W.value=m?$.value.target:$.value.source,q.value=(m?$.value.targetHandle:$.value.sourceHandle)??null,I.value=m?"target":"source",M.updateStart({event:v,edge:$.value}),D(v))}function ee(v){var m;const x={event:v,edge:$.value};g.value&&(s.value=!1,$.value.selected&&h.value?(u([$.value]),(m=re.value)==null||m.blur()):n([$.value])),M.click(x)}function ie(v){M.contextMenu({event:v,edge:$.value})}function fe(v){M.doubleClick({event:v,edge:$.value})}function we(v){M.mouseEnter({event:v,edge:$.value})}function he(v){M.mouseMove({event:v,edge:$.value})}function $e(v){M.mouseLeave({event:v,edge:$.value})}function y(v){Q(v,!0)}function N(v){Q(v,!1)}function p(v){var m;!E.value&&ff.includes(v.key)&&g.value&&(v.key==="Escape"?((m=re.value)==null||m.blur(),u([c(e.id)])):n([c(e.id)]))}}}),O_=D_,R_=Pe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:l,connectionLineOptions:a,connectionStatus:u,viewport:c,findNode:f}=ke(),d=(e=ct(Cr))==null?void 0:e["connection-line"],h=ce(()=>{var k;return f((k=o.value)==null?void 0:k.nodeId)}),E=ce(()=>{var k;return f((k=i.value)==null?void 0:k.nodeId)??null}),b=ce(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),C=ce(()=>a.value.markerStart?`url(#${Uo(a.value.markerStart,t)})`:""),w=ce(()=>a.value.markerEnd?`url(#${Uo(a.value.markerEnd,t)})`:"");return()=>{var k,$,M;if(!h.value||!o.value)return null;const B=o.value.id,G=o.value.type,F=h.value.handleBounds;let X=(F==null?void 0:F[G])??[];if(n.value===pn.Loose){const T=(F==null?void 0:F[G==="source"?"target":"source"])??[];X=[...X,...T]}if(!X)return null;const ne=(B?X.find(T=>T.id===B):X[0])??null,W=(ne==null?void 0:ne.position)??ae.Top,{x:q,y:I}=io(h.value,ne,W);let re=null;E.value&&(n.value===pn.Strict?re=((k=E.value.handleBounds[G==="source"?"target":"source"])==null?void 0:k.find(T=>{var H;return T.id===((H=i.value)==null?void 0:H.id)}))||null:re=(($=[...E.value.handleBounds.source??[],...E.value.handleBounds.target??[]])==null?void 0:$.find(T=>{var H;return T.id===((H=i.value)==null?void 0:H.id)}))||null);const g=((M=i.value)==null?void 0:M.position)??(W?ks[W]:null);if(!W||!g)return null;const P=s.value??a.value.type??xn.Bezier;let _="";const A={sourceX:q,sourceY:I,sourcePosition:W,targetX:b.value.x,targetY:b.value.y,targetPosition:g};return P===xn.Bezier?[_]=Df(A):P===xn.Step?[_]=Is({...A,borderRadius:0}):P===xn.SmoothStep?[_]=Is(A):P===xn.SimpleBezier?[_]=Of(A):_=`M${q},${I} ${b.value.x},${b.value.y}`,Ce("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Ce("g",{class:"vue-flow__connection"},d?Ce(d,{sourceX:q,sourceY:I,sourcePosition:W,targetX:b.value.x,targetY:b.value.y,targetPosition:g,sourceNode:h.value,sourceHandle:ne,targetNode:E.value,targetHandle:re,markerEnd:w.value,markerStart:C.value,connectionStatus:u.value}):Ce("path",{d:_,class:[a.value.class,u.value,"vue-flow__connection-path"],style:{...l.value,...a.value.style},"marker-end":w.value,"marker-start":C.value})))}}}),z_=R_,B_=["id","markerWidth","markerHeight","markerUnits","orient"],H_={name:"MarkerType",compatConfig:{MODE:3}},V_=Pe({...H_,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(K(),te("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===Z(Ns).ArrowClosed?(K(),te("polyline",{key:0,style:tt({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Ae("",!0),t.type===Z(Ns).Arrow?(K(),te("polyline",{key:1,style:tt({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Ae("",!0)],8,B_))}}),F_={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},L_={name:"MarkerDefinitions",compatConfig:{MODE:3}},Y_=Pe({...L_,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=ke(),r=ce(()=>{const s=new Set,l=[],a=u=>{if(u){const c=Uo(u,t);s.has(c)||(typeof u=="object"?l.push({...u,id:c,color:u.color||i.value}):l.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])a(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])a(c);return l.sort((u,c)=>u.id.localeCompare(c.id))});return(s,l)=>(K(),te("svg",F_,[U("defs",null,[(K(!0),te(be,null,yt(r.value,a=>(K(),Ve(V_,{id:a.id,key:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,"stroke-width":a.strokeWidth,orient:a.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),G_={name:"Edges",compatConfig:{MODE:3}},U_=Pe({...G_,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=ke();return(i,r)=>(K(),te(be,null,[me(Y_),(K(!0),te(be,null,yt(Z(n),s=>(K(),te("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:tt({zIndex:Z(u0)(s,Z(t),Z(o))})},[me(Z(O_),{id:s.id},null,8,["id"])],4))),128)),me(Z(z_))],64))}}),X_=Pe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:l,addSelectedNodes:a,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:f,nodeExtent:d,elevateNodesOnSelect:h,disableKeyboardA11y:E,ariaLiveMessage:b,snapToGrid:C,snapGrid:w,nodeDragThreshold:k,nodesDraggable:$,elementsSelectable:M,nodesConnectable:B,nodesFocusable:G,hooks:F}=ke(),X=ye(null);Qt(Nf,X),Qt(Ef,e.id);const ne=ct(Cr),W=vn(),q=Tf(),{node:I,parentNode:re}=kf(e.id),{emit:g,on:P}=M0(I,s),_=Ee(()=>typeof I.draggable>"u"?$.value:I.draggable),A=Ee(()=>typeof I.selectable>"u"?M.value:I.selectable),T=Ee(()=>typeof I.connectable>"u"?B.value:I.connectable),H=Ee(()=>typeof I.focusable>"u"?G.value:I.focusable),D=ce(()=>A.value||_.value||F.value.nodeClick.hasListeners()||F.value.nodeDoubleClick.hasListeners()||F.value.nodeMouseEnter.hasListeners()||F.value.nodeMouseMove.hasListeners()||F.value.nodeMouseLeave.hasListeners()),Y=Ee(()=>!!I.dimensions.width&&!!I.dimensions.height),J=ce(()=>{const m=I.type||"default",x=ne==null?void 0:ne[`node-${m}`];if(x)return x;let S=I.template||f.value[m];if(typeof S=="string"&&W){const z=Object.keys(W.appContext.components);z&&z.includes(m)&&(S=tc(m,!1))}return S&&typeof S!="string"?S:(s.error(new Ge(Le.NODE_TYPE_MISSING,S)),!1)}),le=Cf({id:e.id,el:X,disabled:()=>!_.value,selectable:A,dragHandle:()=>I.dragHandle,onStart(m){g.dragStart(m)},onDrag(m){g.drag(m)},onStop(m){g.dragStop(m)},onClick(m){p(m)}}),ue=ce(()=>I.class instanceof Function?I.class(I):I.class),Q=ce(()=>{const m=(I.style instanceof Function?I.style(I):I.style)||{},x=I.width instanceof Function?I.width(I):I.width,S=I.height instanceof Function?I.height(I):I.height;return!m.width&&x&&(m.width=typeof x=="string"?x:`${x}px`),!m.height&&S&&(m.height=typeof S=="string"?S:`${S}px`),m}),ee=Ee(()=>Number(I.zIndex??Q.value.zIndex??0));return c(m=>{(m.includes(e.id)||!m.length)&&fe()}),_t(()=>{xe(()=>I.hidden,(m=!1,x,S)=>{!m&&X.value&&(e.resizeObserver.observe(X.value),S(()=>{X.value&&e.resizeObserver.unobserve(X.value)}))},{immediate:!0,flush:"post"})}),xe([()=>I.type,()=>I.sourcePosition,()=>I.targetPosition],()=>{Pt(()=>{u([{id:e.id,nodeElement:X.value,forceUpdate:!0}])})}),xe([()=>I.position.x,()=>I.position.y,()=>{var m;return(m=re.value)==null?void 0:m.computedPosition.x},()=>{var m;return(m=re.value)==null?void 0:m.computedPosition.y},()=>{var m;return(m=re.value)==null?void 0:m.computedPosition.z},ee,()=>I.selected,()=>I.dimensions.height,()=>I.dimensions.width,()=>{var m;return(m=re.value)==null?void 0:m.dimensions.height},()=>{var m;return(m=re.value)==null?void 0:m.dimensions.width}],([m,x,S,z,R,O])=>{const L={x:m,y:x,z:O+(h.value&&I.selected?1e3:0)};typeof S<"u"&&typeof z<"u"?I.computedPosition=o0({x:S,y:z,z:R},L):I.computedPosition=L},{flush:"post",immediate:!0}),xe([()=>I.extent,d],([m,x],[S,z])=>{(m!==S||x!==z)&&ie()}),I.extent==="parent"||typeof I.extent=="object"&&"range"in I.extent&&I.extent.range==="parent"?ms(()=>Y).toBe(!0).then(ie):ie(),()=>I.hidden?null:Ce("div",{ref:X,"data-id":I.id,class:["vue-flow__node",`vue-flow__node-${J.value===!1?"default":I.type||"default"}`,{[n.value]:_.value,dragging:le==null?void 0:le.value,draggable:_.value,selected:I.selected,selectable:A.value,parent:I.isParent},ue.value],style:{visibility:Y.value?"visible":"hidden",zIndex:I.computedPosition.z??ee.value,transform:`translate(${I.computedPosition.x}px,${I.computedPosition.y}px)`,pointerEvents:D.value?"all":"none",...Q.value},tabIndex:H.value?0:void 0,role:H.value?"group":void 0,"aria-describedby":E.value?void 0:`${uf}-${t}`,"aria-label":I.ariaLabel,"aria-roledescription":"node",...I.domAttributes,onMouseenter:we,onMousemove:he,onMouseleave:$e,onContextmenu:y,onClick:p,onDblclick:N,onKeydown:v},[Ce(J.value===!1?f.value.default:J.value,{id:I.id,type:I.type,data:I.data,events:{...I.events,...P},selected:I.selected,resizing:I.resizing,dragging:le.value,connectable:T.value,position:I.computedPosition,dimensions:I.dimensions,isValidTargetPos:I.isValidTargetPos,isValidSourcePos:I.isValidSourcePos,parent:I.parentNode,parentNodeId:I.parentNode,zIndex:I.computedPosition.z??ee.value,targetPosition:I.targetPosition,sourcePosition:I.sourcePosition,label:I.label,dragHandle:I.dragHandle,onUpdateNodeInternals:fe})]);function ie(){const m=I.computedPosition,{computedPosition:x,position:S}=gl(I,C.value?Nr(m,w.value):m,s.error,d.value,re.value);(I.computedPosition.x!==x.x||I.computedPosition.y!==x.y)&&(I.computedPosition={...I.computedPosition,...x}),(I.position.x!==S.x||I.position.y!==S.y)&&(I.position=S)}function fe(){X.value&&u([{id:e.id,nodeElement:X.value,forceUpdate:!0}])}function we(m){le!=null&&le.value||g.mouseEnter({event:m,node:I})}function he(m){le!=null&&le.value||g.mouseMove({event:m,node:I})}function $e(m){le!=null&&le.value||g.mouseLeave({event:m,node:I})}function y(m){return g.contextMenu({event:m,node:I})}function N(m){return g.doubleClick({event:m,node:I})}function p(m){A.value&&(!o.value||!_.value||k.value>0)&&Ts(I,r.value,a,l,i,!1,X.value),g.click({event:m,node:I})}function v(m){if(!(Cs(m)||E.value))if(ff.includes(m.key)&&A.value){const x=m.key==="Escape";Ts(I,r.value,a,l,i,x,X.value)}else _.value&&I.selected&&qn[m.key]&&(m.preventDefault(),b.value=`Moved selected node ${m.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~I.position.x}, y: ${~~I.position.y}`,q({x:qn[m.key].x,y:qn[m.key].y},m.shiftKey))}}}),W_=X_;function K_(e={includeHiddenNodes:!1}){const{nodes:t}=ke();return ce(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Z_={class:"vue-flow__nodes vue-flow__container"},q_={name:"Nodes",compatConfig:{MODE:3}},j_=Pe({...q_,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=ke(),i=K_(),r=ye();return xe(i,s=>{s&&Pt(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),_t(()=>{r.value=new ResizeObserver(s=>{const l=s.map(a=>({id:a.target.getAttribute("data-id"),nodeElement:a.target,forceUpdate:!0}));Pt(()=>n(l))})}),el(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,l)=>(K(),te("div",Z_,[r.value?(K(!0),te(be,{key:0},yt(Z(t),(a,u,c,f)=>{const d=[a.id];if(f&&f.key===a.id&&ip(f,d))return f;const h=(K(),Ve(Z(W_),{id:a.id,key:a.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return h.memo=d,h},l,0),128)):Ae("",!0)]))}});function J_(){const{emits:e}=ke();_t(()=>{if(Sf()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ge(Le.MISSING_STYLES))}})}const Q_=U("div",{class:"vue-flow__edge-labels"},null,-1),e1={name:"VueFlow",compatConfig:{MODE:3}},t1=Pe({...e1,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=rc(),r=Xr(o,"modelValue",n),s=Xr(o,"nodes",n),l=Xr(o,"edges",n),a=ke(o),u=A0({modelValue:r,nodes:s,edges:l},o,a);return D0(n,a.hooks),I_(),J_(),Qt(Cr,i),tl(u),t(a),(c,f)=>(K(),te("div",{ref:Z(a).vueFlowRef,class:"vue-flow"},[me(E_,null,{default:dt(()=>[me(U_),Q_,me(j_),Re(c.$slots,"zoom-pane")]),_:3}),Re(c.$slots,"default"),me(T_)],512))}}),n1={name:"Panel",compatConfig:{MODE:3}},zf=Pe({...n1,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=ke(),o=ce(()=>`${t.position}`.split("-"));return(i,r)=>(K(),te("div",{class:Xe(["vue-flow__panel",o.value]),style:tt({pointerEvents:Z(n)?"none":"all"})},[Re(i.$slots,"default")],6))}});var Kt=(e=>(e.Lines="lines",e.Dots="dots",e))(Kt||{});const Bf=function({dimensions:e,size:t,color:n}){return Ce("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Hf=function({radius:e,color:t}){return Ce("circle",{cx:e,cy:e,r:e,fill:t})};Kt.Lines+"",Kt.Dots+"";const o1={[Kt.Dots]:"#81818a",[Kt.Lines]:"#eee"},i1=["id","x","y","width","height","patternTransform"],r1={key:2,height:"100",width:"100"},s1=["fill"],l1=["x","y","fill"],a1={name:"Background",compatConfig:{MODE:3}},u1=Pe({...a1,props:{id:{},variant:{default:()=>Kt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=ke(),o=ce(()=>{const s=n.value.zoom,[l,a]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[l*s||1,a*s||1],c=e.size*s,[f,d]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],h=[f*s||1+u[0]/2,d*s||1+u[1]/2];return{scaledGap:u,offset:h,size:c}}),i=Ee(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=Ee(()=>e.color||e.patternColor||o1[e.variant||Kt.Dots]);return(s,l)=>(K(),te("svg",{class:"vue-flow__background vue-flow__container",style:tt({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Re(s.$slots,"pattern-container",{id:i.value},()=>[U("pattern",{id:i.value,x:Z(n).x%o.value.scaledGap[0],y:Z(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Re(s.$slots,"pattern",{},()=>[s.variant===Z(Kt).Lines?(K(),Ve(Z(Bf),{key:0,size:s.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===Z(Kt).Dots?(K(),Ve(Z(Hf),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Ae("",!0),s.bgColor?(K(),te("svg",r1,[U("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,s1)])):Ae("",!0)])],8,i1)]),U("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,l1),Re(s.$slots,"default",{id:i.value})],4))}}),c1={name:"ControlButton",compatConfig:{MODE:3}},f1=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},d1={type:"button",class:"vue-flow__controls-button"};function h1(e,t,n,o,i,r){return K(),te("button",d1,[Re(e.$slots,"default")])}const mi=f1(c1,[["render",h1]]),p1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},g1=U("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),v1=[g1];function m1(e,t){return K(),te("svg",p1,v1)}const y1={render:m1},_1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},w1=U("path",{d:"M0 0h32v4.2H0z"},null,-1),b1=[w1];function x1(e,t){return K(),te("svg",_1,b1)}const $1={render:x1},S1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},E1=U("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 0 0 27.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.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),N1=[E1];function C1(e,t){return K(),te("svg",S1,N1)}const M1={render:C1},k1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},T1=U("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 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-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"},null,-1),I1=[T1];function A1(e,t){return K(),te("svg",k1,I1)}const P1={render:A1},D1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O1=U("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 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),R1=[O1];function z1(e,t){return K(),te("svg",D1,R1)}const B1={render:z1},H1={name:"Controls",compatConfig:{MODE:3}},V1=Pe({...H1,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>af.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:s,zoomOut:l,fitView:a,viewport:u,minZoom:c,maxZoom:f}=ke(),d=Ee(()=>n.value||o.value||i.value),h=Ee(()=>u.value.zoom<=c.value),E=Ee(()=>u.value.zoom>=f.value);function b(){s(),t("zoomIn")}function C(){l(),t("zoomOut")}function w(){a(e.fitViewParams),t("fitView")}function k(){r(!d.value),t("interactionChange",!d.value)}return($,M)=>(K(),Ve(Z(zf),{class:"vue-flow__controls",position:$.position},{default:dt(()=>[Re($.$slots,"top"),$.showZoom?(K(),te(be,{key:0},[Re($.$slots,"control-zoom-in",{},()=>[me(mi,{class:"vue-flow__controls-zoomin",disabled:E.value,onClick:b},{default:dt(()=>[Re($.$slots,"icon-zoom-in",{},()=>[(K(),Ve(bn(Z(y1))))])]),_:3},8,["disabled"])]),Re($.$slots,"control-zoom-out",{},()=>[me(mi,{class:"vue-flow__controls-zoomout",disabled:h.value,onClick:C},{default:dt(()=>[Re($.$slots,"icon-zoom-out",{},()=>[(K(),Ve(bn(Z($1))))])]),_:3},8,["disabled"])])],64)):Ae("",!0),$.showFitView?Re($.$slots,"control-fit-view",{key:1},()=>[me(mi,{class:"vue-flow__controls-fitview",onClick:w},{default:dt(()=>[Re($.$slots,"icon-fit-view",{},()=>[(K(),Ve(bn(Z(M1))))])]),_:3})]):Ae("",!0),$.showInteractive?Re($.$slots,"control-interactive",{key:2},()=>[$.showInteractive?(K(),Ve(mi,{key:0,class:"vue-flow__controls-interactive",onClick:k},{default:dt(()=>[d.value?Re($.$slots,"icon-unlock",{key:0},()=>[(K(),Ve(bn(Z(B1))))]):Ae("",!0),d.value?Ae("",!0):Re($.$slots,"icon-lock",{key:1},()=>[(K(),Ve(bn(Z(P1))))])]),_:3})):Ae("",!0)]):Ae("",!0),Re($.$slots,"default")]),_:3},8,["position"]))}});var F1={value:()=>{}};function yl(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ii(n)}function Ii(e){this._=e}function L1(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ii.prototype=yl.prototype={constructor:Ii,on:function(e,t){var n=this._,o=L1(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Y1(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=ja(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ja(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ii(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Y1(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function ja(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=F1,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var As="http://www.w3.org/1999/xhtml";const Ja={svg:"http://www.w3.org/2000/svg",xhtml:As,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ar(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ja.hasOwnProperty(t)?{space:Ja[t],local:e}:e}function G1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===As&&t.documentElement.namespaceURI===As?t.createElement(e):t.createElementNS(n,e)}}function U1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Vf(e){var t=Ar(e);return(t.local?U1:G1)(t)}function X1(){}function _l(e){return e==null?X1:function(){return this.querySelector(e)}}function W1(e){typeof e!="function"&&(e=_l(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=new Array(s),a,u,c=0;c<s;++c)(a=r[c])&&(u=e.call(a,a.__data__,c,r))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new ut(o,this._parents)}function K1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Z1(){return[]}function Ff(e){return e==null?Z1:function(){return this.querySelectorAll(e)}}function q1(e){return function(){return K1(e.apply(this,arguments))}}function j1(e){typeof e=="function"?e=q1(e):e=Ff(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(o.push(e.call(a,a.__data__,u,s)),i.push(a));return new ut(o,i)}function Lf(e){return function(){return this.matches(e)}}function Yf(e){return function(t){return t.matches(e)}}var J1=Array.prototype.find;function Q1(e){return function(){return J1.call(this.children,e)}}function ew(){return this.firstElementChild}function tw(e){return this.select(e==null?ew:Q1(typeof e=="function"?e:Yf(e)))}var nw=Array.prototype.filter;function ow(){return Array.from(this.children)}function iw(e){return function(){return nw.call(this.children,e)}}function rw(e){return this.selectAll(e==null?ow:iw(typeof e=="function"?e:Yf(e)))}function sw(e){typeof e!="function"&&(e=Lf(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=[],a,u=0;u<s;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&l.push(a);return new ut(o,this._parents)}function Gf(e){return new Array(e.length)}function lw(){return new ut(this._enter||this._groups.map(Gf),this._parents)}function er(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}er.prototype={constructor:er,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 aw(e){return function(){return e}}function uw(e,t,n,o,i,r){for(var s=0,l,a=t.length,u=r.length;s<u;++s)(l=t[s])?(l.__data__=r[s],o[s]=l):n[s]=new er(e,r[s]);for(;s<a;++s)(l=t[s])&&(i[s]=l)}function cw(e,t,n,o,i,r,s){var l,a,u=new Map,c=t.length,f=r.length,d=new Array(c),h;for(l=0;l<c;++l)(a=t[l])&&(d[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?i[l]=a:u.set(h,a));for(l=0;l<f;++l)h=s.call(e,r[l],l,r)+"",(a=u.get(h))?(o[l]=a,a.__data__=r[l],u.delete(h)):n[l]=new er(e,r[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(d[l])===a&&(i[l]=a)}function fw(e){return e.__data__}function dw(e,t){if(!arguments.length)return Array.from(this,fw);var n=t?cw:uw,o=this._parents,i=this._groups;typeof e!="function"&&(e=aw(e));for(var r=i.length,s=new Array(r),l=new Array(r),a=new Array(r),u=0;u<r;++u){var c=o[u],f=i[u],d=f.length,h=hw(e.call(c,c&&c.__data__,u,o)),E=h.length,b=l[u]=new Array(E),C=s[u]=new Array(E),w=a[u]=new Array(d);n(c,f,b,C,w,h,t);for(var k=0,$=0,M,B;k<E;++k)if(M=b[k]){for(k>=$&&($=k+1);!(B=C[$])&&++$<E;);M._next=B||null}}return s=new ut(s,o),s._enter=l,s._exit=a,s}function hw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pw(){return new ut(this._exit||this._groups.map(Gf),this._parents)}function gw(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function vw(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),l=new Array(i),a=0;a<s;++a)for(var u=n[a],c=o[a],f=u.length,d=l[a]=new Array(f),h,E=0;E<f;++E)(h=u[E]||c[E])&&(d[E]=h);for(;a<i;++a)l[a]=n[a];return new ut(l,this._parents)}function mw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function yw(e){e||(e=_w);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],l=s.length,a=i[r]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new ut(i,this._parents).order()}function _w(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ww(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bw(){return Array.from(this)}function xw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function $w(){let e=0;for(const t of this)++e;return e}function Sw(){return!this.node()}function Ew(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,l;r<s;++r)(l=i[r])&&e.call(l,l.__data__,r,i);return this}function Nw(e){return function(){this.removeAttribute(e)}}function Cw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Mw(e,t){return function(){this.setAttribute(e,t)}}function kw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Tw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Iw(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 Aw(e,t){var n=Ar(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Cw:Nw:typeof t=="function"?n.local?Iw:Tw:n.local?kw:Mw)(n,t))}function Uf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Pw(e){return function(){this.style.removeProperty(e)}}function Dw(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ow(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Rw(e,t,n){return arguments.length>1?this.each((t==null?Pw:typeof t=="function"?Ow:Dw)(e,t,n??"")):ro(this.node(),e)}function ro(e,t){return e.style.getPropertyValue(t)||Uf(e).getComputedStyle(e,null).getPropertyValue(t)}function zw(e){return function(){delete this[e]}}function Bw(e,t){return function(){this[e]=t}}function Hw(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vw(e,t){return arguments.length>1?this.each((t==null?zw:typeof t=="function"?Hw:Bw)(e,t)):this.node()[e]}function Xf(e){return e.trim().split(/^|\s+/)}function wl(e){return e.classList||new Wf(e)}function Wf(e){this._node=e,this._names=Xf(e.getAttribute("class")||"")}Wf.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 Kf(e,t){for(var n=wl(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Zf(e,t){for(var n=wl(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Fw(e){return function(){Kf(this,e)}}function Lw(e){return function(){Zf(this,e)}}function Yw(e,t){return function(){(t.apply(this,arguments)?Kf:Zf)(this,e)}}function Gw(e,t){var n=Xf(e+"");if(arguments.length<2){for(var o=wl(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Yw:t?Fw:Lw)(n,t))}function Uw(){this.textContent=""}function Xw(e){return function(){this.textContent=e}}function Ww(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Kw(e){return arguments.length?this.each(e==null?Uw:(typeof e=="function"?Ww:Xw)(e)):this.node().textContent}function Zw(){this.innerHTML=""}function qw(e){return function(){this.innerHTML=e}}function jw(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Jw(e){return arguments.length?this.each(e==null?Zw:(typeof e=="function"?jw:qw)(e)):this.node().innerHTML}function Qw(){this.nextSibling&&this.parentNode.appendChild(this)}function eb(){return this.each(Qw)}function tb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nb(){return this.each(tb)}function ob(e){var t=typeof e=="function"?e:Vf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ib(){return null}function rb(e,t){var n=typeof e=="function"?e:Vf(e),o=t==null?ib:typeof t=="function"?t:_l(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function sb(){var e=this.parentNode;e&&e.removeChild(this)}function lb(){return this.each(sb)}function ab(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ub(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cb(e){return this.select(e?ub:ab)}function fb(e){return arguments.length?this.property("__data__",e):this.node().__data__}function db(e){return function(t){e.call(this,t,this.__data__)}}function hb(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function pb(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function gb(e,t,n){return function(){var o=this.__on,i,r=db(t);if(o){for(var s=0,l=o.length;s<l;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function vb(e,t,n){var o=hb(e+""),i,r=o.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(i=0,c=l[a];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?gb:pb,i=0;i<r;++i)this.each(l(o[i],t,n));return this}function qf(e,t,n){var o=Uf(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function mb(e,t){return function(){return qf(this,e,t)}}function yb(e,t){return function(){return qf(this,e,t.apply(this,arguments))}}function _b(e,t){return this.each((typeof t=="function"?yb:mb)(e,t))}function*wb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var jf=[null];function ut(e,t){this._groups=e,this._parents=t}function oi(){return new ut([[document.documentElement]],jf)}function bb(){return this}ut.prototype=oi.prototype={constructor:ut,select:W1,selectAll:j1,selectChild:tw,selectChildren:rw,filter:sw,data:dw,enter:lw,exit:pw,join:gw,merge:vw,selection:bb,order:mw,sort:yw,call:ww,nodes:bw,node:xw,size:$w,empty:Sw,each:Ew,attr:Aw,style:Rw,property:Vw,classed:Gw,text:Kw,html:Jw,raise:eb,lower:nb,append:ob,insert:rb,remove:lb,clone:cb,datum:fb,on:vb,dispatch:_b,[Symbol.iterator]:wb};function fn(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],jf)}function xb(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ln(e,t){if(e=xb(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ps={capture:!0,passive:!1};function Ds(e){e.preventDefault(),e.stopImmediatePropagation()}function $b(e){var t=e.document.documentElement,n=fn(e).on("dragstart.drag",Ds,Ps);"onselectstart"in t?n.on("selectstart.drag",Ds,Ps):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Sb(e,t){var n=e.document.documentElement,o=fn(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ds,Ps),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function bl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Jf(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function ii(){}var Wo=.7,tr=1/Wo,jn="\\s*([+-]?\\d+)\\s*",Ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Eb=/^#([0-9a-f]{3,8})$/,Nb=new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`),Cb=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),Mb=new RegExp(`^rgba\\(${jn},${jn},${jn},${Ko}\\)$`),kb=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Ko}\\)$`),Tb=new RegExp(`^hsl\\(${Ko},${Ot},${Ot}\\)$`),Ib=new RegExp(`^hsla\\(${Ko},${Ot},${Ot},${Ko}\\)$`),Qa={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};bl(ii,Zo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eu,formatHex:eu,formatHex8:Ab,formatHsl:Pb,formatRgb:tu,toString:tu});function eu(){return this.rgb().formatHex()}function Ab(){return this.rgb().formatHex8()}function Pb(){return Qf(this).formatHsl()}function tu(){return this.rgb().formatRgb()}function Zo(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Eb.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nu(t):n===3?new it(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yi(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=Nb.exec(e))?new it(t[1],t[2],t[3],1):(t=Cb.exec(e))?new it(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mb.exec(e))?yi(t[1],t[2],t[3],t[4]):(t=kb.exec(e))?yi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Tb.exec(e))?ru(t[1],t[2]/100,t[3]/100,1):(t=Ib.exec(e))?ru(t[1],t[2]/100,t[3]/100,t[4]):Qa.hasOwnProperty(e)?nu(Qa[e]):e==="transparent"?new it(NaN,NaN,NaN,0):null}function nu(e){return new it(e>>16&255,e>>8&255,e&255,1)}function yi(e,t,n,o){return o<=0&&(e=t=n=NaN),new it(e,t,n,o)}function Db(e){return e instanceof ii||(e=Zo(e)),e?(e=e.rgb(),new it(e.r,e.g,e.b,e.opacity)):new it}function Os(e,t,n,o){return arguments.length===1?Db(e):new it(e,t,n,o??1)}function it(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}bl(it,Os,Jf(ii,{brighter(e){return e=e==null?tr:Math.pow(tr,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(In(this.r),In(this.g),In(this.b),nr(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:ou,formatHex:ou,formatHex8:Ob,formatRgb:iu,toString:iu}));function ou(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function Ob(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function iu(){const e=nr(this.opacity);return`${e===1?"rgb(":"rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${e===1?")":`, ${e})`}`}function nr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function In(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nn(e){return e=In(e),(e<16?"0":"")+e.toString(16)}function ru(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gt(e,t,n,o)}function Qf(e){if(e instanceof gt)return new gt(e.h,e.s,e.l,e.opacity);if(e instanceof ii||(e=Zo(e)),!e)return new gt;if(e instanceof gt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,l=r-i,a=(r+i)/2;return l?(t===r?s=(n-o)/l+(n<o)*6:n===r?s=(o-t)/l+2:s=(t-n)/l+4,l/=a<.5?r+i:2-r-i,s*=60):l=a>0&&a<1?0:s,new gt(s,l,a,e.opacity)}function Rb(e,t,n,o){return arguments.length===1?Qf(e):new gt(e,t,n,o??1)}function gt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}bl(gt,Rb,Jf(ii,{brighter(e){return e=e==null?tr:Math.pow(tr,e),new gt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new gt(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,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new it(os(e>=240?e-240:e+120,i,o),os(e,i,o),os(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new gt(su(this.h),_i(this.s),_i(this.l),nr(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=nr(this.opacity);return`${e===1?"hsl(":"hsla("}${su(this.h)}, ${_i(this.s)*100}%, ${_i(this.l)*100}%${e===1?")":`, ${e})`}`}}));function su(e){return e=(e||0)%360,e<0?e+360:e}function _i(e){return Math.max(0,Math.min(1,e||0))}function os(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 ed=e=>()=>e;function zb(e,t){return function(n){return e+n*t}}function Bb(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Hb(e){return(e=+e)==1?td:function(t,n){return n-t?Bb(t,n,e):ed(isNaN(t)?n:t)}}function td(e,t){var n=t-e;return n?zb(e,n):ed(isNaN(e)?t:e)}const lu=(function e(t){var n=Hb(t);function o(i,r){var s=n((i=Os(i)).r,(r=Os(r)).r),l=n(i.g,r.g),a=n(i.b,r.b),u=td(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=l(c),i.b=a(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function cn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Rs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,is=new RegExp(Rs.source,"g");function Vb(e){return function(){return e}}function Fb(e){return function(t){return e(t)+""}}function Lb(e,t){var n=Rs.lastIndex=is.lastIndex=0,o,i,r,s=-1,l=[],a=[];for(e=e+"",t=t+"";(o=Rs.exec(e))&&(i=is.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),l[s]?l[s]+=r:l[++s]=r),(o=o[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,a.push({i:s,x:cn(o,i)})),n=is.lastIndex;return n<t.length&&(r=t.slice(n),l[s]?l[s]+=r:l[++s]=r),l.length<2?a[0]?Fb(a[0].x):Vb(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}var au=180/Math.PI,zs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nd(e,t,n,o,i,r){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*o)&&(n-=e*a,o-=t*a),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,a/=l),e*o<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*au,skewX:Math.atan(a)*au,scaleX:s,scaleY:l}}var wi;function Yb(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zs:nd(t.a,t.b,t.c,t.d,t.e,t.f)}function Gb(e){return e==null||(wi||(wi=document.createElementNS("http://www.w3.org/2000/svg","g")),wi.setAttribute("transform",e),!(e=wi.transform.baseVal.consolidate()))?zs:(e=e.matrix,nd(e.a,e.b,e.c,e.d,e.e,e.f))}function od(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,f,d,h,E){if(u!==f||c!==d){var b=h.push("translate(",null,t,null,n);E.push({i:b-4,x:cn(u,f)},{i:b-2,x:cn(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,o)-2,x:cn(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function l(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,o)-2,x:cn(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function a(u,c,f,d,h,E){if(u!==f||c!==d){var b=h.push(i(h)+"scale(",null,",",null,")");E.push({i:b-4,x:cn(u,f)},{i:b-2,x:cn(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var E=-1,b=d.length,C;++E<b;)f[(C=d[E]).i]=C.x(h);return f.join("")}}}var Ub=od(Yb,"px, ","px)","deg)"),Xb=od(Gb,", ",")",")"),Wb=1e-12;function uu(e){return((e=Math.exp(e))+1/e)/2}function Kb(e){return((e=Math.exp(e))-1/e)/2}function Zb(e){return((e=Math.exp(2*e))-1)/(e+1)}const qb=(function e(t,n,o){function i(r,s){var l=r[0],a=r[1],u=r[2],c=s[0],f=s[1],d=s[2],h=c-l,E=f-a,b=h*h+E*E,C,w;if(b<Wb)w=Math.log(d/u)/t,C=function(F){return[l+F*h,a+F*E,u*Math.exp(t*F*w)]};else{var k=Math.sqrt(b),$=(d*d-u*u+o*b)/(2*u*n*k),M=(d*d-u*u-o*b)/(2*d*n*k),B=Math.log(Math.sqrt($*$+1)-$),G=Math.log(Math.sqrt(M*M+1)-M);w=(G-B)/t,C=function(F){var X=F*w,ne=uu(B),W=u/(n*k)*(ne*Zb(t*X+B)-Kb(B));return[l+W*h,a+W*E,u*ne/uu(t*X+B)]}}return C.duration=w*1e3*t/Math.SQRT2,C}return i.rho=function(r){var s=Math.max(.001,+r),l=s*s,a=l*l;return e(s,l,a)},i})(Math.SQRT2,2,4);var so=0,wo=0,ho=0,id=1e3,or,bo,ir=0,Rn=0,Pr=0,qo=typeof performance=="object"&&performance.now?performance:Date,rd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xl(){return Rn||(rd(jb),Rn=qo.now()+Pr)}function jb(){Rn=0}function rr(){this._call=this._time=this._next=null}rr.prototype=sd.prototype={constructor:rr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?xl():+n)+(t==null?0:+t),!this._next&&bo!==this&&(bo?bo._next=this:or=this,bo=this),this._call=e,this._time=n,Bs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bs())}};function sd(e,t,n){var o=new rr;return o.restart(e,t,n),o}function Jb(){xl(),++so;for(var e=or,t;e;)(t=Rn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--so}function cu(){Rn=(ir=qo.now())+Pr,so=wo=0;try{Jb()}finally{so=0,ex(),Rn=0}}function Qb(){var e=qo.now(),t=e-ir;t>id&&(Pr-=t,ir=e)}function ex(){for(var e,t=or,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:or=n);bo=e,Bs(o)}function Bs(e){if(!so){wo&&(wo=clearTimeout(wo));var t=e-Rn;t>24?(e<1/0&&(wo=setTimeout(cu,e-qo.now()-Pr)),ho&&(ho=clearInterval(ho))):(ho||(ir=qo.now(),ho=setInterval(Qb,id)),so=1,rd(cu))}}function fu(e,t,n){var o=new rr;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var tx=yl("start","end","cancel","interrupt"),nx=[],ld=0,du=1,Hs=2,Ai=3,hu=4,Vs=5,Pi=6;function Dr(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;ox(e,n,{name:t,index:o,group:i,on:tx,tween:nx,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ld})}function $l(e,t){var n=bt(e,t);if(n.state>ld)throw new Error("too late; already scheduled");return n}function Bt(e,t){var n=bt(e,t);if(n.state>Ai)throw new Error("too late; already running");return n}function bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ox(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=sd(r,0,n.time);function r(u){n.state=du,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,d,h;if(n.state!==du)return a();for(c in o)if(h=o[c],h.name===n.name){if(h.state===Ai)return fu(s);h.state===hu?(h.state=Pi,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=Pi,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(fu(function(){n.state===Ai&&(n.state=hu,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Hs,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Hs){for(n.state=Ai,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Vs,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===Vs&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Pi,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Di(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>Hs&&o.state<Vs,o.state=Pi,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function ix(e){return this.each(function(){Di(this,e)})}function rx(e,t){var n,o;return function(){var i=Bt(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,l=o.length;s<l;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function sx(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Bt(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var l={name:t,value:n},a=0,u=i.length;a<u;++a)if(i[a].name===t){i[a]=l;break}a===u&&i.push(l)}r.tween=i}}function lx(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=bt(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?rx:sx)(n,e,t))}function Sl(e,t,n){var o=e._id;return e.each(function(){var i=Bt(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return bt(i,o).value[t]}}function ad(e,t){var n;return(typeof t=="number"?cn:t instanceof Zo?lu:(n=Zo(t))?(t=n,lu):Lb)(e,t)}function ax(e){return function(){this.removeAttribute(e)}}function ux(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cx(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function fx(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function dx(e,t,n){var o,i,r;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l)))}}function hx(e,t,n){var o,i,r;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l)))}}function px(e,t){var n=Ar(e),o=n==="transform"?Xb:ad;return this.attrTween(e,typeof t=="function"?(n.local?hx:dx)(n,o,Sl(this,"attr."+e,t)):t==null?(n.local?ux:ax)(n):(n.local?fx:cx)(n,o,t))}function gx(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function mx(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&vx(e,r)),n}return i._value=t,i}function yx(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&gx(e,r)),n}return i._value=t,i}function _x(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 o=Ar(e);return this.tween(n,(o.local?mx:yx)(o,t))}function wx(e,t){return function(){$l(this,e).delay=+t.apply(this,arguments)}}function bx(e,t){return t=+t,function(){$l(this,e).delay=t}}function xx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wx:bx)(t,e)):bt(this.node(),t).delay}function $x(e,t){return function(){Bt(this,e).duration=+t.apply(this,arguments)}}function Sx(e,t){return t=+t,function(){Bt(this,e).duration=t}}function Ex(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$x:Sx)(t,e)):bt(this.node(),t).duration}function Nx(e,t){if(typeof t!="function")throw new Error;return function(){Bt(this,e).ease=t}}function Cx(e){var t=this._id;return arguments.length?this.each(Nx(t,e)):bt(this.node(),t).ease}function Mx(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Bt(this,e).ease=n}}function kx(e){if(typeof e!="function")throw new Error;return this.each(Mx(this._id,e))}function Tx(e){typeof e!="function"&&(e=Lf(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,l=o[i]=[],a,u=0;u<s;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&l.push(a);return new nn(o,this._parents,this._name,this._id)}function Ix(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),l=0;l<r;++l)for(var a=t[l],u=n[l],c=a.length,f=s[l]=new Array(c),d,h=0;h<c;++h)(d=a[h]||u[h])&&(f[h]=d);for(;l<o;++l)s[l]=t[l];return new nn(s,this._parents,this._name,this._id)}function Ax(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 Px(e,t,n){var o,i,r=Ax(t)?$l:Bt;return function(){var s=r(this,e),l=s.on;l!==o&&(i=(o=l).copy()).on(t,n),s.on=i}}function Dx(e,t){var n=this._id;return arguments.length<2?bt(this.node(),n).on.on(e):this.each(Px(n,e,t))}function Ox(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Rx(){return this.on("end.remove",Ox(this._id))}function zx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_l(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var l=o[s],a=l.length,u=r[s]=new Array(a),c,f,d=0;d<a;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,Dr(u[d],t,n,d,u,bt(c,n)));return new nn(r,this._parents,t,n)}function Bx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ff(e));for(var o=this._groups,i=o.length,r=[],s=[],l=0;l<i;++l)for(var a=o[l],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var d=e.call(c,c.__data__,f,a),h,E=bt(c,n),b=0,C=d.length;b<C;++b)(h=d[b])&&Dr(h,t,n,b,d,E);r.push(d),s.push(c)}return new nn(r,s,t,n)}var Hx=oi.prototype.constructor;function Vx(){return new Hx(this._groups,this._parents)}function Fx(e,t){var n,o,i;return function(){var r=ro(this,e),s=(this.style.removeProperty(e),ro(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function ud(e){return function(){this.style.removeProperty(e)}}function Lx(e,t,n){var o,i=n+"",r;return function(){var s=ro(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Yx(e,t,n){var o,i,r;return function(){var s=ro(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),ro(this,e))),s===a?null:s===o&&a===i?r:(i=a,r=t(o=s,l))}}function Gx(e,t){var n,o,i,r="style."+t,s="end."+r,l;return function(){var a=Bt(this,e),u=a.on,c=a.value[r]==null?l||(l=ud(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),a.on=o}}function Ux(e,t,n){var o=(e+="")=="transform"?Ub:ad;return t==null?this.styleTween(e,Fx(e,o)).on("end.style."+e,ud(e)):typeof t=="function"?this.styleTween(e,Yx(e,o,Sl(this,"style."+e,t))).each(Gx(this._id,e)):this.styleTween(e,Lx(e,o,t),n).on("end.style."+e,null)}function Xx(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Wx(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Xx(e,s,n)),o}return r._value=t,r}function Kx(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Wx(e,t,n??""))}function Zx(e){return function(){this.textContent=e}}function qx(e){return function(){var t=e(this);this.textContent=t??""}}function jx(e){return this.tween("text",typeof e=="function"?qx(Sl(this,"text",e)):Zx(e==null?"":e+""))}function Jx(e){return function(t){this.textContent=e.call(this,t)}}function Qx(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Jx(i)),t}return o._value=e,o}function e$(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,Qx(e))}function t$(){for(var e=this._name,t=this._id,n=cd(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=bt(a,t);Dr(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new nn(o,this._parents,e,n)}function n$(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var l={value:s},a={value:function(){--i===0&&r()}};n.each(function(){var u=Bt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),i===0&&r()})}var o$=0;function nn(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function cd(){return++o$}var Ft=oi.prototype;nn.prototype={constructor:nn,select:zx,selectAll:Bx,selectChild:Ft.selectChild,selectChildren:Ft.selectChildren,filter:Tx,merge:Ix,selection:Vx,transition:t$,call:Ft.call,nodes:Ft.nodes,node:Ft.node,size:Ft.size,empty:Ft.empty,each:Ft.each,on:Dx,attr:px,attrTween:_x,style:Ux,styleTween:Kx,text:jx,textTween:e$,remove:Rx,tween:lx,delay:xx,duration:Ex,ease:Cx,easeVarying:kx,end:n$,[Symbol.iterator]:Ft[Symbol.iterator]};function i$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var r$={time:null,delay:0,duration:250,ease:i$};function s$(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 l$(e){var t,n;e instanceof nn?(t=e._id,e=e._name):(t=cd(),(n=r$).time=xl(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Dr(a,e,t,u,s,n||s$(a,t));return new nn(o,this._parents,e,t)}oi.prototype.interrupt=ix;oi.prototype.transition=l$;const bi=e=>()=>e;function a$(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function Zt(e,t,n){this.k=e,this.x=t,this.y=n}Zt.prototype={constructor:Zt,scale:function(e){return e===1?this:new Zt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Zt(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 El=new Zt(1,0,0);Zt.prototype;function rs(e){e.stopImmediatePropagation()}function po(e){e.preventDefault(),e.stopImmediatePropagation()}function u$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function c$(){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 pu(){return this.__zoom||El}function f$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function d$(){return navigator.maxTouchPoints||"ontouchstart"in this}function h$(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function p$(){var e=u$,t=c$,n=h$,o=f$,i=d$,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=qb,u=yl("start","zoom","end"),c,f,d,h=500,E=150,b=0,C=10;function w(g){g.property("__zoom",pu).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",q).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(g,P,_,A){var T=g.selection?g.selection():g;T.property("__zoom",pu),g!==T?B(g,P,_,A):T.interrupt().each(function(){G(this,arguments).event(A).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},w.scaleBy=function(g,P,_,A){w.scaleTo(g,function(){var T=this.__zoom.k,H=typeof P=="function"?P.apply(this,arguments):P;return T*H},_,A)},w.scaleTo=function(g,P,_,A){w.transform(g,function(){var T=t.apply(this,arguments),H=this.__zoom,D=_==null?M(T):typeof _=="function"?_.apply(this,arguments):_,Y=H.invert(D),J=typeof P=="function"?P.apply(this,arguments):P;return n($(k(H,J),D,Y),T,s)},_,A)},w.translateBy=function(g,P,_,A){w.transform(g,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,A)},w.translateTo=function(g,P,_,A,T){w.transform(g,function(){var H=t.apply(this,arguments),D=this.__zoom,Y=A==null?M(H):typeof A=="function"?A.apply(this,arguments):A;return n(El.translate(Y[0],Y[1]).scale(D.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof _=="function"?-_.apply(this,arguments):-_),H,s)},A,T)};function k(g,P){return P=Math.max(r[0],Math.min(r[1],P)),P===g.k?g:new Zt(P,g.x,g.y)}function $(g,P,_){var A=P[0]-_[0]*g.k,T=P[1]-_[1]*g.k;return A===g.x&&T===g.y?g:new Zt(g.k,A,T)}function M(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function B(g,P,_,A){g.on("start.zoom",function(){G(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){G(this,arguments).event(A).end()}).tween("zoom",function(){var T=this,H=arguments,D=G(T,H).event(A),Y=t.apply(T,H),J=_==null?M(Y):typeof _=="function"?_.apply(T,H):_,le=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ue=T.__zoom,Q=typeof P=="function"?P.apply(T,H):P,ee=a(ue.invert(J).concat(le/ue.k),Q.invert(J).concat(le/Q.k));return function(ie){if(ie===1)ie=Q;else{var fe=ee(ie),we=le/fe[2];ie=new Zt(we,J[0]-fe[0]*we,J[1]-fe[1]*we)}D.zoom(null,ie)}})}function G(g,P,_){return!_&&g.__zooming||new F(g,P)}function F(g,P){this.that=g,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,P),this.taps=0}F.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,P){return this.mouse&&g!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var P=fn(this.that).datum();u.call(g,this.that,new a$(g,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),P)}};function X(g,...P){if(!e.apply(this,arguments))return;var _=G(this,P).event(g),A=this.__zoom,T=Math.max(r[0],Math.min(r[1],A.k*Math.pow(2,o.apply(this,arguments)))),H=ln(g);if(_.wheel)(_.mouse[0][0]!==H[0]||_.mouse[0][1]!==H[1])&&(_.mouse[1]=A.invert(_.mouse[0]=H)),clearTimeout(_.wheel);else{if(A.k===T)return;_.mouse=[H,A.invert(H)],Di(this),_.start()}po(g),_.wheel=setTimeout(D,E),_.zoom("mouse",n($(k(A,T),_.mouse[0],_.mouse[1]),_.extent,s));function D(){_.wheel=null,_.end()}}function ne(g,...P){if(d||!e.apply(this,arguments))return;var _=g.currentTarget,A=G(this,P,!0).event(g),T=fn(g.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",le,!0),H=ln(g,_),D=g.clientX,Y=g.clientY;$b(g.view),rs(g),A.mouse=[H,this.__zoom.invert(H)],Di(this),A.start();function J(ue){if(po(ue),!A.moved){var Q=ue.clientX-D,ee=ue.clientY-Y;A.moved=Q*Q+ee*ee>b}A.event(ue).zoom("mouse",n($(A.that.__zoom,A.mouse[0]=ln(ue,_),A.mouse[1]),A.extent,s))}function le(ue){T.on("mousemove.zoom mouseup.zoom",null),Sb(ue.view,A.moved),po(ue),A.event(ue).end()}}function W(g,...P){if(e.apply(this,arguments)){var _=this.__zoom,A=ln(g.changedTouches?g.changedTouches[0]:g,this),T=_.invert(A),H=_.k*(g.shiftKey?.5:2),D=n($(k(_,H),A,T),t.apply(this,P),s);po(g),l>0?fn(this).transition().duration(l).call(B,D,A,g):fn(this).call(w.transform,D,A,g)}}function q(g,...P){if(e.apply(this,arguments)){var _=g.touches,A=_.length,T=G(this,P,g.changedTouches.length===A).event(g),H,D,Y,J;for(rs(g),D=0;D<A;++D)Y=_[D],J=ln(Y,this),J=[J,this.__zoom.invert(J),Y.identifier],T.touch0?!T.touch1&&T.touch0[2]!==J[2]&&(T.touch1=J,T.taps=0):(T.touch0=J,H=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),H&&(T.taps<2&&(f=J[0],c=setTimeout(function(){c=null},h)),Di(this),T.start())}}function I(g,...P){if(this.__zooming){var _=G(this,P).event(g),A=g.changedTouches,T=A.length,H,D,Y,J;for(po(g),H=0;H<T;++H)D=A[H],Y=ln(D,this),_.touch0&&_.touch0[2]===D.identifier?_.touch0[0]=Y:_.touch1&&_.touch1[2]===D.identifier&&(_.touch1[0]=Y);if(D=_.that.__zoom,_.touch1){var le=_.touch0[0],ue=_.touch0[1],Q=_.touch1[0],ee=_.touch1[1],ie=(ie=Q[0]-le[0])*ie+(ie=Q[1]-le[1])*ie,fe=(fe=ee[0]-ue[0])*fe+(fe=ee[1]-ue[1])*fe;D=k(D,Math.sqrt(ie/fe)),Y=[(le[0]+Q[0])/2,(le[1]+Q[1])/2],J=[(ue[0]+ee[0])/2,(ue[1]+ee[1])/2]}else if(_.touch0)Y=_.touch0[0],J=_.touch0[1];else return;_.zoom("touch",n($(D,Y,J),_.extent,s))}}function re(g,...P){if(this.__zooming){var _=G(this,P).event(g),A=g.changedTouches,T=A.length,H,D;for(rs(g),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),H=0;H<T;++H)D=A[H],_.touch0&&_.touch0[2]===D.identifier?delete _.touch0:_.touch1&&_.touch1[2]===D.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(D=ln(D,this),Math.hypot(f[0]-D[0],f[1]-D[1])<C)){var Y=fn(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return w.wheelDelta=function(g){return arguments.length?(o=typeof g=="function"?g:bi(+g),w):o},w.filter=function(g){return arguments.length?(e=typeof g=="function"?g:bi(!!g),w):e},w.touchable=function(g){return arguments.length?(i=typeof g=="function"?g:bi(!!g),w):i},w.extent=function(g){return arguments.length?(t=typeof g=="function"?g:bi([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),w):t},w.scaleExtent=function(g){return arguments.length?(r[0]=+g[0],r[1]=+g[1],w):[r[0],r[1]]},w.translateExtent=function(g){return arguments.length?(s[0][0]=+g[0][0],s[1][0]=+g[1][0],s[0][1]=+g[0][1],s[1][1]=+g[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(g){return arguments.length?(n=g,w):n},w.duration=function(g){return arguments.length?(l=+g,w):l},w.interpolate=function(g){return arguments.length?(a=g,w):a},w.on=function(){var g=u.on.apply(u,arguments);return g===u?w:g},w.clickDistance=function(g){return arguments.length?(b=(g=+g)*g,w):Math.sqrt(b)},w.tapDistance=function(g){return arguments.length?(C=+g,w):C},w}const fd=Symbol("MiniMapSlots"),g$=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],v$={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},m$=Pe({...v$,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=ct(fd),i=nl(),r=Ee(()=>i.style??{});function s(f){t("click",f)}function l(f){t("dblclick",f)}function a(f){t("mouseenter",f)}function u(f){t("mousemove",f)}function c(f){t("mouseleave",f)}return(f,d)=>!f.hidden&&f.dimensions.width!==0&&f.dimensions.height!==0?(K(),te(be,{key:0},[Z(o)[`node-${n.type}`]?(K(),Ve(bn(Z(o)[`node-${n.type}`]),wd(Ro({key:0},{...n,...f.$attrs})),null,16)):(K(),te("rect",Ro({key:1,id:f.id},f.$attrs,{class:["vue-flow__minimap-node",{selected:f.selected,dragging:f.dragging}],x:f.position.x,y:f.position.y,rx:f.borderRadius,ry:f.borderRadius,width:f.dimensions.width,height:f.dimensions.height,fill:f.color||r.value.background||r.value.backgroundColor,stroke:f.strokeColor,"stroke-width":f.strokeWidth,"shape-rendering":f.shapeRendering,onClick:s,onDblclick:l,onMouseenter:a,onMousemove:u,onMouseleave:c}),null,16,g$))],64)):Ae("",!0)}}),y$=["width","height","viewBox","aria-labelledby"],_$=["id"],w$=["d","fill","stroke","stroke-width"],b$={name:"MiniMap",compatConfig:{MODE:3}},x$=Pe({...b$,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=rc(),o=nl(),i=200,r=150,{id:s,edges:l,viewport:a,translateExtent:u,dimensions:c,emits:f,d3Selection:d,d3Zoom:h,getNodesInitialized:E}=ke(),b=ye();Qt(fd,n);const C=Ee(()=>{var T;return e.width??((T=o.style)==null?void 0:T.width)??i}),w=Ee(()=>{var T;return e.height??((T=o.style)==null?void 0:T.height)??r}),k=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",$=ce(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),M=ce(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),B=ce(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),G=ce(()=>pl(E.value.filter(T=>!T.hidden))),F=ce(()=>({x:-a.value.x/a.value.zoom,y:-a.value.y/a.value.zoom,width:c.value.width/a.value.zoom,height:c.value.height/a.value.zoom})),X=ce(()=>E.value&&E.value.length?e0(G.value,F.value):F.value),ne=ce(()=>{const T=X.value.width/C.value,H=X.value.height/w.value;return Math.max(T,H)}),W=ce(()=>{const T=ne.value*C.value,H=ne.value*w.value,D=e.offsetScale*ne.value;return{offset:D,x:X.value.x-(T-X.value.width)/2-D,y:X.value.y-(H-X.value.height)/2-D,width:T+D*2,height:H+D*2}}),q=ce(()=>!W.value.x||!W.value.y?"":`
|
|
43
|
+
M${W.value.x-W.value.offset},${W.value.y-W.value.offset}
|
|
44
|
+
h${W.value.width+W.value.offset*2}
|
|
45
|
+
v${W.value.height+W.value.offset*2}
|
|
46
|
+
h${-W.value.width-W.value.offset*2}z
|
|
47
|
+
M${F.value.x+e.maskBorderRadius},${F.value.y}
|
|
48
|
+
h${F.value.width-2*e.maskBorderRadius}
|
|
49
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
|
|
50
|
+
v${F.value.height-2*e.maskBorderRadius}
|
|
51
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
|
|
52
|
+
h${-(F.value.width-2*e.maskBorderRadius)}
|
|
53
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
54
|
+
v${-(F.value.height-2*e.maskBorderRadius)}
|
|
55
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);sh(T=>{if(b.value){const H=fn(b.value),D=le=>{if(le.sourceEvent.type!=="wheel"||!d.value||!h.value)return;const ue=le.sourceEvent.ctrlKey&&Xo()?10:1,Q=-le.sourceEvent.deltaY*(le.sourceEvent.deltaMode===1?.05:le.sourceEvent.deltaMode?1:.002)*e.zoomStep,ee=a.value.zoom*2**(Q*ue);h.value.scaleTo(d.value,ee)},Y=le=>{if(le.sourceEvent.type!=="mousemove"||!d.value||!h.value)return;const ue=ne.value*Math.max(1,a.value.zoom)*(e.inversePan?-1:1),Q={x:a.value.x-le.sourceEvent.movementX*ue,y:a.value.y-le.sourceEvent.movementY*ue},ee=[[0,0],[c.value.width,c.value.height]],ie=El.translate(Q.x,Q.y).scale(a.value.zoom),fe=h.value.constrain()(ie,ee,u.value);h.value.transform(d.value,fe)},J=p$().wheelDelta(le=>Ms(le)*(e.zoomStep/10)).on("zoom",e.pannable?Y:()=>{}).on("zoom.wheel",e.zoomable?D:()=>{});H.call(J),T(()=>{H.on("zoom",null)})}},{flush:"post"});function I(T){const[H,D]=ln(T);t("click",{event:T,position:{x:H,y:D}})}function re(T,H){const D={event:T,node:H,connectedEdges:$n([H],l.value)};f.miniMapNodeClick(D),t("nodeClick",D)}function g(T,H){const D={event:T,node:H,connectedEdges:$n([H],l.value)};f.miniMapNodeDoubleClick(D),t("nodeDblclick",D)}function P(T,H){const D={event:T,node:H,connectedEdges:$n([H],l.value)};f.miniMapNodeMouseEnter(D),t("nodeMouseenter",D)}function _(T,H){const D={event:T,node:H,connectedEdges:$n([H],l.value)};f.miniMapNodeMouseMove(D),t("nodeMousemove",D)}function A(T,H){const D={event:T,node:H,connectedEdges:$n([H],l.value)};f.miniMapNodeMouseLeave(D),t("nodeMouseleave",D)}return(T,H)=>(K(),Ve(Z(zf),{position:T.position,class:Xe(["vue-flow__minimap",{pannable:T.pannable,zoomable:T.zoomable}])},{default:dt(()=>[(K(),te("svg",{ref_key:"el",ref:b,width:C.value,height:w.value,viewBox:[W.value.x,W.value.y,W.value.width,W.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${Z(s)}`,onClick:I},[T.ariaLabel?(K(),te("title",{key:0,id:`vue-flow__minimap-${Z(s)}`},Oe(T.ariaLabel),9,_$)):Ae("",!0),(K(!0),te(be,null,yt(Z(E),D=>(K(),Ve(m$,{id:D.id,key:D.id,f:"",position:D.computedPosition,dimensions:D.dimensions,selected:D.selected,dragging:D.dragging,style:tt(D.style),class:Xe(B.value(D)),color:$.value(D),"border-radius":T.nodeBorderRadius,"stroke-color":M.value(D),"stroke-width":T.nodeStrokeWidth,"shape-rendering":Z(k),type:D.type,hidden:D.hidden,onClick:Y=>re(Y,D),onDblclick:Y=>g(Y,D),onMouseenter:Y=>P(Y,D),onMousemove:Y=>_(Y,D),onMouseleave:Y=>A(Y,D)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),U("path",{class:"vue-flow__minimap-mask",d:q.value,fill:T.maskColor,stroke:T.maskStrokeColor,"stroke-width":T.maskStrokeWidth,"fill-rule":"evenodd"},null,8,w$)],8,y$))]),_:1},8,["position","class"]))}}),$$={class:"node-agent__head"},S$={class:"node-agent__id"},E$={key:0,class:"node-agent__badge"},N$={key:0,class:"node-agent__warn"},C$={class:"node-agent__desc"},M$={class:"node-agent__ports"},k$={class:"node-agent__col node-agent__col--in"},T$={class:"node-agent__col node-agent__col--out"},I$={__name:"AgentNode",props:{id:String,data:Object},setup(e){const t=e,n=ct("agents"),{removeNodes:o}=ke(),i=ce(()=>n.value.find(s=>s.id===t.data.agentId)),r=ce(()=>!i.value);return(s,l)=>(K(),te("div",{class:Xe(["node-agent",{"node-agent--stale":r.value}])},[U("header",$$,[U("span",S$,[hn(Oe(e.data.agentId)+" ",1),r.value?(K(),te("span",E$,"stale")):Ae("",!0)]),U("button",{class:"node-agent__close",type:"button",onClick:l[0]||(l[0]=a=>Z(o)([e.id])),title:"Remove node"},"✕")]),r.value?(K(),te("p",N$," Agent introuvable dans le repo. Supprime le node ou restaure le fichier. ")):(K(),te(be,{key:1},[U("p",C$,Oe(i.value.description),1),U("div",M$,[U("div",k$,[l[1]||(l[1]=U("div",{class:"node-agent__col-title"},"Inputs",-1)),(K(!0),te(be,null,yt(i.value.inputs,a=>(K(),te("div",{key:a,class:"node-agent__port node-agent__port--in"},[me(Z(On),{id:`in-${a}`,type:"target",position:Z(ae).Left,style:{top:"50%"}},null,8,["id","position"]),hn(" "+Oe(a),1)]))),128))]),U("div",T$,[l[2]||(l[2]=U("div",{class:"node-agent__col-title"},"Outputs",-1)),(K(!0),te(be,null,yt(i.value.outputs,a=>(K(),te("div",{key:a,class:"node-agent__port node-agent__port--out"},[hn(Oe(a)+" ",1),me(Z(On),{id:`out-${a}`,type:"source",position:Z(ae).Right,style:{top:"50%"}},null,8,["id","position"])]))),128))])])],64))],2))}},A$=mn(I$,[["__scopeId","data-v-9ea2f689"]]);function P$(){const e=ye([]),t=ye(!1),n=ye("");async function o(i="md"){t.value=!0,n.value="";try{const r=await fetch(`/api/files?ext=${encodeURIComponent(i)}`),s=await r.json();if(!r.ok)throw new Error(s.error||"list failed");e.value=s.files||[]}catch(r){n.value=r.message,e.value=[]}finally{t.value=!1}}return{files:e,loading:t,error:n,fetchFiles:o}}const D$={class:"file-picker__dialog"},O$={class:"file-picker__head"},R$={class:"file-picker__title"},z$={class:"file-picker__body"},B$=["placeholder"],H$={key:0,class:"file-picker__state"},V$={key:1,class:"file-picker__state file-picker__state--error"},F$={key:2,class:"file-picker__state"},L$={key:3,class:"file-picker__list"},Y$=["onClick"],G$={__name:"FilePicker",props:{open:Boolean,ext:{type:String,default:"md"},title:{type:String,default:"Choisir un fichier"}},emits:["close","pick"],setup(e,{emit:t}){const n=e,o=t,{files:i,loading:r,error:s,fetchFiles:l}=P$(),a=ye("");xe(()=>n.open,f=>{f&&(a.value="",l(n.ext))}),_t(()=>{n.open&&l(n.ext)});const u=ce(()=>{const f=a.value.trim().toLowerCase();return f?i.value.filter(d=>d.toLowerCase().includes(f)):i.value});function c(f){o("pick",f),o("close")}return(f,d)=>e.open?(K(),te("div",{key:0,class:"file-picker",onClick:d[2]||(d[2]=gs(h=>o("close"),["self"]))},[U("div",D$,[U("header",O$,[U("h3",R$,Oe(e.title),1),U("button",{class:"file-picker__close",type:"button",onClick:d[0]||(d[0]=h=>o("close"))},"✕")]),U("div",z$,[Ku(U("input",{"onUpdate:modelValue":d[1]||(d[1]=h=>a.value=h),class:"file-picker__search",type:"text",placeholder:`Filtrer… (${Z(i).length} fichier(s) .${e.ext})`,autofocus:""},null,8,B$),[[Tc,a.value]]),Z(r)?(K(),te("div",H$,"Chargement…")):Z(s)?(K(),te("div",V$,Oe(Z(s)),1)):u.value.length===0?(K(),te("div",F$,"Aucun fichier.")):(K(),te("ul",L$,[(K(!0),te(be,null,yt(u.value,h=>(K(),te("li",{key:h,class:"file-picker__item",onClick:E=>c(h)},Oe(h),9,Y$))),128))]))])])])):Ae("",!0)}},U$=mn(G$,[["__scopeId","data-v-be890d20"]]),X$={class:"node-input__head"},W$={class:"node-input__meta"},K$={class:"node-input__subtypes"},Z$={class:"node-input__body"},q$=["value"],j$={key:0,class:"node-input__path"},J$={key:1,class:"node-input__placeholder"},Q$=["value"],eS=["value"],tS={class:"node-input__port"},nS={__name:"InputNode",props:{id:String,data:Object},setup(e){const t=e,{removeNodes:n,updateNodeData:o}=ke(),i=ye(!1);function r(s){o(t.id,s)}return(s,l)=>(K(),te("div",{class:Xe(["node-input",`node-input--${e.data.subtype||"file"}`])},[U("header",X$,[U("div",W$,[l[9]||(l[9]=U("span",{class:"node-input__kind"},"Input",-1)),U("div",K$,[U("button",{class:Xe(["node-input__st",{"node-input__st--active":(e.data.subtype||"file")==="file"}]),type:"button",onClick:l[0]||(l[0]=a=>r({subtype:"file"}))},"file",2),U("button",{class:Xe(["node-input__st",{"node-input__st--active":e.data.subtype==="text"}]),type:"button",onClick:l[1]||(l[1]=a=>r({subtype:"text"}))},"text",2)])]),U("button",{class:"node-input__close",type:"button",onClick:l[2]||(l[2]=a=>Z(n)([e.id]))},"✕")]),U("div",Z$,[(e.data.subtype||"file")==="file"?(K(),te(be,{key:0},[U("input",{class:"node-input__field",value:e.data.label||"",placeholder:"Label…",onInput:l[3]||(l[3]=a=>r({label:a.target.value}))},null,40,q$),U("button",{class:"node-input__file-btn",type:"button",onClick:l[4]||(l[4]=a=>i.value=!0)},[e.data.value?(K(),te("span",j$,Oe(e.data.value),1)):(K(),te("span",J$,"— choisir un fichier —"))]),me(U$,{open:i.value,ext:"",title:"Input — choisir un fichier",onClose:l[5]||(l[5]=a=>i.value=!1),onPick:l[6]||(l[6]=a=>r({value:a}))},null,8,["open"])],64)):(K(),te(be,{key:1},[U("input",{class:"node-input__field",value:e.data.label||"",placeholder:"Question à poser…",onInput:l[7]||(l[7]=a=>r({label:a.target.value}))},null,40,Q$),U("input",{class:"node-input__field node-input__field--dim",value:e.data.value||"",placeholder:"Valeur par défaut (optionnel)",onInput:l[8]||(l[8]=a=>r({value:a.target.value}))},null,40,eS)],64))]),U("div",tS,[l[10]||(l[10]=hn(" value ",-1)),me(Z(On),{id:"out-value",type:"source",position:Z(ae).Right},null,8,["position"])])],2))}},oS=mn(nS,[["__scopeId","data-v-95ec91bc"]]),iS={__name:"PipelineCanvas",props:{agents:Array,pipeline:Object},setup(e){const t=e,{onConnect:n,addEdges:o,screenToFlowCoordinate:i,onNodesChange:r,onEdgesChange:s,applyNodeChanges:l,applyEdgeChanges:a}=ke();n(d=>{o([{...d,id:`e-${d.source}-${d.sourceHandle}->${d.target}-${d.targetHandle}`}])}),r(d=>{t.pipeline.nodes.value=l(d,t.pipeline.nodes.value)}),s(d=>{t.pipeline.edges.value=a(d,t.pipeline.edges.value)});function u(d){d.preventDefault(),d.dataTransfer.dropEffect="move"}function c(d){d.preventDefault();const h=i({x:d.clientX,y:d.clientY}),E=d.dataTransfer.getData("application/singleton-agent");if(E){t.pipeline.addAgentNode(JSON.parse(E),h);return}const b=d.dataTransfer.getData("application/singleton-node");if(b){const{kind:C,subtype:w}=JSON.parse(b);C==="input"&&t.pipeline.addInputNode(h,{subtype:w||"file"})}}const f={agent:A$,input:oS};return(d,h)=>(K(),te("div",{class:"canvas",onDragover:u,onDrop:c},[me(Z(t1),{nodes:e.pipeline.nodes.value,edges:e.pipeline.edges.value,"node-types":f,"fit-view-on-init":!0},{default:dt(()=>[me(Z(u1),{"pattern-color":"#1c2027",gap:20}),me(Z(V1)),me(Z(x$),{pannable:"",zoomable:"",class:"canvas__minimap"})]),_:1},8,["nodes","edges"])],32))}},rS=mn(iS,[["__scopeId","data-v-b93ee04b"]]),go=ye([]);let sS=0;function Nl(){function e(t,n="info",o=4e3){const i=++sS;go.value=[...go.value,{id:i,text:t,kind:n}],setTimeout(()=>{go.value=go.value.filter(r=>r.id!==i)},o)}return{messages:go,push:e}}const lS={class:"toolbar"},aS={class:"modal__dialog modal__dialog--md"},uS={class:"modal__header"},cS={class:"modal__body"},fS={class:"modal__section"},dS={class:"modal__section-head"},hS={class:"modal__code modal__code--inline"},pS={class:"modal__section"},gS={class:"modal__section-head"},vS={class:"modal__code modal__code--scroll"},mS={class:"modal__dialog modal__dialog--sm"},yS={class:"modal__header"},_S={class:"modal__body"},wS={key:0,class:"pipeline-list__empty"},bS={key:1,class:"pipeline-list"},xS={class:"pipeline-list__info"},$S={class:"pipeline-list__name"},SS={class:"pipeline-list__meta"},ES={class:"pipeline-list__actions"},NS=["onClick"],CS=["onClick"],MS={__name:"PipelineToolbar",props:{pipeline:Object,agents:Array},emits:["rescan"],setup(e,{emit:t}){const n=e,o=t,{push:i}=Nl(),r=ye(!1),s=ye(""),l=ye(""),a=ye(!1),u=ye([]);async function c(){let C;try{C=n.pipeline.toPipelineJson()}catch(M){i(M.message,"error");return}const w={...C,nodes:n.pipeline.nodes.value,edges:n.pipeline.edges.value},k=await fetch("/api/pipelines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)}),$=await k.json();k.ok?i(`Pipeline sauvée → ${$.file}`,"success"):i(`Erreur save: ${$.error}`,"error")}function f(){let C;try{C=n.pipeline.toPipelineJson()}catch(w){i(w.message,"error");return}s.value=JSON.stringify(C,null,2),l.value=`singleton run --pipeline ./pipelines/${C.name}.json`,r.value=!0}async function d(){try{const w=await(await fetch("/api/pipelines")).json();u.value=w.pipelines||[],a.value=!0}catch(C){i(`Erreur list: ${C.message}`,"error")}}function h(C){n.pipeline.loadPipeline(C);const w=n.pipeline.sanitize();a.value=!1,w.length?i(`"${C.name}" chargée — ${w.length} edge(s) obsolète(s) retirée(s)`,"warn"):i(`"${C.name}" chargée`,"success")}async function E(C){if(!confirm(`Supprimer "${C.name}" ?`))return;(await fetch(`/api/pipelines/${encodeURIComponent(C.name)}`,{method:"DELETE"})).ok?(u.value=u.value.filter(k=>k.name!==C.name),i(`"${C.name}" supprimée`,"info")):i("Suppression échouée","error")}function b(C){navigator.clipboard.writeText(C),i("Copié","info",1200)}return(C,w)=>(K(),te("div",lS,[Ku(U("input",{"onUpdate:modelValue":w[0]||(w[0]=k=>e.pipeline.name.value=k),class:"toolbar__input",placeholder:"pipeline name"},null,512),[[Tc,e.pipeline.name.value]]),U("button",{class:"toolbar__btn",type:"button",onClick:w[1]||(w[1]=k=>o("rescan"))},"Rescan"),U("button",{class:"toolbar__btn",type:"button",onClick:d},"Load"),U("button",{class:"toolbar__btn",type:"button",onClick:c},"Save"),U("button",{class:"toolbar__btn toolbar__btn--primary",type:"button",onClick:f},"Export CLI"),U("button",{class:"toolbar__btn toolbar__btn--danger",type:"button",onClick:w[2]||(w[2]=k=>e.pipeline.clear())},"Clear"),r.value?(K(),te("div",{key:0,class:"modal",onClick:w[6]||(w[6]=gs(k=>r.value=!1,["self"]))},[U("div",aS,[U("header",uS,[w[9]||(w[9]=U("h3",{class:"modal__title"},"Export pipeline",-1)),U("button",{class:"modal__close",type:"button",onClick:w[3]||(w[3]=k=>r.value=!1)},"✕")]),U("div",cS,[U("section",fS,[U("div",dS,[w[10]||(w[10]=U("label",{class:"modal__label"},"CLI command",-1)),U("button",{class:"modal__copy",type:"button",onClick:w[4]||(w[4]=k=>b(l.value))},"Copy")]),U("pre",hS,Oe(l.value),1)]),U("section",pS,[U("div",gS,[w[11]||(w[11]=U("label",{class:"modal__label"},"Pipeline JSON",-1)),U("button",{class:"modal__copy",type:"button",onClick:w[5]||(w[5]=k=>b(s.value))},"Copy")]),U("pre",vS,Oe(s.value),1)])])])])):Ae("",!0),a.value?(K(),te("div",{key:1,class:"modal",onClick:w[8]||(w[8]=gs(k=>a.value=!1,["self"]))},[U("div",mS,[U("header",yS,[w[12]||(w[12]=U("h3",{class:"modal__title"},"Charger une pipeline",-1)),U("button",{class:"modal__close",type:"button",onClick:w[7]||(w[7]=k=>a.value=!1)},"✕")]),U("div",_S,[u.value.length===0?(K(),te("p",wS," Aucune pipeline sauvée. ")):(K(),te("ul",bS,[(K(!0),te(be,null,yt(u.value,k=>{var $;return K(),te("li",{key:k.name,class:"pipeline-list__item"},[U("div",xS,[U("div",$S,Oe(k.name),1),U("div",SS,Oe((k.steps||[]).length)+" step(s) · "+Oe((($=k.created)==null?void 0:$.slice(0,16).replace("T"," "))||"n/a"),1)]),U("div",ES,[U("button",{class:"toolbar__btn toolbar__btn--primary",type:"button",onClick:M=>h(k)},"Load",8,NS),U("button",{class:"toolbar__btn toolbar__btn--danger",type:"button",onClick:M=>E(k)},"✕",8,CS)])])}),128))]))])])])):Ae("",!0)]))}},kS=mn(MS,[["__scopeId","data-v-770bf2a0"]]),TS={class:"toast-stack"},IS={__name:"ToastStack",setup(e){const{messages:t}=Nl();return(n,o)=>(K(),te("div",TS,[(K(!0),te(be,null,yt(Z(t),i=>(K(),te("div",{key:i.id,class:Xe(["toast",`toast--${i.kind}`])},Oe(i.text),3))),128))]))}},AS=mn(IS,[["__scopeId","data-v-ac6df039"]]);function PS(){const e=ye([]),t=ye(!1),n=ye(null);async function o(){t.value=!0,n.value=null;try{const r=await fetch("/api/agents");if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=await r.json();e.value=s.agents||[]}catch(r){n.value=r.message}finally{t.value=!1}}async function i(){t.value=!0,n.value=null;try{const s=await(await fetch("/api/agents/rescan",{method:"POST"})).json();e.value=s.agents||[]}catch(r){n.value=r.message}finally{t.value=!1}}return{agents:e,loading:t,error:n,fetchAgents:o,rescan:i}}function DS(e){const t=ye([]),n=ye([]),o=ye("my-pipeline");let i=0;function r(h){return e.value.find(E=>E.id===h)}function s(h,E={x:200,y:120}){i+=1;const b=`${h.id}-${i}`;return t.value=[...t.value,{id:b,type:"agent",position:E,data:{agentId:h.id}}],b}function l(h={x:80,y:120},{subtype:E="file",label:b="",value:C=""}={}){i+=1;const w=`input-${i}`;return t.value=[...t.value,{id:w,type:"input",position:h,data:{subtype:E,label:b,value:C}}],w}function a(h){t.value=t.value.filter(E=>E.id!==h),n.value=n.value.filter(E=>E.source!==h&&E.target!==h)}function u(){t.value=[],n.value=[],i=0,o.value="my-pipeline"}function c(){var C,w;const h=new Map(t.value.map(k=>[k.id,k])),E=[],b=[];for(const k of n.value){const $=h.get(k.source),M=h.get(k.target);if(!$||!M){b.push({edge:k,reason:"node introuvable"});continue}let B=!0,G="";if($.type==="agent"){const ne=r($.data.agentId),W=(C=k.sourceHandle)==null?void 0:C.replace(/^out-/,"");B=!!(ne&&ne.outputs.includes(W)),B||(G=`output "${W}" introuvable`)}else $.type==="input"?B=k.sourceHandle==="out-value":(B=!1,G="source invalide");let F=!0,X="";if(M.type==="agent"){const ne=r(M.data.agentId),W=(w=k.targetHandle)==null?void 0:w.replace(/^in-/,"");F=!!(ne&&ne.inputs.includes(W)),F||(X=`input "${W}" introuvable`)}else F=!1,X="target invalide";B&&F?E.push(k):b.push({edge:k,reason:G||X||"invalide"})}return b.length&&(n.value=E),b}function f(h){u(),o.value=h.name||"my-pipeline",t.value=Array.isArray(h.nodes)?[...h.nodes]:[],n.value=Array.isArray(h.edges)?[...h.edges]:[];for(const E of t.value){const b=String(E.id).match(/(\d+)/g);if(!b)continue;const C=Math.max(...b.map(Number));C>i&&(i=C)}}function d(){const h=new Map(t.value.map(B=>[B.id,B])),E=new Map,b=new Map;for(const B of n.value)(E.get(B.target)||E.set(B.target,[]).get(B.target)).push(B),(b.get(B.source)||b.set(B.source,[]).get(B.source)).push(B);const C=[],w=new Map;function k(B,G=[]){const F=w.get(B);if(F!=="done"){if(F==="visiting"){const X=[...G.slice(G.indexOf(B)),B].join(" → ");throw new Error(`Cycle détecté dans la pipeline: ${X}`)}w.set(B,"visiting");for(const X of E.get(B)||[])k(X.source,[...G,B]);w.set(B,"done"),C.push(B)}}for(const B of t.value)k(B.id);const M=C.filter(B=>{var G;return((G=h.get(B))==null?void 0:G.type)==="agent"}).map(B=>{var q;const G=h.get(B),F=r(G.data.agentId),X=E.get(B)||[];b.get(B);const ne={};for(const I of(F==null?void 0:F.inputs)||[]){const re=X.find(P=>P.targetHandle===`in-${I}`);if(!re){ne[I]="$FILE:<todo-set-path>";continue}const g=h.get(re.source);if((g==null?void 0:g.type)==="input")ne[I]=`$INPUT:${g.id}`;else{const P=(q=re.sourceHandle)==null?void 0:q.replace(/^out-/,"");ne[I]=`$PIPE:${g==null?void 0:g.data.agentId}.${P}`}}const W={};for(const I of(F==null?void 0:F.outputs)||[])W[I]=`$FILE:./output/${G.data.agentId}.${I}.md`;return{agent:G.data.agentId,agent_file:F==null?void 0:F.file,inputs:ne,outputs:W}});return{name:o.value,created:new Date().toISOString(),steps:M}}return{nodes:t,edges:n,name:o,addAgentNode:s,addInputNode:l,removeNode:a,clear:u,sanitize:c,loadPipeline:f,toPipelineJson:d}}const OS={class:"app"},RS={class:"app__header"},zS={class:"app__body"},BS={class:"app__canvas"},HS={__name:"App",setup(e){const{agents:t,loading:n,error:o,fetchAgents:i,rescan:r}=PS(),s=DS(t),{push:l}=Nl();Qt("agents",t);async function a(){await r();const u=s.sanitize();u.length?l(`${u.length} connexion(s) nettoyée(s) après rescan`,"warn"):l("Rescan OK","success",1800)}return _t(i),xe(t,()=>{s.sanitize()},{deep:!0}),(u,c)=>(K(),te("div",OS,[U("header",RS,[c[0]||(c[0]=U("div",{class:"app__brand"},[U("span",{class:"app__logo"},"◉"),U("h1",{class:"app__title"},"Singleton Pipeline Builder"),U("span",{class:"app__tagline"},"— drag agents, wire them up, ship a CLI command")],-1)),me(kS,{pipeline:Z(s),agents:Z(t),onRescan:a},null,8,["pipeline","agents"])]),U("div",zS,[me(Zp,{agents:Z(t),loading:Z(n),error:Z(o)},null,8,["agents","loading","error"]),U("main",BS,[me(rS,{agents:Z(t),pipeline:Z(s)},null,8,["agents","pipeline"])])]),me(AS)]))}},VS=mn(HS,[["__scopeId","data-v-599c0f81"]]);Ip(VS).mount("#app");
|