@duckcodeailabs/dql-cli 1.14.3-rc.1 → 1.14.5

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.
Files changed (121) hide show
  1. package/dist/args.d.ts +2 -0
  2. package/dist/args.d.ts.map +1 -1
  3. package/dist/args.js +12 -0
  4. package/dist/args.js.map +1 -1
  5. package/dist/ask-runtime/analytical-planner.d.ts +14 -0
  6. package/dist/ask-runtime/analytical-planner.d.ts.map +1 -0
  7. package/dist/ask-runtime/analytical-planner.js +197 -0
  8. package/dist/ask-runtime/analytical-planner.js.map +1 -0
  9. package/dist/ask-runtime/readiness.d.ts +36 -0
  10. package/dist/ask-runtime/readiness.d.ts.map +1 -0
  11. package/dist/ask-runtime/readiness.js +65 -0
  12. package/dist/ask-runtime/readiness.js.map +1 -0
  13. package/dist/assets/dql-notebook/assets/{AgentLogPage-Jbyb4so-.js → AgentLogPage-XonDlOVv.js} +1 -1
  14. package/dist/assets/dql-notebook/assets/{AiBuildDialog-Du07X1qO.js → AiBuildDialog-DwHVVFIS.js} +1 -1
  15. package/dist/assets/dql-notebook/assets/{AiBuildResult-xKtGthWv.js → AiBuildResult-BImB4Wej.js} +1 -1
  16. package/dist/assets/dql-notebook/assets/{AiSidePanel-CE_L04dK.js → AiSidePanel-D7fFBhgc.js} +1 -1
  17. package/dist/assets/dql-notebook/assets/{AnalyticsHome-CiUE10uF.js → AnalyticsHome-CHvGWG92.js} +1 -1
  18. package/dist/assets/dql-notebook/assets/{AppsView-DlNaTuwD.js → AppsView-DNhs0MyO.js} +4 -4
  19. package/dist/assets/dql-notebook/assets/{AskObservabilityPage-DracZPI9.js → AskObservabilityPage-1WYjAf8-.js} +1 -1
  20. package/dist/assets/dql-notebook/assets/AskTracePage-D6_RunIf.js +8 -0
  21. package/dist/assets/dql-notebook/assets/{BlockStudio-DQS5Hcq9.js → BlockStudio-DWMOCHy5.js} +1 -1
  22. package/dist/assets/dql-notebook/assets/{BusinessArtifactView-CqV4i9l_.js → BusinessArtifactView-guqlfQ0j.js} +1 -1
  23. package/dist/assets/dql-notebook/assets/{DbtFirstModelingPage-JKhB_Y2H.js → DbtFirstModelingPage-DE7ewjMK.js} +1 -1
  24. package/dist/assets/dql-notebook/assets/{GitPage-DjaNp0o3.js → GitPage-CM3cgHtf.js} +1 -1
  25. package/dist/assets/dql-notebook/assets/{GlobalAiRail-CsV3zlc8.js → GlobalAiRail-BWfeK8lb.js} +1 -1
  26. package/dist/assets/dql-notebook/assets/{GovernedContextPage-uXUHUOIJ.js → GovernedContextPage-2Ld4yIgE.js} +1 -1
  27. package/dist/assets/dql-notebook/assets/{HelpDocsPage-Hbh9IeYB.js → HelpDocsPage-BxBzoxBO.js} +1 -1
  28. package/dist/assets/dql-notebook/assets/{HomePage-CRRl-R_v.js → HomePage-D4ZjCFfB.js} +1 -1
  29. package/dist/assets/dql-notebook/assets/{LineageDAG-OMUP2sbl.js → LineageDAG-DLdogZMo.js} +1 -1
  30. package/dist/assets/dql-notebook/assets/{LineageDetailView-C964BLuV.js → LineageDetailView-CqPB_tFP.js} +1 -1
  31. package/dist/assets/dql-notebook/assets/{LineageDrawer-CzY0nfpD.js → LineageDrawer-LZyR3zHf.js} +1 -1
  32. package/dist/assets/dql-notebook/assets/{LineagePathBreadcrumb-0Gi-Fm1B.js → LineagePathBreadcrumb-BZ7EcIxp.js} +1 -1
  33. package/dist/assets/dql-notebook/assets/{MiniLineageGraph-wn0wLc9m.js → MiniLineageGraph-Be_kqIq2.js} +1 -1
  34. package/dist/assets/dql-notebook/assets/{NewBlockModal-kMAzk91d.js → NewBlockModal-C9MKCa6R.js} +1 -1
  35. package/dist/assets/dql-notebook/assets/{NewNotebookModal-D_cWd_6M.js → NewNotebookModal-ZxHbTU9u.js} +1 -1
  36. package/dist/assets/dql-notebook/assets/{NotebookEditor-Bax0lxaz.js → NotebookEditor-Bh39Vsg0.js} +1 -1
  37. package/dist/assets/dql-notebook/assets/{ReadinessPage-DEUIXQQY.js → ReadinessPage-jKOBKkED.js} +1 -1
  38. package/dist/assets/dql-notebook/assets/{SetupOnboarding-CyE-Ex41.js → SetupOnboarding-BRut9nLO.js} +1 -1
  39. package/dist/assets/dql-notebook/assets/{SkillsPage-QgvKGPxE.js → SkillsPage-D9msUOxY.js} +1 -1
  40. package/dist/assets/dql-notebook/assets/{TrustBadge-D5CGp0cu.js → TrustBadge-D1CGSj0Y.js} +1 -1
  41. package/dist/assets/dql-notebook/assets/UnifiedAgentRunPanel-BexNjqJd.js +88 -0
  42. package/dist/assets/dql-notebook/assets/{answer-to-notebook-tACdCsTV.js → answer-to-notebook-zHFOdR6E.js} +1 -1
  43. package/dist/assets/dql-notebook/assets/{arrow-left-CF6wxXU5.js → arrow-left-C1tZBhgf.js} +1 -1
  44. package/dist/assets/dql-notebook/assets/{arrow-right-C7G3M_S8.js → arrow-right-BP5vPPNo.js} +1 -1
  45. package/dist/assets/dql-notebook/assets/{book-open-text-DDBO8G7L.js → book-open-text-BD3-ATYI.js} +1 -1
  46. package/dist/assets/dql-notebook/assets/{chevron-left-DxajrX2v.js → chevron-left-3opVgscY.js} +1 -1
  47. package/dist/assets/dql-notebook/assets/{circle-x-HBvXjnT6.js → circle-x-Bg9-70KN.js} +1 -1
  48. package/dist/assets/dql-notebook/assets/{clock-3-CJIdsPLt.js → clock-3-DLV5puGW.js} +1 -1
  49. package/dist/assets/dql-notebook/assets/{external-link-WciAU8Bu.js → external-link-BjD8w9QU.js} +1 -1
  50. package/dist/assets/dql-notebook/assets/{grip-vertical-DVu7ok6x.js → grip-vertical-DqIc09oX.js} +1 -1
  51. package/dist/assets/dql-notebook/assets/{index-D3wnucQC.js → index-C9KfoqCR.js} +2 -2
  52. package/dist/assets/dql-notebook/assets/{link-2-C6uQx50X.js → link-2-5s0hUu6w.js} +1 -1
  53. package/dist/assets/dql-notebook/assets/{list-tree-DapsIuQB.js → list-tree-67yz_uCY.js} +1 -1
  54. package/dist/assets/dql-notebook/assets/{minimize-2-BlVoipnT.js → minimize-2-BJw5tlPC.js} +1 -1
  55. package/dist/assets/dql-notebook/assets/{panel-right-open-DcnKWxfx.js → panel-right-open-CyhTG-tw.js} +1 -1
  56. package/dist/assets/dql-notebook/assets/{play-CNuRuaAs.js → play-CsY8D5M2.js} +1 -1
  57. package/dist/assets/dql-notebook/assets/{rotate-ccw-B2p953Zh.js → rotate-ccw-RvwtBcw9.js} +1 -1
  58. package/dist/assets/dql-notebook/assets/{semantic-fields-2fWgkTJc.js → semantic-fields-EorgHwAj.js} +1 -1
  59. package/dist/assets/dql-notebook/assets/{sliders-horizontal-DwRTu1w4.js → sliders-horizontal-jQ_fUiYf.js} +1 -1
  60. package/dist/assets/dql-notebook/assets/{star-Cbaj4F3i.js → star-N_C8YvbB.js} +1 -1
  61. package/dist/assets/dql-notebook/assets/{style-NlN9F6JE.js → style-D6AlWDHX.js} +1 -1
  62. package/dist/assets/dql-notebook/assets/{triangle-alert-BPHvH1wA.js → triangle-alert-D1WefIrN.js} +1 -1
  63. package/dist/assets/dql-notebook/assets/{upload-DIqK0KE1.js → upload-CFJjpPL4.js} +1 -1
  64. package/dist/assets/dql-notebook/assets/{usePersistedAgentThreadId-DpQXOEDw.js → usePersistedAgentThreadId-B5pTglEr.js} +1 -1
  65. package/dist/assets/dql-notebook/assets/{user-round-DukNupB_.js → user-round-DL6DLw0m.js} +1 -1
  66. package/dist/assets/dql-notebook/assets/{wand-sparkles-CAwLX0b9.js → wand-sparkles-CNUjLDqT.js} +1 -1
  67. package/dist/assets/dql-notebook/assets/{workflow-bOT-NqdO.js → workflow-0NUwpoQ4.js} +1 -1
  68. package/dist/assets/dql-notebook/assets/{wrench-1m0_kcza.js → wrench-QNiznShi.js} +1 -1
  69. package/dist/assets/dql-notebook/assets/{x-fp82BETM.js → x-BhTl5gZs.js} +1 -1
  70. package/dist/assets/dql-notebook/index.html +1 -1
  71. package/dist/commands/agent-eval-cassette.d.ts.map +1 -1
  72. package/dist/commands/agent-eval-cassette.js +15 -0
  73. package/dist/commands/agent-eval-cassette.js.map +1 -1
  74. package/dist/commands/agent-shadow-report.d.ts +17 -0
  75. package/dist/commands/agent-shadow-report.d.ts.map +1 -0
  76. package/dist/commands/agent-shadow-report.js +149 -0
  77. package/dist/commands/agent-shadow-report.js.map +1 -0
  78. package/dist/commands/agent.d.ts.map +1 -1
  79. package/dist/commands/agent.js +6 -2
  80. package/dist/commands/agent.js.map +1 -1
  81. package/dist/commands/notebook.d.ts +2 -1
  82. package/dist/commands/notebook.d.ts.map +1 -1
  83. package/dist/commands/notebook.js +8 -1
  84. package/dist/commands/notebook.js.map +1 -1
  85. package/dist/index.js +3 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/llm/providers/ask-v2-analyst-prompt.d.ts +32 -0
  88. package/dist/llm/providers/ask-v2-analyst-prompt.d.ts.map +1 -0
  89. package/dist/llm/providers/ask-v2-analyst-prompt.js +136 -0
  90. package/dist/llm/providers/ask-v2-analyst-prompt.js.map +1 -0
  91. package/dist/llm/providers/dql-agent-provider.d.ts +77 -1
  92. package/dist/llm/providers/dql-agent-provider.d.ts.map +1 -1
  93. package/dist/llm/providers/dql-agent-provider.js +4851 -354
  94. package/dist/llm/providers/dql-agent-provider.js.map +1 -1
  95. package/dist/llm/types.d.ts +124 -2
  96. package/dist/llm/types.d.ts.map +1 -1
  97. package/dist/local-runtime.d.ts +352 -3
  98. package/dist/local-runtime.d.ts.map +1 -1
  99. package/dist/local-runtime.js +4916 -238
  100. package/dist/local-runtime.js.map +1 -1
  101. package/dist/metricflow.d.ts.map +1 -1
  102. package/dist/metricflow.js +87 -11
  103. package/dist/metricflow.js.map +1 -1
  104. package/dist/package.json +10 -10
  105. package/dist/providers/oauth/claude-oauth.d.ts +14 -0
  106. package/dist/providers/oauth/claude-oauth.d.ts.map +1 -1
  107. package/dist/providers/oauth/claude-oauth.js +32 -5
  108. package/dist/providers/oauth/claude-oauth.js.map +1 -1
  109. package/dist/research-lineage-program.d.ts +29 -0
  110. package/dist/research-lineage-program.d.ts.map +1 -0
  111. package/dist/research-lineage-program.js +389 -0
  112. package/dist/research-lineage-program.js.map +1 -0
  113. package/dist/retrieval-health.d.ts.map +1 -1
  114. package/dist/retrieval-health.js +5 -2
  115. package/dist/retrieval-health.js.map +1 -1
  116. package/dist/semantic-runtime.d.ts.map +1 -1
  117. package/dist/semantic-runtime.js +73 -2
  118. package/dist/semantic-runtime.js.map +1 -1
  119. package/package.json +10 -10
  120. package/dist/assets/dql-notebook/assets/AskTracePage-CSMoMw9a.js +0 -8
  121. package/dist/assets/dql-notebook/assets/UnifiedAgentRunPanel-BjsTE6yf.js +0 -89
@@ -1,4 +1,4 @@
1
- import{R as ca,r as D,j as P}from"./index-D3wnucQC.js";import{r as xo,g as ua}from"./react-CRB3T2We.js";function ie(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=ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var la={value:()=>{}};function Kt(){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 Tt(n)}function Tt(e){this._=e}function fa(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Tt.prototype=Kt.prototype={constructor:Tt,on:function(e,t){var n=this._,r=fa(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=da(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=fr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=fr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tt(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function da(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function fr(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=la,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Nn="http://www.w3.org/1999/xhtml";const dr={svg:"http://www.w3.org/2000/svg",xhtml:Nn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zt(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),dr.hasOwnProperty(t)?{space:dr[t],local:e}:e}function ha(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Nn&&t.documentElement.namespaceURI===Nn?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wo(e){var t=Zt(e);return(t.local?ga:ha)(t)}function pa(){}function Vn(e){return e==null?pa:function(){return this.querySelector(e)}}function ma(e){typeof e!="function"&&(e=Vn(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),c,l,d=0;d<s;++d)(c=i[d])&&(l=e.call(c,c.__data__,d,i))&&("__data__"in c&&(l.__data__=c.__data__),a[d]=l);return new ue(r,this._parents)}function ya(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xa(){return[]}function vo(e){return e==null?xa:function(){return this.querySelectorAll(e)}}function wa(e){return function(){return ya(e.apply(this,arguments))}}function va(e){typeof e=="function"?e=wa(e):e=vo(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),o.push(c));return new ue(r,o)}function bo(e){return function(){return this.matches(e)}}function _o(e){return function(t){return t.matches(e)}}var ba=Array.prototype.find;function _a(e){return function(){return ba.call(this.children,e)}}function Ea(){return this.firstElementChild}function Sa(e){return this.select(e==null?Ea:_a(typeof e=="function"?e:_o(e)))}var Na=Array.prototype.filter;function Ma(){return Array.from(this.children)}function Ca(e){return function(){return Na.call(this.children,e)}}function Ia(e){return this.selectAll(e==null?Ma:Ca(typeof e=="function"?e:_o(e)))}function ka(e){typeof e!="function"&&(e=bo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new ue(r,this._parents)}function Eo(e){return new Array(e.length)}function Aa(){return new ue(this._enter||this._groups.map(Eo),this._parents)}function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rt.prototype={constructor:Rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $a(e){return function(){return e}}function Pa(e,t,n,r,o,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Rt(e,i[s]);for(;s<c;++s)(a=t[s])&&(o[s]=a)}function Ta(e,t,n,r,o,i,s){var a,c,l=new Map,d=t.length,u=i.length,f=new Array(d),h;for(a=0;a<d;++a)(c=t[a])&&(f[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?o[a]=c:l.set(h,c));for(a=0;a<u;++a)h=s.call(e,i[a],a,i)+"",(c=l.get(h))?(r[a]=c,c.__data__=i[a],l.delete(h)):n[a]=new Rt(e,i[a]);for(a=0;a<d;++a)(c=t[a])&&l.get(f[a])===c&&(o[a]=c)}function za(e){return e.__data__}function Da(e,t){if(!arguments.length)return Array.from(this,za);var n=t?Ta:Pa,r=this._parents,o=this._groups;typeof e!="function"&&(e=$a(e));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var d=r[l],u=o[l],f=u.length,h=La(e.call(d,d&&d.__data__,l,r)),g=h.length,y=a[l]=new Array(g),x=s[l]=new Array(g),m=c[l]=new Array(f);n(d,u,y,x,m,h,t);for(var b=0,p=0,w,N;b<g;++b)if(w=y[b]){for(b>=p&&(p=b+1);!(N=x[p])&&++p<g;);w._next=N||null}}return s=new ue(s,r),s._enter=a,s._exit=c,s}function La(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ha(){return new ue(this._exit||this._groups.map(Eo),this._parents)}function Ra(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Va(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var l=n[c],d=r[c],u=l.length,f=a[c]=new Array(u),h,g=0;g<u;++g)(h=l[g]||d[g])&&(f[g]=h);for(;c<o;++c)a[c]=n[c];return new ue(a,this._parents)}function Ba(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Fa(e){e||(e=Oa);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),l,d=0;d<a;++d)(l=s[d])&&(c[d]=l);c.sort(t)}return new ue(o,this._parents).order()}function Oa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ja(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xa(){return Array.from(this)}function Ya(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Wa(){let e=0;for(const t of this)++e;return e}function qa(){return!this.node()}function Ga(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function Ua(e){return function(){this.removeAttribute(e)}}function Ka(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Za(e,t){return function(){this.setAttribute(e,t)}}function Qa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ja(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tc(e,t){var n=Zt(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?Ka:Ua:typeof t=="function"?n.local?ec:Ja:n.local?Qa:Za)(n,t))}function So(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nc(e){return function(){this.style.removeProperty(e)}}function rc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oc(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ic(e,t,n){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?oc:rc)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||So(e).getComputedStyle(e,null).getPropertyValue(t)}function sc(e){return function(){delete this[e]}}function ac(e,t){return function(){this[e]=t}}function cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function uc(e,t){return arguments.length>1?this.each((t==null?sc:typeof t=="function"?cc:ac)(e,t)):this.node()[e]}function No(e){return e.trim().split(/^|\s+/)}function Bn(e){return e.classList||new Mo(e)}function Mo(e){this._node=e,this._names=No(e.getAttribute("class")||"")}Mo.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Co(e,t){for(var n=Bn(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Io(e,t){for(var n=Bn(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function lc(e){return function(){Co(this,e)}}function fc(e){return function(){Io(this,e)}}function dc(e,t){return function(){(t.apply(this,arguments)?Co:Io)(this,e)}}function hc(e,t){var n=No(e+"");if(arguments.length<2){for(var r=Bn(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?dc:t?lc:fc)(n,t))}function gc(){this.textContent=""}function pc(e){return function(){this.textContent=e}}function mc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yc(e){return arguments.length?this.each(e==null?gc:(typeof e=="function"?mc:pc)(e)):this.node().textContent}function xc(){this.innerHTML=""}function wc(e){return function(){this.innerHTML=e}}function vc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bc(e){return arguments.length?this.each(e==null?xc:(typeof e=="function"?vc:wc)(e)):this.node().innerHTML}function _c(){this.nextSibling&&this.parentNode.appendChild(this)}function Ec(){return this.each(_c)}function Sc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Sc)}function Mc(e){var t=typeof e=="function"?e:wo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Cc(){return null}function Ic(e,t){var n=typeof e=="function"?e:wo(e),r=t==null?Cc:typeof t=="function"?t:Vn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kc(){var e=this.parentNode;e&&e.removeChild(this)}function Ac(){return this.each(kc)}function $c(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tc(e){return this.select(e?Pc:$c)}function zc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Dc(e){return function(t){e.call(this,t,this.__data__)}}function Lc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Hc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function Rc(e,t,n){return function(){var r=this.__on,o,i=Dc(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Vc(e,t,n){var r=Lc(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,d;c<l;++c)for(o=0,d=a[c];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?Rc:Hc,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function ko(e,t,n){var r=So(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Bc(e,t){return function(){return ko(this,e,t)}}function Fc(e,t){return function(){return ko(this,e,t.apply(this,arguments))}}function Oc(e,t){return this.each((typeof t=="function"?Fc:Bc)(e,t))}function*jc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Ao=[null];function ue(e,t){this._groups=e,this._parents=t}function mt(){return new ue([[document.documentElement]],Ao)}function Xc(){return this}ue.prototype=mt.prototype={constructor:ue,select:ma,selectAll:va,selectChild:Sa,selectChildren:Ia,filter:ka,data:Da,enter:Aa,exit:Ha,join:Ra,merge:Va,selection:Xc,order:Ba,sort:Fa,call:ja,nodes:Xa,node:Ya,size:Wa,empty:qa,each:Ga,attr:tc,style:ic,property:uc,classed:hc,text:yc,html:bc,raise:Ec,lower:Nc,append:Mc,insert:Ic,remove:Ac,clone:Tc,datum:zc,on:Vc,dispatch:Oc,[Symbol.iterator]:jc};function ce(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],Ao)}function Yc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function le(e,t){if(e=Yc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Wc={passive:!1},at={capture:!0,passive:!1};function dn(e){e.stopImmediatePropagation()}function Oe(e){e.preventDefault(),e.stopImmediatePropagation()}function $o(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Oe,at);"onselectstart"in t?n.on("selectstart.drag",Oe,at):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Po(e,t){var n=e.document.documentElement,r=ce(e).on("dragstart.drag",null);t&&(r.on("click.drag",Oe,at),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const St=e=>()=>e;function Mn(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:c,dy:l,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:d}})}Mn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qc(e){return!e.ctrlKey&&!e.button}function Gc(){return this.parentNode}function Uc(e,t){return t??{x:e.x,y:e.y}}function Kc(){return navigator.maxTouchPoints||"ontouchstart"in this}function To(){var e=qc,t=Gc,n=Uc,r=Kc,o={},i=Kt("start","drag","end"),s=0,a,c,l,d,u=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",x).on("touchmove.drag",m,Wc).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,N){if(!(d||!e.call(this,w,N))){var _=p(this,t.call(this,w,N),w,N,"mouse");_&&(ce(w.view).on("mousemove.drag",g,at).on("mouseup.drag",y,at),$o(w.view),dn(w),l=!1,a=w.clientX,c=w.clientY,_("start",w))}}function g(w){if(Oe(w),!l){var N=w.clientX-a,_=w.clientY-c;l=N*N+_*_>u}o.mouse("drag",w)}function y(w){ce(w.view).on("mousemove.drag mouseup.drag",null),Po(w.view,l),Oe(w),o.mouse("end",w)}function x(w,N){if(e.call(this,w,N)){var _=w.changedTouches,M=t.call(this,w,N),T=_.length,z,B;for(z=0;z<T;++z)(B=p(this,M,w,N,_[z].identifier,_[z]))&&(dn(w),B("start",w,_[z]))}}function m(w){var N=w.changedTouches,_=N.length,M,T;for(M=0;M<_;++M)(T=o[N[M].identifier])&&(Oe(w),T("drag",w,N[M]))}function b(w){var N=w.changedTouches,_=N.length,M,T;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<_;++M)(T=o[N[M].identifier])&&(dn(w),T("end",w,N[M]))}function p(w,N,_,M,T,z){var B=i.copy(),I=le(z||_,N),$,V,v;if((v=n.call(w,new Mn("beforestart",{sourceEvent:_,target:f,identifier:T,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:B}),M))!=null)return $=v.x-I[0]||0,V=v.y-I[1]||0,function k(E,A,C){var S=I,L;switch(E){case"start":o[T]=k,L=s++;break;case"end":delete o[T],--s;case"drag":I=le(C||A,N),L=s;break}B.call(E,w,new Mn(E,{sourceEvent:A,subject:v,target:f,identifier:T,active:L,x:I[0]+$,y:I[1]+V,dx:I[0]-S[0],dy:I[1]-S[1],dispatch:B}),M)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:St(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:St(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:St(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:St(!!w),f):r},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,f):Math.sqrt(u)},f}function Fn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zo(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yt(){}var ct=.7,Vt=1/ct,je="\\s*([+-]?\\d+)\\s*",ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",me="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zc=/^#([0-9a-f]{3,8})$/,Qc=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),Jc=new RegExp(`^rgb\\(${me},${me},${me}\\)$`),eu=new RegExp(`^rgba\\(${je},${je},${je},${ut}\\)$`),tu=new RegExp(`^rgba\\(${me},${me},${me},${ut}\\)$`),nu=new RegExp(`^hsl\\(${ut},${me},${me}\\)$`),ru=new RegExp(`^hsla\\(${ut},${me},${me},${ut}\\)$`),hr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fn(yt,ze,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gr,formatHex:gr,formatHex8:ou,formatHsl:iu,formatRgb:pr,toString:pr});function gr(){return this.rgb().formatHex()}function ou(){return this.rgb().formatHex8()}function iu(){return Do(this).formatHsl()}function pr(){return this.rgb().formatRgb()}function ze(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mr(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Nt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Nt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qc.exec(e))?new ae(t[1],t[2],t[3],1):(t=Jc.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eu.exec(e))?Nt(t[1],t[2],t[3],t[4]):(t=tu.exec(e))?Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nu.exec(e))?wr(t[1],t[2]/100,t[3]/100,1):(t=ru.exec(e))?wr(t[1],t[2]/100,t[3]/100,t[4]):hr.hasOwnProperty(e)?mr(hr[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function mr(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function Nt(e,t,n,r){return r<=0&&(e=t=n=NaN),new ae(e,t,n,r)}function su(e){return e instanceof yt||(e=ze(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Cn(e,t,n,r){return arguments.length===1?su(e):new ae(e,t,n,r??1)}function ae(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fn(ae,Cn,zo(yt,{brighter(e){return e=e==null?Vt:Math.pow(Vt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Pe(this.r),Pe(this.g),Pe(this.b),Bt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yr,formatHex:yr,formatHex8:au,formatRgb:xr,toString:xr}));function yr(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function au(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e((isNaN(this.opacity)?1:this.opacity)*255)}`}function xr(){const e=Bt(this.opacity);return`${e===1?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${e===1?")":`, ${e})`}`}function Bt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return e=Pe(e),(e<16?"0":"")+e.toString(16)}function wr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,r)}function Do(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof yt||(e=ze(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new fe(s,a,c,e.opacity)}function cu(e,t,n,r){return arguments.length===1?Do(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fn(fe,cu,zo(yt,{brighter(e){return e=e==null?Vt:Math.pow(Vt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ae(hn(e>=240?e-240:e+120,o,r),hn(e,o,r),hn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new fe(vr(this.h),Mt(this.s),Mt(this.l),Bt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bt(this.opacity);return`${e===1?"hsl(":"hsla("}${vr(this.h)}, ${Mt(this.s)*100}%, ${Mt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vr(e){return e=(e||0)%360,e<0?e+360:e}function Mt(e){return Math.max(0,Math.min(1,e||0))}function hn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const On=e=>()=>e;function uu(e,t){return function(n){return e+n*t}}function lu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function fu(e){return(e=+e)==1?Lo:function(t,n){return n-t?lu(t,n,e):On(isNaN(t)?n:t)}}function Lo(e,t){var n=t-e;return n?uu(e,n):On(isNaN(e)?t:e)}const Ft=(function e(t){var n=fu(t);function r(o,i){var s=n((o=Cn(o)).r,(i=Cn(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),l=Lo(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=c(d),o.opacity=l(d),o+""}}return r.gamma=e,r})(1);function du(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function hu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gu(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=it(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function pu(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function mu(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=it(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var In=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gn=new RegExp(In.source,"g");function yu(e){return function(){return e}}function xu(e){return function(t){return e(t)+""}}function Ho(e,t){var n=In.lastIndex=gn.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=In.exec(e))&&(o=gn.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:pe(r,o)})),n=gn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?xu(c[0].x):yu(t):(t=c.length,function(l){for(var d=0,u;d<t;++d)a[(u=c[d]).i]=u.x(l);return a.join("")})}function it(e,t){var n=typeof t,r;return t==null||n==="boolean"?On(t):(n==="number"?pe:n==="string"?(r=ze(t))?(t=r,Ft):Ho:t instanceof ze?Ft:t instanceof Date?pu:hu(t)?du:Array.isArray(t)?gu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?mu:pe)(e,t)}var br=180/Math.PI,kn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ro(e,t,n,r,o,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*br,skewX:Math.atan(c)*br,scaleX:s,scaleY:a}}var Ct;function wu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kn:Ro(t.a,t.b,t.c,t.d,t.e,t.f)}function vu(e){return e==null||(Ct||(Ct=document.createElementNS("http://www.w3.org/2000/svg","g")),Ct.setAttribute("transform",e),!(e=Ct.transform.baseVal.consolidate()))?kn:(e=e.matrix,Ro(e.a,e.b,e.c,e.d,e.e,e.f))}function Vo(e,t,n,r){function o(l){return l.length?l.pop()+" ":""}function i(l,d,u,f,h,g){if(l!==u||d!==f){var y=h.push("translate(",null,t,null,n);g.push({i:y-4,x:pe(l,u)},{i:y-2,x:pe(d,f)})}else(u||f)&&h.push("translate("+u+t+f+n)}function s(l,d,u,f){l!==d?(l-d>180?d+=360:d-l>180&&(l+=360),f.push({i:u.push(o(u)+"rotate(",null,r)-2,x:pe(l,d)})):d&&u.push(o(u)+"rotate("+d+r)}function a(l,d,u,f){l!==d?f.push({i:u.push(o(u)+"skewX(",null,r)-2,x:pe(l,d)}):d&&u.push(o(u)+"skewX("+d+r)}function c(l,d,u,f,h,g){if(l!==u||d!==f){var y=h.push(o(h)+"scale(",null,",",null,")");g.push({i:y-4,x:pe(l,u)},{i:y-2,x:pe(d,f)})}else(u!==1||f!==1)&&h.push(o(h)+"scale("+u+","+f+")")}return function(l,d){var u=[],f=[];return l=e(l),d=e(d),i(l.translateX,l.translateY,d.translateX,d.translateY,u,f),s(l.rotate,d.rotate,u,f),a(l.skewX,d.skewX,u,f),c(l.scaleX,l.scaleY,d.scaleX,d.scaleY,u,f),l=d=null,function(h){for(var g=-1,y=f.length,x;++g<y;)u[(x=f[g]).i]=x.x(h);return u.join("")}}}var bu=Vo(wu,"px, ","px)","deg)"),_u=Vo(vu,", ",")",")"),Eu=1e-12;function _r(e){return((e=Math.exp(e))+1/e)/2}function Su(e){return((e=Math.exp(e))-1/e)/2}function Nu(e){return((e=Math.exp(2*e))-1)/(e+1)}const zt=(function e(t,n,r){function o(i,s){var a=i[0],c=i[1],l=i[2],d=s[0],u=s[1],f=s[2],h=d-a,g=u-c,y=h*h+g*g,x,m;if(y<Eu)m=Math.log(f/l)/t,x=function(M){return[a+M*h,c+M*g,l*Math.exp(t*M*m)]};else{var b=Math.sqrt(y),p=(f*f-l*l+r*y)/(2*l*n*b),w=(f*f-l*l-r*y)/(2*f*n*b),N=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(w*w+1)-w);m=(_-N)/t,x=function(M){var T=M*m,z=_r(N),B=l/(n*b)*(z*Nu(t*T+N)-Su(N));return[a+B*h,c+B*g,l*z/_r(t*T+N)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},o})(Math.SQRT2,2,4);var Ye=0,rt=0,tt=0,Bo=1e3,Ot,ot,jt=0,De=0,Qt=0,lt=typeof performance=="object"&&performance.now?performance:Date,Fo=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jn(){return De||(Fo(Mu),De=lt.now()+Qt)}function Mu(){De=0}function Xt(){this._call=this._time=this._next=null}Xt.prototype=Oo.prototype={constructor:Xt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jn():+n)+(t==null?0:+t),!this._next&&ot!==this&&(ot?ot._next=this:Ot=this,ot=this),this._call=e,this._time=n,An()},stop:function(){this._call&&(this._call=null,this._time=1/0,An())}};function Oo(e,t,n){var r=new Xt;return r.restart(e,t,n),r}function Cu(){jn(),++Ye;for(var e=Ot,t;e;)(t=De-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ye}function Er(){De=(jt=lt.now())+Qt,Ye=rt=0;try{Cu()}finally{Ye=0,ku(),De=0}}function Iu(){var e=lt.now(),t=e-jt;t>Bo&&(Qt-=t,jt=e)}function ku(){for(var e,t=Ot,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:Ot=n);ot=e,An(r)}function An(e){if(!Ye){rt&&(rt=clearTimeout(rt));var t=e-De;t>24?(e<1/0&&(rt=setTimeout(Er,e-lt.now()-Qt)),tt&&(tt=clearInterval(tt))):(tt||(jt=lt.now(),tt=setInterval(Iu,Bo)),Ye=1,Fo(Er))}}function Sr(e,t,n){var r=new Xt;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Au=Kt("start","end","cancel","interrupt"),$u=[],jo=0,Nr=1,$n=2,Dt=3,Mr=4,Pn=5,Lt=6;function Jt(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Pu(e,n,{name:t,index:r,group:o,on:Au,tween:$u,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:jo})}function Xn(e,t){var n=ge(e,t);if(n.state>jo)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=ge(e,t);if(n.state>Dt)throw new Error("too late; already running");return n}function ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Pu(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Oo(i,0,n.time);function i(l){n.state=Nr,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var d,u,f,h;if(n.state!==Nr)return c();for(d in r)if(h=r[d],h.name===n.name){if(h.state===Dt)return Sr(s);h.state===Mr?(h.state=Lt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=Lt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(Sr(function(){n.state===Dt&&(n.state=Mr,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=$n,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$n){for(n.state=Dt,o=new Array(f=n.tween.length),d=0,u=-1;d<f;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=h);o.length=u+1}}function a(l){for(var d=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Pn,1),u=-1,f=o.length;++u<f;)o[u].call(e,d);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Lt,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function Ht(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>$n&&r.state<Pn,r.state=Lt,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Tu(e){return this.each(function(){Ht(this,e)})}function zu(e,t){var n,r;return function(){var o=xe(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Du(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=xe(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function Lu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ge(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?zu:Du)(n,e,t))}function Yn(e,t,n){var r=e._id;return e.each(function(){var o=xe(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return ge(o,r).value[t]}}function Xo(e,t){var n;return(typeof t=="number"?pe:t instanceof ze?Ft:(n=ze(t))?(t=n,Ft):Ho)(e,t)}function Hu(e){return function(){this.removeAttribute(e)}}function Ru(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function Bu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function Fu(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function Ou(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function ju(e,t){var n=Zt(e),r=n==="transform"?_u:Xo;return this.attrTween(e,typeof t=="function"?(n.local?Ou:Fu)(n,r,Yn(this,"attr."+e,t)):t==null?(n.local?Ru:Hu)(n):(n.local?Bu:Vu)(n,r,t))}function Xu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Wu(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Yu(e,i)),n}return o._value=t,o}function qu(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Xu(e,i)),n}return o._value=t,o}function Gu(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=Zt(e);return this.tween(n,(r.local?Wu:qu)(r,t))}function Uu(e,t){return function(){Xn(this,e).delay=+t.apply(this,arguments)}}function Ku(e,t){return t=+t,function(){Xn(this,e).delay=t}}function Zu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Uu:Ku)(t,e)):ge(this.node(),t).delay}function Qu(e,t){return function(){xe(this,e).duration=+t.apply(this,arguments)}}function Ju(e,t){return t=+t,function(){xe(this,e).duration=t}}function el(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Qu:Ju)(t,e)):ge(this.node(),t).duration}function tl(e,t){if(typeof t!="function")throw new Error;return function(){xe(this,e).ease=t}}function nl(e){var t=this._id;return arguments.length?this.each(tl(t,e)):ge(this.node(),t).ease}function rl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xe(this,e).ease=n}}function ol(e){if(typeof e!="function")throw new Error;return this.each(rl(this._id,e))}function il(e){typeof e!="function"&&(e=bo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new _e(r,this._parents,this._name,this._id)}function sl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=t[a],l=n[a],d=c.length,u=s[a]=new Array(d),f,h=0;h<d;++h)(f=c[h]||l[h])&&(u[h]=f);for(;a<r;++a)s[a]=t[a];return new _e(s,this._parents,this._name,this._id)}function al(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function cl(e,t,n){var r,o,i=al(t)?Xn:xe;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function ul(e,t){var n=this._id;return arguments.length<2?ge(this.node(),n).on.on(e):this.each(cl(n,e,t))}function ll(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fl(){return this.on("end.remove",ll(this._id))}function dl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vn(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,l=i[s]=new Array(c),d,u,f=0;f<c;++f)(d=a[f])&&(u=e.call(d,d.__data__,f,a))&&("__data__"in d&&(u.__data__=d.__data__),l[f]=u,Jt(l[f],t,n,f,l,ge(d,n)));return new _e(i,this._parents,t,n)}function hl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vo(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],l=c.length,d,u=0;u<l;++u)if(d=c[u]){for(var f=e.call(d,d.__data__,u,c),h,g=ge(d,n),y=0,x=f.length;y<x;++y)(h=f[y])&&Jt(h,t,n,y,f,g);i.push(f),s.push(d)}return new _e(i,s,t,n)}var gl=mt.prototype.constructor;function pl(){return new gl(this._groups,this._parents)}function ml(e,t){var n,r,o;return function(){var i=Xe(this,e),s=(this.style.removeProperty(e),Xe(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Yo(e){return function(){this.style.removeProperty(e)}}function yl(e,t,n){var r,o=n+"",i;return function(){var s=Xe(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function xl(e,t,n){var r,o,i;return function(){var s=Xe(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Xe(this,e))),s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a))}}function wl(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var c=xe(this,e),l=c.on,d=c.value[i]==null?a||(a=Yo(t)):void 0;(l!==n||o!==d)&&(r=(n=l).copy()).on(s,o=d),c.on=r}}function vl(e,t,n){var r=(e+="")=="transform"?bu:Xo;return t==null?this.styleTween(e,ml(e,r)).on("end.style."+e,Yo(e)):typeof t=="function"?this.styleTween(e,xl(e,r,Yn(this,"style."+e,t))).each(wl(this._id,e)):this.styleTween(e,yl(e,r,t),n).on("end.style."+e,null)}function bl(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _l(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&bl(e,s,n)),r}return i._value=t,i}function El(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,_l(e,t,n??""))}function Sl(e){return function(){this.textContent=e}}function Nl(e){return function(){var t=e(this);this.textContent=t??""}}function Ml(e){return this.tween("text",typeof e=="function"?Nl(Yn(this,"text",e)):Sl(e==null?"":e+""))}function Cl(e){return function(t){this.textContent=e.call(this,t)}}function Il(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Cl(o)),t}return r._value=e,r}function kl(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,Il(e))}function Al(){for(var e=this._name,t=this._id,n=Wo(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var d=ge(c,t);Jt(c,e,n,l,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new _e(r,this._parents,e,n)}function $l(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var l=xe(this,r),d=l.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),o===0&&i()})}var Pl=0;function _e(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Wo(){return++Pl}var ve=mt.prototype;_e.prototype={constructor:_e,select:dl,selectAll:hl,selectChild:ve.selectChild,selectChildren:ve.selectChildren,filter:il,merge:sl,selection:pl,transition:Al,call:ve.call,nodes:ve.nodes,node:ve.node,size:ve.size,empty:ve.empty,each:ve.each,on:ul,attr:ju,attrTween:Gu,style:vl,styleTween:El,text:Ml,textTween:kl,remove:fl,tween:Lu,delay:Zu,duration:el,ease:nl,easeVarying:ol,end:$l,[Symbol.iterator]:ve[Symbol.iterator]};function Tl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var zl={time:null,delay:0,duration:250,ease:Tl};function Dl(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ll(e){var t,n;e instanceof _e?(t=e._id,e=e._name):(t=Wo(),(n=zl).time=jn(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Jt(c,e,t,l,s,n||Dl(c,t));return new _e(r,this._parents,e,t)}mt.prototype.interrupt=Tu;mt.prototype.transition=Ll;const It=e=>()=>e;function Hl(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var en=new be(1,0,0);qo.prototype=be.prototype;function qo(e){for(;!e.__zoom;)if(!(e=e.parentNode))return en;return e.__zoom}function pn(e){e.stopImmediatePropagation()}function nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Rl(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vl(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Cr(){return this.__zoom||en}function Bl(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ol(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Go(){var e=Rl,t=Vl,n=Ol,r=Bl,o=Fl,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=zt,l=Kt("start","zoom","end"),d,u,f,h=500,g=150,y=0,x=10;function m(v){v.property("__zoom",Cr).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",B).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(v,k,E,A){var C=v.selection?v.selection():v;C.property("__zoom",Cr),v!==C?N(v,k,E,A):C.interrupt().each(function(){_(this,arguments).event(A).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(v,k,E,A){m.scaleTo(v,function(){var C=this.__zoom.k,S=typeof k=="function"?k.apply(this,arguments):k;return C*S},E,A)},m.scaleTo=function(v,k,E,A){m.transform(v,function(){var C=t.apply(this,arguments),S=this.__zoom,L=E==null?w(C):typeof E=="function"?E.apply(this,arguments):E,R=S.invert(L),H=typeof k=="function"?k.apply(this,arguments):k;return n(p(b(S,H),L,R),C,s)},E,A)},m.translateBy=function(v,k,E,A){m.transform(v,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,A)},m.translateTo=function(v,k,E,A,C){m.transform(v,function(){var S=t.apply(this,arguments),L=this.__zoom,R=A==null?w(S):typeof A=="function"?A.apply(this,arguments):A;return n(en.translate(R[0],R[1]).scale(L.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof E=="function"?-E.apply(this,arguments):-E),S,s)},A,C)};function b(v,k){return k=Math.max(i[0],Math.min(i[1],k)),k===v.k?v:new be(k,v.x,v.y)}function p(v,k,E){var A=k[0]-E[0]*v.k,C=k[1]-E[1]*v.k;return A===v.x&&C===v.y?v:new be(v.k,A,C)}function w(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function N(v,k,E,A){v.on("start.zoom",function(){_(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(A).end()}).tween("zoom",function(){var C=this,S=arguments,L=_(C,S).event(A),R=t.apply(C,S),H=E==null?w(R):typeof E=="function"?E.apply(C,S):E,O=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),j=C.__zoom,Y=typeof k=="function"?k.apply(C,S):k,U=c(j.invert(H).concat(O/j.k),Y.invert(H).concat(O/Y.k));return function(q){if(q===1)q=Y;else{var F=U(q),W=O/F[2];q=new be(W,H[0]-F[0]*W,H[1]-F[1]*W)}L.zoom(null,q)}})}function _(v,k,E){return!E&&v.__zooming||new M(v,k)}function M(v,k){this.that=v,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,k),this.taps=0}M.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,k){return this.mouse&&v!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var k=ce(this.that).datum();l.call(v,this.that,new Hl(v,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:l}),k)}};function T(v,...k){if(!e.apply(this,arguments))return;var E=_(this,k).event(v),A=this.__zoom,C=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),S=le(v);if(E.wheel)(E.mouse[0][0]!==S[0]||E.mouse[0][1]!==S[1])&&(E.mouse[1]=A.invert(E.mouse[0]=S)),clearTimeout(E.wheel);else{if(A.k===C)return;E.mouse=[S,A.invert(S)],Ht(this),E.start()}nt(v),E.wheel=setTimeout(L,g),E.zoom("mouse",n(p(b(A,C),E.mouse[0],E.mouse[1]),E.extent,s));function L(){E.wheel=null,E.end()}}function z(v,...k){if(f||!e.apply(this,arguments))return;var E=v.currentTarget,A=_(this,k,!0).event(v),C=ce(v.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",O,!0),S=le(v,E),L=v.clientX,R=v.clientY;$o(v.view),pn(v),A.mouse=[S,this.__zoom.invert(S)],Ht(this),A.start();function H(j){if(nt(j),!A.moved){var Y=j.clientX-L,U=j.clientY-R;A.moved=Y*Y+U*U>y}A.event(j).zoom("mouse",n(p(A.that.__zoom,A.mouse[0]=le(j,E),A.mouse[1]),A.extent,s))}function O(j){C.on("mousemove.zoom mouseup.zoom",null),Po(j.view,A.moved),nt(j),A.event(j).end()}}function B(v,...k){if(e.apply(this,arguments)){var E=this.__zoom,A=le(v.changedTouches?v.changedTouches[0]:v,this),C=E.invert(A),S=E.k*(v.shiftKey?.5:2),L=n(p(b(E,S),A,C),t.apply(this,k),s);nt(v),a>0?ce(this).transition().duration(a).call(N,L,A,v):ce(this).call(m.transform,L,A,v)}}function I(v,...k){if(e.apply(this,arguments)){var E=v.touches,A=E.length,C=_(this,k,v.changedTouches.length===A).event(v),S,L,R,H;for(pn(v),L=0;L<A;++L)R=E[L],H=le(R,this),H=[H,this.__zoom.invert(H),R.identifier],C.touch0?!C.touch1&&C.touch0[2]!==H[2]&&(C.touch1=H,C.taps=0):(C.touch0=H,S=!0,C.taps=1+!!d);d&&(d=clearTimeout(d)),S&&(C.taps<2&&(u=H[0],d=setTimeout(function(){d=null},h)),Ht(this),C.start())}}function $(v,...k){if(this.__zooming){var E=_(this,k).event(v),A=v.changedTouches,C=A.length,S,L,R,H;for(nt(v),S=0;S<C;++S)L=A[S],R=le(L,this),E.touch0&&E.touch0[2]===L.identifier?E.touch0[0]=R:E.touch1&&E.touch1[2]===L.identifier&&(E.touch1[0]=R);if(L=E.that.__zoom,E.touch1){var O=E.touch0[0],j=E.touch0[1],Y=E.touch1[0],U=E.touch1[1],q=(q=Y[0]-O[0])*q+(q=Y[1]-O[1])*q,F=(F=U[0]-j[0])*F+(F=U[1]-j[1])*F;L=b(L,Math.sqrt(q/F)),R=[(O[0]+Y[0])/2,(O[1]+Y[1])/2],H=[(j[0]+U[0])/2,(j[1]+U[1])/2]}else if(E.touch0)R=E.touch0[0],H=E.touch0[1];else return;E.zoom("touch",n(p(L,R,H),E.extent,s))}}function V(v,...k){if(this.__zooming){var E=_(this,k).event(v),A=v.changedTouches,C=A.length,S,L;for(pn(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),S=0;S<C;++S)L=A[S],E.touch0&&E.touch0[2]===L.identifier?delete E.touch0:E.touch1&&E.touch1[2]===L.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(L=le(L,this),Math.hypot(u[0]-L[0],u[1]-L[1])<x)){var R=ce(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return m.wheelDelta=function(v){return arguments.length?(r=typeof v=="function"?v:It(+v),m):r},m.filter=function(v){return arguments.length?(e=typeof v=="function"?v:It(!!v),m):e},m.touchable=function(v){return arguments.length?(o=typeof v=="function"?v:It(!!v),m):o},m.extent=function(v){return arguments.length?(t=typeof v=="function"?v:It([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):t},m.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],m):[i[0],i[1]]},m.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(a=+v,m):a},m.interpolate=function(v){return arguments.length?(c=v,m):c},m.on=function(){var v=l.on.apply(l,arguments);return v===l?m:v},m.clickDistance=function(v){return arguments.length?(y=(v=+v)*v,m):Math.sqrt(y)},m.tapDistance=function(v){return arguments.length?(x=+v,m):x},m}const ye={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ft=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uo=["Enter"," ","Escape"],Ko={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var We;(function(e){e.Strict="strict",e.Loose="loose"})(We||(We={}));var Te;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Te||(Te={}));var dt;(function(e){e.Partial="partial",e.Full="full"})(dt||(dt={}));const Zo={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ce;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ce||(Ce={}));var Yt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Yt||(Yt={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Ir={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Qo(e){return e===null?null:e?"valid":"invalid"}const Jo=e=>"id"in e&&"source"in e&&"target"in e,jl=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xt=(e,t=[0,0])=>{const{width:n,height:r}=Ee(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Xl=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Wn(o)?o:t.nodeLookup.get(o.id));const a=s?Wt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return tn(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nn(n)},wt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=tn(n,Wt(o)),r=!0)}),r?nn(n):{x:0,y:0,width:0,height:0}},qn=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...bt(t,[n,r,o]),width:t.width/o,height:t.height/o},c=[];for(const l of e.values()){const{measured:d,selectable:u=!0,hidden:f=!1}=l;if(s&&!u||f)continue;const h=d.width??l.width??l.initialWidth??null,g=d.height??l.height??l.initialHeight??null,y=ht(a,Ge(l)),x=(h??0)*(g??0),m=i&&y>0;(!l.internals.handleBounds||m||y>=x||l.dragging)&&c.push(l)}return c},Yl=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Wl(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function ql({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Wl(e,s),c=wt(a),l=Gn(c,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(l,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function ei({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let u=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",ye.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(u=[[c,l],[c+h,l+g]])}else a&&Ue(s.extent)&&(u=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const f=Ue(u)?Le(t,u,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",ye.error015())),{position:{x:f.x-c+(s.measured.width??0)*d[0],y:f.y-l+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function Gl({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),g=!h&&f.parentId&&s.find(y=>y.id===f.parentId);(h||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),d=Yl(s,c);for(const f of c)a.has(f.id)&&!d.find(g=>g.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const u=await o({nodes:s,edges:d});return typeof u=="boolean"?u?{edges:d,nodes:s}:{edges:[],nodes:[]}:u}const qe=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Le=(e={x:0,y:0},t,n)=>({x:qe(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:qe(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ti(e,t,n){const{width:r,height:o}=Ee(n),{x:i,y:s}=n.internals.positionAbsolute;return Le(e,[[i,s],[i+r,s+o]],t)}const kr=(e,t,n)=>e<t?qe(Math.abs(e-t),1,t)/t:e>n?-qe(Math.abs(e-n),1,t)/t:0,ni=(e,t,n=15,r=40)=>{const o=kr(e.x,r,t.width-r)*n,i=kr(e.y,r,t.height-r)*n;return[o,i]},tn=(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)}),Tn=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nn=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ge=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Wn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Wt=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Wn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},ri=(e,t)=>nn(tn(Tn(e),Tn(t))),ht=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ar=e=>de(e.width)&&de(e.height)&&de(e.x)&&de(e.y),de=e=>!isNaN(e)&&isFinite(e),Ul=(e,t)=>{},vt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bt=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?vt(a,s):a},qt=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Ve(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Kl(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ve(e,n),o=Ve(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Ve(e.top??e.y??0,n),o=Ve(e.bottom??e.y??0,n),i=Ve(e.left??e.x??0,t),s=Ve(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zl(e,t,n,r,o,i){const{x:s,y:a}=qt(e,[t,n,r]),{x:c,y:l}=qt({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-c,u=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(u)}}const Gn=(e,t,n,r,o,i)=>{const s=Kl(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),d=qe(l,r,o),u=e.x+e.width/2,f=e.y+e.height/2,h=t/2-u*d,g=n/2-f*d,y=Zl(e,h,g,d,t,n),x={left:Math.min(y.left-s.left,0),top:Math.min(y.top-s.top,0),right:Math.min(y.right-s.right,0),bottom:Math.min(y.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:g-x.top+x.bottom,zoom:d}},gt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ue(e){return e!=null&&e!=="parent"}function Ee(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function oi(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function ii(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function $r(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ql(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Jl(e){return{...Ko,...e||{}}}function st(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=he(e),a=bt({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:c,y:l}=n?vt(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const Un=e=>({width:e.offsetWidth,height:e.offsetHeight}),si=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},ef=["INPUT","SELECT","TEXTAREA"];function ai(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:ef.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ci=e=>"clientX"in e,he=(e,t)=>{var i,s;const n=ci(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Pr=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Un(s)}})};function ui({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+o*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+r*.125,d=Math.abs(c-e),u=Math.abs(l-t);return[c,l,d,u]}function kt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tr({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case X.Left:return[t-kt(t-r,i),n];case X.Right:return[t+kt(r-t,i),n];case X.Top:return[t,n-kt(n-o,i)];case X.Bottom:return[t,n+kt(o-n,i)]}}function li({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=Tr({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[l,d]=Tr({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[u,f,h,g]=ui({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:d});return[`M${e},${t} C${a},${c} ${l},${d} ${r},${o}`,u,f,h,g]}function fi({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function tf({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function nf({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=tn(Wt(e),Wt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return ht(s,nn(i))>0}const rf=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,of=(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)),sf=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||rf;let o;return Jo(e)?o={...e}:o={...e,id:r(e)},of(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function di({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=fi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const zr={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},af=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Dr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:o,offset:i,stepPosition:s}){const a=zr[t],c=zr[r],l={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},u=af({source:l,sourcePosition:t,target:d}),f=u.x!==0?"x":"y",h=u[f];let g=[],y,x;const m={x:0,y:0},b={x:0,y:0},[,,p,w]=fi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*c[f]===-1){f==="x"?(y=o.x??l.x+(d.x-l.x)*s,x=o.y??(l.y+d.y)/2):(y=o.x??(l.x+d.x)/2,x=o.y??l.y+(d.y-l.y)*s);const _=[{x:y,y:l.y},{x:y,y:d.y}],M=[{x:l.x,y:x},{x:d.x,y:x}];a[f]===h?g=f==="x"?_:M:g=f==="x"?M:_}else{const _=[{x:l.x,y:d.y}],M=[{x:d.x,y:l.y}];if(f==="x"?g=a.x===h?M:_:g=a.y===h?_:M,t===r){const $=Math.abs(e[f]-n[f]);if($<=i){const V=Math.min(i-1,i-$);a[f]===h?m[f]=(l[f]>e[f]?-1:1)*V:b[f]=(d[f]>n[f]?-1:1)*V}}if(t!==r){const $=f==="x"?"y":"x",V=a[f]===c[$],v=l[$]>d[$],k=l[$]<d[$];(a[f]===1&&(!V&&v||V&&k)||a[f]!==1&&(!V&&k||V&&v))&&(g=f==="x"?_:M)}const T={x:l.x+m.x,y:l.y+m.y},z={x:d.x+b.x,y:d.y+b.y},B=Math.max(Math.abs(T.x-g[0].x),Math.abs(z.x-g[0].x)),I=Math.max(Math.abs(T.y-g[0].y),Math.abs(z.y-g[0].y));B>=I?(y=(T.x+z.x)/2,x=g[0].y):(y=g[0].x,x=(T.y+z.y)/2)}return[[e,{x:l.x+m.x,y:l.y+m.y},...g,{x:d.x+b.x,y:d.y+b.y},n],y,x,p,w]}function uf(e,t,n,r){const o=Math.min(Dr(e,t)/2,Dr(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*l},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+o*c}Q ${i},${s} ${i+o*a},${s}`}function zn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:d=.5}){const[u,f,h,g,y]=cf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:d});return[u.reduce((m,b,p)=>{let w="";return p>0&&p<u.length-1?w=uf(u[p-1],b,u[p+1],s):w=`${p===0?"M":"L"}${b.x} ${b.y}`,m+=w,m},""),f,h,g,y]}function Lr(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function lf(e){var u;const{sourceNode:t,targetNode:n}=e;if(!Lr(t)||!Lr(n))return null;const r=t.internals.handleBounds||Hr(t.handles),o=n.internals.handleBounds||Hr(n.handles),i=Rr((r==null?void 0:r.source)??[],e.sourceHandle),s=Rr(e.connectionMode===We.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(u=e.onError)==null||u.call(e,"008",ye.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||X.Bottom,c=(s==null?void 0:s.position)||X.Top,l=He(t,i,a),d=He(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:c}}function Hr(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function He(e,t,n=X.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ee(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:o+s/2,y:i};case X.Right:return{x:o+s,y:i+a/2};case X.Bottom:return{x:o+s/2,y:i+a};case X.Left:return{x:o,y:i+a/2}}}function Rr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Dn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function ff(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const l=Dn(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const hi=1e3,df=10,Kn={nodeOrigin:[0,0],nodeExtent:ft,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hf={...Kn,checkEquality:!0};function Zn(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function gf(e,t,n){const r=Zn(Kn,n);for(const o of e.values())if(o.parentId)Jn(o,e,t,r);else{const i=xt(o,r.nodeOrigin),s=Ue(o.extent)?o.extent:r.nodeExtent,a=Le(i,s,Ee(o));o.internals.positionAbsolute=a}}function pf(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Qn(e){return e==="manual"}function Ln(e,t,n,r={}){var l,d;const o=Zn(hf,r),i={i:0},s=new Map(t),a=o!=null&&o.elevateNodesOnSelect&&!Qn(o.zIndexMode)?hi:0;let c=e.length>0;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(o.checkEquality&&u===(f==null?void 0:f.internals.userNode))t.set(u.id,f);else{const h=xt(u,o.nodeOrigin),g=Ue(u.extent)?u.extent:o.nodeExtent,y=Le(h,g,Ee(u));f={...o.defaults,...u,measured:{width:(l=u.measured)==null?void 0:l.width,height:(d=u.measured)==null?void 0:d.height},internals:{positionAbsolute:y,handleBounds:pf(u,f),z:gi(u,a,o.zIndexMode),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),u.parentId&&Jn(f,t,n,r,i)}return c}function mf(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Jn(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=Zn(Kn,r),l=e.parentId,d=t.get(l);if(!d){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mf(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*df),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const u=i&&!Qn(c)?hi:0,{x:f,y:h,z:g}=yf(e,d,s,a,u,c),{positionAbsolute:y}=e.internals,x=f!==y.x||h!==y.y;(x||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:h}:y,z:g}})}function gi(e,t,n){const r=de(e.zIndex)?e.zIndex:0;return Qn(n)?r:r+(e.selected?t:0)}function yf(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,c=Ee(e),l=xt(e,n),d=Ue(e.extent)?Le(l,e.extent,c):l;let u=Le({x:s+d.x,y:a+d.y},r,c);e.extent==="parent"&&(u=ti(u,c,t));const f=gi(e,o,i),h=t.internals.z??0;return{x:u.x,y:u.y,z:h>=f?h+1:f}}function er(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const c=t.get(a.parentId);if(!c)continue;const l=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??Ge(c),d=ri(l,a.rect);i.set(a.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:a,parent:c},l)=>{var p;const d=c.internals.positionAbsolute,u=Ee(c),f=c.origin??r,h=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,g=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,y=Math.max(u.width,Math.round(a.width)),x=Math.max(u.height,Math.round(a.height)),m=(y-u.width)*f[0],b=(x-u.height)*f[1];(h>0||g>0||m||b)&&(o.push({id:l,type:"position",position:{x:c.position.x-h+m,y:c.position.y-g+b}}),(p=n.get(l))==null||p.forEach(w=>{e.some(N=>N.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+g}})})),(u.width<a.width||u.height<a.height||h||g)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:y+(h?f[0]*h-m:0),height:x+(g?f[1]*g-b:0)}})}),o}function xf(e,t,n,r,o,i,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const l=[],d=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),c=!0;continue}const y=Un(h.nodeElement),x=g.measured.width!==y.width||g.measured.height!==y.height;if(!!(y.width&&y.height&&(x||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),p=Ue(g.extent)?g.extent:i;let{positionAbsolute:w}=g.internals;g.parentId&&g.extent==="parent"?w=ti(w,y,t.get(g.parentId)):p&&(w=Le(w,p,y));const N={...g,measured:y,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:Pr("source",h.nodeElement,b,u,g.id),target:Pr("target",h.nodeElement,b,u,g.id)}}};t.set(g.id,N),g.parentId&&Jn(N,t,n,{nodeOrigin:o,zIndexMode:s}),c=!0,x&&(l.push({id:g.id,type:"dimensions",dimensions:y}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:Ge(N,o)}))}}if(f.length>0){const h=er(f,t,n,o);l.push(...h)}return{changes:l,updatedInternals:c}}async function wf({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Vr(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),i){s=`${o}-${e}-${i}`;const l=r.get(s)||new Map;r.set(s,l.set(n,t))}}function pi(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,c={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},l=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;Vr("source",c,d,e,o,s),Vr("target",c,l,e,i,a),t.set(r.id,r)}}function mi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:mi(n,t):!1}function Br(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function vf(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!mi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function mn({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,c;const o=[];for(const[l,d]of t){const u=(s=n.get(l))==null?void 0:s.internals.userNode;u&&o.push({...u,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:o[0],o]}function bf({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=vt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function _f({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},d=null,u=!1,f=null,h=!1,g=!1,y=null;function x({noDragClassName:b,handleSelector:p,domNode:w,isSelectable:N,nodeId:_,nodeClickDistance:M=0}){f=ce(w);function T({x:$,y:V}){const{nodeLookup:v,nodeExtent:k,snapGrid:E,snapToGrid:A,nodeOrigin:C,onNodeDrag:S,onSelectionDrag:L,onError:R,updateNodePositions:H}=t();i={x:$,y:V};let O=!1;const j=a.size>1,Y=j&&k?Tn(wt(a)):null,U=j&&A?bf({dragItems:a,snapGrid:E,x:$,y:V}):null;for(const[q,F]of a){if(!v.has(q))continue;let W={x:$-F.distance.x,y:V-F.distance.y};A&&(W=U?{x:Math.round(W.x+U.x),y:Math.round(W.y+U.y)}:vt(W,E));let Q=null;if(j&&k&&!F.extent&&Y){const{positionAbsolute:G}=F.internals,te=G.x-Y.x+k[0][0],ne=G.x+F.measured.width-Y.x2+k[1][0],ee=G.y-Y.y+k[0][1],se=G.y+F.measured.height-Y.y2+k[1][1];Q=[[te,ee],[ne,se]]}const{position:Z,positionAbsolute:K}=ei({nodeId:q,nextPosition:W,nodeLookup:v,nodeExtent:Q||k,nodeOrigin:C,onError:R});O=O||F.position.x!==Z.x||F.position.y!==Z.y,F.position=Z,F.internals.positionAbsolute=K}if(g=g||O,!!O&&(H(a,!0),y&&(r||S||!_&&L))){const[q,F]=mn({nodeId:_,dragItems:a,nodeLookup:v});r==null||r(y,a,q,F),S==null||S(y,q,F),_||L==null||L(y,F)}}async function z(){if(!d)return;const{transform:$,panBy:V,autoPanSpeed:v,autoPanOnNodeDrag:k}=t();if(!k){c=!1,cancelAnimationFrame(s);return}const[E,A]=ni(l,d,v);(E!==0||A!==0)&&(i.x=(i.x??0)-E/$[2],i.y=(i.y??0)-A/$[2],await V({x:E,y:A})&&T(i)),s=requestAnimationFrame(z)}function B($){var j;const{nodeLookup:V,multiSelectionActive:v,nodesDraggable:k,transform:E,snapGrid:A,snapToGrid:C,selectNodesOnDrag:S,onNodeDragStart:L,onSelectionDragStart:R,unselectNodesAndEdges:H}=t();u=!0,(!S||!N)&&!v&&_&&((j=V.get(_))!=null&&j.selected||H()),N&&S&&_&&(e==null||e(_));const O=st($.sourceEvent,{transform:E,snapGrid:A,snapToGrid:C,containerBounds:d});if(i=O,a=vf(V,k,O,_),a.size>0&&(n||L||!_&&R)){const[Y,U]=mn({nodeId:_,dragItems:a,nodeLookup:V});n==null||n($.sourceEvent,a,Y,U),L==null||L($.sourceEvent,Y,U),_||R==null||R($.sourceEvent,U)}}const I=To().clickDistance(M).on("start",$=>{const{domNode:V,nodeDragThreshold:v,transform:k,snapGrid:E,snapToGrid:A}=t();d=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,g=!1,y=$.sourceEvent,v===0&&B($),i=st($.sourceEvent,{transform:k,snapGrid:E,snapToGrid:A,containerBounds:d}),l=he($.sourceEvent,d)}).on("drag",$=>{const{autoPanOnNodeDrag:V,transform:v,snapGrid:k,snapToGrid:E,nodeDragThreshold:A,nodeLookup:C}=t(),S=st($.sourceEvent,{transform:v,snapGrid:k,snapToGrid:E,containerBounds:d});if(y=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||_&&!C.has(_))&&(h=!0),!h){if(!c&&V&&u&&(c=!0,z()),!u){const L=he($.sourceEvent,d),R=L.x-l.x,H=L.y-l.y;Math.sqrt(R*R+H*H)>A&&B($)}(i.x!==S.xSnapped||i.y!==S.ySnapped)&&a&&u&&(l=he($.sourceEvent,d),T(S))}}).on("end",$=>{if(!(!u||h)&&(c=!1,u=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:v,onNodeDragStop:k,onSelectionDragStop:E}=t();if(g&&(v(a,!1),g=!1),o||k||!_&&E){const[A,C]=mn({nodeId:_,dragItems:a,nodeLookup:V,dragging:!1});o==null||o($.sourceEvent,a,A,C),k==null||k($.sourceEvent,A,C),_||E==null||E($.sourceEvent,C)}}}).filter($=>{const V=$.target;return!$.button&&(!b||!Br(V,`.${b}`,w))&&(!p||Br(V,p,w))});f.call(I)}function m(){f==null||f.on(".drag",null)}return{update:x,destroy:m}}function Ef(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ht(o,Ge(i))>0&&r.push(i);return r}const Sf=250;function Nf(e,t,n,r){var a,c;let o=[],i=1/0;const s=Ef(e,n,t+Sf);for(const l of s){const d=[...((a=l.internals.handleBounds)==null?void 0:a.source)??[],...((c=l.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of d){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:f,y:h}=He(l,u,u.position,!0),g=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));g>t||(g<i?(o=[{...u,x:f,y:h}],i=g):g===i&&o.push({...u,x:f,y:h}))}}if(!o.length)return null;if(o.length>1){const l=r.type==="source"?"target":"source";return o.find(d=>d.type===l)??o[0]}return o[0]}function yi(e,t,n,r,o,i=!1){var l,d,u;const s=r.get(e);if(!s)return null;const a=o==="strict"?(l=s.internals.handleBounds)==null?void 0:l[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((u=s.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return c&&i?{...c,...He(s,c,c.position,!0)}:c}function xi(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Mf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const wi=()=>!0;function Cf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:d,flowId:u,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:y,onConnectEnd:x,isValidConnection:m=wi,onReconnectEnd:b,updateConnection:p,getTransform:w,getFromHandle:N,autoPanSpeed:_,dragThreshold:M=1,handleDomNode:T}){const z=si(e.target);let B=0,I;const{x:$,y:V}=he(e),v=xi(i,T),k=a==null?void 0:a.getBoundingClientRect();let E=!1;if(!k||!v)return;const A=yi(o,v,r,c,t);if(!A)return;let C=he(e,k),S=!1,L=null,R=!1,H=null;function O(){if(!d||!k)return;const[Z,K]=ni(C,k,_);f({x:Z,y:K}),B=requestAnimationFrame(O)}const j={...A,nodeId:o,type:v,position:A.position},Y=c.get(o);let q={inProgress:!0,isValid:null,from:He(Y,j,X.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:Y,to:C,toHandle:null,toPosition:Ir[j.position],toNode:null,pointer:C};function F(){E=!0,p(q),g==null||g(e,{nodeId:o,handleId:r,handleType:v})}M===0&&F();function W(Z){if(!E){const{x:se,y:Se}=he(Z),we=se-$,ke=Se-V;if(!(we*we+ke*ke>M*M))return;F()}if(!N()||!j){Q(Z);return}const K=w();C=he(Z,k),I=Nf(bt(C,K,!1,[1,1]),n,c,j),S||(O(),S=!0);const G=vi(Z,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:z,lib:l,flowId:u,nodeLookup:c});H=G.handleDomNode,L=G.connection,R=Mf(!!I,G.isValid);const te=c.get(o),ne=te?He(te,j,X.Left,!0):q.from,ee={...q,from:ne,isValid:R,to:G.toHandle&&R?qt({x:G.toHandle.x,y:G.toHandle.y},K):C,toHandle:G.toHandle,toPosition:R&&G.toHandle?G.toHandle.position:Ir[j.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:C};p(ee),q=ee}function Q(Z){if(!("touches"in Z&&Z.touches.length>0)){if(E){(I||H)&&L&&R&&(y==null||y(L));const{inProgress:K,...G}=q,te={...G,toPosition:q.toHandle?q.toPosition:null};x==null||x(Z,te),i&&(b==null||b(Z,te))}h(),cancelAnimationFrame(B),S=!1,R=!1,L=null,H=null,z.removeEventListener("mousemove",W),z.removeEventListener("mouseup",Q),z.removeEventListener("touchmove",W),z.removeEventListener("touchend",Q)}}z.addEventListener("mousemove",W),z.addEventListener("mouseup",Q),z.addEventListener("touchmove",W),z.addEventListener("touchend",Q)}function vi(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=wi,nodeLookup:d}){const u=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:g}=he(e),y=s.elementFromPoint(h,g),x=y!=null&&y.classList.contains(`${a}-flow__handle`)?y:f,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const b=xi(void 0,x),p=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!p||!b)return m;const M={source:u?p:r,sourceHandle:u?w:o,target:u?r:p,targetHandle:u?o:w};m.connection=M;const z=N&&_&&(n===We.Strict?u&&b==="source"||!u&&b==="target":p!==r||w!==o);m.isValid=z&&l(M),m.toHandle=yi(p,b,w,d,n,!0)}return m}const Hn={onPointerDown:Cf,isValid:vi};function If({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=ce(e);function i({translateExtent:a,width:c,height:l,zoomStep:d=1,pannable:u=!0,zoomable:f=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=p.sourceEvent.ctrlKey&&gt()?10:1,_=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*d,M=w[2]*Math.pow(2,_*N);t.scaleTo(M)};let y=[0,0];const x=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(y=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const w=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const N=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],_=[N[0]-y[0],N[1]-y[1]];y=N;const M=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),T={x:w[0]-_[0]*M,y:w[1]-_[1]*M},z=[[0,0],[c,l]];t.setViewportConstrained({x:T.x,y:T.y,zoom:w[2]},z,a)},b=Go().on("start",x).on("zoom",u?m:null).on("zoom.wheel",f?g:null);o.call(b,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:le}}const rn=e=>({x:e.x,y:e.y,zoom:e.k}),yn=({x:e,y:t,zoom:n})=>en.translate(e,t).scale(n),Be=(e,t)=>e.target.closest(`.${t}`),bi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,xn=(e,t=0,n=kf,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},_i=e=>{const t=e.ctrlKey&&gt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Af({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return d=>{if(Be(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(d.ctrlKey&&s){const x=le(d),m=_i(d),b=u*Math.pow(2,m);r.scaleTo(n,b,x,d);return}const f=d.deltaMode===1?20:1;let h=o===Te.Vertical?0:d.deltaX*f,g=o===Te.Horizontal?0:d.deltaY*f;!gt()&&d.shiftKey&&o!==Te.Vertical&&(h=d.deltaY*f,g=0),r.translateBy(n,-(h/u)*i,-(g/u)*i,{internal:!0});const y=rn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,y),e.panScrollTimeout=setTimeout(()=>{l==null||l(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,y))}}function $f({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=Be(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function Pf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=rn(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function Tf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&bi(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,rn(i.transform)))}}function zf({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&bi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const c=rn(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,c)},n?150:0)}}}function Df({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:l,connectionInProgress:d}){return u=>{var x;const f=e||t,h=n&&u.ctrlKey,g=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(Be(u,`${l}-flow__node`)||Be(u,`${l}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!g||Be(u,a)&&g||Be(u,c)&&(!g||o&&g&&!e)||!n&&u.ctrlKey&&g)return!1;if(!n&&u.type==="touchstart"&&((x=u.touches)==null?void 0:x.length)>1)return u.preventDefault(),!1;if(!f&&!o&&!h&&g||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||g)&&y}}function Lf({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),u=Go().scaleExtent([t,n]).translateExtent(r),f=ce(e).call(u);b({x:o.x,y:o.y,zoom:qe(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const h=f.on("wheel.zoom"),g=f.on("dblclick.zoom");u.wheelDelta(_i);function y(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).transform(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function x({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:V,userSelectionActive:v,panOnScroll:k,panOnDrag:E,panOnScrollMode:A,panOnScrollSpeed:C,preventScrolling:S,zoomOnPinch:L,zoomOnScroll:R,zoomOnDoubleClick:H,zoomActivationKeyPressed:O,lib:j,onTransformChange:Y,connectionInProgress:U,paneClickDistance:q,selectionOnDrag:F}){v&&!l.isZoomingOrPanning&&m();const W=k&&!O&&!v;u.clickDistance(F?1/0:!de(q)||q<0?0:q);const Q=W?Af({zoomPanValues:l,noWheelClassName:I,d3Selection:f,d3Zoom:u,panOnScrollMode:A,panOnScrollSpeed:C,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):$f({noWheelClassName:I,preventScrolling:S,d3ZoomHandler:h});if(f.on("wheel.zoom",Q,{passive:!1}),!v){const K=Pf({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});u.on("start",K);const G=Tf({zoomPanValues:l,panOnDrag:E,onPaneContextMenu:!!V,onPanZoom:i,onTransformChange:Y});u.on("zoom",G);const te=zf({zoomPanValues:l,panOnDrag:E,panOnScroll:k,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:c});u.on("end",te)}const Z=Df({zoomActivationKeyPressed:O,panOnDrag:E,zoomOnScroll:R,panOnScroll:k,zoomOnDoubleClick:H,zoomOnPinch:L,userSelectionActive:v,noPanClassName:$,noWheelClassName:I,lib:j,connectionInProgress:U});u.filter(Z),H?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function m(){u.on("zoom",null)}async function b(I,$,V){const v=yn(I),k=u==null?void 0:u.constrain()(v,$,V);return k&&await y(k),new Promise(E=>E(k))}async function p(I,$){const V=yn(I);return await y(V,$),new Promise(v=>v(V))}function w(I){if(f){const $=yn(I),V=f.property("__zoom");(V.k!==I.zoom||V.x!==I.x||V.y!==I.y)&&(u==null||u.transform(f,$,null,{sync:!0}))}}function N(){const I=f?qo(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function _(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).scaleTo(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function M(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).scaleBy(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function T(I){u==null||u.scaleExtent(I)}function z(I){u==null||u.translateExtent(I)}function B(I){const $=!de(I)||I<0?0:I;u==null||u.clickDistance($)}return{update:x,destroy:m,setViewport:p,setViewportConstrained:b,getViewport:N,scaleTo:_,scaleBy:M,setScaleExtent:T,setTranslateExtent:z,syncViewport:w,setClickDistance:B}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function Hf({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,a=n-r,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&o&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Fr(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Ne(e,t){return Math.max(0,t-e)}function Me(e,t){return Math.max(0,e-t)}function At(e,t,n){return Math.max(0,t-e,e-n)}function Or(e,t){return e?!t:t}function Rf(e,t,n,r,o,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:d,isVertical:u}=t,f=d&&u,{xSnapped:h,ySnapped:g}=n,{minWidth:y,maxWidth:x,minHeight:m,maxHeight:b}=r,{x:p,y:w,width:N,height:_,aspectRatio:M}=e;let T=Math.floor(d?h-e.pointerX:0),z=Math.floor(u?g-e.pointerY:0);const B=N+(c?-T:T),I=_+(l?-z:z),$=-i[0]*N,V=-i[1]*_;let v=At(B,y,x),k=At(I,m,b);if(s){let C=0,S=0;c&&T<0?C=Ne(p+T+$,s[0][0]):!c&&T>0&&(C=Me(p+B+$,s[1][0])),l&&z<0?S=Ne(w+z+V,s[0][1]):!l&&z>0&&(S=Me(w+I+V,s[1][1])),v=Math.max(v,C),k=Math.max(k,S)}if(a){let C=0,S=0;c&&T>0?C=Me(p+T,a[0][0]):!c&&T<0&&(C=Ne(p+B,a[1][0])),l&&z>0?S=Me(w+z,a[0][1]):!l&&z<0&&(S=Ne(w+I,a[1][1])),v=Math.max(v,C),k=Math.max(k,S)}if(o){if(d){const C=At(B/M,m,b)*M;if(v=Math.max(v,C),s){let S=0;!c&&!l||c&&!l&&f?S=Me(w+V+B/M,s[1][1])*M:S=Ne(w+V+(c?T:-T)/M,s[0][1])*M,v=Math.max(v,S)}if(a){let S=0;!c&&!l||c&&!l&&f?S=Ne(w+B/M,a[1][1])*M:S=Me(w+(c?T:-T)/M,a[0][1])*M,v=Math.max(v,S)}}if(u){const C=At(I*M,y,x)/M;if(k=Math.max(k,C),s){let S=0;!c&&!l||l&&!c&&f?S=Me(p+I*M+$,s[1][0])/M:S=Ne(p+(l?z:-z)*M+$,s[0][0])/M,k=Math.max(k,S)}if(a){let S=0;!c&&!l||l&&!c&&f?S=Ne(p+I*M,a[1][0])/M:S=Me(p+(l?z:-z)*M,a[0][0])/M,k=Math.max(k,S)}}}z=z+(z<0?k:-k),T=T+(T<0?v:-v),o&&(f?B>I*M?z=(Or(c,l)?-T:T)/M:T=(Or(c,l)?-z:z)*M:d?(z=T/M,l=c):(T=z*M,c=l));const E=c?p+T:p,A=l?w+z:w;return{width:N+(c?-T:T),height:_+(l?-z:z),x:i[0]*T*(c?-1:1)+E,y:i[1]*z*(l?-1:1)+A}}const Ei={width:0,height:0,x:0,y:0},Vf={...Ei,pointerX:0,pointerY:0,aspectRatio:1};function Bf(e){return[[0,0],[e.measured.width,e.measured.height]]}function Ff(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[r-a,o-c],[r+i-a,o+s-c]]}function Of({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=ce(e);let s={controlDirection:Fr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:d,keepAspectRatio:u,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:y,shouldResize:x}){let m={...Ei},b={...Vf};s={boundaries:d,resizeDirection:f,keepAspectRatio:u,controlDirection:Fr(l)};let p,w=null,N=[],_,M,T,z=!1;const B=To().on("start",I=>{const{nodeLookup:$,transform:V,snapGrid:v,snapToGrid:k,nodeOrigin:E,paneDomNode:A}=n();if(p=$.get(t),!p)return;w=(A==null?void 0:A.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:S}=st(I.sourceEvent,{transform:V,snapGrid:v,snapToGrid:k,containerBounds:w});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...m,pointerX:C,pointerY:S,aspectRatio:m.width/m.height},_=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(_=$.get(p.parentId),M=_&&p.extent==="parent"?Bf(_):void 0),N=[],T=void 0;for(const[L,R]of $)if(R.parentId===t&&(N.push({id:L,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const H=Ff(R,p,R.origin??E);T?T=[[Math.min(H[0][0],T[0][0]),Math.min(H[0][1],T[0][1])],[Math.max(H[1][0],T[1][0]),Math.max(H[1][1],T[1][1])]]:T=H}h==null||h(I,{...m})}).on("drag",I=>{const{transform:$,snapGrid:V,snapToGrid:v,nodeOrigin:k}=n(),E=st(I.sourceEvent,{transform:$,snapGrid:V,snapToGrid:v,containerBounds:w}),A=[];if(!p)return;const{x:C,y:S,width:L,height:R}=m,H={},O=p.origin??k,{width:j,height:Y,x:U,y:q}=Rf(b,s.controlDirection,E,s.boundaries,s.keepAspectRatio,O,M,T),F=j!==L,W=Y!==R,Q=U!==C&&F,Z=q!==S&&W;if(!Q&&!Z&&!F&&!W)return;if((Q||Z||O[0]===1||O[1]===1)&&(H.x=Q?U:m.x,H.y=Z?q:m.y,m.x=H.x,m.y=H.y,N.length>0)){const ne=U-C,ee=q-S;for(const se of N)se.position={x:se.position.x-ne+O[0]*(j-L),y:se.position.y-ee+O[1]*(Y-R)},A.push(se)}if((F||W)&&(H.width=F&&(!s.resizeDirection||s.resizeDirection==="horizontal")?j:m.width,H.height=W&&(!s.resizeDirection||s.resizeDirection==="vertical")?Y:m.height,m.width=H.width,m.height=H.height),_&&p.expandParent){const ne=O[0]*(H.width??0);H.x&&H.x<ne&&(m.x=ne,b.x=b.x-(H.x-ne));const ee=O[1]*(H.height??0);H.y&&H.y<ee&&(m.y=ee,b.y=b.y-(H.y-ee))}const K=Hf({width:m.width,prevWidth:L,height:m.height,prevHeight:R,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:K};(x==null?void 0:x(I,G))!==!1&&(z=!0,g==null||g(I,G),r(H,A))}).on("end",I=>{z&&(y==null||y(I,{...m}),o==null||o({...m}),z=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}var wn={exports:{}},vn={},bn={exports:{}},_n={};/**
1
+ import{R as ca,r as D,j as P}from"./index-C9KfoqCR.js";import{r as xo,g as ua}from"./react-CRB3T2We.js";function ie(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=ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var la={value:()=>{}};function Kt(){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 Tt(n)}function Tt(e){this._=e}function fa(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Tt.prototype=Kt.prototype={constructor:Tt,on:function(e,t){var n=this._,r=fa(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=da(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=fr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=fr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tt(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function da(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function fr(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=la,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Nn="http://www.w3.org/1999/xhtml";const dr={svg:"http://www.w3.org/2000/svg",xhtml:Nn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zt(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),dr.hasOwnProperty(t)?{space:dr[t],local:e}:e}function ha(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Nn&&t.documentElement.namespaceURI===Nn?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wo(e){var t=Zt(e);return(t.local?ga:ha)(t)}function pa(){}function Vn(e){return e==null?pa:function(){return this.querySelector(e)}}function ma(e){typeof e!="function"&&(e=Vn(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),c,l,d=0;d<s;++d)(c=i[d])&&(l=e.call(c,c.__data__,d,i))&&("__data__"in c&&(l.__data__=c.__data__),a[d]=l);return new ue(r,this._parents)}function ya(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xa(){return[]}function vo(e){return e==null?xa:function(){return this.querySelectorAll(e)}}function wa(e){return function(){return ya(e.apply(this,arguments))}}function va(e){typeof e=="function"?e=wa(e):e=vo(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),o.push(c));return new ue(r,o)}function bo(e){return function(){return this.matches(e)}}function _o(e){return function(t){return t.matches(e)}}var ba=Array.prototype.find;function _a(e){return function(){return ba.call(this.children,e)}}function Ea(){return this.firstElementChild}function Sa(e){return this.select(e==null?Ea:_a(typeof e=="function"?e:_o(e)))}var Na=Array.prototype.filter;function Ma(){return Array.from(this.children)}function Ca(e){return function(){return Na.call(this.children,e)}}function Ia(e){return this.selectAll(e==null?Ma:Ca(typeof e=="function"?e:_o(e)))}function ka(e){typeof e!="function"&&(e=bo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new ue(r,this._parents)}function Eo(e){return new Array(e.length)}function Aa(){return new ue(this._enter||this._groups.map(Eo),this._parents)}function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rt.prototype={constructor:Rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $a(e){return function(){return e}}function Pa(e,t,n,r,o,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Rt(e,i[s]);for(;s<c;++s)(a=t[s])&&(o[s]=a)}function Ta(e,t,n,r,o,i,s){var a,c,l=new Map,d=t.length,u=i.length,f=new Array(d),h;for(a=0;a<d;++a)(c=t[a])&&(f[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?o[a]=c:l.set(h,c));for(a=0;a<u;++a)h=s.call(e,i[a],a,i)+"",(c=l.get(h))?(r[a]=c,c.__data__=i[a],l.delete(h)):n[a]=new Rt(e,i[a]);for(a=0;a<d;++a)(c=t[a])&&l.get(f[a])===c&&(o[a]=c)}function za(e){return e.__data__}function Da(e,t){if(!arguments.length)return Array.from(this,za);var n=t?Ta:Pa,r=this._parents,o=this._groups;typeof e!="function"&&(e=$a(e));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var d=r[l],u=o[l],f=u.length,h=La(e.call(d,d&&d.__data__,l,r)),g=h.length,y=a[l]=new Array(g),x=s[l]=new Array(g),m=c[l]=new Array(f);n(d,u,y,x,m,h,t);for(var b=0,p=0,w,N;b<g;++b)if(w=y[b]){for(b>=p&&(p=b+1);!(N=x[p])&&++p<g;);w._next=N||null}}return s=new ue(s,r),s._enter=a,s._exit=c,s}function La(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ha(){return new ue(this._exit||this._groups.map(Eo),this._parents)}function Ra(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Va(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var l=n[c],d=r[c],u=l.length,f=a[c]=new Array(u),h,g=0;g<u;++g)(h=l[g]||d[g])&&(f[g]=h);for(;c<o;++c)a[c]=n[c];return new ue(a,this._parents)}function Ba(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Fa(e){e||(e=Oa);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),l,d=0;d<a;++d)(l=s[d])&&(c[d]=l);c.sort(t)}return new ue(o,this._parents).order()}function Oa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ja(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xa(){return Array.from(this)}function Ya(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Wa(){let e=0;for(const t of this)++e;return e}function qa(){return!this.node()}function Ga(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function Ua(e){return function(){this.removeAttribute(e)}}function Ka(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Za(e,t){return function(){this.setAttribute(e,t)}}function Qa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ja(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tc(e,t){var n=Zt(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?Ka:Ua:typeof t=="function"?n.local?ec:Ja:n.local?Qa:Za)(n,t))}function So(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nc(e){return function(){this.style.removeProperty(e)}}function rc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oc(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ic(e,t,n){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?oc:rc)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||So(e).getComputedStyle(e,null).getPropertyValue(t)}function sc(e){return function(){delete this[e]}}function ac(e,t){return function(){this[e]=t}}function cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function uc(e,t){return arguments.length>1?this.each((t==null?sc:typeof t=="function"?cc:ac)(e,t)):this.node()[e]}function No(e){return e.trim().split(/^|\s+/)}function Bn(e){return e.classList||new Mo(e)}function Mo(e){this._node=e,this._names=No(e.getAttribute("class")||"")}Mo.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Co(e,t){for(var n=Bn(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Io(e,t){for(var n=Bn(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function lc(e){return function(){Co(this,e)}}function fc(e){return function(){Io(this,e)}}function dc(e,t){return function(){(t.apply(this,arguments)?Co:Io)(this,e)}}function hc(e,t){var n=No(e+"");if(arguments.length<2){for(var r=Bn(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?dc:t?lc:fc)(n,t))}function gc(){this.textContent=""}function pc(e){return function(){this.textContent=e}}function mc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yc(e){return arguments.length?this.each(e==null?gc:(typeof e=="function"?mc:pc)(e)):this.node().textContent}function xc(){this.innerHTML=""}function wc(e){return function(){this.innerHTML=e}}function vc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bc(e){return arguments.length?this.each(e==null?xc:(typeof e=="function"?vc:wc)(e)):this.node().innerHTML}function _c(){this.nextSibling&&this.parentNode.appendChild(this)}function Ec(){return this.each(_c)}function Sc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Sc)}function Mc(e){var t=typeof e=="function"?e:wo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Cc(){return null}function Ic(e,t){var n=typeof e=="function"?e:wo(e),r=t==null?Cc:typeof t=="function"?t:Vn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kc(){var e=this.parentNode;e&&e.removeChild(this)}function Ac(){return this.each(kc)}function $c(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tc(e){return this.select(e?Pc:$c)}function zc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Dc(e){return function(t){e.call(this,t,this.__data__)}}function Lc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Hc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function Rc(e,t,n){return function(){var r=this.__on,o,i=Dc(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Vc(e,t,n){var r=Lc(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,d;c<l;++c)for(o=0,d=a[c];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?Rc:Hc,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function ko(e,t,n){var r=So(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Bc(e,t){return function(){return ko(this,e,t)}}function Fc(e,t){return function(){return ko(this,e,t.apply(this,arguments))}}function Oc(e,t){return this.each((typeof t=="function"?Fc:Bc)(e,t))}function*jc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Ao=[null];function ue(e,t){this._groups=e,this._parents=t}function mt(){return new ue([[document.documentElement]],Ao)}function Xc(){return this}ue.prototype=mt.prototype={constructor:ue,select:ma,selectAll:va,selectChild:Sa,selectChildren:Ia,filter:ka,data:Da,enter:Aa,exit:Ha,join:Ra,merge:Va,selection:Xc,order:Ba,sort:Fa,call:ja,nodes:Xa,node:Ya,size:Wa,empty:qa,each:Ga,attr:tc,style:ic,property:uc,classed:hc,text:yc,html:bc,raise:Ec,lower:Nc,append:Mc,insert:Ic,remove:Ac,clone:Tc,datum:zc,on:Vc,dispatch:Oc,[Symbol.iterator]:jc};function ce(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],Ao)}function Yc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function le(e,t){if(e=Yc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Wc={passive:!1},at={capture:!0,passive:!1};function dn(e){e.stopImmediatePropagation()}function Oe(e){e.preventDefault(),e.stopImmediatePropagation()}function $o(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Oe,at);"onselectstart"in t?n.on("selectstart.drag",Oe,at):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Po(e,t){var n=e.document.documentElement,r=ce(e).on("dragstart.drag",null);t&&(r.on("click.drag",Oe,at),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const St=e=>()=>e;function Mn(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:c,dy:l,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:d}})}Mn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qc(e){return!e.ctrlKey&&!e.button}function Gc(){return this.parentNode}function Uc(e,t){return t??{x:e.x,y:e.y}}function Kc(){return navigator.maxTouchPoints||"ontouchstart"in this}function To(){var e=qc,t=Gc,n=Uc,r=Kc,o={},i=Kt("start","drag","end"),s=0,a,c,l,d,u=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",x).on("touchmove.drag",m,Wc).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,N){if(!(d||!e.call(this,w,N))){var _=p(this,t.call(this,w,N),w,N,"mouse");_&&(ce(w.view).on("mousemove.drag",g,at).on("mouseup.drag",y,at),$o(w.view),dn(w),l=!1,a=w.clientX,c=w.clientY,_("start",w))}}function g(w){if(Oe(w),!l){var N=w.clientX-a,_=w.clientY-c;l=N*N+_*_>u}o.mouse("drag",w)}function y(w){ce(w.view).on("mousemove.drag mouseup.drag",null),Po(w.view,l),Oe(w),o.mouse("end",w)}function x(w,N){if(e.call(this,w,N)){var _=w.changedTouches,M=t.call(this,w,N),T=_.length,z,B;for(z=0;z<T;++z)(B=p(this,M,w,N,_[z].identifier,_[z]))&&(dn(w),B("start",w,_[z]))}}function m(w){var N=w.changedTouches,_=N.length,M,T;for(M=0;M<_;++M)(T=o[N[M].identifier])&&(Oe(w),T("drag",w,N[M]))}function b(w){var N=w.changedTouches,_=N.length,M,T;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<_;++M)(T=o[N[M].identifier])&&(dn(w),T("end",w,N[M]))}function p(w,N,_,M,T,z){var B=i.copy(),I=le(z||_,N),$,V,v;if((v=n.call(w,new Mn("beforestart",{sourceEvent:_,target:f,identifier:T,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:B}),M))!=null)return $=v.x-I[0]||0,V=v.y-I[1]||0,function k(E,A,C){var S=I,L;switch(E){case"start":o[T]=k,L=s++;break;case"end":delete o[T],--s;case"drag":I=le(C||A,N),L=s;break}B.call(E,w,new Mn(E,{sourceEvent:A,subject:v,target:f,identifier:T,active:L,x:I[0]+$,y:I[1]+V,dx:I[0]-S[0],dy:I[1]-S[1],dispatch:B}),M)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:St(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:St(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:St(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:St(!!w),f):r},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,f):Math.sqrt(u)},f}function Fn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zo(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yt(){}var ct=.7,Vt=1/ct,je="\\s*([+-]?\\d+)\\s*",ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",me="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zc=/^#([0-9a-f]{3,8})$/,Qc=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),Jc=new RegExp(`^rgb\\(${me},${me},${me}\\)$`),eu=new RegExp(`^rgba\\(${je},${je},${je},${ut}\\)$`),tu=new RegExp(`^rgba\\(${me},${me},${me},${ut}\\)$`),nu=new RegExp(`^hsl\\(${ut},${me},${me}\\)$`),ru=new RegExp(`^hsla\\(${ut},${me},${me},${ut}\\)$`),hr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fn(yt,ze,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gr,formatHex:gr,formatHex8:ou,formatHsl:iu,formatRgb:pr,toString:pr});function gr(){return this.rgb().formatHex()}function ou(){return this.rgb().formatHex8()}function iu(){return Do(this).formatHsl()}function pr(){return this.rgb().formatRgb()}function ze(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mr(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Nt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Nt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qc.exec(e))?new ae(t[1],t[2],t[3],1):(t=Jc.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eu.exec(e))?Nt(t[1],t[2],t[3],t[4]):(t=tu.exec(e))?Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nu.exec(e))?wr(t[1],t[2]/100,t[3]/100,1):(t=ru.exec(e))?wr(t[1],t[2]/100,t[3]/100,t[4]):hr.hasOwnProperty(e)?mr(hr[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function mr(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function Nt(e,t,n,r){return r<=0&&(e=t=n=NaN),new ae(e,t,n,r)}function su(e){return e instanceof yt||(e=ze(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Cn(e,t,n,r){return arguments.length===1?su(e):new ae(e,t,n,r??1)}function ae(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fn(ae,Cn,zo(yt,{brighter(e){return e=e==null?Vt:Math.pow(Vt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Pe(this.r),Pe(this.g),Pe(this.b),Bt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yr,formatHex:yr,formatHex8:au,formatRgb:xr,toString:xr}));function yr(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function au(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e((isNaN(this.opacity)?1:this.opacity)*255)}`}function xr(){const e=Bt(this.opacity);return`${e===1?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${e===1?")":`, ${e})`}`}function Bt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return e=Pe(e),(e<16?"0":"")+e.toString(16)}function wr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,r)}function Do(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof yt||(e=ze(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new fe(s,a,c,e.opacity)}function cu(e,t,n,r){return arguments.length===1?Do(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fn(fe,cu,zo(yt,{brighter(e){return e=e==null?Vt:Math.pow(Vt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ae(hn(e>=240?e-240:e+120,o,r),hn(e,o,r),hn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new fe(vr(this.h),Mt(this.s),Mt(this.l),Bt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bt(this.opacity);return`${e===1?"hsl(":"hsla("}${vr(this.h)}, ${Mt(this.s)*100}%, ${Mt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vr(e){return e=(e||0)%360,e<0?e+360:e}function Mt(e){return Math.max(0,Math.min(1,e||0))}function hn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const On=e=>()=>e;function uu(e,t){return function(n){return e+n*t}}function lu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function fu(e){return(e=+e)==1?Lo:function(t,n){return n-t?lu(t,n,e):On(isNaN(t)?n:t)}}function Lo(e,t){var n=t-e;return n?uu(e,n):On(isNaN(e)?t:e)}const Ft=(function e(t){var n=fu(t);function r(o,i){var s=n((o=Cn(o)).r,(i=Cn(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),l=Lo(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=c(d),o.opacity=l(d),o+""}}return r.gamma=e,r})(1);function du(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function hu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gu(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=it(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function pu(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function mu(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=it(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var In=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gn=new RegExp(In.source,"g");function yu(e){return function(){return e}}function xu(e){return function(t){return e(t)+""}}function Ho(e,t){var n=In.lastIndex=gn.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=In.exec(e))&&(o=gn.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:pe(r,o)})),n=gn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?xu(c[0].x):yu(t):(t=c.length,function(l){for(var d=0,u;d<t;++d)a[(u=c[d]).i]=u.x(l);return a.join("")})}function it(e,t){var n=typeof t,r;return t==null||n==="boolean"?On(t):(n==="number"?pe:n==="string"?(r=ze(t))?(t=r,Ft):Ho:t instanceof ze?Ft:t instanceof Date?pu:hu(t)?du:Array.isArray(t)?gu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?mu:pe)(e,t)}var br=180/Math.PI,kn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ro(e,t,n,r,o,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*br,skewX:Math.atan(c)*br,scaleX:s,scaleY:a}}var Ct;function wu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kn:Ro(t.a,t.b,t.c,t.d,t.e,t.f)}function vu(e){return e==null||(Ct||(Ct=document.createElementNS("http://www.w3.org/2000/svg","g")),Ct.setAttribute("transform",e),!(e=Ct.transform.baseVal.consolidate()))?kn:(e=e.matrix,Ro(e.a,e.b,e.c,e.d,e.e,e.f))}function Vo(e,t,n,r){function o(l){return l.length?l.pop()+" ":""}function i(l,d,u,f,h,g){if(l!==u||d!==f){var y=h.push("translate(",null,t,null,n);g.push({i:y-4,x:pe(l,u)},{i:y-2,x:pe(d,f)})}else(u||f)&&h.push("translate("+u+t+f+n)}function s(l,d,u,f){l!==d?(l-d>180?d+=360:d-l>180&&(l+=360),f.push({i:u.push(o(u)+"rotate(",null,r)-2,x:pe(l,d)})):d&&u.push(o(u)+"rotate("+d+r)}function a(l,d,u,f){l!==d?f.push({i:u.push(o(u)+"skewX(",null,r)-2,x:pe(l,d)}):d&&u.push(o(u)+"skewX("+d+r)}function c(l,d,u,f,h,g){if(l!==u||d!==f){var y=h.push(o(h)+"scale(",null,",",null,")");g.push({i:y-4,x:pe(l,u)},{i:y-2,x:pe(d,f)})}else(u!==1||f!==1)&&h.push(o(h)+"scale("+u+","+f+")")}return function(l,d){var u=[],f=[];return l=e(l),d=e(d),i(l.translateX,l.translateY,d.translateX,d.translateY,u,f),s(l.rotate,d.rotate,u,f),a(l.skewX,d.skewX,u,f),c(l.scaleX,l.scaleY,d.scaleX,d.scaleY,u,f),l=d=null,function(h){for(var g=-1,y=f.length,x;++g<y;)u[(x=f[g]).i]=x.x(h);return u.join("")}}}var bu=Vo(wu,"px, ","px)","deg)"),_u=Vo(vu,", ",")",")"),Eu=1e-12;function _r(e){return((e=Math.exp(e))+1/e)/2}function Su(e){return((e=Math.exp(e))-1/e)/2}function Nu(e){return((e=Math.exp(2*e))-1)/(e+1)}const zt=(function e(t,n,r){function o(i,s){var a=i[0],c=i[1],l=i[2],d=s[0],u=s[1],f=s[2],h=d-a,g=u-c,y=h*h+g*g,x,m;if(y<Eu)m=Math.log(f/l)/t,x=function(M){return[a+M*h,c+M*g,l*Math.exp(t*M*m)]};else{var b=Math.sqrt(y),p=(f*f-l*l+r*y)/(2*l*n*b),w=(f*f-l*l-r*y)/(2*f*n*b),N=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(w*w+1)-w);m=(_-N)/t,x=function(M){var T=M*m,z=_r(N),B=l/(n*b)*(z*Nu(t*T+N)-Su(N));return[a+B*h,c+B*g,l*z/_r(t*T+N)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},o})(Math.SQRT2,2,4);var Ye=0,rt=0,tt=0,Bo=1e3,Ot,ot,jt=0,De=0,Qt=0,lt=typeof performance=="object"&&performance.now?performance:Date,Fo=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jn(){return De||(Fo(Mu),De=lt.now()+Qt)}function Mu(){De=0}function Xt(){this._call=this._time=this._next=null}Xt.prototype=Oo.prototype={constructor:Xt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jn():+n)+(t==null?0:+t),!this._next&&ot!==this&&(ot?ot._next=this:Ot=this,ot=this),this._call=e,this._time=n,An()},stop:function(){this._call&&(this._call=null,this._time=1/0,An())}};function Oo(e,t,n){var r=new Xt;return r.restart(e,t,n),r}function Cu(){jn(),++Ye;for(var e=Ot,t;e;)(t=De-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ye}function Er(){De=(jt=lt.now())+Qt,Ye=rt=0;try{Cu()}finally{Ye=0,ku(),De=0}}function Iu(){var e=lt.now(),t=e-jt;t>Bo&&(Qt-=t,jt=e)}function ku(){for(var e,t=Ot,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:Ot=n);ot=e,An(r)}function An(e){if(!Ye){rt&&(rt=clearTimeout(rt));var t=e-De;t>24?(e<1/0&&(rt=setTimeout(Er,e-lt.now()-Qt)),tt&&(tt=clearInterval(tt))):(tt||(jt=lt.now(),tt=setInterval(Iu,Bo)),Ye=1,Fo(Er))}}function Sr(e,t,n){var r=new Xt;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Au=Kt("start","end","cancel","interrupt"),$u=[],jo=0,Nr=1,$n=2,Dt=3,Mr=4,Pn=5,Lt=6;function Jt(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Pu(e,n,{name:t,index:r,group:o,on:Au,tween:$u,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:jo})}function Xn(e,t){var n=ge(e,t);if(n.state>jo)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=ge(e,t);if(n.state>Dt)throw new Error("too late; already running");return n}function ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Pu(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Oo(i,0,n.time);function i(l){n.state=Nr,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var d,u,f,h;if(n.state!==Nr)return c();for(d in r)if(h=r[d],h.name===n.name){if(h.state===Dt)return Sr(s);h.state===Mr?(h.state=Lt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=Lt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(Sr(function(){n.state===Dt&&(n.state=Mr,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=$n,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$n){for(n.state=Dt,o=new Array(f=n.tween.length),d=0,u=-1;d<f;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=h);o.length=u+1}}function a(l){for(var d=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Pn,1),u=-1,f=o.length;++u<f;)o[u].call(e,d);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Lt,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function Ht(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>$n&&r.state<Pn,r.state=Lt,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Tu(e){return this.each(function(){Ht(this,e)})}function zu(e,t){var n,r;return function(){var o=xe(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Du(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=xe(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function Lu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ge(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?zu:Du)(n,e,t))}function Yn(e,t,n){var r=e._id;return e.each(function(){var o=xe(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return ge(o,r).value[t]}}function Xo(e,t){var n;return(typeof t=="number"?pe:t instanceof ze?Ft:(n=ze(t))?(t=n,Ft):Ho)(e,t)}function Hu(e){return function(){this.removeAttribute(e)}}function Ru(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function Bu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function Fu(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function Ou(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function ju(e,t){var n=Zt(e),r=n==="transform"?_u:Xo;return this.attrTween(e,typeof t=="function"?(n.local?Ou:Fu)(n,r,Yn(this,"attr."+e,t)):t==null?(n.local?Ru:Hu)(n):(n.local?Bu:Vu)(n,r,t))}function Xu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Wu(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Yu(e,i)),n}return o._value=t,o}function qu(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Xu(e,i)),n}return o._value=t,o}function Gu(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=Zt(e);return this.tween(n,(r.local?Wu:qu)(r,t))}function Uu(e,t){return function(){Xn(this,e).delay=+t.apply(this,arguments)}}function Ku(e,t){return t=+t,function(){Xn(this,e).delay=t}}function Zu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Uu:Ku)(t,e)):ge(this.node(),t).delay}function Qu(e,t){return function(){xe(this,e).duration=+t.apply(this,arguments)}}function Ju(e,t){return t=+t,function(){xe(this,e).duration=t}}function el(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Qu:Ju)(t,e)):ge(this.node(),t).duration}function tl(e,t){if(typeof t!="function")throw new Error;return function(){xe(this,e).ease=t}}function nl(e){var t=this._id;return arguments.length?this.each(tl(t,e)):ge(this.node(),t).ease}function rl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xe(this,e).ease=n}}function ol(e){if(typeof e!="function")throw new Error;return this.each(rl(this._id,e))}function il(e){typeof e!="function"&&(e=bo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new _e(r,this._parents,this._name,this._id)}function sl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=t[a],l=n[a],d=c.length,u=s[a]=new Array(d),f,h=0;h<d;++h)(f=c[h]||l[h])&&(u[h]=f);for(;a<r;++a)s[a]=t[a];return new _e(s,this._parents,this._name,this._id)}function al(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function cl(e,t,n){var r,o,i=al(t)?Xn:xe;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function ul(e,t){var n=this._id;return arguments.length<2?ge(this.node(),n).on.on(e):this.each(cl(n,e,t))}function ll(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fl(){return this.on("end.remove",ll(this._id))}function dl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vn(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,l=i[s]=new Array(c),d,u,f=0;f<c;++f)(d=a[f])&&(u=e.call(d,d.__data__,f,a))&&("__data__"in d&&(u.__data__=d.__data__),l[f]=u,Jt(l[f],t,n,f,l,ge(d,n)));return new _e(i,this._parents,t,n)}function hl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vo(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],l=c.length,d,u=0;u<l;++u)if(d=c[u]){for(var f=e.call(d,d.__data__,u,c),h,g=ge(d,n),y=0,x=f.length;y<x;++y)(h=f[y])&&Jt(h,t,n,y,f,g);i.push(f),s.push(d)}return new _e(i,s,t,n)}var gl=mt.prototype.constructor;function pl(){return new gl(this._groups,this._parents)}function ml(e,t){var n,r,o;return function(){var i=Xe(this,e),s=(this.style.removeProperty(e),Xe(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Yo(e){return function(){this.style.removeProperty(e)}}function yl(e,t,n){var r,o=n+"",i;return function(){var s=Xe(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function xl(e,t,n){var r,o,i;return function(){var s=Xe(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Xe(this,e))),s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a))}}function wl(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var c=xe(this,e),l=c.on,d=c.value[i]==null?a||(a=Yo(t)):void 0;(l!==n||o!==d)&&(r=(n=l).copy()).on(s,o=d),c.on=r}}function vl(e,t,n){var r=(e+="")=="transform"?bu:Xo;return t==null?this.styleTween(e,ml(e,r)).on("end.style."+e,Yo(e)):typeof t=="function"?this.styleTween(e,xl(e,r,Yn(this,"style."+e,t))).each(wl(this._id,e)):this.styleTween(e,yl(e,r,t),n).on("end.style."+e,null)}function bl(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _l(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&bl(e,s,n)),r}return i._value=t,i}function El(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,_l(e,t,n??""))}function Sl(e){return function(){this.textContent=e}}function Nl(e){return function(){var t=e(this);this.textContent=t??""}}function Ml(e){return this.tween("text",typeof e=="function"?Nl(Yn(this,"text",e)):Sl(e==null?"":e+""))}function Cl(e){return function(t){this.textContent=e.call(this,t)}}function Il(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Cl(o)),t}return r._value=e,r}function kl(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,Il(e))}function Al(){for(var e=this._name,t=this._id,n=Wo(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var d=ge(c,t);Jt(c,e,n,l,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new _e(r,this._parents,e,n)}function $l(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var l=xe(this,r),d=l.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),o===0&&i()})}var Pl=0;function _e(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Wo(){return++Pl}var ve=mt.prototype;_e.prototype={constructor:_e,select:dl,selectAll:hl,selectChild:ve.selectChild,selectChildren:ve.selectChildren,filter:il,merge:sl,selection:pl,transition:Al,call:ve.call,nodes:ve.nodes,node:ve.node,size:ve.size,empty:ve.empty,each:ve.each,on:ul,attr:ju,attrTween:Gu,style:vl,styleTween:El,text:Ml,textTween:kl,remove:fl,tween:Lu,delay:Zu,duration:el,ease:nl,easeVarying:ol,end:$l,[Symbol.iterator]:ve[Symbol.iterator]};function Tl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var zl={time:null,delay:0,duration:250,ease:Tl};function Dl(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ll(e){var t,n;e instanceof _e?(t=e._id,e=e._name):(t=Wo(),(n=zl).time=jn(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Jt(c,e,t,l,s,n||Dl(c,t));return new _e(r,this._parents,e,t)}mt.prototype.interrupt=Tu;mt.prototype.transition=Ll;const It=e=>()=>e;function Hl(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var en=new be(1,0,0);qo.prototype=be.prototype;function qo(e){for(;!e.__zoom;)if(!(e=e.parentNode))return en;return e.__zoom}function pn(e){e.stopImmediatePropagation()}function nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Rl(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vl(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Cr(){return this.__zoom||en}function Bl(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ol(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Go(){var e=Rl,t=Vl,n=Ol,r=Bl,o=Fl,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=zt,l=Kt("start","zoom","end"),d,u,f,h=500,g=150,y=0,x=10;function m(v){v.property("__zoom",Cr).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",B).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(v,k,E,A){var C=v.selection?v.selection():v;C.property("__zoom",Cr),v!==C?N(v,k,E,A):C.interrupt().each(function(){_(this,arguments).event(A).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(v,k,E,A){m.scaleTo(v,function(){var C=this.__zoom.k,S=typeof k=="function"?k.apply(this,arguments):k;return C*S},E,A)},m.scaleTo=function(v,k,E,A){m.transform(v,function(){var C=t.apply(this,arguments),S=this.__zoom,L=E==null?w(C):typeof E=="function"?E.apply(this,arguments):E,R=S.invert(L),H=typeof k=="function"?k.apply(this,arguments):k;return n(p(b(S,H),L,R),C,s)},E,A)},m.translateBy=function(v,k,E,A){m.transform(v,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,A)},m.translateTo=function(v,k,E,A,C){m.transform(v,function(){var S=t.apply(this,arguments),L=this.__zoom,R=A==null?w(S):typeof A=="function"?A.apply(this,arguments):A;return n(en.translate(R[0],R[1]).scale(L.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof E=="function"?-E.apply(this,arguments):-E),S,s)},A,C)};function b(v,k){return k=Math.max(i[0],Math.min(i[1],k)),k===v.k?v:new be(k,v.x,v.y)}function p(v,k,E){var A=k[0]-E[0]*v.k,C=k[1]-E[1]*v.k;return A===v.x&&C===v.y?v:new be(v.k,A,C)}function w(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function N(v,k,E,A){v.on("start.zoom",function(){_(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(A).end()}).tween("zoom",function(){var C=this,S=arguments,L=_(C,S).event(A),R=t.apply(C,S),H=E==null?w(R):typeof E=="function"?E.apply(C,S):E,O=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),j=C.__zoom,Y=typeof k=="function"?k.apply(C,S):k,U=c(j.invert(H).concat(O/j.k),Y.invert(H).concat(O/Y.k));return function(q){if(q===1)q=Y;else{var F=U(q),W=O/F[2];q=new be(W,H[0]-F[0]*W,H[1]-F[1]*W)}L.zoom(null,q)}})}function _(v,k,E){return!E&&v.__zooming||new M(v,k)}function M(v,k){this.that=v,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,k),this.taps=0}M.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,k){return this.mouse&&v!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var k=ce(this.that).datum();l.call(v,this.that,new Hl(v,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:l}),k)}};function T(v,...k){if(!e.apply(this,arguments))return;var E=_(this,k).event(v),A=this.__zoom,C=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),S=le(v);if(E.wheel)(E.mouse[0][0]!==S[0]||E.mouse[0][1]!==S[1])&&(E.mouse[1]=A.invert(E.mouse[0]=S)),clearTimeout(E.wheel);else{if(A.k===C)return;E.mouse=[S,A.invert(S)],Ht(this),E.start()}nt(v),E.wheel=setTimeout(L,g),E.zoom("mouse",n(p(b(A,C),E.mouse[0],E.mouse[1]),E.extent,s));function L(){E.wheel=null,E.end()}}function z(v,...k){if(f||!e.apply(this,arguments))return;var E=v.currentTarget,A=_(this,k,!0).event(v),C=ce(v.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",O,!0),S=le(v,E),L=v.clientX,R=v.clientY;$o(v.view),pn(v),A.mouse=[S,this.__zoom.invert(S)],Ht(this),A.start();function H(j){if(nt(j),!A.moved){var Y=j.clientX-L,U=j.clientY-R;A.moved=Y*Y+U*U>y}A.event(j).zoom("mouse",n(p(A.that.__zoom,A.mouse[0]=le(j,E),A.mouse[1]),A.extent,s))}function O(j){C.on("mousemove.zoom mouseup.zoom",null),Po(j.view,A.moved),nt(j),A.event(j).end()}}function B(v,...k){if(e.apply(this,arguments)){var E=this.__zoom,A=le(v.changedTouches?v.changedTouches[0]:v,this),C=E.invert(A),S=E.k*(v.shiftKey?.5:2),L=n(p(b(E,S),A,C),t.apply(this,k),s);nt(v),a>0?ce(this).transition().duration(a).call(N,L,A,v):ce(this).call(m.transform,L,A,v)}}function I(v,...k){if(e.apply(this,arguments)){var E=v.touches,A=E.length,C=_(this,k,v.changedTouches.length===A).event(v),S,L,R,H;for(pn(v),L=0;L<A;++L)R=E[L],H=le(R,this),H=[H,this.__zoom.invert(H),R.identifier],C.touch0?!C.touch1&&C.touch0[2]!==H[2]&&(C.touch1=H,C.taps=0):(C.touch0=H,S=!0,C.taps=1+!!d);d&&(d=clearTimeout(d)),S&&(C.taps<2&&(u=H[0],d=setTimeout(function(){d=null},h)),Ht(this),C.start())}}function $(v,...k){if(this.__zooming){var E=_(this,k).event(v),A=v.changedTouches,C=A.length,S,L,R,H;for(nt(v),S=0;S<C;++S)L=A[S],R=le(L,this),E.touch0&&E.touch0[2]===L.identifier?E.touch0[0]=R:E.touch1&&E.touch1[2]===L.identifier&&(E.touch1[0]=R);if(L=E.that.__zoom,E.touch1){var O=E.touch0[0],j=E.touch0[1],Y=E.touch1[0],U=E.touch1[1],q=(q=Y[0]-O[0])*q+(q=Y[1]-O[1])*q,F=(F=U[0]-j[0])*F+(F=U[1]-j[1])*F;L=b(L,Math.sqrt(q/F)),R=[(O[0]+Y[0])/2,(O[1]+Y[1])/2],H=[(j[0]+U[0])/2,(j[1]+U[1])/2]}else if(E.touch0)R=E.touch0[0],H=E.touch0[1];else return;E.zoom("touch",n(p(L,R,H),E.extent,s))}}function V(v,...k){if(this.__zooming){var E=_(this,k).event(v),A=v.changedTouches,C=A.length,S,L;for(pn(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),S=0;S<C;++S)L=A[S],E.touch0&&E.touch0[2]===L.identifier?delete E.touch0:E.touch1&&E.touch1[2]===L.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(L=le(L,this),Math.hypot(u[0]-L[0],u[1]-L[1])<x)){var R=ce(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return m.wheelDelta=function(v){return arguments.length?(r=typeof v=="function"?v:It(+v),m):r},m.filter=function(v){return arguments.length?(e=typeof v=="function"?v:It(!!v),m):e},m.touchable=function(v){return arguments.length?(o=typeof v=="function"?v:It(!!v),m):o},m.extent=function(v){return arguments.length?(t=typeof v=="function"?v:It([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):t},m.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],m):[i[0],i[1]]},m.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(a=+v,m):a},m.interpolate=function(v){return arguments.length?(c=v,m):c},m.on=function(){var v=l.on.apply(l,arguments);return v===l?m:v},m.clickDistance=function(v){return arguments.length?(y=(v=+v)*v,m):Math.sqrt(y)},m.tapDistance=function(v){return arguments.length?(x=+v,m):x},m}const ye={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ft=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uo=["Enter"," ","Escape"],Ko={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var We;(function(e){e.Strict="strict",e.Loose="loose"})(We||(We={}));var Te;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Te||(Te={}));var dt;(function(e){e.Partial="partial",e.Full="full"})(dt||(dt={}));const Zo={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ce;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ce||(Ce={}));var Yt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Yt||(Yt={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Ir={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Qo(e){return e===null?null:e?"valid":"invalid"}const Jo=e=>"id"in e&&"source"in e&&"target"in e,jl=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xt=(e,t=[0,0])=>{const{width:n,height:r}=Ee(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Xl=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Wn(o)?o:t.nodeLookup.get(o.id));const a=s?Wt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return tn(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nn(n)},wt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=tn(n,Wt(o)),r=!0)}),r?nn(n):{x:0,y:0,width:0,height:0}},qn=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...bt(t,[n,r,o]),width:t.width/o,height:t.height/o},c=[];for(const l of e.values()){const{measured:d,selectable:u=!0,hidden:f=!1}=l;if(s&&!u||f)continue;const h=d.width??l.width??l.initialWidth??null,g=d.height??l.height??l.initialHeight??null,y=ht(a,Ge(l)),x=(h??0)*(g??0),m=i&&y>0;(!l.internals.handleBounds||m||y>=x||l.dragging)&&c.push(l)}return c},Yl=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Wl(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function ql({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Wl(e,s),c=wt(a),l=Gn(c,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(l,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function ei({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let u=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",ye.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(u=[[c,l],[c+h,l+g]])}else a&&Ue(s.extent)&&(u=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const f=Ue(u)?Le(t,u,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",ye.error015())),{position:{x:f.x-c+(s.measured.width??0)*d[0],y:f.y-l+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function Gl({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),g=!h&&f.parentId&&s.find(y=>y.id===f.parentId);(h||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),d=Yl(s,c);for(const f of c)a.has(f.id)&&!d.find(g=>g.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const u=await o({nodes:s,edges:d});return typeof u=="boolean"?u?{edges:d,nodes:s}:{edges:[],nodes:[]}:u}const qe=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Le=(e={x:0,y:0},t,n)=>({x:qe(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:qe(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ti(e,t,n){const{width:r,height:o}=Ee(n),{x:i,y:s}=n.internals.positionAbsolute;return Le(e,[[i,s],[i+r,s+o]],t)}const kr=(e,t,n)=>e<t?qe(Math.abs(e-t),1,t)/t:e>n?-qe(Math.abs(e-n),1,t)/t:0,ni=(e,t,n=15,r=40)=>{const o=kr(e.x,r,t.width-r)*n,i=kr(e.y,r,t.height-r)*n;return[o,i]},tn=(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)}),Tn=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nn=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ge=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Wn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Wt=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Wn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},ri=(e,t)=>nn(tn(Tn(e),Tn(t))),ht=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ar=e=>de(e.width)&&de(e.height)&&de(e.x)&&de(e.y),de=e=>!isNaN(e)&&isFinite(e),Ul=(e,t)=>{},vt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bt=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?vt(a,s):a},qt=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Ve(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Kl(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ve(e,n),o=Ve(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Ve(e.top??e.y??0,n),o=Ve(e.bottom??e.y??0,n),i=Ve(e.left??e.x??0,t),s=Ve(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zl(e,t,n,r,o,i){const{x:s,y:a}=qt(e,[t,n,r]),{x:c,y:l}=qt({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-c,u=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(u)}}const Gn=(e,t,n,r,o,i)=>{const s=Kl(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),d=qe(l,r,o),u=e.x+e.width/2,f=e.y+e.height/2,h=t/2-u*d,g=n/2-f*d,y=Zl(e,h,g,d,t,n),x={left:Math.min(y.left-s.left,0),top:Math.min(y.top-s.top,0),right:Math.min(y.right-s.right,0),bottom:Math.min(y.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:g-x.top+x.bottom,zoom:d}},gt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ue(e){return e!=null&&e!=="parent"}function Ee(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function oi(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function ii(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function $r(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ql(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Jl(e){return{...Ko,...e||{}}}function st(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=he(e),a=bt({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:c,y:l}=n?vt(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const Un=e=>({width:e.offsetWidth,height:e.offsetHeight}),si=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},ef=["INPUT","SELECT","TEXTAREA"];function ai(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:ef.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ci=e=>"clientX"in e,he=(e,t)=>{var i,s;const n=ci(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Pr=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Un(s)}})};function ui({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+o*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+r*.125,d=Math.abs(c-e),u=Math.abs(l-t);return[c,l,d,u]}function kt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tr({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case X.Left:return[t-kt(t-r,i),n];case X.Right:return[t+kt(r-t,i),n];case X.Top:return[t,n-kt(n-o,i)];case X.Bottom:return[t,n+kt(o-n,i)]}}function li({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=Tr({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[l,d]=Tr({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[u,f,h,g]=ui({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:d});return[`M${e},${t} C${a},${c} ${l},${d} ${r},${o}`,u,f,h,g]}function fi({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function tf({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function nf({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=tn(Wt(e),Wt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return ht(s,nn(i))>0}const rf=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,of=(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)),sf=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||rf;let o;return Jo(e)?o={...e}:o={...e,id:r(e)},of(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function di({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=fi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const zr={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},af=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Dr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:o,offset:i,stepPosition:s}){const a=zr[t],c=zr[r],l={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},u=af({source:l,sourcePosition:t,target:d}),f=u.x!==0?"x":"y",h=u[f];let g=[],y,x;const m={x:0,y:0},b={x:0,y:0},[,,p,w]=fi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*c[f]===-1){f==="x"?(y=o.x??l.x+(d.x-l.x)*s,x=o.y??(l.y+d.y)/2):(y=o.x??(l.x+d.x)/2,x=o.y??l.y+(d.y-l.y)*s);const _=[{x:y,y:l.y},{x:y,y:d.y}],M=[{x:l.x,y:x},{x:d.x,y:x}];a[f]===h?g=f==="x"?_:M:g=f==="x"?M:_}else{const _=[{x:l.x,y:d.y}],M=[{x:d.x,y:l.y}];if(f==="x"?g=a.x===h?M:_:g=a.y===h?_:M,t===r){const $=Math.abs(e[f]-n[f]);if($<=i){const V=Math.min(i-1,i-$);a[f]===h?m[f]=(l[f]>e[f]?-1:1)*V:b[f]=(d[f]>n[f]?-1:1)*V}}if(t!==r){const $=f==="x"?"y":"x",V=a[f]===c[$],v=l[$]>d[$],k=l[$]<d[$];(a[f]===1&&(!V&&v||V&&k)||a[f]!==1&&(!V&&k||V&&v))&&(g=f==="x"?_:M)}const T={x:l.x+m.x,y:l.y+m.y},z={x:d.x+b.x,y:d.y+b.y},B=Math.max(Math.abs(T.x-g[0].x),Math.abs(z.x-g[0].x)),I=Math.max(Math.abs(T.y-g[0].y),Math.abs(z.y-g[0].y));B>=I?(y=(T.x+z.x)/2,x=g[0].y):(y=g[0].x,x=(T.y+z.y)/2)}return[[e,{x:l.x+m.x,y:l.y+m.y},...g,{x:d.x+b.x,y:d.y+b.y},n],y,x,p,w]}function uf(e,t,n,r){const o=Math.min(Dr(e,t)/2,Dr(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*l},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+o*c}Q ${i},${s} ${i+o*a},${s}`}function zn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:d=.5}){const[u,f,h,g,y]=cf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:d});return[u.reduce((m,b,p)=>{let w="";return p>0&&p<u.length-1?w=uf(u[p-1],b,u[p+1],s):w=`${p===0?"M":"L"}${b.x} ${b.y}`,m+=w,m},""),f,h,g,y]}function Lr(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function lf(e){var u;const{sourceNode:t,targetNode:n}=e;if(!Lr(t)||!Lr(n))return null;const r=t.internals.handleBounds||Hr(t.handles),o=n.internals.handleBounds||Hr(n.handles),i=Rr((r==null?void 0:r.source)??[],e.sourceHandle),s=Rr(e.connectionMode===We.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(u=e.onError)==null||u.call(e,"008",ye.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||X.Bottom,c=(s==null?void 0:s.position)||X.Top,l=He(t,i,a),d=He(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:c}}function Hr(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function He(e,t,n=X.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ee(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:o+s/2,y:i};case X.Right:return{x:o+s,y:i+a/2};case X.Bottom:return{x:o+s/2,y:i+a};case X.Left:return{x:o,y:i+a/2}}}function Rr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Dn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function ff(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const l=Dn(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const hi=1e3,df=10,Kn={nodeOrigin:[0,0],nodeExtent:ft,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hf={...Kn,checkEquality:!0};function Zn(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function gf(e,t,n){const r=Zn(Kn,n);for(const o of e.values())if(o.parentId)Jn(o,e,t,r);else{const i=xt(o,r.nodeOrigin),s=Ue(o.extent)?o.extent:r.nodeExtent,a=Le(i,s,Ee(o));o.internals.positionAbsolute=a}}function pf(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Qn(e){return e==="manual"}function Ln(e,t,n,r={}){var l,d;const o=Zn(hf,r),i={i:0},s=new Map(t),a=o!=null&&o.elevateNodesOnSelect&&!Qn(o.zIndexMode)?hi:0;let c=e.length>0;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(o.checkEquality&&u===(f==null?void 0:f.internals.userNode))t.set(u.id,f);else{const h=xt(u,o.nodeOrigin),g=Ue(u.extent)?u.extent:o.nodeExtent,y=Le(h,g,Ee(u));f={...o.defaults,...u,measured:{width:(l=u.measured)==null?void 0:l.width,height:(d=u.measured)==null?void 0:d.height},internals:{positionAbsolute:y,handleBounds:pf(u,f),z:gi(u,a,o.zIndexMode),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),u.parentId&&Jn(f,t,n,r,i)}return c}function mf(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Jn(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=Zn(Kn,r),l=e.parentId,d=t.get(l);if(!d){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mf(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*df),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const u=i&&!Qn(c)?hi:0,{x:f,y:h,z:g}=yf(e,d,s,a,u,c),{positionAbsolute:y}=e.internals,x=f!==y.x||h!==y.y;(x||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:h}:y,z:g}})}function gi(e,t,n){const r=de(e.zIndex)?e.zIndex:0;return Qn(n)?r:r+(e.selected?t:0)}function yf(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,c=Ee(e),l=xt(e,n),d=Ue(e.extent)?Le(l,e.extent,c):l;let u=Le({x:s+d.x,y:a+d.y},r,c);e.extent==="parent"&&(u=ti(u,c,t));const f=gi(e,o,i),h=t.internals.z??0;return{x:u.x,y:u.y,z:h>=f?h+1:f}}function er(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const c=t.get(a.parentId);if(!c)continue;const l=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??Ge(c),d=ri(l,a.rect);i.set(a.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:a,parent:c},l)=>{var p;const d=c.internals.positionAbsolute,u=Ee(c),f=c.origin??r,h=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,g=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,y=Math.max(u.width,Math.round(a.width)),x=Math.max(u.height,Math.round(a.height)),m=(y-u.width)*f[0],b=(x-u.height)*f[1];(h>0||g>0||m||b)&&(o.push({id:l,type:"position",position:{x:c.position.x-h+m,y:c.position.y-g+b}}),(p=n.get(l))==null||p.forEach(w=>{e.some(N=>N.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+g}})})),(u.width<a.width||u.height<a.height||h||g)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:y+(h?f[0]*h-m:0),height:x+(g?f[1]*g-b:0)}})}),o}function xf(e,t,n,r,o,i,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const l=[],d=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),c=!0;continue}const y=Un(h.nodeElement),x=g.measured.width!==y.width||g.measured.height!==y.height;if(!!(y.width&&y.height&&(x||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),p=Ue(g.extent)?g.extent:i;let{positionAbsolute:w}=g.internals;g.parentId&&g.extent==="parent"?w=ti(w,y,t.get(g.parentId)):p&&(w=Le(w,p,y));const N={...g,measured:y,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:Pr("source",h.nodeElement,b,u,g.id),target:Pr("target",h.nodeElement,b,u,g.id)}}};t.set(g.id,N),g.parentId&&Jn(N,t,n,{nodeOrigin:o,zIndexMode:s}),c=!0,x&&(l.push({id:g.id,type:"dimensions",dimensions:y}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:Ge(N,o)}))}}if(f.length>0){const h=er(f,t,n,o);l.push(...h)}return{changes:l,updatedInternals:c}}async function wf({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Vr(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),i){s=`${o}-${e}-${i}`;const l=r.get(s)||new Map;r.set(s,l.set(n,t))}}function pi(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,c={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},l=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;Vr("source",c,d,e,o,s),Vr("target",c,l,e,i,a),t.set(r.id,r)}}function mi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:mi(n,t):!1}function Br(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function vf(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!mi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function mn({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,c;const o=[];for(const[l,d]of t){const u=(s=n.get(l))==null?void 0:s.internals.userNode;u&&o.push({...u,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:o[0],o]}function bf({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=vt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function _f({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},d=null,u=!1,f=null,h=!1,g=!1,y=null;function x({noDragClassName:b,handleSelector:p,domNode:w,isSelectable:N,nodeId:_,nodeClickDistance:M=0}){f=ce(w);function T({x:$,y:V}){const{nodeLookup:v,nodeExtent:k,snapGrid:E,snapToGrid:A,nodeOrigin:C,onNodeDrag:S,onSelectionDrag:L,onError:R,updateNodePositions:H}=t();i={x:$,y:V};let O=!1;const j=a.size>1,Y=j&&k?Tn(wt(a)):null,U=j&&A?bf({dragItems:a,snapGrid:E,x:$,y:V}):null;for(const[q,F]of a){if(!v.has(q))continue;let W={x:$-F.distance.x,y:V-F.distance.y};A&&(W=U?{x:Math.round(W.x+U.x),y:Math.round(W.y+U.y)}:vt(W,E));let Q=null;if(j&&k&&!F.extent&&Y){const{positionAbsolute:G}=F.internals,te=G.x-Y.x+k[0][0],ne=G.x+F.measured.width-Y.x2+k[1][0],ee=G.y-Y.y+k[0][1],se=G.y+F.measured.height-Y.y2+k[1][1];Q=[[te,ee],[ne,se]]}const{position:Z,positionAbsolute:K}=ei({nodeId:q,nextPosition:W,nodeLookup:v,nodeExtent:Q||k,nodeOrigin:C,onError:R});O=O||F.position.x!==Z.x||F.position.y!==Z.y,F.position=Z,F.internals.positionAbsolute=K}if(g=g||O,!!O&&(H(a,!0),y&&(r||S||!_&&L))){const[q,F]=mn({nodeId:_,dragItems:a,nodeLookup:v});r==null||r(y,a,q,F),S==null||S(y,q,F),_||L==null||L(y,F)}}async function z(){if(!d)return;const{transform:$,panBy:V,autoPanSpeed:v,autoPanOnNodeDrag:k}=t();if(!k){c=!1,cancelAnimationFrame(s);return}const[E,A]=ni(l,d,v);(E!==0||A!==0)&&(i.x=(i.x??0)-E/$[2],i.y=(i.y??0)-A/$[2],await V({x:E,y:A})&&T(i)),s=requestAnimationFrame(z)}function B($){var j;const{nodeLookup:V,multiSelectionActive:v,nodesDraggable:k,transform:E,snapGrid:A,snapToGrid:C,selectNodesOnDrag:S,onNodeDragStart:L,onSelectionDragStart:R,unselectNodesAndEdges:H}=t();u=!0,(!S||!N)&&!v&&_&&((j=V.get(_))!=null&&j.selected||H()),N&&S&&_&&(e==null||e(_));const O=st($.sourceEvent,{transform:E,snapGrid:A,snapToGrid:C,containerBounds:d});if(i=O,a=vf(V,k,O,_),a.size>0&&(n||L||!_&&R)){const[Y,U]=mn({nodeId:_,dragItems:a,nodeLookup:V});n==null||n($.sourceEvent,a,Y,U),L==null||L($.sourceEvent,Y,U),_||R==null||R($.sourceEvent,U)}}const I=To().clickDistance(M).on("start",$=>{const{domNode:V,nodeDragThreshold:v,transform:k,snapGrid:E,snapToGrid:A}=t();d=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,g=!1,y=$.sourceEvent,v===0&&B($),i=st($.sourceEvent,{transform:k,snapGrid:E,snapToGrid:A,containerBounds:d}),l=he($.sourceEvent,d)}).on("drag",$=>{const{autoPanOnNodeDrag:V,transform:v,snapGrid:k,snapToGrid:E,nodeDragThreshold:A,nodeLookup:C}=t(),S=st($.sourceEvent,{transform:v,snapGrid:k,snapToGrid:E,containerBounds:d});if(y=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||_&&!C.has(_))&&(h=!0),!h){if(!c&&V&&u&&(c=!0,z()),!u){const L=he($.sourceEvent,d),R=L.x-l.x,H=L.y-l.y;Math.sqrt(R*R+H*H)>A&&B($)}(i.x!==S.xSnapped||i.y!==S.ySnapped)&&a&&u&&(l=he($.sourceEvent,d),T(S))}}).on("end",$=>{if(!(!u||h)&&(c=!1,u=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:v,onNodeDragStop:k,onSelectionDragStop:E}=t();if(g&&(v(a,!1),g=!1),o||k||!_&&E){const[A,C]=mn({nodeId:_,dragItems:a,nodeLookup:V,dragging:!1});o==null||o($.sourceEvent,a,A,C),k==null||k($.sourceEvent,A,C),_||E==null||E($.sourceEvent,C)}}}).filter($=>{const V=$.target;return!$.button&&(!b||!Br(V,`.${b}`,w))&&(!p||Br(V,p,w))});f.call(I)}function m(){f==null||f.on(".drag",null)}return{update:x,destroy:m}}function Ef(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ht(o,Ge(i))>0&&r.push(i);return r}const Sf=250;function Nf(e,t,n,r){var a,c;let o=[],i=1/0;const s=Ef(e,n,t+Sf);for(const l of s){const d=[...((a=l.internals.handleBounds)==null?void 0:a.source)??[],...((c=l.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of d){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:f,y:h}=He(l,u,u.position,!0),g=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));g>t||(g<i?(o=[{...u,x:f,y:h}],i=g):g===i&&o.push({...u,x:f,y:h}))}}if(!o.length)return null;if(o.length>1){const l=r.type==="source"?"target":"source";return o.find(d=>d.type===l)??o[0]}return o[0]}function yi(e,t,n,r,o,i=!1){var l,d,u;const s=r.get(e);if(!s)return null;const a=o==="strict"?(l=s.internals.handleBounds)==null?void 0:l[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((u=s.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return c&&i?{...c,...He(s,c,c.position,!0)}:c}function xi(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Mf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const wi=()=>!0;function Cf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:d,flowId:u,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:y,onConnectEnd:x,isValidConnection:m=wi,onReconnectEnd:b,updateConnection:p,getTransform:w,getFromHandle:N,autoPanSpeed:_,dragThreshold:M=1,handleDomNode:T}){const z=si(e.target);let B=0,I;const{x:$,y:V}=he(e),v=xi(i,T),k=a==null?void 0:a.getBoundingClientRect();let E=!1;if(!k||!v)return;const A=yi(o,v,r,c,t);if(!A)return;let C=he(e,k),S=!1,L=null,R=!1,H=null;function O(){if(!d||!k)return;const[Z,K]=ni(C,k,_);f({x:Z,y:K}),B=requestAnimationFrame(O)}const j={...A,nodeId:o,type:v,position:A.position},Y=c.get(o);let q={inProgress:!0,isValid:null,from:He(Y,j,X.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:Y,to:C,toHandle:null,toPosition:Ir[j.position],toNode:null,pointer:C};function F(){E=!0,p(q),g==null||g(e,{nodeId:o,handleId:r,handleType:v})}M===0&&F();function W(Z){if(!E){const{x:se,y:Se}=he(Z),we=se-$,ke=Se-V;if(!(we*we+ke*ke>M*M))return;F()}if(!N()||!j){Q(Z);return}const K=w();C=he(Z,k),I=Nf(bt(C,K,!1,[1,1]),n,c,j),S||(O(),S=!0);const G=vi(Z,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:z,lib:l,flowId:u,nodeLookup:c});H=G.handleDomNode,L=G.connection,R=Mf(!!I,G.isValid);const te=c.get(o),ne=te?He(te,j,X.Left,!0):q.from,ee={...q,from:ne,isValid:R,to:G.toHandle&&R?qt({x:G.toHandle.x,y:G.toHandle.y},K):C,toHandle:G.toHandle,toPosition:R&&G.toHandle?G.toHandle.position:Ir[j.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:C};p(ee),q=ee}function Q(Z){if(!("touches"in Z&&Z.touches.length>0)){if(E){(I||H)&&L&&R&&(y==null||y(L));const{inProgress:K,...G}=q,te={...G,toPosition:q.toHandle?q.toPosition:null};x==null||x(Z,te),i&&(b==null||b(Z,te))}h(),cancelAnimationFrame(B),S=!1,R=!1,L=null,H=null,z.removeEventListener("mousemove",W),z.removeEventListener("mouseup",Q),z.removeEventListener("touchmove",W),z.removeEventListener("touchend",Q)}}z.addEventListener("mousemove",W),z.addEventListener("mouseup",Q),z.addEventListener("touchmove",W),z.addEventListener("touchend",Q)}function vi(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=wi,nodeLookup:d}){const u=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:g}=he(e),y=s.elementFromPoint(h,g),x=y!=null&&y.classList.contains(`${a}-flow__handle`)?y:f,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const b=xi(void 0,x),p=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!p||!b)return m;const M={source:u?p:r,sourceHandle:u?w:o,target:u?r:p,targetHandle:u?o:w};m.connection=M;const z=N&&_&&(n===We.Strict?u&&b==="source"||!u&&b==="target":p!==r||w!==o);m.isValid=z&&l(M),m.toHandle=yi(p,b,w,d,n,!0)}return m}const Hn={onPointerDown:Cf,isValid:vi};function If({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=ce(e);function i({translateExtent:a,width:c,height:l,zoomStep:d=1,pannable:u=!0,zoomable:f=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=p.sourceEvent.ctrlKey&&gt()?10:1,_=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*d,M=w[2]*Math.pow(2,_*N);t.scaleTo(M)};let y=[0,0];const x=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(y=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const w=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const N=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],_=[N[0]-y[0],N[1]-y[1]];y=N;const M=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),T={x:w[0]-_[0]*M,y:w[1]-_[1]*M},z=[[0,0],[c,l]];t.setViewportConstrained({x:T.x,y:T.y,zoom:w[2]},z,a)},b=Go().on("start",x).on("zoom",u?m:null).on("zoom.wheel",f?g:null);o.call(b,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:le}}const rn=e=>({x:e.x,y:e.y,zoom:e.k}),yn=({x:e,y:t,zoom:n})=>en.translate(e,t).scale(n),Be=(e,t)=>e.target.closest(`.${t}`),bi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,xn=(e,t=0,n=kf,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},_i=e=>{const t=e.ctrlKey&&gt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Af({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return d=>{if(Be(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(d.ctrlKey&&s){const x=le(d),m=_i(d),b=u*Math.pow(2,m);r.scaleTo(n,b,x,d);return}const f=d.deltaMode===1?20:1;let h=o===Te.Vertical?0:d.deltaX*f,g=o===Te.Horizontal?0:d.deltaY*f;!gt()&&d.shiftKey&&o!==Te.Vertical&&(h=d.deltaY*f,g=0),r.translateBy(n,-(h/u)*i,-(g/u)*i,{internal:!0});const y=rn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,y),e.panScrollTimeout=setTimeout(()=>{l==null||l(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,y))}}function $f({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=Be(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function Pf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=rn(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function Tf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&bi(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,rn(i.transform)))}}function zf({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&bi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const c=rn(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,c)},n?150:0)}}}function Df({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:l,connectionInProgress:d}){return u=>{var x;const f=e||t,h=n&&u.ctrlKey,g=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(Be(u,`${l}-flow__node`)||Be(u,`${l}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!g||Be(u,a)&&g||Be(u,c)&&(!g||o&&g&&!e)||!n&&u.ctrlKey&&g)return!1;if(!n&&u.type==="touchstart"&&((x=u.touches)==null?void 0:x.length)>1)return u.preventDefault(),!1;if(!f&&!o&&!h&&g||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||g)&&y}}function Lf({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),u=Go().scaleExtent([t,n]).translateExtent(r),f=ce(e).call(u);b({x:o.x,y:o.y,zoom:qe(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const h=f.on("wheel.zoom"),g=f.on("dblclick.zoom");u.wheelDelta(_i);function y(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).transform(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function x({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:V,userSelectionActive:v,panOnScroll:k,panOnDrag:E,panOnScrollMode:A,panOnScrollSpeed:C,preventScrolling:S,zoomOnPinch:L,zoomOnScroll:R,zoomOnDoubleClick:H,zoomActivationKeyPressed:O,lib:j,onTransformChange:Y,connectionInProgress:U,paneClickDistance:q,selectionOnDrag:F}){v&&!l.isZoomingOrPanning&&m();const W=k&&!O&&!v;u.clickDistance(F?1/0:!de(q)||q<0?0:q);const Q=W?Af({zoomPanValues:l,noWheelClassName:I,d3Selection:f,d3Zoom:u,panOnScrollMode:A,panOnScrollSpeed:C,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):$f({noWheelClassName:I,preventScrolling:S,d3ZoomHandler:h});if(f.on("wheel.zoom",Q,{passive:!1}),!v){const K=Pf({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});u.on("start",K);const G=Tf({zoomPanValues:l,panOnDrag:E,onPaneContextMenu:!!V,onPanZoom:i,onTransformChange:Y});u.on("zoom",G);const te=zf({zoomPanValues:l,panOnDrag:E,panOnScroll:k,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:c});u.on("end",te)}const Z=Df({zoomActivationKeyPressed:O,panOnDrag:E,zoomOnScroll:R,panOnScroll:k,zoomOnDoubleClick:H,zoomOnPinch:L,userSelectionActive:v,noPanClassName:$,noWheelClassName:I,lib:j,connectionInProgress:U});u.filter(Z),H?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function m(){u.on("zoom",null)}async function b(I,$,V){const v=yn(I),k=u==null?void 0:u.constrain()(v,$,V);return k&&await y(k),new Promise(E=>E(k))}async function p(I,$){const V=yn(I);return await y(V,$),new Promise(v=>v(V))}function w(I){if(f){const $=yn(I),V=f.property("__zoom");(V.k!==I.zoom||V.x!==I.x||V.y!==I.y)&&(u==null||u.transform(f,$,null,{sync:!0}))}}function N(){const I=f?qo(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function _(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).scaleTo(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function M(I,$){return f?new Promise(V=>{u==null||u.interpolate(($==null?void 0:$.interpolate)==="linear"?it:zt).scaleBy(xn(f,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function T(I){u==null||u.scaleExtent(I)}function z(I){u==null||u.translateExtent(I)}function B(I){const $=!de(I)||I<0?0:I;u==null||u.clickDistance($)}return{update:x,destroy:m,setViewport:p,setViewportConstrained:b,getViewport:N,scaleTo:_,scaleBy:M,setScaleExtent:T,setTranslateExtent:z,syncViewport:w,setClickDistance:B}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function Hf({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,a=n-r,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&o&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Fr(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Ne(e,t){return Math.max(0,t-e)}function Me(e,t){return Math.max(0,e-t)}function At(e,t,n){return Math.max(0,t-e,e-n)}function Or(e,t){return e?!t:t}function Rf(e,t,n,r,o,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:d,isVertical:u}=t,f=d&&u,{xSnapped:h,ySnapped:g}=n,{minWidth:y,maxWidth:x,minHeight:m,maxHeight:b}=r,{x:p,y:w,width:N,height:_,aspectRatio:M}=e;let T=Math.floor(d?h-e.pointerX:0),z=Math.floor(u?g-e.pointerY:0);const B=N+(c?-T:T),I=_+(l?-z:z),$=-i[0]*N,V=-i[1]*_;let v=At(B,y,x),k=At(I,m,b);if(s){let C=0,S=0;c&&T<0?C=Ne(p+T+$,s[0][0]):!c&&T>0&&(C=Me(p+B+$,s[1][0])),l&&z<0?S=Ne(w+z+V,s[0][1]):!l&&z>0&&(S=Me(w+I+V,s[1][1])),v=Math.max(v,C),k=Math.max(k,S)}if(a){let C=0,S=0;c&&T>0?C=Me(p+T,a[0][0]):!c&&T<0&&(C=Ne(p+B,a[1][0])),l&&z>0?S=Me(w+z,a[0][1]):!l&&z<0&&(S=Ne(w+I,a[1][1])),v=Math.max(v,C),k=Math.max(k,S)}if(o){if(d){const C=At(B/M,m,b)*M;if(v=Math.max(v,C),s){let S=0;!c&&!l||c&&!l&&f?S=Me(w+V+B/M,s[1][1])*M:S=Ne(w+V+(c?T:-T)/M,s[0][1])*M,v=Math.max(v,S)}if(a){let S=0;!c&&!l||c&&!l&&f?S=Ne(w+B/M,a[1][1])*M:S=Me(w+(c?T:-T)/M,a[0][1])*M,v=Math.max(v,S)}}if(u){const C=At(I*M,y,x)/M;if(k=Math.max(k,C),s){let S=0;!c&&!l||l&&!c&&f?S=Me(p+I*M+$,s[1][0])/M:S=Ne(p+(l?z:-z)*M+$,s[0][0])/M,k=Math.max(k,S)}if(a){let S=0;!c&&!l||l&&!c&&f?S=Ne(p+I*M,a[1][0])/M:S=Me(p+(l?z:-z)*M,a[0][0])/M,k=Math.max(k,S)}}}z=z+(z<0?k:-k),T=T+(T<0?v:-v),o&&(f?B>I*M?z=(Or(c,l)?-T:T)/M:T=(Or(c,l)?-z:z)*M:d?(z=T/M,l=c):(T=z*M,c=l));const E=c?p+T:p,A=l?w+z:w;return{width:N+(c?-T:T),height:_+(l?-z:z),x:i[0]*T*(c?-1:1)+E,y:i[1]*z*(l?-1:1)+A}}const Ei={width:0,height:0,x:0,y:0},Vf={...Ei,pointerX:0,pointerY:0,aspectRatio:1};function Bf(e){return[[0,0],[e.measured.width,e.measured.height]]}function Ff(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[r-a,o-c],[r+i-a,o+s-c]]}function Of({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=ce(e);let s={controlDirection:Fr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:d,keepAspectRatio:u,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:y,shouldResize:x}){let m={...Ei},b={...Vf};s={boundaries:d,resizeDirection:f,keepAspectRatio:u,controlDirection:Fr(l)};let p,w=null,N=[],_,M,T,z=!1;const B=To().on("start",I=>{const{nodeLookup:$,transform:V,snapGrid:v,snapToGrid:k,nodeOrigin:E,paneDomNode:A}=n();if(p=$.get(t),!p)return;w=(A==null?void 0:A.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:S}=st(I.sourceEvent,{transform:V,snapGrid:v,snapToGrid:k,containerBounds:w});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...m,pointerX:C,pointerY:S,aspectRatio:m.width/m.height},_=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(_=$.get(p.parentId),M=_&&p.extent==="parent"?Bf(_):void 0),N=[],T=void 0;for(const[L,R]of $)if(R.parentId===t&&(N.push({id:L,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const H=Ff(R,p,R.origin??E);T?T=[[Math.min(H[0][0],T[0][0]),Math.min(H[0][1],T[0][1])],[Math.max(H[1][0],T[1][0]),Math.max(H[1][1],T[1][1])]]:T=H}h==null||h(I,{...m})}).on("drag",I=>{const{transform:$,snapGrid:V,snapToGrid:v,nodeOrigin:k}=n(),E=st(I.sourceEvent,{transform:$,snapGrid:V,snapToGrid:v,containerBounds:w}),A=[];if(!p)return;const{x:C,y:S,width:L,height:R}=m,H={},O=p.origin??k,{width:j,height:Y,x:U,y:q}=Rf(b,s.controlDirection,E,s.boundaries,s.keepAspectRatio,O,M,T),F=j!==L,W=Y!==R,Q=U!==C&&F,Z=q!==S&&W;if(!Q&&!Z&&!F&&!W)return;if((Q||Z||O[0]===1||O[1]===1)&&(H.x=Q?U:m.x,H.y=Z?q:m.y,m.x=H.x,m.y=H.y,N.length>0)){const ne=U-C,ee=q-S;for(const se of N)se.position={x:se.position.x-ne+O[0]*(j-L),y:se.position.y-ee+O[1]*(Y-R)},A.push(se)}if((F||W)&&(H.width=F&&(!s.resizeDirection||s.resizeDirection==="horizontal")?j:m.width,H.height=W&&(!s.resizeDirection||s.resizeDirection==="vertical")?Y:m.height,m.width=H.width,m.height=H.height),_&&p.expandParent){const ne=O[0]*(H.width??0);H.x&&H.x<ne&&(m.x=ne,b.x=b.x-(H.x-ne));const ee=O[1]*(H.height??0);H.y&&H.y<ee&&(m.y=ee,b.y=b.y-(H.y-ee))}const K=Hf({width:m.width,prevWidth:L,height:m.height,prevHeight:R,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:K};(x==null?void 0:x(I,G))!==!1&&(z=!0,g==null||g(I,G),r(H,A))}).on("end",I=>{z&&(y==null||y(I,{...m}),o==null||o({...m}),z=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}var wn={exports:{}},vn={},bn={exports:{}},_n={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-D3wnucQC.js";/**
1
+ import{c as e}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-D3wnucQC.js";/**
1
+ import{c as a}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{R as te,j as r,ba as Ye,c as le,r as R,t as q,u as Ht,a as Ot,aL as Ze,L as qt,f as Ut,l as Vt,S as Ge,d as Qt,e as Yt}from"./index-D3wnucQC.js";import{T as Zt}from"./TrustBadge-D5CGp0cu.js";import{R as Gt,G as Xt}from"./AiBuildResult-xKtGthWv.js";import{W as Kt}from"./wrench-1m0_kcza.js";const Jt={value:"Value",block:"Certified block",term:"Business term",metric:"Metric",dimension:"Dimension",model:"dbt model",source:"Source table",consumer:"Used by"};function Xe(e){const t=(e??"").toLowerCase();return t==="certified"?"success":t==="deprecated"?"neutral":t.includes("review")||t==="draft"||t==="pending"?"warning":"neutral"}function Ct({walk:e,defaultOpen:t=!1,triggerLabel:n}){const[o,i]=te.useState(t),s=Math.min(e.steps.length,2),[l,c]=te.useState(s),a=()=>c(s),d=e.steps.slice(0,l),u=e.steps.length-l;return r.jsxs("div",{style:{border:"1px solid var(--border-subtle, rgba(127,127,127,0.25))",borderRadius:8,background:"var(--bg-1, transparent)",overflow:"hidden"},children:[r.jsxs("button",{type:"button","aria-expanded":o,onClick:()=>{i(f=>!f),o&&a()},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,border:0,background:"transparent",color:"var(--text-secondary, inherit)",cursor:"pointer",padding:"8px 11px",font:"inherit",fontSize:12,fontWeight:700},children:[r.jsxs("span",{style:{display:"flex",alignItems:"center",gap:7},children:[r.jsx("span",{"aria-hidden":!0,style:{transform:o?"rotate(90deg)":"none",transition:"transform 120ms",display:"inline-block"},children:"▸"}),n??"Why?"]}),r.jsx("span",{style:{fontSize:11,color:"var(--text-tertiary, inherit)",fontWeight:600},children:o?"Hide derivation":"Show how this was derived"})]}),o&&r.jsxs("div",{style:{padding:"2px 11px 11px",display:"flex",flexDirection:"column",gap:10},children:[r.jsx("div",{style:{fontSize:12.5,lineHeight:1.5,color:"var(--text-primary, inherit)"},children:e.summary}),(e.trustLabel||e.freshness)&&r.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[e.trustLabel&&r.jsx(Ye,{tone:Xe(e.trustLabel),children:Ke(e.trustLabel)}),e.freshness&&r.jsxs("span",{style:{fontSize:11,color:"var(--text-tertiary, inherit)"},children:["Fresh as of ",en(e.freshness)]})]}),r.jsx("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:7},children:d.map((f,h)=>r.jsxs("li",{style:{display:"flex",gap:9,alignItems:"flex-start",paddingLeft:2},children:[r.jsx("span",{"aria-hidden":!0,style:{marginTop:3,width:7,height:7,borderRadius:999,flexShrink:0,background:"var(--accent, currentColor)",opacity:.7}}),r.jsxs("div",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:2},children:[r.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[r.jsx("span",{style:{fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--text-tertiary, inherit)"},children:Jt[f.kind]}),r.jsx("span",{style:{fontSize:12.5,fontWeight:700,color:"var(--text-primary, inherit)",overflowWrap:"anywhere"},children:f.name}),f.status&&r.jsx(Ye,{tone:Xe(f.status),children:Ke(f.status)})]}),(f.owner||f.detail)&&r.jsxs("div",{style:{fontSize:11.5,color:"var(--text-secondary, inherit)",lineHeight:1.45},children:[f.owner&&r.jsxs("span",{children:["Owner: ",f.owner,". "]}),f.detail]})]})]},`${f.kind}-${f.name}-${h}`))}),u>0&&r.jsxs("button",{type:"button",onClick:()=>c(f=>Math.min(e.steps.length,f+1)),style:{alignSelf:"flex-start",border:"1px solid var(--border-default, rgba(127,127,127,0.3))",borderRadius:6,background:"transparent",color:"var(--accent, inherit)",cursor:"pointer",padding:"4px 9px",fontSize:11,fontWeight:700},children:["Show next step (",u," more)"]}),e.caveats&&e.caveats.length>0&&r.jsxs("div",{style:{borderLeft:"3px solid var(--status-warning, #d29922)",background:"var(--status-warning-bg, rgba(210,153,34,0.08))",borderRadius:6,padding:"8px 10px",display:"flex",flexDirection:"column",gap:4},children:[r.jsx("span",{style:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--status-warning, inherit)"},children:"Caveats"}),e.caveats.map((f,h)=>r.jsx("span",{style:{fontSize:11.5,color:"var(--text-secondary, inherit)",lineHeight:1.45},children:f},h))]})]})]})}function Ke(e){return e.replace(/[_-]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function en(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}/**
1
+ import{R as te,j as r,ba as Ye,c as le,r as R,t as q,u as Ht,a as Ot,aL as Ze,L as qt,f as Ut,l as Vt,S as Ge,d as Qt,e as Yt}from"./index-C9KfoqCR.js";import{T as Zt}from"./TrustBadge-D1CGSj0Y.js";import{R as Gt,G as Xt}from"./AiBuildResult-BImB4Wej.js";import{W as Kt}from"./wrench-QNiznShi.js";const Jt={value:"Value",block:"Certified block",term:"Business term",metric:"Metric",dimension:"Dimension",model:"dbt model",source:"Source table",consumer:"Used by"};function Xe(e){const t=(e??"").toLowerCase();return t==="certified"?"success":t==="deprecated"?"neutral":t.includes("review")||t==="draft"||t==="pending"?"warning":"neutral"}function Ct({walk:e,defaultOpen:t=!1,triggerLabel:n}){const[o,i]=te.useState(t),s=Math.min(e.steps.length,2),[l,c]=te.useState(s),a=()=>c(s),d=e.steps.slice(0,l),u=e.steps.length-l;return r.jsxs("div",{style:{border:"1px solid var(--border-subtle, rgba(127,127,127,0.25))",borderRadius:8,background:"var(--bg-1, transparent)",overflow:"hidden"},children:[r.jsxs("button",{type:"button","aria-expanded":o,onClick:()=>{i(f=>!f),o&&a()},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,border:0,background:"transparent",color:"var(--text-secondary, inherit)",cursor:"pointer",padding:"8px 11px",font:"inherit",fontSize:12,fontWeight:700},children:[r.jsxs("span",{style:{display:"flex",alignItems:"center",gap:7},children:[r.jsx("span",{"aria-hidden":!0,style:{transform:o?"rotate(90deg)":"none",transition:"transform 120ms",display:"inline-block"},children:"▸"}),n??"Why?"]}),r.jsx("span",{style:{fontSize:11,color:"var(--text-tertiary, inherit)",fontWeight:600},children:o?"Hide derivation":"Show how this was derived"})]}),o&&r.jsxs("div",{style:{padding:"2px 11px 11px",display:"flex",flexDirection:"column",gap:10},children:[r.jsx("div",{style:{fontSize:12.5,lineHeight:1.5,color:"var(--text-primary, inherit)"},children:e.summary}),(e.trustLabel||e.freshness)&&r.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[e.trustLabel&&r.jsx(Ye,{tone:Xe(e.trustLabel),children:Ke(e.trustLabel)}),e.freshness&&r.jsxs("span",{style:{fontSize:11,color:"var(--text-tertiary, inherit)"},children:["Fresh as of ",en(e.freshness)]})]}),r.jsx("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:7},children:d.map((f,h)=>r.jsxs("li",{style:{display:"flex",gap:9,alignItems:"flex-start",paddingLeft:2},children:[r.jsx("span",{"aria-hidden":!0,style:{marginTop:3,width:7,height:7,borderRadius:999,flexShrink:0,background:"var(--accent, currentColor)",opacity:.7}}),r.jsxs("div",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:2},children:[r.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[r.jsx("span",{style:{fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--text-tertiary, inherit)"},children:Jt[f.kind]}),r.jsx("span",{style:{fontSize:12.5,fontWeight:700,color:"var(--text-primary, inherit)",overflowWrap:"anywhere"},children:f.name}),f.status&&r.jsx(Ye,{tone:Xe(f.status),children:Ke(f.status)})]}),(f.owner||f.detail)&&r.jsxs("div",{style:{fontSize:11.5,color:"var(--text-secondary, inherit)",lineHeight:1.45},children:[f.owner&&r.jsxs("span",{children:["Owner: ",f.owner,". "]}),f.detail]})]})]},`${f.kind}-${f.name}-${h}`))}),u>0&&r.jsxs("button",{type:"button",onClick:()=>c(f=>Math.min(e.steps.length,f+1)),style:{alignSelf:"flex-start",border:"1px solid var(--border-default, rgba(127,127,127,0.3))",borderRadius:6,background:"transparent",color:"var(--accent, inherit)",cursor:"pointer",padding:"4px 9px",fontSize:11,fontWeight:700},children:["Show next step (",u," more)"]}),e.caveats&&e.caveats.length>0&&r.jsxs("div",{style:{borderLeft:"3px solid var(--status-warning, #d29922)",background:"var(--status-warning-bg, rgba(210,153,34,0.08))",borderRadius:6,padding:"8px 10px",display:"flex",flexDirection:"column",gap:4},children:[r.jsx("span",{style:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--status-warning, inherit)"},children:"Caveats"}),e.caveats.map((f,h)=>r.jsx("span",{style:{fontSize:11.5,color:"var(--text-secondary, inherit)",lineHeight:1.45},children:f},h))]})]})]})}function Ke(e){return e.replace(/[_-]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function en(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-D3wnucQC.js";/**
1
+ import{c as a}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-D3wnucQC.js";/**
1
+ import{c as a}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-D3wnucQC.js";/**
1
+ import{c as e}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-D3wnucQC.js";/**
1
+ import{c}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-D3wnucQC.js";/**
1
+ import{c as o}from"./index-C9KfoqCR.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Kalam:wght@400;700&family=Caveat:wght@400;600;700&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-D3wnucQC.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-C9KfoqCR.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/react-CRB3T2We.js">
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-B_kaoARS.css">
13
13
  </head>