@lunora/studio 1.0.0-alpha.381 → 1.0.0-alpha.382
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/dist/index.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ApiTab.mjs +1 -1
- package/dist/packem_chunks/AuditPanel.mjs +1 -1
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/FileBrowser.mjs +1 -1
- package/dist/packem_chunks/FunctionRunner.mjs +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
- package/dist/packem_chunks/HealthPanel.mjs +1 -1
- package/dist/packem_chunks/InsightsPanel.mjs +1 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MailPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
- package/dist/packem_chunks/PitrPanel.mjs +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
- package/dist/packem_chunks/SettingsPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +1 -1
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
- package/dist/packem_chunks/analytics-panel.mjs +1 -1
- package/dist/packem_chunks/architecture-panel.mjs +1 -1
- package/dist/packem_chunks/assistant-panel.mjs +2 -2
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/auth-config-panel.mjs +1 -1
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -1
- package/dist/packem_chunks/containers-panel.mjs +1 -1
- package/dist/packem_chunks/dashboards-panel.mjs +1 -1
- package/dist/packem_chunks/evals-panel.mjs +1 -1
- package/dist/packem_chunks/fanout-panel.mjs +1 -1
- package/dist/packem_chunks/flags-panel.mjs +1 -1
- package/dist/packem_chunks/issues-panel.mjs +1 -1
- package/dist/packem_chunks/kv-browser.mjs +1 -1
- package/dist/packem_chunks/log-drains-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_chunks/organizations-panel.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_chunks/permissions-panel.mjs +1 -1
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
- package/dist/packem_chunks/queues-panel.mjs +1 -1
- package/dist/packem_chunks/reactors-panel.mjs +1 -1
- package/dist/packem_chunks/rls-panel.mjs +1 -1
- package/dist/packem_chunks/schedule-panel.mjs +1 -1
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
- package/dist/packem_chunks/sync-client-panel.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/users-panel.mjs +1 -1
- package/dist/packem_chunks/vector-browser.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/ApiDocsPanel-BZNuHTR8.mjs +2 -0
- package/dist/packem_shared/{ApiReferencePanel-CQxU1Ocx.mjs → ApiReferencePanel-DDvLw7c1.mjs} +1 -1
- package/dist/packem_shared/{CommandPalette-BZCHLpst.mjs → CommandPalette-BjHFgNA6.mjs} +1 -1
- package/dist/packem_shared/{DEFAULT_AUTO_REFRESH_MS-B9kGlqXE.mjs → DEFAULT_AUTO_REFRESH_MS-jK7srdI4.mjs} +1 -1
- package/dist/packem_shared/{DataBrowser-CkVOu6py.mjs → DataBrowser-Dp8ayK1S.mjs} +1 -1
- package/dist/packem_shared/{GlobalDataBrowser-l2ECwXCm.mjs → GlobalDataBrowser-VehUMwUK.mjs} +1 -1
- package/dist/packem_shared/{HomePanel-c7as4tvl.mjs → HomePanel-D5-wWLAj.mjs} +1 -1
- package/dist/packem_shared/{MigrationsPanel-BQol4Un1.mjs → MigrationsPanel-CTd2YSSk.mjs} +1 -1
- package/dist/packem_shared/{OpenRpcReferencePanel-BFDG91tn.mjs → OpenRpcReferencePanel-dXFl95w8.mjs} +1 -1
- package/dist/packem_shared/{ScheduledJobs-Du8ZGL7v.mjs → ScheduledJobs-DPQHuiy6.mjs} +1 -1
- package/dist/packem_shared/Studio-CrfDOmdv.mjs +1 -0
- package/dist/packem_shared/{StudioApp-CsyDnrg2.mjs → StudioApp-DKBDIF7N.mjs} +1 -1
- package/dist/packem_shared/{advisor-view-gtf_DhUU.mjs → advisor-view-y9c2z5w1.mjs} +1 -1
- package/dist/packem_shared/{assistant-provider-Dw0roZh3.mjs → assistant-provider-b2GtJb5K.mjs} +1 -1
- package/dist/packem_shared/{data-grid-B5m1OosL.mjs → data-grid-GQLHcpMI.mjs} +1 -1
- package/dist/packem_shared/{diagram-export-panel-Vdt-DZnO.mjs → diagram-export-panel-miFPsocM.mjs} +1 -1
- package/dist/packem_shared/{error-alert-3AR_-s_s.mjs → error-alert-BxCd81tw.mjs} +1 -1
- package/dist/packem_shared/{grid-features-Drvfswwy.mjs → grid-features-Cdy2nWxA.mjs} +2 -2
- package/dist/packem_shared/{home-panel-TpxiaHgB.mjs → home-panel-BlvQ0xK2.mjs} +1 -1
- package/dist/packem_shared/{internal-hIuTpSbx.mjs → internal-BT5tH08j.mjs} +1 -1
- package/dist/packem_shared/{log-line-CYJQf6P-.mjs → log-line-BmYn49u1.mjs} +1 -1
- package/dist/packem_shared/{recording-client-z4CBi0y8.mjs → recording-client-D_-eNapT.mjs} +1 -1
- package/dist/packem_shared/{reference-view-DENugPcj.mjs → reference-view-CRtrtDMy.mjs} +3 -3
- package/dist/packem_shared/{schema-diagram-CtVPhOGj.mjs → schema-diagram-Dbs7-jSJ.mjs} +1 -1
- package/dist/packem_shared/{sql-result-table-DCwooMGW.mjs → sql-result-table-BuOHHoFG.mjs} +1 -1
- package/dist/packem_shared/{studio-DZlpp4Vx.mjs → studio-CwelGawN.mjs} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bfmg04MD.mjs → table-list-sidebar-Cw7ll9yK.mjs} +1 -1
- package/dist/packem_shared/{use-admin-query-CaOm4JS3.mjs → use-admin-query-DMnTt_hg.mjs} +1 -1
- package/dist/packem_shared/{use-admin-spec-CK7mk3Ui.mjs → use-admin-spec-Cokw73Ks.mjs} +1 -1
- package/dist/packem_shared/use-assistant-rpc-DLsuqTPB.mjs +1 -0
- package/dist/packem_shared/{use-async-submit-D0r7-m2J.mjs → use-async-submit-CBFJevkc.mjs} +1 -1
- package/dist/packem_shared/{use-auth-config-DameIc6y.mjs → use-auth-config-xzSMjhOV.mjs} +1 -1
- package/dist/packem_shared/{use-open-trace-BJKMJjeS.mjs → use-open-trace-trRfFb77.mjs} +1 -1
- package/dist/standalone/{chunk-F2DVDJV6.js → chunk-26XOFIV4.js} +1 -1
- package/dist/standalone/{chunk-MTBY4GXM.js → chunk-2AKEF2E6.js} +1 -1
- package/dist/standalone/chunk-2BX4MJK6.js +1 -0
- package/dist/standalone/{chunk-XBHRAFJA.js → chunk-2DDDI4IG.js} +1 -1
- package/dist/standalone/{chunk-Z4BLDRDD.js → chunk-2YQF4QCI.js} +1 -1
- package/dist/standalone/{chunk-SBQT2ZSX.js → chunk-3CDQYHJX.js} +1 -1
- package/dist/standalone/{chunk-FKOAI6VV.js → chunk-3CHHMX6A.js} +1 -1
- package/dist/standalone/{chunk-YL5ZAR3P.js → chunk-3CUQWI5A.js} +1 -1
- package/dist/standalone/{chunk-7MQQPZQC.js → chunk-3DIKPPNZ.js} +1 -1
- package/dist/standalone/{chunk-WVURFBJS.js → chunk-3JLFCEXX.js} +1 -1
- package/dist/standalone/{chunk-FPODRWDZ.js → chunk-3SRQFKDT.js} +1 -1
- package/dist/standalone/{chunk-ML6YSDEQ.js → chunk-4EZ3YMBU.js} +1 -1
- package/dist/standalone/{chunk-SADHW6WJ.js → chunk-4NRWZ3IK.js} +1 -1
- package/dist/standalone/{chunk-3QNDJXLL.js → chunk-4UDH2YI4.js} +1 -1
- package/dist/standalone/{chunk-AY4DPAPO.js → chunk-57JJA4FO.js} +1 -1
- package/dist/standalone/{chunk-K7GU4AIX.js → chunk-6HVMODID.js} +1 -1
- package/dist/standalone/{chunk-I7PUGF3D.js → chunk-6XU2QUI3.js} +1 -1
- package/dist/standalone/{chunk-HBEZGCPB.js → chunk-73WXN7SZ.js} +1 -1
- package/dist/standalone/{chunk-I626YY7T.js → chunk-75LZZADZ.js} +1 -1
- package/dist/standalone/{chunk-4TGALJHR.js → chunk-7MM2SI65.js} +1 -1
- package/dist/standalone/{chunk-AWFFXR6S.js → chunk-A27GQYC7.js} +1 -1
- package/dist/standalone/{chunk-W3WGVJNJ.js → chunk-AE4LQOKG.js} +1 -1
- package/dist/standalone/{chunk-2VGEYQJ5.js → chunk-AMX5BC24.js} +1 -1
- package/dist/standalone/{chunk-JXUU3BD2.js → chunk-CAEQ6OOD.js} +1 -1
- package/dist/standalone/{chunk-UUOEHNMP.js → chunk-CCJUOPWR.js} +1 -1
- package/dist/standalone/{chunk-4YEGXH2V.js → chunk-CHYLD556.js} +1 -1
- package/dist/standalone/{chunk-WDR3BJ2C.js → chunk-CLZSERWW.js} +1 -1
- package/dist/standalone/{chunk-IMM6HPPD.js → chunk-CNPADLAP.js} +1 -1
- package/dist/standalone/{chunk-XOLTLG4I.js → chunk-D3YEERHT.js} +1 -1
- package/dist/standalone/{chunk-3NYU3CCO.js → chunk-D57SW6H5.js} +1 -1
- package/dist/standalone/{chunk-GCYQOJYI.js → chunk-DLF6VPZK.js} +1 -1
- package/dist/standalone/{chunk-NPZG7XK5.js → chunk-EFJ5SREG.js} +1 -1
- package/dist/standalone/{chunk-VGKDC2OQ.js → chunk-EG45XFL3.js} +1 -1
- package/dist/standalone/{chunk-RAJ327CY.js → chunk-EI2FSTI3.js} +1 -1
- package/dist/standalone/{chunk-KQVY73EU.js → chunk-F4ZN2DRL.js} +3 -3
- package/dist/standalone/{chunk-DELDS72W.js → chunk-F7SJ4DOF.js} +1 -1
- package/dist/standalone/{chunk-ZZA6VQDG.js → chunk-FNWWGQVC.js} +1 -1
- package/dist/standalone/{chunk-NQ727GVM.js → chunk-FOXLEMWC.js} +1 -1
- package/dist/standalone/{chunk-337EJGCU.js → chunk-G62WODKV.js} +1 -1
- package/dist/standalone/{chunk-2KREOMPV.js → chunk-GMKV6EAQ.js} +1 -1
- package/dist/standalone/{chunk-V4JKKAAZ.js → chunk-GTW3JPQQ.js} +1 -1
- package/dist/standalone/{chunk-XSFGXEYO.js → chunk-GWJ57WD2.js} +1 -1
- package/dist/standalone/{chunk-MICDQTTJ.js → chunk-HFDKQBIZ.js} +1 -1
- package/dist/standalone/{chunk-WONKLAKW.js → chunk-HVKGOO4E.js} +1 -1
- package/dist/standalone/{chunk-JELTLAEP.js → chunk-I4AZTCAA.js} +1 -1
- package/dist/standalone/{chunk-274SZA4F.js → chunk-I4EVK4EW.js} +1 -1
- package/dist/standalone/{chunk-76D454G5.js → chunk-JEYIP5MS.js} +1 -1
- package/dist/standalone/{chunk-XEIJUQ4B.js → chunk-JI4WZ5K5.js} +1 -1
- package/dist/standalone/{chunk-MGYRQPAY.js → chunk-JNB2EV3N.js} +1 -1
- package/dist/standalone/{chunk-ZBLG4UAV.js → chunk-JR66YIA4.js} +1 -1
- package/dist/standalone/{chunk-RPRNYCFT.js → chunk-KB75JASP.js} +1 -1
- package/dist/standalone/{chunk-5NPU6VPX.js → chunk-KNZGU3CE.js} +1 -1
- package/dist/standalone/{chunk-OVPS52RO.js → chunk-KS2ZCKZ2.js} +1 -1
- package/dist/standalone/{chunk-WU2ST74V.js → chunk-L645XKP6.js} +1 -1
- package/dist/standalone/{chunk-QCG2G6IF.js → chunk-LAQNOLYC.js} +1 -1
- package/dist/standalone/{chunk-EVUVQB4Q.js → chunk-M2X2UFAA.js} +1 -1
- package/dist/standalone/{chunk-AE3ABYCE.js → chunk-MSW4QPCU.js} +1 -1
- package/dist/standalone/{chunk-X474JV2D.js → chunk-N36AT4CI.js} +1 -1
- package/dist/standalone/{chunk-ELWBGGS7.js → chunk-NCDS5OJ4.js} +1 -1
- package/dist/standalone/{chunk-O65QTRXU.js → chunk-NIHVUGDE.js} +1 -1
- package/dist/standalone/{chunk-VTTS5L36.js → chunk-NLRCYQUM.js} +1 -1
- package/dist/standalone/{chunk-UOFMFYZ7.js → chunk-NX6JHCY5.js} +2 -2
- package/dist/standalone/{chunk-2DKLUTH2.js → chunk-OKDHAG2Y.js} +1 -1
- package/dist/standalone/{chunk-LHQFTCOS.js → chunk-OYO74NM4.js} +1 -1
- package/dist/standalone/{chunk-Q7KRCKCE.js → chunk-PBHKQULL.js} +1 -1
- package/dist/standalone/{chunk-GDAZWXQW.js → chunk-PFIATRRO.js} +1 -1
- package/dist/standalone/{chunk-66IUCD6W.js → chunk-PSPK6BZ2.js} +1 -1
- package/dist/standalone/{chunk-NDIEUO4N.js → chunk-QKWIY6JW.js} +1 -1
- package/dist/standalone/{chunk-YTLKHICM.js → chunk-QLMDHJMC.js} +1 -1
- package/dist/standalone/{chunk-KXUK7CSR.js → chunk-QQ4LEH7V.js} +1 -1
- package/dist/standalone/{chunk-ZZ6ZCOD4.js → chunk-QQENKHRS.js} +1 -1
- package/dist/standalone/{chunk-RK3HQKPW.js → chunk-QT3W5POL.js} +1 -1
- package/dist/standalone/{chunk-A2LKDNNA.js → chunk-QTG3KGNJ.js} +1 -1
- package/dist/standalone/{chunk-DWKKQ75U.js → chunk-ROHVLVGW.js} +1 -1
- package/dist/standalone/{chunk-5QK3ZHNZ.js → chunk-RQHLJCG7.js} +1 -1
- package/dist/standalone/{chunk-OOUGGYHQ.js → chunk-RRDXY56O.js} +1 -1
- package/dist/standalone/{chunk-MULFKWTQ.js → chunk-RWEEBORY.js} +1 -1
- package/dist/standalone/{chunk-MNXXIISC.js → chunk-RY6I3E2K.js} +1 -1
- package/dist/standalone/{chunk-DJPK4PZV.js → chunk-S3LW4HCF.js} +1 -1
- package/dist/standalone/{chunk-O4SDDSDL.js → chunk-S63YTOR5.js} +1 -1
- package/dist/standalone/{chunk-KVQ2GMJR.js → chunk-SGIW3B4R.js} +1 -1
- package/dist/standalone/{chunk-LYNQHGQ4.js → chunk-SOKPPTFJ.js} +1 -1
- package/dist/standalone/{chunk-4E6DQHFK.js → chunk-SOTNC2VE.js} +1 -1
- package/dist/standalone/{chunk-OJO6ERJ4.js → chunk-TMIYU26C.js} +1 -1
- package/dist/standalone/{chunk-D2LGOQ32.js → chunk-TY5MXKUY.js} +1 -1
- package/dist/standalone/{chunk-UFFUDDK7.js → chunk-VTAHI7AZ.js} +1 -1
- package/dist/standalone/{chunk-JQBZDS6X.js → chunk-VX6ZBLXB.js} +1 -1
- package/dist/standalone/{chunk-ZPQFM3A7.js → chunk-WD6TOMHJ.js} +1 -1
- package/dist/standalone/{chunk-ZHZHI6KX.js → chunk-WHIWJD5H.js} +1 -1
- package/dist/standalone/{chunk-QOK2UU3L.js → chunk-WUK2O2KI.js} +1 -1
- package/dist/standalone/{chunk-NYLSD5LR.js → chunk-XEZ7LEII.js} +1 -1
- package/dist/standalone/{chunk-4W7SB3SF.js → chunk-YFZFL4XI.js} +1 -1
- package/dist/standalone/{chunk-OR4RO6V4.js → chunk-YIVDW4BV.js} +1 -1
- package/dist/standalone/{chunk-5MIJ3KEK.js → chunk-Z7HICJ3Z.js} +1 -1
- package/dist/standalone/chunk-ZBXY4FVL.js +14 -0
- package/dist/standalone/studio.js +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/ApiDocsPanel-sEDqUNQq.mjs +0 -2
- package/dist/packem_shared/Studio-BmbkaUrx.mjs +0 -1
- package/dist/packem_shared/use-assistant-rpc-AKu8hvPm.mjs +0 -1
- package/dist/standalone/chunk-A4F3YMBV.js +0 -1
- package/dist/standalone/chunk-AQ6LY5RO.js +0 -14
- /package/dist/standalone/{chunk-VJQP4ARP.js → chunk-ITS5LMYJ.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ro,b as io,c as mi,d as yi,e as ln,g as wi,h as xi,i as ct}from"./chunk-Y2YLTUMD.js";import{a as bi,b as Si,c as Ei,f as un}from"./chunk-GDAZWXQW.js";import{e as pi,k as gi}from"./chunk-2NUCBQFU.js";import{b as xl}from"./chunk-N7FOBAV3.js";import{a as wl}from"./chunk-4AG356VE.js";import{B as hi,b as ui,j as fi,s as oo}from"./chunk-VJQP4ARP.js";import{a as no,b as di}from"./chunk-ADABTCDI.js";import{a as o,d as Ke}from"./chunk-5PEAXTYQ.js";var bl={value:o(()=>{},"value")};function Ci(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new dn(n)}o(Ci,"dispatch");function dn(e){this._=e}o(dn,"Dispatch");function Sl(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(Sl,"parseTypenames");dn.prototype=Ci.prototype={constructor:dn,on:o(function(e,t){var n=this._,r=Sl(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=El(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=vi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=vi(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new dn(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function El(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(El,"get");function vi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=bl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(vi,"set");var Qe=Ci;var fn="http://www.w3.org/1999/xhtml",so={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ne(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),so.hasOwnProperty(t)?{space:so[t],local:e}:e}o(Ne,"default");function vl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fn&&t.documentElement.namespaceURI===fn?t.createElement(e):t.createElementNS(n,e)}}o(vl,"creatorInherit");function Cl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(Cl,"creatorFixed");function Dt(e){var t=Ne(e);return(t.local?Cl:vl)(t)}o(Dt,"default");function _l(){}o(_l,"none");function $e(e){return e==null?_l:function(){return this.querySelector(e)}}o($e,"default");function ao(e){typeof e!="function"&&(e=$e(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=e.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),c[d]=u);return new se(r,this._parents)}o(ao,"default");function co(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(co,"array");function Nl(){return[]}o(Nl,"empty");function lt(e){return e==null?Nl:function(){return this.querySelectorAll(e)}}o(lt,"default");function Ml(e){return function(){return co(e.apply(this,arguments))}}o(Ml,"arrayAll");function lo(e){typeof e=="function"?e=Ml(e):e=lt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new se(r,i)}o(lo,"default");function ut(e){return function(){return this.matches(e)}}o(ut,"default");function hn(e){return function(t){return t.matches(e)}}o(hn,"childMatcher");var Il=Array.prototype.find;function Pl(e){return function(){return Il.call(this.children,e)}}o(Pl,"childFind");function kl(){return this.firstElementChild}o(kl,"childFirst");function uo(e){return this.select(e==null?kl:Pl(typeof e=="function"?e:hn(e)))}o(uo,"default");var Al=Array.prototype.filter;function Dl(){return Array.from(this.children)}o(Dl,"children");function Tl(e){return function(){return Al.call(this.children,e)}}o(Tl,"childrenFilter");function fo(e){return this.selectAll(e==null?Dl:Tl(typeof e=="function"?e:hn(e)))}o(fo,"default");function ho(e){typeof e!="function"&&(e=ut(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new se(r,this._parents)}o(ho,"default");function Tt(e){return new Array(e.length)}o(Tt,"default");function po(){return new se(this._enter||this._groups.map(Tt),this._parents)}o(po,"default");function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(Rt,"EnterNode");Rt.prototype={constructor:Rt,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function go(e){return function(){return e}}o(go,"default");function Rl(e,t,n,r,i,s){for(var a=0,c,l=t.length,u=s.length;a<u;++a)(c=t[a])?(c.__data__=s[a],r[a]=c):n[a]=new Rt(e,s[a]);for(;a<l;++a)(c=t[a])&&(i[a]=c)}o(Rl,"bindIndex");function Ol(e,t,n,r,i,s,a){var c,l,u=new Map,d=t.length,h=s.length,f=new Array(d),p;for(c=0;c<d;++c)(l=t[c])&&(f[c]=p=a.call(l,l.__data__,c,t)+"",u.has(p)?i[c]=l:u.set(p,l));for(c=0;c<h;++c)p=a.call(e,s[c],c,s)+"",(l=u.get(p))?(r[c]=l,l.__data__=s[c],u.delete(p)):n[c]=new Rt(e,s[c]);for(c=0;c<d;++c)(l=t[c])&&u.get(f[c])===l&&(i[c]=l)}o(Ol,"bindKey");function zl(e){return e.__data__}o(zl,"datum");function mo(e,t){if(!arguments.length)return Array.from(this,zl);var n=t?Ol:Rl,r=this._parents,i=this._groups;typeof e!="function"&&(e=go(e));for(var s=i.length,a=new Array(s),c=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],h=i[u],f=h.length,p=$l(e.call(d,d&&d.__data__,u,r)),m=p.length,S=c[u]=new Array(m),x=a[u]=new Array(m),w=l[u]=new Array(f);n(d,h,S,x,w,p,t);for(var E=0,g=0,b,N;E<m;++E)if(b=S[E]){for(E>=g&&(g=E+1);!(N=x[g])&&++g<m;);b._next=N||null}}return a=new se(a,r),a._enter=c,a._exit=l,a}o(mo,"default");function $l(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o($l,"arraylike");function yo(){return new se(this._exit||this._groups.map(Tt),this._parents)}o(yo,"default");function wo(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(wo,"default");function xo(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),c=new Array(i),l=0;l<a;++l)for(var u=n[l],d=r[l],h=u.length,f=c[l]=new Array(h),p,m=0;m<h;++m)(p=u[m]||d[m])&&(f[m]=p);for(;l<i;++l)c[l]=n[l];return new se(c,this._parents)}o(xo,"default");function bo(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(bo,"default");function So(e){e||(e=Ll);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],c=a.length,l=i[s]=new Array(c),u,d=0;d<c;++d)(u=a[d])&&(l[d]=u);l.sort(t)}return new se(i,this._parents).order()}o(So,"default");function Ll(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(Ll,"ascending");function Eo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(Eo,"default");function vo(){return Array.from(this)}o(vo,"default");function Co(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Co,"default");function _o(){let e=0;for(let t of this)++e;return e}o(_o,"default");function No(){return!this.node()}o(No,"default");function Mo(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,c;s<a;++s)(c=i[s])&&e.call(c,c.__data__,s,i);return this}o(Mo,"default");function Hl(e){return function(){this.removeAttribute(e)}}o(Hl,"attrRemove");function Bl(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Bl,"attrRemoveNS");function Vl(e,t){return function(){this.setAttribute(e,t)}}o(Vl,"attrConstant");function Fl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(Fl,"attrConstantNS");function Wl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(Wl,"attrFunction");function Yl(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)}}o(Yl,"attrFunctionNS");function Io(e,t){var n=Ne(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Bl:Hl:typeof t=="function"?n.local?Yl:Wl:n.local?Fl:Vl)(n,t))}o(Io,"default");function Ot(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Ot,"default");function Xl(e){return function(){this.style.removeProperty(e)}}o(Xl,"styleRemove");function Zl(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(Zl,"styleConstant");function Ul(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(Ul,"styleFunction");function Po(e,t,n){return arguments.length>1?this.each((t==null?Xl:typeof t=="function"?Ul:Zl)(e,t,n??"")):Le(this.node(),e)}o(Po,"default");function Le(e,t){return e.style.getPropertyValue(t)||Ot(e).getComputedStyle(e,null).getPropertyValue(t)}o(Le,"styleValue");function ql(e){return function(){delete this[e]}}o(ql,"propertyRemove");function Gl(e,t){return function(){this[e]=t}}o(Gl,"propertyConstant");function Kl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(Kl,"propertyFunction");function ko(e,t){return arguments.length>1?this.each((t==null?ql:typeof t=="function"?Kl:Gl)(e,t)):this.node()[e]}o(ko,"default");function _i(e){return e.trim().split(/^|\s+/)}o(_i,"classArray");function Ao(e){return e.classList||new Ni(e)}o(Ao,"classList");function Ni(e){this._node=e,this._names=_i(e.getAttribute("class")||"")}o(Ni,"ClassList");Ni.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Mi(e,t){for(var n=Ao(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Mi,"classedAdd");function Ii(e,t){for(var n=Ao(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(Ii,"classedRemove");function Ql(e){return function(){Mi(this,e)}}o(Ql,"classedTrue");function Jl(e){return function(){Ii(this,e)}}o(Jl,"classedFalse");function jl(e,t){return function(){(t.apply(this,arguments)?Mi:Ii)(this,e)}}o(jl,"classedFunction");function Do(e,t){var n=_i(e+"");if(arguments.length<2){for(var r=Ao(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?jl:t?Ql:Jl)(n,t))}o(Do,"default");function eu(){this.textContent=""}o(eu,"textRemove");function tu(e){return function(){this.textContent=e}}o(tu,"textConstant");function nu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(nu,"textFunction");function To(e){return arguments.length?this.each(e==null?eu:(typeof e=="function"?nu:tu)(e)):this.node().textContent}o(To,"default");function ou(){this.innerHTML=""}o(ou,"htmlRemove");function ru(e){return function(){this.innerHTML=e}}o(ru,"htmlConstant");function iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(iu,"htmlFunction");function Ro(e){return arguments.length?this.each(e==null?ou:(typeof e=="function"?iu:ru)(e)):this.node().innerHTML}o(Ro,"default");function su(){this.nextSibling&&this.parentNode.appendChild(this)}o(su,"raise");function Oo(){return this.each(su)}o(Oo,"default");function au(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(au,"lower");function zo(){return this.each(au)}o(zo,"default");function $o(e){var t=typeof e=="function"?e:Dt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o($o,"default");function cu(){return null}o(cu,"constantNull");function Lo(e,t){var n=typeof e=="function"?e:Dt(e),r=t==null?cu:typeof t=="function"?t:$e(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Lo,"default");function lu(){var e=this.parentNode;e&&e.removeChild(this)}o(lu,"remove");function Ho(){return this.each(lu)}o(Ho,"default");function uu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(uu,"selection_cloneShallow");function du(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(du,"selection_cloneDeep");function Bo(e){return this.select(e?du:uu)}o(Bo,"default");function Vo(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Vo,"default");function fu(e){return function(t){e.call(this,t,this.__data__)}}o(fu,"contextListener");function hu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(hu,"parseTypenames");function pu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(pu,"onRemove");function gu(e,t,n){return function(){var r=this.__on,i,s=fu(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(gu,"onAdd");function Fo(e,t,n){var r=hu(e+""),i,s=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(i=0,d=c[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(c=t?gu:pu,i=0;i<s;++i)this.each(c(r[i],t,n));return this}o(Fo,"default");function Pi(e,t,n){var r=Ot(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Pi,"dispatchEvent");function mu(e,t){return function(){return Pi(this,e,t)}}o(mu,"dispatchConstant");function yu(e,t){return function(){return Pi(this,e,t.apply(this,arguments))}}o(yu,"dispatchFunction");function Wo(e,t){return this.each((typeof t=="function"?yu:mu)(e,t))}o(Wo,"default");function*Yo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Yo,"default");var Xo=[null];function se(e,t){this._groups=e,this._parents=t}o(se,"Selection");function ki(){return new se([[document.documentElement]],Xo)}o(ki,"selection");function wu(){return this}o(wu,"selection_selection");se.prototype=ki.prototype={constructor:se,select:ao,selectAll:lo,selectChild:uo,selectChildren:fo,filter:ho,data:mo,enter:po,exit:yo,join:wo,merge:xo,selection:wu,order:bo,sort:So,call:Eo,nodes:vo,node:Co,size:_o,empty:No,each:Mo,attr:Io,style:Po,property:ko,classed:Do,text:To,html:Ro,raise:Oo,lower:zo,append:$o,insert:Lo,remove:Ho,clone:Bo,datum:Vo,on:Fo,dispatch:Wo,[Symbol.iterator]:Yo};var De=ki;function ce(e){return typeof e=="string"?new se([[document.querySelector(e)]],[document.documentElement]):new se([[e]],Xo)}o(ce,"default");function Zo(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(Zo,"default");function fe(e,t){if(e=Zo(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(fe,"default");var Ai={passive:!1},Je={capture:!0,passive:!1};function pn(e){e.stopImmediatePropagation()}o(pn,"nopropagation");function Te(e){e.preventDefault(),e.stopImmediatePropagation()}o(Te,"default");function dt(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Te,Je);"onselectstart"in t?n.on("selectstart.drag",Te,Je):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(dt,"default");function zt(e,t){var n=e.document.documentElement,r=ce(e).on("dragstart.drag",null);t&&(r.on("click.drag",Te,Je),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(zt,"yesdrag");var $t=o(e=>()=>e,"default");function Lt(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Lt,"DragEvent");Lt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xu(e){return!e.ctrlKey&&!e.button}o(xu,"defaultFilter");function bu(){return this.parentNode}o(bu,"defaultContainer");function Su(e,t){return t??{x:e.x,y:e.y}}o(Su,"defaultSubject");function Eu(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Eu,"defaultTouchable");function Ht(){var e=xu,t=bu,n=Su,r=Eu,i={},s=Qe("start","drag","end"),a=0,c,l,u,d,h=0;function f(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",x).on("touchmove.drag",w,Ai).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(f,"drag");function p(b,N){if(!(d||!e.call(this,b,N))){var C=g(this,t.call(this,b,N),b,N,"mouse");C&&(ce(b.view).on("mousemove.drag",m,Je).on("mouseup.drag",S,Je),dt(b.view),pn(b),u=!1,c=b.clientX,l=b.clientY,C("start",b))}}o(p,"mousedowned");function m(b){if(Te(b),!u){var N=b.clientX-c,C=b.clientY-l;u=N*N+C*C>h}i.mouse("drag",b)}o(m,"mousemoved");function S(b){ce(b.view).on("mousemove.drag mouseup.drag",null),zt(b.view,u),Te(b),i.mouse("end",b)}o(S,"mouseupped");function x(b,N){if(e.call(this,b,N)){var C=b.changedTouches,M=t.call(this,b,N),D=C.length,A,B;for(A=0;A<D;++A)(B=g(this,M,b,N,C[A].identifier,C[A]))&&(pn(b),B("start",b,C[A]))}}o(x,"touchstarted");function w(b){var N=b.changedTouches,C=N.length,M,D;for(M=0;M<C;++M)(D=i[N[M].identifier])&&(Te(b),D("drag",b,N[M]))}o(w,"touchmoved");function E(b){var N=b.changedTouches,C=N.length,M,D;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<C;++M)(D=i[N[M].identifier])&&(pn(b),D("end",b,N[M]))}o(E,"touchended");function g(b,N,C,M,D,A){var B=s.copy(),z=fe(A||C,N),V,$,y;if((y=n.call(b,new Lt("beforestart",{sourceEvent:C,target:f,identifier:D,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:B}),M))!=null)return V=y.x-z[0]||0,$=y.y-z[1]||0,o(function v(_,I,T){var R=z,H;switch(_){case"start":i[D]=v,H=a++;break;case"end":delete i[D],--a;case"drag":z=fe(T||I,N),H=a;break}B.call(_,b,new Lt(_,{sourceEvent:I,subject:y,target:f,identifier:D,active:H,x:z[0]+V,y:z[1]+$,dx:z[0]-R[0],dy:z[1]-R[1],dispatch:B}),M)},"gesture")}return o(g,"beforestart"),f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:$t(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:$t(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:$t(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:$t(!!b),f):r},f.on=function(){var b=s.on.apply(s,arguments);return b===s?f:b},f.clickDistance=function(b){return arguments.length?(h=(b=+b)*b,f):Math.sqrt(h)},f}o(Ht,"default");var ft=0,Vt=0,Bt=0,Ti=1e3,gn,Ft,mn=0,je=0,yn=0,Wt=typeof performance=="object"&&performance.now?performance:Date,Ri=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xt(){return je||(Ri(vu),je=Wt.now()+yn)}o(Xt,"now");function vu(){je=0}o(vu,"clearNow");function Yt(){this._call=this._time=this._next=null}o(Yt,"Timer");Yt.prototype=wn.prototype={constructor:Yt,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xt():+n)+(t==null?0:+t),!this._next&&Ft!==this&&(Ft?Ft._next=this:gn=this,Ft=this),this._call=e,this._time=n,Uo()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,Uo())},"stop")};function wn(e,t,n){var r=new Yt;return r.restart(e,t,n),r}o(wn,"timer");function Oi(){Xt(),++ft;for(var e=gn,t;e;)(t=je-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ft}o(Oi,"timerFlush");function Di(){je=(mn=Wt.now())+yn,ft=Vt=0;try{Oi()}finally{ft=0,_u(),je=0}}o(Di,"wake");function Cu(){var e=Wt.now(),t=e-mn;t>Ti&&(yn-=t,mn=e)}o(Cu,"poke");function _u(){for(var e,t=gn,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gn=n);Ft=e,Uo(r)}o(_u,"nap");function Uo(e){if(!ft){Vt&&(Vt=clearTimeout(Vt));var t=e-je;t>24?(e<1/0&&(Vt=setTimeout(Di,e-Wt.now()-yn)),Bt&&(Bt=clearInterval(Bt))):(Bt||(mn=Wt.now(),Bt=setInterval(Cu,Ti)),ft=1,Ri(Di))}}o(Uo,"sleep");function Zt(e,t,n){var r=new Yt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(Zt,"default");var Nu=Qe("start","end","cancel","interrupt"),Mu=[],Li=0,zi=1,bn=2,xn=3,$i=4,Sn=5,Ut=6;function Re(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Iu(e,n,{name:t,index:r,group:i,on:Nu,tween:Mu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Li})}o(Re,"default");function qt(e,t){var n=le(e,t);if(n.state>Li)throw new Error("too late; already scheduled");return n}o(qt,"init");function de(e,t){var n=le(e,t);if(n.state>xn)throw new Error("too late; already running");return n}o(de,"set");function le(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(le,"get");function Iu(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wn(s,0,n.time);function s(u){n.state=zi,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,h,f,p;if(n.state!==zi)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===xn)return Zt(a);p.state===$i?(p.state=Ut,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Ut,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(Zt(function(){n.state===xn&&(n.state=$i,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=bn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bn){for(n.state=xn,i=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}o(a,"start");function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Sn,1),h=-1,f=i.length;++h<f;)i[h].call(e,d);n.state===Sn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}o(c,"tick");function l(){n.state=Ut,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(l,"stop")}o(Iu,"create");function He(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>bn&&r.state<Sn,r.state=Ut,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(He,"default");function qo(e){return this.each(function(){He(this,e)})}o(qo,"default");function Pu(e,t){var n,r;return function(){var i=de(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(Pu,"tweenRemove");function ku(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=de(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=c;break}l===u&&i.push(c)}s.tween=i}}o(ku,"tweenFunction");function Go(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=le(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Pu:ku)(n,e,t))}o(Go,"default");function ht(e,t,n){var r=e._id;return e.each(function(){var i=de(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return le(i,r).value[t]}}o(ht,"tweenValue");function Gt(e,t){var n;return(typeof t=="number"?mi:t instanceof ro?io:(n=ro(t))?(t=n,io):yi)(e,t)}o(Gt,"default");function Au(e){return function(){this.removeAttribute(e)}}o(Au,"attrRemove");function Du(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Du,"attrRemoveNS");function Tu(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Tu,"attrConstant");function Ru(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ru,"attrConstantNS");function Ou(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(Ou,"attrFunction");function zu(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(zu,"attrFunctionNS");function Ko(e,t){var n=Ne(e),r=n==="transform"?xi:Gt;return this.attrTween(e,typeof t=="function"?(n.local?zu:Ou)(n,r,ht(this,"attr."+e,t)):t==null?(n.local?Du:Au)(n):(n.local?Ru:Tu)(n,r,t))}o(Ko,"default");function $u(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o($u,"attrInterpolate");function Lu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(Lu,"attrInterpolateNS");function Hu(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Lu(e,s)),n}return o(i,"tween"),i._value=t,i}o(Hu,"attrTweenNS");function Bu(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&$u(e,s)),n}return o(i,"tween"),i._value=t,i}o(Bu,"attrTween");function Qo(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ne(e);return this.tween(n,(r.local?Hu:Bu)(r,t))}o(Qo,"default");function Vu(e,t){return function(){qt(this,e).delay=+t.apply(this,arguments)}}o(Vu,"delayFunction");function Fu(e,t){return t=+t,function(){qt(this,e).delay=t}}o(Fu,"delayConstant");function Jo(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Vu:Fu)(t,e)):le(this.node(),t).delay}o(Jo,"default");function Wu(e,t){return function(){de(this,e).duration=+t.apply(this,arguments)}}o(Wu,"durationFunction");function Yu(e,t){return t=+t,function(){de(this,e).duration=t}}o(Yu,"durationConstant");function jo(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Wu:Yu)(t,e)):le(this.node(),t).duration}o(jo,"default");function Xu(e,t){if(typeof t!="function")throw new Error;return function(){de(this,e).ease=t}}o(Xu,"easeConstant");function er(e){var t=this._id;return arguments.length?this.each(Xu(t,e)):le(this.node(),t).ease}o(er,"default");function Zu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;de(this,e).ease=n}}o(Zu,"easeVarying");function tr(e){if(typeof e!="function")throw new Error;return this.each(Zu(this._id,e))}o(tr,"default");function nr(e){typeof e!="function"&&(e=ut(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new pe(r,this._parents,this._name,this._id)}o(nr,"default");function or(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=t[c],u=n[c],d=l.length,h=a[c]=new Array(d),f,p=0;p<d;++p)(f=l[p]||u[p])&&(h[p]=f);for(;c<r;++c)a[c]=t[c];return new pe(a,this._parents,this._name,this._id)}o(or,"default");function Uu(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(Uu,"start");function qu(e,t,n){var r,i,s=Uu(t)?qt:de;return function(){var a=s(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}o(qu,"onFunction");function rr(e,t){var n=this._id;return arguments.length<2?le(this.node(),n).on.on(e):this.each(qu(n,e,t))}o(rr,"default");function Gu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(Gu,"removeFunction");function ir(){return this.on("end.remove",Gu(this._id))}o(ir,"default");function sr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$e(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],l=c.length,u=s[a]=new Array(l),d,h,f=0;f<l;++f)(d=c[f])&&(h=e.call(d,d.__data__,f,c))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,Re(u[f],t,n,f,u,le(d,n)));return new pe(s,this._parents,t,n)}o(sr,"default");function ar(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lt(e));for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var l=r[c],u=l.length,d,h=0;h<u;++h)if(d=l[h]){for(var f=e.call(d,d.__data__,h,l),p,m=le(d,n),S=0,x=f.length;S<x;++S)(p=f[S])&&Re(p,t,n,S,f,m);s.push(f),a.push(d)}return new pe(s,a,t,n)}o(ar,"default");var Ku=De.prototype.constructor;function cr(){return new Ku(this._groups,this._parents)}o(cr,"default");function Qu(e,t){var n,r,i;return function(){var s=Le(this,e),a=(this.style.removeProperty(e),Le(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(Qu,"styleNull");function Hi(e){return function(){this.style.removeProperty(e)}}o(Hi,"styleRemove");function Ju(e,t,n){var r,i=n+"",s;return function(){var a=Le(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ju,"styleConstant");function ju(e,t,n){var r,i,s;return function(){var a=Le(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),Le(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c))}}o(ju,"styleFunction");function ed(e,t){var n,r,i,s="style."+t,a="end."+s,c;return function(){var l=de(this,e),u=l.on,d=l.value[s]==null?c||(c=Hi(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),l.on=r}}o(ed,"styleMaybeRemove");function lr(e,t,n){var r=(e+="")=="transform"?wi:Gt;return t==null?this.styleTween(e,Qu(e,r)).on("end.style."+e,Hi(e)):typeof t=="function"?this.styleTween(e,ju(e,r,ht(this,"style."+e,t))).each(ed(this._id,e)):this.styleTween(e,Ju(e,r,t),n).on("end.style."+e,null)}o(lr,"default");function td(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(td,"styleInterpolate");function nd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&td(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(nd,"styleTween");function ur(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,nd(e,t,n??""))}o(ur,"default");function od(e){return function(){this.textContent=e}}o(od,"textConstant");function rd(e){return function(){var t=e(this);this.textContent=t??""}}o(rd,"textFunction");function dr(e){return this.tween("text",typeof e=="function"?rd(ht(this,"text",e)):od(e==null?"":e+""))}o(dr,"default");function id(e){return function(t){this.textContent=e.call(this,t)}}o(id,"textInterpolate");function sd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&id(i)),t}return o(r,"tween"),r._value=e,r}o(sd,"textTween");function fr(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,sd(e))}o(fr,"default");function hr(){for(var e=this._name,t=this._id,n=En(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)if(l=a[u]){var d=le(l,t);Re(l,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new pe(r,this._parents,e,n)}o(hr,"default");function pr(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var c={value:a},l={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=de(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),i===0&&s()})}o(pr,"default");var ad=0;function pe(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(pe,"Transition");function Bi(e){return De().transition(e)}o(Bi,"transition");function En(){return++ad}o(En,"newId");var Oe=De.prototype;pe.prototype=Bi.prototype={constructor:pe,select:sr,selectAll:ar,selectChild:Oe.selectChild,selectChildren:Oe.selectChildren,filter:nr,merge:or,selection:cr,transition:hr,call:Oe.call,nodes:Oe.nodes,node:Oe.node,size:Oe.size,empty:Oe.empty,each:Oe.each,on:rr,attr:Ko,attrTween:Qo,style:lr,styleTween:ur,text:dr,textTween:fr,remove:ir,tween:Go,delay:Jo,duration:jo,ease:er,easeVarying:tr,end:pr,[Symbol.iterator]:Oe[Symbol.iterator]};function vn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(vn,"cubicInOut");var cd={time:null,delay:0,duration:250,ease:vn};function ld(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(ld,"inherit");function gr(e){var t,n;e instanceof pe?(t=e._id,e=e._name):(t=En(),(n=cd).time=Xt(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&Re(l,e,t,u,a,n||ld(l,t));return new pe(r,this._parents,e,t)}o(gr,"default");De.prototype.interrupt=qo;De.prototype.transition=gr;var Kt=o(e=>()=>e,"default");function mr(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}o(mr,"ZoomEvent");function Se(e,t,n){this.k=e,this.x=t,this.y=n}o(Se,"Transform");Se.prototype={constructor:Se,scale:o(function(e){return e===1?this:new Se(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Se(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var et=new Se(1,0,0);Qt.prototype=Se.prototype;function Qt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return et;return e.__zoom}o(Qt,"transform");function Cn(e){e.stopImmediatePropagation()}o(Cn,"nopropagation");function tt(e){e.preventDefault(),e.stopImmediatePropagation()}o(tt,"default");function ud(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(ud,"defaultFilter");function dd(){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]]}o(dd,"defaultExtent");function Vi(){return this.__zoom||et}o(Vi,"defaultTransform");function fd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(fd,"defaultWheelDelta");function hd(){return navigator.maxTouchPoints||"ontouchstart"in this}o(hd,"defaultTouchable");function pd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(pd,"defaultConstrain");function Jt(){var e=ud,t=dd,n=pd,r=fd,i=hd,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ct,u=Qe("start","zoom","end"),d,h,f,p=500,m=150,S=0,x=10;function w(y){y.property("__zoom",Vi).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(w,"zoom"),w.transform=function(y,v,_,I){var T=y.selection?y.selection():y;T.property("__zoom",Vi),y!==T?N(y,v,_,I):T.interrupt().each(function(){C(this,arguments).event(I).start().zoom(null,typeof v=="function"?v.apply(this,arguments):v).end()})},w.scaleBy=function(y,v,_,I){w.scaleTo(y,function(){var T=this.__zoom.k,R=typeof v=="function"?v.apply(this,arguments):v;return T*R},_,I)},w.scaleTo=function(y,v,_,I){w.transform(y,function(){var T=t.apply(this,arguments),R=this.__zoom,H=_==null?b(T):typeof _=="function"?_.apply(this,arguments):_,L=R.invert(H),F=typeof v=="function"?v.apply(this,arguments):v;return n(g(E(R,F),H,L),T,a)},_,I)},w.translateBy=function(y,v,_,I){w.transform(y,function(){return n(this.__zoom.translate(typeof v=="function"?v.apply(this,arguments):v,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),a)},null,I)},w.translateTo=function(y,v,_,I,T){w.transform(y,function(){var R=t.apply(this,arguments),H=this.__zoom,L=I==null?b(R):typeof I=="function"?I.apply(this,arguments):I;return n(et.translate(L[0],L[1]).scale(H.k).translate(typeof v=="function"?-v.apply(this,arguments):-v,typeof _=="function"?-_.apply(this,arguments):-_),R,a)},I,T)};function E(y,v){return v=Math.max(s[0],Math.min(s[1],v)),v===y.k?y:new Se(v,y.x,y.y)}o(E,"scale");function g(y,v,_){var I=v[0]-_[0]*y.k,T=v[1]-_[1]*y.k;return I===y.x&&T===y.y?y:new Se(y.k,I,T)}o(g,"translate");function b(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}o(b,"centroid");function N(y,v,_,I){y.on("start.zoom",function(){C(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(I).end()}).tween("zoom",function(){var T=this,R=arguments,H=C(T,R).event(I),L=t.apply(T,R),F=_==null?b(L):typeof _=="function"?_.apply(T,R):_,G=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Y=T.__zoom,K=typeof v=="function"?v.apply(T,R):v,j=l(Y.invert(F).concat(G/Y.k),K.invert(F).concat(G/K.k));return function(q){if(q===1)q=K;else{var O=j(q),W=G/O[2];q=new Se(W,F[0]-O[0]*W,F[1]-O[1]*W)}H.zoom(null,q)}})}o(N,"schedule");function C(y,v,_){return!_&&y.__zooming||new M(y,v)}o(C,"gesture");function M(y,v){this.that=y,this.args=v,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,v),this.taps=0}o(M,"Gesture"),M.prototype={event:o(function(y){return y&&(this.sourceEvent=y),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(y,v){return this.mouse&&y!=="mouse"&&(this.mouse[1]=v.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=v.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=v.invert(this.touch1[0])),this.that.__zoom=v,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(y){var v=ce(this.that).datum();u.call(y,this.that,new mr(y,{sourceEvent:this.sourceEvent,target:w,type:y,transform:this.that.__zoom,dispatch:u}),v)},"emit")};function D(y,...v){if(!e.apply(this,arguments))return;var _=C(this,v).event(y),I=this.__zoom,T=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),R=fe(y);if(_.wheel)(_.mouse[0][0]!==R[0]||_.mouse[0][1]!==R[1])&&(_.mouse[1]=I.invert(_.mouse[0]=R)),clearTimeout(_.wheel);else{if(I.k===T)return;_.mouse=[R,I.invert(R)],He(this),_.start()}tt(y),_.wheel=setTimeout(H,m),_.zoom("mouse",n(g(E(I,T),_.mouse[0],_.mouse[1]),_.extent,a));function H(){_.wheel=null,_.end()}o(H,"wheelidled")}o(D,"wheeled");function A(y,...v){if(f||!e.apply(this,arguments))return;var _=y.currentTarget,I=C(this,v,!0).event(y),T=ce(y.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),R=fe(y,_),H=y.clientX,L=y.clientY;dt(y.view),Cn(y),I.mouse=[R,this.__zoom.invert(R)],He(this),I.start();function F(Y){if(tt(Y),!I.moved){var K=Y.clientX-H,j=Y.clientY-L;I.moved=K*K+j*j>S}I.event(Y).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=fe(Y,_),I.mouse[1]),I.extent,a))}o(F,"mousemoved");function G(Y){T.on("mousemove.zoom mouseup.zoom",null),zt(Y.view,I.moved),tt(Y),I.event(Y).end()}o(G,"mouseupped")}o(A,"mousedowned");function B(y,...v){if(e.apply(this,arguments)){var _=this.__zoom,I=fe(y.changedTouches?y.changedTouches[0]:y,this),T=_.invert(I),R=_.k*(y.shiftKey?.5:2),H=n(g(E(_,R),I,T),t.apply(this,v),a);tt(y),c>0?ce(this).transition().duration(c).call(N,H,I,y):ce(this).call(w.transform,H,I,y)}}o(B,"dblclicked");function z(y,...v){if(e.apply(this,arguments)){var _=y.touches,I=_.length,T=C(this,v,y.changedTouches.length===I).event(y),R,H,L,F;for(Cn(y),H=0;H<I;++H)L=_[H],F=fe(L,this),F=[F,this.__zoom.invert(F),L.identifier],T.touch0?!T.touch1&&T.touch0[2]!==F[2]&&(T.touch1=F,T.taps=0):(T.touch0=F,R=!0,T.taps=1+!!d);d&&(d=clearTimeout(d)),R&&(T.taps<2&&(h=F[0],d=setTimeout(function(){d=null},p)),He(this),T.start())}}o(z,"touchstarted");function V(y,...v){if(this.__zooming){var _=C(this,v).event(y),I=y.changedTouches,T=I.length,R,H,L,F;for(tt(y),R=0;R<T;++R)H=I[R],L=fe(H,this),_.touch0&&_.touch0[2]===H.identifier?_.touch0[0]=L:_.touch1&&_.touch1[2]===H.identifier&&(_.touch1[0]=L);if(H=_.that.__zoom,_.touch1){var G=_.touch0[0],Y=_.touch0[1],K=_.touch1[0],j=_.touch1[1],q=(q=K[0]-G[0])*q+(q=K[1]-G[1])*q,O=(O=j[0]-Y[0])*O+(O=j[1]-Y[1])*O;H=E(H,Math.sqrt(q/O)),L=[(G[0]+K[0])/2,(G[1]+K[1])/2],F=[(Y[0]+j[0])/2,(Y[1]+j[1])/2]}else if(_.touch0)L=_.touch0[0],F=_.touch0[1];else return;_.zoom("touch",n(g(H,L,F),_.extent,a))}}o(V,"touchmoved");function $(y,...v){if(this.__zooming){var _=C(this,v).event(y),I=y.changedTouches,T=I.length,R,H;for(Cn(y),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),R=0;R<T;++R)H=I[R],_.touch0&&_.touch0[2]===H.identifier?delete _.touch0:_.touch1&&_.touch1[2]===H.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(H=fe(H,this),Math.hypot(h[0]-H[0],h[1]-H[1])<x)){var L=ce(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return o($,"touchended"),w.wheelDelta=function(y){return arguments.length?(r=typeof y=="function"?y:Kt(+y),w):r},w.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Kt(!!y),w):e},w.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:Kt(!!y),w):i},w.extent=function(y){return arguments.length?(t=typeof y=="function"?y:Kt([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),w):t},w.scaleExtent=function(y){return arguments.length?(s[0]=+y[0],s[1]=+y[1],w):[s[0],s[1]]},w.translateExtent=function(y){return arguments.length?(a[0][0]=+y[0][0],a[1][0]=+y[1][0],a[0][1]=+y[0][1],a[1][1]=+y[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(y){return arguments.length?(n=y,w):n},w.duration=function(y){return arguments.length?(c=+y,w):c},w.interpolate=function(y){return arguments.length?(l=y,w):l},w.on=function(){var y=u.on.apply(u,arguments);return y===u?w:y},w.clickDistance=function(y){return arguments.length?(S=(y=+y)*y,w):Math.sqrt(S)},w.tapDistance=function(y){return arguments.length?(x=+y,w):x},w}o(Jt,"default");var ge={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},yt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sr=["Enter"," ","Escape"],Er={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},We;(function(e){e.Strict="strict",e.Loose="loose"})(We||(We={}));var ze;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ze||(ze={}));var nt;(function(e){e.Partial="partial",e.Full="full"})(nt||(nt={}));var vr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Me;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Me||(Me={}));var gt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gt||(gt={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));var Fi={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},Cr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),ts=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),_r=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var en=o((e,t=[0,0])=>{let{width:n,height:r}=xe(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),tn=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((i,s)=>{let a=typeof s=="string",c=!t.nodeLookup&&!a?s:void 0;return t.nodeLookup&&(c=a?t.nodeLookup.get(s):_r(s)?s:t.nodeLookup.get(s.id)),c?(n=!0,kn(i,Mn(c,t.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?An(r):{x:0,y:0,width:0,height:0}},"getNodesBounds"),wt=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=kn(n,Mn(i)),r=!0)}),r?An(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),In=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let c=(t.x-n)/i,l=(t.y-r)/i,u=t.width/i,d=t.height/i,h=[];for(let f of e.values()){let{measured:p,selectable:m=!0,hidden:S=!1}=f;if(a&&!m||S)continue;let x=p.width??f.width??f.initialWidth??0,w=p.height??f.height??f.initialHeight??0,{x:E,y:g}=f.internals.positionAbsolute,b=ss(c,l,u,d,E,g,x,w),N=x*w,C=s&&b>0;(!f.internals.handleBounds||C||b>=N||f.dragging)&&h.push(f)}return h},"getNodesInside"),ns=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function gd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:c}=xe(i);s=a>0&&c>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(gd,"getFitViewNodes");async function os({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let c=gd(e,a),l=wt(c),u=st(l,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(os,"fitViewport");function Nr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,h=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)s?.("005",ge.error005());else{let{width:p,height:m}=xe(c);p&&m&&(h=[[l,u],[l+p,u+m]])}else c&&it(a.extent)&&(h=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);let f=it(h)?ot(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ge.error015()),{position:{x:f.x-l+(a.measured.width??0)*d[0],y:f.y-u+(a.measured.height??0)*d[1]},positionAbsolute:f}}o(Nr,"calculateNodePosition");async function rs({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(f=>f.id)),a=[];for(let f of n){if(f.deletable===!1)continue;let p=s.has(f.id),m=!p&&f.parentId&&a.find(S=>S.id===f.parentId);(p||m)&&a.push(f)}let c=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=ns(a,l);for(let f of l)c.has(f.id)&&!d.find(m=>m.id===f.id)&&d.push(f);if(!i)return{edges:d,nodes:a};let h=await i({nodes:a,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:a}:{edges:[],nodes:[]}:h}o(rs,"getElementsToRemove");var mt=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),ot=o((e={x:0,y:0},t,n)=>({x:mt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:mt(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function is(e,t,n){let{width:r,height:i}=xe(n),{x:s,y:a}=n.internals.positionAbsolute;return ot(e,[[s,a],[s+r,a+i]],t)}o(is,"clampPositionToParent");var Wi=o((e,t,n)=>e<t?mt(Math.abs(e-t),1,t)/t:e>n?-mt(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),Pn=o((e,t,n=15,r=40)=>{let i=Wi(e.x,r,t.width-r)*n,s=Wi(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),kn=o((e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),"getBoundsOfBoxes"),br=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),An=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),xt=o((e,t=[0,0])=>{let{x:n,y:r}=_r(e)?e.internals.positionAbsolute:en(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),Mn=o((e,t=[0,0])=>{let{x:n,y:r}=_r(e)?e.internals.positionAbsolute:en(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),Mr=o((e,t)=>An(kn(br(e),br(t))),"getBoundsOfRects"),ss=o((e,t,n,r,i,s,a,c)=>{let l=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+c)-Math.max(t,s));return Math.ceil(l*u)},"getRectsOverlappingArea"),nn=o((e,t)=>ss(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Ir=o(e=>ye(e.width)&&ye(e.height)&&ye(e.x)&&ye(e.y),"isRectObject"),ye=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),Pr=o((e,t)=>(n,r)=>{},"createDevWarn"),bt=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),St=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let c={x:(e-n)/i,y:(t-r)/i};return s?bt(c,a):c},"pointToRendererPoint"),rt=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function pt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(pt,"parsePadding");function md(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=pt(e,n),i=pt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=pt(e.top??e.y??0,n),i=pt(e.bottom??e.y??0,n),s=pt(e.left??e.x??0,t),a=pt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(md,"parsePaddings");function yd(e,t,n,r,i,s){let{x:a,y:c}=rt(e,[t,n,r]),{x:l,y:u}=rt({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,h=s-u;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(d),bottom:Math.floor(h)}}o(yd,"calculateAppliedPaddings");var st=o((e,t,n,r,i,s)=>{let a=md(s,t,n),c=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(c,l),d=mt(u,r,i),h=e.x+e.width/2,f=e.y+e.height/2,p=t/2-h*d,m=n/2-f*d,S=yd(e,p,m,d,t,n),x={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:p-x.left+x.right,y:m-x.top+x.bottom,zoom:d}},"getViewportForBounds"),Et=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function it(e){return e!=null&&e!=="parent"}o(it,"isCoordinateExtent");function xe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(xe,"getNodeDimensions");function Dn(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(Dn,"nodeHasDimensions");function kr(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let c=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}o(kr,"evaluateAbsolutePosition");function Ar(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o(Ar,"areSetsEqual");function as(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(as,"withResolvers");function cs(e){return{...Er,...e||{}}}o(cs,"mergeAriaLabelConfig");function Dr(e){return e===null?null:e?"valid":"invalid"}o(Dr,"getConnectionStatus");function jt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=we(e),c=St({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:u}=n?bt(c,t):c;return{xSnapped:l,ySnapped:u,...c}}o(jt,"getPointerPosition");var Tn=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Tr=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),wd=["INPUT","SELECT","TEXTAREA"];function Rr(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:wd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Rr,"isInputDOMNode");var Or=o(e=>"clientX"in e,"isMouseEvent"),we=o((e,t)=>{let n=Or(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),Yi=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Tn(a)}})},"getHandleBounds");function Rn({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:c}){let l=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+c*.375+r*.125,d=Math.abs(l-e),h=Math.abs(u-t);return[l,u,d,h]}o(Rn,"getBezierEdgeCenter");function _n(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(_n,"calculateControlOffset");function Xi({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Z.Left:return[t-_n(t-r,s),n];case Z.Right:return[t+_n(r-t,s),n];case Z.Top:return[t,n-_n(n-i,s)];case Z.Bottom:return[t,n+_n(i-n,s)]}}o(Xi,"getControlWithCurvature");function On({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:s=Z.Top,curvature:a=.25}){let[c,l]=Xi({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Xi({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[h,f,p,m]=Rn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${l} ${u},${d} ${r},${i}`,h,f,p,m]}o(On,"getBezierPath");function zr({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[s,c,i,a]}o(zr,"getEdgeCenter");function ls({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}o(ls,"getElevatedEdgeZIndex");function us({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=kn(Mn(e),Mn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return nn(a,An(s))>0}o(us,"isEdgeVisible");var xd=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),bd=o((e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),"connectionExists"),ds=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ge.error006()),t;let r=n.getEdgeId||xd,i;return Cr(e)?i={...e}:i={...e,id:r(e)},bd(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function zn({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,c]=zr({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,c]}o(zn,"getStraightPath");var Zi={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},Sd=o(({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.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},"getDirection"),Ui=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance"),Ed=o((e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0,"isBetween");function vd({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:s,stepPosition:a}){let c=Zi[t],l=Zi[r],u={x:e.x+c.x*s,y:e.y+c.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},h=Sd({source:u,sourcePosition:t,target:d}),f=h.x!==0?"x":"y",p=h[f],m=[],S,x,w={x:0,y:0},E={x:0,y:0},[,,g,b]=zr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[f]*l[f]===-1){f==="x"?(S=i.x??u.x+(d.x-u.x)*a,x=i.y??(u.y+d.y)/2):(S=i.x??(u.x+d.x)/2,x=i.y??u.y+(d.y-u.y)*a);let D=[{x:S,y:u.y},{x:S,y:d.y}],A=[{x:u.x,y:x},{x:d.x,y:x}];c[f]===p?m=f==="x"?D:A:m=f==="x"?A:D}else{let D=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(f==="x"?m=c.x===p?A:D:m=c.y===p?D:A,t===r){let y=Math.abs(e[f]-n[f]);if(y<=s){let v=Math.min(s-1,s-y);c[f]===p?w[f]=(u[f]>e[f]?-1:1)*v:E[f]=(d[f]>n[f]?-1:1)*v}}if(t!==r){let y=f==="x"?"y":"x",v=c[f]===l[y],_=u[y]>d[y],I=u[y]<d[y];(c[f]===1&&(!v&&_||v&&I)||c[f]!==1&&(!v&&I||v&&_))&&(m=f==="x"?D:A)}let B={x:u.x+w.x,y:u.y+w.y},z={x:d.x+E.x,y:d.y+E.y},V=Math.max(Math.abs(B.x-m[0].x),Math.abs(z.x-m[0].x)),$=Math.max(Math.abs(B.y-m[0].y),Math.abs(z.y-m[0].y));V>=$?(S=(B.x+z.x)/2,x=m[0].y):(S=m[0].x,x=(B.y+z.y)/2)}let N={x:u.x+w.x,y:u.y+w.y},C={x:d.x+E.x,y:d.y+E.y},M=[];for(let D of[e,N,...m,C,n]){let[A,B]=M.slice(-2);B&&Ed(A,B,D)&&M.pop(),M.push(D)}return[M,S,x,g,b]}o(vd,"getPoints");function Cd(e,t,n,r){let i=Math.min(Ui(e,t)/2,Ui(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${a+i*l}Q ${s},${a} ${s+i*c},${a}`}o(Cd,"getBend");function on({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:s=Z.Top,borderRadius:a=5,centerX:c,centerY:l,offset:u=20,stepPosition:d=.5}){let[h,f,p,m,S]=vd({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:c,y:l},offset:u,stepPosition:d}),x=`M${h[0].x} ${h[0].y}`;for(let w=1;w<h.length-1;w++)x+=Cd(h[w-1],h[w],h[w+1],a);return x+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[x,f,p,m,S]}o(on,"getSmoothStepPath");function qi(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(qi,"isNodeInitialized");function fs(e){let{sourceNode:t,targetNode:n}=e;if(!qi(t)||!qi(n))return null;let r=t.internals.handleBounds||Gi(t.handles),i=n.internals.handleBounds||Gi(n.handles),s=Ki(r?.source??[],e.sourceHandle),a=Ki(e.connectionMode===We.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ge.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let c=s?.position||Z.Bottom,l=a?.position||Z.Top,u=Ye(t,s,c),d=Ye(n,a,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:l}}o(fs,"getEdgePosition");function Gi(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(Gi,"toHandleBounds");function Ye(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??xe(e);if(r)return{x:i+a/2,y:s+c/2};switch(t?.position??n){case Z.Top:return{x:i+a/2,y:s};case Z.Right:return{x:i+a,y:s+c/2};case Z.Bottom:return{x:i+a/2,y:s+c};case Z.Left:return{x:i,y:s+c/2}}}o(Ye,"getHandlePosition");function Ki(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(Ki,"getHandle$1");function $n(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o($n,"getMarkerId");function hs(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){let u=$n(l,t);s.has(u)||(a.push({id:u,color:l.color||n,...l}),s.add(u))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}o(hs,"createMarkerIds");var ps=1e3,_d=10,$r={nodeOrigin:[0,0],nodeExtent:yt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Nd={...$r,checkEquality:!0};function Lr(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Lr,"mergeObjects");function gs(e,t,n){let r=Lr($r,n);for(let i of e.values())if(i.parentId)Br(i,e,t,r);else{let s=en(i,r.nodeOrigin),a=it(i.extent)?i.extent:r.nodeExtent,c=ot(s,a,xe(i));i.internals.positionAbsolute=c}}o(gs,"updateAbsolutePositions");function Md(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(Md,"parseHandles");function Hr(e){return e==="manual"}o(Hr,"isManualZIndexMode");function Ln(e,t,n,r={}){let i=Lr(Nd,r),s={i:0},a=new Map(t),c=i?.elevateNodesOnSelect&&!Hr(i.zIndexMode)?ps:0,l=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let h=a.get(d.id);if(i.checkEquality&&d===h?.internals.userNode)t.set(d.id,h);else{let f=en(d,i.nodeOrigin),p=it(d.extent)?d.extent:i.nodeExtent,m=ot(f,p,xe(d));h={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:m,handleBounds:Md(d,h),z:ms(d,c,i.zIndexMode),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),d.parentId&&Br(h,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:l,hasSelectedNodes:u}}o(Ln,"adoptUserNodes");function Id(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(Id,"updateParentLookup");function Br(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:l}=Lr($r,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Id(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*_d),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let h=s&&!Hr(l)?ps:0,{x:f,y:p,z:m}=Pd(e,d,a,c,h,l),{positionAbsolute:S}=e.internals,x=f!==S.x||p!==S.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:p}:S,z:m}})}o(Br,"updateChildNode");function ms(e,t,n){let r=ye(e.zIndex)?e.zIndex:0;return Hr(n)?r:r+(e.selected?t:0)}o(ms,"calculateZ");function Pd(e,t,n,r,i,s){let{x:a,y:c}=t.internals.positionAbsolute,l=xe(e),u=en(e,n),d=it(e.extent)?ot(u,e.extent,l):u,h=ot({x:a+d.x,y:c+d.y},r,l);e.extent==="parent"&&(h=is(h,l,t));let f=ms(e,i,s),p=t.internals.z??0;return{x:h.x,y:h.y,z:p>=f?p+1:f}}o(Pd,"calculateChildXYZ");function Hn(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let c=t.get(a.parentId);if(!c)continue;let l=s.get(a.parentId)?.expandedRect??xt(c),u=Mr(l,a.rect);s.set(a.parentId,{expandedRect:u,parent:c})}return s.size>0&&s.forEach(({expandedRect:a,parent:c},l)=>{let u=c.internals.positionAbsolute,d=xe(c),h=c.origin??r,f=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),x=(m-d.width)*h[0],w=(S-d.height)*h[1];(f>0||p>0||x||w)&&(i.push({id:l,type:"position",position:{x:c.position.x-f+x,y:c.position.y-p+w}}),n.get(l)?.forEach(E=>{e.some(g=>g.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+f,y:E.position.y+p}})})),(d.width<a.width||d.height<a.height||f||p)&&i.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:m+(f?h[0]*f-x:0),height:S+(p?h[1]*p-w:0)}})}),i}o(Hn,"handleExpandParent");function ys(e,t,n,r,i,s,a){let c=r?.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};let u=[],d=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=[];for(let p of e.values()){let m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}let S=Tn(p.nodeElement),x=m.measured.width!==S.width||m.measured.height!==S.height;if(!!(S.width&&S.height&&(x||!m.internals.handleBounds||p.force))){let E=p.nodeElement.getBoundingClientRect(),g=it(m.extent)?m.extent:s,{positionAbsolute:b}=m.internals;if(m.parentId&&m.extent==="parent"){let C=t.get(m.parentId);C&&(b=is(b,S,C))}else g&&(b=ot(b,g,S));let N={...m,measured:S,internals:{...m.internals,positionAbsolute:b,handleBounds:{source:Yi("source",p.nodeElement,E,h,m.id),target:Yi("target",p.nodeElement,E,h,m.id)}}};t.set(m.id,N),m.parentId&&Br(N,t,n,{nodeOrigin:i,zIndexMode:a}),l=!0,x&&(u.push({id:m.id,type:"dimensions",dimensions:S}),m.expandParent&&m.parentId&&f.push({id:m.id,parentId:m.parentId,rect:xt(N,i)}))}}if(f.length>0){let p=Hn(f,t,n,i);u.push(...p)}return{changes:u,updatedInternals:l}}o(ys,"updateNodeInternals");async function ws({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(ws,"panBy");function Qi(e,t,n,r,i,s){let a=i,c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(Qi,"addConnectionToLookup");function Vr(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:c=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:c},u=`${i}-${a}--${s}-${c}`,d=`${s}-${c}--${i}-${a}`;Qi("source",l,d,e,i,a),Qi("target",l,u,e,s,c),t.set(r.id,r)}}o(Vr,"updateConnectionLookup");function xs(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:xs(n,t):!1}o(xs,"isParentSelected");function Ji(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(Ji,"hasSelector");function kd(e,t,n,r,i){let s=new Map;for(let[a,c]of e)if((i?c.id===r:c.selected||c.id===r)&&(i||!c.parentId||!xs(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){let u=e.get(a);u&&s.set(a,{id:a,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return s}o(kd,"getDragItems");function yr({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,c]of t){let l=n.get(a)?.internals.userNode;l&&i.push({...l,position:c.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(yr,"getEventHandlerParams");function Ad({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=bt(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(Ad,"calculateSnapOffset");function bs({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,c=new Map,l=!1,u={x:0,y:0},d=null,h=!1,f=null,p=!1,m=!1,S=null;function x({noDragClassName:E,handleSelector:g,domNode:b,isSelectable:N,nodeId:C,nodeClickDistance:M=0}){f=ce(b);function D({x:V,y:$}){let{nodeLookup:y,nodeExtent:v,snapGrid:_,snapToGrid:I,nodeOrigin:T,onNodeDrag:R,onSelectionDrag:H,onError:L,updateNodePositions:F}=t();s={x:V,y:$};let G=!1,Y=c.size>1,K=Y&&v?br(wt(c)):null,j=Y&&I?Ad({dragItems:c,snapGrid:_,x:V,y:$}):null;for(let[q,O]of c){if(!y.has(q))continue;let W={x:V-O.distance.x,y:$-O.distance.y};I&&(W=j?{x:Math.round(W.x+j.x),y:Math.round(W.y+j.y)}:bt(W,_));let J=null;if(Y&&v&&!O.extent&&K){let{positionAbsolute:U}=O.internals,ee=U.x-K.x+v[0][0],te=U.x+O.measured.width-K.x2+v[1][0],oe=U.y-K.y+v[0][1],ue=U.y+O.measured.height-K.y2+v[1][1];J=[[ee,oe],[te,ue]]}let{position:Q,positionAbsolute:X}=Nr({nodeId:q,nextPosition:W,nodeLookup:y,nodeExtent:J||v,nodeOrigin:T,onError:L});G=G||O.position.x!==Q.x||O.position.y!==Q.y,O.position=Q,O.internals.positionAbsolute=X}if(m=m||G,!!G&&(F(c,!0),S&&(r||R||!C&&H))){let[q,O]=yr({nodeId:C,dragItems:c,nodeLookup:y});r?.(S,c,q,O),R?.(S,q,O),C||H?.(S,O)}}o(D,"updateNodes");async function A(){if(!d)return;let{transform:V,panBy:$,autoPanSpeed:y,autoPanOnNodeDrag:v}=t();if(!v){l=!1,cancelAnimationFrame(a);return}let[_,I]=Pn(u,d,y);(_!==0||I!==0)&&(s.x=(s.x??0)-_/V[2],s.y=(s.y??0)-I/V[2],await $({x:_,y:I})&&D(s)),a=requestAnimationFrame(A)}o(A,"autoPan");function B(V){let{nodeLookup:$,multiSelectionActive:y,nodesDraggable:v,transform:_,snapGrid:I,snapToGrid:T,selectNodesOnDrag:R,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:F}=t();h=!0;let G=!!C&&!y&&!$.get(C)?.selected;(!R||!N)&&!y&&C&&($.get(C)?.selected||F()),N&&R&&C&&e?.(C);let Y=jt(V.sourceEvent,{transform:_,snapGrid:I,snapToGrid:T,containerBounds:d});if(s=Y,c=kd($,v,Y,C,G),c.size>0&&(n||H||!C&&L)){let[K,j]=yr({nodeId:C,dragItems:c,nodeLookup:$});n?.(V.sourceEvent,c,K,j),H?.(V.sourceEvent,K,j),C||L?.(V.sourceEvent,j)}}o(B,"startDrag");let z=Ht().clickDistance(M).on("start",V=>{let{domNode:$,nodeDragThreshold:y,transform:v,snapGrid:_,snapToGrid:I}=t();d=$?.getBoundingClientRect()||null,p=!1,m=!1,S=V.sourceEvent,y===0&&B(V),s=jt(V.sourceEvent,{transform:v,snapGrid:_,snapToGrid:I,containerBounds:d}),u=we(V.sourceEvent,d)}).on("drag",V=>{let{autoPanOnNodeDrag:$,transform:y,snapGrid:v,snapToGrid:_,nodeDragThreshold:I,nodeLookup:T}=t(),R=jt(V.sourceEvent,{transform:y,snapGrid:v,snapToGrid:_,containerBounds:d});if(S=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||C&&!T.has(C))&&(p=!0),!p){if(!l&&$&&h&&(l=!0,A()),!h){let H=we(V.sourceEvent,d),L=H.x-u.x,F=H.y-u.y;Math.sqrt(L*L+F*F)>I&&B(V)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&c&&h&&(u=we(V.sourceEvent,d),D(R))}}).on("end",V=>{if(!h||p){p&&c.size>0&&t().updateNodePositions(c,!1);return}if(l=!1,h=!1,cancelAnimationFrame(a),c.size>0){let{nodeLookup:$,updateNodePositions:y,onNodeDragStop:v,onSelectionDragStop:_}=t();if(m&&(y(c,!1),m=!1),i||v||!C&&_){let[I,T]=yr({nodeId:C,dragItems:c,nodeLookup:$,dragging:!1});i?.(V.sourceEvent,c,I,T),v?.(V.sourceEvent,I,T),C||_?.(V.sourceEvent,T)}}}).filter(V=>{let $=V.target;return!V.button&&(!E||!Ji($,`.${E}`,b))&&(!g||Ji($,g,b))});f.call(z)}o(x,"update");function w(){f?.on(".drag",null)}return o(w,"destroy"),{update:x,destroy:w}}o(bs,"XYDrag");function Dd(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())nn(i,xt(s))>0&&r.push(s);return r}o(Dd,"getNodesWithinDistance");var Td=250;function Rd(e,t,n,r){let i=[],s=1/0,a=Dd(e,n,t+Td);for(let c of a){let l=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(let u of l){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:h}=Ye(c,u,u.position,!0),f=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));f>t||(f<s?(i=[{...u,x:d,y:h}],s=f):f===s&&i.push({...u,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){let c=r.type==="source"?"target":"source";return i.find(l=>l.type===c)??i[0]}return i[0]}o(Rd,"getClosestHandle");function Ss(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let c=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?c?.find(u=>u.id===n):c?.[0])??null;return l&&s?{...l,...Ye(a,l,l.position,!0)}:l}o(Ss,"getHandle");function Es(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Es,"getHandleType");function Od(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(Od,"isConnectionValid");var vs=o(()=>!0,"alwaysValid");function zd(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:S,onConnectEnd:x,isValidConnection:w=vs,onReconnectEnd:E,updateConnection:g,getTransform:b,getFromHandle:N,autoPanSpeed:C,dragThreshold:M=1,handleDomNode:D}){let A=Tr(e.target),B=0,z,{x:V,y:$}=we(e),y=Es(s,D),v=c?.getBoundingClientRect(),_=!1;if(!v||!y)return;let I=Ss(i,y,r,l,t);if(!I)return;let T=we(e,v),R=!1,H=null,L=!1,F=null;function G(){if(!d||!v)return;let[Q,X]=Pn(T,v,C);f({x:Q,y:X}),B=requestAnimationFrame(G)}o(G,"autoPan");let Y={...I,nodeId:i,type:y,position:I.position},K=l.get(i),q={inProgress:!0,isValid:null,from:Ye(K,Y,Z.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:K,to:T,toHandle:null,toPosition:Fi[Y.position],toNode:null,pointer:T};function O(){_=!0,g(q),m?.(e,{nodeId:i,handleId:r,handleType:y})}o(O,"startConnection"),M===0&&O();function W(Q){if(!_){let{x:ue,y:Ie}=we(Q),Ce=ue-V,_e=Ie-$;if(!(Ce*Ce+_e*_e>M*M))return;O()}if(!N()||!Y){J(Q);return}let X=b();T=we(Q,v),z=Rd(St(T,X,!1,[1,1]),n,l,Y),R||(G(),R=!0);let U=Cs(Q,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:w,doc:A,lib:u,flowId:h,nodeLookup:l});F=U.handleDomNode,H=U.connection,L=Od(!!z,U.isValid);let ee=l.get(i),te=ee?Ye(ee,Y,Z.Left,!0):q.from,oe={...q,from:te,isValid:L,to:U.toHandle&&L?rt({x:U.toHandle.x,y:U.toHandle.y},X):T,toHandle:U.toHandle,toPosition:L&&U.toHandle?U.toHandle.position:Fi[Y.position],toNode:U.toHandle?l.get(U.toHandle.nodeId):null,pointer:T};g(oe),q=oe}o(W,"onPointerMove");function J(Q){if(!("touches"in Q&&Q.touches.length>0)){if(_){(z||F)&&H&&L&&S?.(H);let{inProgress:X,...U}=q,ee={...U,toPosition:q.toHandle?q.toPosition:null};x?.(Q,ee),s&&E?.(Q,ee)}p(),cancelAnimationFrame(B),R=!1,L=!1,H=null,F=null,A.removeEventListener("mousemove",W),A.removeEventListener("mouseup",J),A.removeEventListener("touchmove",W),A.removeEventListener("touchend",J)}}o(J,"onPointerUp"),A.addEventListener("mousemove",W),A.addEventListener("mouseup",J),A.addEventListener("touchmove",W),A.addEventListener("touchend",J)}o(zd,"onPointerDown");function Cs(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:c,flowId:l,isValidConnection:u=vs,nodeLookup:d}){let h=s==="target",f=t?a.querySelector(`.${c}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=we(e),S=a.elementFromPoint(p,m),x=S?.classList.contains(`${c}-flow__handle`)?S:f,w={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){let E=Es(void 0,x),g=x.getAttribute("data-nodeid"),b=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),C=x.classList.contains("connectableend");if(!g||!E)return w;let M={source:h?g:r,sourceHandle:h?b:i,target:h?r:g,targetHandle:h?i:b};w.connection=M;let A=N&&C&&(n===We.Strict?h&&E==="source"||!h&&E==="target":g!==r||b!==i);w.isValid=A&&u(M),w.toHandle=Ss(g,E,b,d,n,!0)}return w}o(Cs,"isValidHandle");var Bn={onPointerDown:zd,isValid:Cs};function _s({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=ce(e);function s({translateExtent:c,width:l,height:u,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:p=!1}){let m=o(g=>{if(g.sourceEvent.type!=="wheel"||!t)return;let b=n(),N=g.sourceEvent.ctrlKey&&Et()?10:1,C=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,M=b[2]*Math.pow(2,C*N);t.scaleTo(M)},"zoomHandler"),S=[0,0],x=o(g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(S=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},"panStartHandler"),w=o(g=>{let b=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;let N=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],C=[N[0]-S[0],N[1]-S[1]];S=N;let M=r()*Math.max(b[2],Math.log(b[2]))*(p?-1:1),D={x:b[0]-C[0]*M,y:b[1]-C[1]*M},A=[[0,0],[l,u]];t.setViewportConstrained({x:D.x,y:D.y,zoom:b[2]},A,c)},"panHandler"),E=Jt().on("start",x).on("zoom",h?w:null).on("zoom.wheel",f?m:null);i.call(E,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:fe}}o(_s,"XYMinimap");var Vn=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),wr=o(({x:e,y:t,zoom:n})=>et.translate(e,t).scale(n),"viewportToTransform"),Fe=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Ns=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),$d=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),xr=o((e,t=0,n=$d,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ms=o(e=>{let t=e.ctrlKey&&Et()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function Ld({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Fe(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&a){let x=fe(d),w=Ms(d),E=h*Math.pow(2,w);r.scaleTo(n,E,x,d);return}let f=d.deltaMode===1?20:1,p=i===ze.Vertical?0:d.deltaX*f,m=i===ze.Horizontal?0:d.deltaY*f;!Et()&&d.shiftKey&&i!==ze.Vertical&&(p=d.deltaY*f,m=0),r.translateBy(n,-(p/h)*s,-(m/h)*s,{internal:!0});let S=Vn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(d,S):(e.isPanScrolling=!0,c?.(d,S)),e.panScrollTimeout=setTimeout(()=>{u?.(d,S),e.isPanScrolling=!1},150)}}o(Ld,"createPanOnScrollHandler");function Hd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,c=Fe(r,e);if(r.ctrlKey&&s&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}o(Hd,"createZoomOnScrollHandler");function Bd({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Vn(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(Bd,"createPanZoomStartHandler");function Vd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Ns(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Vn(s.transform))}}o(Vd,"createPanZoomHandler");function Fd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Ns(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let c=Vn(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}o(Fd,"createPanZoomEndHandler");function Wd({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:h}){return f=>{let p=t||n,m=r&&f.ctrlKey,S=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Fe(f,`${d}-flow__node`)||Fe(f,`${d}-flow__edge`)||Fe(f,`${d}-flow__selection`)||Fe(f,`${d}-flow__nodesselection`)))return!0;if(!i&&!p&&!s&&!a&&!r||c||h&&!S||Fe(f,l)&&S||Fe(f,u)&&(!S||s&&S&&!t)||!r&&f.ctrlKey&&S)return!1;if(!r&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!s&&!m&&S||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;let x=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||S||e)&&x}}o(Wd,"createFilter");function Is({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=[[0,0],[d.width,d.height]],f=typeof ResizeObserver<"u"?new ResizeObserver($=>{let y=$[0];y?.contentRect&&(h=[[0,0],[y.contentRect.width,y.contentRect.height]])}):null;f?.observe(e);let p=Jt().extent(()=>h).scaleExtent([t,n]).translateExtent(r),m=ce(e).call(p);b({x:i.x,y:i.y,zoom:mt(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let S=m.on("wheel.zoom"),x=m.on("dblclick.zoom");p.wheelDelta(Ms);async function w($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).transform(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(w,"setTransform");function E({noWheelClassName:$,noPanClassName:y,onPaneContextMenu:v,userSelectionActive:_,panOnScroll:I,panOnDrag:T,panOnScrollMode:R,panOnScrollSpeed:H,preventScrolling:L,zoomOnPinch:F,zoomOnScroll:G,zoomOnDoubleClick:Y,panActivationKeyPressed:K=!1,zoomActivationKeyPressed:j,lib:q,onTransformChange:O,connectionInProgress:W,paneClickDistance:J,selectionOnDrag:Q}){_&&!u.isZoomingOrPanning&&p.on("zoom",null);let X=I&&!j&&!_;p.clickDistance(Q?1/0:!ye(J)||J<0?0:J);let U=X?Ld({zoomPanValues:u,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:R,panOnScrollSpeed:H,zoomOnPinch:F,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):Hd({noWheelClassName:$,preventScrolling:L,d3ZoomHandler:S});m.on("wheel.zoom",U,{passive:!1});let ee=Bd({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});p.on("start",ee);let te=Vd({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!v,onPanZoom:s,onTransformChange:O});p.on("zoom",te);let oe=Fd({zoomPanValues:u,panOnDrag:T,panOnScroll:I,onPaneContextMenu:v,onPanZoomEnd:c,onDraggingChange:l});p.on("end",oe);let ue=Wd({panActivationKeyPressed:K,zoomActivationKeyPressed:j,panOnDrag:T,zoomOnScroll:G,panOnScroll:I,zoomOnDoubleClick:Y,zoomOnPinch:F,userSelectionActive:_,noPanClassName:y,noWheelClassName:$,lib:q,connectionInProgress:W});p.filter(ue),Y?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}o(E,"update");function g(){p.on("zoom",null),f?.disconnect()}o(g,"destroy");async function b($,y,v){let _=wr($),I=p?.constrain()(_,y,v);return I&&await w(I),I}o(b,"setViewportConstrained");async function N($,y){let v=wr($);return await w(v,y),v}o(N,"setViewport");function C($){if(m){let y=wr($),v=m.property("__zoom");(v.k!==$.zoom||v.x!==$.x||v.y!==$.y)&&p?.transform(m,y,null,{sync:!0})}}o(C,"syncViewport");function M(){let $=m?Qt(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}o(M,"getViewport");async function D($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).scaleTo(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(D,"scaleTo");async function A($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).scaleBy(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(A,"scaleBy");function B($){p?.scaleExtent($)}o(B,"setScaleExtent");function z($){p?.translateExtent($)}o(z,"setTranslateExtent");function V($){let y=!ye($)||$<0?0:$;p?.clickDistance(y)}return o(V,"setClickDistance"),{update:E,destroy:g,setViewport:N,setViewportConstrained:b,getViewport:M,scaleTo:D,scaleBy:A,setScaleExtent:B,setTranslateExtent:z,syncViewport:C,setClickDistance:V}}o(Is,"XYPanZoom");var Xe;(function(e){e.Line="line",e.Handle="handle"})(Xe||(Xe={}));function Yd({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,c=n-r,l=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(l[0]=l[0]*-1),c&&s&&(l[1]=l[1]*-1),l}o(Yd,"getResizeDirection");function ji(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(ji,"getControlDirection");function Be(e,t){return Math.max(0,t-e)}o(Be,"getLowerExtentClamp");function Ve(e,t){return Math.max(0,e-t)}o(Ve,"getUpperExtentClamp");function Nn(e,t,n){return Math.max(0,t-e,e-n)}o(Nn,"getSizeClamp");function es(e,t){return e?!t:t}o(es,"xor");function Xd(e,t,n,r,i,s,a,c){let{affectsX:l,affectsY:u}=t,{isHorizontal:d,isVertical:h}=t,f=d&&h,{xSnapped:p,ySnapped:m}=n,{minWidth:S,maxWidth:x,minHeight:w,maxHeight:E}=r,{x:g,y:b,width:N,height:C,aspectRatio:M}=e,D=Math.floor(d?p-e.pointerX:0),A=Math.floor(h?m-e.pointerY:0),B=N+(l?-D:D),z=C+(u?-A:A),V=-s[0]*N,$=-s[1]*C,y=Nn(B,S,x),v=Nn(z,w,E);if(a){let T=0,R=0;l&&D<0?T=Be(g+D+V,a[0][0]):!l&&D>0&&(T=Ve(g+B+V,a[1][0])),u&&A<0?R=Be(b+A+$,a[0][1]):!u&&A>0&&(R=Ve(b+z+$,a[1][1])),y=Math.max(y,T),v=Math.max(v,R)}if(c){let T=0,R=0;l&&D>0?T=Ve(g+D,c[0][0]):!l&&D<0&&(T=Be(g+B,c[1][0])),u&&A>0?R=Ve(b+A,c[0][1]):!u&&A<0&&(R=Be(b+z,c[1][1])),y=Math.max(y,T),v=Math.max(v,R)}if(i){if(d){let T=Nn(B/M,w,E)*M;if(y=Math.max(y,T),a){let R=0;!l&&!u||l&&!u&&f?R=Ve(b+$+B/M,a[1][1])*M:R=Be(b+$+(l?D:-D)/M,a[0][1])*M,y=Math.max(y,R)}if(c){let R=0;!l&&!u||l&&!u&&f?R=Be(b+B/M,c[1][1])*M:R=Ve(b+(l?D:-D)/M,c[0][1])*M,y=Math.max(y,R)}}if(h){let T=Nn(z*M,S,x)/M;if(v=Math.max(v,T),a){let R=0;!l&&!u||u&&!l&&f?R=Ve(g+z*M+V,a[1][0])/M:R=Be(g+(u?A:-A)*M+V,a[0][0])/M,v=Math.max(v,R)}if(c){let R=0;!l&&!u||u&&!l&&f?R=Be(g+z*M,c[1][0])/M:R=Ve(g+(u?A:-A)*M,c[0][0])/M,v=Math.max(v,R)}}}A=A+(A<0?v:-v),D=D+(D<0?y:-y),i&&(f?B>z*M?A=(es(l,u)?-D:D)/M:D=(es(l,u)?-A:A)*M:d?(A=D/M,u=l):(D=A*M,l=u));let _=l?g+D:g,I=u?b+A:b;return{width:N+(l?-D:D),height:C+(u?-A:A),x:s[0]*D*(l?-1:1)+_,y:s[1]*A*(u?-1:1)+I}}o(Xd,"getDimensionsAfterResize");var Ps={width:0,height:0,x:0,y:0},Zd={...Ps,pointerX:0,pointerY:0,aspectRatio:1};function Ud(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,c=n[0]*s,l=n[1]*a;return[[r-c,i-l],[r+s-c,i+a-l]]}o(Ud,"nodeToChildExtent");function ks({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=ce(e),a={controlDirection:ji("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:d,keepAspectRatio:h,resizeDirection:f,onResizeStart:p,onResize:m,onResizeEnd:S,shouldResize:x}){let w={...Ps},E={...Zd};a={boundaries:d,resizeDirection:f,keepAspectRatio:h,controlDirection:ji(u)};let g,b=null,N=[],C,M,D,A=Ht().on("start",B=>{let{nodeLookup:z,transform:V,snapGrid:$,snapToGrid:y,nodeOrigin:v,paneDomNode:_}=n();if(g=z.get(t),!g)return;b=_?.getBoundingClientRect()??null;let{xSnapped:I,ySnapped:T}=jt(B.sourceEvent,{transform:V,snapGrid:$,snapToGrid:y,containerBounds:b});w={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},E={...w,pointerX:I,pointerY:T,aspectRatio:w.width/w.height},C=void 0,M=it(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(C=z.get(g.parentId)),C&&g.extent==="parent"&&(M=[[0,0],[C.measured.width,C.measured.height]]),N=[],D=void 0;for(let[R,H]of z)if(H.parentId===t&&(N.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){let L=Ud(H,g,H.origin??v);D?D=[[Math.min(L[0][0],D[0][0]),Math.min(L[0][1],D[0][1])],[Math.max(L[1][0],D[1][0]),Math.max(L[1][1],D[1][1])]]:D=L}p?.(B,{...w})}).on("drag",B=>{let{transform:z,snapGrid:V,snapToGrid:$,nodeOrigin:y}=n(),v=jt(B.sourceEvent,{transform:z,snapGrid:V,snapToGrid:$,containerBounds:b}),_=[];if(!g)return;let{x:I,y:T,width:R,height:H}=w,L={},F=g.origin??y,{width:G,height:Y,x:K,y:j}=Xd(E,a.controlDirection,v,a.boundaries,a.keepAspectRatio,F,M,D),q=G!==R,O=Y!==H,W=K!==I&&q,J=j!==T&&O;if(!W&&!J&&!q&&!O)return;let Q={prevValues:{...w},startX:E.x,startY:E.y,childNodes:N.map(te=>({...te,position:{...te.position}}))};if((W||J||F[0]===1||F[1]===1)&&(L.x=W?K:w.x,L.y=J?j:w.y,w.x=L.x,w.y=L.y,N.length>0)){let te=K-I,oe=j-T;for(let ue of N)ue.position={x:ue.position.x-te+F[0]*(G-R),y:ue.position.y-oe+F[1]*(Y-H)},_.push(ue)}if((q||O)&&(L.width=q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?G:w.width,L.height=O&&(!a.resizeDirection||a.resizeDirection==="vertical")?Y:w.height,w.width=L.width,w.height=L.height),C&&g.expandParent){let te=F[0]*(L.width??0);L.x&&L.x<te&&(w.x=te,E.x=E.x-(L.x-te));let oe=F[1]*(L.height??0);L.y&&L.y<oe&&(w.y=oe,E.y=E.y-(L.y-oe))}let X=Yd({width:w.width,prevWidth:R,height:w.height,prevHeight:H,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),U={...w,direction:X};if(x?.(B,U)===!1){w=Q.prevValues,E.x=Q.startX,E.y=Q.startY,N.forEach((te,oe)=>{te.position=Q.childNodes[oe].position});return}m?.(B,U),r(L,_)}).on("end",B=>{S?.(B,{...w}),i?.({...w})});s.call(A)}o(c,"update");function l(){s.on(".drag",null)}return o(l,"destroy"),{update:c,destroy:l}}o(ks,"XYResizer");var k=Ke(di()),P=Ke(no());function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ae,"cc");var Rs=Ke(no(),1),Os=Ke(xl(),1);var As=o(e=>{let t,n=new Set,r=o((d,h)=>{let f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){let p=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,p))}},"setState"),i=o(()=>t,"getState"),l={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,l);return l},"createStoreImpl"),Ds=o(e=>e?As(e):As,"createStore");var{useDebugValue:qd}=Rs.default,{useSyncExternalStoreWithSelector:Gd}=Os.default,Kd=o(e=>e,"identity");function Fr(e,t=Kd,n){let r=Gd(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qd(r),r}o(Fr,"useStoreWithEqualityFn");var Ts=o((e,t)=>{let n=Ds(e),r=o((i,s=t)=>Fr(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),zs=o((e,t)=>e?Ts(e,t):Ts,"createWithEqualityFn");function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(re,"shallow$1");var Qd=Ke(wl());var Zn=(0,P.createContext)(null),Jd=Zn.Provider,la=ge.error001("react");function ne(e,t){let n=(0,P.useContext)(Zn);if(n===null)throw new Error(la);return Fr(n,e,t)}o(ne,"useStore");function ie(){let e=(0,P.useContext)(Zn);if(e===null)throw new Error(la);return(0,P.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(ie,"useStoreApi");var $s={display:"none"},jd={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ua="react-flow__node-desc",da="react-flow__edge-desc",ef="react-flow__aria-live",tf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),nf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function of({rfId:e}){let t=ne(tf);return(0,k.jsx)("div",{id:`${ef}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jd,children:t})}o(of,"AriaLiveMessage");function rf({rfId:e,disableKeyboardA11y:t}){let n=ne(nf);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{id:`${ua}-${e}`,style:$s,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,k.jsx)("div",{id:`${da}-${e}`,style:$s,children:n["edge.a11yDescription.default"]}),!t&&(0,k.jsx)(of,{rfId:e})]})}o(rf,"A11yDescriptions");var Ct=(0,P.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,k.jsx)("div",{className:ae(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});Ct.displayName="Panel";var Ls="https://reactflow.dev?utm_source=attribution";function sf({proOptions:e,position:t="bottom-right"}){return(0,P.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,k.jsx)(Ct,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Ls}`,children:(0,k.jsx)("a",{href:Ls,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(sf,"Attribution");var af=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Fn=o(e=>e.id,"selectId");function cf(e,t){return re(e.selectedNodes.map(Fn),t.selectedNodes.map(Fn))&&re(e.selectedEdges.map(Fn),t.selectedEdges.map(Fn))}o(cf,"areEqual$1");function lf({onSelectionChange:e}){let t=ie(),{selectedNodes:n,selectedEdges:r}=ne(af,cf);return(0,P.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(lf,"SelectionListenerInner");var uf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function df({onSelectionChange:e}){let t=ne(uf);return e||t?(0,k.jsx)(lf,{onSelectionChange:e}):null}o(df,"SelectionListener");var fa=[0,0],ff={x:0,y:0,zoom:1},hf=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Hs=[...hf,"rfId"],pf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Bs={translateExtent:yt,nodeOrigin:fa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function gf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:l}=ne(pf,re),u=ie();(0,P.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Bs,c()}),[]);let d=(0,P.useRef)(Bs);return(0,P.useEffect)(()=>{for(let h of Hs){let f=e[h],p=d.current[h];f!==p&&(typeof e[h]>"u"||(h==="nodes"?t(f):h==="edges"?n(f):h==="minZoom"?r(f):h==="maxZoom"?i(f):h==="translateExtent"?s(f):h==="nodeExtent"?a(f):h==="ariaLabelConfig"?u.setState({ariaLabelConfig:cs(f)}):h==="fitView"?u.setState({fitViewQueued:f}):h==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[h]:f})))}d.current=e},Hs.map(h=>e[h])),null}o(gf,"StoreUpdater");function Vs(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Vs,"getMediaQuery");function mf(e){let[t,n]=(0,P.useState)(e==="system"?null:e);return(0,P.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Vs(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Vs()?.matches?"dark":"light"}o(mf,"useColorModeClass");var Fs=typeof document<"u"?document:null;function rn(e=null,t={target:Fs,actInsideInputWithModifier:!0}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(!1),s=(0,P.useRef)(new Set([])),[a,c]=(0,P.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace(/\+/g,`
|
|
1
|
+
import{a as ro,b as io,c as mi,d as yi,e as ln,g as wi,h as xi,i as ct}from"./chunk-Y2YLTUMD.js";import{a as bi,b as Si,c as Ei,f as un}from"./chunk-PFIATRRO.js";import{e as pi,k as gi}from"./chunk-2NUCBQFU.js";import{b as xl}from"./chunk-N7FOBAV3.js";import{a as wl}from"./chunk-4AG356VE.js";import{B as hi,b as ui,j as fi,s as oo}from"./chunk-ITS5LMYJ.js";import{a as no,b as di}from"./chunk-ADABTCDI.js";import{a as o,d as Ke}from"./chunk-5PEAXTYQ.js";var bl={value:o(()=>{},"value")};function Ci(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new dn(n)}o(Ci,"dispatch");function dn(e){this._=e}o(dn,"Dispatch");function Sl(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(Sl,"parseTypenames");dn.prototype=Ci.prototype={constructor:dn,on:o(function(e,t){var n=this._,r=Sl(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=El(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=vi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=vi(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new dn(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function El(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(El,"get");function vi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=bl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(vi,"set");var Qe=Ci;var fn="http://www.w3.org/1999/xhtml",so={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ne(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),so.hasOwnProperty(t)?{space:so[t],local:e}:e}o(Ne,"default");function vl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fn&&t.documentElement.namespaceURI===fn?t.createElement(e):t.createElementNS(n,e)}}o(vl,"creatorInherit");function Cl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(Cl,"creatorFixed");function Dt(e){var t=Ne(e);return(t.local?Cl:vl)(t)}o(Dt,"default");function _l(){}o(_l,"none");function $e(e){return e==null?_l:function(){return this.querySelector(e)}}o($e,"default");function ao(e){typeof e!="function"&&(e=$e(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=e.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),c[d]=u);return new se(r,this._parents)}o(ao,"default");function co(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(co,"array");function Nl(){return[]}o(Nl,"empty");function lt(e){return e==null?Nl:function(){return this.querySelectorAll(e)}}o(lt,"default");function Ml(e){return function(){return co(e.apply(this,arguments))}}o(Ml,"arrayAll");function lo(e){typeof e=="function"?e=Ml(e):e=lt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new se(r,i)}o(lo,"default");function ut(e){return function(){return this.matches(e)}}o(ut,"default");function hn(e){return function(t){return t.matches(e)}}o(hn,"childMatcher");var Il=Array.prototype.find;function Pl(e){return function(){return Il.call(this.children,e)}}o(Pl,"childFind");function kl(){return this.firstElementChild}o(kl,"childFirst");function uo(e){return this.select(e==null?kl:Pl(typeof e=="function"?e:hn(e)))}o(uo,"default");var Al=Array.prototype.filter;function Dl(){return Array.from(this.children)}o(Dl,"children");function Tl(e){return function(){return Al.call(this.children,e)}}o(Tl,"childrenFilter");function fo(e){return this.selectAll(e==null?Dl:Tl(typeof e=="function"?e:hn(e)))}o(fo,"default");function ho(e){typeof e!="function"&&(e=ut(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new se(r,this._parents)}o(ho,"default");function Tt(e){return new Array(e.length)}o(Tt,"default");function po(){return new se(this._enter||this._groups.map(Tt),this._parents)}o(po,"default");function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(Rt,"EnterNode");Rt.prototype={constructor:Rt,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function go(e){return function(){return e}}o(go,"default");function Rl(e,t,n,r,i,s){for(var a=0,c,l=t.length,u=s.length;a<u;++a)(c=t[a])?(c.__data__=s[a],r[a]=c):n[a]=new Rt(e,s[a]);for(;a<l;++a)(c=t[a])&&(i[a]=c)}o(Rl,"bindIndex");function Ol(e,t,n,r,i,s,a){var c,l,u=new Map,d=t.length,h=s.length,f=new Array(d),p;for(c=0;c<d;++c)(l=t[c])&&(f[c]=p=a.call(l,l.__data__,c,t)+"",u.has(p)?i[c]=l:u.set(p,l));for(c=0;c<h;++c)p=a.call(e,s[c],c,s)+"",(l=u.get(p))?(r[c]=l,l.__data__=s[c],u.delete(p)):n[c]=new Rt(e,s[c]);for(c=0;c<d;++c)(l=t[c])&&u.get(f[c])===l&&(i[c]=l)}o(Ol,"bindKey");function zl(e){return e.__data__}o(zl,"datum");function mo(e,t){if(!arguments.length)return Array.from(this,zl);var n=t?Ol:Rl,r=this._parents,i=this._groups;typeof e!="function"&&(e=go(e));for(var s=i.length,a=new Array(s),c=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],h=i[u],f=h.length,p=$l(e.call(d,d&&d.__data__,u,r)),m=p.length,S=c[u]=new Array(m),x=a[u]=new Array(m),w=l[u]=new Array(f);n(d,h,S,x,w,p,t);for(var E=0,g=0,b,N;E<m;++E)if(b=S[E]){for(E>=g&&(g=E+1);!(N=x[g])&&++g<m;);b._next=N||null}}return a=new se(a,r),a._enter=c,a._exit=l,a}o(mo,"default");function $l(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o($l,"arraylike");function yo(){return new se(this._exit||this._groups.map(Tt),this._parents)}o(yo,"default");function wo(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(wo,"default");function xo(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),c=new Array(i),l=0;l<a;++l)for(var u=n[l],d=r[l],h=u.length,f=c[l]=new Array(h),p,m=0;m<h;++m)(p=u[m]||d[m])&&(f[m]=p);for(;l<i;++l)c[l]=n[l];return new se(c,this._parents)}o(xo,"default");function bo(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(bo,"default");function So(e){e||(e=Ll);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],c=a.length,l=i[s]=new Array(c),u,d=0;d<c;++d)(u=a[d])&&(l[d]=u);l.sort(t)}return new se(i,this._parents).order()}o(So,"default");function Ll(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(Ll,"ascending");function Eo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(Eo,"default");function vo(){return Array.from(this)}o(vo,"default");function Co(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Co,"default");function _o(){let e=0;for(let t of this)++e;return e}o(_o,"default");function No(){return!this.node()}o(No,"default");function Mo(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,c;s<a;++s)(c=i[s])&&e.call(c,c.__data__,s,i);return this}o(Mo,"default");function Hl(e){return function(){this.removeAttribute(e)}}o(Hl,"attrRemove");function Bl(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Bl,"attrRemoveNS");function Vl(e,t){return function(){this.setAttribute(e,t)}}o(Vl,"attrConstant");function Fl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(Fl,"attrConstantNS");function Wl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(Wl,"attrFunction");function Yl(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)}}o(Yl,"attrFunctionNS");function Io(e,t){var n=Ne(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Bl:Hl:typeof t=="function"?n.local?Yl:Wl:n.local?Fl:Vl)(n,t))}o(Io,"default");function Ot(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Ot,"default");function Xl(e){return function(){this.style.removeProperty(e)}}o(Xl,"styleRemove");function Zl(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(Zl,"styleConstant");function Ul(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(Ul,"styleFunction");function Po(e,t,n){return arguments.length>1?this.each((t==null?Xl:typeof t=="function"?Ul:Zl)(e,t,n??"")):Le(this.node(),e)}o(Po,"default");function Le(e,t){return e.style.getPropertyValue(t)||Ot(e).getComputedStyle(e,null).getPropertyValue(t)}o(Le,"styleValue");function ql(e){return function(){delete this[e]}}o(ql,"propertyRemove");function Gl(e,t){return function(){this[e]=t}}o(Gl,"propertyConstant");function Kl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(Kl,"propertyFunction");function ko(e,t){return arguments.length>1?this.each((t==null?ql:typeof t=="function"?Kl:Gl)(e,t)):this.node()[e]}o(ko,"default");function _i(e){return e.trim().split(/^|\s+/)}o(_i,"classArray");function Ao(e){return e.classList||new Ni(e)}o(Ao,"classList");function Ni(e){this._node=e,this._names=_i(e.getAttribute("class")||"")}o(Ni,"ClassList");Ni.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Mi(e,t){for(var n=Ao(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Mi,"classedAdd");function Ii(e,t){for(var n=Ao(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(Ii,"classedRemove");function Ql(e){return function(){Mi(this,e)}}o(Ql,"classedTrue");function Jl(e){return function(){Ii(this,e)}}o(Jl,"classedFalse");function jl(e,t){return function(){(t.apply(this,arguments)?Mi:Ii)(this,e)}}o(jl,"classedFunction");function Do(e,t){var n=_i(e+"");if(arguments.length<2){for(var r=Ao(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?jl:t?Ql:Jl)(n,t))}o(Do,"default");function eu(){this.textContent=""}o(eu,"textRemove");function tu(e){return function(){this.textContent=e}}o(tu,"textConstant");function nu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(nu,"textFunction");function To(e){return arguments.length?this.each(e==null?eu:(typeof e=="function"?nu:tu)(e)):this.node().textContent}o(To,"default");function ou(){this.innerHTML=""}o(ou,"htmlRemove");function ru(e){return function(){this.innerHTML=e}}o(ru,"htmlConstant");function iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(iu,"htmlFunction");function Ro(e){return arguments.length?this.each(e==null?ou:(typeof e=="function"?iu:ru)(e)):this.node().innerHTML}o(Ro,"default");function su(){this.nextSibling&&this.parentNode.appendChild(this)}o(su,"raise");function Oo(){return this.each(su)}o(Oo,"default");function au(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(au,"lower");function zo(){return this.each(au)}o(zo,"default");function $o(e){var t=typeof e=="function"?e:Dt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o($o,"default");function cu(){return null}o(cu,"constantNull");function Lo(e,t){var n=typeof e=="function"?e:Dt(e),r=t==null?cu:typeof t=="function"?t:$e(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Lo,"default");function lu(){var e=this.parentNode;e&&e.removeChild(this)}o(lu,"remove");function Ho(){return this.each(lu)}o(Ho,"default");function uu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(uu,"selection_cloneShallow");function du(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(du,"selection_cloneDeep");function Bo(e){return this.select(e?du:uu)}o(Bo,"default");function Vo(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Vo,"default");function fu(e){return function(t){e.call(this,t,this.__data__)}}o(fu,"contextListener");function hu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(hu,"parseTypenames");function pu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(pu,"onRemove");function gu(e,t,n){return function(){var r=this.__on,i,s=fu(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(gu,"onAdd");function Fo(e,t,n){var r=hu(e+""),i,s=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(i=0,d=c[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(c=t?gu:pu,i=0;i<s;++i)this.each(c(r[i],t,n));return this}o(Fo,"default");function Pi(e,t,n){var r=Ot(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Pi,"dispatchEvent");function mu(e,t){return function(){return Pi(this,e,t)}}o(mu,"dispatchConstant");function yu(e,t){return function(){return Pi(this,e,t.apply(this,arguments))}}o(yu,"dispatchFunction");function Wo(e,t){return this.each((typeof t=="function"?yu:mu)(e,t))}o(Wo,"default");function*Yo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Yo,"default");var Xo=[null];function se(e,t){this._groups=e,this._parents=t}o(se,"Selection");function ki(){return new se([[document.documentElement]],Xo)}o(ki,"selection");function wu(){return this}o(wu,"selection_selection");se.prototype=ki.prototype={constructor:se,select:ao,selectAll:lo,selectChild:uo,selectChildren:fo,filter:ho,data:mo,enter:po,exit:yo,join:wo,merge:xo,selection:wu,order:bo,sort:So,call:Eo,nodes:vo,node:Co,size:_o,empty:No,each:Mo,attr:Io,style:Po,property:ko,classed:Do,text:To,html:Ro,raise:Oo,lower:zo,append:$o,insert:Lo,remove:Ho,clone:Bo,datum:Vo,on:Fo,dispatch:Wo,[Symbol.iterator]:Yo};var De=ki;function ce(e){return typeof e=="string"?new se([[document.querySelector(e)]],[document.documentElement]):new se([[e]],Xo)}o(ce,"default");function Zo(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(Zo,"default");function fe(e,t){if(e=Zo(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(fe,"default");var Ai={passive:!1},Je={capture:!0,passive:!1};function pn(e){e.stopImmediatePropagation()}o(pn,"nopropagation");function Te(e){e.preventDefault(),e.stopImmediatePropagation()}o(Te,"default");function dt(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Te,Je);"onselectstart"in t?n.on("selectstart.drag",Te,Je):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(dt,"default");function zt(e,t){var n=e.document.documentElement,r=ce(e).on("dragstart.drag",null);t&&(r.on("click.drag",Te,Je),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(zt,"yesdrag");var $t=o(e=>()=>e,"default");function Lt(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Lt,"DragEvent");Lt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xu(e){return!e.ctrlKey&&!e.button}o(xu,"defaultFilter");function bu(){return this.parentNode}o(bu,"defaultContainer");function Su(e,t){return t??{x:e.x,y:e.y}}o(Su,"defaultSubject");function Eu(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Eu,"defaultTouchable");function Ht(){var e=xu,t=bu,n=Su,r=Eu,i={},s=Qe("start","drag","end"),a=0,c,l,u,d,h=0;function f(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",x).on("touchmove.drag",w,Ai).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(f,"drag");function p(b,N){if(!(d||!e.call(this,b,N))){var C=g(this,t.call(this,b,N),b,N,"mouse");C&&(ce(b.view).on("mousemove.drag",m,Je).on("mouseup.drag",S,Je),dt(b.view),pn(b),u=!1,c=b.clientX,l=b.clientY,C("start",b))}}o(p,"mousedowned");function m(b){if(Te(b),!u){var N=b.clientX-c,C=b.clientY-l;u=N*N+C*C>h}i.mouse("drag",b)}o(m,"mousemoved");function S(b){ce(b.view).on("mousemove.drag mouseup.drag",null),zt(b.view,u),Te(b),i.mouse("end",b)}o(S,"mouseupped");function x(b,N){if(e.call(this,b,N)){var C=b.changedTouches,M=t.call(this,b,N),D=C.length,A,B;for(A=0;A<D;++A)(B=g(this,M,b,N,C[A].identifier,C[A]))&&(pn(b),B("start",b,C[A]))}}o(x,"touchstarted");function w(b){var N=b.changedTouches,C=N.length,M,D;for(M=0;M<C;++M)(D=i[N[M].identifier])&&(Te(b),D("drag",b,N[M]))}o(w,"touchmoved");function E(b){var N=b.changedTouches,C=N.length,M,D;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<C;++M)(D=i[N[M].identifier])&&(pn(b),D("end",b,N[M]))}o(E,"touchended");function g(b,N,C,M,D,A){var B=s.copy(),z=fe(A||C,N),V,$,y;if((y=n.call(b,new Lt("beforestart",{sourceEvent:C,target:f,identifier:D,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:B}),M))!=null)return V=y.x-z[0]||0,$=y.y-z[1]||0,o(function v(_,I,T){var R=z,H;switch(_){case"start":i[D]=v,H=a++;break;case"end":delete i[D],--a;case"drag":z=fe(T||I,N),H=a;break}B.call(_,b,new Lt(_,{sourceEvent:I,subject:y,target:f,identifier:D,active:H,x:z[0]+V,y:z[1]+$,dx:z[0]-R[0],dy:z[1]-R[1],dispatch:B}),M)},"gesture")}return o(g,"beforestart"),f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:$t(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:$t(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:$t(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:$t(!!b),f):r},f.on=function(){var b=s.on.apply(s,arguments);return b===s?f:b},f.clickDistance=function(b){return arguments.length?(h=(b=+b)*b,f):Math.sqrt(h)},f}o(Ht,"default");var ft=0,Vt=0,Bt=0,Ti=1e3,gn,Ft,mn=0,je=0,yn=0,Wt=typeof performance=="object"&&performance.now?performance:Date,Ri=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xt(){return je||(Ri(vu),je=Wt.now()+yn)}o(Xt,"now");function vu(){je=0}o(vu,"clearNow");function Yt(){this._call=this._time=this._next=null}o(Yt,"Timer");Yt.prototype=wn.prototype={constructor:Yt,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xt():+n)+(t==null?0:+t),!this._next&&Ft!==this&&(Ft?Ft._next=this:gn=this,Ft=this),this._call=e,this._time=n,Uo()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,Uo())},"stop")};function wn(e,t,n){var r=new Yt;return r.restart(e,t,n),r}o(wn,"timer");function Oi(){Xt(),++ft;for(var e=gn,t;e;)(t=je-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ft}o(Oi,"timerFlush");function Di(){je=(mn=Wt.now())+yn,ft=Vt=0;try{Oi()}finally{ft=0,_u(),je=0}}o(Di,"wake");function Cu(){var e=Wt.now(),t=e-mn;t>Ti&&(yn-=t,mn=e)}o(Cu,"poke");function _u(){for(var e,t=gn,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gn=n);Ft=e,Uo(r)}o(_u,"nap");function Uo(e){if(!ft){Vt&&(Vt=clearTimeout(Vt));var t=e-je;t>24?(e<1/0&&(Vt=setTimeout(Di,e-Wt.now()-yn)),Bt&&(Bt=clearInterval(Bt))):(Bt||(mn=Wt.now(),Bt=setInterval(Cu,Ti)),ft=1,Ri(Di))}}o(Uo,"sleep");function Zt(e,t,n){var r=new Yt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(Zt,"default");var Nu=Qe("start","end","cancel","interrupt"),Mu=[],Li=0,zi=1,bn=2,xn=3,$i=4,Sn=5,Ut=6;function Re(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Iu(e,n,{name:t,index:r,group:i,on:Nu,tween:Mu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Li})}o(Re,"default");function qt(e,t){var n=le(e,t);if(n.state>Li)throw new Error("too late; already scheduled");return n}o(qt,"init");function de(e,t){var n=le(e,t);if(n.state>xn)throw new Error("too late; already running");return n}o(de,"set");function le(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(le,"get");function Iu(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wn(s,0,n.time);function s(u){n.state=zi,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,h,f,p;if(n.state!==zi)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===xn)return Zt(a);p.state===$i?(p.state=Ut,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Ut,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(Zt(function(){n.state===xn&&(n.state=$i,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=bn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bn){for(n.state=xn,i=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}o(a,"start");function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Sn,1),h=-1,f=i.length;++h<f;)i[h].call(e,d);n.state===Sn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}o(c,"tick");function l(){n.state=Ut,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(l,"stop")}o(Iu,"create");function He(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>bn&&r.state<Sn,r.state=Ut,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(He,"default");function qo(e){return this.each(function(){He(this,e)})}o(qo,"default");function Pu(e,t){var n,r;return function(){var i=de(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(Pu,"tweenRemove");function ku(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=de(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=c;break}l===u&&i.push(c)}s.tween=i}}o(ku,"tweenFunction");function Go(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=le(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Pu:ku)(n,e,t))}o(Go,"default");function ht(e,t,n){var r=e._id;return e.each(function(){var i=de(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return le(i,r).value[t]}}o(ht,"tweenValue");function Gt(e,t){var n;return(typeof t=="number"?mi:t instanceof ro?io:(n=ro(t))?(t=n,io):yi)(e,t)}o(Gt,"default");function Au(e){return function(){this.removeAttribute(e)}}o(Au,"attrRemove");function Du(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Du,"attrRemoveNS");function Tu(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Tu,"attrConstant");function Ru(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ru,"attrConstantNS");function Ou(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(Ou,"attrFunction");function zu(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(zu,"attrFunctionNS");function Ko(e,t){var n=Ne(e),r=n==="transform"?xi:Gt;return this.attrTween(e,typeof t=="function"?(n.local?zu:Ou)(n,r,ht(this,"attr."+e,t)):t==null?(n.local?Du:Au)(n):(n.local?Ru:Tu)(n,r,t))}o(Ko,"default");function $u(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o($u,"attrInterpolate");function Lu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(Lu,"attrInterpolateNS");function Hu(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Lu(e,s)),n}return o(i,"tween"),i._value=t,i}o(Hu,"attrTweenNS");function Bu(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&$u(e,s)),n}return o(i,"tween"),i._value=t,i}o(Bu,"attrTween");function Qo(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ne(e);return this.tween(n,(r.local?Hu:Bu)(r,t))}o(Qo,"default");function Vu(e,t){return function(){qt(this,e).delay=+t.apply(this,arguments)}}o(Vu,"delayFunction");function Fu(e,t){return t=+t,function(){qt(this,e).delay=t}}o(Fu,"delayConstant");function Jo(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Vu:Fu)(t,e)):le(this.node(),t).delay}o(Jo,"default");function Wu(e,t){return function(){de(this,e).duration=+t.apply(this,arguments)}}o(Wu,"durationFunction");function Yu(e,t){return t=+t,function(){de(this,e).duration=t}}o(Yu,"durationConstant");function jo(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Wu:Yu)(t,e)):le(this.node(),t).duration}o(jo,"default");function Xu(e,t){if(typeof t!="function")throw new Error;return function(){de(this,e).ease=t}}o(Xu,"easeConstant");function er(e){var t=this._id;return arguments.length?this.each(Xu(t,e)):le(this.node(),t).ease}o(er,"default");function Zu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;de(this,e).ease=n}}o(Zu,"easeVarying");function tr(e){if(typeof e!="function")throw new Error;return this.each(Zu(this._id,e))}o(tr,"default");function nr(e){typeof e!="function"&&(e=ut(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new pe(r,this._parents,this._name,this._id)}o(nr,"default");function or(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=t[c],u=n[c],d=l.length,h=a[c]=new Array(d),f,p=0;p<d;++p)(f=l[p]||u[p])&&(h[p]=f);for(;c<r;++c)a[c]=t[c];return new pe(a,this._parents,this._name,this._id)}o(or,"default");function Uu(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(Uu,"start");function qu(e,t,n){var r,i,s=Uu(t)?qt:de;return function(){var a=s(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}o(qu,"onFunction");function rr(e,t){var n=this._id;return arguments.length<2?le(this.node(),n).on.on(e):this.each(qu(n,e,t))}o(rr,"default");function Gu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(Gu,"removeFunction");function ir(){return this.on("end.remove",Gu(this._id))}o(ir,"default");function sr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$e(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],l=c.length,u=s[a]=new Array(l),d,h,f=0;f<l;++f)(d=c[f])&&(h=e.call(d,d.__data__,f,c))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,Re(u[f],t,n,f,u,le(d,n)));return new pe(s,this._parents,t,n)}o(sr,"default");function ar(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lt(e));for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var l=r[c],u=l.length,d,h=0;h<u;++h)if(d=l[h]){for(var f=e.call(d,d.__data__,h,l),p,m=le(d,n),S=0,x=f.length;S<x;++S)(p=f[S])&&Re(p,t,n,S,f,m);s.push(f),a.push(d)}return new pe(s,a,t,n)}o(ar,"default");var Ku=De.prototype.constructor;function cr(){return new Ku(this._groups,this._parents)}o(cr,"default");function Qu(e,t){var n,r,i;return function(){var s=Le(this,e),a=(this.style.removeProperty(e),Le(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(Qu,"styleNull");function Hi(e){return function(){this.style.removeProperty(e)}}o(Hi,"styleRemove");function Ju(e,t,n){var r,i=n+"",s;return function(){var a=Le(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ju,"styleConstant");function ju(e,t,n){var r,i,s;return function(){var a=Le(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),Le(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c))}}o(ju,"styleFunction");function ed(e,t){var n,r,i,s="style."+t,a="end."+s,c;return function(){var l=de(this,e),u=l.on,d=l.value[s]==null?c||(c=Hi(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),l.on=r}}o(ed,"styleMaybeRemove");function lr(e,t,n){var r=(e+="")=="transform"?wi:Gt;return t==null?this.styleTween(e,Qu(e,r)).on("end.style."+e,Hi(e)):typeof t=="function"?this.styleTween(e,ju(e,r,ht(this,"style."+e,t))).each(ed(this._id,e)):this.styleTween(e,Ju(e,r,t),n).on("end.style."+e,null)}o(lr,"default");function td(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(td,"styleInterpolate");function nd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&td(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(nd,"styleTween");function ur(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,nd(e,t,n??""))}o(ur,"default");function od(e){return function(){this.textContent=e}}o(od,"textConstant");function rd(e){return function(){var t=e(this);this.textContent=t??""}}o(rd,"textFunction");function dr(e){return this.tween("text",typeof e=="function"?rd(ht(this,"text",e)):od(e==null?"":e+""))}o(dr,"default");function id(e){return function(t){this.textContent=e.call(this,t)}}o(id,"textInterpolate");function sd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&id(i)),t}return o(r,"tween"),r._value=e,r}o(sd,"textTween");function fr(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,sd(e))}o(fr,"default");function hr(){for(var e=this._name,t=this._id,n=En(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)if(l=a[u]){var d=le(l,t);Re(l,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new pe(r,this._parents,e,n)}o(hr,"default");function pr(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var c={value:a},l={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=de(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),i===0&&s()})}o(pr,"default");var ad=0;function pe(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(pe,"Transition");function Bi(e){return De().transition(e)}o(Bi,"transition");function En(){return++ad}o(En,"newId");var Oe=De.prototype;pe.prototype=Bi.prototype={constructor:pe,select:sr,selectAll:ar,selectChild:Oe.selectChild,selectChildren:Oe.selectChildren,filter:nr,merge:or,selection:cr,transition:hr,call:Oe.call,nodes:Oe.nodes,node:Oe.node,size:Oe.size,empty:Oe.empty,each:Oe.each,on:rr,attr:Ko,attrTween:Qo,style:lr,styleTween:ur,text:dr,textTween:fr,remove:ir,tween:Go,delay:Jo,duration:jo,ease:er,easeVarying:tr,end:pr,[Symbol.iterator]:Oe[Symbol.iterator]};function vn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(vn,"cubicInOut");var cd={time:null,delay:0,duration:250,ease:vn};function ld(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(ld,"inherit");function gr(e){var t,n;e instanceof pe?(t=e._id,e=e._name):(t=En(),(n=cd).time=Xt(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&Re(l,e,t,u,a,n||ld(l,t));return new pe(r,this._parents,e,t)}o(gr,"default");De.prototype.interrupt=qo;De.prototype.transition=gr;var Kt=o(e=>()=>e,"default");function mr(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}o(mr,"ZoomEvent");function Se(e,t,n){this.k=e,this.x=t,this.y=n}o(Se,"Transform");Se.prototype={constructor:Se,scale:o(function(e){return e===1?this:new Se(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Se(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var et=new Se(1,0,0);Qt.prototype=Se.prototype;function Qt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return et;return e.__zoom}o(Qt,"transform");function Cn(e){e.stopImmediatePropagation()}o(Cn,"nopropagation");function tt(e){e.preventDefault(),e.stopImmediatePropagation()}o(tt,"default");function ud(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(ud,"defaultFilter");function dd(){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]]}o(dd,"defaultExtent");function Vi(){return this.__zoom||et}o(Vi,"defaultTransform");function fd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(fd,"defaultWheelDelta");function hd(){return navigator.maxTouchPoints||"ontouchstart"in this}o(hd,"defaultTouchable");function pd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(pd,"defaultConstrain");function Jt(){var e=ud,t=dd,n=pd,r=fd,i=hd,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ct,u=Qe("start","zoom","end"),d,h,f,p=500,m=150,S=0,x=10;function w(y){y.property("__zoom",Vi).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(w,"zoom"),w.transform=function(y,v,_,I){var T=y.selection?y.selection():y;T.property("__zoom",Vi),y!==T?N(y,v,_,I):T.interrupt().each(function(){C(this,arguments).event(I).start().zoom(null,typeof v=="function"?v.apply(this,arguments):v).end()})},w.scaleBy=function(y,v,_,I){w.scaleTo(y,function(){var T=this.__zoom.k,R=typeof v=="function"?v.apply(this,arguments):v;return T*R},_,I)},w.scaleTo=function(y,v,_,I){w.transform(y,function(){var T=t.apply(this,arguments),R=this.__zoom,H=_==null?b(T):typeof _=="function"?_.apply(this,arguments):_,L=R.invert(H),F=typeof v=="function"?v.apply(this,arguments):v;return n(g(E(R,F),H,L),T,a)},_,I)},w.translateBy=function(y,v,_,I){w.transform(y,function(){return n(this.__zoom.translate(typeof v=="function"?v.apply(this,arguments):v,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),a)},null,I)},w.translateTo=function(y,v,_,I,T){w.transform(y,function(){var R=t.apply(this,arguments),H=this.__zoom,L=I==null?b(R):typeof I=="function"?I.apply(this,arguments):I;return n(et.translate(L[0],L[1]).scale(H.k).translate(typeof v=="function"?-v.apply(this,arguments):-v,typeof _=="function"?-_.apply(this,arguments):-_),R,a)},I,T)};function E(y,v){return v=Math.max(s[0],Math.min(s[1],v)),v===y.k?y:new Se(v,y.x,y.y)}o(E,"scale");function g(y,v,_){var I=v[0]-_[0]*y.k,T=v[1]-_[1]*y.k;return I===y.x&&T===y.y?y:new Se(y.k,I,T)}o(g,"translate");function b(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}o(b,"centroid");function N(y,v,_,I){y.on("start.zoom",function(){C(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(I).end()}).tween("zoom",function(){var T=this,R=arguments,H=C(T,R).event(I),L=t.apply(T,R),F=_==null?b(L):typeof _=="function"?_.apply(T,R):_,G=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Y=T.__zoom,K=typeof v=="function"?v.apply(T,R):v,j=l(Y.invert(F).concat(G/Y.k),K.invert(F).concat(G/K.k));return function(q){if(q===1)q=K;else{var O=j(q),W=G/O[2];q=new Se(W,F[0]-O[0]*W,F[1]-O[1]*W)}H.zoom(null,q)}})}o(N,"schedule");function C(y,v,_){return!_&&y.__zooming||new M(y,v)}o(C,"gesture");function M(y,v){this.that=y,this.args=v,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,v),this.taps=0}o(M,"Gesture"),M.prototype={event:o(function(y){return y&&(this.sourceEvent=y),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(y,v){return this.mouse&&y!=="mouse"&&(this.mouse[1]=v.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=v.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=v.invert(this.touch1[0])),this.that.__zoom=v,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(y){var v=ce(this.that).datum();u.call(y,this.that,new mr(y,{sourceEvent:this.sourceEvent,target:w,type:y,transform:this.that.__zoom,dispatch:u}),v)},"emit")};function D(y,...v){if(!e.apply(this,arguments))return;var _=C(this,v).event(y),I=this.__zoom,T=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),R=fe(y);if(_.wheel)(_.mouse[0][0]!==R[0]||_.mouse[0][1]!==R[1])&&(_.mouse[1]=I.invert(_.mouse[0]=R)),clearTimeout(_.wheel);else{if(I.k===T)return;_.mouse=[R,I.invert(R)],He(this),_.start()}tt(y),_.wheel=setTimeout(H,m),_.zoom("mouse",n(g(E(I,T),_.mouse[0],_.mouse[1]),_.extent,a));function H(){_.wheel=null,_.end()}o(H,"wheelidled")}o(D,"wheeled");function A(y,...v){if(f||!e.apply(this,arguments))return;var _=y.currentTarget,I=C(this,v,!0).event(y),T=ce(y.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),R=fe(y,_),H=y.clientX,L=y.clientY;dt(y.view),Cn(y),I.mouse=[R,this.__zoom.invert(R)],He(this),I.start();function F(Y){if(tt(Y),!I.moved){var K=Y.clientX-H,j=Y.clientY-L;I.moved=K*K+j*j>S}I.event(Y).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=fe(Y,_),I.mouse[1]),I.extent,a))}o(F,"mousemoved");function G(Y){T.on("mousemove.zoom mouseup.zoom",null),zt(Y.view,I.moved),tt(Y),I.event(Y).end()}o(G,"mouseupped")}o(A,"mousedowned");function B(y,...v){if(e.apply(this,arguments)){var _=this.__zoom,I=fe(y.changedTouches?y.changedTouches[0]:y,this),T=_.invert(I),R=_.k*(y.shiftKey?.5:2),H=n(g(E(_,R),I,T),t.apply(this,v),a);tt(y),c>0?ce(this).transition().duration(c).call(N,H,I,y):ce(this).call(w.transform,H,I,y)}}o(B,"dblclicked");function z(y,...v){if(e.apply(this,arguments)){var _=y.touches,I=_.length,T=C(this,v,y.changedTouches.length===I).event(y),R,H,L,F;for(Cn(y),H=0;H<I;++H)L=_[H],F=fe(L,this),F=[F,this.__zoom.invert(F),L.identifier],T.touch0?!T.touch1&&T.touch0[2]!==F[2]&&(T.touch1=F,T.taps=0):(T.touch0=F,R=!0,T.taps=1+!!d);d&&(d=clearTimeout(d)),R&&(T.taps<2&&(h=F[0],d=setTimeout(function(){d=null},p)),He(this),T.start())}}o(z,"touchstarted");function V(y,...v){if(this.__zooming){var _=C(this,v).event(y),I=y.changedTouches,T=I.length,R,H,L,F;for(tt(y),R=0;R<T;++R)H=I[R],L=fe(H,this),_.touch0&&_.touch0[2]===H.identifier?_.touch0[0]=L:_.touch1&&_.touch1[2]===H.identifier&&(_.touch1[0]=L);if(H=_.that.__zoom,_.touch1){var G=_.touch0[0],Y=_.touch0[1],K=_.touch1[0],j=_.touch1[1],q=(q=K[0]-G[0])*q+(q=K[1]-G[1])*q,O=(O=j[0]-Y[0])*O+(O=j[1]-Y[1])*O;H=E(H,Math.sqrt(q/O)),L=[(G[0]+K[0])/2,(G[1]+K[1])/2],F=[(Y[0]+j[0])/2,(Y[1]+j[1])/2]}else if(_.touch0)L=_.touch0[0],F=_.touch0[1];else return;_.zoom("touch",n(g(H,L,F),_.extent,a))}}o(V,"touchmoved");function $(y,...v){if(this.__zooming){var _=C(this,v).event(y),I=y.changedTouches,T=I.length,R,H;for(Cn(y),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),R=0;R<T;++R)H=I[R],_.touch0&&_.touch0[2]===H.identifier?delete _.touch0:_.touch1&&_.touch1[2]===H.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(H=fe(H,this),Math.hypot(h[0]-H[0],h[1]-H[1])<x)){var L=ce(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return o($,"touchended"),w.wheelDelta=function(y){return arguments.length?(r=typeof y=="function"?y:Kt(+y),w):r},w.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Kt(!!y),w):e},w.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:Kt(!!y),w):i},w.extent=function(y){return arguments.length?(t=typeof y=="function"?y:Kt([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),w):t},w.scaleExtent=function(y){return arguments.length?(s[0]=+y[0],s[1]=+y[1],w):[s[0],s[1]]},w.translateExtent=function(y){return arguments.length?(a[0][0]=+y[0][0],a[1][0]=+y[1][0],a[0][1]=+y[0][1],a[1][1]=+y[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(y){return arguments.length?(n=y,w):n},w.duration=function(y){return arguments.length?(c=+y,w):c},w.interpolate=function(y){return arguments.length?(l=y,w):l},w.on=function(){var y=u.on.apply(u,arguments);return y===u?w:y},w.clickDistance=function(y){return arguments.length?(S=(y=+y)*y,w):Math.sqrt(S)},w.tapDistance=function(y){return arguments.length?(x=+y,w):x},w}o(Jt,"default");var ge={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},yt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sr=["Enter"," ","Escape"],Er={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},We;(function(e){e.Strict="strict",e.Loose="loose"})(We||(We={}));var ze;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ze||(ze={}));var nt;(function(e){e.Partial="partial",e.Full="full"})(nt||(nt={}));var vr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Me;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Me||(Me={}));var gt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gt||(gt={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));var Fi={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},Cr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),ts=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),_r=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var en=o((e,t=[0,0])=>{let{width:n,height:r}=xe(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),tn=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((i,s)=>{let a=typeof s=="string",c=!t.nodeLookup&&!a?s:void 0;return t.nodeLookup&&(c=a?t.nodeLookup.get(s):_r(s)?s:t.nodeLookup.get(s.id)),c?(n=!0,kn(i,Mn(c,t.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?An(r):{x:0,y:0,width:0,height:0}},"getNodesBounds"),wt=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=kn(n,Mn(i)),r=!0)}),r?An(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),In=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let c=(t.x-n)/i,l=(t.y-r)/i,u=t.width/i,d=t.height/i,h=[];for(let f of e.values()){let{measured:p,selectable:m=!0,hidden:S=!1}=f;if(a&&!m||S)continue;let x=p.width??f.width??f.initialWidth??0,w=p.height??f.height??f.initialHeight??0,{x:E,y:g}=f.internals.positionAbsolute,b=ss(c,l,u,d,E,g,x,w),N=x*w,C=s&&b>0;(!f.internals.handleBounds||C||b>=N||f.dragging)&&h.push(f)}return h},"getNodesInside"),ns=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function gd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:c}=xe(i);s=a>0&&c>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(gd,"getFitViewNodes");async function os({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let c=gd(e,a),l=wt(c),u=st(l,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(os,"fitViewport");function Nr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,h=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)s?.("005",ge.error005());else{let{width:p,height:m}=xe(c);p&&m&&(h=[[l,u],[l+p,u+m]])}else c&&it(a.extent)&&(h=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);let f=it(h)?ot(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ge.error015()),{position:{x:f.x-l+(a.measured.width??0)*d[0],y:f.y-u+(a.measured.height??0)*d[1]},positionAbsolute:f}}o(Nr,"calculateNodePosition");async function rs({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(f=>f.id)),a=[];for(let f of n){if(f.deletable===!1)continue;let p=s.has(f.id),m=!p&&f.parentId&&a.find(S=>S.id===f.parentId);(p||m)&&a.push(f)}let c=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=ns(a,l);for(let f of l)c.has(f.id)&&!d.find(m=>m.id===f.id)&&d.push(f);if(!i)return{edges:d,nodes:a};let h=await i({nodes:a,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:a}:{edges:[],nodes:[]}:h}o(rs,"getElementsToRemove");var mt=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),ot=o((e={x:0,y:0},t,n)=>({x:mt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:mt(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function is(e,t,n){let{width:r,height:i}=xe(n),{x:s,y:a}=n.internals.positionAbsolute;return ot(e,[[s,a],[s+r,a+i]],t)}o(is,"clampPositionToParent");var Wi=o((e,t,n)=>e<t?mt(Math.abs(e-t),1,t)/t:e>n?-mt(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),Pn=o((e,t,n=15,r=40)=>{let i=Wi(e.x,r,t.width-r)*n,s=Wi(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),kn=o((e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),"getBoundsOfBoxes"),br=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),An=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),xt=o((e,t=[0,0])=>{let{x:n,y:r}=_r(e)?e.internals.positionAbsolute:en(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),Mn=o((e,t=[0,0])=>{let{x:n,y:r}=_r(e)?e.internals.positionAbsolute:en(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),Mr=o((e,t)=>An(kn(br(e),br(t))),"getBoundsOfRects"),ss=o((e,t,n,r,i,s,a,c)=>{let l=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+c)-Math.max(t,s));return Math.ceil(l*u)},"getRectsOverlappingArea"),nn=o((e,t)=>ss(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Ir=o(e=>ye(e.width)&&ye(e.height)&&ye(e.x)&&ye(e.y),"isRectObject"),ye=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),Pr=o((e,t)=>(n,r)=>{},"createDevWarn"),bt=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),St=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let c={x:(e-n)/i,y:(t-r)/i};return s?bt(c,a):c},"pointToRendererPoint"),rt=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function pt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(pt,"parsePadding");function md(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=pt(e,n),i=pt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=pt(e.top??e.y??0,n),i=pt(e.bottom??e.y??0,n),s=pt(e.left??e.x??0,t),a=pt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(md,"parsePaddings");function yd(e,t,n,r,i,s){let{x:a,y:c}=rt(e,[t,n,r]),{x:l,y:u}=rt({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,h=s-u;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(d),bottom:Math.floor(h)}}o(yd,"calculateAppliedPaddings");var st=o((e,t,n,r,i,s)=>{let a=md(s,t,n),c=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(c,l),d=mt(u,r,i),h=e.x+e.width/2,f=e.y+e.height/2,p=t/2-h*d,m=n/2-f*d,S=yd(e,p,m,d,t,n),x={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:p-x.left+x.right,y:m-x.top+x.bottom,zoom:d}},"getViewportForBounds"),Et=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function it(e){return e!=null&&e!=="parent"}o(it,"isCoordinateExtent");function xe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(xe,"getNodeDimensions");function Dn(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(Dn,"nodeHasDimensions");function kr(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let c=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}o(kr,"evaluateAbsolutePosition");function Ar(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o(Ar,"areSetsEqual");function as(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(as,"withResolvers");function cs(e){return{...Er,...e||{}}}o(cs,"mergeAriaLabelConfig");function Dr(e){return e===null?null:e?"valid":"invalid"}o(Dr,"getConnectionStatus");function jt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=we(e),c=St({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:u}=n?bt(c,t):c;return{xSnapped:l,ySnapped:u,...c}}o(jt,"getPointerPosition");var Tn=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Tr=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),wd=["INPUT","SELECT","TEXTAREA"];function Rr(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:wd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Rr,"isInputDOMNode");var Or=o(e=>"clientX"in e,"isMouseEvent"),we=o((e,t)=>{let n=Or(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),Yi=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Tn(a)}})},"getHandleBounds");function Rn({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:c}){let l=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+c*.375+r*.125,d=Math.abs(l-e),h=Math.abs(u-t);return[l,u,d,h]}o(Rn,"getBezierEdgeCenter");function _n(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(_n,"calculateControlOffset");function Xi({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Z.Left:return[t-_n(t-r,s),n];case Z.Right:return[t+_n(r-t,s),n];case Z.Top:return[t,n-_n(n-i,s)];case Z.Bottom:return[t,n+_n(i-n,s)]}}o(Xi,"getControlWithCurvature");function On({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:s=Z.Top,curvature:a=.25}){let[c,l]=Xi({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Xi({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[h,f,p,m]=Rn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${l} ${u},${d} ${r},${i}`,h,f,p,m]}o(On,"getBezierPath");function zr({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[s,c,i,a]}o(zr,"getEdgeCenter");function ls({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}o(ls,"getElevatedEdgeZIndex");function us({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=kn(Mn(e),Mn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return nn(a,An(s))>0}o(us,"isEdgeVisible");var xd=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),bd=o((e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),"connectionExists"),ds=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ge.error006()),t;let r=n.getEdgeId||xd,i;return Cr(e)?i={...e}:i={...e,id:r(e)},bd(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function zn({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,c]=zr({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,c]}o(zn,"getStraightPath");var Zi={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},Sd=o(({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.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},"getDirection"),Ui=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance"),Ed=o((e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0,"isBetween");function vd({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:s,stepPosition:a}){let c=Zi[t],l=Zi[r],u={x:e.x+c.x*s,y:e.y+c.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},h=Sd({source:u,sourcePosition:t,target:d}),f=h.x!==0?"x":"y",p=h[f],m=[],S,x,w={x:0,y:0},E={x:0,y:0},[,,g,b]=zr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[f]*l[f]===-1){f==="x"?(S=i.x??u.x+(d.x-u.x)*a,x=i.y??(u.y+d.y)/2):(S=i.x??(u.x+d.x)/2,x=i.y??u.y+(d.y-u.y)*a);let D=[{x:S,y:u.y},{x:S,y:d.y}],A=[{x:u.x,y:x},{x:d.x,y:x}];c[f]===p?m=f==="x"?D:A:m=f==="x"?A:D}else{let D=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(f==="x"?m=c.x===p?A:D:m=c.y===p?D:A,t===r){let y=Math.abs(e[f]-n[f]);if(y<=s){let v=Math.min(s-1,s-y);c[f]===p?w[f]=(u[f]>e[f]?-1:1)*v:E[f]=(d[f]>n[f]?-1:1)*v}}if(t!==r){let y=f==="x"?"y":"x",v=c[f]===l[y],_=u[y]>d[y],I=u[y]<d[y];(c[f]===1&&(!v&&_||v&&I)||c[f]!==1&&(!v&&I||v&&_))&&(m=f==="x"?D:A)}let B={x:u.x+w.x,y:u.y+w.y},z={x:d.x+E.x,y:d.y+E.y},V=Math.max(Math.abs(B.x-m[0].x),Math.abs(z.x-m[0].x)),$=Math.max(Math.abs(B.y-m[0].y),Math.abs(z.y-m[0].y));V>=$?(S=(B.x+z.x)/2,x=m[0].y):(S=m[0].x,x=(B.y+z.y)/2)}let N={x:u.x+w.x,y:u.y+w.y},C={x:d.x+E.x,y:d.y+E.y},M=[];for(let D of[e,N,...m,C,n]){let[A,B]=M.slice(-2);B&&Ed(A,B,D)&&M.pop(),M.push(D)}return[M,S,x,g,b]}o(vd,"getPoints");function Cd(e,t,n,r){let i=Math.min(Ui(e,t)/2,Ui(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${a+i*l}Q ${s},${a} ${s+i*c},${a}`}o(Cd,"getBend");function on({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:s=Z.Top,borderRadius:a=5,centerX:c,centerY:l,offset:u=20,stepPosition:d=.5}){let[h,f,p,m,S]=vd({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:c,y:l},offset:u,stepPosition:d}),x=`M${h[0].x} ${h[0].y}`;for(let w=1;w<h.length-1;w++)x+=Cd(h[w-1],h[w],h[w+1],a);return x+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[x,f,p,m,S]}o(on,"getSmoothStepPath");function qi(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(qi,"isNodeInitialized");function fs(e){let{sourceNode:t,targetNode:n}=e;if(!qi(t)||!qi(n))return null;let r=t.internals.handleBounds||Gi(t.handles),i=n.internals.handleBounds||Gi(n.handles),s=Ki(r?.source??[],e.sourceHandle),a=Ki(e.connectionMode===We.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ge.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let c=s?.position||Z.Bottom,l=a?.position||Z.Top,u=Ye(t,s,c),d=Ye(n,a,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:l}}o(fs,"getEdgePosition");function Gi(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(Gi,"toHandleBounds");function Ye(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??xe(e);if(r)return{x:i+a/2,y:s+c/2};switch(t?.position??n){case Z.Top:return{x:i+a/2,y:s};case Z.Right:return{x:i+a,y:s+c/2};case Z.Bottom:return{x:i+a/2,y:s+c};case Z.Left:return{x:i,y:s+c/2}}}o(Ye,"getHandlePosition");function Ki(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(Ki,"getHandle$1");function $n(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o($n,"getMarkerId");function hs(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){let u=$n(l,t);s.has(u)||(a.push({id:u,color:l.color||n,...l}),s.add(u))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}o(hs,"createMarkerIds");var ps=1e3,_d=10,$r={nodeOrigin:[0,0],nodeExtent:yt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Nd={...$r,checkEquality:!0};function Lr(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Lr,"mergeObjects");function gs(e,t,n){let r=Lr($r,n);for(let i of e.values())if(i.parentId)Br(i,e,t,r);else{let s=en(i,r.nodeOrigin),a=it(i.extent)?i.extent:r.nodeExtent,c=ot(s,a,xe(i));i.internals.positionAbsolute=c}}o(gs,"updateAbsolutePositions");function Md(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(Md,"parseHandles");function Hr(e){return e==="manual"}o(Hr,"isManualZIndexMode");function Ln(e,t,n,r={}){let i=Lr(Nd,r),s={i:0},a=new Map(t),c=i?.elevateNodesOnSelect&&!Hr(i.zIndexMode)?ps:0,l=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let h=a.get(d.id);if(i.checkEquality&&d===h?.internals.userNode)t.set(d.id,h);else{let f=en(d,i.nodeOrigin),p=it(d.extent)?d.extent:i.nodeExtent,m=ot(f,p,xe(d));h={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:m,handleBounds:Md(d,h),z:ms(d,c,i.zIndexMode),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),d.parentId&&Br(h,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:l,hasSelectedNodes:u}}o(Ln,"adoptUserNodes");function Id(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(Id,"updateParentLookup");function Br(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:l}=Lr($r,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Id(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*_d),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let h=s&&!Hr(l)?ps:0,{x:f,y:p,z:m}=Pd(e,d,a,c,h,l),{positionAbsolute:S}=e.internals,x=f!==S.x||p!==S.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:p}:S,z:m}})}o(Br,"updateChildNode");function ms(e,t,n){let r=ye(e.zIndex)?e.zIndex:0;return Hr(n)?r:r+(e.selected?t:0)}o(ms,"calculateZ");function Pd(e,t,n,r,i,s){let{x:a,y:c}=t.internals.positionAbsolute,l=xe(e),u=en(e,n),d=it(e.extent)?ot(u,e.extent,l):u,h=ot({x:a+d.x,y:c+d.y},r,l);e.extent==="parent"&&(h=is(h,l,t));let f=ms(e,i,s),p=t.internals.z??0;return{x:h.x,y:h.y,z:p>=f?p+1:f}}o(Pd,"calculateChildXYZ");function Hn(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let c=t.get(a.parentId);if(!c)continue;let l=s.get(a.parentId)?.expandedRect??xt(c),u=Mr(l,a.rect);s.set(a.parentId,{expandedRect:u,parent:c})}return s.size>0&&s.forEach(({expandedRect:a,parent:c},l)=>{let u=c.internals.positionAbsolute,d=xe(c),h=c.origin??r,f=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),x=(m-d.width)*h[0],w=(S-d.height)*h[1];(f>0||p>0||x||w)&&(i.push({id:l,type:"position",position:{x:c.position.x-f+x,y:c.position.y-p+w}}),n.get(l)?.forEach(E=>{e.some(g=>g.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+f,y:E.position.y+p}})})),(d.width<a.width||d.height<a.height||f||p)&&i.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:m+(f?h[0]*f-x:0),height:S+(p?h[1]*p-w:0)}})}),i}o(Hn,"handleExpandParent");function ys(e,t,n,r,i,s,a){let c=r?.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};let u=[],d=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=[];for(let p of e.values()){let m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}let S=Tn(p.nodeElement),x=m.measured.width!==S.width||m.measured.height!==S.height;if(!!(S.width&&S.height&&(x||!m.internals.handleBounds||p.force))){let E=p.nodeElement.getBoundingClientRect(),g=it(m.extent)?m.extent:s,{positionAbsolute:b}=m.internals;if(m.parentId&&m.extent==="parent"){let C=t.get(m.parentId);C&&(b=is(b,S,C))}else g&&(b=ot(b,g,S));let N={...m,measured:S,internals:{...m.internals,positionAbsolute:b,handleBounds:{source:Yi("source",p.nodeElement,E,h,m.id),target:Yi("target",p.nodeElement,E,h,m.id)}}};t.set(m.id,N),m.parentId&&Br(N,t,n,{nodeOrigin:i,zIndexMode:a}),l=!0,x&&(u.push({id:m.id,type:"dimensions",dimensions:S}),m.expandParent&&m.parentId&&f.push({id:m.id,parentId:m.parentId,rect:xt(N,i)}))}}if(f.length>0){let p=Hn(f,t,n,i);u.push(...p)}return{changes:u,updatedInternals:l}}o(ys,"updateNodeInternals");async function ws({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(ws,"panBy");function Qi(e,t,n,r,i,s){let a=i,c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(Qi,"addConnectionToLookup");function Vr(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:c=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:c},u=`${i}-${a}--${s}-${c}`,d=`${s}-${c}--${i}-${a}`;Qi("source",l,d,e,i,a),Qi("target",l,u,e,s,c),t.set(r.id,r)}}o(Vr,"updateConnectionLookup");function xs(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:xs(n,t):!1}o(xs,"isParentSelected");function Ji(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(Ji,"hasSelector");function kd(e,t,n,r,i){let s=new Map;for(let[a,c]of e)if((i?c.id===r:c.selected||c.id===r)&&(i||!c.parentId||!xs(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){let u=e.get(a);u&&s.set(a,{id:a,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return s}o(kd,"getDragItems");function yr({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,c]of t){let l=n.get(a)?.internals.userNode;l&&i.push({...l,position:c.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(yr,"getEventHandlerParams");function Ad({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=bt(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(Ad,"calculateSnapOffset");function bs({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,c=new Map,l=!1,u={x:0,y:0},d=null,h=!1,f=null,p=!1,m=!1,S=null;function x({noDragClassName:E,handleSelector:g,domNode:b,isSelectable:N,nodeId:C,nodeClickDistance:M=0}){f=ce(b);function D({x:V,y:$}){let{nodeLookup:y,nodeExtent:v,snapGrid:_,snapToGrid:I,nodeOrigin:T,onNodeDrag:R,onSelectionDrag:H,onError:L,updateNodePositions:F}=t();s={x:V,y:$};let G=!1,Y=c.size>1,K=Y&&v?br(wt(c)):null,j=Y&&I?Ad({dragItems:c,snapGrid:_,x:V,y:$}):null;for(let[q,O]of c){if(!y.has(q))continue;let W={x:V-O.distance.x,y:$-O.distance.y};I&&(W=j?{x:Math.round(W.x+j.x),y:Math.round(W.y+j.y)}:bt(W,_));let J=null;if(Y&&v&&!O.extent&&K){let{positionAbsolute:U}=O.internals,ee=U.x-K.x+v[0][0],te=U.x+O.measured.width-K.x2+v[1][0],oe=U.y-K.y+v[0][1],ue=U.y+O.measured.height-K.y2+v[1][1];J=[[ee,oe],[te,ue]]}let{position:Q,positionAbsolute:X}=Nr({nodeId:q,nextPosition:W,nodeLookup:y,nodeExtent:J||v,nodeOrigin:T,onError:L});G=G||O.position.x!==Q.x||O.position.y!==Q.y,O.position=Q,O.internals.positionAbsolute=X}if(m=m||G,!!G&&(F(c,!0),S&&(r||R||!C&&H))){let[q,O]=yr({nodeId:C,dragItems:c,nodeLookup:y});r?.(S,c,q,O),R?.(S,q,O),C||H?.(S,O)}}o(D,"updateNodes");async function A(){if(!d)return;let{transform:V,panBy:$,autoPanSpeed:y,autoPanOnNodeDrag:v}=t();if(!v){l=!1,cancelAnimationFrame(a);return}let[_,I]=Pn(u,d,y);(_!==0||I!==0)&&(s.x=(s.x??0)-_/V[2],s.y=(s.y??0)-I/V[2],await $({x:_,y:I})&&D(s)),a=requestAnimationFrame(A)}o(A,"autoPan");function B(V){let{nodeLookup:$,multiSelectionActive:y,nodesDraggable:v,transform:_,snapGrid:I,snapToGrid:T,selectNodesOnDrag:R,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:F}=t();h=!0;let G=!!C&&!y&&!$.get(C)?.selected;(!R||!N)&&!y&&C&&($.get(C)?.selected||F()),N&&R&&C&&e?.(C);let Y=jt(V.sourceEvent,{transform:_,snapGrid:I,snapToGrid:T,containerBounds:d});if(s=Y,c=kd($,v,Y,C,G),c.size>0&&(n||H||!C&&L)){let[K,j]=yr({nodeId:C,dragItems:c,nodeLookup:$});n?.(V.sourceEvent,c,K,j),H?.(V.sourceEvent,K,j),C||L?.(V.sourceEvent,j)}}o(B,"startDrag");let z=Ht().clickDistance(M).on("start",V=>{let{domNode:$,nodeDragThreshold:y,transform:v,snapGrid:_,snapToGrid:I}=t();d=$?.getBoundingClientRect()||null,p=!1,m=!1,S=V.sourceEvent,y===0&&B(V),s=jt(V.sourceEvent,{transform:v,snapGrid:_,snapToGrid:I,containerBounds:d}),u=we(V.sourceEvent,d)}).on("drag",V=>{let{autoPanOnNodeDrag:$,transform:y,snapGrid:v,snapToGrid:_,nodeDragThreshold:I,nodeLookup:T}=t(),R=jt(V.sourceEvent,{transform:y,snapGrid:v,snapToGrid:_,containerBounds:d});if(S=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||C&&!T.has(C))&&(p=!0),!p){if(!l&&$&&h&&(l=!0,A()),!h){let H=we(V.sourceEvent,d),L=H.x-u.x,F=H.y-u.y;Math.sqrt(L*L+F*F)>I&&B(V)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&c&&h&&(u=we(V.sourceEvent,d),D(R))}}).on("end",V=>{if(!h||p){p&&c.size>0&&t().updateNodePositions(c,!1);return}if(l=!1,h=!1,cancelAnimationFrame(a),c.size>0){let{nodeLookup:$,updateNodePositions:y,onNodeDragStop:v,onSelectionDragStop:_}=t();if(m&&(y(c,!1),m=!1),i||v||!C&&_){let[I,T]=yr({nodeId:C,dragItems:c,nodeLookup:$,dragging:!1});i?.(V.sourceEvent,c,I,T),v?.(V.sourceEvent,I,T),C||_?.(V.sourceEvent,T)}}}).filter(V=>{let $=V.target;return!V.button&&(!E||!Ji($,`.${E}`,b))&&(!g||Ji($,g,b))});f.call(z)}o(x,"update");function w(){f?.on(".drag",null)}return o(w,"destroy"),{update:x,destroy:w}}o(bs,"XYDrag");function Dd(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())nn(i,xt(s))>0&&r.push(s);return r}o(Dd,"getNodesWithinDistance");var Td=250;function Rd(e,t,n,r){let i=[],s=1/0,a=Dd(e,n,t+Td);for(let c of a){let l=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(let u of l){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:h}=Ye(c,u,u.position,!0),f=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));f>t||(f<s?(i=[{...u,x:d,y:h}],s=f):f===s&&i.push({...u,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){let c=r.type==="source"?"target":"source";return i.find(l=>l.type===c)??i[0]}return i[0]}o(Rd,"getClosestHandle");function Ss(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let c=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?c?.find(u=>u.id===n):c?.[0])??null;return l&&s?{...l,...Ye(a,l,l.position,!0)}:l}o(Ss,"getHandle");function Es(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Es,"getHandleType");function Od(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(Od,"isConnectionValid");var vs=o(()=>!0,"alwaysValid");function zd(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:S,onConnectEnd:x,isValidConnection:w=vs,onReconnectEnd:E,updateConnection:g,getTransform:b,getFromHandle:N,autoPanSpeed:C,dragThreshold:M=1,handleDomNode:D}){let A=Tr(e.target),B=0,z,{x:V,y:$}=we(e),y=Es(s,D),v=c?.getBoundingClientRect(),_=!1;if(!v||!y)return;let I=Ss(i,y,r,l,t);if(!I)return;let T=we(e,v),R=!1,H=null,L=!1,F=null;function G(){if(!d||!v)return;let[Q,X]=Pn(T,v,C);f({x:Q,y:X}),B=requestAnimationFrame(G)}o(G,"autoPan");let Y={...I,nodeId:i,type:y,position:I.position},K=l.get(i),q={inProgress:!0,isValid:null,from:Ye(K,Y,Z.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:K,to:T,toHandle:null,toPosition:Fi[Y.position],toNode:null,pointer:T};function O(){_=!0,g(q),m?.(e,{nodeId:i,handleId:r,handleType:y})}o(O,"startConnection"),M===0&&O();function W(Q){if(!_){let{x:ue,y:Ie}=we(Q),Ce=ue-V,_e=Ie-$;if(!(Ce*Ce+_e*_e>M*M))return;O()}if(!N()||!Y){J(Q);return}let X=b();T=we(Q,v),z=Rd(St(T,X,!1,[1,1]),n,l,Y),R||(G(),R=!0);let U=Cs(Q,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:w,doc:A,lib:u,flowId:h,nodeLookup:l});F=U.handleDomNode,H=U.connection,L=Od(!!z,U.isValid);let ee=l.get(i),te=ee?Ye(ee,Y,Z.Left,!0):q.from,oe={...q,from:te,isValid:L,to:U.toHandle&&L?rt({x:U.toHandle.x,y:U.toHandle.y},X):T,toHandle:U.toHandle,toPosition:L&&U.toHandle?U.toHandle.position:Fi[Y.position],toNode:U.toHandle?l.get(U.toHandle.nodeId):null,pointer:T};g(oe),q=oe}o(W,"onPointerMove");function J(Q){if(!("touches"in Q&&Q.touches.length>0)){if(_){(z||F)&&H&&L&&S?.(H);let{inProgress:X,...U}=q,ee={...U,toPosition:q.toHandle?q.toPosition:null};x?.(Q,ee),s&&E?.(Q,ee)}p(),cancelAnimationFrame(B),R=!1,L=!1,H=null,F=null,A.removeEventListener("mousemove",W),A.removeEventListener("mouseup",J),A.removeEventListener("touchmove",W),A.removeEventListener("touchend",J)}}o(J,"onPointerUp"),A.addEventListener("mousemove",W),A.addEventListener("mouseup",J),A.addEventListener("touchmove",W),A.addEventListener("touchend",J)}o(zd,"onPointerDown");function Cs(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:c,flowId:l,isValidConnection:u=vs,nodeLookup:d}){let h=s==="target",f=t?a.querySelector(`.${c}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=we(e),S=a.elementFromPoint(p,m),x=S?.classList.contains(`${c}-flow__handle`)?S:f,w={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){let E=Es(void 0,x),g=x.getAttribute("data-nodeid"),b=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),C=x.classList.contains("connectableend");if(!g||!E)return w;let M={source:h?g:r,sourceHandle:h?b:i,target:h?r:g,targetHandle:h?i:b};w.connection=M;let A=N&&C&&(n===We.Strict?h&&E==="source"||!h&&E==="target":g!==r||b!==i);w.isValid=A&&u(M),w.toHandle=Ss(g,E,b,d,n,!0)}return w}o(Cs,"isValidHandle");var Bn={onPointerDown:zd,isValid:Cs};function _s({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=ce(e);function s({translateExtent:c,width:l,height:u,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:p=!1}){let m=o(g=>{if(g.sourceEvent.type!=="wheel"||!t)return;let b=n(),N=g.sourceEvent.ctrlKey&&Et()?10:1,C=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,M=b[2]*Math.pow(2,C*N);t.scaleTo(M)},"zoomHandler"),S=[0,0],x=o(g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(S=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},"panStartHandler"),w=o(g=>{let b=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;let N=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],C=[N[0]-S[0],N[1]-S[1]];S=N;let M=r()*Math.max(b[2],Math.log(b[2]))*(p?-1:1),D={x:b[0]-C[0]*M,y:b[1]-C[1]*M},A=[[0,0],[l,u]];t.setViewportConstrained({x:D.x,y:D.y,zoom:b[2]},A,c)},"panHandler"),E=Jt().on("start",x).on("zoom",h?w:null).on("zoom.wheel",f?m:null);i.call(E,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:fe}}o(_s,"XYMinimap");var Vn=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),wr=o(({x:e,y:t,zoom:n})=>et.translate(e,t).scale(n),"viewportToTransform"),Fe=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Ns=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),$d=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),xr=o((e,t=0,n=$d,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ms=o(e=>{let t=e.ctrlKey&&Et()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function Ld({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Fe(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&a){let x=fe(d),w=Ms(d),E=h*Math.pow(2,w);r.scaleTo(n,E,x,d);return}let f=d.deltaMode===1?20:1,p=i===ze.Vertical?0:d.deltaX*f,m=i===ze.Horizontal?0:d.deltaY*f;!Et()&&d.shiftKey&&i!==ze.Vertical&&(p=d.deltaY*f,m=0),r.translateBy(n,-(p/h)*s,-(m/h)*s,{internal:!0});let S=Vn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(d,S):(e.isPanScrolling=!0,c?.(d,S)),e.panScrollTimeout=setTimeout(()=>{u?.(d,S),e.isPanScrolling=!1},150)}}o(Ld,"createPanOnScrollHandler");function Hd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,c=Fe(r,e);if(r.ctrlKey&&s&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}o(Hd,"createZoomOnScrollHandler");function Bd({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Vn(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(Bd,"createPanZoomStartHandler");function Vd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Ns(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Vn(s.transform))}}o(Vd,"createPanZoomHandler");function Fd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Ns(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let c=Vn(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}o(Fd,"createPanZoomEndHandler");function Wd({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:h}){return f=>{let p=t||n,m=r&&f.ctrlKey,S=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Fe(f,`${d}-flow__node`)||Fe(f,`${d}-flow__edge`)||Fe(f,`${d}-flow__selection`)||Fe(f,`${d}-flow__nodesselection`)))return!0;if(!i&&!p&&!s&&!a&&!r||c||h&&!S||Fe(f,l)&&S||Fe(f,u)&&(!S||s&&S&&!t)||!r&&f.ctrlKey&&S)return!1;if(!r&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!s&&!m&&S||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;let x=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||S||e)&&x}}o(Wd,"createFilter");function Is({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=[[0,0],[d.width,d.height]],f=typeof ResizeObserver<"u"?new ResizeObserver($=>{let y=$[0];y?.contentRect&&(h=[[0,0],[y.contentRect.width,y.contentRect.height]])}):null;f?.observe(e);let p=Jt().extent(()=>h).scaleExtent([t,n]).translateExtent(r),m=ce(e).call(p);b({x:i.x,y:i.y,zoom:mt(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let S=m.on("wheel.zoom"),x=m.on("dblclick.zoom");p.wheelDelta(Ms);async function w($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).transform(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(w,"setTransform");function E({noWheelClassName:$,noPanClassName:y,onPaneContextMenu:v,userSelectionActive:_,panOnScroll:I,panOnDrag:T,panOnScrollMode:R,panOnScrollSpeed:H,preventScrolling:L,zoomOnPinch:F,zoomOnScroll:G,zoomOnDoubleClick:Y,panActivationKeyPressed:K=!1,zoomActivationKeyPressed:j,lib:q,onTransformChange:O,connectionInProgress:W,paneClickDistance:J,selectionOnDrag:Q}){_&&!u.isZoomingOrPanning&&p.on("zoom",null);let X=I&&!j&&!_;p.clickDistance(Q?1/0:!ye(J)||J<0?0:J);let U=X?Ld({zoomPanValues:u,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:R,panOnScrollSpeed:H,zoomOnPinch:F,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):Hd({noWheelClassName:$,preventScrolling:L,d3ZoomHandler:S});m.on("wheel.zoom",U,{passive:!1});let ee=Bd({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});p.on("start",ee);let te=Vd({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!v,onPanZoom:s,onTransformChange:O});p.on("zoom",te);let oe=Fd({zoomPanValues:u,panOnDrag:T,panOnScroll:I,onPaneContextMenu:v,onPanZoomEnd:c,onDraggingChange:l});p.on("end",oe);let ue=Wd({panActivationKeyPressed:K,zoomActivationKeyPressed:j,panOnDrag:T,zoomOnScroll:G,panOnScroll:I,zoomOnDoubleClick:Y,zoomOnPinch:F,userSelectionActive:_,noPanClassName:y,noWheelClassName:$,lib:q,connectionInProgress:W});p.filter(ue),Y?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}o(E,"update");function g(){p.on("zoom",null),f?.disconnect()}o(g,"destroy");async function b($,y,v){let _=wr($),I=p?.constrain()(_,y,v);return I&&await w(I),I}o(b,"setViewportConstrained");async function N($,y){let v=wr($);return await w(v,y),v}o(N,"setViewport");function C($){if(m){let y=wr($),v=m.property("__zoom");(v.k!==$.zoom||v.x!==$.x||v.y!==$.y)&&p?.transform(m,y,null,{sync:!0})}}o(C,"syncViewport");function M(){let $=m?Qt(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}o(M,"getViewport");async function D($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).scaleTo(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(D,"scaleTo");async function A($,y){return m?new Promise(v=>{p?.interpolate(y?.interpolate==="linear"?ln:ct).scaleBy(xr(m,y?.duration,y?.ease,()=>v(!0)),$)}):!1}o(A,"scaleBy");function B($){p?.scaleExtent($)}o(B,"setScaleExtent");function z($){p?.translateExtent($)}o(z,"setTranslateExtent");function V($){let y=!ye($)||$<0?0:$;p?.clickDistance(y)}return o(V,"setClickDistance"),{update:E,destroy:g,setViewport:N,setViewportConstrained:b,getViewport:M,scaleTo:D,scaleBy:A,setScaleExtent:B,setTranslateExtent:z,syncViewport:C,setClickDistance:V}}o(Is,"XYPanZoom");var Xe;(function(e){e.Line="line",e.Handle="handle"})(Xe||(Xe={}));function Yd({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,c=n-r,l=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(l[0]=l[0]*-1),c&&s&&(l[1]=l[1]*-1),l}o(Yd,"getResizeDirection");function ji(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(ji,"getControlDirection");function Be(e,t){return Math.max(0,t-e)}o(Be,"getLowerExtentClamp");function Ve(e,t){return Math.max(0,e-t)}o(Ve,"getUpperExtentClamp");function Nn(e,t,n){return Math.max(0,t-e,e-n)}o(Nn,"getSizeClamp");function es(e,t){return e?!t:t}o(es,"xor");function Xd(e,t,n,r,i,s,a,c){let{affectsX:l,affectsY:u}=t,{isHorizontal:d,isVertical:h}=t,f=d&&h,{xSnapped:p,ySnapped:m}=n,{minWidth:S,maxWidth:x,minHeight:w,maxHeight:E}=r,{x:g,y:b,width:N,height:C,aspectRatio:M}=e,D=Math.floor(d?p-e.pointerX:0),A=Math.floor(h?m-e.pointerY:0),B=N+(l?-D:D),z=C+(u?-A:A),V=-s[0]*N,$=-s[1]*C,y=Nn(B,S,x),v=Nn(z,w,E);if(a){let T=0,R=0;l&&D<0?T=Be(g+D+V,a[0][0]):!l&&D>0&&(T=Ve(g+B+V,a[1][0])),u&&A<0?R=Be(b+A+$,a[0][1]):!u&&A>0&&(R=Ve(b+z+$,a[1][1])),y=Math.max(y,T),v=Math.max(v,R)}if(c){let T=0,R=0;l&&D>0?T=Ve(g+D,c[0][0]):!l&&D<0&&(T=Be(g+B,c[1][0])),u&&A>0?R=Ve(b+A,c[0][1]):!u&&A<0&&(R=Be(b+z,c[1][1])),y=Math.max(y,T),v=Math.max(v,R)}if(i){if(d){let T=Nn(B/M,w,E)*M;if(y=Math.max(y,T),a){let R=0;!l&&!u||l&&!u&&f?R=Ve(b+$+B/M,a[1][1])*M:R=Be(b+$+(l?D:-D)/M,a[0][1])*M,y=Math.max(y,R)}if(c){let R=0;!l&&!u||l&&!u&&f?R=Be(b+B/M,c[1][1])*M:R=Ve(b+(l?D:-D)/M,c[0][1])*M,y=Math.max(y,R)}}if(h){let T=Nn(z*M,S,x)/M;if(v=Math.max(v,T),a){let R=0;!l&&!u||u&&!l&&f?R=Ve(g+z*M+V,a[1][0])/M:R=Be(g+(u?A:-A)*M+V,a[0][0])/M,v=Math.max(v,R)}if(c){let R=0;!l&&!u||u&&!l&&f?R=Be(g+z*M,c[1][0])/M:R=Ve(g+(u?A:-A)*M,c[0][0])/M,v=Math.max(v,R)}}}A=A+(A<0?v:-v),D=D+(D<0?y:-y),i&&(f?B>z*M?A=(es(l,u)?-D:D)/M:D=(es(l,u)?-A:A)*M:d?(A=D/M,u=l):(D=A*M,l=u));let _=l?g+D:g,I=u?b+A:b;return{width:N+(l?-D:D),height:C+(u?-A:A),x:s[0]*D*(l?-1:1)+_,y:s[1]*A*(u?-1:1)+I}}o(Xd,"getDimensionsAfterResize");var Ps={width:0,height:0,x:0,y:0},Zd={...Ps,pointerX:0,pointerY:0,aspectRatio:1};function Ud(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,c=n[0]*s,l=n[1]*a;return[[r-c,i-l],[r+s-c,i+a-l]]}o(Ud,"nodeToChildExtent");function ks({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=ce(e),a={controlDirection:ji("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:d,keepAspectRatio:h,resizeDirection:f,onResizeStart:p,onResize:m,onResizeEnd:S,shouldResize:x}){let w={...Ps},E={...Zd};a={boundaries:d,resizeDirection:f,keepAspectRatio:h,controlDirection:ji(u)};let g,b=null,N=[],C,M,D,A=Ht().on("start",B=>{let{nodeLookup:z,transform:V,snapGrid:$,snapToGrid:y,nodeOrigin:v,paneDomNode:_}=n();if(g=z.get(t),!g)return;b=_?.getBoundingClientRect()??null;let{xSnapped:I,ySnapped:T}=jt(B.sourceEvent,{transform:V,snapGrid:$,snapToGrid:y,containerBounds:b});w={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},E={...w,pointerX:I,pointerY:T,aspectRatio:w.width/w.height},C=void 0,M=it(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(C=z.get(g.parentId)),C&&g.extent==="parent"&&(M=[[0,0],[C.measured.width,C.measured.height]]),N=[],D=void 0;for(let[R,H]of z)if(H.parentId===t&&(N.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){let L=Ud(H,g,H.origin??v);D?D=[[Math.min(L[0][0],D[0][0]),Math.min(L[0][1],D[0][1])],[Math.max(L[1][0],D[1][0]),Math.max(L[1][1],D[1][1])]]:D=L}p?.(B,{...w})}).on("drag",B=>{let{transform:z,snapGrid:V,snapToGrid:$,nodeOrigin:y}=n(),v=jt(B.sourceEvent,{transform:z,snapGrid:V,snapToGrid:$,containerBounds:b}),_=[];if(!g)return;let{x:I,y:T,width:R,height:H}=w,L={},F=g.origin??y,{width:G,height:Y,x:K,y:j}=Xd(E,a.controlDirection,v,a.boundaries,a.keepAspectRatio,F,M,D),q=G!==R,O=Y!==H,W=K!==I&&q,J=j!==T&&O;if(!W&&!J&&!q&&!O)return;let Q={prevValues:{...w},startX:E.x,startY:E.y,childNodes:N.map(te=>({...te,position:{...te.position}}))};if((W||J||F[0]===1||F[1]===1)&&(L.x=W?K:w.x,L.y=J?j:w.y,w.x=L.x,w.y=L.y,N.length>0)){let te=K-I,oe=j-T;for(let ue of N)ue.position={x:ue.position.x-te+F[0]*(G-R),y:ue.position.y-oe+F[1]*(Y-H)},_.push(ue)}if((q||O)&&(L.width=q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?G:w.width,L.height=O&&(!a.resizeDirection||a.resizeDirection==="vertical")?Y:w.height,w.width=L.width,w.height=L.height),C&&g.expandParent){let te=F[0]*(L.width??0);L.x&&L.x<te&&(w.x=te,E.x=E.x-(L.x-te));let oe=F[1]*(L.height??0);L.y&&L.y<oe&&(w.y=oe,E.y=E.y-(L.y-oe))}let X=Yd({width:w.width,prevWidth:R,height:w.height,prevHeight:H,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),U={...w,direction:X};if(x?.(B,U)===!1){w=Q.prevValues,E.x=Q.startX,E.y=Q.startY,N.forEach((te,oe)=>{te.position=Q.childNodes[oe].position});return}m?.(B,U),r(L,_)}).on("end",B=>{S?.(B,{...w}),i?.({...w})});s.call(A)}o(c,"update");function l(){s.on(".drag",null)}return o(l,"destroy"),{update:c,destroy:l}}o(ks,"XYResizer");var k=Ke(di()),P=Ke(no());function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ae,"cc");var Rs=Ke(no(),1),Os=Ke(xl(),1);var As=o(e=>{let t,n=new Set,r=o((d,h)=>{let f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){let p=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,p))}},"setState"),i=o(()=>t,"getState"),l={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,l);return l},"createStoreImpl"),Ds=o(e=>e?As(e):As,"createStore");var{useDebugValue:qd}=Rs.default,{useSyncExternalStoreWithSelector:Gd}=Os.default,Kd=o(e=>e,"identity");function Fr(e,t=Kd,n){let r=Gd(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qd(r),r}o(Fr,"useStoreWithEqualityFn");var Ts=o((e,t)=>{let n=Ds(e),r=o((i,s=t)=>Fr(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),zs=o((e,t)=>e?Ts(e,t):Ts,"createWithEqualityFn");function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(re,"shallow$1");var Qd=Ke(wl());var Zn=(0,P.createContext)(null),Jd=Zn.Provider,la=ge.error001("react");function ne(e,t){let n=(0,P.useContext)(Zn);if(n===null)throw new Error(la);return Fr(n,e,t)}o(ne,"useStore");function ie(){let e=(0,P.useContext)(Zn);if(e===null)throw new Error(la);return(0,P.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(ie,"useStoreApi");var $s={display:"none"},jd={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ua="react-flow__node-desc",da="react-flow__edge-desc",ef="react-flow__aria-live",tf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),nf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function of({rfId:e}){let t=ne(tf);return(0,k.jsx)("div",{id:`${ef}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jd,children:t})}o(of,"AriaLiveMessage");function rf({rfId:e,disableKeyboardA11y:t}){let n=ne(nf);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{id:`${ua}-${e}`,style:$s,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,k.jsx)("div",{id:`${da}-${e}`,style:$s,children:n["edge.a11yDescription.default"]}),!t&&(0,k.jsx)(of,{rfId:e})]})}o(rf,"A11yDescriptions");var Ct=(0,P.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,k.jsx)("div",{className:ae(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});Ct.displayName="Panel";var Ls="https://reactflow.dev?utm_source=attribution";function sf({proOptions:e,position:t="bottom-right"}){return(0,P.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,k.jsx)(Ct,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Ls}`,children:(0,k.jsx)("a",{href:Ls,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(sf,"Attribution");var af=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Fn=o(e=>e.id,"selectId");function cf(e,t){return re(e.selectedNodes.map(Fn),t.selectedNodes.map(Fn))&&re(e.selectedEdges.map(Fn),t.selectedEdges.map(Fn))}o(cf,"areEqual$1");function lf({onSelectionChange:e}){let t=ie(),{selectedNodes:n,selectedEdges:r}=ne(af,cf);return(0,P.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(lf,"SelectionListenerInner");var uf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function df({onSelectionChange:e}){let t=ne(uf);return e||t?(0,k.jsx)(lf,{onSelectionChange:e}):null}o(df,"SelectionListener");var fa=[0,0],ff={x:0,y:0,zoom:1},hf=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Hs=[...hf,"rfId"],pf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Bs={translateExtent:yt,nodeOrigin:fa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function gf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:l}=ne(pf,re),u=ie();(0,P.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Bs,c()}),[]);let d=(0,P.useRef)(Bs);return(0,P.useEffect)(()=>{for(let h of Hs){let f=e[h],p=d.current[h];f!==p&&(typeof e[h]>"u"||(h==="nodes"?t(f):h==="edges"?n(f):h==="minZoom"?r(f):h==="maxZoom"?i(f):h==="translateExtent"?s(f):h==="nodeExtent"?a(f):h==="ariaLabelConfig"?u.setState({ariaLabelConfig:cs(f)}):h==="fitView"?u.setState({fitViewQueued:f}):h==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[h]:f})))}d.current=e},Hs.map(h=>e[h])),null}o(gf,"StoreUpdater");function Vs(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Vs,"getMediaQuery");function mf(e){let[t,n]=(0,P.useState)(e==="system"?null:e);return(0,P.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Vs(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Vs()?.matches?"dark":"light"}o(mf,"useColorModeClass");var Fs=typeof document<"u"?document:null;function rn(e=null,t={target:Fs,actInsideInputWithModifier:!0}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(!1),s=(0,P.useRef)(new Set([])),[a,c]=(0,P.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace(/\+/g,`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as H}from"./chunk-
|
|
1
|
+
import{i as H}from"./chunk-GTW3JPQQ.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as G}from"./chunk-EG45XFL3.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as J}from"./chunk-FOXLEMWC.js";import"./chunk-L27FKJTG.js";import{a as Q,b as W,c as Z,d as V,e as I,f as S}from"./chunk-7MM2SI65.js";import{a as F,e as K}from"./chunk-QQENKHRS.js";import{n as D}from"./chunk-F4ZN2DRL.js";import"./chunk-ZPQBVYNN.js";import{B,j as $,r as A,s as z}from"./chunk-ITS5LMYJ.js";import"./chunk-PDBW6GTJ.js";import{a as X}from"./chunk-A6TVTNKO.js";import{a as U,b as Y}from"./chunk-ADABTCDI.js";import{a as k,d as M}from"./chunk-5PEAXTYQ.js";var L=M(X(),1),g=M(U(),1);var t=M(Y(),1);var _=10,E=k(h=>{let e=(0,L.c)(7),{label:i,value:l}=h,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let a=l??"\u2014",n;e[2]!==a?(n=(0,t.jsx)("span",{className:"font-mono text-sm",children:a}),e[2]=a,e[3]=n):n=e[3];let s;return e[4]!==r||e[5]!==n?(s=(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,n]}),e[4]=r,e[5]=n,e[6]=s):s=e[6],s},"_"),ee=k(h=>{let e=(0,L.c)(38),{indexes:i,onSelect:l,selected:r}=h,a=B(),n;e[0]!==a?(n=a("name"),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==n?(s=(0,t.jsx)(I,{children:n}),e[2]=n,e[3]=s):s=e[3];let c;e[4]!==a?(c=a("table"),e[4]=a,e[5]=c):c=e[5];let o;e[6]!==c?(o=(0,t.jsx)(I,{children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==a?(d=a("dimensions"),e[8]=a,e[9]=d):d=e[9];let x;e[10]!==d?(x=(0,t.jsx)(I,{children:d}),e[10]=d,e[11]=x):x=e[11];let m;e[12]!==a?(m=a("metric"),e[12]=a,e[13]=m):m=e[13];let p;e[14]!==m?(p=(0,t.jsx)(I,{children:m}),e[14]=m,e[15]=p):p=e[15];let u;e[16]!==a?(u=a("vectors"),e[16]=a,e[17]=u):u=e[17];let v;e[18]!==u?(v=(0,t.jsx)(I,{children:u}),e[18]=u,e[19]=v):v=e[19];let C;e[20]!==v||e[21]!==s||e[22]!==o||e[23]!==x||e[24]!==p?(C=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[s,o,x,p,v]})}),e[20]=v,e[21]=s,e[22]=o,e[23]=x,e[24]=p,e[25]=C):C=e[25];let y;if(e[26]!==i||e[27]!==l||e[28]!==r){let q;e[30]!==l||e[31]!==r?(q=k(w=>(0,t.jsxs)(V,{className:w.name===r?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":w.name,"data-testid":`vector-row-${w.name}`,onClick:l,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:w.name}),(0,t.jsx)(S,{className:"font-mono text-xs",children:w.table}),(0,t.jsx)(S,{className:"tabular-nums",children:w.dimensions??"\u2014"}),(0,t.jsx)(S,{children:w.metric??"\u2014"}),(0,t.jsx)(S,{className:"tabular-nums",children:w.vectorsCount??"\u2014"})]},w.name),"q"),e[30]=l,e[31]=r,e[32]=q):q=e[32],y=i.map(q),e[26]=i,e[27]=l,e[28]=r,e[29]=y}else y=e[29];let N;e[33]!==y?(N=(0,t.jsx)(Z,{children:y}),e[33]=y,e[34]=N):N=e[34];let f;return e[35]!==C||e[36]!==N?(f=(0,t.jsx)(F,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-table",children:[C,N]})})}),e[35]=C,e[36]=N,e[37]=f):f=e[37],f},"X"),te=k(h=>{let e=(0,L.c)(27),{matches:i}=h,l=B();if(i.length===0){let u;e[0]!==l?(u=l("No matches."),e[0]=l,e[1]=u):u=e[1];let v;return e[2]!==u?(v=(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:u}),e[2]=u,e[3]=v):v=e[3],v}let r;e[4]!==l?(r=l("id"),e[4]=l,e[5]=r):r=e[5];let a;e[6]!==r?(a=(0,t.jsx)(I,{children:r}),e[6]=r,e[7]=a):a=e[7];let n;e[8]!==l?(n=l("score"),e[8]=l,e[9]=n):n=e[9];let s;e[10]!==n?(s=(0,t.jsx)(I,{children:n}),e[10]=n,e[11]=s):s=e[11];let c;e[12]!==l?(c=l("metadata"),e[12]=l,e[13]=c):c=e[13];let o;e[14]!==c?(o=(0,t.jsx)(I,{children:c}),e[14]=c,e[15]=o):o=e[15];let d;e[16]!==a||e[17]!==s||e[18]!==o?(d=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[a,s,o]})}),e[16]=a,e[17]=s,e[18]=o,e[19]=d):d=e[19];let x;e[20]!==i?(x=i.map(le),e[20]=i,e[21]=x):x=e[21];let m;e[22]!==x?(m=(0,t.jsx)(Z,{children:x}),e[22]=x,e[23]=m):m=e[23];let p;return e[24]!==d||e[25]!==m?(p=(0,t.jsx)(F,{className:"mt-3 overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-matches",children:[d,m]})})}),e[24]=d,e[25]=m,e[26]=p):p=e[26],p},"Y"),me=k(({loadIndexes:h,runQuery:e}={})=>{let i=D(),l=B(),[r,a]=(0,g.useState)(null),[n,s]=(0,g.useState)(null),[c,o]=(0,g.useState)(null),[d,x]=(0,g.useState)(""),[m,p]=(0,g.useState)(null),[u,v]=(0,g.useState)(null),[C,y]=(0,g.useState)(!1),N=(0,g.useRef)(0);(0,g.useEffect)(()=>{let b={cancelled:!1};return z((async()=>{try{let j=await(h??(()=>i.listVectorIndexes()))();b.cancelled||(a(j),s(null),o(T=>T??j[0]?.name??null))}catch(j){b.cancelled||(a(null),s($(j)))}})()),()=>{b.cancelled=!0}},[i,h]);let f=r?.find(b=>b.name===c)??null,q=k(b=>{N.current+=1,o(b.currentTarget.dataset.index??null),p(null),v(null),y(!1)},"q"),w=k(b=>{x(b.target.value)},"y"),O=k(async()=>{let b=d.trim();if(c===null||b==="")return;N.current+=1;let j=N.current;y(!0),v(null);try{let T=await(e??(R=>i.queryVectorIndex(R)))({name:c,text:b,topK:_});if(j!==N.current)return;p(T)}catch(T){if(j!==N.current)return;p(null),v($(T))}y(!1)},"H"),P=k(()=>{z(O())},"K");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:n}),r!==null&&r.length===0&&(0,t.jsx)(J,{description:l("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:l("No vector indexes.")}),r!==null&&r.length>0&&(0,t.jsx)(ee,{indexes:r,onSelect:q,selected:c}),f!==null&&(0,t.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(E,{label:l("field"),value:f.field}),(0,t.jsx)(E,{label:l("dimensions"),value:f.dimensions}),(0,t.jsx)(E,{label:l("metric"),value:f.metric}),(0,t.jsx)(E,{label:l("vectors"),value:f.vectorsCount})]}),f.metadata!==void 0&&f.metadata.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[l("metadata"),": ",(0,t.jsx)("span",{className:"font-mono",children:f.metadata.join(", ")})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(H,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:w,placeholder:l("Search by similarity\u2026"),value:d}),(0,t.jsx)(G,{"data-testid":"vector-search",disabled:C||d.trim()==="",onClick:P,children:l(C?"Searching\u2026":"Search")})]}),u!==null&&(0,t.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:u}),m!==null&&(0,t.jsx)(te,{matches:m})]})]})},"ue");function le(h){return(0,t.jsxs)(V,{"data-testid":`vector-match-${h.id}`,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:h.id}),(0,t.jsx)(S,{className:"tabular-nums",children:h.score.toFixed(4)}),(0,t.jsx)(S,{className:"max-w-md truncate font-mono text-xs",children:h.metadata===void 0?"\u2014":A(h.metadata)})]},h.id)}k(le,"ee");export{me as VectorBrowser};
|